21 public $mActionForm =
null;
22 public $mMailer =
null;
24 public function hasPermission(&$controller, &$xoopsUser)
26 return is_object($xoopsUser);
29 public function prepare(&$controller, &$xoopsUser)
32 $this->mActionForm->prepare();
35 public function getDefaultView(&$controller, &$xoopsUser)
37 $this->mActionForm->load($xoopsUser);
38 return LEGACY_FRAME_VIEW_INPUT;
41 public function execute(&$controller, &$xoopsUser)
43 $this->mActionForm->fetch();
44 $this->mActionForm->validate();
46 if ($this->mActionForm->hasError()) {
47 return LEGACY_FRAME_VIEW_INPUT;
50 $root =& XCube_Root::getSingleton();
52 $this->mMailer =& getMailer();
53 $this->mMailer->setTemplate(
'tellfriend.tpl');
54 $this->mMailer->assign(
'SITENAME', $root->mContext->getXoopsConfig(
'sitename'));
55 $this->mMailer->assign(
'ADMINMAIL', $root->mContext->getXoopsConfig(
'adminmail'));
56 $this->mMailer->assign(
'SITEURL', XOOPS_URL .
'/');
58 $this->mActionForm->update($this->mMailer);
60 $root->mLanguageManager->loadPageTypeMessageCatalog(
'misc');
62 $this->mMailer->setSubject(sprintf(_MSC_INTSITE, $root->mContext->getXoopsConfig(
'sitename')));
64 return $this->mMailer->send() ? LEGACY_FRAME_VIEW_SUCCESS : LEGACY_FRAME_VIEW_ERROR;
67 public function executeViewInput(&$controller, &$xoopsUser, &$render)
69 $render->setTemplateName(
'legacy_misc_friend.html');
70 $render->setAttribute(
'actionForm', $this->mActionForm);
73 public function executeViewSuccess(&$controller, &$xoopsUser, &$render)
75 $render->setTemplateName(
'legacy_misc_friend_success.html');
78 public function executeViewError(&$controller, &$xoopsUser, &$render)
80 $render->setTemplateName(
'legacy_misc_friend_error.html');
81 $render->setAttribute(
'xoopsMailer', $this->mMailer);