public function actionGallery() { if (isset($_REQUEST["view"]) && !isset($_REQUEST["id"])) { $view = $this->request->view; $obj = new ViewgalleryDB(); $obj->load($view); $this->title = $obj->title; $this->meta_desc = $obj->meta_desc; $this->meta_key = $obj->meta_key; $head = $this->getHead(array("/css/main.css"), false); $content = new Gallery(); $content->items = GalleryDB::getItemsOnView($view); $head->add("js", null, true); $head->js = array("/js/main.js"); $hornav = $this->getHornav(); $hornav->addData("Фотогалерея", URL::get("gallery", "")); $hornav->addData($obj->title); $content->hornav = $hornav; $content->header = $obj->title; $this->render($head, $content); } else { if (isset($_REQUEST["view"]) && isset($_REQUEST["id"])) { $view = $this->request->view; $id = $this->request->id; $obj = new GalleryDB(); $obj->load($id); $this->title = $obj->title; $this->meta_desc = $obj->meta_desc; $this->meta_key = $obj->meta_key; $head = $this->getHead(array("/css/main.css", "/css/lightbox.css"), false); $content = new Imggallery(); $content->items = ImggalleryDB::getImagesOnGalleryId($id); $head->add("js", null, true); $head->js = array("/js/main.js", "/js/lightbox-2.6.min.js"); $v = new ViewgalleryDB(); $v->load($view); $hornav = $this->getHornav(); $hornav->addData("Фотогалерея", URL::get("gallery", "")); $hornav->addData($v->title, URL::get("gallery", "", array("view" => $v->id))); $hornav->addData($obj->title); $content->hornav = $hornav; $content->header = $obj->title; $content->title = $obj->title; $this->render($head, $content); } else { $this->title = "Фотогалерея"; $this->meta_desc = "Фотогалерея"; $this->meta_key = "Фотогалерея"; $head = $this->getHead(array("/css/main.css"), false); $content = new Viewgallery(); $content->items = ViewgalleryDB::getAllShow(); $head->add("js", null, true); $head->js = array("/js/main.js"); $hornav = $this->getHornav(); $hornav->addData("Фотогалерея"); $content->hornav = $hornav; $content->header = "Фотогалерея"; $this->render($head, $content); } } }