本文整理匯總了PHP中Fox::getLoggedMember方法的典型用法代碼示例。如果您正苦於以下問題:PHP Fox::getLoggedMember方法的具體用法?PHP Fox::getLoggedMember怎麽用?PHP Fox::getLoggedMember使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Fox
的用法示例。
在下文中一共展示了Fox::getLoggedMember方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _prepareForm
/**
* Prepare form
*
* @param Uni_Core_Form_Eav $form
*/
protected function _prepareForm(Uni_Core_Form_Eav $form)
{
$form->setName('member')->setMethod('post');
$model = Fox::getModel($this->getModelKey());
if (Fox::getLoggedMember()) {
$model->load(Fox::getLoggedMember()->getId());
}
$eavMetaData = $model->getEavFormMetaData(1, Fox_Eav_Model_Abstract::EDITABLE_TYPE_FRONTEND);
$form->createEavForm($eavMetaData);
$form->addPrefixPath('Uni_Core_Admin_View_Form_Decorator', 'Uni/Core/Admin/View/Form/Decorator/', 'decorator');
$form->setDecorators(array('Tabs'));
parent::_prepareForm($form);
}
示例2: isImageExists
/**
* Determines whether the image file exists
*
* @return boolean
*/
public function isImageExists()
{
$imagePath = Fox_Member_Model_Member::getImageUploadPath();
return Fox::getLoggedMember()->getMemberImage() && file_exists($imagePath . DIRECTORY_SEPARATOR . Fox::getLoggedMember()->getMemberImage());
}
示例3: removeImageAction
/**
* Remove image action
*/
public function removeImageAction()
{
$memberModel = Fox::getModel('member/member');
$memberModel->getAdapter()->beginTransaction();
try {
$memberData = Fox::getLoggedMember();
$memberModel->load($memberData->getId());
$path = Fox_Member_Model_Member::getImageUploadPath();
$prevImage = $memberModel->getMemberImage();
$memberModel->setMemberImage('');
$memberModel->save();
$memberModel->getAdapter()->commit();
if ($prevImage && file_exists($path . DIRECTORY_SEPARATOR . $prevImage)) {
@unlink($path . DIRECTORY_SEPARATOR . $prevImage);
}
Fox::getModel('member/session')->setLoginData($memberModel);
Fox::getHelper('core/message')->setInfo('Profile image was successfully removed.');
} catch (Exception $e) {
$memberModel->getAdapter()->rollback();
Fox::getHelper('core/message')->setError($e->getMessage());
}
$this->sendRedirect('*/*/edit-image');
}