public function sliderAction()
 {
     //$page      = $this->_getParam('page');
     $pic_proxy = new SxCms_Page_Picture_Proxy();
     $pics = $pic_proxy->getRandomByPage(0, $this->_getParam('lng', 'nl'));
     $this->view->pic = $pics;
 }
Example #2
0
 public function getByPageId($page_id, $lng = 'nl')
 {
     $proxy = new SxCms_Page_Picture_Proxy();
     return $proxy->getAllByPage($page_id, 0, $lng);
 }
 public function removeAction()
 {
     $picture_id = $this->_getParam('id');
     $proxy = new SxCms_Page_Picture_Proxy();
     $picture = $proxy->getSingle($picture_id);
     $picture->delete();
     $original = APPLICATION_ROOT . '/public_html/images/page/page_' . $picture->getPageId() . '/' . $picture->getFile();
     $thumb = APPLICATION_ROOT . '/public_html/images/page/page' . $picture->getPageId() . '/100x100/' . $picture->getFile();
     $smallimage = APPLICATION_ROOT . '/public_html/images/page/page' . $picture->getPageId() . '/100x65/' . $picture->getFile();
     $image = APPLICATION_ROOT . '/public_html/images/page/page' . $picture->getPageId() . '/500x268/' . $picture->getFile();
     if (file_exists($original)) {
         unlink($original);
     }
     if (file_exists($thumb)) {
         unlink($thumb);
     }
     if (file_exists($smallimage)) {
         unlink($smallimage);
     }
     if (file_exists($image)) {
         unlink($image);
     }
     $this->_helper->layout()->disableLayout();
     $this->view->result = Zend_Json::encode(array('success' => true));
     $this->render('result');
 }