Beispiel #1
0
 private function _map($item)
 {
     $db = Zend_Registry::get('db');
     $select = $db->select()->from(array('t' => 'SecureDocsGroupMaps'), array('*'))->where('t.group_id = ?', (int) $item['group_id']);
     $results = $db->fetchAll($select);
     $maps = array();
     foreach ($results as $result) {
         $maps[] = $result['mapname'];
     }
     $obj = new SxModule_Securedocs_Group();
     $obj->setGroupId((int) $item['group_id']);
     $obj->setGroup($item['group']);
     $obj->setMaps($maps);
     return $obj;
 }
 public function addgroupAction()
 {
     SxCms_Acl::requireAcl('securedocs', 'securedocs.add');
     $proxy = new SxModule_Securedocs_Folder_Proxy();
     $folders = $proxy->getAll();
     $this->view->folders = $folders;
     if ($this->getRequest()->isGet()) {
         $item = new SxModule_Securedocs_Group();
     }
     if ($this->getRequest()->isPost()) {
         $item = new SxModule_Securedocs_Group();
         $item->setGroup($this->_getParam('groupname'));
         $item->setMaps($this->_getParam('maps'));
         $item->setTmx($this->tmx);
         if ($item->isValid()) {
             $item->save();
             $flashMessenger = $this->_helper->getHelper('FlashMessenger');
             $flashMessenger->addMessage($this->admin_tmx->_('groupcreated'));
             $this->_helper->redirector->gotoSimple('groupoverview', 'securedocs');
         }
     }
     $this->view->messages = Sanmax_MessageStack::getInstance('SxModule_Securedocs_Group');
     $this->view->item = $item;
 }