function actionEditlayout($params = '') { $objLayouts = new LayoutModel(); $layout_id = !empty($params['layout_id']) ? intval($params['layout_id']) : false; if (!empty($params['dosave'])) { $layout_id = $this->saveLayout($params); if (!empty($params['ajaxsave'])) { $layoutInfo = $objLayouts->loadLayout($layout_id); echo json_encode($layoutInfo); return; } $this->messages[] = array('type' => 'success', 'message' => 'Layout has been saved.'); if ($params['submit'] == 'Save and Close') { $this->actionLayouts(); return; } } if (!empty($layout_id)) { $layoutInfo = $objLayouts->loadLayout($layout_id); $this->view->assign('layoutInfo', $layoutInfo); } $this->view->assign('content', $this->view->fetch('tpl/design/layout.tpl')); $this->view->assign('messages', $this->messages); $this->finish(); }
function actionIndex($params = '') { $objPage = new PagesModel(); $objLayout = new LayoutModel(); $page_id = !empty($params['page_id']) ? intval($params['page_id']) : 0; $previewPage = !empty($params['preview']) ? true : false; if (empty($params['page_id'])) { $page_id = $objPage->getPageId('home'); } $pageInfo = $objPage->loadPage($page_id); if (!empty($pageInfo) && $pageInfo['status'] == 'published' && $pageInfo['type'] == 'page' || $previewPage == true) { // load additional page info $sideBars = $objPage->getPageSidebars($page_id); $layoutInfo = $objLayout->loadLayout($pageInfo['layout_id']); // used to set active state in menu $this->view->current_page = $pageInfo['keyName']; //assign template vars $this->view->assign('pageTitle', $pageInfo['title']); $this->view->assign('content', $this->view->fetch('fromstring:' . $pageInfo['content'])); if (!empty($sideBars)) { $this->view->assign('sidebar_left', $this->view->fetch('fromstring:' . $sideBars['left']['content'])); $this->view->assign('sidebar_right', $this->view->fetch('fromstring:' . $sideBars['right']['content'])); } $this->view->assign('layout', $this->view->fetch('fromstring:' . $layoutInfo['code'])); } else { // page not found $this->view->assign('layout', '404 - ' . print_r($params, true)); } $this->finish(); }
function actionIndex($params = '') { $objSearch = new SearchModel(); $searchQuery = !empty($params['searchQuery']) ? $params['searchQuery'] : ''; $searchOptions = array(); $searchResults = false; // load templates $objLayout = new LayoutModel(); $objTemplate = new TemplatesModel(); $layoutInfo = $objLayout->loadLayout(); $template = $objTemplate->loadTemplateFromKeyname('search'); // doing search? if (!empty($searchQuery)) { // add search options if (!empty($params['searchForType'])) { foreach ($params['searchForType'] as $typeSearch) { $searchOptions[] = array('type' => 'type', 'value' => $typeSearch); } } // do search $searchResults = $objSearch->performSearch($searchQuery, $searchOptions); } // assign to template $this->view->assign('searchQuery', $searchQuery); $this->view->assign('searchOptions', $searchOptions); $this->view->assign('searchResults', $searchResults); // render template $this->view->assign('content', $this->view->fetch('fromstring:' . $template['content'])); $this->view->assign('sidebar_left', $this->view->fetch('fromstring:' . $template['left_sidebar'])); $this->view->assign('sidebar_right', $this->view->fetch('fromstring:' . $template['right_sidebar'])); $this->view->assign('layout', $this->view->fetch('fromstring:' . $layoutInfo['code'])); $this->finish(); }
function actionRequiresaccount($params = '') { $objLayout = new LayoutModel(); $layoutInfo = $objLayout->loadLayout(); $this->view->assign('content', 'To view this page, you must have an account. Please login or register.'); $this->view->assign('layout', $this->view->fetch('fromstring:' . $layoutInfo['code'])); $this->finish(); }
function sendWebcastRegistrationAdmin($orderInfo) { $objEmailer = new Emailer(); $objLayout = new LayoutModel(); $objTemplate = new TemplatesModel(); $objSettings = Settings::getInstance(); $adminEmail = $objSettings->getEntry('admin', 'admin-email'); $layoutInfo = $objLayout->loadLayout(28); $template = $objTemplate->loadTemplateFromKeyname('email-webcastregistration-admin'); $this->view->assign('orderInfo', $orderInfo); $objEmailer->setFrom('*****@*****.**'); $objEmailer->addTo($adminEmail); $objEmailer->setSubject('WEBCAST PURCHASE'); // render template $this->view->assign('content', $this->view->fetch('fromstring:' . $template['content'])); $this->view->assign('sidebar_left', $this->view->fetch('fromstring:' . $template['left_sidebar'])); $this->view->assign('sidebar_right', $this->view->fetch('fromstring:' . $template['right_sidebar'])); $objEmailer->setBody($this->view->fetch('fromstring:' . $layoutInfo['code']), true); $objEmailer->sendMail(); return true; }
function actionChangePassword($params = '') { $this->objAuthentication->requiresAccount(); $errorMsg = false; $changedpassword = false; if (!empty($params['changepassword'])) { $objUser = new UserModel(); if (!empty($params['orignal_pw']) && !empty($params['password']) && !empty($params['password2'])) { // verify old password $passwordMatch = $objUser->testPassword($this->objAuthentication->user_id, $params['orignal_pw']); if ($passwordMatch) { $objValidation = new Validator(); $objValidation->validatePassword($params['password']); $objValidation->passwordsMatch($params['password'], $params['password2']); if ($objValidation->hasError) { $errorMsg = $objValidation->getError(); if (is_array($errorMsg)) { $errorMsg = implode(', ', $errorMsg); } } else { $saveData = array(); $saveData['id'] = $this->objAuthentication->user_id; $saveData['password'] = $this->objAuthentication->encryptPassword($params['password']); $changedpassword = $objUser->save($saveData, 'users'); if ($changedpassword) { $objEmailer = new EmailSender(); $objEmailer->sendUserChangePassword($this->objAuthentication->user_id); } else { $errorMsg = 'Unable to change password.'; } } } else { $errorMsg = 'Current password incorrect.'; } } else { $errorMsg = 'Current password and new password are required.'; } } $objLayout = new LayoutModel(); $objTemplate = new TemplatesModel(); $layoutInfo = $objLayout->loadLayout(); $template = $objTemplate->loadTemplateFromKeyname('user-changepassword'); $this->view->assign('errorMsg', $errorMsg); $this->view->assign('changedpassword', $changedpassword); $this->view->assign('content', $this->view->fetch('fromstring:' . $template['content'])); $this->view->assign('sidebar_left', $this->view->fetch('fromstring:' . $template['left_sidebar'])); $this->view->assign('sidebar_right', $this->view->fetch('fromstring:' . $template['right_sidebar'])); $this->view->assign('layout', $this->view->fetch('fromstring:' . $layoutInfo['code'])); $this->finish(); }