openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 9ed1b67bb3db9df4d0d321e0f3d84b5bc7068a9b
parent 748f6bdb9b468ca82366ddcbfdab8ed3cdd10c19
Author: Jan Dankert <devnull@localhost>
Date:   Wed, 21 Mar 2012 21:56:42 +0100

Fix: Sprache hinzufügen.

Diffstat:
action/LanguageAction.class.php | 39---------------------------------------
action/LanguagelistAction.class.php | 48++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 48 insertions(+), 39 deletions(-)

diff --git a/action/LanguageAction.class.php b/action/LanguageAction.class.php @@ -90,45 +90,6 @@ class LanguageAction extends Action /** - * Sprache hinzufuegen - */ - function addView() - { - global $conf; - $countryList = $conf['countries']; - - foreach( $this->project->getLanguageIds() as $id ) - { - if ( $id == $this->language->languageid ) - continue; - - $l = new Language( $id ); - $l->load(); - - unset( $countryList[$l->isoCode] ); - } - - asort( $countryList ); - $this->setTemplateVar('isocodes' ,$countryList ); - } - - - function addPost() - { - global $conf; - $countryList = $conf['countries']; - - // Hinzufuegen einer Sprache - $iso = $this->getRequestVar('isocode'); - $language = new Language(); - $language->projectid = $this->project->projectid; - $language->isoCode = $iso; - $language->name = $countryList[$iso]; - $language->add(); - } - - - /** * Setzen der Sprache als Standardsprache. * Diese Sprache wird benutzt beim Ausw?hlen des Projektes sowie * als Default-Sprache bei mehrsprachigen Webseiten ("content-negotiation") diff --git a/action/LanguagelistAction.class.php b/action/LanguagelistAction.class.php @@ -124,4 +124,52 @@ class LanguagelistAction extends Action { $this->nextSubAction('show'); } + + + + + /** + * Sprache hinzufuegen + */ + function addView() + { + global $conf; + $countryList = $conf['countries']; + + $language = Session::getProjectLanguage(); + + foreach( $this->project->getLanguageIds() as $id ) + { + + if ( $id == $language->languageid ) + continue; + + $l = new Language( $id ); + $l->load(); + + unset( $countryList[$l->isoCode] ); + } + + asort( $countryList ); + $this->setTemplateVar('isocodes' ,$countryList ); + } + + + function addPost() + { + global $conf; + $countryList = $conf['countries']; + + // Hinzufuegen einer Sprache + $iso = $this->getRequestVar('isocode'); + $language = new Language(); + $language->projectid = $this->project->projectid; + $language->isoCode = $iso; + $language->name = $countryList[$iso]; + $language->add(); + + $this->addNotice('language',$language->name,'ADDED','ok'); + } + + } \ No newline at end of file