english/libraries/joomla/html/html/contentlanguage.php
/**
	 * Get a list of the available content language items.
	 *
	 * @return  string
	 * @since   11.1
	 */
Get a list of the available content language items.
Get a list of the available content language items .
public static function existing($all = false, $translate=false)
	{
		if (empty(self::$items)) {
			$db		= JFactory::getDBO();
			$query	= $db->getQuery(true);
			$query->select('a.lang_code AS value, a.title AS text, a.title_native');
			$query->from('#__languages AS a');
			$query->where('a.published >= 0');
			$query->order('a.title');
			$db->setQuery($query);
			self::$items = $db->loadObjectList();
			if ($all) {
				array_unshift(self::$items, new JObject(array('value'=>'*','text'=>$translate ? JText::alt('JALL','language') : 'JALL_LANGUAGE')));
			}
			if ($db->getErrorNum()) {
				JError::raiseWarning(500, $db->getErrorMsg());
			}
		}
		return self::$items;
	}
public static function existing ( $ all = false , $ translate = false ) { if ( empty ( self :: $ items ) ) { $ db = JFactory :: getDBO ( ) ; $ query = $ db -> getQuery ( true ) ; $ query -> select ( 'a.lang_code AS value, a.title AS text, a.title_native' ) ; $ query -> from ( '#__languages AS a' ) ; $ query -> where ( 'a.published >= 0' ) ; $ query -> order ( 'a.title' ) ; $ db -> setQuery ( $ query ) ; self :: $ items = $ db -> loadObjectList ( ) ; if ( $ all ) { array_unshift ( self :: $ items , new JObject ( array ( 'value' => '*' , 'text' => $ translate ? JText :: alt ( 'JALL' , 'language' ) : 'JALL_LANGUAGE' ) ) ) ; } if ( $ db -> getErrorNum ( ) ) { JError :: raiseWarning ( 500 , $ db -> getErrorMsg ( ) ) ; } } return self :: $ items ; }
Get a list of the available content language items.
Get a list of the available content language items .
// Get the database object and a new query object. // Build the query. // Set the query and load the options. // Detect errors