Output custom stylesheets on design sub-Actions

This commit is contained in:
Zach Copley 2009-06-15 22:13:35 -07:00
parent 44343986c3
commit ef99f83963
3 changed files with 30 additions and 1 deletions

View File

@ -47,7 +47,7 @@ class Design extends Memcached_DataObject
function showCSS($out)
{
$out->element('stylesheet', array('type' => 'text/css'),
$out->element('style', array('type' => 'text/css'),
'body { background-color: #' . dechex($this->backgroundcolor) . '} '."\n".
'#content { background-color #' . dechex($this->contentcolor) . '} '."\n".
'#aside_primary { background-color #'. dechex($this->sidebarcolor) .'} '."\n".

View File

@ -47,6 +47,20 @@ if (!defined('LACONICA')) {
class CurrentUserDesignAction extends Action
{
/**
* Show the user's design stylesheet
*
* @return nothing
*/
function showStylesheets()
{
parent::showStylesheets();
$design = $this->getDesign();
$design->showCSS($this);
}
/**
* A design for this action
*
@ -66,4 +80,6 @@ class CurrentUserDesignAction extends Action
return $cur->getDesign();
}
}

View File

@ -52,6 +52,19 @@ class OwnerDesignAction extends Action {
var $user = null;
/**
* Show the owner's design stylesheet
*
* @return nothing
*/
function showStylesheets()
{
parent::showStylesheets();
$design = $this->getDesign();
$design->showCSS($this);
}
/**
* A design for this action
*