public function getInstalled(bool $grouped = false, int $offset = 0, int $limit = 20) : array
{
$exts = $this->db->run('
SELECT
*
FROM
airship_package_cache
WHERE
installed
ORDER BY
packagetype ASC,
supplier ASC,
name ASC
OFFSET ' . $offset . '
LIMIT ' . $limit);
if ($grouped) {
$groups = ['Core' => [], 'Cabin' => [], 'Gadget' => [], 'Motif' => []];
foreach ($exts as $ext) {
$groups[$ext['packagetype']] = $ext;
}
return $groups;
}
return $exts;
}
/** * @route ajax/admin/skyport/installed */ public function ajaxGetInstalledPackages() { $numInstalled = $this->skyport->countInstalled(); list($page, $offset) = $this->getPaginated($numInstalled); $this->lens('skyport/list', ['headline' => 'Installed Extensions', 'extensions' => $this->skyport->getInstalled(false, $offset, $this->perPage), 'pagination' => ['count' => $numInstalled, 'page' => $page, 'per_page' => $this->perPage]]); }