Skip to content

Commit

Permalink
renamed config key switches to prefilter and renamed subkeys to the n…
Browse files Browse the repository at this point in the history
…ame of the prefilter
  • Loading branch information
jakoch committed Sep 24, 2012
1 parent 721bc18 commit 7ee79e3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions Clansuite/Configuration/Staging/development.php
Expand Up @@ -81,11 +81,11 @@
tag = ""
;----------------------------------------
; switches
; prefilter
;----------------------------------------
[switches]
themeswitch_via_url = 0
languageswitch_via_url = 0
[prefilter]
theme_via_get = 0
language_via_get = 0
;----------------------------------------
; maintenance
Expand Down
6 changes: 3 additions & 3 deletions framework/Koch/Filter/Filters/LanguageViaGet.php
Expand Up @@ -59,7 +59,7 @@ class LanguageViaGet implements FilterInterface
public function __construct(Config $config)
{
// only subarray is relevant
$this->config = $config['switches'];
$this->config = $config['prefilter'];
}

public function executeFilter(HttpRequestInterface $request, HttpResponseInterface $response)
Expand All @@ -68,7 +68,7 @@ public function executeFilter(HttpRequestInterface $request, HttpResponseInterfa
* take the initiative of filtering, if language switching is enabled in CONFIG
* or pass through (do nothing) if disabled
*/
if (true === (bool) $this->config['languageswitch_via_url']) {
if (true === (bool) $this->config['language_via_get']) {
return;
}

Expand All @@ -82,7 +82,7 @@ public function executeFilter(HttpRequestInterface $request, HttpResponseInterfa
* b) that the language was set via $_GET parameter
*/
$_SESSION['user']['language'] = mb_strtolower($language);
$_SESSION['user']['language_via_url'] = 1;
$_SESSION['user']['language_via_get'] = 1;
}
}
}
4 changes: 2 additions & 2 deletions framework/Koch/Filter/Filters/ThemeViaGet.php
Expand Up @@ -50,14 +50,14 @@ class ThemeViaGet implements FilterInterface
public function __construct(Config $config, Inputfilter $input)
{
// reduce array size by selection of the section
$this->config = $config['switches'];
$this->config = $config['prefilter'];
$this->input = $input;
}

public function executeFilter(HttpRequestInterface $request, HttpResponseInterface $response)
{
// themeswitching must is enabled in configuration
if ($this->config['themeswitch_via_url'] == 1) {
if ($this->config['theme_via_get'] == 1) {
return;
}

Expand Down

0 comments on commit 7ee79e3

Please sign in to comment.