added interface of the new decoupled libraries concept gh-92

This commit is contained in:
2017-11-26 02:29:08 +02:00
parent 9760ac86a3
commit 82df61aa4a
174 changed files with 11626 additions and 1094 deletions

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;
}
/**