Beispiel #1
0
 public function loadUserAttributes(Application_Model_Models_User $user)
 {
     $attributes = array();
     if ($user->getId()) {
         $select = $this->getDbTable()->getAdapter()->select()->from('user_attributes', array('attribute', 'value'))->where('user_id = ?', $user->getId());
         $data = $this->getDbTable()->getAdapter()->fetchPairs($select);
         if (!is_null($data)) {
             $attributes = $data;
         }
     }
     return $user->setAttributes($attributes);
 }
Beispiel #2
0
 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');
 }