Пример #1
0
 /**
  * Определям абстракную функцию, выводяшию страницу на редактирование
  */
 protected function adminEditNode($id)
 {
     $container = $this->builder->components()->template()->get('app:News/edit');
     $query = $this->builder->components()->orm()->query($this->table);
     $container->article = $query->in($id)->findOne();
     if (!$container->article) {
         return $this->return404();
     }
     $container->pageTitle = "Редактирование Новости";
     $container->formAction = "edit";
     $this->setGlobalProperty($container);
     return $container;
 }
Пример #2
0
 private function getBase($structOnle = true)
 {
     $tables = $this->getNameTables();
     $res = array();
     foreach ($tables as $key => $value) {
         if ($value == "users") {
             continue;
         }
         //Убираем информацию по паролям
         $table = (array) $this->builder->components()->database()->get()->execute("SHOW CREATE TABLE " . $value)->asArray(true)[0];
         $res[$key]["table"] = $table["Table"];
         $res[$key]["create"] = $table["Create Table"];
         if (!$structOnle) {
             $res[$key]["text"] = $this->getText();
         }
     }
     return $res;
 }
Пример #3
0
 public function defaultAction(Request $request)
 {
     $id = $request->attributes()->get('id');
     if (isset($id)) {
         // $results['pageTitle'] = "Здвинская централизованная библиотечная система |";
         $container = $this->builder->components()->template()->get('app:Gallery/list');
         $container->galleries = $this->orm->query('gallery')->where("id_galery", $id)->find();
         $container->parend = $this->orm->query('gallery')->in($id)->findOne();
         $container->title = $container->parend->title_galery;
         $container->pageTitle = "Здвинская централизованная библиотечная система |" . $container->title;
         $container->description = $container->parend->txt;
     } else {
         $container = $this->builder->components()->template()->get('app:Gallery/view');
         $container->pageTitle = "Здвинская централизованная библиотечная система | Наша галерея";
         $container->description = "На этой страницы представленны изображения относящееся к Здвинской библиотеке или ЦБС Здвинск";
         $id_galery = "0";
         $container->galleries = $this->orm->query('gallery')->where("id_galery", $id_galery)->find();
     }
     $this->setGlobalProperty($container);
     return $container;
 }
Пример #4
0
 /**
  * Общие для всех страниц изменяемые свойства
  *
  * @param      &     $container  (description)
  */
 protected function setGlobalProperty(&$container)
 {
     $auth = $this->domain()->user();
     $container->adminMenu = is_null($auth) ? false : true;
     if ($auth != null) {
         $container->user = $auth->username;
     }
     $container->function = $this->builder->menu();
     $container->menu = $this->builder->menu()->buildMenu($this->builder->components()->orm());
     $container->bunersLeft = $this->getBuner(true);
     $container->bunersRight = $this->getBuner(false);
     $container->eyeless = $this->getEyeless();
 }