/** * Returns a list of addons in the Addon class. */ public function getAddons($type = 'all') { // TODO: add support to grab addon options. $type = strtolower($type); $allowed_types = array('all', 'enabled', 'disabled'); if (!in_array($type, $allowed_types)) { $type = 'all'; } $installed_addons = $this->getModels()->getModel('addon')->getAllAddOns(); $addons = array(); foreach ($installed_addons as $addon) { $temp_addon = new Addon($addon); if ($type == 'enabled' && $temp_addon->isEnabled() || $type == 'disabled' && !$temp_addon->isEnabled() || $type == 'all') { $addons[] = $temp_addon; } } return $addons; }