├── lang ├── ko │ ├── lang.php │ └── settings.php ├── zh-tw │ ├── lang.php │ └── settings.php ├── ja │ ├── lang.php │ └── settings.php ├── ar │ ├── lang.php │ └── settings.php ├── no │ ├── lang.php │ └── settings.php ├── eu │ ├── settings.php │ └── lang.php ├── sv │ ├── lang.php │ └── settings.php ├── hu │ ├── lang.php │ └── settings.php ├── cy │ ├── lang.php │ └── settings.php ├── sk │ ├── lang.php │ └── settings.php ├── ca │ ├── lang.php │ └── settings.php ├── sr │ ├── lang.php │ └── settings.php ├── ta │ ├── lang.php │ └── settings.php ├── tr │ ├── lang.php │ └── settings.php ├── ckb │ ├── lang.php │ └── settings.php ├── hr │ ├── lang.php │ └── settings.php ├── oc │ ├── lang.php │ └── settings.php ├── vi │ ├── lang.php │ └── settings.php ├── el │ ├── lang.php │ └── settings.php ├── da │ ├── lang.php │ └── settings.php ├── fa │ ├── lang.php │ └── settings.php ├── eo │ ├── lang.php │ └── settings.php ├── it │ ├── lang.php │ └── settings.php ├── de-informal │ ├── lang.php │ └── settings.php ├── nl │ ├── lang.php │ └── settings.php ├── uk │ ├── settings.php │ └── lang.php ├── zh │ ├── settings.php │ └── lang.php ├── en │ ├── settings.php │ └── lang.php ├── de │ ├── settings.php │ └── lang.php ├── ru │ ├── settings.php │ └── lang.php ├── pt-br │ ├── settings.php │ └── lang.php ├── cs │ ├── settings.php │ └── lang.php ├── pl │ ├── settings.php │ └── lang.php ├── fr │ ├── settings.php │ └── lang.php └── es │ ├── settings.php │ └── lang.php ├── plugin.info.txt ├── simple-lightbox ├── get.sh └── simple-lightbox.less ├── conf ├── default.php └── metadata.php ├── README ├── syntax ├── list.php └── main.php ├── classes ├── ListGallery.php ├── NamespaceGallery.php ├── AbstractGallery.php ├── FeedGallery.php ├── BasicFormatter.php ├── Options.php ├── Image.php └── XHTMLFormatter.php ├── deleted.files ├── screen.less ├── script.js ├── GalleryNode.php ├── action └── prosemirror.php ├── script └── prosemirror.js └── LICENSE /lang/ko/lang.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['pages'] = '相簿頁碼'; 9 | $lang['js']['addgal'] = '添加作為相簿的名字空間'; 10 | -------------------------------------------------------------------------------- /lang/ja/lang.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['pages'] = 'ギャラリー・ページ'; 9 | $lang['js']['addgal'] = '名前空間の追加'; 10 | -------------------------------------------------------------------------------- /lang/ar/lang.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['pages'] = 'صفحات المعرض '; 9 | $lang['js']['addgal'] = 'أضف نطاق كامعرض '; 10 | -------------------------------------------------------------------------------- /lang/no/lang.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['pages'] = 'Bildesider:'; 9 | $lang['js']['addgal'] = 'Navnerom som bildearkiv'; 10 | -------------------------------------------------------------------------------- /lang/eu/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['image_width'] = 'Irudi zabalera'; 9 | $lang['image_height'] = 'Irudi altuera'; 10 | -------------------------------------------------------------------------------- /lang/eu/lang.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['pages'] = 'Galeria Orriak:'; 9 | $lang['nothingfound'] = 'Irudirik ez aurkituak.'; 10 | -------------------------------------------------------------------------------- /lang/sv/lang.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['pages'] = 'Bildsidor:'; 9 | $lang['js']['addgal'] = 'Lägg till namnrymd som bildarkiv'; 10 | -------------------------------------------------------------------------------- /lang/hu/lang.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['pages'] = 'Képgaléria oldalai:'; 9 | $lang['js']['addgal'] = 'Névtér hozzáadása képgalériaként'; 10 | -------------------------------------------------------------------------------- /lang/cy/lang.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['pages'] = 'Tudalennau Oriel:'; 9 | $lang['js']['addgal'] = 'Ychwanegu namespace fel oriel'; 10 | -------------------------------------------------------------------------------- /lang/sk/lang.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['pages'] = 'Stránky galérie:'; 9 | $lang['js']['addgal'] = 'Pridaj menný priestor ako galériu'; 10 | -------------------------------------------------------------------------------- /lang/ca/lang.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['pages'] = 'Pàgines de la galeria'; 9 | $lang['js']['addgal'] = 'Afegeix un espai com a galeria'; 10 | -------------------------------------------------------------------------------- /lang/sr/lang.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['pages'] = 'Странице галерије:'; 9 | $lang['js']['addgal'] = 'Додај именски простор као галерију'; 10 | -------------------------------------------------------------------------------- /lang/ta/lang.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['pages'] = 'பட தொகுப்பு பக்கங்கள் '; 9 | $lang['js']['addgal'] = 'பட தொகுப்பை பெயர்வேளியாக சேர் '; 10 | -------------------------------------------------------------------------------- /simple-lightbox/get.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | VERSION="v2.14.2" 4 | 5 | wget https://raw.githubusercontent.com/andreknieriem/simplelightbox/$VERSION/dist/simple-lightbox.js -O simple-lightbox.js 6 | wget https://raw.githubusercontent.com/andreknieriem/simplelightbox/$VERSION/dist/simple-lightbox.css -O simple-lightbox.less 7 | -------------------------------------------------------------------------------- /lang/tr/lang.php: -------------------------------------------------------------------------------- 1 | 7 | * @author ilker Rifat Kapaç 8 | */ 9 | $lang['pages'] = 'Sergi Sayfaları'; 10 | $lang['js']['addgal'] = 'İsimalanını sergi olarak ekle'; 11 | -------------------------------------------------------------------------------- /lang/ckb/lang.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['pages'] = 'گەلەری لاپەڕەکان:'; 9 | $lang['js']['addgal'] = 'زیادکردنی بۆشایی ناو وەک گالەری'; 10 | $lang['nothingfound'] = 'هیچ وێنەیەک نەدۆزرایەوە.'; 11 | -------------------------------------------------------------------------------- /lang/hr/lang.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['pages'] = 'Stranice galerije:'; 9 | $lang['js']['addgal'] = 'Dodaj imenski prostor kao galeriju'; 10 | $lang['nothingfound'] = 'Slike nisu pronađene.'; 11 | -------------------------------------------------------------------------------- /lang/oc/lang.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['pages'] = 'Pagina galariá :'; 9 | $lang['js']['addgal'] = 'Ajustar los noms d\'espaci coma galariá'; 10 | $lang['nothingfound'] = 'Cap d\'imatge pas trobat.'; 11 | -------------------------------------------------------------------------------- /lang/vi/lang.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['pages'] = 'Trang thư viện'; 9 | $lang['js']['addgal'] = 'Thêm không gian tên làm thư viện'; 10 | $lang['nothingfound'] = 'Không tìm thấy hình ảnh.'; 11 | -------------------------------------------------------------------------------- /lang/el/lang.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['pages'] = 'Σελίδες Gallery'; 9 | $lang['js']['addgal'] = 'Προσθέσετε χώρο για όνομα ως γκαλερί.'; 10 | $lang['nothingfound'] = 'Δεν βρέθηκαν εικόνες.'; 11 | -------------------------------------------------------------------------------- /conf/default.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | 9 | $conf['thumbnail_width'] = 150; 10 | $conf['thumbnail_height'] = 150; 11 | $conf['image_width'] = 1600; 12 | $conf['image_height'] = 1200; 13 | $conf['cols'] = 0; 14 | 15 | $conf['sort'] = 'file'; 16 | $conf['options'] = 'cache, crop, lightbox'; 17 | -------------------------------------------------------------------------------- /lang/da/lang.php: -------------------------------------------------------------------------------- 1 | 7 | * @author Soren Birk 8 | */ 9 | $lang['pages'] = 'Gallerisider:'; 10 | $lang['js']['addgal'] = 'Tilføj navnerum som galleri'; 11 | $lang['nothingfound'] = 'Ingen billeder fundet.'; 12 | -------------------------------------------------------------------------------- /lang/fa/lang.php: -------------------------------------------------------------------------------- 1 | 7 | * @author sam01 8 | */ 9 | $lang['pages'] = 'صفحه‌های گالری:'; 10 | $lang['js']['addgal'] = 'اضافه کردن فضای نام به‌عنوان گالری'; 11 | $lang['nothingfound'] = 'تصویری یافت نشد.'; 12 | -------------------------------------------------------------------------------- /lang/eo/lang.php: -------------------------------------------------------------------------------- 1 | 7 | * @author Robert Bogenschneider 8 | */ 9 | $lang['pages'] = 'Galeripaĝoj:'; 10 | $lang['js']['addgal'] = 'Aldoni nomspacon kiel galerio'; 11 | $lang['nothingfound'] = 'Neniu bildo trovita'; 12 | -------------------------------------------------------------------------------- /lang/it/lang.php: -------------------------------------------------------------------------------- 1 | 7 | * @author Giovanni 8 | */ 9 | $lang['pages'] = 'Pagine Galleria'; 10 | $lang['js']['addgal'] = 'Aggiungi nome alla galleria'; 11 | $lang['nothingfound'] = 'Nessuna immagine trovata.'; 12 | -------------------------------------------------------------------------------- /lang/de-informal/lang.php: -------------------------------------------------------------------------------- 1 | 7 | * @author Felix Müller-Donath 8 | */ 9 | $lang['pages'] = 'Galerie-Seiten:'; 10 | $lang['js']['addgal'] = 'Namensraum als Galerie hinzufügen'; 11 | $lang['nothingfound'] = 'Keine Bilder gefunden'; 12 | -------------------------------------------------------------------------------- /lang/nl/lang.php: -------------------------------------------------------------------------------- 1 | 7 | * @author Hugo Smet 8 | */ 9 | $lang['pages'] = 'Beeldreeks pagina\'s:'; 10 | $lang['js']['addgal'] = 'Voeg naamruimte toe als beeldreeks'; 11 | $lang['nothingfound'] = 'Geen afbeeldingen gevonden.'; 12 | -------------------------------------------------------------------------------- /lang/uk/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['image_width'] = 'Довжина зображення'; 9 | $lang['image_height'] = 'Висота зображення'; 10 | $lang['cols'] = 'Зображень в рядку'; 11 | $lang['sort'] = 'Як сортувати зображення галереї'; 12 | $lang['sort_o_file'] = 'сортувати за ім\'ям файлу'; 13 | $lang['sort_o_mod'] = 'сортувати за датою створення файлу'; 14 | $lang['options'] = 'Додадкові параметри галереї за замовчуванням'; 15 | -------------------------------------------------------------------------------- /lang/zh-tw/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['thumbnail_width'] = '縮圖的寬度'; 9 | $lang['thumbnail_height'] = '縮圖的高度'; 10 | $lang['image_width'] = '圖像寬度'; 11 | $lang['image_height'] = '圖像高度'; 12 | $lang['cols'] = '每一列的圖像數'; 13 | $lang['sort'] = '相簿圖像要如何排序?'; 14 | $lang['sort_o_file'] = '依檔名排序'; 15 | $lang['sort_o_mod'] = '依建檔日期排序'; 16 | $lang['sort_o_date'] = '依EXIF日期排序'; 17 | $lang['sort_o_title'] = '依EXIF標題排序'; 18 | $lang['options'] = '額外的相簿預設選項'; 19 | -------------------------------------------------------------------------------- /lang/ja/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['thumbnail_width'] = 'サムネイル画像の幅'; 9 | $lang['thumbnail_height'] = 'サムネイル画像の高さ'; 10 | $lang['image_width'] = '画像の幅'; 11 | $lang['image_height'] = '画像の高さ'; 12 | $lang['cols'] = '一行の画像数'; 13 | $lang['sort'] = '画像のソート方法'; 14 | $lang['sort_o_file'] = 'ファイル名順'; 15 | $lang['sort_o_mod'] = 'ファイル日付順'; 16 | $lang['sort_o_date'] = 'EXIF日付順'; 17 | $lang['sort_o_title'] = 'EXIFタイトル順'; 18 | $lang['options'] = 'デフォルトに追加するギャラリーのオプション'; 19 | -------------------------------------------------------------------------------- /lang/zh/settings.php: -------------------------------------------------------------------------------- 1 | 7 | * @author oott123 8 | */ 9 | $lang['thumbnail_width'] = '缩略图宽度'; 10 | $lang['thumbnail_height'] = '缩略图高度'; 11 | $lang['image_width'] = '图片宽度'; 12 | $lang['image_height'] = '图片高度'; 13 | $lang['cols'] = '每行图片数量'; 14 | $lang['sort'] = '图片排序方式'; 15 | $lang['sort_o_file'] = '按文件名'; 16 | $lang['sort_o_mod'] = '按文件时间'; 17 | $lang['sort_o_date'] = '按 EXIF 时间'; 18 | $lang['sort_o_title'] = '按 EXIT 标题'; 19 | $lang['options'] = '其他相册默认选项'; 20 | -------------------------------------------------------------------------------- /lang/en/settings.php: -------------------------------------------------------------------------------- 1 | 6 | * @author Andreas Gohr 7 | */ 8 | 9 | $lang['thumbnail_width'] = 'Thumbnail image width'; 10 | $lang['thumbnail_height'] = 'Thumbnail image height'; 11 | $lang['image_width'] = 'Image width'; 12 | $lang['image_height'] = 'Image height'; 13 | $lang['cols'] = 'Images per row'; 14 | 15 | $lang['sort'] = 'How to sort the gallery images'; 16 | $lang['sort_o_file'] = 'sort by filename'; 17 | $lang['sort_o_mod'] = 'sort by file date'; 18 | $lang['sort_o_date'] = 'sort by EXIF date'; 19 | $lang['sort_o_title'] = 'sort by EXIF title'; 20 | 21 | $lang['options'] = 'Additional gallery default options'; 22 | 23 | -------------------------------------------------------------------------------- /lang/hu/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['thumbnail_width'] = 'Bélyegkép szélessége'; 9 | $lang['thumbnail_height'] = 'Bélyegkép magassága'; 10 | $lang['image_width'] = 'Képszélesség'; 11 | $lang['image_height'] = 'Képmagasság'; 12 | $lang['cols'] = 'Képek száma soronként'; 13 | $lang['sort'] = 'Galériaképek rendezése'; 14 | $lang['sort_o_file'] = 'Fájlok neve szerint'; 15 | $lang['sort_o_mod'] = 'Fájlok dátuma szerint'; 16 | $lang['sort_o_date'] = 'EXIF-dátum szerint'; 17 | $lang['sort_o_title'] = 'EXIF-cím szerint'; 18 | $lang['options'] = 'További alapértelmezett beállítások'; 19 | -------------------------------------------------------------------------------- /lang/no/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['thumbnail_width'] = 'Miniatyrbilde bredde'; 9 | $lang['thumbnail_height'] = 'Miniatyrbilde høyde'; 10 | $lang['image_width'] = 'Bildebredde'; 11 | $lang['image_height'] = 'Bildehøyde'; 12 | $lang['cols'] = 'Bilder pr. rad'; 13 | $lang['sort'] = 'Sortering av bildene'; 14 | $lang['sort_o_file'] = 'sorter etter filnavn'; 15 | $lang['sort_o_mod'] = 'sorter etter fildato'; 16 | $lang['sort_o_date'] = 'sorter etter EXIF dato'; 17 | $lang['sort_o_title'] = 'sorter etter EXIT tittel'; 18 | $lang['options'] = 'Andre standardvalg for bildearkivet'; 19 | -------------------------------------------------------------------------------- /lang/eo/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['thumbnail_width'] = 'Bildeta larĝeco'; 9 | $lang['thumbnail_height'] = 'Bildeta alteco'; 10 | $lang['image_width'] = 'Bildlarĝeco'; 11 | $lang['image_height'] = 'Bildalteco'; 12 | $lang['cols'] = 'Bildoj po vico'; 13 | $lang['sort'] = 'Kiel ordigi la galeribildojn'; 14 | $lang['sort_o_file'] = 'ordigi per dosier-nomo'; 15 | $lang['sort_o_mod'] = 'ordigi per dosier-dato'; 16 | $lang['sort_o_date'] = 'ordigi per EXIF-dato'; 17 | $lang['sort_o_title'] = 'ordigi per EXIF-titolo'; 18 | $lang['options'] = 'Aldonaj galeriaj standardaj opcioj'; 19 | -------------------------------------------------------------------------------- /lang/oc/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['thumbnail_width'] = 'Largor de las vinhetas'; 9 | $lang['thumbnail_height'] = 'Nautor de las vinhetas'; 10 | $lang['image_width'] = 'Largor imatge'; 11 | $lang['image_height'] = 'Nautor imatge'; 12 | $lang['cols'] = 'Imatges per linha'; 13 | $lang['sort'] = 'Biais de triar los imatges de la galariá'; 14 | $lang['sort_o_file'] = 'triar per nom fichièr'; 15 | $lang['sort_o_mod'] = 'triar per data fichièr'; 16 | $lang['sort_o_date'] = 'triar per data EXIF'; 17 | $lang['sort_o_title'] = 'triar per títol EXIF'; 18 | $lang['options'] = 'Opcion de la galariá'; 19 | -------------------------------------------------------------------------------- /lang/sv/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['thumbnail_width'] = 'Bredd på miniatyrbild'; 9 | $lang['thumbnail_height'] = 'Höjd på miniatyrbild'; 10 | $lang['image_width'] = 'Bildbredd'; 11 | $lang['image_height'] = 'Bildhöjd'; 12 | $lang['cols'] = 'Bilder per rad'; 13 | $lang['sort'] = 'Sortering av bilderna'; 14 | $lang['sort_o_file'] = 'Sortera efter filtitel'; 15 | $lang['sort_o_mod'] = 'Sortera efter fildatum'; 16 | $lang['sort_o_date'] = 'Sortera efter EXIF-datum'; 17 | $lang['sort_o_title'] = 'Sortera efter EXIF-titel'; 18 | $lang['options'] = 'Ytterligare standardval för bildarkivet'; 19 | -------------------------------------------------------------------------------- /lang/cy/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['thumbnail_width'] = 'Lled bawdlun'; 9 | $lang['thumbnail_height'] = 'Uchder bawdlun'; 10 | $lang['image_width'] = 'Lled delwedd'; 11 | $lang['image_height'] = 'Uchder delwedd'; 12 | $lang['cols'] = 'Delweddau y rhes'; 13 | $lang['sort'] = 'Sut i drefnu delweddau\'r oriel'; 14 | $lang['sort_o_file'] = 'trefnu gan enw ffeil'; 15 | $lang['sort_o_mod'] = 'trefnu gan ddyddiad ffeil'; 16 | $lang['sort_o_date'] = 'trefnu gan ddyddiad EXIF'; 17 | $lang['sort_o_title'] = 'trefnu gan deitl EXIF'; 18 | $lang['options'] = 'Opsiynau diofyn ychwanegol oriel'; 19 | -------------------------------------------------------------------------------- /lang/sr/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['thumbnail_width'] = 'Ширина сличице'; 9 | $lang['thumbnail_height'] = 'Висина сличице'; 10 | $lang['image_width'] = 'Ширина слике'; 11 | $lang['image_height'] = 'Висина слике'; 12 | $lang['cols'] = 'Слика по реду'; 13 | $lang['sort'] = 'Како треба ређати слике у галерији'; 14 | $lang['sort_o_file'] = 'ређај по имену датотеке'; 15 | $lang['sort_o_mod'] = 'ређају по датуму настанка'; 16 | $lang['sort_o_date'] = 'ређај по EXIF датуму'; 17 | $lang['sort_o_title'] = 'ређај по EXIF наслову'; 18 | $lang['options'] = 'Додатне подразумеване опције галерије'; 19 | -------------------------------------------------------------------------------- /lang/ar/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['thumbnail_width'] = 'عرض الصورة المصغرة'; 9 | $lang['thumbnail_height'] = 'طول الصورة المصغرة '; 10 | $lang['image_width'] = 'عرض الصورة '; 11 | $lang['image_height'] = 'ارتفاع الصورة '; 12 | $lang['cols'] = 'صورة لكل صف'; 13 | $lang['sort'] = 'كيف تريد ترتيب صورة المعرض '; 14 | $lang['sort_o_file'] = 'ترتيب حسب اسم الملف'; 15 | $lang['sort_o_mod'] = 'ترتيب حسب تاريخ الملف'; 16 | $lang['sort_o_date'] = 'ترتيب حسب التاريخ المسجل في تفاصيل الملفات'; 17 | $lang['sort_o_title'] = 'ترتيب حسب الاسم المسجل في تفاصيل الملفات'; 18 | $lang['options'] = 'اعدادت اضافية للمعرض '; 19 | -------------------------------------------------------------------------------- /lang/de/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['thumbnail_width'] = 'Vorschaubildbreite'; 9 | $lang['thumbnail_height'] = 'Vorschaubildhöhe'; 10 | $lang['image_width'] = 'Bildbreite'; 11 | $lang['image_height'] = 'Bildhöhe'; 12 | $lang['cols'] = 'Bilder pro Zeile'; 13 | $lang['sort'] = 'Sortierung der Galeriebilder'; 14 | $lang['sort_o_file'] = 'nach Dateiname sortieren'; 15 | $lang['sort_o_mod'] = 'nach Dateidatum sortieren'; 16 | $lang['sort_o_date'] = 'nach EXIF-Datum sortieren'; 17 | $lang['sort_o_title'] = 'nach EXIF-Titel sortieren'; 18 | $lang['options'] = 'Zusätzliche Galerie Standard-Einstellungen'; 19 | -------------------------------------------------------------------------------- /lang/da/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['thumbnail_width'] = 'Miniaturebillede bredde'; 9 | $lang['thumbnail_height'] = 'Miniaturebillede højde'; 10 | $lang['image_width'] = 'Billede bredde'; 11 | $lang['image_height'] = 'Billede højde'; 12 | $lang['cols'] = 'Billeder per række'; 13 | $lang['sort'] = 'Sortér galleribilleder efter'; 14 | $lang['sort_o_file'] = 'sortér efter filnavn'; 15 | $lang['sort_o_mod'] = 'sortér efter fildato'; 16 | $lang['sort_o_date'] = 'sortér efter EXIF dato'; 17 | $lang['sort_o_title'] = 'sortér efter EXIF titel'; 18 | $lang['options'] = 'Yderligere galleri-standardindstillinger'; 19 | -------------------------------------------------------------------------------- /lang/sk/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['thumbnail_width'] = 'Šírka náhľadu'; 9 | $lang['thumbnail_height'] = 'Výška náhľadu'; 10 | $lang['image_width'] = 'Šírka obrázku'; 11 | $lang['image_height'] = 'Výška obrázku'; 12 | $lang['cols'] = 'Počet obrázkov na riadok'; 13 | $lang['sort'] = 'Spôsob triedenia obrázkov galérie'; 14 | $lang['sort_o_file'] = 'triedenie podľa mena'; 15 | $lang['sort_o_mod'] = 'triedenie podľa dátumu'; 16 | $lang['sort_o_date'] = 'triedenie podľa EXIF dátumu'; 17 | $lang['sort_o_title'] = 'triedenie podľa EXIF názvu'; 18 | $lang['options'] = 'Dodatočné imlicitné voľby galérie'; 19 | -------------------------------------------------------------------------------- /lang/ckb/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['thumbnail_width'] = 'پانی وێنەی بچووک'; 9 | $lang['thumbnail_height'] = 'بەرزی وێنەی وێنۆچکە'; 10 | $lang['image_width'] = 'پانی وێنە'; 11 | $lang['image_height'] = 'بەرزی وێنە'; 12 | $lang['cols'] = 'وێنەکان بۆ هەر ڕیزێک'; 13 | $lang['sort'] = 'چۆن وێنە گەلەرییەکان پۆلێن بکەیت'; 14 | $lang['sort_o_file'] = 'پۆلێنکردن بەپێی ناوی فایل'; 15 | $lang['sort_o_mod'] = 'پۆلێنکردن بەپێی بەرواری فایل'; 16 | $lang['sort_o_date'] = 'پۆلێنکردن بەپێی بەرواری EXIF'; 17 | $lang['sort_o_title'] = 'پۆلێن کردن بە ناونیشانی EXIF'; 18 | $lang['options'] = 'هەڵبژاردنەکانی پێش گریمانەی گالەری زیاتر'; 19 | -------------------------------------------------------------------------------- /lang/hr/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['thumbnail_width'] = 'Širina slikovnih minijatura'; 9 | $lang['thumbnail_height'] = 'Visina slikovnih minijatura'; 10 | $lang['image_width'] = 'Širina slike'; 11 | $lang['image_height'] = 'Visina slike'; 12 | $lang['cols'] = 'Slika u retku'; 13 | $lang['sort'] = 'Kako poredati slike u galeriji'; 14 | $lang['sort_o_file'] = 'poredaj po imenu'; 15 | $lang['sort_o_mod'] = 'poredaj po datumu datoteke'; 16 | $lang['sort_o_date'] = 'poredaj po EXIF datumu'; 17 | $lang['sort_o_title'] = 'poredaj po EXIF naslovu'; 18 | $lang['options'] = 'Dodatne podrazumijevane opcije galerije'; 19 | -------------------------------------------------------------------------------- /lang/ko/settings.php: -------------------------------------------------------------------------------- 1 | 7 | * @author Andreas Gohr 8 | * @author SC Yoo 9 | * @author Myeongjin 10 | */ 11 | $lang['thumbnail_width'] = '섬네일 그림 너비'; 12 | $lang['thumbnail_height'] = '섬네일 그림 높이'; 13 | $lang['image_width'] = '그림 너비'; 14 | $lang['image_height'] = '그림 높이'; 15 | $lang['cols'] = '열당 그림 수'; 16 | $lang['sort'] = '갤러리 그림 정렬 방법'; 17 | $lang['sort_o_file'] = '파일 이름 순서로 정렬'; 18 | $lang['sort_o_mod'] = '파일 날짜 순서로 정렬'; 19 | $lang['sort_o_date'] = 'EXIF 날짜 순서로 정렬'; 20 | $lang['sort_o_title'] = 'EXIF 제목 순서로 정렬'; 21 | $lang['options'] = '추가적인 갤러리 기본 설정'; 22 | -------------------------------------------------------------------------------- /lang/nl/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['thumbnail_width'] = 'Breedte van het miniatuur beeld'; 9 | $lang['thumbnail_height'] = 'Hoogte van het miniatuur beeld'; 10 | $lang['image_width'] = 'Beeld breedte'; 11 | $lang['image_height'] = 'Beeld hoogte'; 12 | $lang['cols'] = 'Aantal beelden per rij'; 13 | $lang['sort'] = 'Hoe de beeldreeks sorteren'; 14 | $lang['sort_o_file'] = 'sorteren op bestandsnaam'; 15 | $lang['sort_o_mod'] = 'sorteren op bestandsdatum'; 16 | $lang['sort_o_date'] = 'sorteren op EXIF datum'; 17 | $lang['sort_o_title'] = 'sorteren op EXIF titel'; 18 | $lang['options'] = 'Bijkomende beeldreeks verstek opties'; 19 | -------------------------------------------------------------------------------- /lang/vi/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['thumbnail_width'] = 'Chiều rộng hình ảnh thu nhỏ'; 9 | $lang['thumbnail_height'] = 'Chiều cao hình ảnh thu nhỏ'; 10 | $lang['image_width'] = 'Chiều rộng hình ảnh'; 11 | $lang['image_height'] = 'Chiều cao hình ảnh'; 12 | $lang['cols'] = 'Hình ảnh mỗi hàng'; 13 | $lang['sort'] = 'Cách sắp xếp hình ảnh thư viện'; 14 | $lang['sort_o_file'] = 'sắp xếp theo tên tập tin'; 15 | $lang['sort_o_mod'] = 'sắp xếp theo ngày'; 16 | $lang['sort_o_date'] = 'sắp xếp theo ngày EXIF'; 17 | $lang['sort_o_title'] = 'sắp xếp theo tiêu đề EXIF'; 18 | $lang['options'] = 'Tùy chọn thư viện mặc định bổ sung'; 19 | -------------------------------------------------------------------------------- /lang/ru/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['thumbnail_width'] = 'Ширина миниатюры изображения'; 9 | $lang['thumbnail_height'] = 'Высота миниатюры изображения'; 10 | $lang['image_width'] = 'Ширина изображения'; 11 | $lang['image_height'] = 'Высота изображения'; 12 | $lang['cols'] = 'Изображения в ряд'; 13 | $lang['sort'] = 'Как сортировать изображения в галерее'; 14 | $lang['sort_o_file'] = 'сортировать по имени файла'; 15 | $lang['sort_o_mod'] = 'сортировать по дате файла'; 16 | $lang['sort_o_date'] = 'сортировать по EXIF-дате'; 17 | $lang['sort_o_title'] = 'сортировать по EXIF-заголовку'; 18 | $lang['options'] = 'Дополнительные опции'; 19 | -------------------------------------------------------------------------------- /lang/el/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['thumbnail_width'] = 'Πλάτος εικόνας thumbnail '; 9 | $lang['thumbnail_height'] = 'Ύψος εικόνας Thumbnail '; 10 | $lang['image_width'] = 'Πλάτος εικόνας'; 11 | $lang['image_height'] = 'Ύψος εικόνας'; 12 | $lang['cols'] = 'Εικόνες ανά σειρά'; 13 | $lang['sort'] = 'Πώς να επιλέξεις τις εικόνες γαλαρίας '; 14 | $lang['sort_o_file'] = 'επιλέχθηκε από το όνομα φακέλλου'; 15 | $lang['sort_o_mod'] = 'επιλογή φακέλλου καθ\'ημερομηνία'; 16 | $lang['sort_o_date'] = 'επιλογή κατά ημερομηνία EXIF'; 17 | $lang['sort_o_title'] = 'επιλογή κατά τίτλο EXIF '; 18 | $lang['options'] = 'Επιπλέον επιλογές από γκαλερί'; 19 | -------------------------------------------------------------------------------- /lang/pt-br/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['thumbnail_width'] = 'Largura da imagem miniatura'; 9 | $lang['thumbnail_height'] = 'Altura da imagem miniatura'; 10 | $lang['image_width'] = 'Largura da imagem'; 11 | $lang['image_height'] = 'Altura da imagem'; 12 | $lang['cols'] = 'Imagens por linha'; 13 | $lang['sort'] = 'Como ordenar as imagens da galeria'; 14 | $lang['sort_o_file'] = 'ordenar por nome do arquivo'; 15 | $lang['sort_o_mod'] = 'ordenar por data do arquivo'; 16 | $lang['sort_o_date'] = 'ordenar por data EXIF'; 17 | $lang['sort_o_title'] = 'ordenar por título EXIF'; 18 | $lang['options'] = 'Opções padrão da galeria adicional'; 19 | -------------------------------------------------------------------------------- /lang/uk/lang.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['pages'] = 'Сторінки галереї:'; 9 | $lang['js']['title_dialog'] = 'Плагін галереї'; 10 | $lang['js']['label_align_left'] = 'вирівняти зліва'; 11 | $lang['js']['label_align_center'] = 'вирівняти по центру'; 12 | $lang['js']['label_align_right'] = 'вирівняти справа'; 13 | $lang['js']['label_cols'] = 'Кількість зображень на рядок у таблиці галереї'; 14 | $lang['js']['label_offset'] = 'Пропустити першу кількість зображень. Корисно з опцією вище'; 15 | $lang['js']['label_sort_file'] = 'Сортувати за ім\'ям файлу'; 16 | $lang['js']['label_sort_mod'] = 'Сортувати за датою змінювання'; 17 | $lang['nothingfound'] = 'Зображення не знайдено.'; 18 | $lang['fail'] = 'Помилка завантаження галереї'; 19 | -------------------------------------------------------------------------------- /lang/ca/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['thumbnail_width'] = 'Amplada de la miniatura'; 9 | $lang['thumbnail_height'] = 'Alçada de la miniatura'; 10 | $lang['image_width'] = 'Amplada de la imatge'; 11 | $lang['image_height'] = 'Alçada de la imatge'; 12 | $lang['cols'] = 'Imatges per fila'; 13 | $lang['sort'] = 'Com ordenar les imatges'; 14 | $lang['sort_o_file'] = 'Ordenar per nom de l\'arxiu'; 15 | $lang['sort_o_mod'] = 'Ordenar per data de l\'arxiu'; 16 | $lang['sort_o_date'] = 'Ordenar per la data de l\'EXIF'; 17 | $lang['sort_o_title'] = 'Ordenar pel títol de l\'EXIF'; 18 | $lang['options'] = 'Opcions predeterminades de galeria adicionals'; 19 | -------------------------------------------------------------------------------- /lang/fa/settings.php: -------------------------------------------------------------------------------- 1 | 7 | * @author sam01 8 | */ 9 | $lang['thumbnail_width'] = 'عرض تصویر بند انگشتی'; 10 | $lang['thumbnail_height'] = 'طول تصویر بند انگشتی'; 11 | $lang['image_width'] = 'عرض تصویر'; 12 | $lang['image_height'] = 'طول تصویر'; 13 | $lang['cols'] = 'تعداد عکس در هر ردیف'; 14 | $lang['sort'] = 'چگونگی مرتب سازی تصاویر گالری'; 15 | $lang['sort_o_file'] = 'مرتب کردن بر اساس نام فایل'; 16 | $lang['sort_o_mod'] = 'مرتب‌ کردن بر اساس تاریخ فایل'; 17 | $lang['sort_o_date'] = 'مرتب کردن بر اساس تاریخ EXIF'; 18 | $lang['sort_o_title'] = 'مرتب کردن بر اساس عنوان EXIF'; 19 | $lang['options'] = 'گزینه‌های اضافی پیش‌فرض گالری'; 20 | -------------------------------------------------------------------------------- /lang/pt-br/lang.php: -------------------------------------------------------------------------------- 1 | 7 | * @author Frederico Gonçalves Guimarães 8 | * @author Juliano Marconi Lanigra 9 | */ 10 | $lang['pages'] = 'Páginas da galeria:'; 11 | $lang['js']['addgal'] = 'Adicionar domínio como galeria'; 12 | $lang['js']['label_sort_random'] = 'Organizar imagens randomicamente. Você pode querer desabilitar o cache também'; 13 | $lang['js']['label_sort_mod'] = 'Organizar imagens por data de modificação'; 14 | $lang['js']['label_sort_exif_date'] = 'Organizar imagens por data EXIF'; 15 | $lang['js']['label_sort_exif_title'] = 'Organizar imagens por título EXIF '; 16 | $lang['nothingfound'] = 'Não foi encontrada nenhuma imagem.'; 17 | $lang['fail'] = 'Falha ao carregar a galeria'; 18 | -------------------------------------------------------------------------------- /lang/cs/settings.php: -------------------------------------------------------------------------------- 1 | 7 | * @author Tomáš Drbohlav 8 | * @author Jaroslav Lichtblau 9 | */ 10 | $lang['thumbnail_width'] = 'Šířka miniatury'; 11 | $lang['thumbnail_height'] = 'Výška miniatury'; 12 | $lang['image_width'] = 'Šířka obrázku'; 13 | $lang['image_height'] = 'Výška obrázku'; 14 | $lang['cols'] = 'Obrázků na řádek'; 15 | $lang['sort'] = 'Jak řadit obrázky v galerii'; 16 | $lang['sort_o_file'] = 'řadit podle názvu souboru'; 17 | $lang['sort_o_mod'] = 'řadit podle data souboru'; 18 | $lang['sort_o_date'] = 'řadit podle EXIF data'; 19 | $lang['sort_o_title'] = 'řadit podle EXIF názvu'; 20 | $lang['options'] = 'Další výchozí možnosti galerie'; 21 | -------------------------------------------------------------------------------- /lang/de-informal/settings.php: -------------------------------------------------------------------------------- 1 | 7 | * @author Felix Müller-Donath 8 | */ 9 | $lang['thumbnail_width'] = 'Breite der Vorschaubilder'; 10 | $lang['thumbnail_height'] = 'Höhe der Vorschaubilder'; 11 | $lang['image_width'] = 'Bildbreite'; 12 | $lang['image_height'] = 'Bildhöhe'; 13 | $lang['cols'] = 'Bilder pro Zeile'; 14 | $lang['sort'] = 'Sortierung der Galeriebilder'; 15 | $lang['sort_o_file'] = 'nach Dateiname sortieren'; 16 | $lang['sort_o_mod'] = 'nach Dateidatum sortieren'; 17 | $lang['sort_o_date'] = 'nach EXIF-Datum sortieren'; 18 | $lang['sort_o_title'] = 'nach EXIF-Titel sortieren'; 19 | $lang['options'] = 'Zusätzliche Galerie Standard-Einstellungen'; 20 | -------------------------------------------------------------------------------- /lang/tr/settings.php: -------------------------------------------------------------------------------- 1 | 7 | * @author ilker Rifat Kapaç 8 | */ 9 | $lang['thumbnail_width'] = 'Küçük resim genişliği'; 10 | $lang['thumbnail_height'] = 'Küçük resim yüksekliği'; 11 | $lang['image_width'] = 'Resim genişliği'; 12 | $lang['image_height'] = 'Resim yüksekliği'; 13 | $lang['cols'] = 'Satır başına görüntü sayısı'; 14 | $lang['sort'] = 'Sergi resimleri nasıl sıralansın'; 15 | $lang['sort_o_file'] = 'Dosya adına göre sırala'; 16 | $lang['sort_o_mod'] = 'Dosya tarihine göre sıralama'; 17 | $lang['sort_o_date'] = 'EXIF tarihine göre sırala'; 18 | $lang['sort_o_title'] = 'EXIF başlığına göre sırala'; 19 | $lang['options'] = 'İlave serginin varsayılan seçenekleri'; 20 | -------------------------------------------------------------------------------- /lang/pl/settings.php: -------------------------------------------------------------------------------- 1 | 9 | */ 10 | $lang['thumbnail_width'] = 'Szerokość miniaturki'; 11 | $lang['thumbnail_height'] = 'Wysokość miniaturki'; 12 | $lang['image_width'] = 'Szerokość zdjęcia'; 13 | $lang['image_height'] = 'Wysokość zdjęcia'; 14 | $lang['cols'] = 'Limit zdjęć w wierszu (0 gdy limit wyłączony)'; 15 | $lang['sort'] = 'Sortowanie zdjęć w galerii'; 16 | $lang['sort_o_file'] = 'sortuj po nazwie pliku'; 17 | $lang['sort_o_mod'] = 'sortuj po dacie modyfikacji'; 18 | $lang['sort_o_date'] = 'sortuj po dacie utworzenia z EXIF'; 19 | $lang['sort_o_title'] = 'sortuj po nazwie z EXIF'; 20 | $lang['options'] = 'Dodatkowe opcje galerii'; 21 | -------------------------------------------------------------------------------- /lang/ta/settings.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $lang['thumbnail_width'] = 'சிறு படத்தின் உயரம்'; 9 | $lang['thumbnail_height'] = 'சிறு படத்தின் அகலம் '; 10 | $lang['image_width'] = 'படத்தின் அகலம்'; 11 | $lang['image_height'] = 'படத்தின் உயரம்'; 12 | $lang['cols'] = 'ஒரு வரிசையில் எத்தனை படங்கள் '; 13 | $lang['sort'] = 'இந்த பட தொகுப்பை எப்படி வகைப்படுத்துவது '; 14 | $lang['sort_o_file'] = 'கோப்பின் பெயரை வைத்து வகைப்படுத்து '; 15 | $lang['sort_o_mod'] = 'கோப்பின் தேதியை வைத்து வகைப்படுத்து '; 16 | $lang['sort_o_date'] = 'EXIF தேதியை வைத்து வகைப்படுத்து'; 17 | $lang['sort_o_title'] = 'EXIF பெயரை வைத்து வகைப்படுத்து'; 18 | $lang['options'] = 'கூடுதல் படத் தொகுப்பின் முன்னிருப்பு விருப்பங்கள் '; 19 | -------------------------------------------------------------------------------- /conf/metadata.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | 9 | use dokuwiki\plugin\gallery\classes\Options; 10 | 11 | $meta['thumbnail_width'] = array('numeric'); 12 | $meta['thumbnail_height'] = array('numeric'); 13 | $meta['image_width'] = array('numeric'); 14 | $meta['image_height'] = array('numeric'); 15 | $meta['cols'] = array('numeric'); 16 | 17 | $meta['sort'] = array( 18 | 'multichoice', 19 | '_choices' => array( 20 | Options::SORT_FILE, 21 | Options::SORT_CTIME, 22 | Options::SORT_MTIME, 23 | Options::SORT_TITLE, 24 | Options::SORT_RANDOM, 25 | ) 26 | ); 27 | $meta['options'] = array('multicheckbox', '_choices' => array( 28 | 'cache', 29 | 'crop', 30 | 'direct', 31 | 'lightbox', 32 | 'recursive', 33 | 'reverse', 34 | 'showcaption', 35 | 'showname', 36 | 'showtitle', 37 | )); 38 | -------------------------------------------------------------------------------- /lang/fr/settings.php: -------------------------------------------------------------------------------- 1 | 7 | * @author Emmanuel Dupin 8 | * @author NicolasFriedli 9 | */ 10 | $lang['thumbnail_width'] = 'Largeur des miniatures'; 11 | $lang['thumbnail_height'] = 'Hauteur des miniatures'; 12 | $lang['image_width'] = 'Largeur des images'; 13 | $lang['image_height'] = 'Hauteur des images'; 14 | $lang['cols'] = 'Nombre d\'images par ligne'; 15 | $lang['sort'] = 'Critère de tri des images'; 16 | $lang['sort_o_file'] = 'trier par nom du fichier'; 17 | $lang['sort_o_mod'] = 'trier par date de modification du fichier'; 18 | $lang['sort_o_date'] = 'trier par date EXIF'; 19 | $lang['sort_o_title'] = 'trier par titre EXIF'; 20 | $lang['options'] = 'Options par défaut supplémentaires'; 21 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | gallery Plugin for DokuWiki 2 | 3 | All documentation for this plugin can be found at 4 | http://www.dokuwiki.org/plugin:gallery 5 | 6 | If you install this plugin manually, make sure it is installed in 7 | lib/plugins/gallery/ - if the folder is called different it 8 | will not work! 9 | 10 | Please refer to http://www.dokuwiki.org/plugins for additional info 11 | on how to install plugins in DokuWiki. 12 | 13 | ---- 14 | Copyright (C) Andreas Gohr 15 | 16 | This program is free software; you can redistribute it and/or modify 17 | it under the terms of the GNU General Public License as published by 18 | the Free Software Foundation; version 2 of the License 19 | 20 | This program is distributed in the hope that it will be useful, 21 | but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | GNU General Public License for more details. 24 | 25 | See the COPYING file in your DokuWiki folder for details 26 | -------------------------------------------------------------------------------- /lang/es/settings.php: -------------------------------------------------------------------------------- 1 | 7 | * @author Joel Cantoral 8 | * @author Domingo Redal 9 | */ 10 | $lang['thumbnail_width'] = 'Ancho de la imagen en miniatura'; 11 | $lang['thumbnail_height'] = 'Alto de la imagen en miniatura'; 12 | $lang['image_width'] = 'Ancho de la imagen'; 13 | $lang['image_height'] = 'Alto de la imagen'; 14 | $lang['cols'] = 'Imágenes por fila'; 15 | $lang['sort'] = 'Cómo ordenar las imágenes de la galería'; 16 | $lang['sort_o_file'] = 'ordenar por nombre de archivo'; 17 | $lang['sort_o_mod'] = 'ordenar por fecha de archivo'; 18 | $lang['sort_o_date'] = 'ordenar por fecha EXIF'; 19 | $lang['sort_o_title'] = 'ordenar por título EXIF'; 20 | $lang['options'] = 'Opciones adicionales por defecto de la galería'; 21 | -------------------------------------------------------------------------------- /lang/it/settings.php: -------------------------------------------------------------------------------- 1 | 7 | * @author Dmitry Baikov 8 | * @author Diego Pierotto 9 | * @author Antonio 10 | */ 11 | $lang['thumbnail_width'] = 'Larghezza immagine anteprima'; 12 | $lang['thumbnail_height'] = 'Altezza immagine anteprima'; 13 | $lang['image_width'] = 'Larghezza immagine'; 14 | $lang['image_height'] = 'Altezza immagine'; 15 | $lang['cols'] = 'Immagini per riga'; 16 | $lang['sort'] = 'Come ordinare le immagini della galleria'; 17 | $lang['sort_o_file'] = 'ordina per nome del file'; 18 | $lang['sort_o_mod'] = 'ordina per data del file'; 19 | $lang['sort_o_date'] = 'ordina per data dell\'EXIF'; 20 | $lang['sort_o_title'] = 'ordina per titolo dell\'EXIF'; 21 | $lang['options'] = 'Opzioni predefinite aggiuntive galleria'; 22 | -------------------------------------------------------------------------------- /syntax/list.php: -------------------------------------------------------------------------------- 1 | 10 | */ 11 | class syntax_plugin_gallery_list extends syntax_plugin_gallery_main 12 | { 13 | /** @inheritDoc */ 14 | public function connectTo($mode) 15 | { 16 | $this->Lexer->addSpecialPattern('.+?', $mode, 'plugin_gallery_list'); 17 | } 18 | 19 | /** @inheritDoc */ 20 | public function handle($match, $state, $pos, Doku_Handler $handler) 21 | { 22 | $match = substr($match, 8, -10); //strip markup from start and end 23 | [$params, $list] = sexplode('>', $match, 2); 24 | 25 | $options = new Options(); 26 | $options->parseParameters($params); 27 | 28 | $list = explode("\n", $list); 29 | $list = array_map('trim', $list); 30 | $list = array_filter($list); 31 | 32 | return [$list, $options]; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /classes/ListGallery.php: -------------------------------------------------------------------------------- 1 | hasImageExtension($img)) continue; 27 | 28 | try { 29 | $image = new Image($img); 30 | } catch (\Exception $e) { 31 | // not found 32 | continue; 33 | } 34 | 35 | if ($title) $image->setTitle($title); 36 | if ($desc) $image->setDescription($desc); 37 | $this->images[] = $image; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lang/zh/lang.php: -------------------------------------------------------------------------------- 1 | 7 | * @author RainSlide 8 | * @author oott123 9 | */ 10 | $lang['pages'] = '相册页面:'; 11 | $lang['js']['addgal'] = '将命名空间添加为相册'; 12 | $lang['js']['label_toolbar_button'] = '插入图库'; 13 | $lang['js']['title_dialog'] = '图库插件'; 14 | $lang['js']['label_namespace'] = '命名空间或RSS订阅'; 15 | $lang['js']['label_thumbnailsize'] = '设置缩略图的大小'; 16 | $lang['js']['pattern_hint_thumbnailsize'] = ''; 17 | $lang['js']['label_imagesize'] = '设置直接模式下链接图像的大小。'; 18 | $lang['js']['pattern_hint_imagesize'] = ''; 19 | $lang['js']['label_cache'] = '缓存缩略图'; 20 | $lang['js']['label_filter'] = '过滤器(必须包含字符“*”)'; 21 | $lang['js']['label_showname'] = '在缩略图下显示文件名'; 22 | $lang['js']['label_showtitle'] = '在缩略图下显示EXIF标签标题作为标题'; 23 | $lang['js']['label_crop'] = '使缩略图的大小完全符合给定的缩略图尺寸,需要时进行裁剪。'; 24 | $lang['js']['label_direct'] = '将缩略图链接到较大尺寸的图像,而不是它们的详细页面。'; 25 | $lang['js']['label_lightbox'] = '以漂亮的JavaScript模态框显示图像'; 26 | $lang['js']['label_reverse'] = '反转显示的图像顺序'; 27 | $lang['js']['label_recursive'] = '在给定命名空间及其所有子命名空间中查找图像'; 28 | $lang['js']['label_align_left'] = '左对齐'; 29 | $lang['js']['label_align_center'] = '居中对齐'; 30 | $lang['js']['label_align_right'] = '右对齐'; 31 | $lang['js']['label_cols'] = '在图库表中每行的图像数量'; 32 | $lang['js']['label_limit'] = '将输出限制为给定数量的图像。0 表示全部'; 33 | $lang['js']['label_offset'] = '跳过第一批图像的数量。与上述选项一起使用时很有用'; 34 | $lang['js']['label_paginate'] = '为缩略图添加分页,显示每页给定缩略图的数量。0表示禁用分页'; 35 | $lang['js']['label_sort_file'] = '按文件名对图像进行排序'; 36 | $lang['js']['label_sort_random'] = '随机排序图像。您可能还想禁用缓存'; 37 | $lang['js']['label_sort_mod'] = '按文件修改日期排序图像'; 38 | $lang['js']['label_sort_exif_date'] = '按EXIF日期排序图像'; 39 | $lang['js']['label_sort_exif_title'] = '按EXIF标题排序图像'; 40 | $lang['nothingfound'] = '找不到图片。'; 41 | $lang['fail'] = '加载图库失败'; 42 | -------------------------------------------------------------------------------- /deleted.files: -------------------------------------------------------------------------------- 1 | # This is a list of files that were present in previous releases 2 | # but were removed later. They should not exist in your installation. 3 | all.less 4 | classes/Formatter.php 5 | images/blank.gif 6 | images/close.gif 7 | images/expand.gif 8 | images/loading.gif 9 | images/next.gif 10 | images/overlay.png 11 | images/overlayie.png 12 | images/prev.gif 13 | images/shrink.gif 14 | index.html 15 | info.txt 16 | jquery.prettyPhoto.js 17 | prettyPhoto/dark_rounded/btnNext.png 18 | prettyPhoto/dark_rounded/btnPrevious.png 19 | prettyPhoto/dark_rounded/contentPattern.png 20 | prettyPhoto/dark_rounded/default_thumbnail.gif 21 | prettyPhoto/dark_rounded/loader.gif 22 | prettyPhoto/dark_rounded/sprite.png 23 | prettyPhoto/dark_square/btnNext.png 24 | prettyPhoto/dark_square/btnPrevious.png 25 | prettyPhoto/dark_square/contentPattern.png 26 | prettyPhoto/dark_square/default_thumbnail.gif 27 | prettyPhoto/dark_square/loader.gif 28 | prettyPhoto/dark_square/sprite.png 29 | prettyPhoto/default/default_thumb.png 30 | prettyPhoto/default/loader.gif 31 | prettyPhoto/default/sprite.png 32 | prettyPhoto/default/sprite_next.png 33 | prettyPhoto/default/sprite_prev.png 34 | prettyPhoto/default/sprite_x.png 35 | prettyPhoto/default/sprite_y.png 36 | prettyPhoto/facebook/btnNext.png 37 | prettyPhoto/facebook/btnPrevious.png 38 | prettyPhoto/facebook/contentPatternBottom.png 39 | prettyPhoto/facebook/contentPatternLeft.png 40 | prettyPhoto/facebook/contentPatternRight.png 41 | prettyPhoto/facebook/contentPatternTop.png 42 | prettyPhoto/facebook/default_thumbnail.gif 43 | prettyPhoto/facebook/loader.gif 44 | prettyPhoto/facebook/sprite.png 45 | prettyPhoto/light_rounded/btnNext.png 46 | prettyPhoto/light_rounded/btnPrevious.png 47 | prettyPhoto/light_rounded/default_thumbnail.gif 48 | prettyPhoto/light_rounded/loader.gif 49 | prettyPhoto/light_rounded/sprite.png 50 | prettyPhoto/light_square/btnNext.png 51 | prettyPhoto/light_square/btnPrevious.png 52 | prettyPhoto/light_square/default_thumbnail.gif 53 | prettyPhoto/light_square/loader.gif 54 | prettyPhoto/light_square/sprite.png 55 | screen.css 56 | style.css 57 | swipebox/README 58 | swipebox/css/swipebox.less 59 | swipebox/css/swipebox.min.css 60 | swipebox/img/icons.png 61 | swipebox/img/icons.svg 62 | swipebox/img/loader.gif 63 | swipebox/js/jquery.swipebox.js 64 | swipebox/js/jquery.swipebox.min.js 65 | syntax.php 66 | -------------------------------------------------------------------------------- /screen.less: -------------------------------------------------------------------------------- 1 | @import "simple-lightbox/simple-lightbox.less"; 2 | 3 | /** Simple Lightbox Adjustments */ 4 | .sl-overlay { 5 | background-color: #000; 6 | } 7 | 8 | .sl-wrapper { 9 | .sl-counter, 10 | .sl-close, 11 | .sl-navigation button { 12 | color: #fff; 13 | 14 | &:hover { 15 | color: #000; 16 | } 17 | } 18 | } 19 | 20 | /** Gallery Styles */ 21 | div.plugin-gallery { 22 | max-width: 100%; 23 | box-sizing: border-box; 24 | margin-bottom: 1.4em; 25 | 26 | div.gallery-page { 27 | display: grid; 28 | // column setup happens in Formatter::formatPage() 29 | gap: 1em; 30 | width: auto; 31 | max-width: 100%; 32 | 33 | figure { 34 | text-align: center; 35 | border: 1px solid @ini_border; 36 | margin: 0; 37 | padding: 0.4em; 38 | display: flex; 39 | flex-direction: column; 40 | justify-content: space-between; 41 | overflow: hidden; 42 | 43 | img { 44 | max-width: 100%; 45 | height: auto; 46 | } 47 | 48 | figcaption { 49 | margin-top: 0.4em; 50 | 51 | a { 52 | display: block; 53 | 54 | &.gallery-title { 55 | font-weight: bold; 56 | } 57 | } 58 | } 59 | } 60 | } 61 | 62 | &.align-full { 63 | width: 100%; 64 | } 65 | 66 | &.align-left { 67 | float: left; 68 | margin-right: 1em; 69 | } 70 | 71 | &.align-right { 72 | float: right; 73 | margin-left: 1em; 74 | } 75 | 76 | &.align-center { 77 | display: flex; 78 | justify-content: center; 79 | flex-wrap: wrap; // wrap page selector on new line 80 | } 81 | 82 | .gallery-page-selector { 83 | padding-top: 0.4em; 84 | display: none; // hidden by default, shown by JS 85 | 86 | a { 87 | display: inline-block; 88 | padding: 0.2em 0.4em; 89 | border: 1px solid transparent; 90 | 91 | &.active { 92 | border: 1px solid @ini_border; 93 | border-radius: 0.4em; 94 | } 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /lang/en/lang.php: -------------------------------------------------------------------------------- 1 | '; 14 | $lang['js']['label_imagesize'] = 'Sets the size for the linked images in direct mode.'; 15 | $lang['js']['pattern_hint_imagesize'] = ''; 16 | $lang['js']['label_cache'] = 'Cache the thumbnails'; 17 | $lang['js']['label_filter'] = 'Filter (must contain a "*" character)'; 18 | $lang['js']['label_showname'] = 'Show filename below thumbnails'; 19 | $lang['js']['label_showtitle'] = 'Show the EXIF tag Headline as title below thumbnails'; 20 | $lang['js']['label_crop'] = 'Make thumbnails the exact given thumbnail size big, cropping when needed'; 21 | $lang['js']['label_direct'] = 'Link thumbnails with the bigger sized images not with their detail page'; 22 | $lang['js']['label_lightbox'] = 'Show images in a fancy JavaScript modal'; 23 | $lang['js']['label_reverse'] = 'Reverse the order of the displayed images'; 24 | $lang['js']['label_recursive'] = 'Find images in the given namespace and all sub namespaces'; 25 | $lang['js']['label_align_left'] = 'align left'; 26 | $lang['js']['label_align_center'] = 'align center'; 27 | $lang['js']['label_align_right'] = 'align right'; 28 | $lang['js']['label_cols'] = 'The number images per row in the gallery table'; 29 | $lang['js']['label_limit'] = 'Limits the output to the given number of images. 0 means all'; 30 | $lang['js']['label_offset'] = 'Skip the first number of images. Useful with the option above'; 31 | $lang['js']['label_paginate'] = 'Add a pagination for the thumbnails displaying the number of given thumbnails per page. 0 disables pagination'; 32 | $lang['js']['label_sort_file'] = 'Sort the images by filename'; 33 | $lang['js']['label_sort_random'] = 'Sort images randomly. You might want to disable the cache as well'; 34 | $lang['js']['label_sort_mod'] = 'Sort images by file modification date'; 35 | $lang['js']['label_sort_exif_date'] = 'Sort images by EXIF date'; 36 | $lang['js']['label_sort_exif_title'] = 'Sort images by EXIF title'; 37 | -------------------------------------------------------------------------------- /classes/NamespaceGallery.php: -------------------------------------------------------------------------------- 1 | searchNamespace($ns, $options->recursive, $options->filter); 12 | } 13 | 14 | /** 15 | * Find the images 16 | * 17 | * @param string $ns 18 | * @param bool $recursive search recursively? 19 | * @param string $filter regular expresion to filter image IDs against (without namespace) 20 | * @throws \Exception 21 | */ 22 | protected function searchNamespace($ns, $recursive, $filter) 23 | { 24 | global $conf; 25 | 26 | if (media_exists($ns) && !is_dir(mediaFN($ns))) { 27 | // this is a single file, not a namespace 28 | if ($this->hasImageExtension($ns)) { 29 | $this->images[] = new Image($ns); 30 | } 31 | } else { 32 | search( 33 | $this->images, 34 | $conf['mediadir'], 35 | [$this, 'searchCallback'], 36 | [ 37 | 'depth' => $recursive ? 0 : 1, 38 | 'filter' => $filter 39 | ], 40 | utf8_encodeFN(str_replace(':', '/', $ns)) 41 | ); 42 | } 43 | } 44 | 45 | /** 46 | * Callback for search() to find images 47 | */ 48 | public function searchCallback(&$data, $base, $file, $type, $lvl, $opts) 49 | { 50 | if ($type == 'd') { 51 | if (empty($opts['depth'])) return true; // recurse forever 52 | $depth = substr_count($file, '/'); // we can't use level because we start deeper 53 | if ($depth >= $opts['depth']) return false; // depth reached 54 | return true; 55 | } 56 | 57 | $id = pathID($file, true); 58 | 59 | // skip non-valid files 60 | if ($id != cleanID($id)) return false; 61 | //check ACL for namespace (we have no ACL for mediafiles) 62 | if (auth_quickaclcheck(getNS($id) . ':*') < AUTH_READ) return false; 63 | // skip non-images 64 | if (!$this->hasImageExtension($file)) return false; 65 | // skip filtered images 66 | if ($opts['filter'] && !preg_match($opts['filter'], noNS($id))) return false; 67 | 68 | // still here, add to result 69 | $data[] = new Image($id); 70 | return false; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /classes/AbstractGallery.php: -------------------------------------------------------------------------------- 1 | options = $options; 23 | } 24 | 25 | /** 26 | * Simple heuristic if something is an image 27 | * 28 | * @param string $src 29 | * @return bool 30 | */ 31 | public function hasImageExtension($src) 32 | { 33 | return (bool)preg_match(Image::IMG_REGEX, $src); 34 | } 35 | 36 | /** 37 | * Get the images of this gallery 38 | * 39 | * The result will be sorted, reversed and limited according to the options 40 | * 41 | * @return Image[] 42 | */ 43 | public function getImages() 44 | { 45 | $images = $this->images; // create a copy of the array 46 | 47 | switch ($this->options->sort) { 48 | case Options::SORT_FILE: 49 | usort($images, function ($a, $b) { 50 | return Sort::strcmp($a->getFilename(), $b->getFilename()); 51 | }); 52 | break; 53 | case Options::SORT_CTIME: 54 | usort($images, function ($a, $b) { 55 | return $a->getCreated() - $b->getCreated(); 56 | }); 57 | break; 58 | case Options::SORT_MTIME: 59 | usort($images, function ($a, $b) { 60 | return $a->getModified() - $b->getModified(); 61 | }); 62 | break; 63 | case Options::SORT_TITLE: 64 | usort($images, function ($a, $b) { 65 | return Sort::strcmp($a->getTitle(), $b->getTitle()); 66 | }); 67 | break; 68 | case Options::SORT_RANDOM: 69 | shuffle($images); 70 | break; 71 | } 72 | if ($this->options->reverse) { 73 | $images = array_reverse($images); 74 | } 75 | if ($this->options->offset) { 76 | $images = array_slice($images, $this->options->offset); 77 | } 78 | if ($this->options->limit) { 79 | $images = array_slice($images, 0, $this->options->limit); 80 | } 81 | 82 | return $images; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /lang/cs/lang.php: -------------------------------------------------------------------------------- 1 | 7 | * @author Petr Kajzar 8 | * @author Jaroslav Lichtblau 9 | */ 10 | $lang['pages'] = 'Stránky galerie:'; 11 | $lang['js']['addgal'] = 'Přidat jmenný prostor jako galerii'; 12 | $lang['js']['label_toolbar_button'] = 'Vložit galerii'; 13 | $lang['js']['title_dialog'] = 'Modul plug-in Galerie'; 14 | $lang['js']['label_namespace'] = 'Jmenný prostor nebo RSS kanál'; 15 | $lang['js']['label_thumbnailsize'] = 'Nastavit velikost miniatur'; 16 | $lang['js']['label_imagesize'] = 'Nastavit velikost propojených obrázků v přímém režimu'; 17 | $lang['js']['label_cache'] = 'Uložit miniatury do mezipaměti'; 18 | $lang['js']['label_filter'] = 'Filtr (musí obsahovat znak *)'; 19 | $lang['js']['label_showname'] = 'Zobrazit název souboru pod miniaturami'; 20 | $lang['js']['label_showtitle'] = 'Zobrazit EXIF ​​tag Headline jako nadpis pod miniaturami'; 21 | $lang['js']['label_crop'] = 'Vytvořit miniatury přesně dané velikosti a v případě potřeby je oříznout'; 22 | $lang['js']['label_direct'] = 'Propojit miniatury s obrázky větších rozměrů, nikoli se stránkou s podrobnostmi'; 23 | $lang['js']['label_lightbox'] = 'Zobrazit obrázky v efektním modálním okně JavaScriptu'; 24 | $lang['js']['label_reverse'] = 'Obrátit pořadí zobrazených snímků'; 25 | $lang['js']['label_recursive'] = 'Vyhledat obrázky v daném jmenném prostoru a všech podřízených jmenných prostorech'; 26 | $lang['js']['label_align_left'] = 'Zarovnat vlevo'; 27 | $lang['js']['label_align_center'] = 'Zarovnat na střed'; 28 | $lang['js']['label_align_right'] = 'Zarovnat vpravo'; 29 | $lang['js']['label_cols'] = 'Počet obrázků na řádek v tabulce galerie'; 30 | $lang['js']['label_limit'] = 'Omezit výstup na zadaný počet obrázků. 0 znamená všechny'; 31 | $lang['js']['label_offset'] = 'Přeskočit první počet obrázků. Užitečné s možností výše'; 32 | $lang['js']['label_paginate'] = 'Přidat stránkování pro miniatury zobrazující počet daných miniatur na stránku. 0 zakáže stránkování'; 33 | $lang['js']['label_sort_file'] = 'Seřadit obrázky podle názvu souboru'; 34 | $lang['js']['label_sort_random'] = 'Seřadit obrázky náhodně. Možná budete chtít také zakázat mezipaměť'; 35 | $lang['js']['label_sort_mod'] = 'Seřadit obrázky podle data změny souboru'; 36 | $lang['js']['label_sort_exif_date'] = 'Seřadit obrázky podle data EXIF'; 37 | $lang['js']['label_sort_exif_title'] = 'Seřadit obrázky podle názvu EXIF'; 38 | $lang['nothingfound'] = 'Nenalezeny žádné obrázky.'; 39 | $lang['fail'] = 'Načtení galerie se nezdařilo'; 40 | -------------------------------------------------------------------------------- /script.js: -------------------------------------------------------------------------------- 1 | /* DOKUWIKI:include_once simple-lightbox/simple-lightbox.js */ 2 | /* DOKUWIKI:include script/prosemirror.js */ 3 | 4 | jQuery(function () { 5 | /** 6 | * Add a quicklink to the media popup 7 | */ 8 | (function() { 9 | const $opts = jQuery('#media__opts'); 10 | if (!$opts.length) return; 11 | if (!window.opener) return; // we're not in the popup 12 | 13 | const glbl = document.createElement('label'); 14 | const glnk = document.createElement('a'); 15 | const gbrk = document.createElement('br'); 16 | 17 | glnk.innerHTML = LANG.plugins.gallery.addgal; 18 | glnk.style.cursor = 'pointer'; 19 | glnk.href = '#'; 20 | 21 | glnk.onclick = function () { 22 | const $h1 = jQuery('#media__ns'); 23 | if (!$h1.length) return; 24 | const ns = $h1[0].textContent; 25 | opener.insertAtCarret('wiki__text', '{{gallery>' + ns + '}}'); 26 | if (!dw_mediamanager.keepopen) window.close(); 27 | }; 28 | 29 | $opts[0].appendChild(glbl); 30 | glbl.appendChild(glnk); 31 | $opts[0].appendChild(gbrk); 32 | })(); 33 | 34 | /** 35 | * Display a selected page and hide all others 36 | */ 37 | (function() { 38 | // hide all pages except the first one in each gallery 39 | jQuery('.plugin-gallery').each(function() { 40 | const $gallery = jQuery(this); 41 | $gallery.find('.gallery-page').hide().eq(0).show(); 42 | $gallery.find('.gallery-page-selector a').eq(0).addClass('active'); 43 | }); 44 | // attach page selector 45 | jQuery('.gallery-page-selector a').click(function(e) { 46 | const $self = jQuery(this); 47 | $self.siblings().removeClass('active'); 48 | $self.addClass('active'); 49 | const $gallery = $self.closest('.plugin-gallery'); 50 | $gallery.find('.gallery-page').hide(); 51 | $gallery.find(e.target.hash).show(); 52 | e.preventDefault(); 53 | }); 54 | // make page selector visible 55 | jQuery('.gallery-page-selector').show(); 56 | })(); 57 | 58 | /** 59 | * Initialize the lightbox 60 | */ 61 | new SimpleLightbox("a.lightbox, a[rel^='lightbox']", { 62 | sourceAttr: 'data-url', 63 | captionSelector: 'self', 64 | captionType: 'data', 65 | captionsData: 'caption', 66 | captionPosition: 'outside', 67 | captionHTML: true, // we allow HTML and double escape in the formatter 68 | alertError: false, 69 | fileExt: false, 70 | uniqueImages: false 71 | }); 72 | }); 73 | 74 | -------------------------------------------------------------------------------- /lang/pl/lang.php: -------------------------------------------------------------------------------- 1 | 7 | * @author Michał 8 | * @author Bartek S 9 | */ 10 | $lang['pages'] = 'Stron galerii:'; 11 | $lang['js']['addgal'] = 'Dodaj jako galerię'; 12 | $lang['js']['label_toolbar_button'] = 'Wstaw galerię'; 13 | $lang['js']['title_dialog'] = 'Wtyczka galerii'; 14 | $lang['js']['label_namespace'] = 'Przestrzeń nazw lub kanał RSS'; 15 | $lang['js']['label_thumbnailsize'] = 'Ustawia rozmiar miniatur'; 16 | $lang['js']['pattern_hint_thumbnailsize'] = ''; 17 | $lang['js']['label_imagesize'] = 'Ustawia rozmiar połączonych obrazów w trybie bezpośrednim.'; 18 | $lang['js']['pattern_hint_imagesize'] = ''; 19 | $lang['js']['label_cache'] = 'Buforuj miniatury'; 20 | $lang['js']['label_filter'] = 'Filtr (musi zawierać znak „*”)'; 21 | $lang['js']['label_showname'] = 'Pokaż nazwę pliku pod miniaturami'; 22 | $lang['js']['label_showtitle'] = 'Pokaż nagłówek tagu EXIF jako tytuł pod miniaturami'; 23 | $lang['js']['label_crop'] = 'Twórz miniatury dokładnie w podanym rozmiarze, przycinając je w razie potrzeby'; 24 | $lang['js']['label_direct'] = 'Połącz miniatury z obrazami o większym rozmiarze, a nie ze stroną ze szczegółami'; 25 | $lang['js']['label_lightbox'] = 'Wyświetlaj obrazy w fantazyjnym trybie JavaScript'; 26 | $lang['js']['label_reverse'] = 'Odwróć kolejność wyświetlanych obrazów'; 27 | $lang['js']['label_recursive'] = 'Znajdź obrazy w podanej przestrzeni nazw i wszystkich podprzestrzeniach nazw'; 28 | $lang['js']['label_align_left'] = 'wyrównaj do lewej'; 29 | $lang['js']['label_align_center'] = 'wyrównaj do środka'; 30 | $lang['js']['label_align_right'] = 'wyrównaj do prawej'; 31 | $lang['js']['label_cols'] = 'Liczba obrazów w wierszu w tabeli galerii'; 32 | $lang['js']['label_limit'] = 'Ogranicza dane wyjściowe do podanej liczby obrazów. 0 oznacza wszystko'; 33 | $lang['js']['label_offset'] = 'Pomiń pierwszą liczbę obrazów. Przydatne z opcją powyżej'; 34 | $lang['js']['label_paginate'] = 'Dodaj paginację dla miniatur wyświetlającą liczbę podanych miniatur na stronie. 0 wyłącza paginację'; 35 | $lang['js']['label_sort_file'] = 'Sortuj obrazy według nazwy pliku'; 36 | $lang['js']['label_sort_random'] = 'Sortuj obrazy losowo. Możesz także wyłączyć pamięć podręczną'; 37 | $lang['js']['label_sort_mod'] = 'Sortuj obrazy według daty modyfikacji pliku'; 38 | $lang['js']['label_sort_exif_date'] = 'Sortuj obrazy według daty EXIF'; 39 | $lang['js']['label_sort_exif_title'] = 'Sortuj obrazy według tytułu EXIF'; 40 | $lang['nothingfound'] = 'Brak zdjęć.'; 41 | $lang['fail'] = 'Nie udało się załadować galerii'; 42 | -------------------------------------------------------------------------------- /lang/ru/lang.php: -------------------------------------------------------------------------------- 1 | 7 | * @author android405 8 | * @author Aleksandr Selivanov 9 | */ 10 | $lang['pages'] = 'Страницы галереи:'; 11 | $lang['js']['addgal'] = 'Добавить пространство имён как галерею'; 12 | $lang['js']['label_toolbar_button'] = 'Вставить галерею'; 13 | $lang['js']['title_dialog'] = 'Плагин Gallery'; 14 | $lang['js']['label_namespace'] = 'Пространство имен или RSS-канал'; 15 | $lang['js']['label_thumbnailsize'] = 'Устанавливает размер миниатюр'; 16 | $lang['js']['label_imagesize'] = 'Устанавливает размер связанных изображений в прямом режиме.'; 17 | $lang['js']['label_cache'] = 'Кэшировать миниатюры'; 18 | $lang['js']['label_filter'] = 'Фильтр (должен содержать символ "*")'; 19 | $lang['js']['label_showname'] = 'Показывать имя файла под миниатюрами'; 20 | $lang['js']['label_showtitle'] = 'Показывать заголовок тега EXIF в качестве заголовка под миниатюрами'; 21 | $lang['js']['label_crop'] = 'Увеличивать миниатюры точно до заданного размера, обрезая их при необходимости'; 22 | $lang['js']['label_direct'] = 'Связывать миниатюры с изображениями большего размера, а не со страницей их подробной информации'; 23 | $lang['js']['label_lightbox'] = 'Показывать изображения в необычном режиме JavaScript'; 24 | $lang['js']['label_reverse'] = 'Изменить порядок отображения изображений в обратном порядке'; 25 | $lang['js']['label_recursive'] = 'Поиск изображений в заданном пространстве имен и всех подпространствах имен'; 26 | $lang['js']['label_align_left'] = 'выровнять по левому краю'; 27 | $lang['js']['label_align_center'] = 'выровнять по центру'; 28 | $lang['js']['label_align_right'] = 'выровнять по правому краю'; 29 | $lang['js']['label_cols'] = 'Количество изображений в строке таблицы галереи'; 30 | $lang['js']['label_limit'] = 'Ограничивает вывод заданным количеством изображений. 0 означает все'; 31 | $lang['js']['label_offset'] = 'Пропустить первое количество изображений. Полезно при использовании опции, указанной выше'; 32 | $lang['js']['label_paginate'] = 'Добавьте разбивку на страницы для миниатюр, отображающую количество заданных миниатюр на странице. 0 отключает разбивку на страницы'; 33 | $lang['js']['label_sort_file'] = 'Сортировка изображений по имени файла'; 34 | $lang['js']['label_sort_random'] = 'Сортируйте изображения случайным образом. Возможно, вы также захотите отключить кэширование'; 35 | $lang['js']['label_sort_mod'] = 'Сортировка изображений по дате изменения файла'; 36 | $lang['js']['label_sort_exif_date'] = 'Сортировка изображений по дате EXIF'; 37 | $lang['js']['label_sort_exif_title'] = 'Сортировка изображений по названию EXIF'; 38 | $lang['nothingfound'] = 'Изображения не найдены'; 39 | $lang['fail'] = 'Не удалось загрузить галерею'; 40 | -------------------------------------------------------------------------------- /lang/de/lang.php: -------------------------------------------------------------------------------- 1 | 7 | * @author Andreas Gohr 8 | * @author Christoph Ziehr 9 | */ 10 | $lang['pages'] = 'Galerie-Seiten:'; 11 | $lang['js']['addgal'] = 'Namensraum als Galerie hinzufügen'; 12 | $lang['js']['label_toolbar_button'] = 'Gallery einfügen'; 13 | $lang['js']['title_dialog'] = 'Gallery-Plugin'; 14 | $lang['js']['label_namespace'] = 'Namensraum oder RSS-Feed'; 15 | $lang['js']['label_thumbnailsize'] = 'Größe für Vorschaubild festlegen'; 16 | $lang['js']['pattern_hint_thumbnailsize'] = ''; 17 | $lang['js']['label_imagesize'] = 'Bildgröße für Direktmodus festlegen'; 18 | $lang['js']['pattern_hint_imagesize'] = ''; 19 | $lang['js']['label_cache'] = 'Vorschaubilder cachen'; 20 | $lang['js']['label_filter'] = 'Filter (muss das Zeichen "*" enthalten)'; 21 | $lang['js']['label_showname'] = 'Dateiname unter dem Vorschaubild anzeigen'; 22 | $lang['js']['label_showtitle'] = 'Zeige den EXIF Tag "Titel" als Titel unter dem Vorschaubild'; 23 | $lang['js']['label_crop'] = 'Passe die Vorschaubilder exakt an die vorgegebene Größe an und passe sie, wenn nötig, an.'; 24 | $lang['js']['label_direct'] = 'Verknüpfe die Vorschaubilder mit den größeren Bildern und nicht mit ihren Detail-Seiten.'; 25 | $lang['js']['label_lightbox'] = 'Zeige Bilder in einem modischen JavaScript-Modell'; 26 | $lang['js']['label_reverse'] = 'Zeige die Bilder in umgekehrter Reihenfolge an'; 27 | $lang['js']['label_recursive'] = 'Finde alle Bilder im ausgewählten Namensraum und allen Unternamensräumen'; 28 | $lang['js']['label_align_left'] = 'linksbündig ausrichten'; 29 | $lang['js']['label_align_center'] = 'zentriert ausrichten'; 30 | $lang['js']['label_align_right'] = 'rechtsbündig ausrichten'; 31 | $lang['js']['label_cols'] = 'Anzahl der Bilder in einer Zeile in der Gallery-Tabelle'; 32 | $lang['js']['label_limit'] = 'Beschränkt die Anzahl der ausgegebenen Bilder. 0 zeigt alle Bilder an.'; 33 | $lang['js']['label_offset'] = 'Überspringt die erste Nummer der Bilder. Nützlich im Zusammenhang mit der obigen Option.'; 34 | $lang['js']['label_paginate'] = 'Fügt die Anzahl der angezeigten Vorschaubilder pro Seite ein. 0 deaktiviert die Anzeige der Anzahl.'; 35 | $lang['js']['label_sort_file'] = 'Sortiert die Bilder nach ihrem Namen.'; 36 | $lang['js']['label_sort_random'] = 'Sortiert die Bilder zufällig. Eventuell sollten Sie dazu auch den Cache deaktivieren.'; 37 | $lang['js']['label_sort_mod'] = 'Sortiert die Bilder nach ihrem Änderungsdatum.'; 38 | $lang['js']['label_sort_exif_date'] = 'Sortiert die Bilder nach ihrem EXIF-Datum.'; 39 | $lang['js']['label_sort_exif_title'] = 'Sortiert die Bilder nach ihrem EXIF-Titel.'; 40 | $lang['nothingfound'] = 'Keine Bilder gefunden.'; 41 | $lang['fail'] = 'Gallery konnte nicht geladen werden'; 42 | -------------------------------------------------------------------------------- /lang/fr/lang.php: -------------------------------------------------------------------------------- 1 | 7 | * @author jrivron 8 | * @author Christian "Na_kai" Sueur 9 | * @author NicolasFriedli 10 | */ 11 | $lang['pages'] = 'Pages galerie:'; 12 | $lang['js']['addgal'] = 'Utiliser cette catégorie comme galerie'; 13 | $lang['js']['label_toolbar_button'] = 'Insérer une galerie'; 14 | $lang['js']['title_dialog'] = 'Greffon Gallery'; 15 | $lang['js']['label_namespace'] = 'catégorie ou flux RSS'; 16 | $lang['js']['label_thumbnailsize'] = 'Fixe la taille des miniatures'; 17 | $lang['js']['pattern_hint_thumbnailsize'] = ''; 18 | $lang['js']['label_imagesize'] = 'Fixe la taille des images liées en mode direct'; 19 | $lang['js']['pattern_hint_imagesize'] = ''; 20 | $lang['js']['label_cache'] = 'Mettre les miniatures en cache'; 21 | $lang['js']['label_filter'] = 'Filtrer (doit contenir un caractère "*")'; 22 | $lang['js']['label_showname'] = 'Afficher le nom du fichier sous les miniatures'; 23 | $lang['js']['label_showtitle'] = 'Afficher l\'étiquette EXIF Headline comme titre sous les miniatures'; 24 | $lang['js']['label_crop'] = 'Faire des miniatures de la taille exacte indiquée, recadre si besoin'; 25 | $lang['js']['label_direct'] = 'Lier les miniatures à l\'image de plus grande taille, pas à la page de détails'; 26 | $lang['js']['label_lightbox'] = 'Montrer les images dans une fenêtre modale javascript sophistiquée'; 27 | $lang['js']['label_reverse'] = 'Renverser l\'ordre des images affichées'; 28 | $lang['js']['label_recursive'] = 'Trouver les images de la catégorie indiquée et de toutes les sous catégories'; 29 | $lang['js']['label_align_left'] = 'aligner à gauche'; 30 | $lang['js']['label_align_center'] = 'aligner au centrer'; 31 | $lang['js']['label_align_right'] = 'aligner à droite'; 32 | $lang['js']['label_cols'] = 'Le nombre d\'images par ligne dans les tableaux de galerie'; 33 | $lang['js']['label_limit'] = 'Limite l\'affichage au nombre d\'images indiqué. 0 signifie toutes'; 34 | $lang['js']['label_offset'] = 'Saute les n première images. Utile avec l\'option ci-dessus'; 35 | $lang['js']['label_paginate'] = 'Ajouter une pagination pour l\'affichage des miniatures en n\'affichant que le nombre indiqué de miniatures par page. 0 désactive la pagination'; 36 | $lang['js']['label_sort_file'] = 'Trier les images par nom de fichier'; 37 | $lang['js']['label_sort_random'] = 'Trier les images au hasard. Vous voudrez peut-être également désactiver le cache'; 38 | $lang['js']['label_sort_mod'] = 'Trier les images par date de modification'; 39 | $lang['js']['label_sort_exif_date'] = 'Trier les images par date EXIF'; 40 | $lang['js']['label_sort_exif_title'] = 'trier les image par titre EXIF'; 41 | $lang['nothingfound'] = 'Aucune image trouvée.'; 42 | $lang['fail'] = 'Erreur du chargement de la galerie'; 43 | -------------------------------------------------------------------------------- /lang/es/lang.php: -------------------------------------------------------------------------------- 1 | 7 | * @author Yllelder 8 | * @author Joel Cantoral 9 | * @author Domingo Redal 10 | */ 11 | $lang['pages'] = 'Páginas de la galería:'; 12 | $lang['js']['addgal'] = 'Añadir espacio de nombres como galería'; 13 | $lang['js']['label_toolbar_button'] = 'Insertar galería'; 14 | $lang['js']['title_dialog'] = 'Complemento Gallery'; 15 | $lang['js']['label_namespace'] = 'Espacio de nombres o fuente RSS'; 16 | $lang['js']['label_thumbnailsize'] = 'Establece el tamaño de las miniaturas'; 17 | $lang['js']['pattern_hint_thumbnailsize'] = ''; 18 | $lang['js']['label_imagesize'] = 'Establece el tamaño de las imágenes enlazadas en modo directo.'; 19 | $lang['js']['pattern_hint_imagesize'] = ''; 20 | $lang['js']['label_cache'] = 'Almacenar en caché las miniaturas'; 21 | $lang['js']['label_filter'] = 'Filtro (debe contener un carácter "*")'; 22 | $lang['js']['label_showname'] = 'Mostrar el nombre del archivo debajo de las miniaturas'; 23 | $lang['js']['label_showtitle'] = 'Mostrar la etiqueta EXIF "Titular" como el título debajo de las miniaturas'; 24 | $lang['js']['label_crop'] = 'Hacer que las miniaturas tengan el tamaño exacto especificado, recortándolas cuando sea necesario'; 25 | $lang['js']['label_direct'] = 'Enlazar las miniaturas con las imágenes de mayor tamaño, no con su página de detalles'; 26 | $lang['js']['label_lightbox'] = 'Mostrar las imágenes en un modal elegante con JavaScript'; 27 | $lang['js']['label_reverse'] = 'Invertir el orden de las imágenes mostradas'; 28 | $lang['js']['label_recursive'] = 'Buscar imágenes en el espacio de nombres indicado y en todos sus subespacios de nombres'; 29 | $lang['js']['label_align_left'] = 'alinear a la izquierda'; 30 | $lang['js']['label_align_center'] = 'alinear al centro'; 31 | $lang['js']['label_align_right'] = 'alinear a la derecha'; 32 | $lang['js']['label_cols'] = 'Número de imágenes por fila en la tabla de galería'; 33 | $lang['js']['label_limit'] = 'Limita la salida al número de imágenes indicado. 0 significa todas'; 34 | $lang['js']['label_offset'] = 'Omitir las primeras imágenes. Útil con la opción anterior'; 35 | $lang['js']['label_paginate'] = 'Añade una paginación para las miniaturas, mostrando la cantidad indicada de miniaturas por página. 0 desactiva la paginación'; 36 | $lang['js']['label_sort_file'] = 'Ordenar las imágenes por nombre de archivo'; 37 | $lang['js']['label_sort_random'] = 'Ordenar imágenes aleatoriamente. También podrías desactivar la caché'; 38 | $lang['js']['label_sort_mod'] = 'Ordenar imágenes por fecha de modificación del archivo'; 39 | $lang['js']['label_sort_exif_date'] = 'Ordenar imágenes por fecha EXIF'; 40 | $lang['js']['label_sort_exif_title'] = 'Ordenar imágenes por título EXIF'; 41 | $lang['nothingfound'] = 'No se han encontrado imágenes.'; 42 | $lang['fail'] = 'Error al cargar la galería'; 43 | -------------------------------------------------------------------------------- /classes/FeedGallery.php: -------------------------------------------------------------------------------- 1 | initBaseUrl($url); 21 | $this->parseFeed($url); 22 | } 23 | 24 | /** 25 | * Parses the given feed and adds all images to the gallery 26 | * 27 | * @param string $url 28 | * @return void 29 | * @throws \Exception 30 | */ 31 | protected function parseFeed($url) 32 | { 33 | $feed = new FeedParser(); 34 | $feed->set_feed_url($url); 35 | 36 | $ok = $feed->init(); 37 | if (!$ok) throw new \Exception($feed->error()); 38 | 39 | foreach ($feed->get_items() as $item) { 40 | $enclosure = $item->get_enclosure(); 41 | if (!$enclosure instanceof Enclosure) continue; 42 | 43 | // skip non-image enclosures 44 | if ($enclosure->get_type() && substr($enclosure->get_type(), 0, 5) != 'image') { 45 | continue; 46 | } elseif (!$this->hasImageExtension($enclosure->get_link())) { 47 | continue; 48 | } 49 | 50 | $enclosureLink = $this->makeAbsoluteUrl($enclosure->get_link()); 51 | $detailLink = $this->makeAbsoluteUrl($item->get_link()); 52 | 53 | $image = new Image($enclosureLink); 54 | $image->setDetaillink($detailLink); 55 | $image->setTitle(htmlspecialchars_decode($enclosure->get_title() ?? '', ENT_COMPAT)); 56 | $image->setDescription(strip_tags(htmlspecialchars_decode( 57 | $enclosure->get_description() ?? '', 58 | ENT_COMPAT 59 | ))); 60 | $image->setCreated($item->get_date('U')); 61 | $image->setModified($item->get_date('U')); 62 | $image->setWidth($enclosure->get_width()); 63 | $image->setHeight($enclosure->get_height()); 64 | 65 | $this->images[] = $image; 66 | } 67 | } 68 | 69 | /** 70 | * Make the given URL absolute using feed's URL as base 71 | * 72 | * @param string $url 73 | * @return string 74 | */ 75 | protected function makeAbsoluteUrl($url) 76 | { 77 | 78 | if (!preg_match('/^https?:\/\//i', $url)) { 79 | if ($url[0] == '/') { 80 | $url = $this->feedHost . $url; 81 | } else { 82 | $url = $this->feedHost . $this->feedPath . $url; 83 | } 84 | } 85 | return $url; 86 | } 87 | 88 | /** 89 | * Initialize base url to use for broken feeds with non-absolute links 90 | * @param string $url The feed URL 91 | * @return void 92 | */ 93 | protected function initBaseUrl($url) 94 | { 95 | $main = parse_url($url); 96 | $this->feedHost = $main['scheme'] . '://' . $main['host'] . (empty($main['port']) ? '' : ':' . $main['port']); 97 | $this->feedPath = dirname($main['path']) . '/'; 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /syntax/main.php: -------------------------------------------------------------------------------- 1 | 17 | * @author Joe Lapp 18 | * @author Dave Doyle 19 | */ 20 | class syntax_plugin_gallery_main extends SyntaxPlugin 21 | { 22 | /** @inheritdoc */ 23 | public function getType() 24 | { 25 | return 'substition'; 26 | } 27 | 28 | /** @inheritdoc */ 29 | public function getPType() 30 | { 31 | return 'block'; 32 | } 33 | 34 | /** @inheritdoc */ 35 | public function getSort() 36 | { 37 | return 301; 38 | } 39 | 40 | /** @inheritdoc */ 41 | public function connectTo($mode) 42 | { 43 | $this->Lexer->addSpecialPattern('\{\{gallery>[^}]*\}\}', $mode, 'plugin_gallery_main'); 44 | } 45 | 46 | /** @inheritdoc */ 47 | public function handle($match, $state, $pos, Doku_Handler $handler) 48 | { 49 | global $ID; 50 | $match = substr($match, 10, -2); //strip markup from start and end 51 | 52 | $options = new Options(); 53 | 54 | // unique gallery ID 55 | $options->galleryID = substr(md5($match), 0, 4); 56 | 57 | // alignment 58 | if (substr($match, 0, 1) == ' ') $options->align += Options::ALIGN_RIGHT; 59 | if (substr($match, -1, 1) == ' ') $options->align += Options::ALIGN_LEFT; 60 | 61 | // extract src and params 62 | [$src, $params] = sexplode('?', $match, 2); 63 | $src = trim($src); 64 | 65 | // resolve relative namespace 66 | if (!preg_match('/^https?:\/\//i', $src)) { 67 | $mediaResolver = new MediaResolver($ID); 68 | $src = $mediaResolver->resolveId($src); 69 | } 70 | 71 | // parse parameters 72 | $options->parseParameters($params); 73 | 74 | return [ 75 | $src, $options 76 | ]; 77 | } 78 | 79 | /** @inheritdoc */ 80 | public function render($mode, Doku_Renderer $R, $data) 81 | { 82 | [$src, $options] = $data; 83 | 84 | try { 85 | if (is_array($src)) { 86 | $gallery = new ListGallery($src, $options); 87 | } elseif (preg_match('/^https?:\/\//i', $src)) { 88 | $gallery = new FeedGallery($src, $options); 89 | } else { 90 | $gallery = new NamespaceGallery($src, $options); 91 | } 92 | 93 | $R->info['cache'] = $options->cache; 94 | if ($mode == 'xhtml') { 95 | $formatter = new XHTMLFormatter($R, $options); 96 | } else { 97 | $formatter = new BasicFormatter($R, $options); 98 | } 99 | $formatter->render($gallery); 100 | } catch (Exception $e) { 101 | msg(hsc($e->getMessage()), -1); 102 | $R->cdata($this->getLang('fail')); 103 | } 104 | return true; 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /GalleryNode.php: -------------------------------------------------------------------------------- 1 | parent = &$parent; 26 | $this->data = $data; 27 | } 28 | 29 | /** 30 | * Get the node's representation as DokuWiki Syntax 31 | * 32 | * @return string 33 | */ 34 | public function toSyntax() 35 | { 36 | /** @var \action_plugin_gallery_prosemirror $action */ 37 | $action = plugin_load('action', 'gallery_prosemirror'); 38 | $defaults = $action->getDefaults(); 39 | $query = []; 40 | $attrs = $this->data['attrs']; 41 | if ($attrs['thumbnailsize'] !== $defaults['thumbnailsize']) { 42 | $query[] = $attrs['thumbnailsize']; 43 | } 44 | if ($attrs['imagesize'] !== $defaults['imagesize']) { 45 | $query[] = $attrs['imagesize']; 46 | } 47 | 48 | $query[] = $this->extractFlagParam('showname', $attrs, $defaults); 49 | $query[] = $this->extractFlagParam('showtitle', $attrs, $defaults); 50 | $query[] = $this->extractFlagParam('cache', $attrs, $defaults); 51 | $query[] = $this->extractFlagParam('crop', $attrs, $defaults); 52 | $query[] = $this->extractFlagParam('direct', $attrs, $defaults); 53 | $query[] = $this->extractFlagParam('lightbox', $attrs, $defaults); 54 | $query[] = $this->extractFlagParam('reverse', $attrs, $defaults); 55 | $query[] = $this->extractFlagParam('recursive', $attrs, $defaults); 56 | $query = array_filter($query); 57 | 58 | if ((int)$attrs['cols'] !== (int)$defaults['cols']) { 59 | $query[] = $attrs['cols']; 60 | } 61 | if ((int)$attrs['limit'] !== (int)$defaults['limit']) { 62 | $query[] = '=' . $attrs['limit']; 63 | } 64 | if ((int)$attrs['offset'] !== (int)$defaults['offset']) { 65 | $query[] = '+' . $attrs['offset']; 66 | } 67 | if ((int)$attrs['paginate'] !== (int)$defaults['paginate']) { 68 | $query[] = '~' . $attrs['paginate']; 69 | } 70 | if ((int)$attrs['sort'] !== (int)$defaults['sort']) { 71 | $query[] = $attrs['sort']; 72 | } 73 | if ($attrs['filter'] && strpos($attrs['filter'], '*') !== false) { 74 | $query[] = $attrs['filter']; 75 | } 76 | $alignLeft = $attrs['align'] === 'left' ? ' ' : ''; 77 | $alignRight = $attrs['align'] === 'right' ? ' ' : ''; 78 | $result = '{{gallery>' . $alignRight . $attrs['namespace']; 79 | if ($query !== []) { 80 | $result .= '?' . implode('&', $query); 81 | } 82 | $result .= $alignLeft . '}}'; 83 | return $result; 84 | } 85 | 86 | /** 87 | * Get syntax option-string if the option is different from the default 88 | * 89 | * @param string $paramName The name of the parameter 90 | * @param array $data The node's attributes from the editor 91 | * @param array $defaults The default options 92 | * 93 | * @return null|string Either the string to toggle the option away from the default or null 94 | */ 95 | protected function extractFlagParam($paramName, $data, $defaults) 96 | { 97 | if ((bool)$data[$paramName] !== (bool)$defaults[$paramName]) { 98 | return ($defaults[$paramName] ? 'no' : '') . $paramName; 99 | } 100 | return null; 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /classes/BasicFormatter.php: -------------------------------------------------------------------------------- 1 | options = $options; 28 | $this->renderer = $renderer; 29 | } 30 | 31 | /** 32 | * Render the whole Gallery 33 | * 34 | * @param AbstractGallery $gallery 35 | * @return void 36 | */ 37 | public function render(AbstractGallery $gallery) 38 | { 39 | $images = $gallery->getImages(); 40 | foreach ($images as $image) { 41 | $this->renderImage($image); 42 | } 43 | } 44 | 45 | /** 46 | * Render a single thumbnail image in the gallery 47 | * 48 | * @param Image $image 49 | * @return void 50 | */ 51 | protected function renderImage(Image $image) 52 | { 53 | [$w, $h] = $this->getThumbnailSize($image); 54 | $link = $image->getDetaillink() ?: $image->getSrc(); 55 | 56 | $imgdata = [ 57 | 'src' => $image->getSrc(), 58 | 'title' => $image->getTitle(), 59 | 'align' => '', 60 | 'width' => $w, 61 | 'height' => $h, 62 | 'cache' => '' 63 | ]; 64 | 65 | if ($image->isExternal()) { 66 | $this->renderer->externallink($link, $imgdata); 67 | } else { 68 | $this->renderer->internalmedia(":$link", $imgdata); // prefix with : to ensure absolute src 69 | } 70 | } 71 | 72 | 73 | // region Utilities 74 | 75 | /** 76 | * Calculate the thumbnail size 77 | * 78 | * @param Image $image 79 | * @param int|float $retina The retina scaling factor 80 | * @return array 81 | */ 82 | protected function getThumbnailSize(Image $image, $retina = 1) 83 | { 84 | $thumbW = $this->options->thumbnailWidth * $retina; 85 | $thumbH = $this->options->thumbnailHeight * $retina; 86 | 87 | // if image size is unknown, use the configured thumbnail size 88 | if (!$image->getWidth() || !$image->getHeight()) { 89 | return [$thumbW, $thumbH]; 90 | } 91 | 92 | // avoid upscaling 93 | if ( 94 | $image->getWidth() < $thumbW && 95 | $image->getHeight() < $thumbH 96 | ) { 97 | return [$image->getWidth(), $image->getHeight()]; 98 | } 99 | 100 | if (!$this->options->crop) { 101 | [$thumbWidth, $thumbHeight] = $this->fitBoundingBox( 102 | $image->getWidth(), 103 | $image->getHeight(), 104 | $thumbW, 105 | $thumbH 106 | ); 107 | } else { 108 | $thumbWidth = $thumbW; 109 | $thumbHeight = $thumbH; 110 | } 111 | return [$thumbWidth, $thumbHeight]; 112 | } 113 | 114 | 115 | /** 116 | * Calculate the size of a thumbnail to fit into a bounding box 117 | * 118 | * @param int $imgWidth 119 | * @param int $imgHeight 120 | * @param int $bBoxWidth 121 | * @param int $bBoxHeight 122 | * @return int[] 123 | */ 124 | protected function fitBoundingBox($imgWidth, $imgHeight, $bBoxWidth, $bBoxHeight) 125 | { 126 | $scale = min($bBoxWidth / $imgWidth, $bBoxHeight / $imgHeight); 127 | 128 | $width = round($imgWidth * $scale); 129 | $height = round($imgHeight * $scale); 130 | 131 | return [$width, $height]; 132 | } 133 | 134 | // endregion 135 | } 136 | -------------------------------------------------------------------------------- /classes/Options.php: -------------------------------------------------------------------------------- 1 | thumbnailWidth = $plugin->getConf('thumbnail_width'); 49 | $this->thumbnailHeight = $plugin->getConf('thumbnail_height'); 50 | $this->lightboxWidth = $plugin->getConf('image_width'); 51 | $this->lightboxHeight = $plugin->getConf('image_height'); 52 | $this->columns = $plugin->getConf('cols'); 53 | $this->sort = $plugin->getConf('sort'); 54 | $this->parseParameters($plugin->getConf('options')); 55 | } 56 | 57 | /** 58 | * Simple option strings parser 59 | * 60 | * @param string $params 61 | * @return void 62 | */ 63 | public function parseParameters($params) 64 | { 65 | $params = preg_replace('/[,&?]+/', ' ', $params); 66 | $params = explode(' ', $params); 67 | foreach ($params as $param) { 68 | if ($param === '') continue; 69 | if ($param == 'titlesort') { 70 | $this->sort = self::SORT_TITLE; 71 | } elseif ($param == 'datesort') { 72 | $this->sort = self::SORT_CTIME; 73 | } elseif ($param == 'modsort') { 74 | $this->sort = self::SORT_MTIME; 75 | } elseif ($param == 'random') { 76 | $this->sort = self::SORT_RANDOM; 77 | } elseif ($param == 'left') { 78 | $this->align = self::ALIGN_LEFT; 79 | } elseif ($param == 'right') { 80 | $this->align = self::ALIGN_RIGHT; 81 | } elseif ($param == 'center') { 82 | $this->align = self::ALIGN_CENTER; 83 | } elseif ($param == 'full') { 84 | $this->align = self::ALIGN_FULL; 85 | } elseif (preg_match('/^=(\d+)$/', $param, $match)) { 86 | $this->limit = (int)$match[1]; 87 | } elseif (preg_match('/^\+(\d+)$/', $param, $match)) { 88 | $this->offset = (int)$match[1]; 89 | } elseif (is_numeric($param)) { 90 | $this->columns = (int)$param; 91 | } elseif (preg_match('/^~(\d+)$/', $param, $match)) { 92 | $this->paginate = (int)$match[1]; 93 | } elseif (preg_match('/^(\d+)([xX])(\d+)$/', $param, $match)) { 94 | if ($match[2] == 'X') { 95 | $this->lightboxWidth = (int)$match[1]; 96 | $this->lightboxHeight = (int)$match[3]; 97 | } else { 98 | $this->thumbnailWidth = (int)$match[1]; 99 | $this->thumbnailHeight = (int)$match[3]; 100 | } 101 | } elseif (strpos($param, '*') !== false) { 102 | $param = preg_quote($param, '/'); 103 | $param = '/^' . str_replace('\\*', '.*?', $param) . '$/'; 104 | $this->filter = $param; 105 | } else { 106 | if (substr($param, 0, 2) == 'no') { 107 | $opt = substr($param, 2); 108 | $set = false; 109 | } else { 110 | $opt = $param; 111 | $set = true; 112 | } 113 | if (!property_exists($this, $opt) || !is_bool($this->$opt)) continue; 114 | $this->$opt = $set; 115 | } 116 | } 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /classes/Image.php: -------------------------------------------------------------------------------- 1 | src = $src; 31 | if (preg_match('/^https:\/\//i', $src)) { 32 | $this->isExternal = true; 33 | $path = parse_url($src, PHP_URL_PATH); 34 | $this->filename = basename($path); 35 | } else { 36 | $this->localfile = mediaFN($src); 37 | if (!file_exists($this->localfile)) throw new \Exception('File not found: ' . $this->localfile); 38 | $this->filename = basename($this->localfile); 39 | $this->modified = filemtime($this->localfile); 40 | 41 | $jpegMeta = new \JpegMeta($this->localfile); 42 | $this->title = $jpegMeta->getField('Simple.Title'); 43 | $this->description = $jpegMeta->getField('Iptc.Caption'); 44 | $this->created = $jpegMeta->getField('Date.EarliestTime'); 45 | $this->width = $jpegMeta->getField('File.Width'); 46 | $this->height = $jpegMeta->getField('File.Height'); 47 | } 48 | } 49 | 50 | public function isExternal() 51 | { 52 | return $this->isExternal; 53 | } 54 | 55 | public function getSrc() 56 | { 57 | return $this->src; 58 | } 59 | 60 | public function getFilename() 61 | { 62 | return $this->filename; 63 | } 64 | 65 | public function setFilename(string $filename) 66 | { 67 | $this->filename = $filename; 68 | } 69 | 70 | public function getLocalfile() 71 | { 72 | return $this->localfile; 73 | } 74 | 75 | public function setLocalfile(string $localfile) 76 | { 77 | $this->localfile = $localfile; 78 | } 79 | 80 | /** 81 | * @return string 82 | */ 83 | public function getTitle() 84 | { 85 | if (empty($this->title) || $this->title == $this->filename) { 86 | $title = str_replace('_', ' ', $this->filename); 87 | $title = preg_replace(self::IMG_REGEX, '', $title); 88 | $title = PhpString::ucwords($title); 89 | return $title; 90 | } 91 | return $this->title; 92 | } 93 | 94 | /** 95 | * @param string $title 96 | */ 97 | public function setTitle($title) 98 | { 99 | $this->title = $title; 100 | } 101 | 102 | /** 103 | * @return string 104 | */ 105 | public function getDescription() 106 | { 107 | return trim(str_replace("\n", ' ', $this->description)); 108 | } 109 | 110 | /** 111 | * @param string $description 112 | */ 113 | public function setDescription($description) 114 | { 115 | $this->description = $description; 116 | } 117 | 118 | /** 119 | * @return int 120 | */ 121 | public function getWidth() 122 | { 123 | return $this->width; 124 | } 125 | 126 | /** 127 | * @param int $width 128 | */ 129 | public function setWidth($width) 130 | { 131 | $this->width = $width; 132 | } 133 | 134 | /** 135 | * @return int 136 | */ 137 | public function getHeight() 138 | { 139 | return $this->height; 140 | } 141 | 142 | /** 143 | * @param int $height 144 | */ 145 | public function setHeight($height) 146 | { 147 | $this->height = $height; 148 | } 149 | 150 | /** 151 | * @return int 152 | */ 153 | public function getCreated() 154 | { 155 | return $this->created; 156 | } 157 | 158 | /** 159 | * @param int $created 160 | */ 161 | public function setCreated($created) 162 | { 163 | $this->created = $created; 164 | } 165 | 166 | /** 167 | * @return int 168 | */ 169 | public function getModified() 170 | { 171 | return $this->modified; 172 | } 173 | 174 | /** 175 | * @param int $modified 176 | */ 177 | public function setModified($modified) 178 | { 179 | $this->modified = $modified; 180 | } 181 | 182 | public function getDetaillink() 183 | { 184 | return $this->detaillink; 185 | } 186 | 187 | public function setDetaillink($detaillink) 188 | { 189 | $this->detaillink = $detaillink; 190 | } 191 | } 192 | -------------------------------------------------------------------------------- /simple-lightbox/simple-lightbox.less: -------------------------------------------------------------------------------- 1 | /*! 2 | By André Rinas, www.andrerinas.de 3 | Documentation, www.simplelightbox.com 4 | Available for use under the MIT License 5 | Version 2.14.2 6 | */ 7 | body.hidden-scroll { 8 | overflow: hidden; 9 | } 10 | 11 | .sl-overlay { 12 | position: fixed; 13 | left: 0; 14 | right: 0; 15 | top: 0; 16 | bottom: 0; 17 | background: #fff; 18 | display: none; 19 | z-index: 1035; 20 | } 21 | 22 | .sl-wrapper { 23 | z-index: 1040; 24 | width: 100%; 25 | height: 100%; 26 | left: 0; 27 | top: 0; 28 | position: fixed; 29 | } 30 | .sl-wrapper * { 31 | box-sizing: border-box; 32 | } 33 | .sl-wrapper button { 34 | border: 0 none; 35 | background: transparent; 36 | font-size: 28px; 37 | padding: 0; 38 | cursor: pointer; 39 | } 40 | .sl-wrapper button:hover { 41 | opacity: 0.7; 42 | } 43 | .sl-wrapper .sl-close { 44 | display: none; 45 | position: fixed; 46 | right: 30px; 47 | top: 30px; 48 | z-index: 10060; 49 | margin-top: -14px; 50 | margin-right: -14px; 51 | height: 44px; 52 | width: 44px; 53 | line-height: 44px; 54 | font-family: Arial, Baskerville, monospace; 55 | color: #000; 56 | font-size: 3rem; 57 | } 58 | .sl-wrapper .sl-counter { 59 | display: none; 60 | position: fixed; 61 | top: 30px; 62 | left: 30px; 63 | z-index: 10060; 64 | color: #000; 65 | font-size: 1rem; 66 | } 67 | .sl-wrapper .sl-download { 68 | display: none; 69 | position: fixed; 70 | bottom: 5px; 71 | width: 100%; 72 | text-align: center; 73 | z-index: 10060; 74 | color: #fff; 75 | font-size: 1rem; 76 | } 77 | .sl-wrapper .sl-download a { 78 | color: #fff; 79 | } 80 | .sl-wrapper .sl-navigation { 81 | width: 100%; 82 | display: none; 83 | } 84 | .sl-wrapper .sl-navigation button { 85 | position: fixed; 86 | top: 50%; 87 | margin-top: -22px; 88 | height: 44px; 89 | width: 22px; 90 | line-height: 44px; 91 | text-align: center; 92 | display: block; 93 | z-index: 10060; 94 | font-family: Arial, Baskerville, monospace; 95 | color: #000; 96 | } 97 | .sl-wrapper .sl-navigation button.sl-next { 98 | right: 5px; 99 | font-size: 2rem; 100 | } 101 | .sl-wrapper .sl-navigation button.sl-prev { 102 | left: 5px; 103 | font-size: 2rem; 104 | } 105 | @media (min-width: 35.5em) { 106 | .sl-wrapper .sl-navigation button { 107 | width: 44px; 108 | } 109 | .sl-wrapper .sl-navigation button.sl-next { 110 | right: 10px; 111 | font-size: 3rem; 112 | } 113 | .sl-wrapper .sl-navigation button.sl-prev { 114 | left: 10px; 115 | font-size: 3rem; 116 | } 117 | } 118 | @media (min-width: 50em) { 119 | .sl-wrapper .sl-navigation button { 120 | width: 44px; 121 | } 122 | .sl-wrapper .sl-navigation button.sl-next { 123 | right: 20px; 124 | font-size: 3rem; 125 | } 126 | .sl-wrapper .sl-navigation button.sl-prev { 127 | left: 20px; 128 | font-size: 3rem; 129 | } 130 | } 131 | .sl-wrapper.sl-dir-rtl .sl-navigation { 132 | direction: ltr; 133 | } 134 | .sl-wrapper .sl-image { 135 | position: fixed; 136 | -ms-touch-action: none; 137 | touch-action: none; 138 | z-index: 10000; 139 | } 140 | .sl-wrapper .sl-image img { 141 | margin: 0; 142 | padding: 0; 143 | display: block; 144 | border: 0 none; 145 | width: 100%; 146 | height: auto; 147 | } 148 | @media (min-width: 35.5em) { 149 | .sl-wrapper .sl-image img { 150 | border: 0 none; 151 | } 152 | } 153 | @media (min-width: 50em) { 154 | .sl-wrapper .sl-image img { 155 | border: 0 none; 156 | } 157 | } 158 | .sl-wrapper .sl-image iframe { 159 | background: #000; 160 | border: 0 none; 161 | } 162 | @media (min-width: 35.5em) { 163 | .sl-wrapper .sl-image iframe { 164 | border: 0 none; 165 | } 166 | } 167 | @media (min-width: 50em) { 168 | .sl-wrapper .sl-image iframe { 169 | border: 0 none; 170 | } 171 | } 172 | .sl-wrapper .sl-image .sl-caption { 173 | display: none; 174 | padding: 10px; 175 | color: #fff; 176 | background: rgba(0, 0, 0, 0.8); 177 | font-size: 1rem; 178 | position: absolute; 179 | bottom: 0; 180 | left: 0; 181 | right: 0; 182 | } 183 | .sl-wrapper .sl-image .sl-caption.pos-top { 184 | bottom: auto; 185 | top: 0; 186 | } 187 | .sl-wrapper .sl-image .sl-caption.pos-outside { 188 | bottom: auto; 189 | } 190 | 191 | .sl-spinner { 192 | display: none; 193 | border: 5px solid #333; 194 | border-radius: 40px; 195 | height: 40px; 196 | left: 50%; 197 | margin: -20px 0 0 -20px; 198 | opacity: 0; 199 | position: fixed; 200 | top: 50%; 201 | width: 40px; 202 | z-index: 1007; 203 | -webkit-animation: pulsate 1s ease-out infinite; 204 | -moz-animation: pulsate 1s ease-out infinite; 205 | -ms-animation: pulsate 1s ease-out infinite; 206 | -o-animation: pulsate 1s ease-out infinite; 207 | animation: pulsate 1s ease-out infinite; 208 | } 209 | 210 | .sl-scrollbar-measure { 211 | position: absolute; 212 | top: -9999px; 213 | width: 50px; 214 | height: 50px; 215 | overflow: scroll; 216 | } 217 | 218 | .sl-transition { 219 | transition: -moz-transform ease 200ms; 220 | transition: -ms-transform ease 200ms; 221 | transition: -o-transform ease 200ms; 222 | transition: -webkit-transform ease 200ms; 223 | transition: transform ease 200ms; 224 | } 225 | 226 | @-webkit-keyframes pulsate { 227 | 0% { 228 | transform: scale(0.1); 229 | opacity: 0; 230 | } 231 | 50% { 232 | opacity: 1; 233 | } 234 | 100% { 235 | transform: scale(1.2); 236 | opacity: 0; 237 | } 238 | } 239 | @keyframes pulsate { 240 | 0% { 241 | transform: scale(0.1); 242 | opacity: 0; 243 | } 244 | 50% { 245 | opacity: 1; 246 | } 247 | 100% { 248 | transform: scale(1.2); 249 | opacity: 0; 250 | } 251 | } 252 | @-moz-keyframes pulsate { 253 | 0% { 254 | transform: scale(0.1); 255 | opacity: 0; 256 | } 257 | 50% { 258 | opacity: 1; 259 | } 260 | 100% { 261 | transform: scale(1.2); 262 | opacity: 0; 263 | } 264 | } 265 | @-o-keyframes pulsate { 266 | 0% { 267 | transform: scale(0.1); 268 | opacity: 0; 269 | } 270 | 50% { 271 | opacity: 1; 272 | } 273 | 100% { 274 | transform: scale(1.2); 275 | opacity: 0; 276 | } 277 | } 278 | @-ms-keyframes pulsate { 279 | 0% { 280 | transform: scale(0.1); 281 | opacity: 0; 282 | } 283 | 50% { 284 | opacity: 1; 285 | } 286 | 100% { 287 | transform: scale(1.2); 288 | opacity: 0; 289 | } 290 | } -------------------------------------------------------------------------------- /action/prosemirror.php: -------------------------------------------------------------------------------- 1 | register_hook('DOKUWIKI_STARTED', 'BEFORE', $this, 'writeDefaultsToJSINFO'); 26 | $controller->register_hook('PROSEMIRROR_RENDER_PLUGIN', 'BEFORE', $this, 'renderFromInstructions'); 27 | $controller->register_hook('PROSEMIRROR_PARSE_UNKNOWN', 'BEFORE', $this, 'parseToSyntax'); 28 | $controller->register_hook('AJAX_CALL_UNKNOWN', 'BEFORE', $this, 'renderAttributesToHTML'); 29 | } 30 | 31 | /** 32 | * Render our syntax instructions for prosemirror 33 | * 34 | * Triggered by event: DOKUWIKI_STARTED 35 | * 36 | * @param Event $event event object 37 | * @param mixed $param [the parameters passed as fifth argument to register_hook() when this 38 | * handler was registered] 39 | * 40 | * @return void 41 | */ 42 | public function writeDefaultsToJSINFO(Event $event, $param) 43 | { 44 | global $JSINFO; 45 | 46 | $defaults = $this->getDefaults(); 47 | 48 | if (!isset($JSINFO['plugins'])) { 49 | $JSINFO['plugins'] = []; 50 | } 51 | $JSINFO['plugins']['gallery'] = [ 52 | 'defaults' => array_map(function ($default) { 53 | return ['default' => $default,]; 54 | }, $defaults), 55 | ]; 56 | $JSINFO['plugins']['gallery']['defaults']['namespace'] = ['default' => '']; 57 | } 58 | 59 | 60 | /** 61 | * Render our syntax instructions for prosemirror 62 | * 63 | * Triggered by event: PROSEMIRROR_RENDER_PLUGIN 64 | * 65 | * @param Event $event event object 66 | * @param mixed $param [the parameters passed as fifth argument to register_hook() when this 67 | * handler was registered] 68 | * 69 | * @return void 70 | */ 71 | public function renderFromInstructions(Event $event, $param) 72 | { 73 | if ($event->data['name'] !== 'gallery_main') { 74 | return; 75 | } 76 | $event->preventDefault(); 77 | $event->stopPropagation(); 78 | 79 | $node = new Node('dwplugin_gallery'); 80 | $data = $event->data['data']; 81 | // FIXME source can be something other than namespace 82 | [$ns, $options] = $data; 83 | 84 | if (cleanID($ns) === $ns) { 85 | $ns = ':' . $ns; 86 | } 87 | $node->attr('namespace', $ns); 88 | 89 | $attrs = $this->optionsToAttrs($options); 90 | foreach ($attrs as $name => $value) { 91 | $node->attr($name, $value); 92 | } 93 | $event->data['renderer']->nodestack->add($node); 94 | } 95 | 96 | /** 97 | * Render our syntax instructions for prosemirror 98 | * 99 | * Triggered by event: PROSEMIRROR_PARSE_UNKNOWN 100 | * 101 | * @param Event $event event object 102 | * @param mixed $param [the parameters passed as fifth argument to register_hook() when this 103 | * handler was registered] 104 | * 105 | * @return void 106 | */ 107 | public function parseToSyntax(Event $event, $param) 108 | { 109 | if ($event->data['node']['type'] !== 'dwplugin_gallery') { 110 | return; 111 | } 112 | $event->preventDefault(); 113 | $event->stopPropagation(); 114 | 115 | $event->data['newNode'] = new GalleryNode($event->data['node'], $event->data['parent']); 116 | } 117 | 118 | /** 119 | * Render the nodes attributes to html so it can be displayed in the editor 120 | * 121 | * Triggered by event: AJAX_CALL_UNKNOQN 122 | * 123 | * @param Event $event event object 124 | * @param mixed $param [the parameters passed as fifth argument to register_hook() when this 125 | * handler was registered] 126 | * 127 | * @return void 128 | */ 129 | public function renderAttributesToHTML(Event $event, $param) 130 | { 131 | if ($event->data !== 'plugin_gallery_prosemirror') { 132 | return; 133 | } 134 | $event->preventDefault(); 135 | $event->stopPropagation(); 136 | 137 | global $INPUT; 138 | $node = new GalleryNode(['attrs' => json_decode($INPUT->str('attrs'), true)], new RootNode([])); 139 | $syntax = $node->toSyntax(); 140 | $html = p_render('xhtml', p_get_instructions($syntax), $info); 141 | echo $html; 142 | } 143 | 144 | /** 145 | * Get default node attributes from gallery Options object 146 | */ 147 | public function getDefaults(): array 148 | { 149 | $options = new Options(); 150 | 151 | return [ 152 | 'thumbnailsize' => $options->thumbnailWidth . 'x' . $options->thumbnailHeight, 153 | 'imagesize' => $options->lightboxWidth . 'X' . $options->lightboxHeight, 154 | 'cache' => $options->cache, 155 | 'filter' => $options->filter, 156 | 'showname' => $options->showname, 157 | 'showtitle' => $options->showtitle, 158 | 'crop' => $options->crop, 159 | 'direct' => $options->direct, 160 | 'reverse' => $options->reverse, 161 | 'recursive' => $options->recursive, 162 | 'align' => $options->align, 163 | 'cols' => $options->columns, 164 | 'limit' => $options->limit, 165 | 'offset' => $options->offset, 166 | 'paginate' => $options->paginate, 167 | 'sort' => $options->sort, 168 | ]; 169 | } 170 | 171 | /** 172 | * Convert gallery options to node attributes 173 | * 174 | * @param Options $options 175 | * @return array 176 | */ 177 | protected function optionsToAttrs($options) 178 | { 179 | $attrs = (array)$options; 180 | 181 | $attrs['thumbnailsize'] = $options->thumbnailWidth . 'x' . $options->thumbnailHeight; 182 | $attrs['imagesize'] = $options->lightboxWidth . 'X' . $options->lightboxHeight; 183 | $attrs['cols'] = $options->columns; 184 | 185 | unset($attrs['thumbnailWidth']); 186 | unset($attrs['thumbnailHeight']); 187 | unset($attrs['lightboxWidth']); 188 | unset($attrs['lightboxHeight']); 189 | unset($attrs['columns']); 190 | 191 | return $attrs; 192 | } 193 | } 194 | -------------------------------------------------------------------------------- /classes/XHTMLFormatter.php: -------------------------------------------------------------------------------- 1 | 'plugin__gallery_' . $this->options->galleryID, 14 | 'class' => 'plugin-gallery', 15 | ]; 16 | 17 | switch ($this->options->align) { 18 | case Options::ALIGN_FULL: 19 | $attr['class'] .= ' align-full'; 20 | break; 21 | case Options::ALIGN_LEFT: 22 | $attr['class'] .= ' align-left'; 23 | break; 24 | case Options::ALIGN_RIGHT: 25 | $attr['class'] .= ' align-right'; 26 | break; 27 | case Options::ALIGN_CENTER: 28 | $attr['class'] .= ' align-center'; 29 | break; 30 | } 31 | 32 | $this->renderer->doc .= '
'; 33 | $images = $gallery->getImages(); 34 | $pages = $this->paginate($images); 35 | foreach ($pages as $page => $images) { 36 | $this->renderPage($images, $page); 37 | } 38 | $this->renderPageSelector($pages); 39 | $this->renderer->doc .= '
'; 40 | } 41 | 42 | /** 43 | * Render the page selector 44 | * 45 | * @param $pages 46 | * @return void 47 | */ 48 | protected function renderPageSelector($pages) 49 | { 50 | if (count($pages) <= 1) return; 51 | 52 | $plugin = plugin_load('syntax', 'gallery_main'); 53 | 54 | $this->renderer->doc .= ''; 65 | } 66 | 67 | /** 68 | * Render the given images into a gallery page 69 | * 70 | * @param Image[] $images 71 | * @param int $page The page number 72 | * @return void 73 | */ 74 | protected function renderPage($images, int $page) 75 | { 76 | $attr = [ 77 | 'class' => 'gallery-page', 78 | 'id' => 'gallery__' . $this->options->galleryID . '_' . $page, 79 | ]; 80 | 81 | // define the grid 82 | $colwidth = $this->options->thumbnailWidth . 'px'; 83 | if ($this->options->columns) { 84 | $cols = $this->options->columns; 85 | if ($this->options->align === Options::ALIGN_FULL) { 86 | $colwidth = '1fr'; 87 | } else { 88 | // calculate the max width for each column 89 | $maxwidth = '(100% / ' . $this->options->columns . ') - 1em'; 90 | $colwidth = 'min(' . $colwidth . ', ' . $maxwidth . ')'; 91 | } 92 | } else { 93 | $cols = 'auto-fill'; 94 | $colwidth = 'minmax(' . $colwidth . ', 1fr)'; 95 | } 96 | $attr['style'] = 'grid-template-columns: repeat(' . $cols . ', ' . $colwidth . ')'; 97 | 98 | $this->renderer->doc .= '
'; 99 | foreach ($images as $image) { 100 | $this->renderImage($image); 101 | } 102 | $this->renderer->doc .= '
'; 103 | } 104 | 105 | /** @inheritdoc */ 106 | protected function renderImage(Image $image) 107 | { 108 | global $ID; 109 | 110 | // thumbnail image properties 111 | [$w, $h] = $this->getThumbnailSize($image, 2); 112 | 113 | $img = []; 114 | $img['width'] = $w; 115 | $img['height'] = $h; 116 | $img['src'] = ml($image->getSrc(), ['w' => $w, 'h' => $h], true, '&'); 117 | $img['alt'] = $image->getFilename(); 118 | $img['loading'] = 'lazy'; 119 | 120 | // link properties 121 | $a = []; 122 | $a['href'] = $this->getDetailLink($image); 123 | $a['title'] = $image->getTitle(); 124 | 125 | if ($this->options->lightbox) { 126 | // double escape for lightbox: 127 | $a['data-caption'] = implode(' – ', array_filter([ 128 | '' . hsc($image->getTitle()) . '', 129 | hsc($image->getDescription()) 130 | ])); 131 | $a['class'] = "lightbox JSnocheck"; 132 | $a['rel'] = 'lightbox[gal-' . substr(md5($ID), 4) . ']'; //unique ID all images on the same page 133 | $a['data-url'] = $this->getLightboxLink($image); 134 | } 135 | 136 | // figure properties 137 | $fig = []; 138 | $fig['class'] = 'gallery-image'; 139 | if ($this->options->align !== Options::ALIGN_FULL) { 140 | $fig['style'] = 'max-width: ' . $this->options->thumbnailWidth . 'px; '; 141 | } 142 | 143 | $html = '
'; 144 | $html .= ''; 145 | $html .= ''; 146 | $html .= ''; 147 | 148 | if ($this->options->showtitle || $this->options->showname) { 149 | $html .= '
'; 150 | if ($this->options->showtitle) { 151 | $a = [ 152 | 'href' => $this->getDetailLink($image), 153 | 'class' => 'gallery-title', 154 | 'title' => $image->getTitle(), 155 | ]; 156 | $html .= '' . hsc($image->getTitle()) . ''; 157 | } 158 | if ($this->options->showcaption) { 159 | $p = [ 160 | 'class' => 'gallery-caption', 161 | ]; 162 | $html .= '
' . hsc($image->getDescription()) . '
'; 163 | } 164 | if ($this->options->showname) { 165 | $a = [ 166 | 'href' => $this->getDetailLink($image), 167 | 'class' => 'gallery-filename', 168 | 'title' => $image->getFilename(), 169 | ]; 170 | $html .= '' . hsc($image->getFilename()) . ''; 171 | } 172 | $html .= '
'; 173 | } 174 | 175 | $html .= '
'; 176 | $this->renderer->doc .= $html; 177 | } 178 | 179 | // endregion 180 | 181 | // region Utilities 182 | 183 | /** 184 | * Access the detail link for this image 185 | * 186 | * @param Image $image 187 | * @return string 188 | */ 189 | protected function getDetailLink(Image $image) 190 | { 191 | global $ID; 192 | 193 | if ($image->getDetaillink()) { 194 | // external image 195 | return $image->getDetaillink(); 196 | } else { 197 | return ml($image->getSrc(), ['id' => $ID], $this->options->direct, '&'); 198 | } 199 | } 200 | 201 | /** 202 | * Get the direct link to the image but limit it to a certain size 203 | * 204 | * @param Image $image 205 | * @return string 206 | */ 207 | protected function getLightboxLink(Image $image) 208 | { 209 | // use original image if no size is available 210 | if (!$image->getWidth() || !$image->getHeight()) { 211 | return ml($image->getSrc(), '', true, '&'); 212 | } 213 | 214 | // fit into bounding box 215 | [$width, $height] = $this->fitBoundingBox( 216 | $image->getWidth(), 217 | $image->getHeight(), 218 | $this->options->lightboxWidth, 219 | $this->options->lightboxHeight 220 | ); 221 | 222 | // no upscaling 223 | if ($width > $image->getWidth() || $height > $image->getHeight()) { 224 | return ml($image->getSrc(), '', true, '&'); 225 | } 226 | 227 | return ml($image->getSrc(), ['w' => $width, 'h' => $height], true, '&'); 228 | } 229 | 230 | /** 231 | * Create an array of pages for the given images 232 | * 233 | * @param Image[] $images 234 | * @return Image[][] 235 | */ 236 | protected function paginate($images) 237 | { 238 | if ($this->options->paginate) { 239 | $pages = array_chunk($images, $this->options->paginate); 240 | } else { 241 | $pages = [$images]; 242 | } 243 | 244 | return $pages; 245 | } 246 | 247 | // endregion 248 | } 249 | -------------------------------------------------------------------------------- /script/prosemirror.js: -------------------------------------------------------------------------------- 1 | jQuery(document).on('PROSEMIRROR_API_INITIALIZED', function () { 2 | 3 | /** 4 | * Add our node to the document schema of the Prosemirror plugin 5 | * 6 | * @param {OrderedMap} nodes the nodes already in the schema 7 | * @param {OrderedMap} marks the marks already in the schema 8 | * 9 | * @returns {{nodes: OrderedMap, marks: OrderedMap}} the updated nodes and marks 10 | */ 11 | function addGallerySchema(nodes, marks) { 12 | nodes = nodes.addToEnd('dwplugin_gallery', { 13 | content: '', // there is no content here -- it is all attributes 14 | marks: '', 15 | attrs: jQuery.extend( 16 | { 17 | renderedHTML: {default: null}, 18 | }, 19 | JSINFO.plugins.gallery.defaults 20 | ), 21 | group: 'protected_block', // may go into a block quote or list, but not into a table 22 | }); 23 | 24 | return {nodes: nodes, marks: marks}; 25 | } 26 | 27 | window.Prosemirror.pluginSchemas.push(addGallerySchema); 28 | 29 | /** 30 | * Get the fields for the key value form with values 31 | * 32 | * @param {object} attrs the values to use 33 | * @return {Object[]} array with parameters 34 | */ 35 | function getGalleryFormFields(attrs) { 36 | return [ 37 | { 38 | name: 'namespace', 39 | label: LANG.plugins.gallery.label_namespace, 40 | type: 'text', 41 | value: attrs['namespace'], 42 | }, 43 | { 44 | name: 'thumbnailsize', 45 | label: LANG.plugins.gallery.label_thumbnailsize, 46 | type: 'text', 47 | pattern: '\\d+x\\d+', 48 | title: LANG.plugins.gallery.pattern_hint_thumbnailsize, 49 | value: attrs['thumbnailsize'], 50 | }, 51 | { 52 | name: 'imagesize', 53 | label: LANG.plugins.gallery.label_imagesize, 54 | type: 'text', 55 | pattern: '\\d+X\\d+', 56 | title: LANG.plugins.gallery.pattern_hint_imagesize, 57 | value: attrs['imagesize'], 58 | }, 59 | { 60 | name: 'cache', 61 | label: LANG.plugins.gallery.label_cache, 62 | type: 'checkbox', 63 | value: '1', 64 | checked: attrs['cache'], 65 | }, 66 | { 67 | name: 'filter', 68 | label: LANG.plugins.gallery.label_filter, 69 | type: 'text', 70 | value: attrs['filter'], 71 | }, 72 | { 73 | name: 'showname', 74 | label: LANG.plugins.gallery.label_showname, 75 | type: 'checkbox', 76 | value: '1', 77 | checked: attrs['showname'], 78 | }, 79 | { 80 | name: 'showtitle', 81 | label: LANG.plugins.gallery.label_showtitle, 82 | type: 'checkbox', 83 | value: '1', 84 | checked: attrs['showtitle'], 85 | }, 86 | { 87 | name: 'crop', 88 | label: LANG.plugins.gallery.label_crop, 89 | type: 'checkbox', 90 | value: '1', 91 | checked: attrs['crop'], 92 | }, 93 | { 94 | name: 'direct', 95 | label: LANG.plugins.gallery.label_direct, 96 | type: 'checkbox', 97 | value: '1', 98 | checked: attrs['direct'], 99 | }, 100 | { 101 | name: 'lightbox', 102 | label: LANG.plugins.gallery.label_lightbox, 103 | type: 'checkbox', 104 | value: '1', 105 | checked: attrs['lightbox'], 106 | }, 107 | { 108 | name: 'reverse', 109 | label: LANG.plugins.gallery.label_reverse, 110 | type: 'checkbox', 111 | value: '1', 112 | checked: attrs['reverse'], 113 | }, 114 | { 115 | name: 'recursive', 116 | label: LANG.plugins.gallery.label_recursive, 117 | type: 'checkbox', 118 | value: '1', 119 | checked: attrs['recursive'], 120 | }, 121 | { 122 | name: 'align', 123 | label: LANG.plugins.gallery.label_align_left, 124 | type: 'radio', 125 | value: 'left', 126 | checked: attrs['align'] === 'left', 127 | }, 128 | { 129 | name: 'align', 130 | label: LANG.plugins.gallery.label_align_center, 131 | type: 'radio', 132 | value: 'center', 133 | checked: attrs['align'] === 'center', 134 | }, 135 | { 136 | name: 'align', 137 | label: LANG.plugins.gallery.label_align_right, 138 | type: 'radio', 139 | value: 'right', 140 | checked: attrs['align'] === 'right', 141 | }, 142 | { 143 | name: 'cols', 144 | label: LANG.plugins.gallery.label_cols, 145 | type: 'number', 146 | value: attrs['cols'], 147 | min: 0, 148 | }, 149 | { 150 | name: 'limit', 151 | label: LANG.plugins.gallery.label_limit, 152 | type: 'number', 153 | value: attrs['limit'], 154 | min: 0, 155 | }, 156 | { 157 | name: 'offset', 158 | label: LANG.plugins.gallery.label_offset, 159 | type: 'number', 160 | value: attrs['offset'], 161 | min: 0, 162 | }, 163 | { 164 | name: 'paginate', 165 | label: LANG.plugins.gallery.label_paginate, 166 | type: 'number', 167 | value: attrs['paginate'], 168 | min: 0, 169 | }, 170 | { 171 | name: 'sort', 172 | label: LANG.plugins.gallery.label_sort_file, 173 | type: 'radio', 174 | value: 'filesort', 175 | checked: attrs['sort'] === 'filesort', 176 | }, 177 | { 178 | name: 'sort', 179 | label: LANG.plugins.gallery.label_sort_random, 180 | type: 'radio', 181 | value: 'random', 182 | checked: attrs['sort'] === 'random', 183 | }, 184 | { 185 | name: 'sort', 186 | label: LANG.plugins.gallery.label_sort_mod, 187 | type: 'radio', 188 | value: 'modsort', 189 | checked: attrs['sort'] === 'modsort', 190 | }, 191 | { 192 | name: 'sort', 193 | label: LANG.plugins.gallery.label_sort_exif_date, 194 | type: 'radio', 195 | value: 'datesort', 196 | checked: attrs['sort'] === 'datesort', 197 | }, 198 | { 199 | name: 'sort', 200 | label: LANG.plugins.gallery.label_sort_exif_title, 201 | type: 'radio', 202 | value: 'titlesort', 203 | checked: attrs['sort'] === 'titlesort', 204 | }, 205 | ]; 206 | } 207 | 208 | 209 | /** 210 | * Handle our submitted form 211 | * 212 | * @param {Event} event the submit event 213 | * 214 | * @return {void} 215 | */ 216 | function handleFormSubmit(event) { 217 | event.preventDefault(); 218 | event.stopPropagation(); 219 | var newAttrs = jQuery(event.target).serializeArray().reduce(function (acc, cur) { 220 | acc[cur['name']] = cur['value']; 221 | return acc; 222 | }, {}); 223 | var nodeStartPos = this.getPos(); 224 | 225 | // we must have the unchecked checkboxes with default = true 226 | // explicitly listed as false, they cannot just be missing 227 | // similar might be (multi-)selects that have options selected by default 228 | newAttrs = Object.entries(this.node.type.attrs).reduce( 229 | function (acc, cur) { 230 | if (acc[cur[0]]) { 231 | return acc; 232 | } 233 | if (cur[1].default && cur[1].default === true) { 234 | acc[cur[0]] = false; 235 | } 236 | return acc; 237 | }, 238 | newAttrs 239 | ); 240 | 241 | this.form.hide(); 242 | this.outerView.dispatch( 243 | this.outerView.state.tr 244 | .setNodeMarkup( 245 | nodeStartPos, 246 | null, 247 | newAttrs, 248 | this.node.marks 249 | ) 250 | ); 251 | } 252 | 253 | /** 254 | * Send this node's attributes to the server to get the rendered html back 255 | * 256 | * @param {object} attrs 257 | * @param {GalleryNodeView} nodeview 258 | */ 259 | function retrieveRenderedHTML(attrs, nodeview) { 260 | const ajaxEndpoint = DOKU_BASE + 'lib/exe/ajax.php'; 261 | jQuery.post(ajaxEndpoint, { 262 | 'call': 'plugin_gallery_prosemirror', 263 | 'attrs': JSON.stringify(attrs), 264 | }).done(function (data) { 265 | var newAttrs = jQuery.extend({}, attrs); 266 | newAttrs.renderedHTML = data; 267 | nodeview.outerView.dispatch( 268 | nodeview.outerView.state.tr 269 | .setNodeMarkup( 270 | nodeview.getPos(), 271 | null, 272 | newAttrs, 273 | nodeview.node.marks 274 | ) 275 | ); 276 | }); 277 | } 278 | 279 | /** 280 | * Callback returning our NodeView 281 | * 282 | * See https://prosemirror.net/docs/ref/#view.NodeView 283 | * 284 | * @param {Node} node 285 | * @param {EditorView} outerview 286 | * @param {function} getPos 287 | * @return {GalleryNodeView} 288 | */ 289 | function dwplugin_gallery(node, outerview, getPos) { 290 | 291 | // Inheritance in an IE compatible way without "class" keyword 292 | function GalleryNodeView(node, outerview, getPos) { 293 | this.form = new window.Prosemirror.classes.KeyValueForm( 294 | LANG.plugins.gallery.title_dialog, 295 | getGalleryFormFields(node.attrs) 296 | ); 297 | AbstractNodeView.call(this, node, outerview, getPos); 298 | } 299 | 300 | GalleryNodeView.prototype = Object.create(AbstractNodeView.prototype); 301 | GalleryNodeView.prototype.constructor = GalleryNodeView; 302 | 303 | /** 304 | * This renders the node into the editor 305 | * 306 | * This method is called from the AbstractNodeView constructor and from our update method below 307 | * 308 | * @param attrs 309 | */ 310 | GalleryNodeView.prototype.renderNode = function (attrs) { 311 | var thisView = this; 312 | if (!this.dom) { 313 | this.dom = document.createElement('div'); 314 | var $settingsButton = jQuery('