public static function sendMailNotification($page, $author, $date, $comm, $emailAuthor, $pageTitle = '', $vcode = '') { $sendEmail = ipGetOption('Comment.useSeparateEmail'); if (empty($sendEmail)) { $sendEmail = ipGetOptionLang('Config.websiteEmail'); } $noUser = '******' . __("You are not a registered user, or pehaps you were not logged in when have commented. So, you need to verify " . "your email address before your comment is moderated and published. Please, click on the following link for " . "such a thing: ", "Comments") . '<a href="' . ipHomeUrl() . ipContent()->getCurrentLanguage()->getUrlPath() . 'comments/' . $vcode . '-!' . $emailAuthor . '">' . __('Email verification', 'Comments') . '</a>' . __(" If it doesn't work, please copy and past the following in your web browser: ", "Comments") . "<strong>" . ipHomeUrl() . ipContent()->getCurrentLanguage()->getUrlPath() . "comments/" . $vcode . '-!' . $emailAuthor . '</strong></div><br />'; if (ipUser()->isLoggedIn()) { $noUser = ''; } //array can has: 'title', 'content', 'signature', 'footer'. $contentAdmin = sprintf('<div><strong>' . __('Page', 'Comments') . ':</strong> ' . __($pageTitle, 'Comments') . ' (%s)</div>' . '<div><strong>' . __('Author', 'Comments') . ':</strong> %s - ' . $emailAuthor . '</div>' . '<div><strong>' . __('Date', 'Comments') . ':</strong> %s</div>' . '<div><strong>' . __('Comment', 'Comments') . ':</strong></div>' . '<div><cite class="mail">%s</cite></div>', $page, $author, $date, $comm); $templateAdmin = array('title' => __('You just received a comment', 'Comments'), 'content' => $contentAdmin, 'signature' => '<h4>' . __('Internal Administration', 'Comments') . '</h4>', 'footer' => '<h4>' . ipGetOptionLang('Config.websiteTitle') . '</h4>'); $contentAuthor = sprintf(__('Your comment has been sent and it is awaiting moderation. Thank you.', 'Comments') . $noUser . '<div><strong>' . __('Page', 'Comments') . ':</strong> ' . __($pageTitle, 'Comments') . ' (%s)</div>' . '<div><strong>' . __('Author', 'Comments') . ':</strong> %s - ' . $emailAuthor . '</div>' . '<div><strong>' . __('Date', 'Comments') . ':</strong> %s</div>' . '<div><strong>' . __('Comment', 'Comments') . ':</strong></div>' . '<div><cite class="mail">%s</cite></div>', $page, $author, $date, $comm); $templateAuthor = array('title' => __('You just sent a comment', 'Comments'), 'content' => $contentAuthor, 'signature' => '<div>' . __('Kindest regards', 'Comments') . ',</div>', 'footer' => '<h4>' . ipGetOptionLang('Config.websiteTitle') . '</h4>'); /* ipSendEmail ( string $from , string $fromName , string $to , string $toName , string $subject , string $content , [ boolean $urgent ] , [ boolean $html ] , [ string|array|null $files ] ) */ if (ipGetOption('Comments.informAboutNewComments') == 'Yes') { //ipSendEmail() Administration ipSendEmail($sendEmail, __('Site Comment', 'Comments'), $sendEmail, __('Comment Moderation', 'Comments'), __('There is a new comment', 'Comments') . ': ' . __($pageTitle, 'Comments'), ipEmailTemplate($templateAdmin), true, true); } if (ipGetOption('Comments.requireEmailConfirmation') == 'Yes') { //ipSendMail Author ipSendEmail($sendEmail, ipGetOptionLang('Config.websiteTitle'), $emailAuthor, $author, __('You have just done a comment in our website', 'Comments') . ': ' . __($pageTitle, 'Comments'), ipEmailTemplate($templateAuthor), true, true); } }
public static function getRssItems($languageCode) { $sql = "SELECT p.id FROM " . ipTable('page') . " AS p\n LEFT JOIN " . ipTable('page_storage') . " AS s ON p.id=s.pageId\n WHERE s.`key`='rssFeed' AND s.`value`=1 AND p.`languageCode`='" . esc($languageCode) . "'\n ORDER BY p.`createdAt` DESC"; $rssPageIds = ipDb()->fetchColumn($sql); $items = array(); foreach ($rssPageIds as $pageId) { $pageContent = self::getPageContent($pageId); if (isset($pageContent['text']) && $pageContent['text']) { $item['url'] = ipHomeUrl() . ipPage($pageId)->getUrlPath(); $item['description'] = $pageContent['text']; if (isset($pageContent['heading']) && $pageContent['heading']) { $item['title'] = $pageContent['heading']; } else { $item['title'] = ipPage($pageId)->getTitle(); } $items[] = $item; } } return $items; }
public function index() { \Ip\Internal\Content\Service::setManagementMode(1); return new \Ip\Response\Redirect(ipHomeUrl()); }
public function loginAjax() { ipRequest()->mustBePost(); $validateForm = FormHelper::getLoginForm(); $errors = $validateForm->validate(ipRequest()->getPost()); $username = ipRequest()->getPost('login'); if (empty($errors)) { $model = Model::instance(); if (!$model->login($username, ipRequest()->getPost('password'))) { $errors = $model->getErrors(); } } $redirectUrl = ipHomeUrl(); $model = Model::instance(); $adminMenuItems = $model->getAdminMenuItems(null); if (!empty($adminMenuItems)) { //redirect user to the first module $firstMenuItem = $adminMenuItems[0]; $redirectUrl = $firstMenuItem->getUrl(); } if (empty($errors)) { $answer = array('status' => 'success', 'redirectUrl' => $redirectUrl); } else { $answer = array('status' => 'error', 'errors' => $errors); $usageStatistics = array('action' => 'Admin.loginFailed', 'data' => array('admin' => $username, 'errors' => $errors)); \Ip\Internal\System\Model::sendUsageStatistics($usageStatistics); } if (ipRequest()->getPost('ajax', 1)) { $response = new \Ip\Response\Json($answer); return $response; } else { //MultiSite autologin return new \Ip\Response\Redirect($redirectUrl); } }
/** * Get page URL address * @return string Page URL */ public function getLink() { $path = str_replace('%2F', '/', rawurlencode($this->urlPath)); return ipHomeUrl($this->getLanguageCode()) . $path; }
/** * @param bool $showHome * @return string HTML with links to website languages */ static function generateBreadcrumb($showHome = true) { $data = array('homeUrl' => $showHome ? ipHomeUrl() : null, 'pages' => ipContent()->getBreadcrumb()); $breadcrumb = ipView('view/breadcrumb.php', $data)->render(); return $breadcrumb; }
public function logout() { Model::instance()->logout(); if (ipRequest()->isAjax()) { return new \Ip\Response\Json(array()); } else { return new \Ip\Response\Redirect(ipHomeUrl()); } }
$content .= '</div><div class="column' . $columns . '">'; $entryCounter = 0; } $content .= '</ul><h3 class="char" id="' . $headerChar . '">' . $headerChar . '</h3>'; } if (empty($keyword)) { $keyword = $entry['keyword']; $content .= '<ul class="multicolumn" ><span class="keyword">' . $entry['keyword'] . '</span>'; } elseif ($keyword != $entry['keyword']) { $keyword = $entry['keyword']; $content .= '</ul><ul class="multicolumn"><span class="keyword">' . $entry['keyword'] . '</span>'; } $entryCounter++; if ($tooltip) { $linkTitle = $entry['description'] != '' ? '<span><img class="callout" src="' . ipFileUrl('Plugin/Keywordlist/assets') . '/callout.gif" />' . $entry['description'] . '</span>' : ''; } $content .= '<li><a class="tooltip" href="' . ipHomeUrl(ipContent()->getCurrentLanguage()->getCode()) . $entry['urlPath'] . '">' . $entry['title'] . $linkTitle . '</a></li>'; } echo $jumpMenu; echo '<div class="keywordlist">' . $content . '</div></div>'; } else { ?> <p><?php echo __('There are currently no keywords.', 'Keywordlist'); ?> </p> <?php } ?> </div>
/** * @param string $route * @param array $params * @return string */ function ipRouteUrl($route, $params = array()) { return ipHomeUrl() . \Ip\ServiceLocator::router()->generate($route, $params); }