diff --git a/classes/AbstractGallery.php b/classes/AbstractGallery.php index dfd8354..0b329ab 100644 --- a/classes/AbstractGallery.php +++ b/classes/AbstractGallery.php @@ -4,8 +4,6 @@ namespace dokuwiki\plugin\gallery\classes; abstract class AbstractGallery { - - /** @var Image[] */ protected $images = []; /** @var Options */ @@ -14,7 +12,7 @@ abstract class AbstractGallery /** * Initialize the Gallery * - * @param string $src The source from where to get the images + * @param mixed $src The source from where to get the images * @param Options $options Gallery configuration */ public function __construct($src, Options $options) diff --git a/classes/FeedGallery.php b/classes/FeedGallery.php index 361eb73..7db0cbd 100644 --- a/classes/FeedGallery.php +++ b/classes/FeedGallery.php @@ -9,7 +9,10 @@ class FeedGallery extends AbstractGallery protected $feedHost; protected $feedPath; - /** @inheritdoc */ + /** + * @inheritdoc + * @param string $url + */ public function __construct($url, Options $options) { parent::__construct($url, $options); diff --git a/classes/ListGallery.php b/classes/ListGallery.php new file mode 100644 index 0000000..1e99c66 --- /dev/null +++ b/classes/ListGallery.php @@ -0,0 +1,40 @@ +hasImageExtension($img)) continue; + + try { + $image = new Image($img); + } catch (\Exception $e) { + // not found + continue; + } + + if ($title) $image->setTitle($title); + if ($desc) $image->setDescription($desc); + $this->images[] = $image; + } + } +} diff --git a/classes/Options.php b/classes/Options.php index 00d0a0c..55516e7 100644 --- a/classes/Options.php +++ b/classes/Options.php @@ -45,7 +45,7 @@ class Options public function __construct() { // load options from config - $plugin = plugin_load('syntax', 'gallery'); + $plugin = plugin_load('syntax', 'gallery_main'); $this->thumbnailWidth = $plugin->getConf('thumbnail_width'); $this->thumbnailHeight = $plugin->getConf('thumbnail_height'); $this->lightboxWidth = $plugin->getConf('image_width'); diff --git a/classes/XHTMLFormatter.php b/classes/XHTMLFormatter.php index aa0fb67..491a97d 100644 --- a/classes/XHTMLFormatter.php +++ b/classes/XHTMLFormatter.php @@ -51,7 +51,7 @@ class XHTMLFormatter extends BasicFormatter { if (count($pages) <= 1) return; - $plugin = plugin_load('syntax', 'gallery'); + $plugin = plugin_load('syntax', 'gallery_main'); $this->renderer->doc .= '