public function edit_staticpages() { // Set Pagetitle and Breadcrumbs Clansuite_Breadcrumb::add(_('Edit'), '/staticpages/admin/edit'); $info['html'] = $_POST['html']; $info['description'] = $_POST['description']; $info['title'] = $_POST['title']; $info['orig_title'] = $_POST['orig_title']; $info['url'] = $_POST['url']; $info['iframe'] = $_POST['iframe']; $info['iframe_height'] = $_POST['iframe_height']; $info['submit'] = $_POST['submit']; $info['id'] = $_POST['id']; if (!empty($info['submit'])) { if (empty($info['description']) or empty($info['title'])) { $error['fill_form'] = 1; } if ((!$input->check($info['description'], 'is_abc|is_int|is_custom', '_\\s') or !$input->check($info['title'], 'is_abc|is_int|is_custom', '_\\s') or !$input->check($info['iframe_height'], 'is_int')) and !$error['fill_form']) { $error['no_special_chars'] = 1; } if (!$input->check($info['url'], 'is_url') and !empty($url)) { $error['give_correct_url'] = 1; } $entity = $this->getModel()->findOneBySlug($slug); if ($entity === null) { throw new Clansuite_Exception('Unable to find the requested Page: ' . $slug); } Clansuite_Debug::firebug($entity); #$page = Doctrine::getTable('CsStaticPages')->findOneBy('title', $title); if (is_array($page) and $info['orig_title'] != $info['title']) { $error['static_already_exist'] = 1; } if (count($error) == 0) { $page->title = $info['title']; $page->description = $info['description']; $page->url = $info['url']; $page->html = $info['html']; $page->iframe = $info['iframe']; $page->iframe_height = $info['iframe_height']; $page->save(); $this->setFlashmessage('success', _('The page was successfully modified.')); $this->redirect('/controlcenter/staticpages&action=show'); } } else { // $info } $view = $this->getView(); $view->assign('error', $error); $view->assign('info', $info); $view->setLayoutTemplate('index.tpl'); $this->display(); }