AAAAhome/academiac/www/libraries/joomla/html/parameter/element/componentlayouts.php 0000644 00000005366 15137263476 0024205 0 ustar 00 setQuery($query);
$template = $db->loadResult();
if ($view = $node->attributes('view') && $extn = $node->attributes('extension'))
{
$view = preg_replace('#\W#', '', $view);
$extn = preg_replace('#\W#', '', $extn);
$path1 = JPATH_SITE . '/components/' . $extn . '/views/' . $view . '/tmpl';
$path2 = JPATH_SITE . '/templates/' . $template . '/html/' . $extn . '/' . $view;
$options[] = JHtml::_('select.option', '', JText::_('JOPTION_USE_MENU_REQUEST_SETTING'));
}
if ($path1 && $path2)
{
jimport('joomla.filesystem.file');
$path1 = JPath::clean($path1);
$path2 = JPath::clean($path2);
$files = JFolder::files($path1, '^[^_]*\.php$');
foreach ($files as $file)
{
$options[] = JHtml::_('select.option', JFile::stripExt($file));
}
if (is_dir($path2) && $files = JFolder::files($path2, '^[^_]*\.php$'))
{
$options[] = JHtml::_('select.optgroup', JText::_('JOPTION_FROM_DEFAULT_TEMPLATE'));
foreach ($files as $file)
{
$options[] = JHtml::_('select.option', JFile::stripExt($file));
}
$options[] = JHtml::_('select.optgroup', JText::_('JOPTION_FROM_DEFAULT_TEMPLATE'));
}
}
// Merge any additional options in the XML definition.
$options = array_merge(parent::_getOptions($node), $options);
return $options;
}
}