openrat-cms

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

LanguagelistEditAction.class.php (888B)


      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 LanguagelistEditAction extends LanguagelistAction implements Method {
     11 
     12 	public function view() {
     13 		$countryList = Configuration::Conf()->get('countries',[]);
     14 
     15 		$list = array();
     16 
     17 		$this->setTemplateVar('act_languageid',0 );
     18 
     19 
     20 
     21 		foreach( $this->project->getLanguageIds() as $id )
     22 		{
     23 			$l = new Language( $id );
     24 			$l->load();
     25 
     26 			unset( $countryList[strtoupper($l->isoCode)] );
     27 
     28 			$list[$id] = array();
     29 			$list[$id]['name'   ] = $l->name;
     30 			$list[$id]['isocode'] = $l->isoCode;
     31 			$list[$id]['id'     ] = $id;
     32 
     33 			$list[$id]['is_default'] = $l->isDefault;
     34 
     35 			$list[$id]['select_url']  = Html::url( 'index','language',$id );
     36 		}
     37 
     38 		$this->setTemplateVar('el',$list);
     39 	}
     40 
     41     public function post() {
     42     }
     43 }