function before() { parent::before(); $this->template->bc['messages'] = 'Запросы пользователей'; // add class for news pages $this->template->css_class = 'wrapper-news'; }
public function before() { parent::before(); $this->template->bc['reviews'] = 'Отзывы об автосервисах Москвы и России'; // add class for news pages $this->template->css_class = 'wrapper-news'; }
public function before() { parent::before(); if ($this->request->action() == 'view') { Model_Service::generate_ratings(); } }
public function before() { parent::before(); $this->template->bc['participants'] = 'Участники'; // add class for news pages $this->template->css_class = 'wrapper-news'; }
/** * 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); }
public function after() { parent::after(); if ($this->request->action() == 'view') { ORM::factory('visit')->save_visit(); } }
function before() { parent::before(); // breadcrumbs title $this->template->bc['stocks'] = 'Акции автосервисов'; // add class for news pages $this->template->css_class = 'wrapper-news'; }
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); } }
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); } }
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'; }
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'; } }
/** * @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); }
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(); }
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(); }
public function after() { parent::after(); }
public function before() { parent::before(); // add class for news pages $this->template->css_class = 'wrapper-news'; }
public function before() { parent::before(); $this->add_js('assets/js/jquery.columnizer.min.js'); }
public function before() { parent::before(); $this->sidebar = View::factory('message/sidebar'); }
/** * @see parent::__construct() */ public function __construct() { parent::__construct(); $this->setView(new View_Frontend_Service()); }
public function before() { parent::before(); }
public function before() { parent::before(); $this->_config = Kohana::$config->load('pages_titles.feedback'); $this->template->bc['feedback'] = $this->_config['title']; }
public function __construct() { parent::__construct(); $this->setView(new View_Frontend_Catalog()); }
function before() { parent::before(); $this->template->bc['vacancies'] = 'Вакансии автосервисов'; }