You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							30 lines
						
					
					
						
							876 B
						
					
					
				
			
		
		
	
	
							30 lines
						
					
					
						
							876 B
						
					
					
				<?php
 | 
						|
/* For licensing terms, see /license.txt */
 | 
						|
 | 
						|
/**
 | 
						|
* A dropdownlist with all languages to use with QuickForm
 | 
						|
*/
 | 
						|
class SelectLanguage extends HTML_QuickForm_select
 | 
						|
{
 | 
						|
	/**
 | 
						|
	 * Class constructor
 | 
						|
	 */
 | 
						|
	function SelectLanguage($elementName=null, $elementLabel=null, $options=null, $attributes=null)
 | 
						|
	{
 | 
						|
		if (!isset($attributes['class'])) {
 | 
						|
			$attributes['class'] = 'chzn-select';
 | 
						|
		}
 | 
						|
		parent::__construct($elementName, $elementLabel, $options, $attributes);
 | 
						|
		// Get all languages
 | 
						|
		$languages = api_get_languages();
 | 
						|
		$this->_options = array();
 | 
						|
		$this->_values = array();
 | 
						|
		foreach ($languages['name'] as $index => $name) {
 | 
						|
			if($languages['folder'][$index] == api_get_setting('platformLanguage')) {
 | 
						|
				$this->addOption($name,$languages['folder'][$index],array('selected'=>'selected'));
 | 
						|
			} else {
 | 
						|
				$this->addOption($name,$languages['folder'][$index]);
 | 
						|
			}
 | 
						|
		}
 | 
						|
	}
 | 
						|
}
 | 
						|
 |