public function pageAction() { // action body $idpage = $this->_getParam('idpage', 0); $this->view->content = Model_Page::getById($idpage, $this->view->lang); $this->view->gallery = Model_Image::getAll($this->view->content->idgallery); $this->view->video = Model_Image::getAll($this->view->content->idvideo); $this->view->audio = Model_Image::getAll($this->view->content->idaudio); if (is_object($this->view->content)) { $this->view->pageTitle = $this->view->content->title; $this->view->headMeta()->appendName('keywords', $this->view->content->keyword); $this->view->headMeta()->appendName('description', $this->view->content->description); } //@TODO додати на сторінку title keywords description }
public function audioAction() { $this->view->menu_audio = 'selected'; $this->view->item = $this->_getParam('item', 'new'); $this->view->audio = Model_Gallery::getAll('audio'); //перевіряємо на видалення $delete = $this->_getParam('delete', false); if ($delete && Zend_Validate::is($this->view->item, 'Digits')) { Model_Gallery::deletegallery($this->view->item); $this->_redirect('/admin/audio'); } // якщо треба отримати дані за id меню if (Zend_Validate::is($this->view->item, 'Digits')) { if ($this->_request->isPost()) { $selectedtracks = $this->_getParam('mp3folder'); if (count($selectedtracks) > 0) { foreach ($selectedtracks as $track) { Model_Image::addTrack($this->view->item, $track); } return $this->_redirect('/admin/audio/item/' . $this->view->item); } } $this->view->data = Model_Gallery::getById($this->view->item); $this->view->listmp3 = @scandir($this->view->config->mp3folder); $this->view->tracklist = Model_Image::getAll($this->view->item); } else { $this->view->data = Model_Gallery::getById(NULL); } $this->renderScript('admin/audio/audio.phtml'); }
private function imagesList($idgallery) { $data = Model_Image::getAll($idgallery); if (is_object($data)) { $res = ''; foreach ($data as $value) { $res .= "\n<div style=\"float: left; text-align: center; margin-bottom: 4px;\">\n <img src=\"/public/gallery/small/" . $value["idgallery"] . "_" . $value["idimage"] . ".jpg\" style=\"float: left; border: 1px solid; margin-left: 2px;\"><br>\n <input type=\"text\" onchange=\"\$.post('/ajax/path', {item: " . $value["idimage"] . ", path: \$(this).val()})\"\n value=\"" . $value["path"] . "\"><br />\n <input type=\"button\" onclick=\"\$.get('/ajax/delimg/item/" . $value["idimage"] . "', function(data){ \$('.photolist').html(data)});\" class=\"admin_buttonfield\"\n value=\"Видалити\">\n</div>"; } echo $res; } }