summaryrefslogtreecommitdiff
path: root/app/Controller
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-05-07 18:05:33 -0400
committerFrederic Guillot <fred@kanboard.net>2016-05-07 18:05:33 -0400
commit55ee906ba36cf66c3a390c98dde75e241de26e65 (patch)
treeed4e5419bb6254c97d63d6a5cab5ab74536201a0 /app/Controller
parentaac11a609c58ec8356e1ca479da456876034b06c (diff)
Added support for language LDAP attribute
Diffstat (limited to 'app/Controller')
-rw-r--r--app/Controller/Config.php6
-rw-r--r--app/Controller/Currency.php1
-rw-r--r--app/Controller/Doc.php4
-rw-r--r--app/Controller/User.php14
4 files changed, 12 insertions, 13 deletions
diff --git a/app/Controller/Config.php b/app/Controller/Config.php
index a1b8c2af..021534cf 100644
--- a/app/Controller/Config.php
+++ b/app/Controller/Config.php
@@ -42,7 +42,7 @@ class Config extends Base
}
if ($this->config->save($values)) {
- $this->config->reload();
+ $this->language->loadCurrentLanguage();
$this->flash->success(t('Settings saved successfully.'));
} else {
$this->flash->failure(t('Unable to save your settings.'));
@@ -90,8 +90,8 @@ class Config extends Base
$this->common('application');
$this->response->html($this->helper->layout->config('config/application', array(
- 'languages' => $this->config->getLanguages(),
- 'timezones' => $this->config->getTimezones(),
+ 'languages' => $this->language->getLanguages(),
+ 'timezones' => $this->timezone->getTimezones(),
'date_formats' => $this->dateParser->getAvailableFormats($this->dateParser->getDateFormats()),
'datetime_formats' => $this->dateParser->getAvailableFormats($this->dateParser->getDateTimeFormats()),
'time_formats' => $this->dateParser->getAvailableFormats($this->dateParser->getTimeFormats()),
diff --git a/app/Controller/Currency.php b/app/Controller/Currency.php
index ecaa9834..3e0de905 100644
--- a/app/Controller/Currency.php
+++ b/app/Controller/Currency.php
@@ -59,7 +59,6 @@ class Currency extends Base
$values = $this->request->getValues();
if ($this->config->save($values)) {
- $this->config->reload();
$this->flash->success(t('Settings saved successfully.'));
} else {
$this->flash->failure(t('Unable to save your settings.'));
diff --git a/app/Controller/Doc.php b/app/Controller/Doc.php
index 00b9e585..219ef8ad 100644
--- a/app/Controller/Doc.php
+++ b/app/Controller/Doc.php
@@ -20,7 +20,7 @@ class Doc extends Base
$page = 'index';
}
- if ($this->config->getCurrentLanguage() === 'fr_FR') {
+ if ($this->language->getCurrentLanguage() === 'fr_FR') {
$filename = __DIR__.'/../../doc/fr/' . $page . '.markdown';
} else {
$filename = __DIR__ . '/../../doc/' . $page . '.markdown';
@@ -83,7 +83,7 @@ class Doc extends Base
*/
public function replaceImageUrl(array $matches)
{
- if ($this->config->getCurrentLanguage() === 'fr_FR') {
+ if ($this->language->getCurrentLanguage() === 'fr_FR') {
return '('.$this->helper->url->base().'doc/fr/'.$matches[1].')';
}
diff --git a/app/Controller/User.php b/app/Controller/User.php
index f7d7d2e0..4caed1e6 100644
--- a/app/Controller/User.php
+++ b/app/Controller/User.php
@@ -67,8 +67,8 @@ class User extends Base
$is_remote = $this->request->getIntegerParam('remote') == 1 || (isset($values['is_ldap_user']) && $values['is_ldap_user'] == 1);
$this->response->html($this->helper->layout->app($is_remote ? 'user/create_remote' : 'user/create_local', array(
- 'timezones' => $this->config->getTimezones(true),
- 'languages' => $this->config->getLanguages(true),
+ 'timezones' => $this->timezone->getTimezones(true),
+ 'languages' => $this->language->getLanguages(true),
'roles' => $this->role->getApplicationRoles(),
'projects' => $this->project->getList(),
'errors' => $errors,
@@ -121,8 +121,8 @@ class User extends Base
$user = $this->getUser();
$this->response->html($this->helper->layout->user('user/show', array(
'user' => $user,
- 'timezones' => $this->config->getTimezones(true),
- 'languages' => $this->config->getLanguages(true),
+ 'timezones' => $this->timezone->getTimezones(true),
+ 'languages' => $this->language->getLanguages(true),
)));
}
@@ -247,7 +247,7 @@ class User extends Base
$this->response->html($this->helper->layout->user('user/integrations', array(
'user' => $user,
- 'values' => $this->userMetadata->getall($user['id']),
+ 'values' => $this->userMetadata->getAll($user['id']),
)));
}
@@ -365,8 +365,8 @@ class User extends Base
'values' => $values,
'errors' => $errors,
'user' => $user,
- 'timezones' => $this->config->getTimezones(true),
- 'languages' => $this->config->getLanguages(true),
+ 'timezones' => $this->timezone->getTimezones(true),
+ 'languages' => $this->language->getLanguages(true),
'roles' => $this->role->getApplicationRoles(),
)));
}