API16:JHelp/createSiteList
From Joomla! Documentation
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.
Contents |
Description
Builds a list of the help sites which can be used in a select option
Description:JHelp/createSiteList
Syntax
static createSiteList($pathToXml, $selected=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $pathToXml | Path to an xml file | |
| $selected | null | Language tag to select (if exists) |
Defined in
libraries/joomla/language/help.php
Importing
jimport( 'joomla.language.help' );
Source Body
static function createSiteList($pathToXml, $selected = null) { $list = array (); $data = null; $xml = false; if (!empty($pathToXml)) { $xml = JFactory::getXML($pathToXml); } if( ! $xml) { $option['text'] = 'English (GB) help.joomla.org'; $option['value'] = 'http://help.joomla.org'; $list[] = $option; } else { $option = array (); foreach ($xml->sites->site as $site) { $option['text'] = (string)$site; $option['value'] = (string)$site->attributes()->url; $list[] = $option; } } return $list; }
[Edit See Also] SeeAlso:JHelp/createSiteList
Examples
<CodeExamplesForm />
