Fixed gh-422 to insure the details tab always gets added if no custom tab names are found. Added the option to run the expantion option without installing the components locally.
This commit is contained in:
@ -35,7 +35,7 @@ class JFormFieldViewtabs extends JFormFieldList
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
// get the input from url
|
||||
// get the input from url
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
// get the view name & id
|
||||
$fieldsID = $jinput->getInt('id', 0);
|
||||
@ -77,14 +77,19 @@ class JFormFieldViewtabs extends JFormFieldList
|
||||
if (isset($item->addtabs) && ComponentbuilderHelper::checkJson($item->addtabs))
|
||||
{
|
||||
$items = json_decode($item->addtabs, true);
|
||||
$nr = 1;
|
||||
foreach($items as $itemName)
|
||||
// check if the array has values
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
$options[] = JHtml::_('select.option', $nr, $itemName['name']);
|
||||
$nr++;
|
||||
$nr = 1;
|
||||
foreach($items as $itemName)
|
||||
{
|
||||
$options[] = JHtml::_('select.option', $nr, $itemName['name']);
|
||||
$nr++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
// check if any were loaded
|
||||
if (!ComponentbuilderHelper::checkArray($options))
|
||||
{
|
||||
$options[] = JHtml::_('select.option', 1, JText::_('COM_COMPONENTBUILDER_DETAILS'));
|
||||
}
|
||||
|
Reference in New Issue
Block a user