1 | <?php |
||
8 | class LanguageComponent implements Component |
||
9 | { |
||
10 | protected $request; |
||
11 | protected $parameters; |
||
12 | |||
13 | protected $defaultLanguage = 'en'; |
||
14 | protected $acceptedLanguages = null; |
||
15 | protected $languageParameterName = 'language'; |
||
16 | protected $forceRedirect = false; |
||
17 | protected $sessionValues; |
||
18 | |||
19 | /** |
||
20 | * Component constructor. |
||
21 | * |
||
22 | * @param $template |
||
23 | * @param Request $request |
||
24 | * @param $parameters |
||
25 | * @param $matchedSitemapItem |
||
26 | */ |
||
27 | public function __construct($template, Request $request, $parameters, $matchedSitemapItem) |
||
43 | |||
44 | /** |
||
45 | * Checks to see if any parameters are given from the configuration in the CMS |
||
46 | */ |
||
47 | private function checkParameters() |
||
66 | |||
67 | /** |
||
68 | * @return array |
||
69 | */ |
||
70 | public function getParameters() |
||
74 | |||
75 | |||
76 | /** |
||
77 | * Check if the found language is allowed and |
||
78 | * if an action is to be taken. |
||
79 | * |
||
80 | * @param $lang |
||
81 | * @param $request |
||
82 | */ |
||
83 | private function detectLanguage($lang, $request) |
||
104 | |||
105 | /** |
||
106 | * Detect if the language is switched manually |
||
107 | * |
||
108 | * @param $request |
||
109 | */ |
||
110 | private function checkLanguageSwitch($request) |
||
117 | |||
118 | /* |
||
119 | * These functions are required by the interface, but not for the functionality |
||
120 | */ |
||
121 | public function run(Storage $storage) {} |
||
124 | } |