public function indexAction()
 {
     $model = new App_Model_Page();
     $this->view->model = $model->fetchRow(array("name ='news'", 'active = 1'));
     $news = new App_Model_News();
     $this->view->news = $news->fetchAll(array('active=1'), array('created DESC', 'order'));
 }
 public function indexAction()
 {
     $model = new App_Model_Page();
     $this->view->model = $model->fetchRow(array("name ='careers'", 'active = 1'));
     $jobs = new App_Model_Careers();
     $this->view->jobs = $jobs->fetchAll('active=1', 'order');
 }
 public function indexAction()
 {
     $model = new App_Model_Page();
     $this->view->model = $model->fetchRow(array("name ='links'", 'active = 1'));
     $links = new App_Model_Links();
     $this->view->links = $links->fetchAll('active=1', 'order');
 }
 public function indexAction()
 {
     $model = new App_Model_Page();
     $this->view->model = $model->fetchRow(array("name ='faqs'", 'active = 1'));
     $faqs = new App_Model_Faqs();
     $this->view->faqs = $faqs->fetchAll('active=1', 'order');
 }
 public function navAction()
 {
     $menu = $this->getRequest()->getParam('menu');
     $category = new App_Model_MenuCategories();
     $cat = $category->fetchRow(array("menu_name ='" . $menu . "'", 'active = 1'));
     $model = new App_Model_Page();
     $this->view->menus = $model->menuItems($cat->id, false);
     $this->view->sub = $model->menuItems($cat->id, true);
 }
 public function indexAction()
 {
     $name = $this->getRequest()->getParam('title');
     $model = new App_Model_Page();
     $this->view->model = $model->fetchRow(array("name ='" . $name . "'", 'active = 1'));
     if (!isset($this->view->model->id)) {
         $this->_redirect('/error/missing/title/' . $title);
         //$this->view->model = $model->fetchRow('id = 2');
     }
 }
示例#7
0
 public function createAction()
 {
     $folder = $this->getDb()->getRepository('App_Model_Folder')->find($this->getRequest()->getParam('folder_id'));
     if (!$folder) {
         $this->addFlashMessageError('Folder not found');
         $this->_redirect($this->getUrl(array(), 'admin_index'));
     }
     $templates = $this->getDb()->getRepository('App_Model_Template')->findAll();
     if (!$templates) {
         $this->addFlashError('There are currently no templates available. You must create at least one template before creating a webpage');
         $this->_redirect($this->getUrl(array('folder_id' => $folder->getId()), 'admin_create_template'));
     }
     $this->view->templates = $templates;
     $this->view->page_heading = 'Create New Webpage';
     $form = new Admin_Form_CreatePage($templates);
     $this->view->form = $form;
     if (!$this->getRequest()->isPost()) {
         return;
     }
     if ($form->isValid($this->getRequest()->getPost())) {
         $template = $this->getDb()->getRepository('App_Model_Template')->find($form->template->getValue());
         if (!$template) {
             $this->form->template->addError('You must select a template');
         }
         $page = new App_Model_Page();
         $page->setName($form->name->getValue());
         $page->setFolder($folder);
         $page->setTemplate($template);
         $template_parser = new App_Model_TemplateParser($template);
         $page->setSections($template_parser->generateSections());
         try {
             $this->getDb()->persist($page);
             $this->getDb()->flush();
             $this->addFlashMessageSuccess('Your new webpage has been created successfully');
             $this->_redirect($this->getUrl(array('folder_id' => $folder->getId()), 'admin_view_folder'));
         } catch (PDOException $e) {
             $dbException = new App_Model_DBExceptionDecorator($e);
             if ($dbException->isDuplicateKeyViolation()) {
                 $form->name->addError('A webpage with this name already exists in this folder');
             } else {
                 throw $e;
             }
         }
     }
 }
 public function indexAction()
 {
     $model = new App_Model_Page();
     $this->view->model = $model->getPage('home');
 }
 public function thankyouAction()
 {
     $model = new App_Model_Page();
     $this->view->model = $model->fetchRow(array("name ='contact_thanx'"));
 }