Added getLanguages() and getIconPath()
authorAlexander Ebert <ebert@woltlab.com>
Mon, 16 Jul 2012 12:45:49 +0000 (14:45 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 16 Jul 2012 12:45:49 +0000 (14:45 +0200)
wcfsetup/install/files/lib/data/language/Language.class.php

index 6d0b783e4649ff9237e08800fcb564aba21a08da..2d5c2e9cad3f2f3f64090ffb9998a9465739a794 100644 (file)
@@ -181,6 +181,24 @@ class Language extends DatabaseObject {
                setlocale(LC_CTYPE, $this->get('wcf.global.locale.unix').'.UTF-8', $this->get('wcf.global.locale.unix'), $this->get('wcf.global.locale.win'));
        }
        
+       /**
+        * Returns language icon path.
+        * 
+        * @return      string
+        */
+       public function getIconPath() {
+               return WCF::getPath() . 'icon/flag/'.$this->countryCode.'.svg';
+       }
+       
+       /**
+        * Returns a list of available languages.
+        * 
+        * @return      array<wcf\data\language\Language>
+        */
+       public function getLanguages() {
+               return LanguageFactory::getInstance()->getLanguages();
+       }
+       
        public function __wakeup() {
                $this->packageID = PACKAGE_ID;
        }