english/administrator/components/com_menus/models/fields/menutype.php
/**
	 * Method to get the available menu item type options.
	 *
	 * @return	array	Array of groups with menu item types.
	 * @since	1.6
	 */
Method to get the available menu item type options.
@return      array   Array of groups with menu item types.
Method to get the available menu item type options . @return array Array of groups with menu item types .
protected function _getTypeOptions()
	{
		jimport('joomla.filesystem.file');
		$lang = JFactory::getLanguage();
		$list = array();
		$db = JFactory::getDBO();
		$db->setQuery(
			'SELECT `name`, `element` AS "option"' .
			' FROM `#__extensions`' .
			' WHERE `type` = "component"' .
			' AND `enabled` = 1' .
			' ORDER BY `name`'
		);
		$components = $db->loadObjectList();
		foreach ($components as $component)
		{
			if ($options = $this->_getTypeOptionsByComponent($component->option)) {
				$list[$component->name] = $options;
				foreach ($options as $option)
				{
					if (isset($option->request)) {
						$this->_rlu[MenusHelper::getLinkKey($option->request)] = $option->get('title');
						if (isset($option->request['option'])) {
								$lang->load($option->request['option'].'.sys', JPATH_ADMINISTRATOR, null, false, false)
							||	$lang->load($option->request['option'].'.sys', JPATH_ADMINISTRATOR.'/components/'.$option->request['option'], null, false, false)
							||	$lang->load($option->request['option'].'.sys', JPATH_ADMINISTRATOR, $lang->getDefault(), false, false)
							||	$lang->load($option->request['option'].'.sys', JPATH_ADMINISTRATOR.'/components/'.$option->request['option'], $lang->getDefault(), false, false);
						}
					}
				}
			}
		}
		return $list;
	}
protected function _getTypeOptions ( ) { jimport ( 'joomla.filesystem.file' ) ; $ lang = JFactory :: getLanguage ( ) ; $ list = array ( ) ; $ db = JFactory :: getDBO ( ) ; $ db -> setQuery ( 'SELECT `name`, `element` AS "option"' . ' FROM `#__extensions`' . ' WHERE `type` = "component"' . ' AND `enabled` = 1' . ' ORDER BY `name`' ) ; $ components = $ db -> loadObjectList ( ) ; foreach ( $ components as $ component ) { if ( $ options = $ this -> _getTypeOptionsByComponent ( $ component -> option ) ) { $ list [ $ component -> name ] = $ options ; foreach ( $ options as $ option ) { if ( isset ( $ option -> request ) ) { $ this -> _rlu [ MenusHelper :: getLinkKey ( $ option -> request ) ] = $ option -> get ( 'title' ) ; if ( isset ( $ option -> request [ 'option' ] ) ) { $ lang -> load ( $ option -> request [ 'option' ] . '.sys' , JPATH_ADMINISTRATOR , null , false , false ) || $ lang -> load ( $ option -> request [ 'option' ] . '.sys' , JPATH_ADMINISTRATOR . '/components/' . $ option -> request [ 'option' ] , null , false , false ) || $ lang -> load ( $ option -> request [ 'option' ] . '.sys' , JPATH_ADMINISTRATOR , $ lang -> getDefault ( ) , false , false ) || $ lang -> load ( $ option -> request [ 'option' ] . '.sys' , JPATH_ADMINISTRATOR . '/components/' . $ option -> request [ 'option' ] , $ lang -> getDefault ( ) , false , false ) ; } } } } } return $ list ; }
Method to get the available menu item type options.
Method to get the available menu item type options .
// Initialise variables. // Get the list of components. // Create the reverse lookup for link-to-name.