示例#1
0
 /**
  * Получение из базы списка блоков шаблона указанной страницы.
  */
 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'];
     }
 }
示例#2
0
 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'];
     }
 }
示例#3
0
 private function getCategories()
 {
     $query = "select * from `MaterialsInCategories` where `material`='{$this->malerial}'";
     $mySqlHelper = new MySqlHelper($query);
     $this->malerialData['categories'] = $mySqlHelper->getAllData();
 }
示例#4
0
 /**
  * Получение параметров модуля.
  * @param String $createdModules - ID созданного модуля.
  * @return array - массив параметров.
  */
 private function getModulesParam($createdModules)
 {
     $query = "Select * from `ModulesParam` where `module`='" . $createdModules . "';";
     $mySqlHelper = new MySqlHelper($query);
     return $mySqlHelper->getAllData();
 }
示例#5
0
 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;
 }
示例#6
0
 /**
  * Получение параметров страницы
  */
 private function getPageParam()
 {
     $query = "Select * from `PageParam` where `page`='" . $this->page . "'";
     $mySqlHelper = new MySqlHelper($query);
     $this->pageParam = $mySqlHelper->getAllData();
 }
示例#7
0
 private function getAllLengs()
 {
     $query = "Select * from `Lang` order by `default` desc;";
     $mySqlHelper = new MySqlHelper($query);
     $this->langs = $mySqlHelper->getAllData();
 }
示例#8
0
 private function getSlidesData()
 {
     $query = "select * from `Slides` where `slider`='" . $this->name . "' order by `sequence` asc;";
     $mySqlHelper = new MySqlHelper($query);
     $this->data['slides'] = $mySqlHelper->getAllData();
 }
示例#9
0
 /**
  * Получение списка параметров для плагина.
  * @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();
 }