This repository has been archived on 2019-04-06. You can view files and clone it, but cannot push or open issues or pull requests.
onemove/application/classes/controller/navigation.php

22 lines
988 B
PHP

<?php defined('SYSPATH') or die('No direct script access.');
class Controller_Navigation extends Controller_Template {
public $template = 'navigation/actions';
public function action_actions() {
$this->template = new View('navigation/actions');
$login_or_logout = HTML::anchor('login', 'Вход');
if (Kohana::config('common.vote_opens') > date("Y-m-d")) $login_or_logout .= "</li><li>".HTML::anchor('register', 'Регистрация');
$this->template->login_or_logout = $login_or_logout;
if (Auth::instance()->logged_in()){
$this->template->login_or_logout = HTML::anchor('logout', 'Выход');
}
if (Auth::instance()->logged_in('admin')){
$this->template->admin_actions = View::factory('navigation/admin')->render();
}
if (Auth::instance()->logged_in('author') or Auth::instance()->logged_in('admin')){
$this->template->user_actions = View::factory('navigation/user')->render();
}
}
public function action_view(){$this->request->redirect('');}
}