Chris@5: alterInfo('views_slideshow_widget_info'); Chris@5: $this->setCacheBackend($cache_backend, 'views_slideshow_widget'); Chris@5: } Chris@5: Chris@5: /** Chris@5: * Gets the definition of all or filtered plugins for this type. Chris@5: * Chris@5: * @param mixed $type Chris@5: * A string or an array of types to filter on. Chris@5: * Chris@5: * @return mixed Chris@5: * An array of plugin definitions. Keys are plugin IDs. Chris@5: */ Chris@5: public function getDefinitions($type = NULL) { Chris@5: $definitions = parent::getDefinitions(); Chris@5: Chris@5: // Filter widgets to keep only required types. Chris@5: if (!empty($type)) { Chris@5: foreach ($definitions as $widgetId => $widgetInfo) { Chris@5: if ((is_array($type) && !in_array($widgetInfo['type'], $type)) || (is_string($type) && $widgetInfo['type'] !== $type)) { Chris@5: unset($definitions[$widgetId]); Chris@5: } Chris@5: } Chris@5: } Chris@5: Chris@5: return $definitions; Chris@5: } Chris@5: Chris@5: }