Skip to content

Commit

Permalink
Use the cached manifest on the com_modules select model
Browse files Browse the repository at this point in the history
  • Loading branch information
Anderson Grudtner Martins committed Nov 28, 2014
1 parent b2c565a commit 0b5f34f
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions administrator/components/com_modules/models/select.php
Expand Up @@ -84,6 +84,7 @@ protected function getListQuery()
'a.extension_id, a.name, a.element AS module'
)
);
$query->select('a.manifest_cache AS manifest');
$query->from($db->quoteName('#__extensions') . ' AS a');

// Filter by module
Expand Down Expand Up @@ -119,24 +120,14 @@ public function getItems()
// and load language support.
foreach ($items as &$item)
{
$path = JPath::clean($client->path . '/modules/' . $item->module . '/' . $item->module . '.xml');

if (file_exists($path))
{
$item->xml = simplexml_load_file($path);
}
else
{
$item->xml = null;
}

// 1.5 Format; Core files or language packs then
// 1.6 3PD Extension Support
$lang->load($item->module . '.sys', $client->path, null, false, true)
|| $lang->load($item->module . '.sys', $client->path . '/modules/' . $item->module, null, false, true);
$item->name = JText::_($item->name);

if (isset($item->xml) && $text = trim($item->xml->description))
$item->manifest = json_decode($item->manifest);
if (isset($item->manifest) && $text = trim($item->manifest->description))
{
$item->desc = JText::_($text);
}
Expand All @@ -148,8 +139,6 @@ public function getItems()

$items = JArrayHelper::sortObjects($items, 'name', 1, true, true);

// TODO: Use the cached XML from the extensions table?
return $items;
}
}

0 comments on commit 0b5f34f

Please sign in to comment.