added interface of the new decoupled libraries concept gh-92
This commit is contained in:
@ -79,7 +79,7 @@ class ComponentbuilderModelTemplate extends JModelAdmin
|
||||
{
|
||||
if ($item = parent::getItem($pk))
|
||||
{
|
||||
if (!empty($item->params))
|
||||
if (!empty($item->params) && !is_array($item->params))
|
||||
{
|
||||
// Convert the params field to an array.
|
||||
$registry = new Registry;
|
||||
@ -95,6 +95,14 @@ class ComponentbuilderModelTemplate extends JModelAdmin
|
||||
$item->metadata = $registry->toArray();
|
||||
}
|
||||
|
||||
if (!empty($item->libraries))
|
||||
{
|
||||
// Convert the libraries field to an array.
|
||||
$libraries = new Registry;
|
||||
$libraries->loadString($item->libraries);
|
||||
$item->libraries = $libraries->toArray();
|
||||
}
|
||||
|
||||
if (!empty($item->template))
|
||||
{
|
||||
// base64 Decode template.
|
||||
@ -830,6 +838,19 @@ class ComponentbuilderModelTemplate extends JModelAdmin
|
||||
$data['metadata'] = (string) $metadata;
|
||||
}
|
||||
|
||||
// Set the libraries items to data.
|
||||
if (isset($data['libraries']) && is_array($data['libraries']))
|
||||
{
|
||||
$libraries = new JRegistry;
|
||||
$libraries->loadArray($data['libraries']);
|
||||
$data['libraries'] = (string) $libraries;
|
||||
}
|
||||
elseif (!isset($data['libraries']))
|
||||
{
|
||||
// Set the empty libraries to data
|
||||
$data['libraries'] = '';
|
||||
}
|
||||
|
||||
// Set the template string to base64 string.
|
||||
if (isset($data['template']))
|
||||
{
|
||||
|
Reference in New Issue
Block a user