예제 #1
0
 public function __construct($request, $response)
 {
     $this->info = new AdminInfo();
     $this->translator = FrontHelper::getTranslation();
     View::set_global('translator', $this->translator);
     parent::__construct($request, $response);
 }
예제 #2
0
파일: base.php 프로젝트: ryross/kobase
 public function __construct(Request $request)
 {
     if (Request::$is_ajax) {
         $this->profiler = NULL;
         $this->auto_render = FALSE;
     }
     $this->session = Session::instance();
     parent::__construct($request);
 }
예제 #3
0
 public function __construct($request)
 {
     parent::__construct($request);
     $this->template = View::factory('hmo_masterpage');
     $config = Kohana_Config::instance()->load("config");
     $this->site = $config['app_path'];
     $this->session = Session::instance();
     if ($this->authenticate) {
         $this->authenticate();
     }
     $this->message = I18n::load('en-us');
 }
예제 #4
0
파일: admin.php 프로젝트: kerkness/shindig
 public function __construct(Request $request)
 {
     parent::__construct($request);
     if (!Kohana::config('shindig.use_authentication')) {
         // Redirect to the home page
         $this->request->redirect('');
     }
     if ($user = Cookie::get('authorized')) {
         $user = Sprig::factory('user', array('username' => $user))->load();
         if ($user->loaded()) {
             // User is logged in
             $this->user = $user;
             Shindig::$has_auth = TRUE;
         }
     }
     if (!$this->user) {
         // Force the user to login
         $this->request->action = 'login';
     }
 }
예제 #5
0
 public function __construct(Request $request, Response $response)
 {
     parent::__construct($request, $response);
     if (!isset($_COOKIE['cms_milestone_language'])) {
         setcookie('cms_milestone_language', I18n::lang(), time() + 60 * 60 * 24 * 30);
     }
     if (isset($_POST['language_website'])) {
         setcookie('cms_milestone_language', $this->request->post('language_website'), time() + 60 * 60 * 24 * 30);
         $new_adress = $this->request->post('language_website') . substr($this->request->uri(), strpos($this->request->uri(), '/'));
         HTTP::redirect(URL::site($new_adress, TRUE), 302);
     }
     if (!$this->request->param('language')) {
         print_r($_COOKIE);
         if (isset($_COOKIE['cms_milestone_language'])) {
             HTTP::redirect($_COOKIE['cms_milestone_language'] . '/' . $this->request->uri(), 302);
         } else {
             HTTP::redirect(I18n::lang() . '/' . $this->request->uri(), 302);
         }
     }
     I18n::lang($this->request->param('language'));
     $this->_session = Session::instance();
     $this->_auth = Auth::instance();
     /*
     if( !empty( $_COOKIE['cms_lang'] ) )
     {
     	if( isset( $_POST['cms_lang'] ) )
     	{
             		I18n::lang($_POST['cms_lang']);
     		setcookie( 'cms_lang', $_POST['cms_lang'], time()+(60*60*24*30) );
     		HTTP::redirect( $_SERVER['REQUEST_URI'] );
     	}
     }
     else 
     {
     	I18n::lang('pl-pl');
     	setcookie( 'cms_lang', 'pl-pl', time()+(60*60*24*30) );
     }
     */
 }
예제 #6
0
파일: site.php 프로젝트: jmhobbs/Sanity
 public function __construct($request)
 {
     $session = Session::instance();
     $mobile = $session->get('mobile');
     if (isset($_REQUEST['mobile'])) {
         $mobile = true == $_REQUEST['mobile'];
     }
     if (is_null($mobile)) {
         $ua = $_SERVER['HTTP_USER_AGENT'];
         $matches = array('/iPhone/i', '/iPod/i', '/iPad/i');
         $mobile = false;
         foreach ($matches as $match) {
             if (preg_match($match, $ua)) {
                 $mobile = true;
                 break;
             }
         }
     }
     $session->set('mobile', $mobile);
     if ($mobile) {
         $this->template = 'mobile';
     }
     parent::__construct($request);
 }
예제 #7
0
 function __construct(Request $request)
 {
     parent::__construct($request);
 }
예제 #8
0
 function __construct($request, $response)
 {
     parent::__construct($request, $response);
 }
예제 #9
0
 public function __construct(Kohana_request $request)
 {
     parent::__construct($request);
 }
예제 #10
0
 public function __construct(\Request $request, \Response $response)
 {
     $this->force_this_main_template = 'blank';
     parent::__construct($request, $response);
 }
예제 #11
0
파일: base.php 프로젝트: hbarroso/Goworkat
 /**
  * Default class construct
  */
 public function __construct($request, $response)
 {
     $this->config = Kohana::$config->load('application');
     parent::__construct($request, $response);
 }