Ejemplo n.º 1
0
 public function action_index()
 {
     $write_allowed = ACL::is_action_allowed('admin', 'config', 'write');
     $this->template->write_allowed = $write_allowed;
     if (isset($_POST['cancel'])) {
         $this->redirect('/' . Extasy_Url::url_to_route('admin-config'));
     }
     $form = new Form_Config();
     if (!$write_allowed) {
         $form->set_read_only();
     }
     if ($write_allowed and isset($_POST['submit']) and $form->submit()) {
         $this->redirect('/' . Extasy_Url::url_to_route('admin-config'));
     }
     $this->template->form = $form;
 }
Ejemplo n.º 2
0
 protected function _getConfigForm($id)
 {
     require_once APPLICATION_PATH_COMMONS . '/forms/Config.php';
     $form = new Form_Config();
     if ($id > 0) {
         $form->setAction($this->_helper->url('form/?id=' . $id));
     } else {
         $form->setAction($this->_helper->url('form'));
     }
     return $form;
 }