Public Member Functions | |
prepare (&$controller, &$xoopsUser, $moduleConfig) | |
_setupActionForm () | |
isSecure () | |
hasPermission (&$controller, &$xoopsUser, $moduleConfig) | |
getDefaultView (&$controller, &$xoopsUser) | |
_doExecute () | |
Public Attributes | |
$mSystemAvatars = array() |
Users who are allowed to upload, can upload custom avatars and select system avatars. So this action has to implement both of uploading and selecting. In the case of GET request, this action shows two forms to changing a avatar for specified user. One of form shows upload-form. Anther form shows the list of system avatars and the page navigator of the list.
User_AvatarSelectForm
User_AvatarEditAction::prepare | ( | &$ | controller, | |
&$ | xoopsUser, | |||
$ | moduleConfig | |||
) |
Fetch conditions from $moduleConfig and set these to member properties. And, by the member property mConfig of the base class, any member functions of this class can access $moduleConfig.
User_AvatarEditAction::_setupActionForm | ( | ) |
This class uses AvatarUploadForm class. It requests three condition which are width limit, height limit and filesize limit.
User_AvatarEditAction::isSecure | ( | ) |
Return true. This action should not be used by a guest user.
User_AvatarEditAction::hasPermission | ( | &$ | controller, | |
&$ | xoopsUser, | |||
$ | moduleConfig | |||
) |
Check whether a current user can access this action. 1) A specified user has to exist. 2) A current user has to equal the specified user, or a current user has to be a administrator.
User_AvatarEditAction::getDefaultView | ( | &$ | controller, | |
&$ | xoopsUser | |||
) |
This override method looks like the same method of ListAction, and tries to get system avatars. After, it will call base class.
User_AvatarEditAction::_doExecute | ( | ) |
1) Save avatar file which has been uploaded. 2) If old avatar file exists, remove it. 3) Insert a data to DB with calling base class method.
User_AvatarEditAction::$mSystemAvatars = array() |
Preset avatar object collection.