Get all of the addons of a certain type.
public lookupAllByType ( string $type ) : array | ||
$type | string | One of the **Addon::TYPE_*** constants. |
return | array |
/** * Looks through the themes directory for valid themes. * * The themes are returned as an associative array of "Theme Name" => "Theme Info Array". * * @param bool $force Deprecated. * @return array Returns the available themes in an array. */ public function availableThemes($force = false) { $addons = $this->addonManager->lookupAllByType(Addon::TYPE_THEME); $result = []; /* @var Addon $addon */ foreach ($addons as $addon) { $result[$addon->getRawKey()] = Gdn::pluginManager()->calcOldInfoArray($addon); } return $result; }
/** * Get a list of available plugins. * * @deprecated Use {@link AddonManager::lookupAllByType()}. */ public function availablePlugins() { $addons = $this->addonManager->lookupAllByType(Addon::TYPE_ADDON); $result = []; foreach ($addons as $addon) { /* @var Addon $addon */ if ($addon->getSpecial('oldType') !== 'plugin') { continue; } $infoArray = static::calcOldInfoArray($addon); $result[$infoArray['Index']] = $infoArray; } return $result; }