Ejemplo n.º 1
0
 function before()
 {
     parent::before();
     $this->template->bc['messages'] = 'Запросы пользователей';
     // add class for news pages
     $this->template->css_class = 'wrapper-news';
 }
Ejemplo n.º 2
0
 public function before()
 {
     parent::before();
     $this->template->bc['reviews'] = 'Отзывы об автосервисах Москвы и России';
     // add class for news pages
     $this->template->css_class = 'wrapper-news';
 }
Ejemplo n.º 3
0
 public function before()
 {
     parent::before();
     if ($this->request->action() == 'view') {
         Model_Service::generate_ratings();
     }
 }
Ejemplo n.º 4
0
 public function before()
 {
     parent::before();
     $this->template->bc['participants'] = 'Участники';
     // add class for news pages
     $this->template->css_class = 'wrapper-news';
 }
Ejemplo n.º 5
0
 function before()
 {
     parent::before();
     if (!$this->auth->logged_in()) {
         Message::set(Message::ERROR, 'Доступ закрыт, авторизуйтесь');
         $this->request->redirect('login');
     }
     if (empty($this->user->expires)) {
         $user_expires = new DateTime();
         $user_expires->modify("-1 day");
     } else {
         $user_expires = new DateTime($this->user->expires);
     }
     //  проверка на позможность использования кабинета
     /*if (!$this->allow_expired && Date::diff($user_expires->format("Y-m-d 23:59:59"),date("Y-m-d")) <= 0 ) {
     			Message::set(Message::ERROR, 'Аккаунт заблокирован. Пожалуйста, пополните счет');
     			$this->request->redirect('/cabinet/payment/add');
     		}*/
     if (!empty($this->user->expires)) {
         $exp = Date::diff($user_expires->format("Y-m-d"), date("Y-m-d"), 'days');
         $exp++;
         // текущий день - опказываем как день
         if ($exp >= 0 && $exp <= 5) {
             Message::set(Message::NOTICE, 'Внимание, осталось <strong>' . $exp . " " . MyHelper::morph($exp, "день", "дня", "дней") . ' </strong> использования аккаунтом');
         }
     }
     $this->template->bc['cabinet'] = 'Личный кабиент';
 }
Ejemplo n.º 6
0
 /**
  * Before action
  */
 public function before()
 {
     parent::before();
     // Получаем статус ошибки
     $status = (int) $this->request->action();
     // Если вызов из строки браузера (http://example.com/error/500)
     if (Request::$initial === Request::$current) {
         $status = 404;
         $this->response->status($status);
         $this->request->action($status);
     } else {
         // Если кода ошибки нет в списке обрабатываемых
         if (!in_array($status, [403, 404, 500, 503])) {
             $status = 404;
             $this->response->status($status);
             $this->request->action($status);
         } else {
             $this->response->status($status);
             $message = $this->request->param('message');
             // Если стандартное сообщение 404
             if (UTF8::strpos($message, 'Unable to find a route to match the URI') !== false) {
                 // Не будем выводить message
                 //$message = '';
             }
         }
     }
     $this->content = View::factory('errors/' . $status)->bind('message', $message);
 }
Ejemplo n.º 7
0
 public function before()
 {
     parent::before();
     if (Request::current()->is_ajax() == FALSE) {
         $this->template->header_block = View::factory('layout/header_block')->set('header_title', 'Sample Photo Demo');
         $this->template->body = View::factory('body/interface');
     }
 }
Ejemplo n.º 8
0
 public function before()
 {
     parent::before();
     $this->_search_modes = array_flip($this->_search_modes);
     foreach ($this->_search_modes as $mode => $value) {
         $this->_search_modes[$mode] = __('site_search_' . $mode);
     }
 }
Ejemplo n.º 9
0
 public function before()
 {
     parent::before();
     $this->template->title = 'Статьи';
     $this->template->bc['articles'] = $this->template->title;
     // add class for news pages
     $this->template->css_class = 'wrapper-news';
 }
Ejemplo n.º 10
0
 function before()
 {
     parent::before();
     // breadcrumbs title
     $this->template->bc['stocks'] = 'Акции автосервисов';
     // add class for news pages
     $this->template->css_class = 'wrapper-news';
 }
Ejemplo n.º 11
0
 public function before()
 {
     parent::before();
     $allowed = array('login', 'create');
     if (!$this->user instanceof Model_Client and !in_array($this->request->action, $allowed)) {
         $this->request->redirect($this->_login . '/from:' . $this->request->uri);
     }
 }
Ejemplo n.º 12
0
 public function before()
 {
     parent::before();
     $this->category_id = Request::instance()->param('id');
     // If the category id was enterd, use view action instead of index.
     if ($this->category_id && $this->request->action == 'index') {
         $this->request->action = 'view';
     }
 }
Ejemplo n.º 13
0
 public function before()
 {
     parent::before();
     //$this->add_js('assets/js/shop.js');
     // Assign the shop id to $shop_id
     $this->shop_id = Request::instance()->param('shop');
     // Make sure it's a interger and not empty
     if (!is_numeric($this->shop_id) || $this->shop_id == '') {
         Message::set(Message::ERROR, 'Shop does not exist');
         $this->request->redirect('zone');
     }
     // Retrive the shop with matching id
     $this->shop = Jelly::select('shop')->where('id', '=', $this->shop_id)->load();
 }
Ejemplo n.º 14
0
 public function before()
 {
     parent::before();
     // add class for news pages
     $this->template->css_class = 'wrapper-news';
 }
Ejemplo n.º 15
0
 public function before()
 {
     parent::before();
     $this->sidebar = View::factory('message/sidebar');
 }
Ejemplo n.º 16
0
 public function before()
 {
     parent::before();
 }
Ejemplo n.º 17
0
 public function before()
 {
     parent::before();
     $this->_config = Kohana::$config->load('pages_titles.feedback');
     $this->template->bc['feedback'] = $this->_config['title'];
 }
Ejemplo n.º 18
0
 function before()
 {
     parent::before();
     $this->template->bc['vacancies'] = 'Вакансии автосервисов';
 }
Ejemplo n.º 19
0
 public function before()
 {
     parent::before();
     $this->add_js('assets/js/jquery.columnizer.min.js');
 }