summaryrefslogtreecommitdiff
path: root/lib/currentuserdesignaction.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/currentuserdesignaction.php')
-rw-r--r--lib/currentuserdesignaction.php55
1 files changed, 18 insertions, 37 deletions
diff --git a/lib/currentuserdesignaction.php b/lib/currentuserdesignaction.php
index 4c7e15a8b..c2f38cd00 100644
--- a/lib/currentuserdesignaction.php
+++ b/lib/currentuserdesignaction.php
@@ -1,6 +1,6 @@
<?php
/**
- * Laconica, the distributed open-source microblogging tool
+ * StatusNet, the distributed open-source microblogging tool
*
* Base class for actions that use the current user's design
*
@@ -20,14 +20,14 @@
* 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.
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @copyright 2009 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
exit(1);
}
@@ -38,42 +38,19 @@ if (!defined('LACONICA')) {
* design. This superclass returns that design.
*
* @category Action
- * @package Laconica
- * @author Evan Prodromou <evan@controlyourself.ca>
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*
*/
class CurrentUserDesignAction extends Action
{
-
- /**
- * Show the user's design stylesheet
- *
- * @return nothing
- */
-
- function showStylesheets()
- {
- parent::showStylesheets();
-
- $user = common_current_user();
-
- if (empty($user) || $user->viewdesigns) {
- $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.
+ * Returns the design preferences for the current user.
*
* @return Design a design object to use
*/
@@ -82,11 +59,15 @@ class CurrentUserDesignAction extends Action
{
$cur = common_current_user();
- if (empty($cur)) {
- return null;
+ if (!empty($cur)) {
+
+ $design = $cur->getDesign();
+
+ if (!empty($design)) {
+ return $design;
+ }
}
- return $cur->getDesign();
+ return parent::getDesign();
}
-
}