added interface of the new decoupled libraries concept gh-92

This commit is contained in:
Llewellyn committed 2017-11-26 04:03:27 +02:00
1 parent 9760ac86a3
commit 82df61aa4a
174 files changed
+11626 -1094

No files matched your search

+37 -1
View File
@@ -122,10 +122,46 @@ class ComponentbuilderModelLibraries extends JModelList
}
}
}
}
// set selection value to a translatable value
if (ComponentbuilderHelper::checkArray($items))
{
foreach ($items as $nr => &$item)
{
// convert how
$item->how = $this->selectionTranslation($item->how, 'how');
}
}
// return items
return $items;
}
/**
* Method to convert selection values to translatable string.
*
* @return translatable string
*/
public function selectionTranslation($value,$name)
{
// Array of how language strings
if ($name === 'how')
{
$howArray = array(
1 => 'COM_COMPONENTBUILDER_LIBRARY_ALWAYS_ADD',
2 => 'COM_COMPONENTBUILDER_LIBRARY_CONDITIONS',
3 => 'COM_COMPONENTBUILDER_LIBRARY_CUSTOM_SCRIPT',
0 => 'COM_COMPONENTBUILDER_LIBRARY_DO_NOT_ADD'
);
// Now check if value is found in this array
if (isset($howArray[$value]) && ComponentbuilderHelper::checkString($howArray[$value]))
{
return $howArray[$value];
}
}
return $value;
}
/**