public function indexAction() { $Params = $this->_getParam('params'); $ThisPage = $this->_getParam('Page'); $Page = new App_Model_DbTable_Pages(); $this->view->page = $Page->getPageFromID($ThisPage['IDPagina']); }
public function editAction() { $Gallery = new App_Model_DbTable_Gallery(); $Pages = new App_Model_DbTable_Pages(); $Form = new Admin_Form_Album(); $Form->Submit->setLabel('Edit'); $Form->IDPage->addMultiOptions($this->view->printSelectPages($Pages->getTreePages())); $this->view->form = $Form; if ($this->getRequest()->isPost()) { $FormData = $this->getRequest()->getPost(); if ($Form->isValid($FormData)) { $IDAlbum = $Form->getValue('IDAlbum'); $IDPage = $Form->getValue('IDPage'); $Title = $Form->getValue('Title'); $Description = $Form->getValue('Description'); $Gallery->updateAlbum($IDAlbum, $Title, $Description, $IDPage); $this->_helper->redirector('index'); } else { $Form->populate($FormData); } } else { $IDAlbum = (int) $this->_getParam('IDAlbum', 0); if ($IDAlbum) { $Form->populate($Gallery->getAlbum($IDAlbum)); } } }
public function editAction() { $News = new App_Model_DbTable_News(); $Page = new App_Model_DbTable_Pages(); $Form = new Admin_Form_News(); $Form->Submit->setLabel('Edit'); $Form->IDPage->addMultiOptions($this->view->printSelectPages($Page->getNewsPages())); $this->view->form = $Form; if ($this->getRequest()->isPost()) { $FormData = $this->getRequest()->getPost(); if ($Form->isValid($FormData)) { $IDNews = (int) $Form->getValue('IDNews'); $Title = $Form->getValue('Title'); $Text = $Form->getValue('Text'); $IDPage = $Form->getValue('IDPage'); $News->updateNews($IDNews, $Title, $Text, $IDPage); $this->_helper->redirector('index'); } else { $Form->populate($FormData); } } else { $IDNews = (int) $this->_getParam('IDNews', 0); if ($IDNews) { $News = new App_Model_DbTable_News(); $Form->populate($News->getNews($IDNews)); } } }
public function deleteAction() { $IDPage = (int) $this->_getParam('IDPage', 0); if ($IDPage) { $Page = new App_Model_DbTable_Pages(); $Page->deletePage($IDPage); $this->_helper->redirector('index'); } }
public function menu() { $Pages = new App_Model_DbTable_Pages(); $Menu = $Pages->getMainMenu(); array_unshift($Menu, array('Titolo' => 'Home', 'URI' => '/')); $MenuStr = '<ul>'; foreach ($Menu as $M) { $MenuStr .= '<li><a href="' . $M['URI'] . '" title="' . $M['Titolo'] . '">' . $M['Titolo'] . '</a></li>'; } $MenuStr .= '</ul>'; return $MenuStr; }
public function match($Path, $Partial = false) { $Path = trim($Path, '/'); $Params = explode('/', $Path); if (array_shift($Params) == 'pages') { $Pages = new App_Model_DbTable_Pages(); $Page = $Pages->getPageFromURL($Params); if ($Page) { return array('controller' => $Page['Tipo'], 'action' => 'index', 'params' => $Params, 'Page' => $Page); } } return false; }