/** * Получение из базы списка блоков шаблона указанной страницы. */ private function getTemplateBlocks() { $query = "select\n TB.`id`,\n TB.`block` \n from (select\n Te.`alias` as template\n from `Pages` as Pg left join `Templates` as Te\n on Pg.`template` = Te.`alias`\n where Pg.`alias` = '{$this->page}') \n as Te left join `TemplateBlocks` as TB\n on Te.`template` = TB.`template`"; $mySqlHelper = new MySqlHelper($query); $blocksData = $mySqlHelper->getAllData(); $this->blocks = array(); $i = 0; foreach ($blocksData as $block) { $this->blocks[$i]['id'] = $block['id']; $this->blocks[$i++]['block'] = $block['block']; } }
private function getMenuItemsData() { $query = "select\n MeIt.`menuItem`, MeIt.`page`, MeIt.`postfix`,\n MeIt.`url`, MeIt.`sequence`, \n MeIt.`target`, MeItPa.`parent`\n from (\n select\n MeIt.`id` as menuItem, MeItPa.`page`, MeItPa.`postfix`,\n MeIt.`url`, MeIt.`sequence`, MeIt.`target`\n from (\n select \n MeIt.`id`, MeIt.`url`, UrTa.`target`, MeIt.`sequence`\n from `MenuItems` as MeIt left join `UrlTarget` as UrTa\n on MeIt.`target` = UrTa.`id`\n where MeIt.`menu` = '" . $this->menuName . "'\n ) as MeIt left join `MenuItemsPage` as MeItPa\n on MeIt.`id` = MeItPa.`menuItem`\n ) as MeIt left join `MenuItemParent` as MeItPa\n on MeIt.`menuItem` = MeItPa.`menuItem`\n order by MeIt.`sequence` asc"; $mySqlHelper = new MySqlHelper($query); $this->menuItemsData = $mySqlHelper->getAllData(); foreach ($this->menuItemsData as $menuItem) { //$this->menuItems['parent']['menuItem']['key']; $parent = 0; if ($this->checkValue($menuItem['parent'])) { $parent = $menuItem['parent']; } $this->menuItems[$parent][$menuItem['menuItem']]['menuItem'] = $menuItem['menuItem']; $this->menuItems[$parent][$menuItem['menuItem']]['page'] = $menuItem['page']; $this->menuItems[$parent][$menuItem['menuItem']]['postfix'] = $menuItem['postfix']; $this->menuItems[$parent][$menuItem['menuItem']]['url'] = $menuItem['url']; $this->menuItems[$parent][$menuItem['menuItem']]['target'] = $menuItem['target']; $title = $this->getMenuLang($menuItem['menuItem']); $this->menuItems[$parent][$menuItem['menuItem']]['title'] = $title['title']; } }
private function getCategories() { $query = "select * from `MaterialsInCategories` where `material`='{$this->malerial}'"; $mySqlHelper = new MySqlHelper($query); $this->malerialData['categories'] = $mySqlHelper->getAllData(); }
/** * Получение параметров модуля. * @param String $createdModules - ID созданного модуля. * @return array - массив параметров. */ private function getModulesParam($createdModules) { $query = "Select * from `ModulesParam` where `module`='" . $createdModules . "';"; $mySqlHelper = new MySqlHelper($query); return $mySqlHelper->getAllData(); }
private function checkPageAlias($alias) { $query = "Select `alias` from `Pages` where `alias`='{$alias}';"; $mySqlHelper = new MySqlHelper($query); $pagesInfo = $mySqlHelper->getAllData(); return count($pagesInfo) > 0 ? true : false; }
/** * Получение параметров страницы */ private function getPageParam() { $query = "Select * from `PageParam` where `page`='" . $this->page . "'"; $mySqlHelper = new MySqlHelper($query); $this->pageParam = $mySqlHelper->getAllData(); }
private function getAllLengs() { $query = "Select * from `Lang` order by `default` desc;"; $mySqlHelper = new MySqlHelper($query); $this->langs = $mySqlHelper->getAllData(); }
private function getSlidesData() { $query = "select * from `Slides` where `slider`='" . $this->name . "' order by `sequence` asc;"; $mySqlHelper = new MySqlHelper($query); $this->data['slides'] = $mySqlHelper->getAllData(); }
/** * Получение списка параметров для плагина. * @param type $id - id плагина. * @param type $plugin - имя плагина. */ private function getPluginParam($id, $plugin) { $query = "Select * from `PluginDefaultParam` where `plugin`='" . $plugin . "'"; $mySqlHelper = new MySqlHelper($query); $this->pluginsParam[$plugin]['default'] = $mySqlHelper->getAllData(); $query = "Select * from `PluginParam` where `plugin`='" . $id . "'"; $mySqlHelper = new MySqlHelper($query); $this->pluginsParam[$plugin]['page'] = $mySqlHelper->getAllData(); }