Пример #1
0
 /**
  * get instance
  *
  *
  * @return Cms_Model_PageTypeMapper
  */
 public static function getInstance()
 {
     if (self::$_instance === null) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
Пример #2
0
 public function dialogAction()
 {
     $page_id = $this->getRequest()->getParam('page_id', '');
     $langFilter = $this->getRequest()->getParam('langFilter', '');
     $data = $this->getRequest()->getPost('data');
     $this->view->languages = Application_Model_TranslateMapper::getInstance()->getLanguages();
     $this->view->types = Cms_Model_PageTypeMapper::getInstance()->fetchAll();
     $this->view->page_id = $page_id;
     $this->view->langFilter = $langFilter;
     if ($this->_formHelper->isSave()) {
         return $this->_formHelper->returnSuccess($this->view->url(array('action' => 'menu')), $this->translate('Page Selected.'), $data);
     }
 }
 /**
  * Ajax action to obtain pages types for a module
  */
 public function getModulePageTypesAction()
 {
     $data = array('success' => false, 'message' => $this->translate("No page types associated with this module."), 'page_types' => '');
     $pageTypes = Cms_Model_PageTypeMapper::getInstance()->findByModule($this->_getParam('id'));
     if (count($pageTypes)) {
         $data = array('success' => true, 'message' => $this->translate("Page types obtained."), 'page_types' => $pageTypes);
     }
     $this->_helper->json->sendJson($data);
 }