• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

Services/MetaData/classes/class.ilMDLanguageItem.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2001 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
00021         +-----------------------------------------------------------------------------+
00022 */
00023 
00024 
00032 class ilMDLanguageItem
00033 {
00034         var $language_code;
00035         var $possible_language_codes = array();
00036 
00037 
00038         function ilMDLanguageItem($a_code)
00039         {
00040                 $this->language_code = $a_code;
00041         }
00042 
00043 
00044         function getLanguageCode()
00045         {
00046                 $lang = ilMDLanguageItem::_getPossibleLanguageCodes();
00047                 if(in_array($this->language_code,$lang))
00048                 {
00049                         return $this->language_code;
00050                 }
00051                 return false;
00052         }
00053 
00054 
00055         /*
00056          * @static
00057          */
00058         function _getPossibleLanguageCodes()
00059         {
00060                 return array("aa","ab","af","am","ar","as","ay","az","ba","be","bg","bh",
00061                                          "bi","bn","bo","br","ca","co","cs","cy","da","de","dz","el","en","eo",
00062                                          "es","et","eu","fa","fi","fj","fo","fr","fy","ga","gd","gl","gn","gu",
00063                                          "ha","he","hi","hr","hu","hy","ia","ie","ik","id","is","it","iu","ja",
00064                                          "jv","ka","kk","kl","km","kn","ko","ks","ku","ky","la","ln",
00065                                          "lo","lt","lv","mg","mi","mk","ml","mn","mo","mr","ms","mt",
00066                                          "my","na","ne","nl","no","oc","om","or","pa","pl","ps","pt",
00067                                          "qu","rm","rn","ro",
00068                                          "ru","rw",
00069                                          "sa","sd","sg","sh","si","sk","sl","sm","sn","so","sq","sr","ss","st",
00070                                          "su","sv","sw","ta","te","tg","th","ti","tk","tl","tn","to","tr","ts",
00071                                          "tt","tw","ug","uk","ur","uz","vi","vo","wo","xh","yi","yo","za","zh",
00072                                          "zu");
00073         }
00074 
00075         /*
00076          * @static
00077          */
00078         function _getLanguages()
00079         {
00080                 global $lng;
00081 
00082                 $lng->loadLanguageModule("meta");
00083 
00084                 $langs = array();
00085                 foreach(ilMDLanguageItem::_getPossibleLanguageCodes() as $lngcode)
00086                 {
00087                         $langs[$lngcode] = $lng->txt("meta_l_".$lngcode);
00088                 }
00089                 asort($langs);
00090                 return $langs;
00091         }
00092 
00093                 
00094 }
00095 ?>

Generated on Fri Dec 13 2013 13:52:11 for ILIAS Release_3_7_x_branch .rev 46817 by  doxygen 1.7.1