Beispiel #1
0
 public function clickAction()
 {
     $request = $this->getRequest();
     if ($request->isXmlHttpRequest() && $request->getQuery('id')) {
         Model_Extensions_Topbanner::updateClicks($request->getQuery('id'));
     } else {
         $this->redirect($request->getBaseUrl());
     }
 }
Beispiel #2
0
 private function getPageForm()
 {
     $request = $this->getRequest();
     $page_id = $request->getQuery('id');
     $pages_module = new Model_Extensions_Topbanner();
     $this->view->page_num = $this->getRequest()->getRequest('page', 1);
     $this->view->cancle = $this->getRequest()->getBaseUrl() . $this->getRequest()->getModule() . '/extensions/edit/?extension=topbanner&page=' . $this->view->page_num;
     if ($this->error) {
         $this->view->error_warning = implode('; ', $this->error);
     }
     if ($page_id) {
         $page_info = $pages_module->get($page_id);
     }
     if ($request->getPost('name')) {
         $this->view->name = $request->getPost('name');
     } elseif (isset($page_info)) {
         $this->view->name = $page_info['name'];
     } else {
         $this->view->name = '';
     }
     if ($request->getPost('url')) {
         $this->view->url = $request->getPost('url');
     } elseif (isset($page_info)) {
         $this->view->url = $page_info['url'];
     } else {
         $this->view->url = '';
     }
     if ($request->getPost('html')) {
         $this->view->html = $request->getPost('html');
     } elseif (isset($page_info)) {
         $this->view->html = $page_info['html'];
     } else {
         $this->view->html = '';
     }
     if ($request->getPost('background')) {
         $this->view->background = $request->getPost('background');
     } elseif (isset($page_info)) {
         $this->view->background = $page_info['background'];
     } else {
         $this->view->background = '';
     }
     if ($request->getPost('from')) {
         $this->view->from = $request->getPost('from');
     } elseif (isset($page_info)) {
         if ($page_info['from'] == '0000-00-00') {
             $this->view->from = '';
         } else {
             $this->view->from = JO_Date::getInstance($page_info['from'], 'dd.mm.yy', true)->toString();
         }
     } else {
         $this->view->from = '';
     }
     if (is_numeric($request->getPost('cookie'))) {
         $this->view->cookie = $request->getPost('cookie');
     } elseif (isset($page_info)) {
         $this->view->cookie = $page_info['cookie'];
     } else {
         $this->view->cookie = '';
     }
     if ($request->getPost('to')) {
         $this->view->to = $request->getPost('to');
     } elseif (isset($page_info)) {
         if ($page_info['to'] == '0000-00-00') {
             $this->view->to = '';
         } else {
             $this->view->to = JO_Date::getInstance($page_info['to'], 'dd.mm.yy', true)->toString();
         }
     } else {
         $this->view->to = '';
     }
     if ($request->getPost('close')) {
         $this->view->close = $request->getPost('close');
     } elseif (isset($page_info)) {
         $this->view->close = $page_info['close'];
     } else {
         $this->view->close = 'true';
     }
     if ($request->getPost('width')) {
         $this->view->width = $request->getPost('width');
     } elseif (isset($page_info)) {
         $this->view->width = $page_info['width'];
     } else {
         $this->view->width = 976;
     }
     if ($request->getPost('height')) {
         $this->view->height = $request->getPost('height');
     } elseif (isset($page_info)) {
         $this->view->height = $page_info['height'];
     } else {
         $this->view->height = 50;
     }
     /////// logo
     $image_model = new Model_Images();
     if ($request->getPost('photo')) {
         $this->view->photo = $request->getPost('photo');
     } elseif (isset($page_info)) {
         $this->view->photo = $page_info['photo'];
     } else {
         $this->view->photo = '';
     }
     if ($this->view->photo) {
         $this->view->preview = $image_model->resize($this->view->photo, 100, 100);
     } else {
         $this->view->preview = $image_model->resize(JO_Registry::forceGet('no_image'), 100, 100);
     }
     if (!$this->view->preview) {
         $this->view->preview = $image_model->resize(JO_Registry::forceGet('no_image'), 100, 100);
     }
     if (!$this->view->preview) {
         $this->view->preview = $image_model->resize('/no_image.png', 100, 100);
     }
     $this->view->preview_no_image = $image_model->resize(JO_Registry::forceGet('no_image'), 100, 100);
     if (!$this->view->preview_no_image) {
         $this->view->preview_no_image = $image_model->resize('/no_image.png', 100, 100);
     }
 }