]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/currentuserdesignaction.php
change Laconica and Control Yourself to StatusNet in PHP files
[quix0rs-gnu-social.git] / lib / currentuserdesignaction.php
index 2975256557dd72dda104664b7919363c266307b6..8323eeccb76b11e5f08131678cc8dcdd0d1b6969 100644 (file)
@@ -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,9 +20,9 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  * @category  Action
- * @package   Laconica
+ * @package   StatusNet
  * @author    Evan Prodromou <evan@controlyourself.ca>
- * @copyright 2009 Control Yourself, Inc.
+ * @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/
  */
@@ -38,7 +38,7 @@ if (!defined('LACONICA')) {
  * design. This superclass returns that design.
  *
  * @category Action
- * @package  Laconica
+ * @package  StatusNet
  * @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/
@@ -50,8 +50,7 @@ class CurrentUserDesignAction extends Action
     /**
      * 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
      */
@@ -60,10 +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();
     }
 }