/** * IS: Parameter id terdeklarasi * FS: Mengirimkan ke viewer: content, static_id * Desc: Mengatur aksi yang dilakukan untuk halaman edit */ public function editAction() { $language_id = 1; $static_id = $this->_getParam('id'); $table_static = new Model_DbTable_StaticContent(); if ($this->getRequest()->isPost()) { $data = array('content' => $_POST['pageContent']); $table_static->updateStaticContent($data, $static_id); $this->loggingaction('page', 'edit', $static_id, $language_id); $this->_flash->addMessage('1\\Page Update Success!'); $this->_redirect($this->view->rootUrl('/admin/page/')); } $content = $table_static->getContentByLangId($static_id, $language_id); $this->view->content = $content[0]['content']; $this->view->static_id = $static_id; }
/** * IS: - * FS: Mengirimkan ke viewer: staticType, menuType, staticContent * Desc: Fungsi yang digunakan untuk menampilkan content static * * @param $staticType tipe static (climate/currency) dari tabel * @param $menuType tipe menu/navigation (discover atau travel) */ private function _displayContent($staticType, $menuType = '') { // Model $staticContentDb = new Model_DbTable_StaticContent(); // Data $staticContent = $staticContentDb->getContentByLangId($staticType, $this->_languageId); // View $this->view->staticType = $staticType; $this->view->menuType = $menuType; $this->view->staticContent = $staticContent; }