Пример #1
0
 function before()
 {
     parent::before();
     $this->template->bc['messages'] = 'Запросы пользователей';
     // add class for news pages
     $this->template->css_class = 'wrapper-news';
 }
Пример #2
0
 public function before()
 {
     parent::before();
     $this->template->bc['reviews'] = 'Отзывы об автосервисах Москвы и России';
     // add class for news pages
     $this->template->css_class = 'wrapper-news';
 }
Пример #3
0
 public function before()
 {
     parent::before();
     if ($this->request->action() == 'view') {
         Model_Service::generate_ratings();
     }
 }
Пример #4
0
 public function before()
 {
     parent::before();
     $this->template->bc['participants'] = 'Участники';
     // add class for news pages
     $this->template->css_class = 'wrapper-news';
 }
Пример #5
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);
 }
Пример #6
0
 public function after()
 {
     parent::after();
     if ($this->request->action() == 'view') {
         ORM::factory('visit')->save_visit();
     }
 }
Пример #7
0
 function before()
 {
     parent::before();
     // breadcrumbs title
     $this->template->bc['stocks'] = 'Акции автосервисов';
     // add class for news pages
     $this->template->css_class = 'wrapper-news';
 }
Пример #8
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);
     }
 }
Пример #9
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);
     }
 }
Пример #10
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';
 }
Пример #11
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';
     }
 }
Пример #12
0
 /**
  * @see parent::noMethod()
  */
 public function noMethod($method = null)
 {
     $Brand = new Product_Brand();
     $Brand = $Brand->findItem(array('Name = ' . urldecode(String::toLinkCase($method, ' ', '-'))));
     if ($Brand->Id) {
         $this->getView()->setMethod('view');
         return $this->view($Brand);
     }
     return parent::noMethod($method);
 }
Пример #13
0
 function after()
 {
     $new_notice = '';
     if (isset($this->template->notice_count['new']) and $this->template->notice_count['new'] > 0) {
         $new_notice = ' <span style="background-color: #d8a04b; color: #FFF; text-decoration: none; padding: 0 5px;">' . $this->template->notice_count['new'] . '</span>';
     }
     $menu = array('main' => array('url' => 'cabinet', 'title' => 'Панель управления', 'icon' => 'assets/img/icons/home.png'), 'profile' => array('url' => 'cabinet/profile', 'title' => __('cb_profile'), 'icon' => 'assets/img/icons/profile_mini.png'), 'company' => array('url' => 'cabinet/company', 'title' => __('cb_companies'), 'icon' => 'assets/img/icons/services_mini.png'), 'statistics' => array('url' => 'cabinet/statistics', 'title' => 'Статистика', 'icon' => 'assets/img/icons/statistics.png'), 'gallery' => array('url' => 'cabinet/gallery', 'title' => 'Галерея', 'icon' => 'assets/img/icons/gallery.png'), 'news' => array('url' => 'cabinet/news', 'title' => __('cb_news'), 'icon' => 'assets/img/icons/news_mini.png'), 'vacancy' => array('url' => 'cabinet/vacancy', 'title' => __('cb_vacancies'), 'icon' => 'assets/img/icons/vacancies_mini.png'), 'stock' => array('url' => 'cabinet/stock', 'title' => __('cb_stocks'), 'icon' => 'assets/img/icons/stocks_mini.png'), 'qa' => array('url' => 'cabinet/qa', 'title' => __('cb_questions'), 'icon' => 'assets/img/icons/questions.png'), 'adv' => array('url' => 'cabinet/adv', 'title' => __('cb_adv'), 'icon' => 'assets/img/icons/adv_mini.png'), 'feedback' => array('url' => 'cabinet/feedback', 'title' => __('cb_feedback'), 'icon' => 'assets/img/icons/feedback.png'), 'notice' => array('url' => 'cabinet/notice', 'title' => __('cb_notice') . $new_notice, 'icon' => 'assets/img/icons/notices_mini.png'), 'payment' => array('url' => 'cabinet/payment/', 'title' => __('cb_payment'), 'icon' => 'assets/img/icons/ccard.png'));
     $cabinet_template = View::factory('templates/cabinet')->set('menu_items', $menu)->set('content', $this->template->content)->set('notice_count', $this->template->notice_count)->set('expires', empty($this->user->expires) ? null : MyDate::show_small($this->user->expires))->render();
     $this->template->content = $cabinet_template;
     parent::after();
 }
Пример #14
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();
 }
Пример #15
0
 public function after()
 {
     parent::after();
 }
Пример #16
0
 public function before()
 {
     parent::before();
     // add class for news pages
     $this->template->css_class = 'wrapper-news';
 }
Пример #17
0
 public function before()
 {
     parent::before();
     $this->add_js('assets/js/jquery.columnizer.min.js');
 }
Пример #18
0
 public function before()
 {
     parent::before();
     $this->sidebar = View::factory('message/sidebar');
 }
Пример #19
0
 /**
  * @see parent::__construct()
  */
 public function __construct()
 {
     parent::__construct();
     $this->setView(new View_Frontend_Service());
 }
Пример #20
0
 public function before()
 {
     parent::before();
 }
Пример #21
0
 public function before()
 {
     parent::before();
     $this->_config = Kohana::$config->load('pages_titles.feedback');
     $this->template->bc['feedback'] = $this->_config['title'];
 }
Пример #22
0
 public function __construct()
 {
     parent::__construct();
     $this->setView(new View_Frontend_Catalog());
 }
Пример #23
0
 function before()
 {
     parent::before();
     $this->template->bc['vacancies'] = 'Вакансии автосервисов';
 }