Files
firefly-iii/app/Http/Controllers/Controller.php

48 lines
1.3 KiB
PHP
Raw Normal View History

2015-02-06 04:52:16 +01:00
<?php namespace FireflyIII\Http\Controllers;
2015-02-06 04:39:52 +01:00
2015-05-14 13:41:21 +02:00
use Auth;
2015-06-13 10:02:36 +02:00
use Illuminate\Foundation\Bus\DispatchesJobs;
2015-02-06 04:39:52 +01:00
use Illuminate\Foundation\Validation\ValidatesRequests;
2015-02-11 07:35:10 +01:00
use Illuminate\Routing\Controller as BaseController;
2015-05-14 13:41:21 +02:00
use Preferences;
2015-04-28 15:26:30 +02:00
use View;
2015-02-06 04:39:52 +01:00
2015-02-11 07:35:10 +01:00
/**
* Class Controller
*
* @package FireflyIII\Http\Controllers
*/
abstract class Controller extends BaseController
{
2015-02-06 04:39:52 +01:00
2015-06-13 10:02:36 +02:00
use DispatchesJobs, ValidatesRequests;
2015-02-06 04:39:52 +01:00
2015-05-14 13:41:21 +02:00
/** @var string */
protected $monthAndDayFormat;
2015-05-16 09:41:14 +02:00
/** @var string */
2015-05-14 13:41:21 +02:00
protected $monthFormat;
2015-04-28 15:26:30 +02:00
/**
2015-05-23 20:49:57 +02:00
* @codeCoverageIgnore
2015-04-28 15:26:30 +02:00
*/
public function __construct()
{
View::share('hideBudgets', false);
View::share('hideCategories', false);
View::share('hideBills', false);
View::share('hideTags', false);
2015-05-14 13:41:21 +02:00
if (Auth::check()) {
2015-12-20 08:40:58 +01:00
$pref = Preferences::get('language', env('DEFAULT_LANGUAGE', 'en_US'));
2015-05-14 13:41:21 +02:00
$lang = $pref->data;
2015-12-24 08:35:08 +01:00
$this->monthFormat = trans('config.month');
$this->monthAndDayFormat = trans('config.month_and_day');
2015-05-14 13:41:21 +02:00
View::share('monthFormat', $this->monthFormat);
View::share('monthAndDayFormat', $this->monthAndDayFormat);
View::share('language', $lang);
2015-12-20 08:40:58 +01:00
View::share('localeconv', localeconv());
2015-05-14 13:41:21 +02:00
}
2015-04-28 15:26:30 +02:00
}
2015-02-06 04:39:52 +01:00
}