本文整理汇总了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');
}