public static function getPositionVariations($template = '', $default = true) { $path = JPATH_SITE . '/libraries/cck/rendering/variations'; $variations = $default !== false ? array('' => '- ' . JText::_('COM_CCK_DEFAULT') . ' -', 'empty' => '- ' . JText::_('COM_CCK_EMPTY') . ' -', 'none' => '- ' . JText::_('COM_CCK_NONE') . ' -') : array('none' => '- ' . JText::_('COM_CCK_NONE') . ' -'); jimport('joomla.filesystem.folder'); $list = JFolder::folders($path, '.', false, false, array('empty')); if (is_array($list) && count($list)) { $variations[] = JHtml::_('select.option', '<OPTGROUP>', JText::_('COM_CCK_LIBRARY')); $list = array_combine(array_values($list), $list); $variations = array_merge($variations, $list); } if (!self::$template && $template) { self::$template = $template; } if (self::$template != '') { $path = JPATH_SITE . '/templates/' . self::$template . '/variations'; $list = JFolder::folders($path, '.', false, false); if (is_array($list) && count($list)) { $variations[] = JHtml::_('select.option', '<OPTGROUP>', JText::_('COM_CCK_TEMPLATE')); $list = array_combine(array_values($list), $list); $variations = array_merge($variations, $list); } } return $variations; }