Beispiel #1
0
 function newAction()
 {
     $f = $this->getRequest();
     $guid = $f->getParam('guid');
     $node = $f->getParam('node');
     $modelFolder = new Pandamp_Modules_Misc_Menu_Model_Menu();
     $newRow = $modelFolder->createRow();
     if (isset($node) && $node != 'root') {
         $rowNode = $modelFolder->find($node)->current();
         if ($rowNode) {
             $this->view->nodeTitle = $rowNode->title;
         }
     } else {
         $this->view->nodeTitle = 'Root';
     }
     $message = '';
     if ($f->isPost()) {
         //die('post');
         $newRow->parentGuid = $node;
         $newRow->title = $f->getParam('title');
         $newRow->description = $f->getParam('description');
         $newRow->viewOrder = $f->getParam('viewOrder');
         $newRow->cmsParams = $f->getParam('cmsParams');
         $newRow->save();
         $message = 'Data was successfully saved.';
     }
     $this->view->node = $node;
     $this->view->row = $newRow;
 }
 public function view()
 {
     $browserUrl = ROOT_URL . '/dev/menu/browse/node';
     $folderGuid = $this->folderGuid ? $this->folderGuid : 'root';
     $tblFolder = new Pandamp_Modules_Misc_Menu_Model_Menu();
     $aPath = array();
     if ($folderGuid == 'root') {
         $aPath[0]['title'] = 'Root';
         $aPath[0]['url'] = $browserUrl;
     } else {
         $rowFolder = $tblFolder->find($folderGuid)->current();
         if (!empty($rowFolder->path)) {
             $aFolderGuid = explode("/", $rowFolder->path);
             $sPath = 'root >';
             $aPath[0]['title'] = 'Root';
             $aPath[0]['url'] = $browserUrl;
             $i = 1;
             if (count($aFolderGuid)) {
                 $sPath1 = '';
                 foreach ($aFolderGuid as $guid) {
                     if (!empty($guid)) {
                         $rowFolder1 = $tblFolder->find($guid)->current();
                         $sPath1 .= $rowFolder1->title . ' > ';
                         $aPath[$i]['title'] = $rowFolder1->title;
                         $aPath[$i]['url'] = $browserUrl . '/' . $rowFolder1->guid;
                         $i++;
                     }
                 }
                 $aPath[$i]['title'] = $rowFolder->title;
                 $aPath[$i]['url'] = $browserUrl . '/' . $rowFolder->guid;
             }
         } else {
             $aPath[0]['title'] = 'Root';
             $aPath[0]['url'] = $browserUrl;
             $aPath[1]['title'] = $rowFolder->title;
             $aPath[1]['url'] = $browserUrl . '/' . $rowFolder->guid;
         }
     }
     $this->view->aPath = $aPath;
 }
Beispiel #3
0
 function viewFolderKu()
 {
     $time_start = microtime(true);
     $parentGuid = $this->_node;
     $columns = 4;
     $tblFolder = new Pandamp_Modules_Misc_Menu_Model_Menu();
     $rowsetFolder = $tblFolder->fetchChildren($parentGuid);
     $num_rows = count($rowsetFolder);
     $rows = ceil($num_rows / $columns);
     if ($num_rows < $columns) {
         $columns = $num_rows;
     }
     if ($num_rows == 0) {
     }
     $in = 0;
     $data = array();
     foreach ($rowsetFolder as $rowFolder) {
         $data[$in][0] = $rowFolder->title;
         $data[$in][1] = $rowFolder->description;
         $data[$in][2] = $rowFolder->guid;
         $data[$in][3] = '';
         $in++;
     }
     $this->view->rows = $rows;
     $this->view->columns = $columns;
     $this->view->data = $data;
     $this->view->numberOfFolders = $num_rows;
     $this->view->node = $parentGuid;
     if ($parentGuid != 'root') {
         $rowCurrentNode = $tblFolder->find($parentGuid)->current();
         $this->view->currentNodeTitle = $rowCurrentNode->title;
     } else {
         $this->view->currentNodeTitle = 'ROOT';
     }
     $time_end = microtime(true);
     $time = $time_end - $time_start;
 }