X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fcurrentuserdesignaction.php;h=e84c77768569d0f13d9bdffc3b66b1f3d3ddb6fc;hb=03de85ed469874b843709b145f3ce995f688d74b;hp=52516b624a08cdf5f369ba126ef604dc0c10be7f;hpb=854d24b05a052bffe21f112b705d58c9abf126a9;p=quix0rs-gnu-social.git diff --git a/lib/currentuserdesignaction.php b/lib/currentuserdesignaction.php index 52516b624a..e84c777685 100644 --- a/lib/currentuserdesignaction.php +++ b/lib/currentuserdesignaction.php @@ -1,6 +1,6 @@ . * * @category Action - * @package Laconica - * @author Evan Prodromou - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou + * @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://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -38,15 +38,35 @@ if (!defined('LACONICA')) { * design. This superclass returns that design. * * @category Action - * @package Laconica - * @author Evan Prodromou + * @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://laconi.ca/ + * @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; + } } +