function indexAction() { echo "<p>in AdminController::indexAction()</p>"; $this->view->title = "Panel Administracyjny"; $pages = new Pages(); $this->view->pages = $pages->fetchAll(); if (!isset($_REQUEST['login_msg'])) { $_REQUEST['login_msg'] = 'permissiondenied'; } }
function indexAction() { $this->view->baseUrl = $this->_request->getBaseUrl(); $this->view->title = "Wirtulna Biblioteka"; $pages = new Pages(); $this->view->pages = $pages->fetchAll(); $strony = new Strony(); $this->view->strony = $strony->fetchAll(); $wtyczka = new Wtyczka(); $this->view->wtyczka = $wtyczka->fetchAll(); }
private function autogenerateMenuItemFromPageId($itemId, $parentId, $recursive = false) { $pageObject = new Pages(); $select = $pageObject->select()->setIntegrityCheck(false)->from('Pages')->joinInner('PagesIndex', 'PI_PageID = P_ID')->where('PI_LanguageID = ?', Zend_Registry::get('languageID'))->where('P_ParentID = ?', $parentId)->order('P_Position'); $pages = $pageObject->fetchAll($select)->toArray(); foreach ($pages as $item) { $page_id = $item['P_ID']; $position = $this->_db->fetchCol("SELECT count(*) FROM MenuItemData WHERE MID_ParentID = '{$itemId}' AND MID_MenuID = '{$this->_id}'"); $position = $position[0]; $langs = Cible_FunctionsGeneral::getAllLanguage(); foreach ($langs as $lang) { $page_details = Cible_FunctionsPages::getPageDetails($page_id, $lang['L_ID']); $page_title = !empty($page_details['PI_PageTitle']) ? $page_details['PI_PageTitle'] : null; if ($page_title != null) { $found_status = $this->autogenerate_checkIfAlreadyExists($itemId, $page_id, $lang['L_ID']); if (!$found_status['data']) { $menuData = new MenuItem(); $_data = $menuData->createRow(); $_data->setFromArray(array('MID_MenuID' => $this->_id, 'MID_ParentID' => $itemId, 'MID_Position' => $position)); $_data->save(); $_dataId = $this->_db->lastInsertId(); $menuIndex = new MenuItemIndex(); $_index = $menuIndex->createRow(); $_index->setFromArray(array('MII_LanguageID' => $item['PI_LanguageID'], 'MII_MenuItemDataID' => $_dataId, 'MII_Title' => $page_title, 'MII_Link' => '', 'MII_PageID' => $page_id)); $_index->save(); } else { if ($found_status['data'] && !$found_status['lang']) { $_dataId = $found_status['dataID']; $menuIndex = new MenuItemIndex(); $_index = $menuIndex->createRow(); $_index->setFromArray(array('MII_LanguageID' => $lang['L_ID'], 'MII_MenuItemDataID' => $_dataId, 'MII_Title' => $page_title, 'MII_Link' => '', 'MII_PageID' => $page_id)); $_index->save(); } } } } if ($_dataId != -1 && $recursive) { $this->autogenerateMenuItemFromPageId($_dataId, $page_id, $recursive); } } }
public static function findChildPage($ParentID, $lang = null) { if ($lang == null) { $lang = Zend_Registry::get("languageID"); } $childArray = new Pages(); $select = $childArray->select()->setIntegrityCheck(false)->from('Pages')->join('PagesIndex', 'Pages.P_ID = PagesIndex.PI_PageID')->where('Pages.P_ParentID = ?', $ParentID)->where('PagesIndex.PI_LanguageID = ?', $lang)->order('Pages.P_Position'); return $childArray->fetchAll($select); }