X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fcurrentuserdesignaction.php;h=e84c77768569d0f13d9bdffc3b66b1f3d3ddb6fc;hb=a3c4dca90dd2eec92ff600393d09204ba10df230;hp=874e3ff9825f965ec4e91afded655489f8791aeb;hpb=ae883ceb9b4689f6c1dd3aecdc4a844eda7d179a;p=quix0rs-gnu-social.git diff --git a/lib/currentuserdesignaction.php b/lib/currentuserdesignaction.php index 874e3ff982..e84c777685 100644 --- a/lib/currentuserdesignaction.php +++ b/lib/currentuserdesignaction.php @@ -22,12 +22,12 @@ * @category Action * @package StatusNet * @author Evan Prodromou - * @copyright 2009 StatusNet, Inc. + * @copyright 2009-2010 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -40,13 +40,33 @@ if (!defined('LACONICA')) { * @category Action * @package StatusNet * @author Evan Prodromou + * @author Zach Copley * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ * */ - class CurrentUserDesignAction extends Action { + + protected $cur = null; // The current user + + /** + * For initializing members of the class. Set a the + * current user here. + * + * @param array $argarray misc. arguments + * + * @return boolean true + */ + function prepare($argarray) + { + parent::prepare($argarray); + + $this->cur = common_current_user(); + + return true; + } + /** * A design for this action * @@ -54,14 +74,11 @@ class CurrentUserDesignAction extends Action * * @return Design a design object to use */ - function getDesign() { - $cur = common_current_user(); - - if (!empty($cur)) { + if (!empty($this->cur)) { - $design = $cur->getDesign(); + $design = $this->cur->getDesign(); if (!empty($design)) { return $design; @@ -70,4 +87,10 @@ class CurrentUserDesignAction extends Action return parent::getDesign(); } + + function getCurrentUser() + { + return $this->cur; + } } +