/** * Удаляет фото */ protected function EventRemoveFoto() { /** * Устанавливаем формат Ajax ответа */ $this->Viewer_SetResponseAjax('json'); /** * Удаляем */ $this->User_DeleteFoto($this->oUserCurrent); $this->oUserCurrent->setProfileFoto(null); $this->User_Update($this->oUserCurrent); /** * Возвращает дефолтную аватарку */ $this->Viewer_AssignAjax('sFile', $this->oUserCurrent->getProfileFotoDefault()); $this->Viewer_AssignAjax('sTitleUpload', $this->Lang_Get('settings_profile_photo_upload')); }
/** * Удаляет фото пользователя * * @param ModuleUser_EntityUser $oUser */ public function DeleteProfilePhoto($oUser) { if ($oUser->getProfileFoto()) { $this->Image_RemoveFile($oUser->getProfileFoto()); $oUser->setProfileFoto(null); } }