[ Index ] |
|
Code source de LifeType 1.2.4 |
1 <?php 2 3 lt_include( PLOG_CLASS_PATH.'class/view/admin/admintemplatedview.class.php' ); 4 lt_include( PLOG_CLASS_PATH.'class/view/admin/adminerrorview.class.php' ); 5 lt_include( PLOG_CLASS_PATH.'class/dao/users.class.php' ); 6 lt_include( PLOG_CLASS_PATH.'class/dao/userstatus.class.php' ); 7 lt_include( PLOG_CLASS_PATH.'class/dao/permissions.class.php' ); 8 9 /** 10 * \ingroup View 11 * @private 12 * 13 * shows the view to edit a user 14 */ 15 class AdminEditSiteUserView extends AdminTemplatedView 16 { 17 var $_user; 18 19 function AdminEditSiteUserView( $blogInfo, $userInfo = null ) 20 { 21 // check if we have something in the session... 22 if( $userInfo == null ) { 23 $this->_user = $this->getSessionValue( 'editUserInfo' ); 24 } 25 else { 26 $this->_user = $userInfo; 27 $this->setSessionValue( 'editUserInfo', $this->_user ); 28 } 29 30 if( $this->_user ) { 31 // in case everything went fine... 32 $this->AdminTemplatedView( $blogInfo, 'userprofile' ); 33 // user settings 34 $this->setValue( 'userId', $this->_user->getId()); 35 $this->setValue( 'userStatus', $this->_user->getStatus()); 36 $this->setValue( 'userName', $this->_user->getUsername()); 37 $this->setValue( 'userEmail', $this->_user->getEmail()); 38 $this->setValue( 'userIsSiteAdmin', $this->_user->isSiteAdmin()); 39 $this->setValue( 'userAbout', $this->_user->getAboutMyself()); 40 $this->setValue( 'userFullName', $this->_user->getFullName()); 41 // list of global permissions that the user has 42 $this->setValue( 'userPermissions', $this->_user->getPermissions()); 43 } 44 else { 45 // or else an error 46 $this->AdminErrorView( $blogInfo ); 47 $this->setMessage( 'Error loading user data from the session' ); 48 } 49 } 50 51 function render() 52 { 53 // fetch the blogs to which this user belongs 54 $users = new Users(); 55 $userBlogs = $users->getUsersBlogs( $this->_user->getId()); 56 $this->notifyEvent( EVENT_BLOGS_LOADED, Array( 'blogs' => &$userBlogs )); 57 58 // otherwise, transfer it to the template context and let the 59 // template do the rest 60 $this->setValue( 'edituser', $this->_user ); 61 $this->setValue( 'edituserblogs', $userBlogs ); 62 // list of available status 63 $this->setValue( 'userStatusList', UserStatus::getStatusList()); 64 // list of global permisisons 65 $perms = new Permissions(); 66 $this->setValue( 'permissions', $perms->getAllPermissions()); 67 68 parent::render(); 69 } 70 } 71 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Nov 26 21:04:15 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |