public function Manage($permalink) { $this->data['user'] = $this->checkLogin(OpenSms::OPEN_ROLE_ADMIN); $page = $this->loadModel('OpenSms_Model_Page', [0 => $permalink]); if ($page->Id < 1) { $this->setError("No page found with the permalink: {$permalink}", "page_manage"); $this->redirectToAction('index'); } if (isset($_POST['title'])) { $page->Title = $_POST['title']; $page->Layout = $_POST['layout']; $page->Description = $_POST['description']; $result = $page->Save(); if ($result == true) { $this->setNotification('Page saved', 'page_manage'); } else { $this->setError('Error in saving page', 'page_manage'); } $this->redirectToAction('index'); } $this->data['page'] = $page; $this->data['pageTitle'] = "Manage Page"; OpenSms::registerView('cms_ck_editor_js', 'default/assets/plugins/ckeditor/ckeditor.js', OpenSms::VIEW_TYPE_SCRIPT, OpenSms::VIEW_POSITION_TOP); $this->renderTemplate(); }
public static function TriggerEditor() { if (isset($_GET['action']) && $_GET['action'] == 'cms') { OpenSms::checkLogin(OpenSms::OPEN_ROLE_ADMIN); OpenSms::registerView('cms_ck_editor_js', 'default/assets/plugins/ckeditor/ckeditor.js', OpenSms::VIEW_TYPE_SCRIPT, OpenSms::VIEW_POSITION_TOP); OpenSms::registerView('cms_content_editor', 'default/template/cms/content_editor.php', OpenSms::VIEW_TYPE_HTML, OpenSms::VIEW_POSITION_FOOTER); OpenSms::registerView('cms_editor_js', 'default/assets/js/cms.js', OpenSms::VIEW_TYPE_SCRIPT, OpenSms::VIEW_POSITION_FOOTER); OpenSms::registerView('cms_editor_css', 'default/assets/css/cms.css', OpenSms::VIEW_TYPE_STYLE, OpenSms::VIEW_POSITION_TOP); } }
protected function registerView($key, $content, $type, $position, $isFile = true) { OpenSms::registerView($key, $content, $type, $position, $isFile); }