function indexAction() { $r = $this->getRequest(); $row = App_Model_Show_Folder::show()->getIdByTitle($r->getParam('page')); $this->view->id = $row['guid']; $this->view->title = $row['title']; }
function viewFolderKu() { $time_start = microtime(true); $parentGuid = $this->_node; $columns = 4; $acl = Pandamp_Acl::manager(); $auth = Zend_Auth::getInstance(); if (!$auth->hasIdentity()) { echo "You aren't login"; } $identity = $auth->getIdentity(); $packageId = $identity->packageId; $username = $identity->username; $aReturn = App_Model_Show_AroGroup::show()->getUserGroup($packageId); $tblFolder = new App_Model_Db_Table_Folder(); $rowsetFolder = App_Model_Show_Folder::show()->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) { if ($aReturn['name'] == "Master" || $aReturn['name'] == "Super Admin") { $content = 'all-access'; } else { $content = $rowFolder['type']; } if ($acl->getPermissionsOnContent('', $aReturn['name'], $content)) { if ($rowFolder['title'] == "Kategori" || $rowFolder['title'] == "Peraturan" || $rowFolder['title'] == "Putusan") { $title = "<font color=red><b>" . $rowFolder['title'] . "</b></font>"; } else { $title = $rowFolder['title']; } $data[$in][0] = $title; $data[$in][1] = $rowFolder['description']; $data[$in][2] = $rowFolder['guid']; $data[$in][3] = ''; } else { continue; } $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; }
function headerAction() { $r = $this->getRequest(); $node = $r->getParam('node') ? $r->getParam('node') : 'root'; $menuFolder = App_Model_Show_Folder::show()->getMenu($node); $this->view->menuFolder = $menuFolder; $rowset = App_Model_Show_Catalog::show()->getCatalogByProfile("kategoriklinik"); $content = 0; $data = array(); foreach ($rowset as $row) { $data[$content][0] = App_Model_Show_CatalogAttribute::show()->getCatalogAttributeValue($row['guid'], 'fixedTitle'); $data[$content][1] = $row['guid']; $content++; } $num_rows = count($rowset); $this->view->numberOfRows = $num_rows; $this->view->data = $data; }
/** * Get Tree * * @param string $folderGuid * @param string $sGuid * @param int $level * @return void */ protected function _traverseFolder($folderGuid, $sGuid, $level, array $attributes) { $acl = Pandamp_Acl::manager(); $auth = Zend_Auth::getInstance(); $group = $auth->getIdentity()->name; $rowSet = App_Model_Show_Folder::show()->fetchChildren($folderGuid); $sGuid = ''; foreach ($rowSet as $row) { if ($group == "Master" || $group == "Super Admin") { $content = 'all-access'; } else { $content = $row['type']; } if ($acl->getPermissionsOnContent('', $group, $content)) { $selected = isset($attributes['selected']) && in_array($row['guid'], $attributes['selected']) ? ' checked="checked"' : ''; $checkBox = '<div>' . str_repeat('-----', $level) . ' <input type="checkbox" name="' . $attributes['name'] . '" value="' . $row['guid'] . '"' . $selected . ' />' . $row['title'] . '</div>' . self::EOL; $sGuid .= $checkBox . $this->_traverseFolder($row['guid'], '', $level + 1, $attributes); } } return $sGuid; }
function getmenuchildAction() { $r = $this->getRequest(); $node = $r->getParam('node'); $rowset = App_Model_Show_Folder::show()->getMenu($node); $this->view->rowset = $rowset; }
public function getchildreninjsonAction() { // Make sure nothing is cached header("Cache-Control: must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); header("Expires: " . gmdate("D, d M Y H:i:s", mktime(date("H") - 2, date("i"), date("s"), date("m"), date("d"), date("Y"))) . " GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // So that the loading indicator is visible sleep(1); $acl = Pandamp_Acl::manager(); $auth = Zend_Auth::getInstance(); if (!$auth->hasIdentity()) { echo "You aren't login"; } $identity = $auth->getIdentity(); $packageId = $identity->packageId; $username = $identity->username; $aReturn = App_Model_Show_AroGroup::show()->getUserGroup($packageId); // The id of the node being opened $id = $_REQUEST["id"]; if ($id == "0") { $rowset = App_Model_Show_Folder::show()->fetchChildren('root'); echo '[' . "\n"; for ($i = 0; $i < count($rowset); $i++) { if ($aReturn['name'] == "Master" || $aReturn['name'] == "Super Admin") { $content = 'all-access'; } else { $content = $rowset[$i]['type']; } if ($acl->getPermissionsOnContent('', $aReturn['name'], $content)) { if ($rowset[$i]['title'] == "Kategori" || $rowset[$i]['title'] == "Peraturan" || $rowset[$i]['title'] == "Putusan") { $title = "<font color=red><b>" . $rowset[$i]['title'] . "</b></font>"; } else { $title = $rowset[$i]['title']; } if ($i == count($rowset) - 1) { $tree = "\t" . '{ attributes: { id : "' . $rowset[$i]['guid'] . '" }, state: "closed", data: "' . $title . '" }' . "\n"; } else { $tree = "\t" . '{ attributes: { id : "' . $rowset[$i]['guid'] . '" }, state: "closed", data: "' . $title . '" },' . "\n"; } echo $tree; } else { continue; } } echo ']' . "\n"; } else { $rowset = App_Model_Show_Folder::show()->fetchChildren($id); echo '[' . "\n"; for ($i = 0; $i < count($rowset); $i++) { if ($i == count($rowset) - 1) { echo "\t" . '{ attributes: { id : "' . $rowset[$i]['guid'] . '" }, state: "closed", data: "' . $rowset[$i]['title'] . '" }' . "\n"; } else { echo "\t" . '{ attributes: { id : "' . $rowset[$i]['guid'] . '" }, state: "closed", data: "' . $rowset[$i]['title'] . '" },' . "\n"; } } echo ']' . "\n"; } exit; }