Hallo Forum,
ist es möglich eine Joomla Konstante z.B. JPATH_SITE in eine
Modul.xml so einzubinden, das sie in der Moduleinstellung unter Modulparameter
geparst angezeigt wird?
Danke.PHP-Code:foreach ($node->children() as $option)
{
$val = trim($option->attributes('value'));
$pos = strrpos($val,'{');
if($pos === false){
} else{
$const = substr( $val,1,-1);
$val = constant($const);
}
$val = $val;
$text = $option->data();
$options[] = JHTML::_('select.option', $val, JText::_($text));
}
Lösung:
PHP-Code:
//// in der mod_module.xml z.B.
<param name="start_folder" type="applylist" default="{JPATH_SITE}" label="Start folder" description="The search start folder. On change save the current solution." size="1">
<option value="{JPATH_SITE}">root</option>
<option value="images">images</option>
<option value="templates">templates root</option>
</param>
////in fetchElement
foreach ($node->children() as $option)
{
$val = $this-> convertConstant($option->attributes('value'));
$text = $option->data();
$options[] = JHTML::_('select.option', $val, JText::_($text));
}
//in der Elements Datei
function convertConstant($val){
$val = trim($val);
$pos = strrpos($val,'{');
if($pos === false){
} else{
$const = substr( $val,1,-1);
$val = constant($const);
}
return $val;
}
Tom


LinkBack URL
About LinkBacks
Zitieren
Lesezeichen