JHelp/createSiteList: Difference between revisions
From Joomla! Documentation
New page: ===Description===
Builds a list of the help sites which can be used in a select option
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JHelp/createSi... |
m removing red link to edit, no existant pages |
||
| Line 3: | Line 3: | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
<nowiki>[< | <nowiki>[<! removed edit link to red link >]</nowiki> | ||
</span> | </span> | ||
<! removed transcluded page call, red link never existed > | |||
===Syntax=== | ===Syntax=== | ||
| Line 67: | Line 67: | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
<nowiki>[< | <nowiki>[<! removed edit link to red link >]</nowiki> | ||
</span> | </span> | ||
<! removed transcluded page call, red link never existed > | |||
===Examples=== | ===Examples=== | ||
| Line 82: | Line 82: | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
[[Category:Archived pages API16]] | |||
Revision as of 02:55, 14 May 2013
Description
Builds a list of the help sites which can be used in a select option
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
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;
}
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />