예제 #1
0
 public function __construct()
 {
     if (Cookie::get('Locale') && in_array(strtolower(Cookie::get('Locale')), Helper::$Locales)) {
         Locale::getInstance()->setLocale(Cookie::get('Locale'));
     }
     parent::__construct();
     $this->getSite()->addWrappedCss('style.css');
     $this->getSite()->addWrappedJs('jquery-1.6.2.min.js');
     $this->getSite()->addWrappedJs('global.js');
     $this->getSite()->setTitle('mp3vibez.com');
     $this->globalMenu = new \Pecee\UI\Menu\Menu();
     $this->globalMenu->addItem(lang('Search.Search'), '#' . url())->addClass('active');
 }
 public function handle(Request $request, ILoadableRoute &$route = null)
 {
     $locale = 'en_gb';
     if (Cookie::get('lang')) {
         $locale = Cookie::get('lang');
     }
     if (input()->get('lang') && in_array(strtolower(input()->get('lang')), $this->supportedLanguages)) {
         /* Site main language */
         $locale = input()->get('lang');
         Cookie::create('lang', input()->get('lang'));
     }
     app()->setLocale($locale);
 }
예제 #3
0
 public static function getTicket()
 {
     if (Cookie::exists(static::COOKIE_NAME) === false) {
         return null;
     }
     $ticket = Guid::decrypt(static::getSalt(), Cookie::get(static::COOKIE_NAME));
     if ($ticket !== false) {
         $ticket = explode('|', $ticket);
         return count($ticket) > 0 ? $ticket : null;
     }
     return null;
 }
예제 #4
0
 public function getActiveOrganisation()
 {
     return Cookie::get(self::ORGANISATION_COOKIE_KEY, null);
 }