openrat-cms

OpenRat Content Management System
git clone http://git.code.weiherhei.de/openrat-cms.git
Log | Files | Refs | README

LanguagelistShowAction.class.php (918B)


      1 <?php
      2 namespace cms\action\languagelist;
      3 use cms\action\LanguagelistAction;
      4 use cms\action\Method;
      5 use cms\base\Configuration;
      6 use cms\model\Language;
      7 use util\Html;
      8 
      9 
     10 class LanguagelistShowAction extends LanguagelistAction implements Method {
     11     public function view() {
     12 		$countryList = Configuration::Conf()->get('countries',[]);
     13 
     14 		$list = array();
     15 
     16 		$this->setTemplateVar('act_languageid',0 );
     17 
     18 
     19 
     20 		foreach( $this->project->getLanguageIds() as $id )
     21 		{
     22 			$l = new Language( $id );
     23 			$l->load();
     24 			
     25 			unset( $countryList[strtoupper($l->isoCode)] );
     26 			
     27 			$list[$id] = array();
     28 			$list[$id]['name'   ] = $l->name;
     29 			$list[$id]['isocode'] = $l->isoCode;
     30 			$list[$id]['id'     ] = $id;
     31 
     32             $list[$id]['is_default'] = $l->isDefault;
     33 
     34             $list[$id]['select_url']  = Html::url( 'index','language',$id );
     35 		}
     36 		
     37 		$this->setTemplateVar('el',$list);
     38     }
     39     public function post() {
     40     }
     41 }