AAAAhome/academiac/www/libraries/joomla/html/parameter/element/modulelayouts.php 0000644 00000005275 15137261103 0023450 0 ustar 00 attributes('client_id')) ? $v : 0;
$options = array();
$path1 = null;
$path2 = null;
// Load template entries for each menuid
$db = JFactory::getDBO();
$query = $db->getQuery(true);
$query->select('template');
$query->from('#__template_styles');
$query->where('client_id = ' . (int) $clientId);
$query->where('home = 1');
$db->setQuery($query);
$template = $db->loadResult();
if ($module = $node->attributes('module'))
{
$base = ($clientId == 1) ? JPATH_ADMINISTRATOR : JPATH_SITE;
$module = preg_replace('#\W#', '', $module);
$path1 = $base . '/modules/' . $module . '/tmpl';
$path2 = $base . '/templates/' . $template . '/html/' . $module;
$options[] = JHTML::_('select.option', '', '');
}
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'));
foreach ($files as $file)
{
$options[] = JHTML::_('select.option', JFile::stripExt($file));
}
$options[] = JHTML::_('select.optgroup', JText::_('JOPTION_FROM_DEFAULT'));
}
}
// Merge any additional options in the XML definition.
$options = array_merge(parent::_getOptions($node), $options);
return $options;
}
}