_redirect('*/*/view'); } public function photoAction() { $gallery_id = $this->getRequest()->getParam('id'); if(!$gallery_id) $gallery_id = 0; $model = Mage::getModel('gallery/toitgallery')->load($gallery_id); Mage::register('current_gallery', $model); if ($this->getRequest()->isXmlHttpRequest()) { $this->loadLayout(); $block = $this->getLayout()->createBlock('gallery/gallery','Gallery'); $block->setTemplate('gallery/photo.phtml'); print $block->toHtml(); ; }else{ $this->loadLayout(); $this->renderLayout(); } } public function viewAction() { $gallery_id = $this->getRequest()->getParam('id'); if(!$gallery_id) $gallery_id = 0; $model = Mage::getModel('gallery/toitgallery')->load($gallery_id); Mage::register('current_gallery', $model); $this->loadLayout(); if($head = $this->getLayout()->getBlock('head')){ if($model->getGalleryId()){ $head->setTitle($model->getTitle()); $head->setKeywords($model->getMetaKeywords()); $head->setDescription($model->getMetaDescription()); }else{ $head->setTitle(Mage::helper('gallery')->__('Gallery')); $head->setKeywords(Mage::helper('gallery')->__('Gallery')); $head->setDescription(Mage::helper('gallery')->__('Gallery')); } } $this->renderLayout(); } }