diff options
author | Zach Copley <zach@controlyourself.ca> | 2009-06-17 18:49:25 -0700 |
---|---|---|
committer | Zach Copley <zach@controlyourself.ca> | 2009-06-17 18:49:25 -0700 |
commit | 6c7bdf9df67d02d26d3052e7fba5a80c482aacb8 (patch) | |
tree | 41bb18e5c8e3d873aefaf3a07bf9fd287f2aaeed /lib/currentuserdesignaction.php | |
parent | 85b4c24188502ce3f8cef32cfba37ab91c8a648f (diff) | |
parent | 00736bddd199b2a43820367c3476b9e9ec84c0db (diff) |
Merge branch 'userdesign' into 0.8.x
* userdesign: (56 commits)
Fix for background image repetition for various page heights
Removed height:100% for better background image repetition
A little more specific selector for notice reply
Have user favorites page show user's design
Placed a check to make sure there is a reply button in a notice before
Make MailboxAction read only
Remove stale reference to deprecated personal.php
Uppercase hex color values
Default to image being on, no tile after upload
Fix sidebar color bug default design
Update background image settings to use bitflags
It was accidently removed
Dynamically tile background image and turn background image on or off
Show a background img in settings form
IE7/8 CSS update for user design
Enable tiling of background imgs for Designs
Added background image tile flag to Design
Init styles for tile and image use on/off for user design settings
Added form option to tile background image and to turn it on and off
Add background dir
...
Diffstat (limited to 'lib/currentuserdesignaction.php')
-rw-r--r-- | lib/currentuserdesignaction.php | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/lib/currentuserdesignaction.php b/lib/currentuserdesignaction.php new file mode 100644 index 000000000..7c2520cf6 --- /dev/null +++ b/lib/currentuserdesignaction.php @@ -0,0 +1,88 @@ +<?php +/** + * Laconica, the distributed open-source microblogging tool + * + * Base class for actions that use the current user's design + * + * PHP version 5 + * + * LICENCE: This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @category Action + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @copyright 2009 Control Yourself, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + */ + +if (!defined('LACONICA')) { + exit(1); +} + +/** + * Base class for actions that use the current user's design + * + * Some pages (settings in particular) use the current user's chosen + * design. This superclass returns that design. + * + * @category Action + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + * + */ + +class CurrentUserDesignAction extends Action +{ + + /** + * Show the user's design stylesheet + * + * @return nothing + */ + function showStylesheets() + { + parent::showStylesheets(); + + $design = $this->getDesign(); + + if (!empty($design)) { + $design->showCSS($this); + } + } + + /** + * A design for this action + * + * if the user attribute has been set, returns that user's + * design. + * + * @return Design a design object to use + */ + + function getDesign() + { + $cur = common_current_user(); + + if (empty($cur)) { + return null; + } + + return $cur->getDesign(); + } + + +} |