protected function _renderPhoto() { if (isset($this->_options[0])) { $imgSize = $this->_options[0]; } else { $imgSize = 'small'; } $imgNameSlug = md5($this->_user->getId() . $this->_user->getEmail()) . '.png'; $userpic = 'media/' . self::USERPIC_FOLDER . '/' . $imgSize . '/' . $imgNameSlug; $this->_view->userpic = file_exists($this->_websiteHelper->getPath() . $userpic) ? $userpic : null; $this->_view->imgNameSlug = $imgNameSlug; $this->_view->user = $this->_user; $this->_view->imgSize = $imgSize; $this->_view->editableMode = $this->_editableMode; return $this->_view->render('user-photo.phtml'); }
public function __construct($options, $seotoasterData) { // setting up Seotoaster data and plugin options $this->_options = $options; $this->_seotoasterData = $seotoasterData; // setting up helpers $this->_sessionHelper = Zend_Controller_Action_HelperBroker::getStaticHelper('session'); $this->_websiteHelper = Zend_Controller_Action_HelperBroker::getStaticHelper('website'); $this->_responseHelper = Zend_Controller_Action_HelperBroker::getStaticHelper('response'); $this->_redirector = new Zend_Controller_Action_Helper_Redirector(); // setting up request and response objects $front = Zend_Controller_Front::getInstance(); $this->_request = $front->getRequest(); $this->_response = $front->getResponse(); unset($front); // setting up view $this->_view = new Zend_View(); $this->_websiteUrl = $this->_websiteHelper->getUrl(); $this->_pluginName = strtolower(__CLASS__); $this->_view->websiteUrl = $this->_websiteUrl; $this->_view->pluginName = $this->_pluginName; // setting up view helpers (standart and ZendX) $this->_view->setHelperPath(APPLICATION_PATH . '/views/helpers/'); $this->_view->addHelperPath('ZendX/JQuery/View/Helper/', 'ZendX_JQuery_View_Helper'); // runing init routines $this->_initAcl(); $this->_initTranslator(); $this->_init(); }