public function index() { // Display home page of web site // We must not put the title as this is the home page, so this is the default title is used. /**** BEGIN Style sheet and JS files ****/ // Only visitors if (!UserCore::auth()) { $this->view->is_splash_page = Framework\Mvc\Model\DbConfig::getSetting('splashPage'); $this->design->addCss(PH7_LAYOUT . PH7_TPL . PH7_TPL_NAME . PH7_SH . PH7_CSS, 'splash.css,tooltip.css,js/jquery/carousel.css'); $this->design->addJs(PH7_DOT, PH7_STATIC . PH7_JS . 'jquery/carouFredSel.js,' . PH7_LAYOUT . PH7_TPL . PH7_TPL_NAME . PH7_SH . PH7_JS . 'splash.js'); } // Only Members if (UserCore::auth()) { $this->design->addCss(PH7_LAYOUT . PH7_TPL . PH7_TPL_NAME . PH7_SH . PH7_CSS, 'zoomer.css'); $this->design->addJs(PH7_STATIC . PH7_JS, 'zoomer.js,Wall.js'); $this->view->first_name = $this->session->get('member_first_name'); // First Name for the welcome message. } /**** END Style sheet and JS files ****/ // For Profiles Carousel $this->view->userDesignModel = new UserDesignCoreModel(); $this->view->userDesign = new UserDesignCore(); $this->output(); }
/** * Send an email to warn the friend request. * * @param int $iId friend ID * @param object \PH7\UserCoreModel $oUserModel * @return void */ protected function sendMail($iId, UserCoreModel $oUserModel) { $sFriendEmail = $oUserModel->getEmail($iId); $sFriendUsername = $oUserModel->getUsername($iId); /** * Note: The predefined variables as %site_name% does not work here, * because we are in an ajax script that is called before the definition of these variables. */ /** * Get the site name, because we do not have access to predefined variables. */ $sSiteName = Framework\Mvc\Model\DbConfig::getSetting('siteName'); $this->view->content = t('Hello %0%!<br /><strong>%1%</strong> sent you a friendship request on %2%.<br /> <a href="%3%">Click here</a> to see your friend request.', $sFriendUsername, $this->session->get('member_username'), $sSiteName, Framework\Mvc\Router\Uri::get('user', 'friend', 'index')); /* Because we work in Ajax, the constant "PH7_TPL_NAME" is not yet defined. * So we use the constant "PH7_DEFAULT_THEME" is already defined. */ $sMessageHtml = $this->view->parseMail(PH7_PATH_SYS . 'global/' . PH7_VIEWS . PH7_DEFAULT_THEME . '/mail/sys/mod/user/friend_request.tpl', $sFriendEmail); $aInfo = ['to' => $sFriendEmail, 'subject' => t('%0% wants to be friends with you on %1%', $this->session->get('member_first_name'), $sSiteName)]; (new Framework\Mail\Mail())->send($aInfo, $sMessageHtml); }