Design class now uses WebColor class for outputting hex colors
This commit is contained in:
parent
ef99f83963
commit
4652f316cf
@ -17,13 +17,16 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('LACONICA')) { exit(1); }
|
if (!defined('LACONICA')) {
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Table Definition for design
|
* Table Definition for design
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
|
require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
|
||||||
|
require_once INSTALLDIR . '/lib/webcolor.php';
|
||||||
|
|
||||||
class Design extends Memcached_DataObject
|
class Design extends Memcached_DataObject
|
||||||
{
|
{
|
||||||
@ -47,11 +50,25 @@ class Design extends Memcached_DataObject
|
|||||||
|
|
||||||
function showCSS($out)
|
function showCSS($out)
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
$bgcolor = new WebColor($this->backgroundcolor);
|
||||||
|
$ccolor = new WebColor($this->contentcolor);
|
||||||
|
$sbcolor = new WebColor($this->sidebarcolor);
|
||||||
|
$tcolor = new WebColor($this->textcolor);
|
||||||
|
$lcolor = new WebColor($this->linkcolor);
|
||||||
|
|
||||||
|
} catch (WebColorException $e) {
|
||||||
|
// This shouldn't happen
|
||||||
|
common_log(LOG_ERR, "Unable to create color for design $id.",
|
||||||
|
__FILE__);
|
||||||
|
}
|
||||||
|
|
||||||
$out->element('style', array('type' => 'text/css'),
|
$out->element('style', array('type' => 'text/css'),
|
||||||
'body { background-color: #' . dechex($this->backgroundcolor) . '} '."\n".
|
'body { background-color: #' . $bgcolor->hexValue() . '} '."\n".
|
||||||
'#content { background-color #' . dechex($this->contentcolor) . '} '."\n".
|
'#content { background-color #' . $ccolor->hexValue() . '} '."\n".
|
||||||
'#aside_primary { background-color #'. dechex($this->sidebarcolor) .'} '."\n".
|
'#aside_primary { background-color #'. $sbcolor->hexValue() .'} '."\n".
|
||||||
'html body { color: #'. dechex($this->textcolor) .'} '."\n".
|
'html body { color: #'. $tcolor->hexValue() .'} '."\n".
|
||||||
'a { color: #' . dechex($this->linkcolor) . '} '."\n");
|
'a { color: #' . $lcolor->hexValue() . '} '."\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user