Пример #1
0
 public function viewAction()
 {
     $typeName = $this->_getParam('typename');
     $typeId = $this->_getParam('typeid');
     $this->view->items = "";
     $proxy = new SxCms_Page_Proxy();
     $this->view->page = $proxy->getPageById('286', null, $this->_getParam('lng', 'nl'));
     $proxy = new SxModule_Sheets_Type_Proxy();
     $types = $proxy->getAllActive();
     $this->view->types = $types;
     $masterArray = array();
     $typesAr = array();
     $xi = 0;
     $subtypesArray = array();
     foreach ($types as $type) {
         if (count($type->getSubtypes()) != 0) {
             $proxy = new SxModule_Sheets_Proxy();
             $items = $proxy->getAllActiveByType($type->getId());
             $typesAr[$xi]['id'] = $type->getId();
             $typesAr[$xi]['name'] = $type->getName();
             $xi++;
             //geef items en subtitles door
             if ($type->getId() == $typeId) {
                 $this->view->items = $type->getSubtypes();
             }
         }
     }
     $this->view->typeid = $typeId;
     $this->view->types = $typesAr;
     $this->_helper->layout->setLayout('12col');
 }
Пример #2
0
 public function deleteAction()
 {
     SxCms_Acl::requireAcl('sheets', 'sheets.delete');
     $type_id = $this->_getParam('id');
     $proxy = new SxModule_Sheets_Subtype_Proxy();
     $this->_subtype = $proxy->getTypeById($type_id);
     $this->_subtype->delete();
     $cache = Zend_Registry::get('cache');
     $cache->clean(Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG, array('SxModule_Sheets_Subtype'));
     $proxyAction = new SxModule_Sheets_Proxy();
     $proxyAction->deleteByType($type_id);
     $flashMessenger = $this->_helper->getHelper('FlashMessenger');
     $flashMessenger->addMessage($this->admin_tmx->_('itemdeleted'));
     $this->_helper->redirector->gotoSimple('index', 'sheets_subtype', 'admin', array('type' => $this->_getParam('type')));
 }
Пример #3
0
 public function getAllBySubType($type, $cache = true)
 {
     $db = Zend_Registry::get('db');
     $select = $db->select()->from(array('ty' => 'SheetsSubtype'), array('*'))->join(array('tyt' => 'SheetsSubtypeTsl'), 'ty.subtype_id = tyt.subtype_id', array('*'))->where('tyt.lng = ?', $_SESSION['System']['lng'])->where('ty.type = ?', $type)->where('active = 1')->order('ty.position ASC');
     $results = $db->fetchAll($select);
     $types = array();
     foreach ($results as $result) {
         $type = new SxModule_Sheets_Subtype();
         $type = $this->_mapper->toObject(is_array($result) ? $result : array());
         $proxy = new SxModule_Sheets_Proxy();
         $sheets = $proxy->getAllBySubtype($result['subtype_id']);
         $type->setSheets($sheets);
         $types[] = $type;
     }
     return $types;
 }
Пример #4
0
 public function deleteAction()
 {
     SxCms_Acl::requireAcl('sheets', 'sheets.delete');
     $sheet_id = $this->_getParam('id');
     $proxy = new SxModule_Sheets_Proxy();
     $this->_sheets = $proxy->getById($sheet_id);
     $this->_sheets->delete();
     $flashMessenger = $this->_helper->getHelper('FlashMessenger');
     $flashMessenger->addMessage($this->admin_tmx->_('itemdeleted'));
     $this->_helper->redirector->gotoSimple('index', 'sheets');
 }
Пример #5
0
 public function deleteAction()
 {
     SxCms_Acl::requireAcl('sheets', 'sheets.delete');
     $type_id = $this->_getParam('id');
     $proxy = new SxModule_Sheets_Type_Proxy();
     $this->_type = $proxy->getTypeById($type_id, $_SESSION['System']['lng']);
     $this->_type->delete();
     $cache = Zend_Registry::get('cache');
     $cache->clean(Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG, array('SxModule_Sheets_Type'));
     $proxyAction = new SxModule_Sheets_Proxy();
     $proxyAction->deleteByType($type_id);
     $flashMessenger = $this->_helper->getHelper('FlashMessenger');
     $flashMessenger->addMessage('Type werd succesvol verwijderd!');
     $this->_helper->redirector->gotoSimple('index', 'sheets_type');
 }