Merge branch 'release/0.18.7'
This commit is contained in:
commit
49953fdfd4
|
@ -27,16 +27,16 @@ jobs:
|
|||
wp: ['latest', '5.4']
|
||||
experimental: [false]
|
||||
|
||||
include:
|
||||
# include:
|
||||
# Complement the builds run via the matrix with high/low WP builds for PHP 7.4 and 8.0.
|
||||
# PHP 8.0 is sort of supported since WP 5.6.
|
||||
# PHP 7.4 is supported since WP 5.3.
|
||||
- php: '8.0'
|
||||
wp: 'latest'
|
||||
experimental: true
|
||||
- php: '8.0'
|
||||
wp: '5.6'
|
||||
experimental: true
|
||||
# - php: '8.0'
|
||||
# wp: 'latest'
|
||||
# experimental: true
|
||||
# - php: '8.0'
|
||||
# wp: '5.6'
|
||||
# experimental: true
|
||||
|
||||
name: "PHP ${{ matrix.php }} - WP ${{ matrix.wp }}"
|
||||
|
||||
|
@ -91,9 +91,9 @@ jobs:
|
|||
id: set_phpunit
|
||||
run: |
|
||||
if [[ "${{ matrix.php }}" = "8.0" ]]; then
|
||||
wget https://phar.phpunit.de/phpunit-8.3.1.phar -P /tmp
|
||||
chmod +x /tmp/phpunit-8.3.1.phar
|
||||
mv /tmp/phpunit-8.3.1.phar /usr/local/bin/phpunit
|
||||
wget https://phar.phpunit.de/phpunit-9.3.0.phar -P /tmp
|
||||
chmod +x /tmp/phpunit-9.3.0.phar
|
||||
mv /tmp/phpunit-9.3.0.phar /usr/local/bin/phpunit
|
||||
elif [[ "${{ matrix.php }}" > "6.0" ]]; then
|
||||
wget https://phar.phpunit.de/phpunit-6.5.7.phar -P /tmp
|
||||
chmod +x /tmp/phpunit-6.5.7.phar
|
||||
|
|
36
build.sh
36
build.sh
|
@ -14,12 +14,12 @@ current_OS=`uname`
|
|||
# For macOS (Darwin)
|
||||
if [ $current_OS == "Darwin" ]; then
|
||||
find src *.js -type f \( -name "*.js" -or -name "*.vue" -or -name "webpack.common.js" -or -name "webpack.dev.js" -or -name "webpack.prod.js" \) -exec md5 {} \; | sort -k 2 | md5 > last-js-build.md5
|
||||
find ./src/views/admin/scss/ ./src/views/gutenberg-blocks/ ./src/views/gutenberg-blocks/tainacan-blocks/collections-list ./src/views/gutenberg-blocks/tainacan-blocks/facets-list ./src/views/gutenberg-blocks/tainacan-blocks/dynamic-items-list ./src/views/gutenberg-blocks/tainacan-blocks/items-list ./src/views/gutenberg-blocks/tainacan-blocks/terms-list -type f \( -name "*.scss" \) -exec md5 {} \; | sort -k 2 | md5 > last-sass-build.md5
|
||||
find ./src/views/admin/scss/ ./src/views/gutenberg-blocks/ ./src/views/gutenberg-blocks/blocks/collections-list ./src/views/gutenberg-blocks/blocks/facets-list ./src/views/gutenberg-blocks/blocks/dynamic-items-list ./src/views/gutenberg-blocks/blocks/items-list ./src/views/gutenberg-blocks/blocks/terms-list -type f \( -name "*.scss" \) -exec md5 {} \; | sort -k 2 | md5 > last-sass-build.md5
|
||||
find ./composer.json -type f \( -name "composer.json" \) -exec md5 {} \; | sort -k 2 | md5 > last-composer-build.md5
|
||||
find ./package.json -type f \( -name "package.json" -or -name "package-lock.json" \) -exec md5 {} \; | sort -k 2 | md5 > last-package-build.md5
|
||||
else
|
||||
find src *.js -type f \( -name "*.js" -or -name "*.vue" -or -name "webpack.common.js" -or -name "webpack.dev.js" -or -name "webpack.prod.js" \) -exec md5sum {} \; | sort -k 2 | md5sum > last-js-build.md5
|
||||
find ./src/views/admin/scss/ ./src/views/roles/ ./src/views/media-component/ ./src/views/reports/ ./src/views/gutenberg-blocks ./src/views/gutenberg-blocks/tainacan-blocks/collections-list ./src/views/gutenberg-blocks/tainacan-blocks/facets-list ./src/views/gutenberg-blocks/tainacan-blocks/dynamic-items-list ./src/views/gutenberg-blocks/tainacan-blocks/items-list ./src/views/gutenberg-blocks/tainacan-blocks/terms-list -type f \( -name "*.scss" \) -exec md5sum {} \; | sort -k 2 | md5sum > last-sass-build.md5
|
||||
find ./src/views/admin/scss/ ./src/views/gutenberg-blocks ./src/views/gutenberg-blocks/blocks/collections-list ./src/views/gutenberg-blocks/blocks/facets-list ./src/views/gutenberg-blocks/blocks/dynamic-items-list ./src/views/gutenberg-blocks/blocks/items-list ./src/views/gutenberg-blocks/blocks/terms-list -type f \( -name "*.scss" \) -exec md5sum {} \; | sort -k 2 | md5sum > last-sass-build.md5
|
||||
find ./composer.json -type f \( -name "composer.json" \) -exec md5sum {} \; | sort -k 2 | md5sum > last-composer-build.md5
|
||||
find ./package.json -type f \( -name "package.json" -or -name "package-lock.json" \) -exec md5sum {} \; | sort -k 2 | md5sum > last-package-build.md5
|
||||
fi
|
||||
|
@ -31,11 +31,26 @@ then
|
|||
npm ci
|
||||
fi
|
||||
|
||||
is_prod_build=false
|
||||
for i in "$@"
|
||||
do
|
||||
case $i in
|
||||
--prod)
|
||||
is_prod_build=true
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
new_md5_composer=$(<last-composer-build.md5)
|
||||
if [ "$current_md5_composer" != "$new_md5_composer" ]
|
||||
then
|
||||
## Install composer dependencies
|
||||
composer install
|
||||
if [ "$is_prod_build" == false ]
|
||||
then
|
||||
composer install
|
||||
else
|
||||
composer install --no-dev
|
||||
fi
|
||||
fi
|
||||
|
||||
new_md5_sass=$(<last-sass-build.md5)
|
||||
|
@ -47,24 +62,15 @@ fi
|
|||
|
||||
new_md5_js=$(<last-js-build.md5)
|
||||
|
||||
is_prod_build=false
|
||||
if [ "$current_md5_js" != "$new_md5_js" ]
|
||||
then
|
||||
for i in "$@"
|
||||
do
|
||||
case $i in
|
||||
--prod)
|
||||
is_prod_build=true
|
||||
echo "$(tput setab 4) $(tput sgr 0) $(tput setab 4) $(tput sgr 0) Building in production mode $(tput setab 4) $(tput sgr 0) $(tput setab 4) $(tput sgr 0)"
|
||||
npm run build-prod
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ "$is_prod_build" == false ]
|
||||
then
|
||||
echo "$(tput setab 2) $(tput sgr 0) $(tput setab 2) $(tput sgr 0) Building in development mode $(tput setab 2) $(tput sgr 0) $(tput setab 2) $(tput sgr 0)"
|
||||
npm run build
|
||||
else
|
||||
echo "$(tput setab 4) $(tput sgr 0) $(tput setab 4) $(tput sgr 0) Building in production mode $(tput setab 4) $(tput sgr 0) $(tput setab 4) $(tput sgr 0)"
|
||||
npm run build-prod
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
|
@ -14,35 +14,37 @@ sass -E 'UTF-8' --cache-location .tmp/sass-cache-2 src/views/roles/tainacan-role
|
|||
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-3 src/views/reports/tainacan-reports.scss:src/assets/css/tainacan-reports.css
|
||||
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-4 src/views/media-component/media-component.scss:src/assets/css/media-component.css
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-4 src/views/gutenberg-blocks/blocks/item-gallery/style.scss:src/assets/css/tainacan-gutenberg-block-item-gallery.css
|
||||
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-5 src/views/gutenberg-blocks/tainacan-blocks/collections-list/style.scss:src/assets/css/tainacan-gutenberg-block-collections-list.css
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-5 src/views/gutenberg-blocks/blocks/collections-list/style.scss:src/assets/css/tainacan-gutenberg-block-collections-list.css
|
||||
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-6 src/views/gutenberg-blocks/tainacan-blocks/carousel-collections-list/style.scss:src/assets/css/tainacan-gutenberg-block-carousel-collections-list.css
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-6 src/views/gutenberg-blocks/blocks/carousel-collections-list/style.scss:src/assets/css/tainacan-gutenberg-block-carousel-collections-list.css
|
||||
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-7 src/views/gutenberg-blocks/tainacan-blocks/items-list/style.scss:src/assets/css/tainacan-gutenberg-block-items-list.css
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-7 src/views/gutenberg-blocks/blocks/items-list/style.scss:src/assets/css/tainacan-gutenberg-block-items-list.css
|
||||
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-8 src/views/gutenberg-blocks/tainacan-blocks/dynamic-items-list/style.scss:src/assets/css/tainacan-gutenberg-block-dynamic-items-list.css
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-8 src/views/gutenberg-blocks/blocks/dynamic-items-list/style.scss:src/assets/css/tainacan-gutenberg-block-dynamic-items-list.css
|
||||
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-9 src/views/gutenberg-blocks/tainacan-blocks/search-bar/style.scss:src/assets/css/tainacan-gutenberg-block-search-bar.css
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-9 src/views/gutenberg-blocks/blocks/search-bar/style.scss:src/assets/css/tainacan-gutenberg-block-search-bar.css
|
||||
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-10 src/views/gutenberg-blocks/tainacan-blocks/carousel-items-list/style.scss:src/assets/css/tainacan-gutenberg-block-carousel-items-list.css
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-10 src/views/gutenberg-blocks/blocks/carousel-items-list/style.scss:src/assets/css/tainacan-gutenberg-block-carousel-items-list.css
|
||||
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-12 src/views/gutenberg-blocks/tainacan-blocks/carousel-items-list/style.scss:src/assets/css/tainacan-gutenberg-block-carousel-items-list.css
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-12 src/views/gutenberg-blocks/blocks/carousel-items-list/style.scss:src/assets/css/tainacan-gutenberg-block-carousel-items-list.css
|
||||
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-12 src/views/gutenberg-blocks/tainacan-blocks/terms-list/style.scss:src/assets/css/tainacan-gutenberg-block-terms-list.css
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-12 src/views/gutenberg-blocks/blocks/terms-list/style.scss:src/assets/css/tainacan-gutenberg-block-terms-list.css
|
||||
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-13 src/views/gutenberg-blocks/tainacan-blocks/facets-list/style.scss:src/assets/css/tainacan-gutenberg-block-facets-list.css
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-13 src/views/gutenberg-blocks/blocks/facets-list/style.scss:src/assets/css/tainacan-gutenberg-block-facets-list.css
|
||||
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-14 src/views/gutenberg-blocks/tainacan-blocks/carousel-terms-list/style.scss:src/assets/css/tainacan-gutenberg-block-carousel-terms-list.css
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-14 src/views/gutenberg-blocks/blocks/carousel-terms-list/style.scss:src/assets/css/tainacan-gutenberg-block-carousel-terms-list.css
|
||||
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-15 src/views/gutenberg-blocks/tainacan-blocks/faceted-search/style.scss:src/assets/css/tainacan-gutenberg-block-faceted-search.css
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-15 src/views/gutenberg-blocks/blocks/faceted-search/style.scss:src/assets/css/tainacan-gutenberg-block-faceted-search.css
|
||||
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-16 src/views/gutenberg-blocks/tainacan-blocks/item-submission-form/style.scss:src/assets/css/tainacan-gutenberg-block-item-submission-form.css
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-16 src/views/gutenberg-blocks/blocks/item-submission-form/style.scss:src/assets/css/tainacan-gutenberg-block-item-submission-form.css
|
||||
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-17 src/views/gutenberg-blocks/tainacan-blocks/carousel-related-items/style.scss:src/assets/css/tainacan-gutenberg-block-carousel-related-items.css
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-17 src/views/gutenberg-blocks/blocks/related-items-list/style.scss:src/assets/css/tainacan-gutenberg-block-related-items-list.css
|
||||
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-18 src/views/gutenberg-blocks/gutenberg-blocks-style.scss:src/assets/css/tainacan-gutenberg-block-common-styles.css
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-18 src/views/gutenberg-blocks/scss/gutenberg-blocks-editor-style.scss:src/assets/css/tainacan-gutenberg-block-common-editor-styles.css
|
||||
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-19 src/views/gutenberg-blocks/scss/gutenberg-blocks-theme-style.scss:src/assets/css/tainacan-gutenberg-block-common-theme-styles.css
|
||||
|
||||
echo "Compilação do Sass Concluído!"
|
||||
exit 0
|
||||
|
|
|
@ -5,11 +5,13 @@
|
|||
"require": {
|
||||
"respect/validation": "^1.1",
|
||||
"smalot/pdfparser": "*",
|
||||
"kornrunner/blurhash": "^1.1"
|
||||
"kornrunner/blurhash": "^1.1",
|
||||
"symfony/polyfill-mbstring": "1.20.0",
|
||||
"phpcompatibility/php-compatibility": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"squizlabs/php_codesniffer": "^2.2 || ^3.0.2",
|
||||
"phpcompatibility/php-compatibility": "*"
|
||||
"yoast/phpunit-polyfills": "^1.0.1"
|
||||
},
|
||||
"prefer-stable" : true,
|
||||
"minimum-stability": "dev",
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
29
package.json
29
package.json
|
@ -8,16 +8,15 @@
|
|||
"build-prod": "cross-env NODE_ENV=production webpack --config webpack.prod.js --display-error-details --progress --hide-modules"
|
||||
},
|
||||
"dependencies": {
|
||||
"apexcharts": "^3.26.3",
|
||||
"axios": "^0.21.1",
|
||||
"apexcharts": "^3.29.0",
|
||||
"axios": "^0.21.4",
|
||||
"blurhash": "^1.1.3",
|
||||
"buefy": "^0.9.10",
|
||||
"buefy": "^0.9.11",
|
||||
"bulma": "^0.9.3",
|
||||
"conditioner-core": "^2.3.3",
|
||||
"countup.js": "^2.0.7",
|
||||
"css-vars-ponyfill": "^2.3.1",
|
||||
"mdi": "^2.2.43",
|
||||
"moment": "^2.25.3",
|
||||
"countup.js": "^2.0.8",
|
||||
"css-vars-ponyfill": "^2.4.7",
|
||||
"moment": "^2.29.1",
|
||||
"node-sass": "^4.14.1",
|
||||
"photoswipe": "^4.1.3",
|
||||
"qs": "^6.9.4",
|
||||
|
@ -26,15 +25,15 @@
|
|||
"swiper": "^5.2.0",
|
||||
"t": "^0.5.1",
|
||||
"v-tooltip": "^2.1.3",
|
||||
"vue": "^2.6.11",
|
||||
"vue-apexcharts": "^1.6.1",
|
||||
"vue": "^2.6.14",
|
||||
"vue-apexcharts": "^1.6.2",
|
||||
"vue-awesome-swiper": "^4.1.1",
|
||||
"vue-blurhash": "^0.1.4",
|
||||
"vue-countup-v2": "^4.0.0",
|
||||
"vue-masonry-css": "^1.0.3",
|
||||
"vue-router": "^3.1.6",
|
||||
"vue-the-mask": "^0.11.1",
|
||||
"vuedraggable": "^2.23.2",
|
||||
"vuedraggable": "^2.24.3",
|
||||
"vuex": "^3.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -55,12 +54,12 @@
|
|||
"sass-loader": "^7.3.1",
|
||||
"style-loader": "^0.23.1",
|
||||
"terser-webpack-plugin": "3.0.0",
|
||||
"vue-loader": "^15.9.2",
|
||||
"vue-template-compiler": "^2.6.11",
|
||||
"webpack": "^4.43.0",
|
||||
"vue-loader": "^15.9.8",
|
||||
"vue-template-compiler": "^2.6.14",
|
||||
"webpack": "^4.45.0",
|
||||
"webpack-bundle-analyzer": "^3.7.0",
|
||||
"webpack-cli": "^3.3.11",
|
||||
"webpack-dev-server": "^3.11.0",
|
||||
"webpack-cli": "^3.3.12",
|
||||
"webpack-dev-server": "^3.11.2",
|
||||
"webpack-merge": "^5.4.0"
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"version": 3,
|
||||
"mappings": "AAEA,yCAA0C;EACtC,MAAM,EAAE,UAAU;EAClB,KAAK,EAAE,IAAI;EAGX,4DAAmB;IACf,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE,GAAG;IACZ,OAAO,EAAE,IAAI;IACb,eAAe,EAAE,MAAM;IACvB,WAAW,EAAE,MAAM;IACnB,KAAK,EAAE,oCAAmC;AAI9C,qCAIC;EAHG,EAAE;IAAC,OAAO,EAAE,GAAG;EACf,GAAG;IAAC,OAAO,EAAE,GAAG;EAChB,IAAI;IAAC,OAAO,EAAE,GAAG;AAErB,kCAIC;EAHG,EAAE;IAAC,OAAO,EAAE,GAAG;EACf,GAAG;IAAC,OAAO,EAAE,GAAG;EAChB,IAAI;IAAC,OAAO,EAAE,GAAG;AAErB,gCAIC;EAHG,EAAE;IAAC,OAAO,EAAE,GAAG;EACf,GAAG;IAAC,OAAO,EAAE,GAAG;EAChB,IAAI;IAAC,OAAO,EAAE,GAAG;AAErB,6BAIC;EAHG,EAAE;IAAC,OAAO,EAAE,GAAG;EACf,GAAG;IAAC,OAAO,EAAE,GAAG;EAChB,IAAI;IAAC,OAAO,EAAE,GAAG;EAErB,mDAAU;IACN,aAAa,EAAE,GAAG;IAClB,UAAU,EAAE,oCAAmC;IAE/C,iBAAiB,EAAE,qCAAqC;IACxD,cAAc,EAAE,qCAAqC;IACrD,YAAY,EAAE,qCAAqC;IACnD,SAAS,EAAE,qCAAqC;EAIpD,gFAAuC;IACnC,QAAQ,EAAE,QAAQ;IAElB,0FAAY;MACR,UAAU,EAAE,KAAK",
|
||||
"sources": ["../../views/gutenberg-blocks/tainacan-blocks/carousel-related-items/style.scss"],
|
||||
"sources": ["../../views/gutenberg-blocks/blocks/carousel-related-items/style.scss"],
|
||||
"names": [],
|
||||
"file": "tainacan-gutenberg-block-carousel-related-items.css"
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"version": 3,
|
||||
"mappings": "AAEA,mCAAoC;EAChC,MAAM,EAAE,QAAQ;EAGhB,uDAAoB;IAChB,QAAQ,EAAE,QAAQ;IAClB,KAA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U;MAG1B;sHAAI;QACA,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,IAAI;QACX,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,GAAG;QACZ,YAAY,EAAE,IAAI;MAItB;iJAA+B;QAC3B,OAAO,EAAE,IAAI;MAGjB;;0HACU;QACN,KAAK,EAAE,OAAO;QACd,eAAe,EAAE,IAAI;MAGzB,0CAA2C;QApC/C;oHAAwB;UAqChB,SAAS,EAAE,gBAAgB;UAC3B,KAAK,EAAE,gBAAgB;MAG3B,0CAA2C;QAzC/C;oHAAwB;UA0ChB,SAAS,EAAE,oBAAoB;UAC/B,KAAK,EAAE,oBAAoB;MAG/B,yCAA0C;QA9C9C;oHAAwB;UA+ChB,SAAS,EAAE,gBAAgB;UAC3B,KAAK,EAAE,gBAAgB;MAG3B,yCAA0C;QAnD9C;oHAAwB;UAoDhB,SAAS,EAAE,iBAAiB;UAC5B,KAAK,EAAE,iBAAiB;;AAOhC;iIACa;EACT,KAAK,EAAE,OAAO",
|
||||
"sources": ["../../views/gutenberg-blocks/tainacan-blocks/collections-list/style.scss","../../views/gutenberg-blocks/gutenberg-blocks-variables.scss"],
|
||||
"sources": ["../../views/gutenberg-blocks/blocks/collections-list/style.scss","../../views/gutenberg-blocks/scss/gutenberg-blocks-variables.scss"],
|
||||
"names": [],
|
||||
"file": "tainacan-gutenberg-block-collections-list.css"
|
||||
}
|
||||
|
|
|
@ -179,4 +179,4 @@
|
|||
padding: 0 12px;
|
||||
color: var(--tainacan-block-gray5, #454647); }
|
||||
|
||||
/*# sourceMappingURL=tainacan-gutenberg-block-common-styles.css.map */
|
||||
/*# sourceMappingURL=tainacan-gutenberg-block-common-editor-styles.css.map */
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"version": 3,
|
||||
"mappings": "AAIA,KAAM;EACF,sBAAsB,CAAC,QAAU;EACjC,sBAAsB,CAAC,QAAU;EACjC,sBAAsB,CAAC,QAAU;EACjC,sBAAsB,CAAC,QAAU;EACjC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,IAAI;IACrB,MAAM,EAAE,IAAI;IACZ,OAAO,EAAE,GAAG;IACZ,UAAU,EAAE,IAAI;IAChB,UAAU,EAAE,IAAI;IAChB,UAAU,EAAE,MAAM;IAElB;uGAAyB;MACrB,QAAQ,EAAE,MAAM;MAChB,YAAY,EAAE,GAAG;IAGrB;;;gHACkC;MAC9B,OAAO,EAAE,IAAI;MACb,eAAe,EAAE,UAAU;MAC3B,WAAW,EAAE,MAAM;MAEnB;;;sHAAI;QACA,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,IAAI;QACZ,YAAY,EAAE,IAAI;QAClB,aAAa,EAAE,GAAG;MAEtB;;;wHAAM;QACF,OAAO,EAAE,YAAY;QACrB,SAAS,EAAE,GAAG;QAEd,yCAA0C;UAJ9C;;;4HAAM;YAI0C,SAAS,EAAE,GAAG;IAGlE;iJAAmE;MAC/D,SAAS,EAAE,IAAI;MACf,UAAU,EAAE,IAAI;EAGxB,gDAAwB;IACpB,OAAO,EAAE,IAAI;IACb,WAAW,EAAE,QAAQ;IACrB,eAAe,EAAE,MAAM;IAEvB,kDAAE;MACE,KAAK,EAAE,oCAAmC;MAC1C,YAAY,EAAE,IAAI;MAClB,UAAU,EAAE,GAAG;EAGvB,2CAAmB;IACf,UAAU,EAAE,iBAAiB;IAC7B,OAAO,EAAE,IAAI;IACb,WAAW,EAAE,QAAQ;IACrB,eAAe,EAAE,aAAa;IAC9B,OAAO,EAAE,gBAAgB;IACzB,MAAM,EAAE,OAAO;IAEf,6CAAE;MACE,OAAO,EAAE,MAAM;MACf,KAAK,EAAE,oCAAmC",
|
||||
"sources": ["../../views/gutenberg-blocks/gutenberg-blocks-style.scss","../../views/gutenberg-blocks/gutenberg-blocks-variables.scss"],
|
||||
"sources": ["../../views/gutenberg-blocks/scss/gutenberg-blocks-editor-style.scss","../../views/gutenberg-blocks/scss/gutenberg-blocks-variables.scss"],
|
||||
"names": [],
|
||||
"file": "tainacan-gutenberg-block-common-styles.css"
|
||||
"file": "tainacan-gutenberg-block-common-editor-styles.css"
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
[data-module="faceted-search"]:not(.has-mounted),
|
||||
[data-module="facets-list"]:not(.has-mounted),
|
||||
[data-module="dynamic-items-list"]:not(.has-mounted),
|
||||
[data-module="carousel-items-list"]:not(.has-mounted),
|
||||
[data-module="carousel-terms-list"]:not(.has-mounted),
|
||||
[data-module="carousel-collections-list"]:not(.has-mounted),
|
||||
[data-module="item-submission-form"]:not(.has-mounted) {
|
||||
background-color: inherit;
|
||||
opacity: 0.75;
|
||||
border-radius: 2px; }
|
||||
|
||||
[data-module="item-submission-form"]:not(.has-mounted),
|
||||
[data-module="faceted-search"]:not(.has-mounted) {
|
||||
min-height: 75vh; }
|
||||
|
||||
[data-module="facets-list"]:not(.has-mounted),
|
||||
[data-module="dynamic-items-list"]:not(.has-mounted),
|
||||
[data-module="carousel-items-list"]:not(.has-mounted),
|
||||
[data-module="carousel-terms-list"]:not(.has-mounted),
|
||||
[data-module="carousel-collections-list"]:not(.has-mounted) {
|
||||
min-height: 160px; }
|
||||
|
||||
[data-module="facets-list"]:not(.has-mounted),
|
||||
[data-module="dynamic-items-list"]:not(.has-mounted) {
|
||||
min-height: 360px; }
|
||||
|
||||
/* Admin menu links */
|
||||
#wpadminbar #wp-admin-bar-tainacan-item-edition-link > .ab-item::before,
|
||||
#wpadminbar #wp-admin-bar-tainacan-collection-edition-link > .ab-item::before,
|
||||
#wpadminbar #wp-admin-bar-tainacan-collections-edition-link > .ab-item::before {
|
||||
content: '\f464';
|
||||
top: 2px; }
|
||||
|
||||
/*# sourceMappingURL=tainacan-gutenberg-block-common-theme-styles.css.map */
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"version": 3,
|
||||
"mappings": "AACA;;;;;;sDAMuD;EACnD,gBAAgB,EAAE,OAAO;EACzB,OAAO,EAAE,IAAI;EACb,aAAa,EAAE,GAAG;;AAEtB;gDACiD;EAC7C,UAAU,EAAE,IAAI;;AAEpB;;;;2DAI4D;EACxD,UAAU,EAAE,KAAK;;AAErB;oDACqD;EACjD,UAAU,EAAE,KAAK;;AAGrB,sBAAsB;AACtB;;8EAE+E;EAC3E,OAAO,EAAE,OAAO;EAChB,GAAG,EAAE,GAAG",
|
||||
"sources": ["../../views/gutenberg-blocks/scss/gutenberg-blocks-theme-style.scss"],
|
||||
"names": [],
|
||||
"file": "tainacan-gutenberg-block-common-theme-styles.css"
|
||||
}
|
|
@ -231,6 +231,7 @@
|
|||
grid-gap: 24px;
|
||||
gap: 24px;
|
||||
justify-content: space-evenly;
|
||||
align-items: flex-start;
|
||||
list-style-type: none; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid:not(.max-columns-count-1):not(.max-columns-count-2):not(.max-columns-count-3):not(.max-columns-count-4):not(.max-columns-count-5):not(.max-columns-count-6):not(.max-columns-count-7),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid:not(.max-columns-count-1):not(.max-columns-count-2):not(.max-columns-count-3):not(.max-columns-count-4):not(.max-columns-count-5):not(.max-columns-count-6):not(.max-columns-count-7) {
|
||||
|
@ -513,7 +514,8 @@
|
|||
margin-right: 20px;
|
||||
display: block;
|
||||
height: 54px;
|
||||
width: 54px; }
|
||||
width: 54px;
|
||||
min-width: 54px; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list li.item-list-item img,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list li.item-list-item img {
|
||||
height: auto;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"version": 3,
|
||||
"mappings": "AAEA,iCAAkC;EAC9B,MAAM,EAAE,MAAM;EAGd,oDAAmB;IACf,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE,GAAG;IACZ,OAAO,EAAE,IAAI;IACb,eAAe,EAAE,MAAM;IACvB,WAAW,EAAE,MAAM;IACnB,KAAK,EAAE,oCAAmC;EAG9C,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AAW;UACP,gBAAgB,EAAE,wDAAsD;MAGhF,qFAAiB;QACb,eAAe,EAAE,KAAK;QACtB,gBAAgB,EAAE,4DAA0D;QAC5E,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,IAAI;QACX,KAAK,EAAE,IAAI;MAEf,2FAAuB;QACnB,gBAAgB,EAAE,qDAAmD;QACrE,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,GAAG;QACV,aAAa,EAAE,GAAG;QAClB,MAAM,EAAE,eAAe;QACvB,QAAQ,EAAE,QAAQ;QAClB,IAAI,EAAE,IAAI;QAEV,0GAAiB;UACb,KAAK,EAAE,GAAG;EAM1B,mDAAkB;IACd,SAAS,EAAE,eAAe;EAI1B,mFAAgB;IACZ,OAAO,EAAE,4HAA4H;EAEzI,iGAA8B;IAC1B,OAAO,EAAE,sDAAsD;EAEnE,gGAA6B;IACzB,aAAa,EAAE,GAAG;EAEtB,wGAAqC;IACjC,YAAY,EAAE,uCAAuC;IACrD,aAAa,EAAE,uCAAuC",
|
||||
"sources": ["../../views/gutenberg-blocks/tainacan-blocks/faceted-search/style.scss"],
|
||||
"sources": ["../../views/gutenberg-blocks/blocks/faceted-search/style.scss"],
|
||||
"names": [],
|
||||
"file": "tainacan-gutenberg-block-faceted-search.css"
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,967 @@
|
|||
/*! PhotoSwipe main CSS by Dmitry Semenov | photoswipe.com | MIT license */
|
||||
/*
|
||||
Styles for basic PhotoSwipe functionality (sliding area, open/close transitions)
|
||||
*/
|
||||
/* pswp = photoswipe */
|
||||
.pswp {
|
||||
display: none;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
overflow: hidden;
|
||||
-ms-touch-action: none;
|
||||
touch-action: none;
|
||||
z-index: 9999999;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
/* create separate layer, to avoid paint on window.onscroll in webkit/blink */
|
||||
-webkit-backface-visibility: hidden;
|
||||
outline: none; }
|
||||
.pswp * {
|
||||
box-sizing: border-box; }
|
||||
.pswp img {
|
||||
max-width: none; }
|
||||
|
||||
/* style is added when JS option showHideOpacity is set to true */
|
||||
.pswp--animate_opacity {
|
||||
/* 0.001, because opacity:0 doesn't trigger Paint action, which causes lag at start of transition */
|
||||
opacity: 0.001;
|
||||
will-change: opacity;
|
||||
/* for open/close transition */
|
||||
transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1); }
|
||||
|
||||
.pswp--open {
|
||||
display: block; }
|
||||
|
||||
.pswp--zoom-allowed .pswp__img {
|
||||
/* autoprefixer: off */
|
||||
cursor: -webkit-zoom-in;
|
||||
cursor: -moz-zoom-in;
|
||||
cursor: zoom-in; }
|
||||
|
||||
.pswp--zoomed-in .pswp__img {
|
||||
/* autoprefixer: off */
|
||||
cursor: -webkit-grab;
|
||||
cursor: -moz-grab;
|
||||
cursor: grab; }
|
||||
|
||||
.pswp--dragging .pswp__img {
|
||||
/* autoprefixer: off */
|
||||
cursor: -webkit-grabbing;
|
||||
cursor: -moz-grabbing;
|
||||
cursor: grabbing; }
|
||||
|
||||
/*
|
||||
Background is added as a separate element.
|
||||
As animating opacity is much faster than animating rgba() background-color.
|
||||
*/
|
||||
.pswp__bg {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
opacity: 0;
|
||||
transform: translateZ(0);
|
||||
-webkit-backface-visibility: hidden;
|
||||
will-change: opacity; }
|
||||
|
||||
.pswp__scroll-wrap {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden; }
|
||||
|
||||
.pswp__container,
|
||||
.pswp__zoom-wrap {
|
||||
-ms-touch-action: none;
|
||||
touch-action: none;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0; }
|
||||
|
||||
/* Prevent selection and tap highlights */
|
||||
.pswp__container,
|
||||
.pswp__img {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
user-select: none;
|
||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||
-webkit-touch-callout: none; }
|
||||
|
||||
.pswp__zoom-wrap {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
-webkit-transform-origin: left top;
|
||||
-moz-transform-origin: left top;
|
||||
-ms-transform-origin: left top;
|
||||
transform-origin: left top;
|
||||
/* for open/close transition */
|
||||
transition: transform 333ms cubic-bezier(0.4, 0, 0.22, 1); }
|
||||
|
||||
.pswp__bg {
|
||||
will-change: opacity;
|
||||
/* for open/close transition */
|
||||
transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1); }
|
||||
|
||||
.pswp--animated-in .pswp__bg,
|
||||
.pswp--animated-in .pswp__zoom-wrap {
|
||||
-webkit-transition: none;
|
||||
transition: none; }
|
||||
|
||||
.pswp__container,
|
||||
.pswp__zoom-wrap {
|
||||
-webkit-backface-visibility: hidden; }
|
||||
|
||||
.pswp__item {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
overflow: hidden; }
|
||||
|
||||
.pswp__img {
|
||||
position: absolute;
|
||||
width: auto;
|
||||
height: auto;
|
||||
top: 0;
|
||||
left: 0; }
|
||||
|
||||
/*
|
||||
stretched thumbnail or div placeholder element (see below)
|
||||
style is added to avoid flickering in webkit/blink when layers overlap
|
||||
*/
|
||||
.pswp__img--placeholder {
|
||||
-webkit-backface-visibility: hidden; }
|
||||
|
||||
/*
|
||||
div element that matches size of large image
|
||||
large image loads on top of it
|
||||
*/
|
||||
.pswp__img--placeholder--blank {
|
||||
background: #222; }
|
||||
|
||||
.pswp--ie .pswp__img {
|
||||
width: 100% !important;
|
||||
height: auto !important;
|
||||
left: 0;
|
||||
top: 0; }
|
||||
|
||||
/*
|
||||
Error message appears when image is not loaded
|
||||
(JS option errorMsg controls markup)
|
||||
*/
|
||||
.pswp__error-msg {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
line-height: 16px;
|
||||
margin-top: -8px;
|
||||
color: #CCC; }
|
||||
|
||||
.pswp__error-msg a {
|
||||
color: #CCC;
|
||||
text-decoration: underline; }
|
||||
|
||||
/*! PhotoSwipe Default UI CSS by Dmitry Semenov | photoswipe.com | MIT license */
|
||||
/*
|
||||
|
||||
Contents:
|
||||
|
||||
1. Buttons
|
||||
2. Share modal and links
|
||||
3. Index indicator ("1 of X" counter)
|
||||
4. Caption
|
||||
5. Loading indicator
|
||||
6. Additional styles (root element, top bar, idle state, hidden state, etc.)
|
||||
|
||||
*/
|
||||
/*
|
||||
|
||||
1. Buttons
|
||||
|
||||
*/
|
||||
/* <button> css reset */
|
||||
.pswp__button {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
position: relative;
|
||||
background: none;
|
||||
cursor: pointer;
|
||||
overflow: visible;
|
||||
-webkit-appearance: none;
|
||||
display: block;
|
||||
border: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
float: right;
|
||||
opacity: 0.75;
|
||||
transition: opacity 0.2s;
|
||||
box-shadow: none; }
|
||||
.pswp__button:focus, .pswp__button:hover {
|
||||
opacity: 1; }
|
||||
.pswp__button:active {
|
||||
outline: none;
|
||||
opacity: 0.9; }
|
||||
.pswp__button::-moz-focus-inner {
|
||||
padding: 0;
|
||||
border: 0; }
|
||||
|
||||
/* pswp__ui--over-close class it added when mouse is over element that should close gallery */
|
||||
.pswp__ui--over-close .pswp__button--close {
|
||||
opacity: 1; }
|
||||
|
||||
.pswp__button,
|
||||
.pswp__button--arrow--left:before,
|
||||
.pswp__button--arrow--right:before {
|
||||
background: url(../images/default-skin.png) 0 0 no-repeat;
|
||||
background-size: 264px 88px;
|
||||
width: 44px;
|
||||
height: 44px; }
|
||||
|
||||
@media (-webkit-min-device-pixel-ratio: 1.1), (min-resolution: 105dpi), (min-resolution: 1.1dppx) {
|
||||
/* Serve SVG sprite if browser supports SVG and resolution is more than 105dpi */
|
||||
.pswp--svg .pswp__button,
|
||||
.pswp--svg .pswp__button--arrow--left:before,
|
||||
.pswp--svg .pswp__button--arrow--right:before {
|
||||
background-image: url(../images/default-skin.svg); }
|
||||
|
||||
.pswp--svg .pswp__button--arrow--left,
|
||||
.pswp--svg .pswp__button--arrow--right {
|
||||
background: none; } }
|
||||
.pswp__button--close {
|
||||
background-position: 0 -44px; }
|
||||
|
||||
.pswp__button--share {
|
||||
background-position: -44px -44px; }
|
||||
|
||||
.pswp__button--fs {
|
||||
display: none; }
|
||||
|
||||
.pswp--supports-fs .pswp__button--fs {
|
||||
display: block; }
|
||||
|
||||
.pswp--fs .pswp__button--fs {
|
||||
background-position: -44px 0; }
|
||||
|
||||
.pswp__button--zoom {
|
||||
display: none;
|
||||
background-position: -88px 0; }
|
||||
|
||||
.pswp--zoom-allowed .pswp__button--zoom {
|
||||
display: block; }
|
||||
|
||||
.pswp--zoomed-in .pswp__button--zoom {
|
||||
background-position: -132px 0; }
|
||||
|
||||
/* no arrows on touch screens */
|
||||
.pswp--touch .pswp__button--arrow--left,
|
||||
.pswp--touch .pswp__button--arrow--right {
|
||||
visibility: hidden; }
|
||||
|
||||
/*
|
||||
Arrow buttons hit area
|
||||
(icon is added to :before pseudo-element)
|
||||
*/
|
||||
.pswp__button--arrow--left,
|
||||
.pswp__button--arrow--right {
|
||||
background: none;
|
||||
top: 50%;
|
||||
margin-top: -50px;
|
||||
width: 70px;
|
||||
height: 100px;
|
||||
position: absolute; }
|
||||
|
||||
.pswp__button--arrow--left {
|
||||
left: 0; }
|
||||
|
||||
.pswp__button--arrow--right {
|
||||
right: 0; }
|
||||
|
||||
.pswp__button--arrow--left:before,
|
||||
.pswp__button--arrow--right:before {
|
||||
content: '';
|
||||
top: 35px;
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
height: 30px;
|
||||
width: 32px;
|
||||
position: absolute; }
|
||||
|
||||
.pswp__button--arrow--left:before {
|
||||
left: 6px;
|
||||
background-position: -138px -44px; }
|
||||
|
||||
.pswp__button--arrow--right:before {
|
||||
right: 6px;
|
||||
background-position: -94px -44px; }
|
||||
|
||||
/*
|
||||
|
||||
2. Share modal/popup and links
|
||||
|
||||
*/
|
||||
.pswp__counter,
|
||||
.pswp__share-modal {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
user-select: none; }
|
||||
|
||||
.pswp__share-modal {
|
||||
display: block;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
padding: 10px;
|
||||
position: absolute;
|
||||
z-index: 10000099;
|
||||
opacity: 0;
|
||||
transition: opacity 0.25s ease-out;
|
||||
-webkit-backface-visibility: hidden;
|
||||
will-change: opacity; }
|
||||
|
||||
.pswp__share-modal--hidden {
|
||||
display: none; }
|
||||
|
||||
.pswp__share-tooltip {
|
||||
z-index: 10000119;
|
||||
position: absolute;
|
||||
background: #FFF;
|
||||
top: 56px;
|
||||
border-radius: 2px;
|
||||
display: block;
|
||||
width: auto;
|
||||
right: 44px;
|
||||
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
|
||||
transform: translateY(6px);
|
||||
transition: transform 0.25s;
|
||||
-webkit-backface-visibility: hidden;
|
||||
will-change: transform; }
|
||||
.pswp__share-tooltip a {
|
||||
display: block;
|
||||
padding: 8px 12px;
|
||||
color: #000;
|
||||
text-decoration: none;
|
||||
font-size: 14px;
|
||||
line-height: 18px; }
|
||||
.pswp__share-tooltip a:hover {
|
||||
text-decoration: none;
|
||||
color: #000; }
|
||||
.pswp__share-tooltip a:first-child {
|
||||
/* round corners on the first/last list item */
|
||||
border-radius: 2px 2px 0 0; }
|
||||
.pswp__share-tooltip a:last-child {
|
||||
border-radius: 0 0 2px 2px; }
|
||||
|
||||
.pswp__share-modal--fade-in {
|
||||
opacity: 1; }
|
||||
.pswp__share-modal--fade-in .pswp__share-tooltip {
|
||||
transform: translateY(0); }
|
||||
|
||||
/* increase size of share links on touch devices */
|
||||
.pswp--touch .pswp__share-tooltip a {
|
||||
padding: 16px 12px; }
|
||||
|
||||
a.pswp__share--facebook:before {
|
||||
content: '';
|
||||
display: block;
|
||||
width: 0;
|
||||
height: 0;
|
||||
position: absolute;
|
||||
top: -12px;
|
||||
right: 15px;
|
||||
border: 6px solid rgba(0, 0, 0, 0);
|
||||
border-bottom-color: #FFF;
|
||||
-webkit-pointer-events: none;
|
||||
-moz-pointer-events: none;
|
||||
pointer-events: none; }
|
||||
a.pswp__share--facebook:hover {
|
||||
background: #3E5C9A;
|
||||
color: #FFF; }
|
||||
a.pswp__share--facebook:hover:before {
|
||||
border-bottom-color: #3E5C9A; }
|
||||
|
||||
a.pswp__share--twitter:hover {
|
||||
background: #55ACEE;
|
||||
color: #FFF; }
|
||||
|
||||
a.pswp__share--pinterest:hover {
|
||||
background: #CCC;
|
||||
color: #CE272D; }
|
||||
|
||||
a.pswp__share--download:hover {
|
||||
background: #DDD; }
|
||||
|
||||
/*
|
||||
|
||||
3. Index indicator ("1 of X" counter)
|
||||
|
||||
*/
|
||||
.pswp__counter {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
height: 44px;
|
||||
font-size: 13px;
|
||||
line-height: 44px;
|
||||
color: #FFF;
|
||||
opacity: 0.75;
|
||||
padding: 0 10px; }
|
||||
|
||||
/*
|
||||
|
||||
4. Caption
|
||||
|
||||
*/
|
||||
.pswp__caption {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
min-height: 44px; }
|
||||
.pswp__caption small {
|
||||
font-size: 11px;
|
||||
color: #BBB; }
|
||||
|
||||
.pswp__caption__center {
|
||||
text-align: left;
|
||||
max-width: 420px;
|
||||
margin: 0 auto;
|
||||
font-size: 13px;
|
||||
padding: 10px;
|
||||
line-height: 20px;
|
||||
color: #CCC; }
|
||||
|
||||
.pswp__caption--empty {
|
||||
display: none; }
|
||||
|
||||
/* Fake caption element, used to calculate height of next/prev image */
|
||||
.pswp__caption--fake {
|
||||
visibility: hidden; }
|
||||
|
||||
/*
|
||||
|
||||
5. Loading indicator (preloader)
|
||||
|
||||
You can play with it here - http://codepen.io/dimsemenov/pen/yyBWoR
|
||||
|
||||
*/
|
||||
.pswp__preloader {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
margin-left: -22px;
|
||||
opacity: 0;
|
||||
transition: opacity 0.25s ease-out;
|
||||
will-change: opacity;
|
||||
direction: ltr; }
|
||||
|
||||
.pswp__preloader__icn {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin: 12px; }
|
||||
|
||||
.pswp__preloader--active {
|
||||
opacity: 1; }
|
||||
.pswp__preloader--active .pswp__preloader__icn {
|
||||
/* We use .gif in browsers that don't support CSS animation */
|
||||
background: url(../images/preloader.gif) 0 0 no-repeat; }
|
||||
|
||||
.pswp--css_animation .pswp__preloader--active {
|
||||
opacity: 1; }
|
||||
.pswp--css_animation .pswp__preloader--active .pswp__preloader__icn {
|
||||
animation: clockwise 500ms linear infinite; }
|
||||
.pswp--css_animation .pswp__preloader--active .pswp__preloader__donut {
|
||||
animation: donut-rotate 1000ms cubic-bezier(0.4, 0, 0.22, 1) infinite; }
|
||||
.pswp--css_animation .pswp__preloader__icn {
|
||||
background: none;
|
||||
opacity: 0.75;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
position: absolute;
|
||||
left: 15px;
|
||||
top: 15px;
|
||||
margin: 0; }
|
||||
.pswp--css_animation .pswp__preloader__cut {
|
||||
/*
|
||||
The idea of animating inner circle is based on Polymer ("material") loading indicator
|
||||
by Keanu Lee https://blog.keanulee.com/2014/10/20/the-tale-of-three-spinners.html
|
||||
*/
|
||||
position: relative;
|
||||
width: 7px;
|
||||
height: 14px;
|
||||
overflow: hidden; }
|
||||
.pswp--css_animation .pswp__preloader__donut {
|
||||
box-sizing: border-box;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
border: 2px solid #FFF;
|
||||
border-radius: 50%;
|
||||
border-left-color: transparent;
|
||||
border-bottom-color: transparent;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background: none;
|
||||
margin: 0; }
|
||||
|
||||
@media screen and (max-width: 1024px) {
|
||||
.pswp__preloader {
|
||||
position: relative;
|
||||
left: auto;
|
||||
top: auto;
|
||||
margin: 0;
|
||||
float: right; } }
|
||||
@keyframes clockwise {
|
||||
0% {
|
||||
transform: rotate(0deg); }
|
||||
100% {
|
||||
transform: rotate(360deg); } }
|
||||
@keyframes donut-rotate {
|
||||
0% {
|
||||
transform: rotate(0); }
|
||||
50% {
|
||||
transform: rotate(-140deg); }
|
||||
100% {
|
||||
transform: rotate(0); } }
|
||||
/*
|
||||
|
||||
6. Additional styles
|
||||
|
||||
*/
|
||||
/* root element of UI */
|
||||
.pswp__ui {
|
||||
-webkit-font-smoothing: auto;
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
z-index: 10000049; }
|
||||
|
||||
/* top black bar with buttons and "1 of X" indicator */
|
||||
.pswp__top-bar {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
height: 44px;
|
||||
width: 100%; }
|
||||
|
||||
.pswp__caption,
|
||||
.pswp__top-bar,
|
||||
.pswp--has_mouse .pswp__button--arrow--left,
|
||||
.pswp--has_mouse .pswp__button--arrow--right {
|
||||
-webkit-backface-visibility: hidden;
|
||||
will-change: opacity;
|
||||
transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1); }
|
||||
|
||||
/* pswp--has_mouse class is added only when two subsequent mousemove events occur */
|
||||
.pswp--has_mouse .pswp__button--arrow--left,
|
||||
.pswp--has_mouse .pswp__button--arrow--right {
|
||||
visibility: visible; }
|
||||
|
||||
.pswp__top-bar,
|
||||
.pswp__caption {
|
||||
background-color: rgba(0, 0, 0, 0.5); }
|
||||
|
||||
/* pswp__ui--fit class is added when main image "fits" between top bar and bottom bar (caption) */
|
||||
.pswp__ui--fit .pswp__top-bar,
|
||||
.pswp__ui--fit .pswp__caption {
|
||||
background-color: rgba(0, 0, 0, 0.3); }
|
||||
|
||||
/* pswp__ui--idle class is added when mouse isn't moving for several seconds (JS option timeToIdle) */
|
||||
.pswp__ui--idle .pswp__top-bar {
|
||||
opacity: 0; }
|
||||
.pswp__ui--idle .pswp__button--arrow--left,
|
||||
.pswp__ui--idle .pswp__button--arrow--right {
|
||||
opacity: 0; }
|
||||
|
||||
/*
|
||||
pswp__ui--hidden class is added when controls are hidden
|
||||
e.g. when user taps to toggle visibility of controls
|
||||
*/
|
||||
.pswp__ui--hidden .pswp__top-bar,
|
||||
.pswp__ui--hidden .pswp__caption,
|
||||
.pswp__ui--hidden .pswp__button--arrow--left,
|
||||
.pswp__ui--hidden .pswp__button--arrow--right {
|
||||
/* Force paint & create composition layer for controls. */
|
||||
opacity: 0.001; }
|
||||
|
||||
/* pswp__ui--one-slide class is added when there is just one item in gallery */
|
||||
.pswp__ui--one-slide .pswp__button--arrow--left,
|
||||
.pswp__ui--one-slide .pswp__button--arrow--right,
|
||||
.pswp__ui--one-slide .pswp__counter {
|
||||
display: none; }
|
||||
|
||||
.pswp__element--disabled {
|
||||
display: none !important; }
|
||||
|
||||
.pswp--minimal--dark .pswp__top-bar {
|
||||
background: none; }
|
||||
|
||||
.tainacan-media-component {
|
||||
--swiper-theme-color: var(--tainacan-secondary, #298596);
|
||||
--swiper-navigation-size: 44px;
|
||||
--tainacan-media-background: var(--tainacan-background-color, transparent);
|
||||
--tainacan-media-main-carousel-height: 60vh;
|
||||
--tainacan-media-main-carousel-width: 100%;
|
||||
--tainacan-media-thumbs-carousel-width: 100%;
|
||||
--tainacan-media-thumbs-carousel-item-size: 136px;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
display: block;
|
||||
background-color: var(--tainacan-media-background, transparent);
|
||||
box-sizing: border-box; }
|
||||
.tainacan-media-component .swiper-slide,
|
||||
.tainacan-media-component .swiper-slide::after,
|
||||
.tainacan-media-component .swiper-slide::before {
|
||||
box-sizing: border-box; }
|
||||
|
||||
/* Style valid for both cases of carousel, main and thumbs */
|
||||
.tainacan-media-component__swiper-main .swiper-button-prev::after,
|
||||
.tainacan-media-component__swiper-main .swiper-container-rtl .swiper-button-next::after,
|
||||
.tainacan-media-component__swiper-thumbs .swiper-button-prev::after,
|
||||
.tainacan-media-component__swiper-thumbs .swiper-container-rtl .swiper-button-next::after {
|
||||
content: 'previous'; }
|
||||
.tainacan-media-component__swiper-main .swiper-button-next::after,
|
||||
.tainacan-media-component__swiper-main .swiper-button-prev::after,
|
||||
.tainacan-media-component__swiper-thumbs .swiper-button-next::after,
|
||||
.tainacan-media-component__swiper-thumbs .swiper-button-prev::after {
|
||||
font-family: "TainacanIcons";
|
||||
opacity: 0.7;
|
||||
transition: opacity ease 0.2s; }
|
||||
.tainacan-media-component__swiper-main:hover .swiper-button-next::after,
|
||||
.tainacan-media-component__swiper-main:hover .swiper-button-prev::after,
|
||||
.tainacan-media-component__swiper-thumbs:hover .swiper-button-next::after,
|
||||
.tainacan-media-component__swiper-thumbs:hover .swiper-button-prev::after {
|
||||
opacity: 1; }
|
||||
.tainacan-media-component__swiper-main ul.swiper-wrapper,
|
||||
.tainacan-media-component__swiper-thumbs ul.swiper-wrapper {
|
||||
list-style: none;
|
||||
padding: 0; }
|
||||
|
||||
.tainacan-media-component__swiper-main {
|
||||
width: 100%;
|
||||
max-width: var(--tainacan-media-main-carousel-width, 100%); }
|
||||
.tainacan-media-component__swiper-main ul.swiper-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 0; }
|
||||
.tainacan-media-component__swiper-main ul.swiper-wrapper[data-pswp-uid]:not([data-pswp-uid='']) li.swiper-slide .swiper-slide-content {
|
||||
cursor: zoom-in !important; }
|
||||
.tainacan-media-component__swiper-main ul.swiper-wrapper[data-pswp-uid]:not([data-pswp-uid='']) li.swiper-slide .swiper-slide-content iframe,
|
||||
.tainacan-media-component__swiper-main ul.swiper-wrapper[data-pswp-uid]:not([data-pswp-uid='']) li.swiper-slide .swiper-slide-content video,
|
||||
.tainacan-media-component__swiper-main ul.swiper-wrapper[data-pswp-uid]:not([data-pswp-uid='']) li.swiper-slide .swiper-slide-content audio {
|
||||
pointer-events: none; }
|
||||
.tainacan-media-component__swiper-main ul.swiper-wrapper[data-pswp-uid]:not([data-pswp-uid='']) li.swiper-slide .swiper-slide-content a {
|
||||
cursor: zoom-in !important; }
|
||||
.tainacan-media-component__swiper-main li.swiper-slide {
|
||||
height: 100%;
|
||||
max-width: 100%;
|
||||
padding: 0 var(--swiper-navigation-size, 44px);
|
||||
opacity: 1.0;
|
||||
transition: opacity 0.2s linear; }
|
||||
.tainacan-media-component__swiper-main li.swiper-slide:not(.swiper-slide-active) {
|
||||
opacity: 0.75; }
|
||||
.tainacan-media-component__swiper-main li.swiper-slide .swiper-slide-metadata {
|
||||
text-align: center;
|
||||
font-size: 0.875em;
|
||||
margin-bottom: 1em; }
|
||||
.tainacan-media-component__swiper-main li.swiper-slide .swiper-slide-metadata.hide-name .swiper-slide-metadata__name {
|
||||
display: none;
|
||||
visibility: hidden; }
|
||||
.tainacan-media-component__swiper-main li.swiper-slide .swiper-slide-metadata.hide-description .swiper-slide-metadata__description {
|
||||
display: none;
|
||||
visibility: hidden; }
|
||||
.tainacan-media-component__swiper-main li.swiper-slide .swiper-slide-metadata.hide-caption .swiper-slide-metadata__caption {
|
||||
display: none;
|
||||
visibility: hidden; }
|
||||
.tainacan-media-component__swiper-main li.swiper-slide .swiper-slide-metadata.hide-name.hide-description.hide-caption br {
|
||||
display: none;
|
||||
visibility: hidden; }
|
||||
.tainacan-media-component__swiper-main li.swiper-slide .swiper-slide-metadata__name {
|
||||
font-size: 1em;
|
||||
font-weight: bold;
|
||||
color: var(--tainacan-label-color, #454647); }
|
||||
.tainacan-media-component__swiper-main li.swiper-slide .swiper-slide-metadata__caption {
|
||||
font-size: 0.9375em;
|
||||
color: var(--tainacan-input-color, #1d1d1d); }
|
||||
.tainacan-media-component__swiper-main li.swiper-slide .swiper-slide-metadata__caption {
|
||||
font-size: 0.875em;
|
||||
color: var(--tainacan-info-color, #555758); }
|
||||
.tainacan-media-component__swiper-main .swiper-slide-content {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
text-align: center; }
|
||||
.tainacan-media-component__swiper-main .swiper-slide-content .tainacan-content-embed {
|
||||
width: 100%;
|
||||
height: auto; }
|
||||
.tainacan-media-component__swiper-main .swiper-slide-content .tainacan-content-embed.tainacan-has-aspect-ratio {
|
||||
max-width: calc((var(--tainacan-media-main-carousel-height, 60vh) * 2) / 1);
|
||||
/* Default to 2:1 aspect ratio. */
|
||||
margin-left: auto;
|
||||
margin-right: auto; }
|
||||
.tainacan-media-component__swiper-main .swiper-slide-content .tainacan-content-embed.tainacan-embed-aspect-21-9 {
|
||||
max-width: calc((var(--tainacan-media-main-carousel-height, 60vh) * 21) / 9); }
|
||||
.tainacan-media-component__swiper-main .swiper-slide-content .tainacan-content-embed.tainacan-embed-aspect-18-9 {
|
||||
max-width: calc((var(--tainacan-media-main-carousel-height, 60vh) * 18) / 9); }
|
||||
.tainacan-media-component__swiper-main .swiper-slide-content .tainacan-content-embed.tainacan-embed-aspect-16-9 {
|
||||
max-width: calc((var(--tainacan-media-main-carousel-height, 60vh) * 16) / 9); }
|
||||
.tainacan-media-component__swiper-main .swiper-slide-content .tainacan-content-embed.tainacan-embed-aspect-4-3 {
|
||||
max-width: calc((var(--tainacan-media-main-carousel-height, 60vh) * 4) / 3); }
|
||||
.tainacan-media-component__swiper-main .swiper-slide-content .tainacan-content-embed.tainacan-embed-aspect-1-1 {
|
||||
max-width: var(--tainacan-media-main-carousel-height, 60vh); }
|
||||
.tainacan-media-component__swiper-main .swiper-slide-content .tainacan-content-embed.tainacan-embed-aspect-3-4 {
|
||||
max-width: calc((var(--tainacan-media-main-carousel-height, 60vh) * 3) / 4); }
|
||||
.tainacan-media-component__swiper-main .swiper-slide-content .tainacan-content-embed.tainacan-embed-aspect-9-16 {
|
||||
max-width: calc((var(--tainacan-media-main-carousel-height, 60vh) * 9) / 16); }
|
||||
.tainacan-media-component__swiper-main .swiper-slide-content .tainacan-content-embed.tainacan-embed-aspect-1-2 {
|
||||
max-width: calc((var(--tainacan-media-main-carousel-height, 60vh) * 1) / 2); }
|
||||
.tainacan-media-component__swiper-main .swiper-slide-content iframe {
|
||||
max-height: var(--tainacan-media-main-carousel-height, 60vh);
|
||||
max-width: 100%;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
border: none;
|
||||
display: block;
|
||||
background-image: url("../images/preloader.gif");
|
||||
background-repeat: no-repeat;
|
||||
background-position: center; }
|
||||
.tainacan-media-component__swiper-main .swiper-slide-content a:first-of-type,
|
||||
.tainacan-media-component__swiper-main .swiper-slide-content p:first-of-type {
|
||||
z-index: 99;
|
||||
background: var(--tainacan-media-background, #ffffff);
|
||||
border-radius: 3px;
|
||||
word-wrap: break-word;
|
||||
padding: 1rem 2rem;
|
||||
display: block; }
|
||||
.tainacan-media-component__swiper-main .swiper-slide-content audio {
|
||||
background: black;
|
||||
min-height: 38px;
|
||||
border-radius: 20px;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
max-height: var(--tainacan-media-main-carousel-height, 60vh); }
|
||||
.tainacan-media-component__swiper-main .swiper-slide-content video {
|
||||
min-height: 56px;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
max-height: var(--tainacan-media-main-carousel-height, 60vh); }
|
||||
.tainacan-media-component__swiper-main .swiper-slide-content img {
|
||||
width: auto;
|
||||
max-height: var(--tainacan-media-main-carousel-height, 60vh); }
|
||||
.tainacan-media-component__swiper-main .swiper-slide-content .twitter-tweet {
|
||||
margin-left: auto;
|
||||
margin-right: auto; }
|
||||
|
||||
.tainacan-media-component__swiper-thumbs {
|
||||
width: 100%;
|
||||
max-width: var(--tainacan-media-thumbs-carousel-width, 100%); }
|
||||
.tainacan-media-component__swiper-thumbs ul.swiper-wrapper {
|
||||
max-width: calc(100% - var(--swiper-navigation-size, 44px) - var(--swiper-navigation-size, 44px));
|
||||
margin: 0 var(--swiper-navigation-size, 44px); }
|
||||
.tainacan-media-component__swiper-thumbs ul.swiper-wrapper[data-pswp-uid]:not([data-pswp-uid='']) li.swiper-slide {
|
||||
cursor: zoom-in; }
|
||||
.tainacan-media-component__swiper-thumbs li.swiper-slide {
|
||||
text-align: center;
|
||||
vertical-align: top;
|
||||
word-break: break-all;
|
||||
font-size: 0.875em;
|
||||
max-width: calc(var(--tainacan-media-thumbs-carousel-item-size, 136px) + 17px); }
|
||||
@media only screen and (max-width: 380px) {
|
||||
.tainacan-media-component__swiper-thumbs li.swiper-slide {
|
||||
margin: 10px 0; } }
|
||||
.tainacan-media-component__swiper-thumbs li.swiper-slide img {
|
||||
width: var(--tainacan-media-thumbs-carousel-item-size, 136px);
|
||||
height: var(--tainacan-media-thumbs-carousel-item-size, 136px);
|
||||
max-width: var(--tainacan-media-thumbs-carousel-item-size, 136px);
|
||||
max-height: var(--tainacan-media-thumbs-carousel-item-size, 136px);
|
||||
object-fit: cover;
|
||||
object-position: center;
|
||||
border-bottom-width: 6px;
|
||||
border-bottom-style: solid;
|
||||
background-color: var(--tainacan-media-background, transparent);
|
||||
border-bottom-color: rgba(255, 255, 255, 0);
|
||||
opacity: 0.85;
|
||||
transition: opacity 0.3s ease, border-bottom-color 0.3s ease; }
|
||||
.tainacan-media-component__swiper-thumbs li.swiper-slide img:focus, .tainacan-media-component__swiper-thumbs li.swiper-slide img:hover {
|
||||
opacity: 0.95;
|
||||
outline: none;
|
||||
border-bottom-color: var(--swiper-theme-color, #298596); }
|
||||
.tainacan-media-component__swiper-thumbs li.swiper-slide.swiper-slide-thumb-active .swiper-slide-metadata__name {
|
||||
font-weight: bold; }
|
||||
.tainacan-media-component__swiper-thumbs li.swiper-slide.swiper-slide-thumb-active img {
|
||||
opacity: 1.0;
|
||||
border-bottom-color: var(--swiper-theme-color, #298596); }
|
||||
.tainacan-media-component__swiper-thumbs li.swiper-slide .swiper-slide-metadata__name {
|
||||
font-size: 1em;
|
||||
color: var(--tainacan-label-color, #454647); }
|
||||
.tainacan-media-component__swiper-thumbs li.swiper-slide .swiper-slide-metadata__caption {
|
||||
font-size: 0.9375em;
|
||||
color: var(--tainacan-input-color, #1d1d1d); }
|
||||
.tainacan-media-component__swiper-thumbs li.swiper-slide .swiper-slide-metadata__caption {
|
||||
font-size: 0.875em;
|
||||
color: var(--tainacan-info-color, #555758); }
|
||||
.tainacan-media-component__swiper-thumbs li.swiper-slide .swiper-slide-metadata {
|
||||
text-align: center;
|
||||
display: block;
|
||||
margin-top: 0.5rem; }
|
||||
.tainacan-media-component__swiper-thumbs li.swiper-slide .swiper-slide-metadata.hide-name .swiper-slide-metadata__name {
|
||||
display: none;
|
||||
visibility: hidden; }
|
||||
.tainacan-media-component__swiper-thumbs li.swiper-slide .swiper-slide-metadata.hide-description .swiper-slide-metadata__description {
|
||||
display: none;
|
||||
visibility: hidden; }
|
||||
.tainacan-media-component__swiper-thumbs li.swiper-slide .swiper-slide-metadata.hide-caption .swiper-slide-metadata__caption {
|
||||
display: none;
|
||||
visibility: hidden; }
|
||||
.tainacan-media-component__swiper-thumbs li.swiper-slide .swiper-slide-metadata.hide-name.hide-description.hide-caption br {
|
||||
display: none;
|
||||
visibility: hidden; }
|
||||
.tainacan-media-component__swiper-thumbs li.swiper-slide a {
|
||||
width: 100%;
|
||||
max-width: var(--tainacan-media-thumbs-carousel-item-size, 136px);
|
||||
text-align: center;
|
||||
word-break: break-word; }
|
||||
.tainacan-media-component__swiper-thumbs li.swiper-slide a,
|
||||
.tainacan-media-component__swiper-thumbs li.swiper-slide a:focus,
|
||||
.tainacan-media-component__swiper-thumbs li.swiper-slide a:hover {
|
||||
outline: none;
|
||||
text-decoration: none;
|
||||
color: var(--tainacan-gray5, #454647); }
|
||||
.tainacan-media-component__swiper-thumbs .swiper-start-border {
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
width: calc(32px + var(--swiper-navigation-size, 44px));
|
||||
background-image: linear-gradient(90deg, var(--tainacan-media-background, #ffffff) 25%, transparent);
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 1; }
|
||||
.tainacan-media-component__swiper-thumbs .swiper-end-border {
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
width: calc(32px + var(--swiper-navigation-size, 44px));
|
||||
background-image: linear-gradient(90deg, transparent, var(--tainacan-media-background, #ffffff) 75%);
|
||||
top: 0;
|
||||
right: 0;
|
||||
z-index: 1; }
|
||||
|
||||
.tainacan-media-component__swiper-main + .tainacan-media-component__swiper-thumbs ul.swiper-wrapper {
|
||||
margin-bottom: 1rem; }
|
||||
.tainacan-media-component__swiper-main + .tainacan-media-component__swiper-thumbs li.swiper-slide {
|
||||
cursor: pointer; }
|
||||
|
||||
.tainacan-photoswipe-layer .pswp__bg {
|
||||
background-color: rgba(0, 0, 0, 0.85); }
|
||||
.tainacan-photoswipe-layer .pswp__ui--fit .pswp__top-bar,
|
||||
.tainacan-photoswipe-layer .pswp__ui--fit .pswp__caption {
|
||||
background-color: rgba(0, 0, 0, 0.7); }
|
||||
.tainacan-photoswipe-layer .pswp__button--arrow--left::before,
|
||||
.tainacan-photoswipe-layer .pswp__button--arrow--right::before {
|
||||
background-color: transparent; }
|
||||
.tainacan-photoswipe-layer .pswp__container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center; }
|
||||
.tainacan-photoswipe-layer .pswp__container .attachment-without-image {
|
||||
width: 100%;
|
||||
height: calc(100% - 44px);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
padding: 44px;
|
||||
margin-top: 22px; }
|
||||
.tainacan-photoswipe-layer .pswp__container .attachment-without-image > iframe:not(.wp-embedded-content) {
|
||||
width: 90vw;
|
||||
height: 90vh;
|
||||
border: none;
|
||||
margin: 44px;
|
||||
display: block;
|
||||
background-image: url("../images/preloader.gif");
|
||||
background-repeat: no-repeat;
|
||||
background-position: center; }
|
||||
.tainacan-photoswipe-layer .pswp__container .pswp__zoom-wrap > iframe#iframePDF {
|
||||
width: 90vw;
|
||||
height: 90vh;
|
||||
border: none;
|
||||
margin: 44px auto;
|
||||
display: block;
|
||||
background-image: url("../images/preloader.gif");
|
||||
background-repeat: no-repeat;
|
||||
background-position: center; }
|
||||
.tainacan-photoswipe-layer .pswp__container .tainacan-content-embed {
|
||||
width: 100%;
|
||||
height: auto; }
|
||||
.tainacan-photoswipe-layer .pswp__container .tainacan-content-embed.tainacan-has-aspect-ratio {
|
||||
max-width: calc((90vh * 2) / 1);
|
||||
/* Default to 2:1 aspect ratio. */
|
||||
margin-left: auto;
|
||||
margin-right: auto; }
|
||||
.tainacan-photoswipe-layer .pswp__container .tainacan-content-embed.tainacan-embed-aspect-21-9 {
|
||||
max-width: calc((90vh * 21) / 9); }
|
||||
.tainacan-photoswipe-layer .pswp__container .tainacan-content-embed.tainacan-embed-aspect-18-9 {
|
||||
max-width: calc((90vh * 18) / 9); }
|
||||
.tainacan-photoswipe-layer .pswp__container .tainacan-content-embed.tainacan-embed-aspect-16-9 {
|
||||
max-width: calc((90vh * 16) / 9); }
|
||||
.tainacan-photoswipe-layer .pswp__container .tainacan-content-embed.tainacan-embed-aspect-4-3 {
|
||||
max-width: calc((90vh * 4) / 3); }
|
||||
.tainacan-photoswipe-layer .pswp__container .tainacan-content-embed.tainacan-embed-aspect-1-1 {
|
||||
max-width: 90vh; }
|
||||
.tainacan-photoswipe-layer .pswp__container .tainacan-content-embed.tainacan-embed-aspect-9-16 {
|
||||
max-width: calc((90vh * 9) / 16); }
|
||||
.tainacan-photoswipe-layer .pswp__container .tainacan-content-embed.tainacan-embed-aspect-1-2 {
|
||||
max-width: calc((90vh * 1) / 2); }
|
||||
.tainacan-photoswipe-layer .pswp__container a:first-of-type,
|
||||
.tainacan-photoswipe-layer .pswp__container p:first-of-type,
|
||||
.tainacan-photoswipe-layer .pswp__container article:first-of-type {
|
||||
z-index: 99;
|
||||
padding: 1rem 4.33337vw;
|
||||
background: var(--tainacan-media-background, #ffffff);
|
||||
border-radius: var(--borderRadius, 3px);
|
||||
word-wrap: break-word; }
|
||||
.tainacan-photoswipe-layer .pswp__container audio {
|
||||
background: black;
|
||||
min-height: 38px;
|
||||
border-radius: 20px; }
|
||||
.tainacan-photoswipe-layer .pswp__container video {
|
||||
min-height: 56px; }
|
||||
.tainacan-photoswipe-layer .pswp__top-bar .pswp__name {
|
||||
color: white;
|
||||
text-align: center;
|
||||
font-size: 1.125em;
|
||||
display: block;
|
||||
height: 44px;
|
||||
max-width: calc(100% - 240px);
|
||||
width: 100%;
|
||||
left: 44px;
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
line-height: 44px;
|
||||
padding: 0 10px; }
|
||||
.tainacan-photoswipe-layer .pswp__figure_caption {
|
||||
font-size: 0.875em;
|
||||
font-style: italic; }
|
||||
.tainacan-photoswipe-layer .pswp__description {
|
||||
font-size: 0.9375em; }
|
||||
.tainacan-photoswipe-layer .pswp__caption__center {
|
||||
text-align: center;
|
||||
font-size: 1em;
|
||||
max-width: 800px; }
|
||||
|
||||
/*# sourceMappingURL=tainacan-gutenberg-block-item-gallery.css.map */
|
File diff suppressed because one or more lines are too long
|
@ -139,10 +139,10 @@
|
|||
display: inline-block; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-button {
|
||||
background-color: var(--tainacan-secondary, rgba(200, 200, 200, 0.3));
|
||||
padding: 0.4em 0.7em;
|
||||
height: 0.95em;
|
||||
padding: 0.45em 0.75em;
|
||||
height: 1em;
|
||||
width: 10%;
|
||||
max-width: 3.25em;
|
||||
max-width: 3.45em;
|
||||
min-width: 1em;
|
||||
margin-left: 6px;
|
||||
border-radius: 3px;
|
||||
|
@ -158,7 +158,8 @@
|
|||
flex: 1 0 auto;
|
||||
margin: 0 2px; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-button.outline {
|
||||
border: 2px solid var(--tainacan-input-border-color rgba(200, 200, 200, 0.3));
|
||||
margin-left: 0px !important;
|
||||
border: 2px solid var(--tainacan-input-border-color, rgba(200, 200, 200, 0.3));
|
||||
background-color: var(--tainacan-background-color, white); }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-button.outline .fake-text {
|
||||
background-color: var(--tainacan-secondary, rgba(200, 200, 200, 0.1)); }
|
||||
|
@ -177,6 +178,27 @@
|
|||
margin-left: 0.5em;
|
||||
width: 24%;
|
||||
max-width: 4em; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-checkbox-confirmation {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0.5em 0.75em 0.25em 0.75em;
|
||||
border: 1px dashed var(--tainacan-input-border-color); }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-checkbox-confirmation .fake-checkbox {
|
||||
border: 2px solid var(--tainacan-info-color, rgba(200, 200, 200, 0.3));
|
||||
height: 0.875em;
|
||||
width: 0.875em;
|
||||
min-height: 0.875em;
|
||||
min-width: 0.875em;
|
||||
max-height: 0.875em;
|
||||
max-width: 0.875em;
|
||||
margin-right: 0.5em;
|
||||
border-radius: 1px;
|
||||
display: inline-block; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-checkbox-confirmation:hover .fake-checkbox, .wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-checkbox-confirmation:hover:focus .fake-checkbox, .wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-checkbox-confirmation:focus-within .fake-checkbox {
|
||||
background-color: var(--tainacan-secondary, rgba(200, 200, 200, 0.1)); }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-checkbox-confirmation .rich-text {
|
||||
margin: 12px 0;
|
||||
padding: 4px 2px; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .documents-section {
|
||||
display: flex;
|
||||
padding: 0.5em; }
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -34,6 +34,7 @@
|
|||
grid-template-columns: repeat(auto-fill, 220px);
|
||||
grid-gap: 0px;
|
||||
justify-content: space-evenly;
|
||||
align-items: flex-start;
|
||||
list-style-type: none; }
|
||||
.wp-block-tainacan-items-list ul.items-list.items-layout-grid li.item-list-item,
|
||||
.wp-block-tainacan-items-list ul.items-list-edit.items-layout-grid li.item-list-item {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"version": 3,
|
||||
"mappings": "AAEA,6BAA8B;EAC1B,MAAM,EAAE,QAAQ;EAGhB,iDAAoB;IAChB,QAAQ,EAAE,QAAQ;IAClB,KAAK,EAAE,CAAC;EAIZ;8EAC+C;IAC3C,OAAO,EAAE,IAAI;IACb,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,CAAC;EAId;4EAC6C;IACzC,qBAAqB,EAAE,wBAAwB;IAC/C,eAAe,EAAE,iBAAiB;IAClC,kBAAkB,EAAE,eAAe;IAEnC;iFAAG;MACC,UAAU,EAAE,YAAY;MACxB,YAAY,EAAE,YAAY;MAC1B,WAAW,EAAE,YAAY;MACzB,MAAM,EAAE,gBAAgB;MAExB;uFAAI;QACA,MAAM,EAAE,gBAAgB;QACxB,aAAa,EAAE,cAAc;EAIzC;oEACqC;IACjC,OAAO,EAAE,CAAC;ICtCd,SAAS,EAAE,IAAI;IACf,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,QAAQ;IACjB,OAAO,EAAE,IAAI;IDqCT,gBAAgB,EAAE,6BAA6B;IAC/C,qBAAqB,EAAE,wBAAwB;IAC/C,QAAQ,EAAE,GAAG;IACb,eAAe,EAAE,YAAY;IAC7B,eAAe,EAAE,IAAI;IAErB;wFAAkB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KAAK,EAAE,OAAO",
|
||||
"sources": ["../../views/gutenberg-blocks/tainacan-blocks/items-list/style.scss","../../views/gutenberg-blocks/gutenberg-blocks-variables.scss"],
|
||||
"mappings": "AAEA,6BAA8B;EAC1B,MAAM,EAAE,QAAQ;EAGhB,iDAAoB;IAChB,QAAQ,EAAE,QAAQ;IAClB,KAAK,EAAE,CAAC;EAIZ;8EAC+C;IAC3C,OAAO,EAAE,IAAI;IACb,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,CAAC;EAId;4EAC6C;IACzC,qBAAqB,EAAE,wBAAwB;IAC/C,eAAe,EAAE,iBAAiB;IAClC,kBAAkB,EAAE,eAAe;IAEnC;iFAAG;MACC,UAAU,EAAE,YAAY;MACxB,YAAY,EAAE,YAAY;MAC1B,WAAW,EAAE,YAAY;MACzB,MAAM,EAAE,gBAAgB;MAExB;uFAAI;QACA,MAAM,EAAE,gBAAgB;QACxB,aAAa,EAAE,cAAc;EAIzC;oEACqC;IACjC,OAAO,EAAE,CAAC;ICtCd,SAAS,EAAE,IAAI;IACf,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,QAAQ;IACjB,OAAO,EAAE,IAAI;IDqCT,gBAAgB,EAAE,6BAA6B;IAC/C,qBAAqB,EAAE,wBAAwB;IAC/C,QAAQ,EAAE,GAAG;IACb,eAAe,EAAE,YAAY;IAC7B,WAAW,EAAE,UAAU;IACvB,eAAe,EAAE,IAAI;IAErB;wFAAkB;MACd,QAAQ,EAAE,QAAQ;MAClB,OAAO,EAAE,KAAK;MACd,MAAM,EAAE,mBAAmB;MAC3B,aAAa,EAAE,IAAI;MACnB,KAAK,EAAE,KAAK;MAEZ;4FAAE;QACE,KAAK,EAAE,OAAO;QACd,MAAM,EAAE,IAAI;QACZ,WAAW,EAAE,IAAI;QACjB,WAAW,EAAE,MAAM;QAEnB;mGAAK;UACD,WAAW,EAAE,MAAM;UACnB,OAAO,EAAE,KAAK;MAItB;8FAAI;QACA,MAAM,EAAE,IAAI;QACZ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E,QAAQ;MAClB,MAAM,EAAE,mBAAmB;MAC3B,aAAa,EAAE,IAAI;MACnB,UAAU,EAAE,IAAI;MAChB,SAAS,EAAE,gBAAgB;MAC3B,KAAK,EAAE,gBAAgB;MAEvB;4FAAE;QACE,KAAK,EAAE,OAAO;QACd,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,MAAM;QACnB,UAAU,EAAE,SAAS;QACrB,UAAU,EAAE,UAAU;MAG1B;8FAAI;QACA,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,IAAI;QACX,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,GAAG;QACZ,YAAY,EAAE,IAAI;MAGtB;mHAAyB;QACrB,OAAO,EAAE,IAAI;MAGjB;;kGACU;QACN,KAAK,EAAE,OAAO;QACd,eAAe,EAAE,IAAI;MAGzB,0CAA2C;QAnC/C;4FAAkB;UAoCV,SAAS,EAAE,gBAAgB;UAC3B,KAAK,EAAE,gBAAgB;MAG3B,0CAA2C;QAxC/C;4FAAkB;UAyCV,SAAS,EAAE,oBAAoB;UAC/B,KAAK,EAAE,oBAAoB;MAG/B,yCAA0C;QA7C9C;4FAAkB;UA8CV,SAAS,EAAE,gBAAgB;UAC3B,KAAK,EAAE,gBAAgB;MAG3B,yCAA0C;QAlD9C;4FAAkB;UAmDV,SAAS,EAAE,iBAAiB;UAC5B,KAAK,EAAE,iBAAiB;;AAOhC;qHACa;EACT,KAAK,EAAE,OAAO",
|
||||
"sources": ["../../views/gutenberg-blocks/blocks/items-list/style.scss","../../views/gutenberg-blocks/scss/gutenberg-blocks-variables.scss"],
|
||||
"names": [],
|
||||
"file": "tainacan-gutenberg-block-items-list.css"
|
||||
}
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
.wp-block-tainacan-related-items {
|
||||
margin: 0.5em auto;
|
||||
width: 100%; }
|
||||
.wp-block-tainacan-related-items .spinner-container {
|
||||
min-height: 56px;
|
||||
padding: 1em;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: var(--tainacan-block-gray4, #555758); }
|
||||
@-webkit-keyframes skeleton-animation {
|
||||
0% {
|
||||
opacity: 1.0; }
|
||||
50% {
|
||||
opacity: 0.2; }
|
||||
100% {
|
||||
opacity: 1.0; } }
|
||||
@-moz-keyframes skeleton-animation {
|
||||
0% {
|
||||
opacity: 1.0; }
|
||||
50% {
|
||||
opacity: 0.2; }
|
||||
100% {
|
||||
opacity: 1.0; } }
|
||||
@-o-keyframes skeleton-animation {
|
||||
0% {
|
||||
opacity: 1.0; }
|
||||
50% {
|
||||
opacity: 0.2; }
|
||||
100% {
|
||||
opacity: 1.0; } }
|
||||
@keyframes skeleton-animation {
|
||||
0% {
|
||||
opacity: 1.0; }
|
||||
50% {
|
||||
opacity: 0.2; }
|
||||
100% {
|
||||
opacity: 1.0; } }
|
||||
.wp-block-tainacan-related-items .skeleton {
|
||||
border-radius: 2px;
|
||||
background: var(--tainacan-block-gray1, #f2f2f2);
|
||||
-webkit-animation: skeleton-animation 1.8s ease infinite;
|
||||
-moz-animation: skeleton-animation 1.8s ease infinite;
|
||||
-o-animation: skeleton-animation 1.8s ease infinite;
|
||||
animation: skeleton-animation 1.8s ease infinite; }
|
||||
.wp-block-tainacan-related-items .related-items-edit-container {
|
||||
position: relative; }
|
||||
.wp-block-tainacan-related-items .related-items-edit-container .skeleton {
|
||||
min-height: 150px; }
|
||||
|
||||
/*# sourceMappingURL=tainacan-gutenberg-block-related-items-list.css.map */
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"version": 3,
|
||||
"mappings": "AAEA,gCAAiC;EAC7B,MAAM,EAAE,UAAU;EAClB,KAAK,EAAE,IAAI;EAGX,mDAAmB;IACf,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE,GAAG;IACZ,OAAO,EAAE,IAAI;IACb,eAAe,EAAE,MAAM;IACvB,WAAW,EAAE,MAAM;IACnB,KAAK,EAAE,oCAAmC;AAI9C,qCAIC;EAHG,EAAE;IAAC,OAAO,EAAE,GAAG;EACf,GAAG;IAAC,OAAO,EAAE,GAAG;EAChB,IAAI;IAAC,OAAO,EAAE,GAAG;AAErB,kCAIC;EAHG,EAAE;IAAC,OAAO,EAAE,GAAG;EACf,GAAG;IAAC,OAAO,EAAE,GAAG;EAChB,IAAI;IAAC,OAAO,EAAE,GAAG;AAErB,gCAIC;EAHG,EAAE;IAAC,OAAO,EAAE,GAAG;EACf,GAAG;IAAC,OAAO,EAAE,GAAG;EAChB,IAAI;IAAC,OAAO,EAAE,GAAG;AAErB,6BAIC;EAHG,EAAE;IAAC,OAAO,EAAE,GAAG;EACf,GAAG;IAAC,OAAO,EAAE,GAAG;EAChB,IAAI;IAAC,OAAO,EAAE,GAAG;EAErB,0CAAU;IACN,aAAa,EAAE,GAAG;IAClB,UAAU,EAAE,oCAAmC;IAE/C,iBAAiB,EAAE,qCAAqC;IACxD,cAAc,EAAE,qCAAqC;IACrD,YAAY,EAAE,qCAAqC;IACnD,SAAS,EAAE,qCAAqC;EAIpD,8DAA8B;IAC1B,QAAQ,EAAE,QAAQ;IAElB,wEAAY;MACR,UAAU,EAAE,KAAK",
|
||||
"sources": ["../../views/gutenberg-blocks/blocks/related-items-list/style.scss"],
|
||||
"names": [],
|
||||
"file": "tainacan-gutenberg-block-related-items-list.css"
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"version": 3,
|
||||
"mappings": "AAEA,yCAA0C;EACtC,MAAM,EAAE,IAAI;EACZ,eAAe,EAAE,MAAM;;AAE3B,6BAA8B;EAC1B,MAAM,EAAE,QAAQ;EAEhB,wDAA2B;IACvB,KAAK,EAAE,IAAI;IAEX,mFAA2B;MACvB,MAAM,EAAE,GAAG;MACX,SAAS,EAAE,IAAI;MACf,OAAO,EAAE,IAAI;MACb,eAAe,EAAE,MAAM;MACvB,WAAW,EAAE,OAAO;MACpB,MAAM,EAAE,MAAM;MACd,MAAM,EAAE,8CAA6C;MACrD,UAAU,EAAE,sBAA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eAAe,EAAE,aAAa;MAE9B,0HAAoC;QAAE,UAAU,EAAE,IAAI;IAG1D,yGAAoC;MAChC,KAAK,EAAE,IAAI;MACX,KAAK,EAAE,KAAK;MAEZ,4GAAG;QACC,MAAM,EAAE,MAAM;QACd,eAAe,EAAE,IAAI;QACrB,SAAS,EAAE,KAAK;QAChB,WAAW,EAAE,KAAK;QAClB,aAAa,EAAE,QAAQ;QACvB,KAAK,EAAE,OAAO;QACd,kHAAQ;UACJ,eAAe,EAAE,IAAI;MAG7B,oHAAW;QACP,KAAK,EAAE,OAAO;QACd,KAAK,EAAE,IAAI;QACX,OAAO,EAAE,KAAK;QACd,UAAU,EAAE,IAAI;QAChB,WAAW,EAAE,MAAM;QACnB,SAAS,EAAE,GAAG;IAItB,0CAA2C;MACvC,yGAAoC;QAChC,aAAa,EAAE,GAAG",
|
||||
"sources": ["../../views/gutenberg-blocks/tainacan-blocks/search-bar/style.scss"],
|
||||
"sources": ["../../views/gutenberg-blocks/blocks/search-bar/style.scss"],
|
||||
"names": [],
|
||||
"file": "tainacan-gutenberg-block-search-bar.css"
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"version": 3,
|
||||
"mappings": "AAEA,6BAA8B;EAC1B,MAAM,EAAE,QAAQ;EAGhB,iDAAoB;IAChB,QAAQ,EAAE,QAAQ;IAClB,KAAK,EAAE,CAAC;EAIZ;8EAC+C;IAC3C,OAAO,EAAE,IAAI;IACb,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,CAAC;EAId;oEACqC;IACjC,OAAO,EAAE,CAAC;ICpBd,SAAS,EAAE,IAAI;IACf,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,QAAQ;IACjB,OAAO,EAAE,IAAI;IDmBT,gBAAgB,EAAE,6BAA6B;IAC/C,qBAAqB,EAAE,wBAAwB;IAC/C,QAAQ,EAAE,GAAG;IACb,eAAe,EAAE,YAAY;IAC7B,eAAe,EAAE,IAAI;IAErB;wFAAkB;MAC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list/style.scss","../../views/gutenberg-blocks/gutenberg-blocks-variables.scss"],
|
||||
"sources": ["../../views/gutenberg-blocks/blocks/terms-list/style.scss","../../views/gutenberg-blocks/scss/gutenberg-blocks-variables.scss"],
|
||||
"names": [],
|
||||
"file": "tainacan-gutenberg-block-terms-list.css"
|
||||
}
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
#tainacan-reports-app {
|
||||
padding: 10px 2px 10px 2px;
|
||||
margin: 0; }
|
||||
#tainacan-reports-app .tainacan-icon::before {
|
||||
opacity: 0.0; }
|
||||
#tainacan-reports-app a:hover {
|
||||
cursor: pointer; }
|
||||
#tainacan-reports-app .tainacan-reports-header {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"version": 3,
|
||||
"mappings": "AAAA,qBAAsB;EAClB,OAAO,EAAE,iBAAiB;EAC1B,MAAM,EAAE,CAAC;EAGT,4CAAuB;IACnB,OAAO,EAAE,GAAG;EAGhB,6BAAQ;IACJ,MAAM,EAAE,OAAO;EAGnB,8CAAyB;IACrB,OAAO,EAAE,IAAI;IACb,eAAe,EAAE,aAAa;IAC9B,WAAW,EAAE,MAAM;IACnB,MAAM,EAAE,kBAAkB;IAE1B,iEAAmB;MACf,MAAM,EAAE,IAAI;IAGhB,qDAAO;MACH,YAAY,EAAE,IAAI;MAClB,WAAW,EAAE,GAAG;EAGxB,iDAA4B;IACxB,OAAO,EAAE,IAAI;IACb,WAAW,EAAE,MAAM;IACnB,MAAM,EAAE,gBAAgB;IACxB,KAAK,EAAE,oCAAoC;IAE3C,mGAAkD;MAC9C,YAAY,EAAE,IAAI;MAClB,WAAW,EAAE,8CAA8C;IAG/D,wFAAuC;MACnC,WAAW,EAAE,IAAI;MACjB,WAAW,EAAE,GAAG;IAGpB,0FAAyC;MACrC,OAAO,EAAE,IAAI;MACb,WAAW,EAAE,MAAM;MACnB,MAAM,EAAE,gBAAgB;MACxB,SAAS,EAAE,IAAI;MAEf,kJAA0D;QACtD,UAAU,EAAE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AEf,4DAAkB;QACd,aAAa,EAAE,IAAI;QACnB,WAAW,EAAE,IAAI;EAK7B,gDAA2B;IACvB,OAAO,EAAE,IAAI;IACb,WAAW,EAAE,MAAM;IACnB,eAAe,EAAE,MAAM;IACvB,OAAO,EAAE,IAAI;IACb,UAAU,EAAE,KAAK;IACjB,cAAc,EAAE,MAAM;IACtB,OAAO,EAAE,IAAI;IAEb,kDAAE;MACE,KAAK,EAAE,oCAAoC;EAInD,wCAAmB;IACf,OAAO,EAAE,YAAY;IACrB,+CAAO;MACH,MAAM,EAAE,eAAe;MACvB,UAAU,EAAE,eAAe;MAC3B,UAAU,EAAE,eAAe;MAC3B,OAAO,EAAE,CAAC;MACV,MAAM,EAAE,OAAO;MAEf,uDAAU;QACN,KAAK,EAAE,oCAAoC;EAKvD,8CAAyB;IACrB,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,IAAI;IACb,eAAe,EAAE,MAAM;IACvB,WAAW,EAAE,UAAU;IACvB,cAAc,EAAE,MAAM;IAEtB,+EAAiC;MAC7B,gBAAgB,EAAE,oCAAoC;MACtD,OAAO,EAAE,IAAI;MACb,eAAe,EAAE,UAAU;MAC3B,WAAW,EAAE,MAAM;MACnB,KAAK,EAAE,IAAI;MACX,OAAO,EAAE,iBAAiB;IAG9B,gHAAgE;MAC5D,OAAO,EAAE,iBAAiB;IAE9B,6EAA+B;MAC3B,KAAK,EAAE,IAAI;MACX,OAAO,EAAE,QAAQ;MACjB,OAAO,EAAE,IAAI;MACb,eAAe,EAAE,MAAM;MACvB,WAAW,EAAE,UAAU;MACvB,cAAc,EAAE,MAAM;MAEtB,+EAAE;QACE,aAAa,EAAE,GAAG;QAClB,SAAS,EAAE,OAAO;EAK9B,+CAA0B;IACtB,OAAO,EAAE,IAAI;IACb,WAAW,EAAE,MAAM",
|
||||
"sources": ["../../views/reports/tainacan-reports.scss"],
|
||||
"names": [],
|
||||
"file": "tainacan-reports.css"
|
||||
|
|
|
@ -375,7 +375,7 @@ class REST_Controller extends \WP_REST_Controller {
|
|||
);
|
||||
|
||||
$query_params['paged'] = array(
|
||||
'description' => __("The results page to be return.", 'tainacan'),
|
||||
'description' => __("The results page to be returned.", 'tainacan'),
|
||||
'type' => 'integer',
|
||||
);
|
||||
|
||||
|
|
|
@ -246,7 +246,7 @@ class REST_Background_Processes_Controller extends REST_Controller {
|
|||
|
||||
if ( !isset($body['status']) || ($body['status'] != 'open' && $body['status'] != 'closed') ) {
|
||||
return new \WP_REST_Response([
|
||||
'error_message' => __('Status must be informed', 'tainacan' ),
|
||||
'error_message' => __('Status must be specified', 'tainacan' ),
|
||||
'session_id' => $id
|
||||
], 400);
|
||||
}
|
||||
|
|
|
@ -210,7 +210,7 @@ class REST_Bulkedit_Controller extends REST_Controller {
|
|||
'args' => [
|
||||
'value' => [
|
||||
'type' => 'string',
|
||||
'description' => __( 'The new coments status (open or close)', 'tainacan' ),
|
||||
'description' => __( 'The new comments status (open or closed)', 'tainacan' ),
|
||||
],
|
||||
],
|
||||
),
|
||||
|
@ -265,7 +265,7 @@ class REST_Bulkedit_Controller extends REST_Controller {
|
|||
];
|
||||
} else {
|
||||
return new \WP_REST_Response([
|
||||
'error_message' => __('You mus specify items_ids OR use_query', 'tainacan'),
|
||||
'error_message' => __('You must specify items_ids OR use_query', 'tainacan'),
|
||||
], 400);
|
||||
}
|
||||
|
||||
|
@ -352,7 +352,7 @@ class REST_Bulkedit_Controller extends REST_Controller {
|
|||
if ( !in_array($method, ['trash_items', 'untrash_items', 'delete_items']) ) {
|
||||
if (empty($body)) {
|
||||
return new \WP_REST_Response([
|
||||
'error_message' => __('Body can not be empty.', 'tainacan'),
|
||||
'error_message' => __('Body cannot be empty.', 'tainacan'),
|
||||
], 400);
|
||||
}
|
||||
|
||||
|
@ -448,4 +448,4 @@ class REST_Bulkedit_Controller extends REST_Controller {
|
|||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -31,6 +31,7 @@ class REST_Collections_Controller extends REST_Controller {
|
|||
*/
|
||||
public function init_objects() {
|
||||
$this->collections_repository = Repositories\Collections::get_instance();
|
||||
$this->items_repository = Repositories\Items::get_instance();
|
||||
$this->collection = new Entities\Collection();
|
||||
}
|
||||
|
||||
|
@ -87,7 +88,7 @@ class REST_Collections_Controller extends REST_Controller {
|
|||
'permission_callback' => array($this, 'update_metadata_order_permissions_check'),
|
||||
'args' => [
|
||||
'metadata_order' => [
|
||||
'description' => __( 'The order of the metadata in the collection, an array of objects with integer id and bool enabled.', 'tainacan' ),
|
||||
'description' => __( 'The order of the metadata in the collection, an array of objects with integer ID and bool enabled.', 'tainacan' ),
|
||||
'required' => true,
|
||||
'validate_callback' => [$this, 'validate_filters_metadata_order']
|
||||
]
|
||||
|
@ -102,7 +103,7 @@ class REST_Collections_Controller extends REST_Controller {
|
|||
'permission_callback' => array($this, 'update_filters_order_permissions_check'),
|
||||
'args' => [
|
||||
'filters_order' => [
|
||||
'description' => __( 'The order of the filters in the collection, an array of objects with integer id and bool enabled.', 'tainacan' ),
|
||||
'description' => __( 'The order of the filters in the collection, an array of objects with integer ID and bool enabled.', 'tainacan' ),
|
||||
'required' => true,
|
||||
'validate_callback' => [$this, 'validate_filters_metadata_order']
|
||||
]
|
||||
|
@ -178,6 +179,38 @@ class REST_Collections_Controller extends REST_Controller {
|
|||
return new \WP_REST_Response($response, 200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Tainacan\Entities\Collection $collection
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function get_preview_image_items($collection, $amount) {
|
||||
if($amount <= 0 )
|
||||
return [];
|
||||
|
||||
$collection_id = $collection->get_id();
|
||||
|
||||
$args = [
|
||||
'meta_query' => [
|
||||
[
|
||||
'key' => 'collection_id',
|
||||
'value' => $collection_id
|
||||
]
|
||||
],
|
||||
'posts_per_page' => $amount
|
||||
];
|
||||
|
||||
$items = $this->items_repository->fetch($args, [], 'OBJECT');
|
||||
$thumbnails = array_map( function($item) {
|
||||
$images = array();
|
||||
$images['thumbnail'] = $item->get_thumbnail();
|
||||
$images['document_mimetype'] = $item->get_document_mimetype();
|
||||
return $images;
|
||||
}, $items);
|
||||
|
||||
return $thumbnails;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Receive a \WP_Query or a Collection object and return both in JSON
|
||||
|
@ -242,6 +275,10 @@ class REST_Collections_Controller extends REST_Controller {
|
|||
$item_arr['url'] = get_permalink( $item_arr['id'] );
|
||||
}
|
||||
|
||||
if(isset($request['fetch_preview_image_items']) && $request['fetch_preview_image_items'] != 0) {
|
||||
$item_arr['preview_image_items'] = $this->get_preview_image_items($item, $request['fetch_preview_image_items']);
|
||||
}
|
||||
|
||||
$total_items = wp_count_posts( $item->get_db_identifier(), 'readable' );
|
||||
|
||||
if (isset($total_items->publish) ||
|
||||
|
@ -353,7 +390,7 @@ class REST_Collections_Controller extends REST_Controller {
|
|||
|
||||
if(empty($body)){
|
||||
return new \WP_REST_Response([
|
||||
'error_message' => __('Body can not be empty.', 'tainacan'),
|
||||
'error_message' => __('Body cannot be empty.', 'tainacan'),
|
||||
'collection' => $body
|
||||
], 400);
|
||||
}
|
||||
|
|
|
@ -120,7 +120,7 @@ class REST_Exporters_Controller extends REST_Controller {
|
|||
|
||||
if(empty($body)) {
|
||||
return new \WP_REST_Response([
|
||||
'error_message' => __('Body can not be empty.', 'tainacan'),
|
||||
'error_message' => __('Body cannot be empty.', 'tainacan'),
|
||||
], 400);
|
||||
}
|
||||
$slug = $body['exporter_slug'];
|
||||
|
@ -187,7 +187,7 @@ class REST_Exporters_Controller extends REST_Controller {
|
|||
}
|
||||
|
||||
return new \WP_REST_Response([
|
||||
'error_message' => __('The body can not be empty', 'tainacan'),
|
||||
'error_message' => __('The body cannot be empty', 'tainacan'),
|
||||
'body' => $body
|
||||
], 400);
|
||||
}
|
||||
|
|
|
@ -71,7 +71,10 @@ class REST_Facets_Controller extends REST_Controller {
|
|||
$collection_id = ( isset($request['collection_id']) ) ? $request['collection_id'] : null;
|
||||
$last_term = ( isset($request['last_term']) ) ? $request['last_term'] : '';
|
||||
|
||||
$query_args = defined('TAINACAN_FACETS_DISABLE_FILTER_ITEMS') && true === TAINACAN_FACETS_DISABLE_FILTER_ITEMS ? [] : $request['current_query'];
|
||||
$query_args = $request['current_query'];
|
||||
if(defined('TAINACAN_FACETS_DISABLE_FILTER_ITEMS') && true === TAINACAN_FACETS_DISABLE_FILTER_ITEMS) {
|
||||
$query_args = is_user_logged_in() && is_admin() ? ["status" => ["publish", "private", "draft"]] : [];
|
||||
}
|
||||
$query_args = $this->prepare_filters($query_args);
|
||||
|
||||
if ( isset($request['hideempty']) && $request['hideempty'] == 0 ) {
|
||||
|
|
|
@ -57,7 +57,7 @@ class REST_Importers_Controller extends REST_Controller {
|
|||
],
|
||||
'collection' => [
|
||||
'type' => ['array','object'],
|
||||
'description' => __( 'The array describing the destination collectino as expected by the importer', 'tainacan' ),
|
||||
'description' => __( 'The array describing the destination collection as expected by the importer', 'tainacan' ),
|
||||
],
|
||||
'options' => [
|
||||
'type' => ['array', 'object'],
|
||||
|
@ -155,7 +155,7 @@ class REST_Importers_Controller extends REST_Controller {
|
|||
|
||||
if(empty($body)){
|
||||
return new \WP_REST_Response([
|
||||
'error_message' => __('Body can not be empty.', 'tainacan'),
|
||||
'error_message' => __('Body cannot be empty.', 'tainacan'),
|
||||
], 400);
|
||||
}
|
||||
|
||||
|
@ -234,7 +234,7 @@ class REST_Importers_Controller extends REST_Controller {
|
|||
}
|
||||
|
||||
return new \WP_REST_Response([
|
||||
'error_message' => __('The body can not be empty', 'tainacan'),
|
||||
'error_message' => __('The body cannot be empty', 'tainacan'),
|
||||
'body' => $body
|
||||
], 400);
|
||||
}
|
||||
|
|
|
@ -38,6 +38,8 @@ class REST_Items_Controller extends REST_Controller {
|
|||
$this->collections_repository = Repositories\Collections::get_instance();
|
||||
$this->metadatum_repository = Repositories\Metadata::get_instance();
|
||||
$this->terms_repository = \Tainacan\Repositories\Terms::get_instance();
|
||||
$this->filters_repository = \Tainacan\Repositories\Filters::get_instance();
|
||||
$this->taxonomies_repository = \Tainacan\Repositories\Taxonomies::get_instance();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -126,7 +128,7 @@ class REST_Items_Controller extends REST_Controller {
|
|||
'type' => 'integer'
|
||||
),
|
||||
'status' => array(
|
||||
'description' => __('Try to assign the informed status to the duplicates if they validate. By default it will save them as drafts.', 'tainacan'),
|
||||
'description' => __('Try to assign the specified status to the duplicates if they validate. By default it will save them as drafts.', 'tainacan'),
|
||||
'type' => 'string'
|
||||
),
|
||||
)
|
||||
|
@ -364,7 +366,7 @@ class REST_Items_Controller extends REST_Controller {
|
|||
$args['post_parent'] = $item_id;
|
||||
$args['post_type'] = 'attachment';
|
||||
$args['post_status'] = 'any';
|
||||
|
||||
|
||||
unset($args['perm']);
|
||||
|
||||
$posts_query = new \WP_Query();
|
||||
|
@ -408,6 +410,163 @@ class REST_Items_Controller extends REST_Controller {
|
|||
return $rest_response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $args — array of query arguments.
|
||||
*
|
||||
* @return array
|
||||
* @throws \Exception
|
||||
*/
|
||||
private function prepare_filters_arguments ( $args, $collection_id = false ) {
|
||||
$filters_arguments = array();
|
||||
$meta_query = isset($args['meta_query']) ? $args['meta_query'] : [];
|
||||
$tax_query = isset($args['tax_query']) ? $args['tax_query'] : [];
|
||||
|
||||
foreach($tax_query as $tax) {
|
||||
|
||||
$taxonomy = $tax['taxonomy'];
|
||||
$taxonomy_id = $this->taxonomies_repository->get_id_by_db_identifier($taxonomy);
|
||||
$terms_id = is_array($tax['terms']) ? $tax['terms']: [$tax['terms']];
|
||||
$terms_name = array_map(function($term_id) {
|
||||
$t = is_numeric($term_id) ? get_term($term_id) : get_term_by('slug', $term_id);
|
||||
return $t != false ? $t->name : '--';
|
||||
}, $terms_id);
|
||||
|
||||
$metas = $this->metadatum_repository->fetch(array(
|
||||
'meta_query' => [
|
||||
[
|
||||
'key' => 'collection_id',
|
||||
'value' => empty($collection_id) ? 'default' : $collection_id,
|
||||
'compare' => '='
|
||||
],
|
||||
[
|
||||
'key' => '_option_taxonomy_id',
|
||||
'value' => $taxonomy_id,
|
||||
'compate' => '='
|
||||
]
|
||||
]
|
||||
), 'OBJECT' );
|
||||
|
||||
if( !empty($metas) ) {
|
||||
$meta_query[] = array(
|
||||
'key' => $metas[0]->get_id(),
|
||||
'value' => $terms_id,
|
||||
'label' => $terms_name,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
foreach($meta_query as $meta) {
|
||||
|
||||
if ( !isset($meta['key']) || !isset($meta['value']) )
|
||||
continue;
|
||||
|
||||
$meta_id = $meta['key'];
|
||||
$meta_value = is_array($meta['value']) ? $meta['value'] : [$meta['value']];
|
||||
$meta_label = isset($meta['label']) ? $meta['label'] : $meta_value;
|
||||
$filter_type_component = false;
|
||||
$arg_type = 'meta';
|
||||
$f = false;
|
||||
$m = false;
|
||||
|
||||
if ($meta_id === 'collection_id') {
|
||||
|
||||
$arg_type = 'collection';
|
||||
$meta_label = array_map(function($collection_id) {
|
||||
$collection = $this->collections_repository->fetch($collection_id);
|
||||
return $collection->get_name();
|
||||
}, $meta_value);
|
||||
|
||||
} else {
|
||||
|
||||
$filter = $this->filters_repository->fetch([
|
||||
'meta_query' => array(
|
||||
[
|
||||
'key' => 'metadatum_id',
|
||||
'value' => $meta_id,
|
||||
'compare' => '='
|
||||
]
|
||||
)
|
||||
], 'OBJECT'
|
||||
);
|
||||
|
||||
if ( !empty($filter) ) {
|
||||
$f = $filter[0]->_toArray();
|
||||
$filter_type_component = $filter[0]->get_filter_type_object()->get_component();
|
||||
$m = $f['metadatum'];
|
||||
} else {
|
||||
$metadatum = $this->metadatum_repository->fetch($meta_id, 'OBJECT');
|
||||
if(!empty($metadatum)) {
|
||||
$m = $metadatum->_toArray();
|
||||
$meta_object = $metadatum->get_metadata_type_object();
|
||||
if (is_object($meta_object)) {
|
||||
$m['metadata_type_object'] = $meta_object->_toArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($m !== false) {
|
||||
switch ($m['metadata_type_object']['primitive_type']) {
|
||||
case 'date':
|
||||
$meta_label = array_map(function($date) {
|
||||
$date_format = get_option( 'date_format' ) != false ? get_option( 'date_format' ) : 'Y-m-d';
|
||||
return empty($date) == false ? mysql2date($date_format, $date) : "";
|
||||
}, $meta_label);
|
||||
break;
|
||||
case 'item':
|
||||
$meta_label = array_map(function($item_id) {
|
||||
$_post = get_post($item_id);
|
||||
if ( ! $_post instanceof \WP_Post) {
|
||||
return;
|
||||
}
|
||||
return $_post->post_title;
|
||||
}, $meta_label);
|
||||
break;
|
||||
case 'control':
|
||||
$control_metadatum = $m['metadata_type_object']['options']['control_metadatum'];
|
||||
$metadata_type_object = new \Tainacan\Metadata_Types\Control();
|
||||
$meta_label = array_map(function($control_value) use ($metadata_type_object, $control_metadatum) {
|
||||
return $metadata_type_object->get_control_metadatum_value($control_value, $control_metadatum, 'string' );
|
||||
}, $meta_label);
|
||||
break;
|
||||
case 'user':
|
||||
$meta_label = array_map(function($user_id) {
|
||||
$name = get_the_author_meta( 'display_name', $user_id );
|
||||
return apply_filters("tainacan-item-get-author-name", $name);
|
||||
}, $meta_label);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$filter_name = is_string($filter_type_component)
|
||||
? "tainacan-api-items-${filter_type_component}-filter-arguments"
|
||||
: 'tainacan-api-items-filter-arguments';
|
||||
|
||||
$filters_arguments[] = apply_filters($filter_name, array(
|
||||
'filter' => $f,
|
||||
'metadatum' => $m,
|
||||
'arg_type' => $arg_type,
|
||||
'value' => $meta_value,
|
||||
'label' => $meta_label,
|
||||
'compare' => isset($meta['compare']) ? $meta['compare'] : '='
|
||||
));
|
||||
}
|
||||
|
||||
if (isset($args['post__in'])) {
|
||||
$filters_arguments[] = array(
|
||||
'filter' => false,
|
||||
'metadatum' => false,
|
||||
'arg_type' => 'postin',
|
||||
'value' => $args['post__in'],
|
||||
'label' => count($args['post__in']),
|
||||
'compare' => 'IN'
|
||||
);
|
||||
}
|
||||
|
||||
return $filters_arguments;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \WP_REST_Request $request
|
||||
*
|
||||
|
@ -436,6 +595,7 @@ class REST_Items_Controller extends REST_Controller {
|
|||
if($request['collection_id']) {
|
||||
$collection_id = $request['collection_id'];
|
||||
}
|
||||
$filters_args = $this->prepare_filters_arguments($args, $collection_id);
|
||||
|
||||
$max_items_per_page = $TAINACAN_API_MAX_ITEMS_PER_PAGE;
|
||||
if ( $max_items_per_page > -1 ) {
|
||||
|
@ -454,6 +614,7 @@ class REST_Items_Controller extends REST_Controller {
|
|||
|
||||
// Filter right after the ->fetch() method. Elastic Search integration relies on this on its 'last_aggregations' hook
|
||||
$response['filters'] = apply_filters('tainacan-api-items-filters-response', [], $request);
|
||||
$response['filters_arguments'] = apply_filters('tainacan-api-items-filters-arguments-response', $filters_args, $args);
|
||||
|
||||
$query_end = microtime(true);
|
||||
|
||||
|
@ -637,7 +798,7 @@ class REST_Items_Controller extends REST_Controller {
|
|||
|
||||
if(empty($item)){
|
||||
return new \WP_REST_Response([
|
||||
'error_message' => __('Body can not be empty.', 'tainacan'),
|
||||
'error_message' => __('Body cannot be empty.', 'tainacan'),
|
||||
'item' => $item
|
||||
], 400);
|
||||
}
|
||||
|
@ -885,7 +1046,7 @@ class REST_Items_Controller extends REST_Controller {
|
|||
|
||||
}
|
||||
|
||||
private function submission_item_metadada ( \Tainacan\Entities\Item_Metadata_Entity &$item_metadata, $request) {
|
||||
private function submission_item_metadata ( \Tainacan\Entities\Item_Metadata_Entity &$item_metadata, $request) {
|
||||
$collection_id = $item_metadata->get_item()->get_collection_id();
|
||||
$item = $item_metadata->get_item();
|
||||
$collection = $this->collections_repository->fetch($collection_id);
|
||||
|
@ -964,7 +1125,7 @@ class REST_Items_Controller extends REST_Controller {
|
|||
|
||||
if(empty($item) || empty($metadata)) {
|
||||
return new \WP_REST_Response([
|
||||
'error_message' => __('Body can not be empty.', 'tainacan'),
|
||||
'error_message' => __('Body cannot be empty.', 'tainacan'),
|
||||
'item' => $item
|
||||
], 400);
|
||||
}
|
||||
|
@ -972,6 +1133,10 @@ class REST_Items_Controller extends REST_Controller {
|
|||
try {
|
||||
$item['status'] = 'auto-draft';
|
||||
$item = $this->prepare_item_for_database( [ $item, $collection_id ] );
|
||||
$data = apply_filters('tainacan-submission-item-data', $item, $metadata);
|
||||
if ( \is_null($data) === false ) {
|
||||
$item = $data;
|
||||
}
|
||||
|
||||
if ( $item->validate() ) {
|
||||
$item = $this->items_repository->insert( $item );
|
||||
|
@ -998,7 +1163,7 @@ class REST_Items_Controller extends REST_Controller {
|
|||
$metadatum_child = $this->metadatum_repository->fetch( $child['metadatum_id'] );
|
||||
$item_metadata_child = new Entities\Item_Metadata_Entity($item, $metadatum_child, null, $parent_meta_id);
|
||||
$item_metadata_child->set_value($child_value);
|
||||
$item_metadata_child = $this->submission_item_metadada($item_metadata_child, $request);
|
||||
$item_metadata_child = $this->submission_item_metadata($item_metadata_child, $request);
|
||||
if ($item_metadata_child instanceof \WP_REST_Response) {
|
||||
return $item_metadata_child;
|
||||
}
|
||||
|
@ -1020,10 +1185,10 @@ class REST_Items_Controller extends REST_Controller {
|
|||
$metadatum_child = $this->metadatum_repository->fetch( $child['metadatum_id'] );
|
||||
$item_metadata_child = new Entities\Item_Metadata_Entity($item, $metadatum_child, null, $parent_meta_id);
|
||||
$item_metadata_child->set_value($child_value);
|
||||
$item_metadata_child = $this->submission_item_metadada($item_metadata_child, $request);
|
||||
$item_metadata_child = $this->submission_item_metadata($item_metadata_child, $request);
|
||||
if ($item_metadata_child instanceof \WP_REST_Response) {
|
||||
return $item_metadata_child;
|
||||
}
|
||||
}
|
||||
$parent_meta_id = $item_metadata_child->get_parent_meta_id();
|
||||
}
|
||||
}
|
||||
|
@ -1042,7 +1207,7 @@ class REST_Items_Controller extends REST_Controller {
|
|||
} else {
|
||||
$item_metadata->set_value( is_array($value) ? implode(' ', $value) : $value);
|
||||
}
|
||||
$item_metadata = $this->submission_item_metadada($item_metadata, $request);
|
||||
$item_metadata = $this->submission_item_metadata($item_metadata, $request);
|
||||
if ($item_metadata instanceof \WP_REST_Response) {
|
||||
return $item_metadata;
|
||||
}
|
||||
|
@ -1057,7 +1222,7 @@ class REST_Items_Controller extends REST_Controller {
|
|||
} else {
|
||||
$item_metadata->set_value( is_array($value) ? implode(' ', $value) : $value);
|
||||
}
|
||||
$item_metadata = $this->submission_item_metadada($item_metadata, $request);
|
||||
$item_metadata = $this->submission_item_metadata($item_metadata, $request);
|
||||
if ($item_metadata instanceof \WP_REST_Response) {
|
||||
return $item_metadata;
|
||||
}
|
||||
|
@ -1076,10 +1241,10 @@ class REST_Items_Controller extends REST_Controller {
|
|||
} else {
|
||||
$this->submission_rollback_new_terms();
|
||||
return new \WP_REST_Response([
|
||||
'error_message' => __('unable create submission ID.', 'tainacan'),
|
||||
'error_message' => __('unable to create submission ID.', 'tainacan'),
|
||||
], 400);
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
$this->submission_rollback_new_terms();
|
||||
return new \WP_REST_Response([
|
||||
|
@ -1109,7 +1274,7 @@ class REST_Items_Controller extends REST_Controller {
|
|||
$item_id = get_transient('tnc_transient_submission_' . $submission_id);
|
||||
if($item_id === false) {
|
||||
return new \WP_REST_Response([
|
||||
'error_message' => __('submission ID not exist.', 'tainacan'),
|
||||
'error_message' => __('submission ID does not exist.', 'tainacan'),
|
||||
], 400);
|
||||
}
|
||||
$this->new_terms_ids = get_transient('tnc_transient_submission_' . $submission_id . '_new_terms_ids');
|
||||
|
@ -1118,7 +1283,7 @@ class REST_Items_Controller extends REST_Controller {
|
|||
$collection = $this->collections_repository->fetch($collection_id);
|
||||
$default_status = $collection->get_submission_default_status();
|
||||
$item->set_status($default_status);
|
||||
|
||||
|
||||
$TainacanMedia = \Tainacan\Media::get_instance();
|
||||
$files = $request->get_file_params();
|
||||
|
||||
|
|
|
@ -266,7 +266,7 @@ class REST_Metadata_Controller extends REST_Controller {
|
|||
}
|
||||
|
||||
return new \WP_REST_Response([
|
||||
'error_message' => __('Body can not be empty.', 'tainacan'),
|
||||
'error_message' => __('Body cannot be empty.', 'tainacan'),
|
||||
'item' => $request->get_body()
|
||||
], 400);
|
||||
|
||||
|
|
|
@ -167,7 +167,7 @@ class REST_Metadatum_Mappers_Controller extends REST_Controller {
|
|||
}
|
||||
}
|
||||
return new \WP_REST_Response([
|
||||
'error_message' => __('Body can not be empty.', 'tainacan'),
|
||||
'error_message' => __('Body cannot be empty.', 'tainacan'),
|
||||
'item' => $request->get_body()
|
||||
], 400);
|
||||
}
|
||||
|
|
|
@ -503,7 +503,7 @@ class REST_Reports_Controller extends REST_Controller {
|
|||
$metadatum_type = $metadatum->get_metadata_type();
|
||||
if($metadatum_type != 'Tainacan\Metadata_Types\Taxonomy') {
|
||||
return new \WP_REST_Response([
|
||||
'error_message' => __('Only taxonomy metadata type has allowed.', 'tainacan'),
|
||||
'error_message' => __('Only taxonomy metadata type is allowed.', 'tainacan'),
|
||||
'metadatum_type' => $metadatum_type
|
||||
], 400);
|
||||
}
|
||||
|
@ -868,4 +868,4 @@ class REST_Reports_Controller extends REST_Controller {
|
|||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -104,7 +104,7 @@ class REST_Sequence_Edit_Controller extends REST_Controller {
|
|||
} else {
|
||||
|
||||
return new \WP_REST_Response([
|
||||
'error_message' => __('You mus specify items_ids OR use_query', 'tainacan'),
|
||||
'error_message' => __('You must specify items_ids OR use_query', 'tainacan'),
|
||||
], 400);
|
||||
|
||||
}
|
||||
|
|
|
@ -390,7 +390,7 @@ class REST_Taxonomies_Controller extends REST_Controller {
|
|||
}
|
||||
} else {
|
||||
return new \WP_REST_Response([
|
||||
'error_message' => __('Body can not be empty.', 'tainacan'),
|
||||
'error_message' => __('Body cannot be empty.', 'tainacan'),
|
||||
'body' => $body
|
||||
], 400);
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ class REST_Terms_Controller extends REST_Controller {
|
|||
$this->terms_repository = Repositories\Terms::get_instance();
|
||||
$this->taxonomy = new Entities\Taxonomy();
|
||||
$this->taxonomy_repository = Repositories\Taxonomies::get_instance();
|
||||
$this->items_repository = Repositories\Items::get_instance();
|
||||
}
|
||||
|
||||
public function register_routes() {
|
||||
|
@ -135,10 +136,10 @@ class REST_Terms_Controller extends REST_Controller {
|
|||
* @return bool|\WP_Error
|
||||
*/
|
||||
public function create_item_permissions_check( $request ) {
|
||||
$taxonomy = $this->taxonomy_repository->fetch($request['taxonomy_id']);
|
||||
$taxonomy = $this->taxonomy_repository->fetch($request['taxonomy_id']);
|
||||
|
||||
if ($taxonomy instanceof Entities\Taxonomy) {
|
||||
if ( $taxonomy->can_edit() ) {
|
||||
if ($taxonomy instanceof Entities\Taxonomy) {
|
||||
if ( $taxonomy->can_edit() ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -154,9 +155,9 @@ class REST_Terms_Controller extends REST_Controller {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -195,11 +196,11 @@ class REST_Terms_Controller extends REST_Controller {
|
|||
$taxonomy = $this->taxonomy_repository->fetch($request['taxonomy_id']);
|
||||
$term = $this->terms_repository->fetch($term_id, $taxonomy);
|
||||
|
||||
if ($term instanceof Entities\Term) {
|
||||
return $term->can_delete();
|
||||
}
|
||||
if ($term instanceof Entities\Term) {
|
||||
return $term->can_delete();
|
||||
}
|
||||
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -264,11 +265,45 @@ class REST_Terms_Controller extends REST_Controller {
|
|||
$taxonomy = $this->taxonomy_repository->fetch($request['taxonomy_id']);
|
||||
$term = $this->terms_repository->fetch($term_id, $taxonomy);
|
||||
|
||||
if ($term instanceof Entities\Term) {
|
||||
return $term->can_edit();
|
||||
}
|
||||
if ($term instanceof Entities\Term) {
|
||||
return $term->can_edit();
|
||||
}
|
||||
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Tainacan\Entities\Term $term
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function get_preview_image_items($term, $amount) {
|
||||
if($amount <= 0 )
|
||||
return [];
|
||||
|
||||
$term_id = $term->get_id();
|
||||
$taxonomy = $term->get_taxonomy();
|
||||
|
||||
$args = [
|
||||
'tax_query' => [
|
||||
[
|
||||
'taxonomy' => $taxonomy,
|
||||
'field' => 'term_id',
|
||||
'terms' => $term_id
|
||||
]
|
||||
],
|
||||
'posts_per_page' => $amount
|
||||
];
|
||||
|
||||
$items = $this->items_repository->fetch($args, [], 'OBJECT');
|
||||
$thumbnails = array_map( function($item) {
|
||||
$images = array();
|
||||
$images['thumbnail'] = $item->get_thumbnail();
|
||||
$images['document_mimetype'] = $item->get_document_mimetype();
|
||||
return $images;
|
||||
}, $items);
|
||||
|
||||
return $thumbnails;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -295,12 +330,17 @@ class REST_Terms_Controller extends REST_Controller {
|
|||
]);
|
||||
|
||||
$item_arr['total_children'] = count($children);
|
||||
|
||||
} else {
|
||||
$attributes_to_filter = $request['fetch_only'];
|
||||
|
||||
$item_arr = $this->filter_object_by_attributes($item, $attributes_to_filter);
|
||||
}
|
||||
|
||||
if(isset($request['fetch_preview_image_items']) && $request['fetch_preview_image_items'] != 0) {
|
||||
$item_arr['preview_image_items'] = $this->get_preview_image_items($item, $request['fetch_preview_image_items']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Use this filter to add additional term_meta to the api response
|
||||
* Use the $request object to get the context of the request and other variables
|
||||
|
@ -413,11 +453,11 @@ class REST_Terms_Controller extends REST_Controller {
|
|||
$taxonomy = $this->taxonomy_repository->fetch($request['taxonomy_id']);
|
||||
$term = $this->terms_repository->fetch($term_id, $taxonomy);
|
||||
|
||||
if ($term instanceof Entities\Term) {
|
||||
return $term->can_read();
|
||||
}
|
||||
if ($term instanceof Entities\Term) {
|
||||
return $term->can_read();
|
||||
}
|
||||
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -429,9 +469,9 @@ class REST_Terms_Controller extends REST_Controller {
|
|||
$endpoint_args = [];
|
||||
if($method === \WP_REST_Server::READABLE) {
|
||||
$endpoint_args = array_merge(
|
||||
$endpoint_args,
|
||||
parent::get_wp_query_params()
|
||||
);
|
||||
$endpoint_args,
|
||||
parent::get_wp_query_params()
|
||||
);
|
||||
} elseif ($method === \WP_REST_Server::CREATABLE || $method === \WP_REST_Server::EDITABLE) {
|
||||
$map = $this->terms_repository->get_map();
|
||||
|
||||
|
@ -450,12 +490,12 @@ class REST_Terms_Controller extends REST_Controller {
|
|||
$endpoint_args['metadatum_id'] = [
|
||||
'required' => false,
|
||||
'type' => 'integer',
|
||||
'description' => __('If term is being created in the context of a Taxonomy metadatum, inform its ID')
|
||||
'description' => __('If term is being created in the context of a Taxonomy metadatum, specify its ID')
|
||||
];
|
||||
$endpoint_args['item_id'] = [
|
||||
'required' => false,
|
||||
'type' => 'integer',
|
||||
'description' => __('If term is being created in the context of a Taxonomy metadatum, inform the ID of the item being edited')
|
||||
'description' => __('If term is being created in the context of a Taxonomy metadatum, specify the ID of the item being edited')
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ class __Bulk_Edit {
|
|||
*
|
||||
* The object can be initialized in three different ways:
|
||||
* 1. passing an array of Items IDs, using the items_ids params
|
||||
* 2. passing a query array, that will be passed to the fetch method of items repository to create the group (in this case you also need to inform the collection id)
|
||||
* 2. passing a query array, that will be passed to the fetch method of items repository to create the group (in this case you also need to specify the collection ID)
|
||||
* 3. passing an group ID, generated by this class in a previous initialization using one of the methods above.
|
||||
*
|
||||
* When initializing using methods 1 or 2, controllers should then call the get_id() method and store it if they want to perform future requests that wil affect this same group of items
|
||||
|
@ -72,7 +72,7 @@ class __Bulk_Edit {
|
|||
if (isset($params['query']) && is_array($params['query'])) {
|
||||
|
||||
if (!isset($params['collection_id']) || !is_numeric($params['collection_id'])) {
|
||||
throw new \Exception('Collection ID must be informed when creating a group via query');
|
||||
throw new \Exception('Collection ID must be specified when creating a group via query');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -362,7 +362,7 @@ class __Bulk_Edit {
|
|||
}
|
||||
|
||||
if ($new_value == $old_value) {
|
||||
return new \WP_Error( 'invalid_action', __( 'Old value and new value can not be the same', 'tainacan' ) );
|
||||
return new \WP_Error( 'invalid_action', __( 'Old value and new value cannot be the same', 'tainacan' ) );
|
||||
}
|
||||
|
||||
$dummyItem = new Entities\Item();
|
||||
|
@ -611,7 +611,7 @@ class __Bulk_Edit {
|
|||
global $wpdb;
|
||||
|
||||
if ($value == $newvalue) {
|
||||
return new \WP_Error( 'error', __( 'New value and old value can not be the same', 'tainacan' ) );
|
||||
return new \WP_Error( 'error', __( 'New value and old value cannot be the same', 'tainacan' ) );
|
||||
}
|
||||
|
||||
$taxRepo = Repositories\Taxonomies::get_instance();
|
||||
|
|
|
@ -145,7 +145,7 @@ class Embed {
|
|||
$width = false;
|
||||
|
||||
$dom = new \DOMDocument();
|
||||
$dom->loadHTML($html);
|
||||
$dom->loadHTML(htmlentities($html));
|
||||
|
||||
// If we have a fixed aspect iframe, and it's a responsive embed content.
|
||||
if ($dom) {
|
||||
|
|
|
@ -552,7 +552,7 @@ class Roles {
|
|||
|
||||
if( in_array($requested_cap, [
|
||||
$this->meta_caps->read_private_posts,
|
||||
$this->filters_caps->read_private_posts]
|
||||
$this->filters_caps->read_private_posts]
|
||||
) && (
|
||||
$user->has_cap('manage_tainacan') ||
|
||||
$user->has_cap('manage_tainacan_collection_all')
|
||||
|
@ -575,8 +575,8 @@ class Roles {
|
|||
|
||||
$check_all_collections_cap = false;
|
||||
$has_all_collections_cap = false;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* We are only interested in checks for a specific collection.
|
||||
* $args[2] will be set if this came from a meta cap of a specific collection ( e.g. current_user_can('tnc_rep_edit_collection', 3) ).
|
||||
|
@ -584,7 +584,7 @@ class Roles {
|
|||
if ( isset( $args[2] ) && is_numeric( $args[2] ) ) {
|
||||
$col_id = $args[2];
|
||||
/**
|
||||
* Or we extract the collectino id from the capability itself. Example: tnc_col_3_delete_items
|
||||
* Or we extract the collection id from the capability itself. Example: tnc_col_3_delete_items
|
||||
*/
|
||||
} else {
|
||||
$col_id = preg_replace('/[a-z_]+(\d+)[a-z_]+?$/', '$1', $cap );
|
||||
|
@ -598,7 +598,7 @@ class Roles {
|
|||
continue;
|
||||
}
|
||||
|
||||
// In case of a tnc_col_* capability check,
|
||||
// In case of a tnc_col_* capability check,
|
||||
// Let's see if the user has the respective tnc_col_all_* capability
|
||||
if ( $check_all_collections_cap ) {
|
||||
$all_collections_cap = preg_replace('/([a-z_]+)(\d+)([a-z_]+?)$/', '${1}all${3}', $cap );
|
||||
|
|
|
@ -117,6 +117,7 @@ class Collection extends Entity {
|
|||
'show_in_menu' => tnc_enable_dev_wp_interface(),
|
||||
//'menu_position' => 5,
|
||||
//'show_in_nav_menus' => false,
|
||||
'show_in_rest' => true,
|
||||
'publicly_queryable' => true,
|
||||
'exclude_from_search' => true,
|
||||
'has_archive' => true,
|
||||
|
@ -783,7 +784,7 @@ class Collection extends Entity {
|
|||
}
|
||||
|
||||
/**
|
||||
* Set enable submission with anonymous user
|
||||
* Set enable submission with anonymous user
|
||||
*
|
||||
* @param [string] $value
|
||||
*
|
||||
|
@ -805,7 +806,7 @@ class Collection extends Entity {
|
|||
}
|
||||
|
||||
/**
|
||||
* Set if submission items are allowes for the current collection.
|
||||
* Set if submission items are allowes for the current collection.
|
||||
*
|
||||
* @param [string] $value
|
||||
*
|
||||
|
@ -852,7 +853,7 @@ class Collection extends Entity {
|
|||
}
|
||||
|
||||
if( $this->is_cover_page_enabled() && !is_numeric( $this->get_cover_page_id() ) ) {
|
||||
$this->add_error('cover_page_id', __('cover page is enabled, please inform the page', 'tainacan'));
|
||||
$this->add_error('cover_page_id', __('cover page is enabled, please specify the page', 'tainacan'));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -288,7 +288,7 @@ class Filter extends Entity {
|
|||
if ($metadatum) {
|
||||
$metadatum_status_obj = get_post_status_object($metadatum->get_status());
|
||||
if ( ! $metadatum_status_obj->public ) {
|
||||
$this->add_error('status', __('Filter can not be public because the related metadatum is private', 'tainacan'));
|
||||
$this->add_error('status', __('Filter cannot be public because the related metadatum is private', 'tainacan'));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -539,6 +539,10 @@ class Item extends Entity {
|
|||
*
|
||||
* @type bool $hide_empty Wether to hide or not metadata the item has no value to
|
||||
* Default: true
|
||||
*
|
||||
* @type string $empty_value_message Message string to display if $hide_empty is false and there is not metadata value.
|
||||
* Default: ''
|
||||
*
|
||||
* @type bool $display_slug_as_class Show metadata slug as a class in the div before the metadata block
|
||||
* Default: false
|
||||
* @type string $before String to be added before each metadata block
|
||||
|
@ -573,6 +577,7 @@ class Item extends Entity {
|
|||
'exclude_description' => false,
|
||||
'exclude_core' => false,
|
||||
'hide_empty' => true,
|
||||
'empty_value_message' => '',
|
||||
'display_slug_as_class' => false,
|
||||
'before' => '<div class="metadata-type-$type $id">',
|
||||
'after' => '</div>',
|
||||
|
@ -582,9 +587,10 @@ class Item extends Entity {
|
|||
'after_value' => '</p>',
|
||||
);
|
||||
$args = wp_parse_args($args, $defaults);
|
||||
|
||||
|
||||
if (!is_null($args['metadata'])) {
|
||||
|
||||
$metadatum = $args['metadata'];
|
||||
$metadatum_object = null;
|
||||
|
||||
if ( $metadatum instanceof \Tainacan\Entities\Metadatum ) {
|
||||
|
@ -597,7 +603,7 @@ class Item extends Entity {
|
|||
$metadatum_object = $metadatum[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( $metadatum_object instanceof \Tainacan\Entities\Metadatum ) {
|
||||
|
||||
if ( is_array($args['metadata__not_in'])
|
||||
|
@ -610,7 +616,6 @@ class Item extends Entity {
|
|||
}
|
||||
|
||||
$mto = $metadatum_object->get_metadata_type_object();
|
||||
|
||||
$item_meta = new \Tainacan\Entities\Item_Metadata_Entity($this, $metadatum_object);
|
||||
if ($item_meta->has_value() || !$args['hide_empty']) {
|
||||
$before = str_replace('$type', $mto->get_slug(), $args['before']);
|
||||
|
@ -622,7 +627,7 @@ class Item extends Entity {
|
|||
}
|
||||
$return .= $before;
|
||||
$return .= $args['before_title'] . $metadatum_object->get_name() . $args['after_title'];
|
||||
$return .= $args['before_value'] . $item_meta->get_value_as_html() . $args['after_value'];
|
||||
$return .= $args['before_value'] . ( $item_meta->has_value() ? $item_meta->get_value_as_html() : $args['empty_value_message'] ) . $args['after_value'];
|
||||
$return .= $args['after'];
|
||||
}
|
||||
|
||||
|
@ -632,8 +637,6 @@ class Item extends Entity {
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
$query_args = [];
|
||||
$post__in = [];
|
||||
$post__not_in = [];
|
||||
|
@ -693,7 +696,7 @@ class Item extends Entity {
|
|||
}
|
||||
$return .= $before;
|
||||
$return .= $args['before_title'] . $item_meta->get_metadatum()->get_name() . $args['after_title'];
|
||||
$return .= $args['before_value'] . $item_meta->get_value_as_html() . $args['after_value'];
|
||||
$return .= $args['before_value'] . ( $item_meta->has_value() ? $item_meta->get_value_as_html() : $args['empty_value_message'] ) . $args['after_value'];
|
||||
$return .= $args['after'];
|
||||
|
||||
}
|
||||
|
@ -719,10 +722,8 @@ class Item extends Entity {
|
|||
|
||||
if ( $document_options && isset($document_options['forced_iframe']) && $document_options['forced_iframe'] === true ) {
|
||||
|
||||
$headers = get_headers($url, 1);
|
||||
|
||||
// URL points to an image file
|
||||
if (strpos($headers['Content-Type'], 'image/') !== false) {
|
||||
if (isset($document_options['is_image']) && $document_options['is_image'] === true) {
|
||||
$_embed = sprintf('<a href="%s" target="blank"><img src="%s" /></a>', $url, $url);
|
||||
|
||||
// URL points to a content that is not an image
|
||||
|
|
|
@ -14,6 +14,7 @@ class Metadatum extends Entity {
|
|||
$order,
|
||||
$parent,
|
||||
$description,
|
||||
$placeholder,
|
||||
$required,
|
||||
$multiple,
|
||||
$display,
|
||||
|
@ -111,6 +112,15 @@ class Metadatum extends Entity {
|
|||
return $this->get_mapped_property('description');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the metadatum placeholder
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get_placeholder() {
|
||||
return $this->get_mapped_property('placeholder');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return if is a required metadatum
|
||||
*
|
||||
|
@ -288,6 +298,16 @@ class Metadatum extends Entity {
|
|||
$this->set_mapped_property('description', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set metadatum placeholder
|
||||
*
|
||||
* @param [string] $value The text placeholder
|
||||
* @return void
|
||||
*/
|
||||
function set_placeholder($value) {
|
||||
$this->set_mapped_property('placeholder', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Allow the metadatum be required
|
||||
*
|
||||
|
@ -462,7 +482,7 @@ class Metadatum extends Entity {
|
|||
if ( $this->get_parent() > 0 && $this->get_metadata_type_object()->get_primitive_type() == 'term' ) {
|
||||
$parent_metadatum = new \Tainacan\Entities\Metadatum($this->get_parent());
|
||||
if ( $parent_metadatum->is_multiple() ) {
|
||||
$this->add_error($this->get_id(), __('Taxonomy metadata can not be used inside Compound metadata with multiple values', 'tainacan'));
|
||||
$this->add_error($this->get_id(), __('Taxonomy metadata cannot be used inside Compound metadata with multiple values', 'tainacan'));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -478,7 +498,7 @@ class Metadatum extends Entity {
|
|||
, 'OBJECT');
|
||||
|
||||
if ( sizeof($children_taxonomy) > 0 ) {
|
||||
$this->add_error($this->get_id(), __('Taxonomy metadata can not be used inside Compound metadata with multiple values', 'tainacan'));
|
||||
$this->add_error($this->get_id(), __('Taxonomy metadata cannot be used inside Compound metadata with multiple values', 'tainacan'));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -59,6 +59,8 @@ class Term extends Entity {
|
|||
$term_array = parent::_toArray();
|
||||
|
||||
$term_id = $term_array['term_id'];
|
||||
$taxonomy_slug = $this->get_taxonomy();
|
||||
$separator = strip_tags(apply_filters('tainacan-terms-hierarchy-html-separator', '>'));
|
||||
|
||||
unset($term_array['term_id']);
|
||||
unset($term_array['status']);
|
||||
|
@ -66,6 +68,7 @@ class Term extends Entity {
|
|||
$term_array['id'] = $term_id;
|
||||
$term_array['header_image'] = $this->get_header_image();
|
||||
$term_array['url'] = get_term_link( $this->get_id() );
|
||||
$term_array['hierarchy_path'] = get_term_parents_list($term_id, $taxonomy_slug, ['format'=>'name', 'separator'=>$separator, 'link'=>false, 'inclusive'=>false]);
|
||||
|
||||
return apply_filters('tainacan-term-to-array', $term_array, $this);
|
||||
}
|
||||
|
@ -234,7 +237,7 @@ class Term extends Entity {
|
|||
|
||||
if (false !== $term_exists) {
|
||||
if ($this->get_id() != $term_exists->term_id) {
|
||||
$this->add_error( 'name', __('You can not have two terms with the same name at the same level', 'tainacan') );
|
||||
$this->add_error( 'name', __('You cannot have two terms with the same name at the same level', 'tainacan') );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -115,7 +115,7 @@ class Term_Exporter extends Exporter {
|
|||
<h5><?php _e('Source Taxonomy', 'tainacan'); ?></h5>
|
||||
</div>
|
||||
<div class="help-tooltip-body">
|
||||
<p><?php _e('Inform the taxonomy you want to export the terms from.', 'tainacan'); ?></p>
|
||||
<p><?php _e('Specify the taxonomy you want to export the terms from.', 'tainacan'); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
|
@ -148,7 +148,7 @@ class Term_Exporter extends Exporter {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
public function exporting_terms(){
|
||||
|
||||
|
@ -195,4 +195,4 @@ class Term_Exporter extends Exporter {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,8 +23,8 @@ class Bulk_Edit_Process extends Generic_Process {
|
|||
$this->item_metadata_repository = \Tainacan\Repositories\Item_Metadata::get_instance();
|
||||
$this->steps = [
|
||||
[
|
||||
'name' => __('Bulk edit control metadada', 'tainacan'),
|
||||
'progress_label' => __('Creating bulk edit control metadada', 'tainacan'),
|
||||
'name' => __('Bulk edit control metadata', 'tainacan'),
|
||||
'progress_label' => __('Creating bulk edit control metadata', 'tainacan'),
|
||||
'callback' => 'add_control_metadata'
|
||||
],[
|
||||
'name' => __('Bulk edit', 'tainacan'),
|
||||
|
@ -42,7 +42,7 @@ class Bulk_Edit_Process extends Generic_Process {
|
|||
}
|
||||
|
||||
if (!isset($params['collection_id']) || !is_numeric($params['collection_id'])) {
|
||||
throw new \Exception('Collection ID must be informed when creating a group.');
|
||||
throw new \Exception('Collection ID must be specified when creating a group.');
|
||||
}
|
||||
|
||||
$this->set_group_id(uniqid());
|
||||
|
@ -141,10 +141,10 @@ class Bulk_Edit_Process extends Generic_Process {
|
|||
$params['control_metadata'] = $this->get_id();
|
||||
$this->save_options($params);
|
||||
} elseif ($params['control_metadata'] === true) {
|
||||
$this->add_log( __('bulk edit control metadata has already been created', 'tainacan') );
|
||||
$this->add_log( __('Bulk edit control metadata has already been created', 'tainacan') );
|
||||
return false;
|
||||
} elseif( is_numeric($params['control_metadata']) && $params['control_metadata'] != $this->get_id() ) {
|
||||
$this->add_log( sprintf( __( 'waiting creating bulk edit control metadata by process ID: "%d"', 'tainacan' ), $params['control_metadata'] ) );
|
||||
$this->add_log( sprintf( __( 'Waiting creating bulk edit control metadata by process ID: "%d"', 'tainacan' ), $params['control_metadata'] ) );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -171,11 +171,11 @@ class Bulk_Edit_Process extends Generic_Process {
|
|||
if(!$item_query->have_posts() ) {
|
||||
$params['control_metadata'] = true;
|
||||
$this->save_options($params);
|
||||
$this->add_log( __('bulk edit control metadata created', 'tainacan') );
|
||||
$this->add_log( __('Bulk edit control metadata created', 'tainacan') );
|
||||
return false;
|
||||
}
|
||||
$item_id = $item_query->get_posts()[0];
|
||||
$this->add_log( sprintf( __( 'creating bulk edit control metadata for item: "%d"', 'tainacan' ), $item_id ) );
|
||||
$this->add_log( sprintf( __( 'Creating bulk edit control metadata for item: "%d"', 'tainacan' ), $item_id ) );
|
||||
add_post_meta($item_id, $this->meta_key, $this->get_group_id());
|
||||
return $count;
|
||||
} elseif (isset($params['items_ids']) && is_array($params['items_ids'])) {
|
||||
|
@ -183,18 +183,18 @@ class Bulk_Edit_Process extends Generic_Process {
|
|||
|
||||
$count = $this->get_in_step_count();
|
||||
if( isset($items_ids[$count]) ) {
|
||||
$this->add_log( sprintf( __( 'creating bulk edit control metadata for item: "%d"', 'tainacan' ), $items_ids[$count] ) );
|
||||
$this->add_log( sprintf( __( 'Creating bulk edit control metadata for item: "%d"', 'tainacan' ), $items_ids[$count] ) );
|
||||
add_post_meta($items_ids[$count++], $this->meta_key, $this->get_group_id());
|
||||
return $count;
|
||||
} else {
|
||||
$params['control_metadata'] = true;
|
||||
$this->save_options($params);
|
||||
$this->add_log( __('bulk edit control metadata created', 'tainacan') );
|
||||
$this->add_log( __('Bulk edit control metadata created', 'tainacan') );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$this->add_error_log(__('wrong parameter on add bulk edit control metadata', 'tainacan'));
|
||||
$this->add_error_log(__('Wrong parameter on add bulk edit control metadata', 'tainacan'));
|
||||
$this->abort();
|
||||
return false;
|
||||
}
|
||||
|
@ -241,7 +241,7 @@ class Bulk_Edit_Process extends Generic_Process {
|
|||
return false;
|
||||
}
|
||||
|
||||
$this->add_log( sprintf( __('bulk edit has process the item ID: "%d"', 'tainacan'), $item->get_id() ) );
|
||||
$this->add_log( sprintf( __('Bulk edit has processed the item ID: "%d"', 'tainacan'), $item->get_id() ) );
|
||||
$add_steps = $this->$method($item);
|
||||
if ( is_int($add_steps) ) {
|
||||
$count = $count + $add_steps;
|
||||
|
@ -252,7 +252,7 @@ class Bulk_Edit_Process extends Generic_Process {
|
|||
public function finished() {
|
||||
$total = $this->get_transient('total_process') == null ? 0 : $this->get_transient('total_process');
|
||||
$this->add_log('finished');
|
||||
$this->add_log( sprintf( __('total items processed: %d', 'tainacan'), $total ) );
|
||||
$this->add_log( sprintf( __('Total items processed: %d', 'tainacan'), $total ) );
|
||||
}
|
||||
|
||||
private function save_item_metadata(\Tainacan\Entities\Item_Metadata_Entity $item_metadata, \Tainacan\Entities\Item $item) {
|
||||
|
@ -310,7 +310,7 @@ class Bulk_Edit_Process extends Generic_Process {
|
|||
$unique = !$compoundItem->is_multiple();
|
||||
$compoundValue = $compoundItem->get_value();
|
||||
if ( $unique && !empty($compoundValue) ) {
|
||||
$key = array_keys($compoundValue)[0]; // get the first metadata ID, if the argument metadata does not exist
|
||||
$key = array_keys($compoundValue)[0]; // get the first metadata ID, if the argument metadata does not exist
|
||||
$parent_meta_id = $compoundValue[$key]->get_parent_meta_id();
|
||||
return $parent_meta_id;
|
||||
} // elseif ((is_array($compoundValue) && sizeof($compoundValue) > 0))
|
||||
|
@ -359,10 +359,10 @@ class Bulk_Edit_Process extends Generic_Process {
|
|||
return $this->save_item_metadata($item_metadata, $item);
|
||||
} else {
|
||||
$metadatum_from = $this->metadatum_repository->fetch($metadatum_id_from);
|
||||
if ( $metadatum_from->get_metadata_type() == $metadatum->get_metadata_type() &&
|
||||
if ( $metadatum_from->get_metadata_type() == $metadatum->get_metadata_type() &&
|
||||
( $metadatum_from->is_multiple() == false || $metadatum_from->is_multiple() == $metadatum->is_multiple() ) ) {
|
||||
$item_metadata_from = new Entities\Item_Metadata_Entity( $item, $metadatum_from );
|
||||
|
||||
|
||||
$value = $item_metadata_from->get_value();
|
||||
if ( $metadatum->get_metadata_type_object()->get_primitive_type() == 'term' ) {
|
||||
if ( $metadatum_from->is_multiple() ) {
|
||||
|
@ -379,7 +379,7 @@ class Bulk_Edit_Process extends Generic_Process {
|
|||
return $this->save_item_metadata($item_metadata, $item);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$this->add_error_log( __('Not possible to copy metadata values of different types', 'tainacan') );
|
||||
return false;
|
||||
}
|
||||
|
@ -435,7 +435,7 @@ class Bulk_Edit_Process extends Generic_Process {
|
|||
}
|
||||
|
||||
if ($new_value == $old_value) {
|
||||
$this->add_error_log( __( 'Old value and new value can not be the same', 'tainacan' ) );
|
||||
$this->add_error_log( __( 'Old value and new value cannot be the same', 'tainacan' ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -445,7 +445,7 @@ class Bulk_Edit_Process extends Generic_Process {
|
|||
$metadatum = $item_metadata->get_metadatum();
|
||||
if($metadatum->get_id() == $metadatum_id) {
|
||||
$values = is_array($item_metadata->get_value()) ? $item_metadata->get_value() : [$item_metadata->get_value()];
|
||||
|
||||
|
||||
if ( $metadatum->get_metadata_type_object()->get_primitive_type() == 'term' ) {
|
||||
$new_term = is_string($new_value) ? $new_value : \Tainacan\Repositories\Terms::get_instance()->fetch($new_value, $metadatum->get_metadata_type_object()->get_taxonomy());
|
||||
$values = array_map( function ($term) use ($old_value, $new_term) {
|
||||
|
@ -453,7 +453,7 @@ class Bulk_Edit_Process extends Generic_Process {
|
|||
($term == $old_value ? $new_term : $term) :
|
||||
($term->get_id() == $old_value ? $new_term : $term);
|
||||
}, $values );
|
||||
|
||||
|
||||
$item_metadata->set_value( $metadatum->is_multiple() ? $values : $new_term );
|
||||
return $this->save_item_metadata($item_metadata, $item);
|
||||
} else {
|
||||
|
@ -472,7 +472,7 @@ class Bulk_Edit_Process extends Generic_Process {
|
|||
|
||||
private function trash_items(\Tainacan\Entities\Item $item) {
|
||||
if ( !$this->items_repository->trash($item) ) {
|
||||
$this->add_error_log( sprintf( __('error on send to trash, item ID: "%d"', 'tainacan'), $item->get_id() ) );
|
||||
$this->add_error_log( sprintf( __('Error on send to trash, item ID: "%d"', 'tainacan'), $item->get_id() ) );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -480,7 +480,7 @@ class Bulk_Edit_Process extends Generic_Process {
|
|||
|
||||
private function untrash_items(\Tainacan\Entities\Item $item) {
|
||||
if ( !wp_untrash_post( $item->get_id() ) ) {
|
||||
$this->add_error_log( sprintf( __('error on untrash, item ID: "%d"', 'tainacan'), $item->get_id() ) );
|
||||
$this->add_error_log( sprintf( __('Error on untrash, item ID: "%d"', 'tainacan'), $item->get_id() ) );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -526,7 +526,7 @@ class Bulk_Edit_Process extends Generic_Process {
|
|||
$value = $this->bulk_edit_data['value'];
|
||||
|
||||
if ( ! in_array( $value, array( 'open', 'closed' ) ) ) {
|
||||
$this->add_error_log( __( "the status of comments must be 'open' or 'closed'", 'tainacan' ) );
|
||||
$this->add_error_log( __( "The status of comments must be 'open' or 'closed'", 'tainacan' ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ class CSV extends Importer {
|
|||
$this->set_option('document_import_mode', 'replace');
|
||||
$this->set_option('document_index', $index);
|
||||
} else if( $rawColumn === 'special_attachments' ||
|
||||
$rawColumn === 'special_attachments|APPEND' ||
|
||||
$rawColumn === 'special_attachments|APPEND' ||
|
||||
$rawColumn === 'special_attachments|REPLACE' ) {
|
||||
$this->set_option('attachment_index', $index);
|
||||
$attachment_type = explode('|', $rawColumn);
|
||||
|
@ -127,7 +127,7 @@ class CSV extends Importer {
|
|||
return $header;
|
||||
}
|
||||
return $header;
|
||||
}, $this->raw_source_metadata());
|
||||
}, $this->raw_source_metadata());
|
||||
|
||||
$item_line = (int) $index + 2;
|
||||
|
||||
|
@ -199,7 +199,7 @@ class CSV extends Importer {
|
|||
$returnValue = [];
|
||||
foreach($valueToInsert as $index => $metadatumValue) {
|
||||
$childrenHeaders = str_getcsv($compoundHeaders[$key], $this->get_option('delimiter'), $this->get_option('enclosure'));
|
||||
$childrenValue = $this->is_clear_value($metadatumValue) ?
|
||||
$childrenValue = $this->is_clear_value($metadatumValue) ?
|
||||
array_fill(0, sizeof($childrenHeaders), $this->get_option('escape_empty_value') ) :
|
||||
str_getcsv($metadatumValue, $this->get_option('delimiter'), $this->get_option('enclosure'));
|
||||
|
||||
|
@ -405,7 +405,7 @@ class CSV extends Importer {
|
|||
<h5><?php _e('Empty value', 'tainacan'); ?></h5>
|
||||
</div>
|
||||
<div class="help-tooltip-body">
|
||||
<p><?php _e('The string representing a value not informed for the metadata. (e.g. \EMPTY)', 'tainacan'); ?></p>
|
||||
<p><?php _e('The string representing a value not specified for the metadata. (e.g. \EMPTY)', 'tainacan'); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
|
@ -414,7 +414,7 @@ class CSV extends Importer {
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="columns">
|
||||
|
@ -462,7 +462,7 @@ class CSV extends Importer {
|
|||
<h5><?php _e('Server path', 'tainacan'); ?></h5>
|
||||
</div>
|
||||
<div class="help-tooltip-body">
|
||||
<p><?php _e("When using CSV special field to add documents or attachments that you've uploaded to the server, inform the full path to the folder here (e.g. /home/user/files/)", 'tainacan'); ?></p>
|
||||
<p><?php _e("When using CSV special field to add documents or attachments that you've uploaded to the server, specify the full path to the folder here (e.g. /home/user/files/)", 'tainacan'); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
|
@ -828,9 +828,10 @@ class CSV extends Importer {
|
|||
if($itemMetadata instanceof Entities\Item_Metadata_Entity ) {
|
||||
$itemMetadata->set_item( $insertedItem ); // *I told you
|
||||
if( $itemMetadata->validate() ) {
|
||||
$result = $Tainacan_Item_Metadata->insert( $itemMetadata );
|
||||
$Tainacan_Item_Metadata->insert( $itemMetadata );
|
||||
} else {
|
||||
$this->add_error_log('Error saving value for ' . $itemMetadata->get_metadatum()->get_name() . " in item " . $insertedItem->get_title());
|
||||
$insertedItemId = $updating_item == true ? ' (special_item_id: ' . $insertedItem->get_id() . ')' : '';
|
||||
$this->add_error_log('Error saving value for ' . $itemMetadata->get_metadatum()->get_name() . " in item " . $insertedItem->get_title() . $insertedItemId);
|
||||
$this->add_error_log($itemMetadata->get_errors());
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<?php
|
||||
<?php
|
||||
|
||||
namespace Tainacan;
|
||||
|
||||
class Importer_Handler {
|
||||
|
||||
|
||||
private $registered_importers = [];
|
||||
|
||||
|
||||
function __construct() {
|
||||
|
||||
|
||||
$this->bg_importer = new Background_Importer();
|
||||
|
||||
add_action('init', array(&$this, 'init'));
|
||||
|
@ -23,7 +23,7 @@ class Importer_Handler {
|
|||
'manual_collection' => true,
|
||||
'manual_mapping' => true,
|
||||
]);
|
||||
|
||||
|
||||
$this->register_importer([
|
||||
'name' => 'Test',
|
||||
'description' => __('Create 2 test colletions with random items', 'tainacan'),
|
||||
|
@ -61,8 +61,8 @@ class Importer_Handler {
|
|||
]);
|
||||
|
||||
$this->register_importer([
|
||||
'name' => 'Youtube (Experimental)',
|
||||
'description' => __('Import items from an Youtube URL', 'tainacan'),
|
||||
'name' => 'YouTube (Experimental)',
|
||||
'description' => __('Import items from an YouTube URL', 'tainacan'),
|
||||
'slug' => 'youtube_importer',
|
||||
'class_name' => '\Tainacan\Importer\Youtube_Importer',
|
||||
'manual_collection' => true,
|
||||
|
@ -71,7 +71,7 @@ class Importer_Handler {
|
|||
|
||||
$this->register_importer([
|
||||
'name' => 'Flickr (Experimental)',
|
||||
'description' => __('Import items from an Flickr URL', 'tainacan'),
|
||||
'description' => __('Import items from a Flickr URL', 'tainacan'),
|
||||
'slug' => 'flickr_importer',
|
||||
'class_name' => '\Tainacan\Importer\Flickr_Importer',
|
||||
'manual_collection' => true,
|
||||
|
@ -87,53 +87,53 @@ class Importer_Handler {
|
|||
global $TAINACAN_BASE_URL;
|
||||
wp_enqueue_script('import_term_csv_script', $TAINACAN_BASE_URL . '/classes/importer/term-importer/js/term.js', false, TAINACAN_VERSION, true);
|
||||
}
|
||||
|
||||
|
||||
function add_to_queue(\Tainacan\Importer\Importer $importer_object) {
|
||||
$data = $importer_object->_to_Array(true);
|
||||
$importer = $this->get_importer_by_object($importer_object);
|
||||
|
||||
|
||||
// Translators: The name of the importer process. E.g. CSV Importer, Legacy Tainacan Importer
|
||||
$importer_name = sprintf( __('%s Importer', 'tainacan'), $importer['name'] );
|
||||
|
||||
|
||||
$bg_process = $this->bg_importer->data($data)->set_name($importer_name)->save();
|
||||
if ( is_wp_error($bg_process->dispatch()) ) {
|
||||
return false;
|
||||
}
|
||||
return $bg_process;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Register Importer
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param array $importer {
|
||||
* Required. Array or string of arguments describing the importer
|
||||
*
|
||||
*
|
||||
* @type string $name The name of the importer. e.g. 'Example Importer'
|
||||
* @type string $slug A unique slug for the importer. e.g. 'This is an example importer description'
|
||||
* @type string $description The importer description. e.g. 'example-importer'
|
||||
* @type string $class_name The Importer Class. e.g. '\Tainacan\Importer\Test_Importer'
|
||||
* @type bool $manual_mapping Wether Tainacan must present the user with an interface to manually map
|
||||
* @type bool $manual_mapping Wether Tainacan must present the user with an interface to manually map
|
||||
* the metadata from the source to the target collection.
|
||||
*
|
||||
* If set to true, Importer Class must implement the method
|
||||
* If set to true, Importer Class must implement the method
|
||||
* get_source_metadata() to return the metadatum found in the source.
|
||||
*
|
||||
*
|
||||
* Note that this will only work when importing items to one single collection.
|
||||
*
|
||||
*
|
||||
* @type bool $manual_collection Wether Tainacan will let the user choose a destination collection.
|
||||
*
|
||||
* If set to true, the API endpoints will handle Collection creation and will assign it to
|
||||
* If set to true, the API endpoints will handle Collection creation and will assign it to
|
||||
* the importer object using add_collection() method.
|
||||
*
|
||||
* Otherwise, the child importer class must create the collections and add them to the collections property also
|
||||
*
|
||||
* Otherwise, the child importer class must create the collections and add them to the collections property also
|
||||
* using add_collection()
|
||||
*
|
||||
*
|
||||
*/
|
||||
public function register_importer(array $importer) {
|
||||
|
||||
|
||||
$defaults = [
|
||||
'manual_mapping' => false,
|
||||
'manual_collection' => true
|
||||
|
@ -144,7 +144,7 @@ class Importer_Handler {
|
|||
if (!isset($attrs['slug']) || !isset($attrs['class_name']) || !isset($attrs['name'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$this->registered_importers[$importer['slug']] = $attrs;
|
||||
|
||||
return true;
|
||||
|
@ -185,7 +185,7 @@ class Importer_Handler {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Save importer instance to the database
|
||||
* @param Tainacan\Importer\Importer $importer The Importer object
|
||||
|
@ -194,7 +194,7 @@ class Importer_Handler {
|
|||
public function save_importer_instance(\Tainacan\Importer\Importer $importer) {
|
||||
update_option('tnc_transient_' . $importer->get_id(), $importer, false);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves an Importer instance from the database based on its session_id
|
||||
* @param string $session_id The Importer ID
|
||||
|
@ -204,7 +204,7 @@ class Importer_Handler {
|
|||
$importer = get_option('tnc_transient_' . $session_id);
|
||||
return $importer;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deletes this importer instance from the database
|
||||
* @param Tainacan\Importer\Importer $importer The Importer object
|
||||
|
@ -213,8 +213,8 @@ class Importer_Handler {
|
|||
public function delete_importer_instance(\Tainacan\Importer\Importer $importer) {
|
||||
return delete_option('tnc_transient_' . $importer->get_id());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
global $Tainacan_Importer_Handler;
|
||||
|
|
|
@ -179,7 +179,7 @@ class Oaipmh_Importer extends Importer {
|
|||
$metadata_map = $this->create_collection_metadata($collection);
|
||||
$total = intval($this->get_total_items_from_source($setSpec));
|
||||
$this->add_log('total in collection: ' . $total);
|
||||
$this->add_log('collection id ' . (string) $collection->get_id());
|
||||
$this->add_log('collection ID ' . (string) $collection->get_id());
|
||||
|
||||
$this->add_collection([
|
||||
'id' => $collection->get_id(),
|
||||
|
@ -194,7 +194,7 @@ class Oaipmh_Importer extends Importer {
|
|||
$metadata_map = $this->create_collection_metadata($collection);
|
||||
$total = intval( $this->get_total_items_from_source(false) );
|
||||
$this->add_log('total in collection: ' . $total);
|
||||
$this->add_log('collection id ' . (string) $collection->get_id());
|
||||
$this->add_log('collection ID ' . (string) $collection->get_id());
|
||||
|
||||
$tax = new Entities\Taxonomy();
|
||||
$tax->set_name( $this->NAME_FOR_SETS );
|
||||
|
@ -869,4 +869,4 @@ class Oaipmh_Importer extends Importer {
|
|||
|
||||
return ob_get_clean();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ class Old_Tainacan extends Importer{
|
|||
'total' => 5
|
||||
]
|
||||
];
|
||||
|
||||
|
||||
protected $tainacan_api_address, $wordpress_api_address, $actual_collection;
|
||||
|
||||
/**
|
||||
|
@ -48,7 +48,7 @@ class Old_Tainacan extends Importer{
|
|||
$this->metadata_repo = \Tainacan\Repositories\Metadata::get_instance();
|
||||
$this->term_repo = \Tainacan\Repositories\Terms::get_instance();
|
||||
$this->item_metadata_repo = \Tainacan\Repositories\Item_Metadata::get_instance();
|
||||
|
||||
|
||||
$this->remove_import_method('file');
|
||||
$this->add_import_method('url');
|
||||
$this->tainacan_api_address = "/wp-json/tainacan/v1";
|
||||
|
@ -59,7 +59,7 @@ class Old_Tainacan extends Importer{
|
|||
/**
|
||||
* create taxonomies ( taxonomies in tainacan old in first level )
|
||||
* next create the terms
|
||||
*
|
||||
*
|
||||
*/
|
||||
public function create_taxonomies() {
|
||||
if (!$this->get_url()) {
|
||||
|
@ -67,20 +67,20 @@ class Old_Tainacan extends Importer{
|
|||
$this->abort();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$this->add_log('Creating taxonomies');
|
||||
|
||||
|
||||
foreach ($this->get_taxonomies() as $taxonomy) {
|
||||
$tax = new Entities\Taxonomy();
|
||||
$tax->set_name( $taxonomy->name );
|
||||
$tax->set_description( $taxonomy->description );
|
||||
$tax->set_allow_insert('yes');
|
||||
$tax->set_status('publish');
|
||||
$tax->set_status('publish');
|
||||
|
||||
if ($tax->validate()) {
|
||||
$tax = $this->tax_repo->insert($tax);
|
||||
|
||||
$this->add_log('Taxonomy ' . $tax->get_name() . ' created, id from Old'. $taxonomy->term_id );
|
||||
|
||||
$this->add_log('Taxonomy ' . $tax->get_name() . ' created, ID from Old'. $taxonomy->term_id );
|
||||
$this->add_transient('tax_' . $taxonomy->term_id . '_id', $tax->get_id());
|
||||
$this->add_transient('tax_' . $taxonomy->term_id . '_name', $tax->get_name());
|
||||
|
||||
|
@ -95,14 +95,14 @@ class Old_Tainacan extends Importer{
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* create the repository metadata which each collection inherits by default
|
||||
*
|
||||
*
|
||||
*/
|
||||
public function create_repo_metadata() {
|
||||
$this->add_log('Creating repository metadata');
|
||||
|
||||
|
||||
foreach ($this->get_repo_metadata() as $metadata) {
|
||||
if (isset($metadata->slug) && strpos($metadata->slug, 'socialdb_property_fixed') === false) {
|
||||
$metadatum_id = $this->create_metadata( $metadata );
|
||||
|
@ -117,12 +117,12 @@ class Old_Tainacan extends Importer{
|
|||
|
||||
/**
|
||||
* create all collections and its metadata
|
||||
*
|
||||
*
|
||||
*/
|
||||
public function create_collections(){
|
||||
|
||||
$this->add_log('Creating collections');
|
||||
|
||||
|
||||
foreach ($this->fetch_collections() as $collection) {
|
||||
$map = [];
|
||||
$this->add_log(memory_get_usage());
|
||||
|
@ -136,16 +136,16 @@ class Old_Tainacan extends Importer{
|
|||
$metadatum_id = $this->create_metadata( $metadatum_old, $collection_id );
|
||||
|
||||
if( $metadatum_id ){
|
||||
$map[$metadatum_id] = $metadatum_old->id;
|
||||
$map[$metadatum_id] = $metadatum_old->id;
|
||||
}
|
||||
|
||||
|
||||
} else if( isset($metadatum_old->slug) && strpos($metadatum_old->slug, 'socialdb_property_fixed_tags') !== false
|
||||
&& isset($metadatum_old->type) && strpos($metadatum_old->type, 'checkbox') !== false
|
||||
){
|
||||
$metadatum_id = $this->create_metadata( $metadatum_old, $collection_id );
|
||||
$this->add_log('Creating tag');
|
||||
if( $metadatum_id ){
|
||||
$map[$metadatum_id] = $metadatum_old->id;
|
||||
$map[$metadatum_id] = $metadatum_old->id;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -177,17 +177,17 @@ class Old_Tainacan extends Importer{
|
|||
if( $collections && is_array( $collections ) ){
|
||||
|
||||
foreach( $collections as $collection ){ // loop collections
|
||||
$map = $this->get_transient('collection_' . $collection->get_id() . '_relationships');
|
||||
|
||||
$map = $this->get_transient('collection_' . $collection->get_id() . '_relationships');
|
||||
|
||||
if(!$map){
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach( $map as $metadatum_id => $items ){ // all relations in collection
|
||||
foreach( $map as $metadatum_id => $items ){ // all relations in collection
|
||||
$newMetadatum = new Entities\Metadatum($metadatum_id);
|
||||
|
||||
$first_index_id = key($items);
|
||||
$collection_id = $this->get_transient('item_' . $items[$first_index_id] . '_collection');
|
||||
$first_index_id = key($items);
|
||||
$collection_id = $this->get_transient('item_' . $items[$first_index_id] . '_collection');
|
||||
|
||||
$newMetadatum->set_metadata_type_options(['collection_id' => $collection_id ]);
|
||||
|
||||
|
@ -198,7 +198,7 @@ class Old_Tainacan extends Importer{
|
|||
|
||||
reset($items);
|
||||
foreach( $items as $item_id => $value_old ){ // all values
|
||||
$value_new = $this->get_transient('item_' . $value_old . '_id');
|
||||
$value_new = $this->get_transient('item_' . $value_old . '_id');
|
||||
$item = new Entities\Item($item_id);
|
||||
$item_metadata = new Entities\Item_Metadata_Entity( $item, $newMetadatum );
|
||||
|
||||
|
@ -226,15 +226,15 @@ class Old_Tainacan extends Importer{
|
|||
'redirection' => 30,
|
||||
);
|
||||
|
||||
$page = intval( $index ) + 1;
|
||||
$page = intval( $index ) + 1;
|
||||
|
||||
$this->add_log('Proccess item index' . $index . ' in collection OLD ' . $collection_id['source_id'] );
|
||||
|
||||
$url_to_fetch = $this->get_url() . $this->tainacan_api_address . "/collections/".
|
||||
$url_to_fetch = $this->get_url() . $this->tainacan_api_address . "/collections/".
|
||||
$collection_id['source_id']."/items?includeMetadata=1&filter[items_per_page]=1&filter[page]=" . $page
|
||||
. "&filter[order_by]=ID&filter[order]=ASC";
|
||||
|
||||
$info = $this->requester( $url_to_fetch, $args );
|
||||
$info = $this->requester( $url_to_fetch, $args );
|
||||
$info = json_decode($info['body']);
|
||||
|
||||
if( !isset( $info->items ) ){
|
||||
|
@ -248,7 +248,7 @@ class Old_Tainacan extends Importer{
|
|||
$this->abort();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$the_item = null;
|
||||
|
||||
foreach( $info->items as $item ){
|
||||
|
@ -257,7 +257,7 @@ class Old_Tainacan extends Importer{
|
|||
|
||||
if( isset($the_item) && isset($the_item->item) && !empty($the_item->item) ){
|
||||
$item_Old = $the_item;
|
||||
$this->add_log('item found ', $the_item->item->ID );
|
||||
$this->add_log('item found ', $the_item->item->ID );
|
||||
return [ 'item' => $item_Old, 'collection_definition' => $collection_id ];
|
||||
} else {
|
||||
$this->add_error_log('fetching remote ' . $url_to_fetch);
|
||||
|
@ -273,7 +273,7 @@ class Old_Tainacan extends Importer{
|
|||
* @param array $processed_item Associative array with metadatum source's as index with
|
||||
* its value or values
|
||||
* @param integet $collection_index The index in the $this->collections array of the collection the item is beeing inserted into
|
||||
*
|
||||
*
|
||||
* @return Tainacan\Entities\Item Item inserted
|
||||
*/
|
||||
public function insert( $processed_item, $collection_index ) {
|
||||
|
@ -336,7 +336,7 @@ class Old_Tainacan extends Importer{
|
|||
$newMetadatum = new Entities\Metadatum($new_tainacanid);
|
||||
|
||||
$item_metadata = new Entities\Item_Metadata_Entity( $item, $newMetadatum );
|
||||
|
||||
|
||||
// avoid blank metadatum
|
||||
|
||||
if( isset($metadatum->empty) ){
|
||||
|
@ -357,7 +357,7 @@ class Old_Tainacan extends Importer{
|
|||
if( in_array($metadatum->type,['text', 'textarea', 'numeric', 'date']) ){
|
||||
|
||||
if($metadatum->type === 'date'){
|
||||
|
||||
|
||||
if(is_array($value)){
|
||||
$values = [];
|
||||
|
||||
|
@ -365,17 +365,17 @@ class Old_Tainacan extends Importer{
|
|||
$v = explode('/',$day);
|
||||
|
||||
$v[1]= ( $v[1] < 10 ) ? '0'.$v[1] : $v[1];
|
||||
$v[0]= ( $v[0] < 10 ) ? '0'.$v[0] : $v[0];
|
||||
$v[0]= ( $v[0] < 10 ) ? '0'.$v[0] : $v[0];
|
||||
|
||||
$values[] = $v[2] . '-' . $v[1] . '-' . $v[0];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
$v = explode('/',$value);
|
||||
|
||||
$v[1]= ( $v[1] < 10 ) ? '0'. $v[1] : $v[1];
|
||||
$v[0]= ( $v[0] < 10 ) ? '0'. $v[0] : $v[0];
|
||||
$v[0]= ( $v[0] < 10 ) ? '0'. $v[0] : $v[0];
|
||||
|
||||
$values = $v[2] . '-' . $v[1] . '-' . $v[0];
|
||||
}
|
||||
|
@ -386,12 +386,12 @@ class Old_Tainacan extends Importer{
|
|||
$item_metadata->set_value($value);
|
||||
|
||||
} else if( $metadatum->type === 'item' ){ // RELATIONSHIPS
|
||||
|
||||
|
||||
/**
|
||||
* save the values to allow set the correct collection
|
||||
* in metadata option in next step
|
||||
*/
|
||||
$relationships[$new_tainacanid][$item->get_id()] = $value;
|
||||
$relationships[$new_tainacanid][$item->get_id()] = $value;
|
||||
|
||||
} else {
|
||||
|
||||
|
@ -403,7 +403,7 @@ class Old_Tainacan extends Importer{
|
|||
|
||||
if( $id )
|
||||
$values[] = intval($id);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
$id = $this->get_transient('term_' . $value . '_id');
|
||||
|
@ -456,7 +456,7 @@ class Old_Tainacan extends Importer{
|
|||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -469,17 +469,17 @@ class Old_Tainacan extends Importer{
|
|||
$args = array(
|
||||
'timeout' => 30,
|
||||
'redirection' => 30,
|
||||
);
|
||||
);
|
||||
|
||||
$info = wp_remote_get( $this->get_url() . $this->tainacan_api_address . "/collections/".$collection_id."/items?includeMetadata=1&filter[page]=" . $page, $args );
|
||||
|
||||
$info = wp_remote_get( $this->get_url() . $this->tainacan_api_address . "/collections/".$collection_id."/items?includeMetadata=1&filter[page]=" . $page, $args );
|
||||
|
||||
if( !isset($info['body']) ){
|
||||
$this->add_error_log($result->get_error_message());
|
||||
$this->add_error_log('Error in fetch remote first page item');
|
||||
$this->abort();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$info = json_decode($info['body']);
|
||||
|
||||
while( isset($info->items) && count( $info->items ) > 0 ){
|
||||
|
@ -489,7 +489,7 @@ class Old_Tainacan extends Importer{
|
|||
}
|
||||
|
||||
$page++;
|
||||
$info = wp_remote_get( $this->get_url() . $this->tainacan_api_address . "/collections/".$collection_id."/items?includeMetadata=1&filter[page]=" . $page, $args );
|
||||
$info = wp_remote_get( $this->get_url() . $this->tainacan_api_address . "/collections/".$collection_id."/items?includeMetadata=1&filter[page]=" . $page, $args );
|
||||
$info = json_decode($info['body']);
|
||||
|
||||
if( !isset($info['body']) ){
|
||||
|
@ -498,8 +498,8 @@ class Old_Tainacan extends Importer{
|
|||
$this->abort();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $items;
|
||||
}
|
||||
|
||||
|
@ -593,7 +593,7 @@ class Old_Tainacan extends Importer{
|
|||
}
|
||||
|
||||
/**
|
||||
* executes the request
|
||||
* executes the request
|
||||
*/
|
||||
protected function requester( $link ){
|
||||
$has_response = false;
|
||||
|
@ -609,13 +609,13 @@ class Old_Tainacan extends Importer{
|
|||
$result = wp_remote_get($link, $args);
|
||||
|
||||
while( !$has_response ){
|
||||
|
||||
|
||||
if (is_wp_error($result)) {
|
||||
|
||||
$this->add_log($result->get_error_message());
|
||||
$this->add_log('Error in fetch remote' . $url);
|
||||
$this->add_log('request number ' . $requests);
|
||||
|
||||
|
||||
} else if (isset($result['body'])){
|
||||
$this->add_log('fetch OK ');
|
||||
return $result;
|
||||
|
@ -627,7 +627,7 @@ class Old_Tainacan extends Importer{
|
|||
|
||||
if( $requests > 3 ){
|
||||
$this->add_log('taking a moment to breathe, waiting for ' . ( $requests * 10 ) . ' seconds ' );
|
||||
sleep( $requests * 10 );
|
||||
sleep( $requests * 10 );
|
||||
}
|
||||
|
||||
$args = array(
|
||||
|
@ -635,14 +635,14 @@ class Old_Tainacan extends Importer{
|
|||
'redirection' => 30,
|
||||
'sslverify' => false
|
||||
);
|
||||
|
||||
|
||||
$result = wp_remote_get($link, $args);
|
||||
|
||||
$requests++;
|
||||
$this->add_log('going to ' . $requests );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$this->add_error_log('Error in fetch remote, expired the 10 requests limit ' . $url);
|
||||
$this->abort();
|
||||
|
@ -653,7 +653,7 @@ class Old_Tainacan extends Importer{
|
|||
* create recursively the terms from tainacan OLD
|
||||
*
|
||||
* @param Entities\Taxonomy $taxonomy_father
|
||||
* @param array $children Array of taxonomies from tainacan old
|
||||
* @param array $children Array of taxonomies from tainacan old
|
||||
* @param (optional) int $term_father the ID of father
|
||||
*
|
||||
* @return array
|
||||
|
@ -661,7 +661,7 @@ class Old_Tainacan extends Importer{
|
|||
protected function add_all_terms($taxonomy_father, $children, $term_father = null){
|
||||
|
||||
$this->add_log('adding terms');
|
||||
|
||||
|
||||
foreach ($children as $term) {
|
||||
|
||||
$new_term = new Entities\Term();
|
||||
|
@ -672,27 +672,27 @@ class Old_Tainacan extends Importer{
|
|||
if($term_father){
|
||||
$new_term->set_parent($term_father->get_id());
|
||||
}
|
||||
|
||||
|
||||
// block terms with same name and parent in taxonomy
|
||||
if( get_term_by( 'name', $term->name, $taxonomy_father->get_db_identifier()) ){
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if ($new_term->validate()) {
|
||||
$inserted_term = $this->term_repo->insert($new_term);
|
||||
} else {
|
||||
$this->add_log( implode(',', $new_term->get_errors()) );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (is_wp_error($inserted_term)) {
|
||||
|
||||
$this->add_log($inserted_term->get_error_message());
|
||||
|
||||
|
||||
} else {
|
||||
$this->add_log('Added term: ' . $inserted_term->get_name() . ' in tax: ' . $taxonomy_father->get_name());
|
||||
$this->add_log('Added term before id ' . $term->term_id );
|
||||
$this->add_log('Added term before ID ' . $term->term_id );
|
||||
}
|
||||
|
||||
/*Insert old tainacan id*/
|
||||
|
@ -709,8 +709,8 @@ class Old_Tainacan extends Importer{
|
|||
|
||||
/**
|
||||
* create the a Metadatum in tainacan
|
||||
*
|
||||
* @return int $metadatum_id
|
||||
*
|
||||
* @return int $metadatum_id
|
||||
*/
|
||||
protected function create_metadata( $node_metadata_old, $collection_id = null){
|
||||
$this->add_log('Creating metadata' . $meta->name);
|
||||
|
@ -751,7 +751,7 @@ class Old_Tainacan extends Importer{
|
|||
return false;
|
||||
}
|
||||
} else if(strcmp($type, "Compound") === 0){
|
||||
|
||||
|
||||
if( isset( $meta->metadata->children ) ){
|
||||
foreach( $meta->metadata->children as $child ){
|
||||
$this->create_metadata( $child, $collection_id);
|
||||
|
@ -778,9 +778,9 @@ class Old_Tainacan extends Importer{
|
|||
|
||||
if($newMetadatum->validate()){
|
||||
$inserted_metadata = $this->metadata_repo->insert( $newMetadatum );
|
||||
|
||||
|
||||
$this->add_log('Metadata created: ' . $inserted_metadata->get_name());
|
||||
|
||||
|
||||
$this->add_transient('metadata_' . $inserted_metadata->get_id() . '_id', $inserted_metadata->get_id());
|
||||
|
||||
if(isset( $related_name) ){
|
||||
|
@ -788,48 +788,48 @@ class Old_Tainacan extends Importer{
|
|||
}
|
||||
|
||||
return $inserted_metadata->get_id();
|
||||
} else{
|
||||
} else{
|
||||
$this->add_log('Error creating metadata ' . $name . ' in collection ' . $collection_id);
|
||||
$this->add_log($newMetadatum->get_errors());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* create the collection in tainacan
|
||||
*
|
||||
* @return int $metadatum_id
|
||||
*
|
||||
* @return int $metadatum_id
|
||||
*/
|
||||
protected function create_collection( $node_collection ){
|
||||
$new_collection = new Entities\Collection();
|
||||
$new_collection->set_name($node_collection->post_title);
|
||||
$new_collection->set_status('publish');
|
||||
$new_collection->validate();
|
||||
|
||||
|
||||
|
||||
if($new_collection->validate()){
|
||||
$new_collection =$this->col_repo->insert($new_collection);
|
||||
|
||||
|
||||
$this->add_log('Collection created: ' . $new_collection->get_name());
|
||||
|
||||
if( $new_collection )
|
||||
$this->add_transient('collection_' . $node_collection->ID . '_name', $new_collection->get_id());
|
||||
|
||||
return $new_collection->get_id();
|
||||
} else{
|
||||
} else{
|
||||
$this->add_error_log('Error creating collection ' . $node_collection->post_title );
|
||||
$this->add_error_log($new_collection->get_errors());
|
||||
$this->abort();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Define the class to create in new Tainacan
|
||||
*
|
||||
*
|
||||
* @param string $type The type from tainacan old
|
||||
*
|
||||
*
|
||||
* @return string the class name
|
||||
*/
|
||||
private function define_type($type){
|
||||
|
@ -848,16 +848,16 @@ class Old_Tainacan extends Importer{
|
|||
$type = "Compound";
|
||||
} else {
|
||||
$type = 'Text';
|
||||
}
|
||||
}
|
||||
|
||||
return $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* create attachments, document and thumb from old
|
||||
*
|
||||
* @param string $node_old
|
||||
*
|
||||
*
|
||||
* @param string $node_old
|
||||
*
|
||||
* @return string the class name
|
||||
*/
|
||||
private function insert_files( $node_old, $item ){
|
||||
|
@ -867,7 +867,7 @@ class Old_Tainacan extends Importer{
|
|||
|
||||
foreach( $types as $type){
|
||||
if( isset( $node_old->attachments->$type ) ){
|
||||
|
||||
|
||||
foreach( $node_old->attachments->$type as $attach){
|
||||
$TainacanMedia->insert_attachment_from_url($attach->url, $item->get_id());
|
||||
}
|
||||
|
@ -883,7 +883,7 @@ class Old_Tainacan extends Importer{
|
|||
|
||||
if( isset( $node_old->content_tainacan ) && $node_old->content_tainacan ){
|
||||
$TainacanMedia = \Tainacan\Media::get_instance();
|
||||
|
||||
|
||||
if( isset($node_old->content_tainacan->guid) ){
|
||||
$id = $TainacanMedia->insert_attachment_from_url( $node_old->content_tainacan->guid, $item->get_id());
|
||||
|
||||
|
@ -891,13 +891,13 @@ class Old_Tainacan extends Importer{
|
|||
$item->set_document( $id );
|
||||
$item->set_document_type( 'attachment' );
|
||||
$this->add_log('Document imported from ' . $node_old->content_tainacan->guid);
|
||||
}
|
||||
}
|
||||
} else if( isset($node_old->type_tainacan) && in_array( $node_old->type_tainacan, ['audio','video','image']) ){
|
||||
$item->set_document( $node_old->content_tainacan );
|
||||
$item->set_document_type( 'url' );
|
||||
$this->add_log('URL imported from ' . $node_old->content_tainacan);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if( $item->validate() )
|
||||
|
|
|
@ -79,7 +79,7 @@ class Term_Importer extends Importer {
|
|||
<h5><?php _e('Existing Taxonomy', 'tainacan'); ?></h5>
|
||||
</div>
|
||||
<div class="help-tooltip-body">
|
||||
<p><?php _e('Inform the taxonomy you want to import the terms to.', 'tainacan'); ?></p>
|
||||
<p><?php _e('Specify the taxonomy you want to import the terms to.', 'tainacan'); ?></p>
|
||||
<p><?php _e('Select an existing taxonomy or create a new one on the fly.', 'tainacan'); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -106,7 +106,7 @@ class Term_Importer extends Importer {
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<?php
|
||||
return ob_get_clean();
|
||||
|
|
|
@ -23,8 +23,11 @@ class Mappers_Handler {
|
|||
self::$instance = $this;
|
||||
|
||||
add_action('init', array(&$this, 'init'));
|
||||
|
||||
|
||||
// @deprecated, we shall use tainacan-i18n now.
|
||||
add_filter( 'tainacan-admin-i18n', [$this, 'mappers_i18n']);
|
||||
|
||||
add_filter( 'tainacan-i18n', [$this, 'mappers_i18n']);
|
||||
|
||||
add_action('tainacan-api-collection-created', [$this, 'create_mapped_collection'], 10, 2);
|
||||
|
||||
|
|
|
@ -91,10 +91,10 @@ class Collections extends Repository {
|
|||
],
|
||||
'default_orderby' => [
|
||||
'map' => 'meta',
|
||||
'title' => __( 'Default Order metadata', 'tainacan' ),
|
||||
'type' => 'string',
|
||||
'description' => __( 'Default property items in this collections will be ordered by', 'tainacan' ),
|
||||
'default' => 'name',
|
||||
'title' => __( 'Default order metadata', 'tainacan' ),
|
||||
'type' => ['string', 'array', 'object'],
|
||||
'description' => __( 'Default property that items in this collections will be ordered by', 'tainacan' ),
|
||||
'default' => 'creation_date',
|
||||
//'validation' => v::stringType(),
|
||||
],
|
||||
'default_order' => [
|
||||
|
@ -284,6 +284,7 @@ class Collections extends Repository {
|
|||
'rewrite' => ['slug' => sanitize_title(_x('collections', 'Slug: the string that will be used to build the URL', 'tainacan'))],
|
||||
'capabilities' => (array) $this->get_capabilities(),
|
||||
'map_meta_cap' => true,
|
||||
'show_in_rest' => true,
|
||||
'supports' => [
|
||||
'title',
|
||||
'editor',
|
||||
|
|
|
@ -153,41 +153,42 @@ class Filters extends Repository {
|
|||
* @param Entities\Metadatum $metadatum
|
||||
* @return int
|
||||
*
|
||||
public function insert($metadatum) {
|
||||
// First iterate through the native post properties
|
||||
$map = $this->get_map();
|
||||
foreach ($map as $prop => $mapped) {
|
||||
if ($mapped['map'] != 'meta' && $mapped['map'] != 'meta_multi') {
|
||||
$metadatum->WP_Post->{$mapped['map']} = $metadatum->get_mapped_property($prop);
|
||||
}
|
||||
}
|
||||
|
||||
// save post and get its ID
|
||||
$metadatum->WP_Post->post_type = Entities\Filter::get_post_type();
|
||||
$metadatum->WP_Post->post_status = 'publish';
|
||||
$id = wp_insert_post($metadatum->WP_Post);
|
||||
$metadatum->WP_Post = get_post($id);
|
||||
|
||||
// Now run through properties stored as postmeta
|
||||
foreach ($map as $prop => $mapped) {
|
||||
if ($mapped['map'] == 'meta') {
|
||||
update_post_meta($id, $prop, $metadatum->get_mapped_property($prop));
|
||||
} elseif ($mapped['map'] == 'meta_multi') {
|
||||
$values = $metadatum->get_mapped_property($prop);
|
||||
|
||||
delete_post_meta($id, $prop);
|
||||
|
||||
if (is_array($values)){
|
||||
foreach ($values as $value){
|
||||
add_post_meta($id, $prop, $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// return a brand new object
|
||||
return new Entities\Filter($metadatum->WP_Post);
|
||||
}*/
|
||||
* public function insert($metadatum) {
|
||||
* // First iterate through the native post properties
|
||||
* $map = $this->get_map();
|
||||
* foreach ($map as $prop => $mapped) {
|
||||
* if ($mapped['map'] != 'meta' && $mapped['map'] != 'meta_multi') {
|
||||
* $metadatum->WP_Post->{$mapped['map']} = $metadatum->get_mapped_property($prop);
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* // save post and get its ID
|
||||
* $metadatum->WP_Post->post_type = Entities\Filter::get_post_type();
|
||||
* $metadatum->WP_Post->post_status = 'publish';
|
||||
* $id = wp_insert_post($metadatum->WP_Post);
|
||||
* $metadatum->WP_Post = get_post($id);
|
||||
*
|
||||
* // Now run through properties stored as postmeta
|
||||
* foreach ($map as $prop => $mapped) {
|
||||
* if ($mapped['map'] == 'meta') {
|
||||
* update_post_meta($id, $prop, $metadatum->get_mapped_property($prop));
|
||||
* } elseif ($mapped['map'] == 'meta_multi') {
|
||||
* $values = $metadatum->get_mapped_property($prop);
|
||||
*
|
||||
* delete_post_meta($id, $prop);
|
||||
*
|
||||
* if (is_array($values)){
|
||||
* foreach ($values as $value){
|
||||
* add_post_meta($id, $prop, $value);
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* // return a brand new object
|
||||
* return new Entities\Filter($metadatum->WP_Post);
|
||||
*}
|
||||
*/
|
||||
|
||||
public function update( $object, $new_values = null ) {
|
||||
return $this->insert( $object );
|
||||
|
@ -378,7 +379,7 @@ class Filters extends Repository {
|
|||
$original_meta_q = isset( $args['meta_query'] ) ? $args['meta_query'] : [];
|
||||
|
||||
/**
|
||||
* Since we introduced roles & capabalities management, we can not rely
|
||||
* Since we introduced roles & capabalities management, we cannot rely
|
||||
* on WordPress behavior when handling default post status values.
|
||||
* WordPress checks if the current user can read_priva_posts, but this is
|
||||
* not enough for us. We have to handle this ourselves to mimic WordPress behavior
|
||||
|
@ -476,7 +477,7 @@ class Filters extends Repository {
|
|||
$original_meta_q = isset( $args['meta_query'] ) ? $args['meta_query'] : [];
|
||||
|
||||
/**
|
||||
* Since we introduced roles & capabalities management, we can not rely
|
||||
* Since we introduced roles & capabalities management, we cannot rely
|
||||
* on WordPress behavior when handling default post status values.
|
||||
* WordPress checks if the current user can read_priva_posts, but this is
|
||||
* not enough for us. We have to handle this ourselves to mimic WordPress behavior
|
||||
|
|
|
@ -165,7 +165,7 @@ class Item_Metadata extends Repository {
|
|||
|
||||
if ( $taxonomy ) {
|
||||
|
||||
// We can not simply use wp_set_object_terms() because it uses term_exists() which is not reliable
|
||||
// We cannot simply use wp_set_object_terms() because it uses term_exists() which is not reliable
|
||||
// see https://core.trac.wordpress.org/ticket/45333 and https://core.trac.wordpress.org/ticket/47099
|
||||
// $success = wp_set_object_terms( $item_metadata->get_item()->get_id(), $new_terms, $taxonomy->get_db_identifier() );
|
||||
|
||||
|
@ -438,7 +438,7 @@ class Item_Metadata extends Repository {
|
|||
if ( is_array( $ids ) ) {
|
||||
foreach ( $ids as $id ) {
|
||||
$post_meta_object = get_metadata_by_mid( 'post', $id );
|
||||
if ( is_object( $post_meta_object ) ) {
|
||||
if ( is_object( $post_meta_object ) && get_post($post_meta_object->meta_key) !== null ) {
|
||||
$metadatum = new Entities\Metadatum( $post_meta_object->meta_key );
|
||||
$return_value[ $metadatum->get_id() ] = new Entities\Item_Metadata_Entity( $item, $metadatum, $id, (int)$compound_meta_id );
|
||||
}
|
||||
|
|
|
@ -117,6 +117,13 @@ class Items extends Repository {
|
|||
'context' => array( 'view', 'edit', 'embed' ),
|
||||
'default' => false
|
||||
),
|
||||
'is_image' => array(
|
||||
'title' => __( 'Is link to external image', 'tainacan' ),
|
||||
'description' => __( 'Is link to external image', 'tainacan' ),
|
||||
'type' => 'boolean',
|
||||
'context' => array( 'view', 'edit', 'embed' ),
|
||||
'default' => false
|
||||
),
|
||||
'forced_iframe_height' => array(
|
||||
'description' => __( 'Iframe height (px)', 'tainacan' ),
|
||||
'type' => 'number',
|
||||
|
@ -258,7 +265,7 @@ class Items extends Repository {
|
|||
$no_collection_set = false;
|
||||
|
||||
/**
|
||||
* We can not use $collections->fetch() here because facets
|
||||
* We cannot use $collections->fetch() here because facets
|
||||
* filter wp_query to just return the query and not the results
|
||||
* See Repositories\Metadata::fetch_all_metadatum_values()
|
||||
*
|
||||
|
@ -340,6 +347,10 @@ class Items extends Repository {
|
|||
$args['orderby'] = $new_order;
|
||||
}
|
||||
|
||||
if ( defined('TAINACAN_ENABLE_RELATIONSHIP_METAQUERY') && true === TAINACAN_ENABLE_RELATIONSHIP_METAQUERY ) {
|
||||
$args = $this->parse_relationship_metaquery($args);
|
||||
}
|
||||
|
||||
$args = apply_filters( 'tainacan_fetch_args', $args, 'items' );
|
||||
|
||||
$should_filter = is_user_logged_in() && ! isset($args['post_status']) && sizeof($cpt) > 1;
|
||||
|
@ -691,4 +702,44 @@ class Items extends Repository {
|
|||
return $response;
|
||||
}
|
||||
|
||||
private function parse_relationship_metaquery ($args) {
|
||||
if( isset($args['meta_query']) ) {
|
||||
$Tainacan_Metadata = \Tainacan\Repositories\Metadata::get_instance();
|
||||
foreach($args['meta_query'] as $idx => $meta) {
|
||||
$meta_id = $meta['key'];
|
||||
$metadata = $Tainacan_Metadata->fetch($meta_id);
|
||||
if(
|
||||
isset($metadata) &&
|
||||
$metadata instanceof \Tainacan\Entities\Metadatum &&
|
||||
$metadata->get_metadata_type() === 'Tainacan\\Metadata_Types\\Relationship' &&
|
||||
(isset($meta['compare']) && !in_array($meta['compare'], ['IN', 'NOT IN', '=']))
|
||||
) {
|
||||
$options = $metadata->get_metadata_type_options();
|
||||
if( isset($options) && isset($options['search']) ) {
|
||||
$this->relationsip_metaquery = array(
|
||||
'meta_id' => $meta_id,
|
||||
'search_meta_id' => $options['search'],
|
||||
'search_meta_value' => $args['meta_query'][$idx]['value']
|
||||
);
|
||||
$args['meta_query'][$idx]['compare'] = '!=';
|
||||
$args['meta_query'][$idx]['value'] = '';
|
||||
add_filter( 'posts_where' , array($this, 'posts_where_relationship_metaquery'), 10, 1 );
|
||||
return $args;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $args;
|
||||
}
|
||||
|
||||
function posts_where_relationship_metaquery( $where ) {
|
||||
$meta_id = $this->relationsip_metaquery['meta_id'];
|
||||
$search_meta_id = $this->relationsip_metaquery['search_meta_id'];
|
||||
$search_meta_value = $this->relationsip_metaquery['search_meta_value'];
|
||||
$SQL_related_item = " SELECT DISTINCT post_id FROM wp_postmeta WHERE meta_key=$search_meta_id AND meta_value LIKE '%$search_meta_value%'";
|
||||
$where .= " AND (wp_postmeta.meta_key = '$meta_id' AND wp_postmeta.meta_value IN ( $SQL_related_item ) ) ";
|
||||
remove_filter( 'posts_where', array($this, 'posts_where_relationship_metaquery') );
|
||||
return $where;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -33,15 +33,15 @@ class Logs extends Repository {
|
|||
parent::__construct();
|
||||
|
||||
add_action( 'tainacan-pre-insert', array( $this, 'pre_insert_entity' ) );
|
||||
|
||||
|
||||
add_action( 'tainacan-insert', array( $this, 'insert_entity' ) );
|
||||
add_action( 'tainacan-deleted', array( $this, 'delete_entity' ), 10, 2 );
|
||||
add_action( 'tainacan-pre-delete', array( $this, 'pre_delete_entity' ), 10, 2 );
|
||||
|
||||
|
||||
add_action( 'add_attachment', array( $this, 'insert_attachment' ) );
|
||||
add_action( 'delete_attachment', array( $this, 'pre_delete_attachment' ) );
|
||||
add_action( 'delete_post', array( $this, 'delete_attachment' ) );
|
||||
|
||||
|
||||
add_filter('tainacan-log-set-title', [$this, 'filter_log_title']);
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ class Logs extends Repository {
|
|||
'object_id' => [
|
||||
'map' => 'meta',
|
||||
'title' => __( 'Log item relationship', 'tainacan' ),
|
||||
'description' => __( 'The id of the object that this log is related to', 'tainacan' ),
|
||||
'description' => __( 'The ID of the object that this log is related to', 'tainacan' ),
|
||||
],
|
||||
'object_type' => [
|
||||
'map' => 'meta',
|
||||
|
@ -117,7 +117,7 @@ class Logs extends Repository {
|
|||
],
|
||||
'old_value' => [
|
||||
'map' => 'meta',
|
||||
'title' => __( 'Old Value', 'tainacan' ),
|
||||
'title' => __( 'Old value', 'tainacan' ),
|
||||
],
|
||||
'new_value' => [
|
||||
'map' => 'meta',
|
||||
|
@ -182,7 +182,7 @@ class Logs extends Repository {
|
|||
* to learn all args accepted in the $args parameter (@see https://developer.wordpress.org/reference/classes/wp_query/)
|
||||
* You can also use a mapped property, such as name and description, as an argument and it will be mapped to the
|
||||
* appropriate WP_Query argument
|
||||
*
|
||||
*
|
||||
* If a number is passed to $args, it will return a \Tainacan\Entities\Log object. But if the post is not found or
|
||||
* does not match the entity post type, it will return an empty array
|
||||
*
|
||||
|
@ -193,7 +193,7 @@ class Logs extends Repository {
|
|||
*/
|
||||
public function fetch( $args = [], $output = null ) {
|
||||
if ( is_numeric( $args ) ) {
|
||||
|
||||
|
||||
$existing_post = get_post( $args );
|
||||
if ( $existing_post instanceof \WP_Post ) {
|
||||
try {
|
||||
|
@ -225,7 +225,7 @@ class Logs extends Repository {
|
|||
public function update( $object, $new_values = null ) {
|
||||
return $this->insert( $object );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Feth most recent log
|
||||
* @return Entities\Log The most recent Log entity
|
||||
|
@ -255,11 +255,11 @@ class Logs extends Repository {
|
|||
$entity = Repository::get_entity_by_post( $post );
|
||||
|
||||
if ( $entity ) { // attached to a tainacan entity
|
||||
|
||||
|
||||
$log = new Entities\Log();
|
||||
|
||||
|
||||
$collection_id = method_exists($entity, 'get_collection_id') ? $entity->get_collection_id() : 'default';
|
||||
|
||||
|
||||
if ( method_exists($entity, 'get_repository') && !$entity->get_repository()->use_logs ) {
|
||||
return;
|
||||
}
|
||||
|
@ -272,24 +272,24 @@ class Logs extends Repository {
|
|||
$log->set_item_id($entity->get_id());
|
||||
$log->set_title( sprintf( __( 'New file was attached to Item "%s"', 'tainacan'), $entity->get_title() ) );
|
||||
}
|
||||
|
||||
|
||||
$object_type = get_class($entity);
|
||||
$object_id = $entity->get_id();
|
||||
|
||||
|
||||
$log->set_collection_id($collection_id);
|
||||
$log->set_object_type($object_type);
|
||||
$log->set_object_id($object_id);
|
||||
$log->set_action('new-attachment');
|
||||
|
||||
|
||||
$prepared = [
|
||||
'id' => $attachment->ID,
|
||||
'title' => $attachment->post_title,
|
||||
'description' => $attachment->post_content,
|
||||
'mime_type' => $attachment->post_mime_type,
|
||||
];
|
||||
|
||||
|
||||
$log->set_new_value($prepared);
|
||||
|
||||
|
||||
if ( $log->validate() ) {
|
||||
$this->insert($log);
|
||||
}
|
||||
|
@ -298,28 +298,28 @@ class Logs extends Repository {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Callback to generate log when attachments attached to any Tainacan entity are deleted
|
||||
*/
|
||||
public function pre_delete_attachment($attachment_id) {
|
||||
|
||||
|
||||
$attachment_post = get_post($attachment_id);
|
||||
|
||||
|
||||
$entity_post = get_post($attachment_post->post_parent);
|
||||
|
||||
if ( $entity_post ) {
|
||||
try {
|
||||
$entity = Repository::get_entity_by_post( $entity_post );
|
||||
|
||||
|
||||
if ( $entity ) {
|
||||
if ( method_exists($entity, 'get_repository') && !$entity->get_repository()->use_logs ) {
|
||||
return;
|
||||
}
|
||||
$collection_id = method_exists($entity, 'get_collection_id') ? $entity->get_collection_id() : 'default';
|
||||
|
||||
|
||||
$log = new Entities\Log();
|
||||
|
||||
|
||||
if ( $entity instanceof Entities\Collection ) {
|
||||
$collection_id = $entity->get_id();
|
||||
$log->set_title( sprintf(__( 'File attached to Collection "%s" was removed', 'tainacan'), $entity->get_name() ) );
|
||||
|
@ -328,32 +328,32 @@ class Logs extends Repository {
|
|||
$log->set_item_id($entity->get_id());
|
||||
$log->set_title( sprintf( __( 'File attached to Item "%s" was removed' , 'tainacan'), $entity->get_title() ) );
|
||||
}
|
||||
|
||||
|
||||
$object_type = get_class($entity);
|
||||
$object_id = $entity->get_id();
|
||||
|
||||
|
||||
$preapred = [
|
||||
'id' => $attachment_id,
|
||||
'title' => $attachment_post->post_title,
|
||||
'description' => $attachment_post->post_content,
|
||||
];
|
||||
|
||||
|
||||
$log->set_collection_id($collection_id);
|
||||
$log->set_object_type($object_type);
|
||||
$log->set_object_id($object_id);
|
||||
$log->set_old_value($preapred);
|
||||
$log->set_action('delete-attachment');
|
||||
|
||||
|
||||
$this->current_attachment_delete_log = $log;
|
||||
|
||||
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
error_log("[pre_delete_attachment]:" . $e->getMessage());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Callback to generate log when attachments attached to any Tainacan entity are deleted
|
||||
*/
|
||||
|
@ -366,7 +366,7 @@ class Logs extends Repository {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Compare two repository entities and sets the current_diff property to be used in the insert hook
|
||||
*
|
||||
|
@ -379,20 +379,20 @@ class Logs extends Repository {
|
|||
if ( ! $unsaved->get_repository()->use_logs ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if ( $unsaved instanceof Entities\Item_Metadata_Entity ) {
|
||||
return $this->prepare_item_metadata_diff($unsaved);
|
||||
}
|
||||
|
||||
|
||||
// do not log a log
|
||||
if ( ( method_exists( $unsaved, 'get_post_type' ) && $unsaved->get_post_type() === 'tainacan-log' ) || $unsaved->get_status() === 'auto-draft' ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$creating = true;
|
||||
|
||||
|
||||
$old = null;
|
||||
|
||||
|
||||
if ( is_numeric( $unsaved->get_id() ) ) {
|
||||
if ( $unsaved instanceof Entities\Term ) {
|
||||
$old = $unsaved->get_repository()->fetch( $unsaved->get_id(), $unsaved->get_taxonomy() );
|
||||
|
@ -400,78 +400,78 @@ class Logs extends Repository {
|
|||
$old = $unsaved->get_repository()->fetch( $unsaved->get_id() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if ( $old instanceof Entities\Entity ) {
|
||||
|
||||
|
||||
if ( $old->get_status() !== 'auto-draft' ) {
|
||||
$creating = false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
$diff = [
|
||||
'old' => [],
|
||||
'new' => []
|
||||
];
|
||||
|
||||
|
||||
$has_diff = false;
|
||||
|
||||
|
||||
if ( $creating ) {
|
||||
$diff['new'] = $unsaved->_toArray();
|
||||
$has_diff = true;
|
||||
} else {
|
||||
$map = $unsaved->get_repository()->get_map();
|
||||
|
||||
|
||||
foreach ( $map as $prop => $mapped ) {
|
||||
if ( $old->get( $prop ) != $unsaved->get( $prop ) ) {
|
||||
|
||||
|
||||
$diff['old'][$prop] = $old->get( $prop );
|
||||
$diff['new'][$prop] = $unsaved->get( $prop );
|
||||
$has_diff = true;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$diff = apply_filters( 'tainacan-entity-diff', $diff, $unsaved, $old );
|
||||
|
||||
|
||||
$this->current_diff = $has_diff ? $diff : false;
|
||||
$this->current_action = $creating ? 'create' : 'update';
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private function prepare_item_metadata_diff( Entities\Entity $unsaved ) {
|
||||
|
||||
|
||||
$diff = [
|
||||
'old' => [],
|
||||
'new' => []
|
||||
];
|
||||
|
||||
|
||||
$old = new Entities\Item_Metadata_Entity($unsaved->get_item(), $unsaved->get_metadatum());
|
||||
|
||||
|
||||
add_filter('tainacan-item-metadata-get-multivalue-separator', [$this, '__temporary_multivalue_separator']);
|
||||
|
||||
|
||||
if ( $old instanceof Entities\Item_Metadata_Entity ) {
|
||||
$diff['old'] = \explode($this->__temporary_multivalue_separator(''), $old->get_value_as_string());
|
||||
}
|
||||
|
||||
|
||||
$diff['new'] = \explode($this->__temporary_multivalue_separator(''), $unsaved->get_value_as_string());
|
||||
|
||||
|
||||
remove_filter('tainacan-item-metadata-get-multivalue-separator', [$this, '__temporary_multivalue_separator']);
|
||||
|
||||
|
||||
$diff = apply_filters( 'tainacan-entity-diff', $diff, $unsaved, $old );
|
||||
|
||||
|
||||
$this->current_diff = $diff;
|
||||
$this->current_action = 'update-metadata-value';
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function __temporary_multivalue_separator($sep) {
|
||||
return '--xx--';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Callback to generate log when Tainacan entities are edited
|
||||
*/
|
||||
|
@ -480,31 +480,31 @@ class Logs extends Repository {
|
|||
if ( ! $entity->get_repository()->use_logs ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if ( $entity instanceof Entities\Item_Metadata_Entity ) {
|
||||
return $this->insert_item_metadata($entity);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// do not log a log
|
||||
if ( ( method_exists( $entity, 'get_post_type' ) && $entity->get_post_type() === 'tainacan-log' ) || $entity->get_status() === 'auto-draft' ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$log = new Entities\Log();
|
||||
$log->set_action($this->current_action);
|
||||
|
||||
|
||||
$collection_id = method_exists($entity, 'get_collection_id') ? $entity->get_collection_id() : 'default';
|
||||
|
||||
|
||||
$diff = $this->current_diff;
|
||||
|
||||
|
||||
if (false === $diff) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if ( $entity instanceof Entities\Collection ) {
|
||||
|
||||
|
||||
$collection_id = $entity->get_id();
|
||||
|
||||
|
||||
if ($this->current_action == 'update') {
|
||||
if (isset($diff['new']['metadata_order'])) {
|
||||
$log->set_title( sprintf( __( 'Collection "%s" metadata order was updated', 'tainacan'), $entity->get_name() ) );
|
||||
|
@ -518,11 +518,11 @@ class Logs extends Repository {
|
|||
} elseif ($this->current_action == 'create') {
|
||||
$log->set_title( sprintf( __( 'Collection "%s" was created', 'tainacan'), $entity->get_name() ) );
|
||||
}
|
||||
|
||||
|
||||
} elseif ( $entity instanceof Entities\Item ) {
|
||||
|
||||
|
||||
$log->set_item_id($entity->get_id());
|
||||
|
||||
|
||||
if ($this->current_action == 'update') {
|
||||
if (isset($diff['new']['document'])) {
|
||||
$log->set_title( sprintf( __( 'Item "%s" document was updated', 'tainacan'), $entity->get_title() ) );
|
||||
|
@ -537,7 +537,7 @@ class Logs extends Repository {
|
|||
$log->set_title( sprintf( __( 'Item "%1$s" was created with the ID %2$s', 'tainacan'), $entity->get_title(), $entity->get_id() ) );
|
||||
}
|
||||
} elseif ( $entity instanceof Entities\Filter ) {
|
||||
|
||||
|
||||
if ( 'default' == $collection_id ) {
|
||||
if ($this->current_action == 'update') {
|
||||
$log->set_title( sprintf( __( 'Filter "%1$s" was updated in repository level', 'tainacan'), $entity->get_name() ) );
|
||||
|
@ -551,9 +551,9 @@ class Logs extends Repository {
|
|||
$log->set_title( sprintf( __( 'Filter "%1$s" was added to Collection "%2$s"', 'tainacan'), $entity->get_name(), $entity->get_collection()->get_name() ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} elseif ( $entity instanceof Entities\Metadatum ) {
|
||||
|
||||
|
||||
if ( 'default' == $collection_id ) {
|
||||
if ($this->current_action == 'update') {
|
||||
$log->set_title( sprintf( __( 'Metadatum "%s" was updated in repository level', 'tainacan'), $entity->get_name() ) );
|
||||
|
@ -567,99 +567,99 @@ class Logs extends Repository {
|
|||
$log->set_title( sprintf( __( 'Metadatum "%1$s" was added to Collection "%2$s"', 'tainacan'), $entity->get_name(), $entity->get_collection()->get_name() ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} elseif ( $entity instanceof Entities\Taxonomy ) {
|
||||
|
||||
|
||||
if ($this->current_action == 'update') {
|
||||
$log->set_title( sprintf( __( 'Taxonomy "%s" was updated', 'tainacan'), $entity->get_name() ) );
|
||||
} elseif ($this->current_action == 'create') {
|
||||
$log->set_title( sprintf( __( 'Taxonomy "%1$s" was created', 'tainacan'), $entity->get_name() ) );
|
||||
}
|
||||
|
||||
|
||||
} elseif ( $entity instanceof Entities\Term ) {
|
||||
|
||||
|
||||
$taxonomy = Taxonomies::get_instance()->fetch_by_db_identifier($entity->get_taxonomy());
|
||||
$tax_name = '';
|
||||
if ($taxonomy instanceof Entities\Taxonomy) {
|
||||
$tax_name = $taxonomy->get_name();
|
||||
}
|
||||
|
||||
|
||||
if ($this->current_action == 'update') {
|
||||
$log->set_title( sprintf( __( 'Term "%1$s" was updated in "%2$s" taxonomy', 'tainacan'), $entity->get_name(), $tax_name ) );
|
||||
} elseif ($this->current_action == 'create') {
|
||||
$log->set_title( sprintf( __( 'Term "%1$s" was added to "%2$s" taxonomy', 'tainacan'), $entity->get_name(), $tax_name ) );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
$object_type = get_class($entity);
|
||||
$object_id = $entity->get_id();
|
||||
|
||||
|
||||
$log->set_collection_id($collection_id);
|
||||
$log->set_object_type($object_type);
|
||||
$log->set_object_id($object_id);
|
||||
$log->set_old_value($diff['old']);
|
||||
$log->set_new_value($diff['new']);
|
||||
|
||||
|
||||
|
||||
|
||||
if ( $log->validate() ) {
|
||||
$this->insert($log);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function pre_delete_entity( Entities\Entity $entity, $permanent) {
|
||||
|
||||
|
||||
if ( ! $entity->get_repository()->use_logs ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// do not log a log
|
||||
if ( ( method_exists( $entity, 'get_post_type' ) && $entity->get_post_type() === 'tainacan-log' ) || $entity->get_status() === 'auto-draft' ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$this->current_deleting_entity = $entity->_toArray();
|
||||
$this->current_action = $permanent ? 'delete' : 'trash';
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function delete_entity( Entities\Entity $entity, $permanent) {
|
||||
|
||||
|
||||
if ( ! $entity->get_repository()->use_logs ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// do not log a log
|
||||
if ( ( method_exists( $entity, 'get_post_type' ) && $entity->get_post_type() === 'tainacan-log' ) || $entity->get_status() === 'auto-draft' ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$log = new Entities\Log();
|
||||
|
||||
|
||||
$collection_id = method_exists($entity, 'get_collection_id') ? $entity->get_collection_id() : 'default';
|
||||
|
||||
|
||||
if ( $entity instanceof Entities\Collection ) {
|
||||
|
||||
|
||||
$collection_id = $entity->get_id();
|
||||
|
||||
|
||||
if ($this->current_action == 'delete') {
|
||||
$log->set_title( sprintf( __( 'Collection "%s" was permanently deleted', 'tainacan'), $entity->get_name() ) );
|
||||
} elseif ($this->current_action == 'trash') {
|
||||
$log->set_title( sprintf( __( 'Collection "%s" was moved to trash', 'tainacan'), $entity->get_name() ) );
|
||||
}
|
||||
|
||||
|
||||
} elseif ( $entity instanceof Entities\Item ) {
|
||||
|
||||
|
||||
$log->set_item_id($entity->get_id());
|
||||
|
||||
|
||||
if ($this->current_action == 'delete') {
|
||||
$log->set_title( sprintf( __( 'Item "%1$s" (ID %2$s) was updated', 'tainacan'), $entity->get_title(), $entity->get_id() ) );
|
||||
} elseif ($this->current_action == 'trash') {
|
||||
$log->set_title( sprintf( __( 'Item "%1$s" (ID %2$s) was moved to trash', 'tainacan'), $entity->get_title(), $entity->get_id() ) );
|
||||
}
|
||||
} elseif ( $entity instanceof Entities\Filter ) {
|
||||
|
||||
|
||||
if ( 'default' == $collection_id ) {
|
||||
if ($this->current_action == 'delete') {
|
||||
$log->set_title( sprintf( __( 'Filter "%s" was permanently deleted from the repository', 'tainacan'), $entity->get_name() ) );
|
||||
|
@ -673,9 +673,9 @@ class Logs extends Repository {
|
|||
$log->set_title( sprintf( __( 'Filter "%1$s" was moved to trash in Collection "%2$s"', 'tainacan'), $entity->get_name(), $entity->get_collection()->get_name() ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} elseif ( $entity instanceof Entities\Metadatum ) {
|
||||
|
||||
|
||||
if ( 'default' == $collection_id ) {
|
||||
if ($this->current_action == 'delete') {
|
||||
$log->set_title( sprintf( __( 'Metadatum "%s" was permanently deleted from the repository', 'tainacan'), $entity->get_name() ) );
|
||||
|
@ -689,69 +689,69 @@ class Logs extends Repository {
|
|||
$log->set_title( sprintf( __( 'Metadatum "%1$s" was moved to trash in Collection "%2$s"', 'tainacan'), $entity->get_name(), $entity->get_collection()->get_name() ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} elseif ( $entity instanceof Entities\Taxonomy ) {
|
||||
|
||||
|
||||
if ($this->current_action == 'delete') {
|
||||
$log->set_title( sprintf( __( 'Taxonomy "%s" was permanently deleted', 'tainacan'), $entity->get_name() ) );
|
||||
} elseif ($this->current_action == 'trash') {
|
||||
$log->set_title( sprintf( __( 'Taxonomy "%1$s" was moved to trash', 'tainacan'), $entity->get_name() ) );
|
||||
}
|
||||
|
||||
|
||||
} elseif ( $entity instanceof Entities\Term ) {
|
||||
|
||||
|
||||
$taxonomy = Taxonomies::get_instance()->fetch_by_db_identifier($entity->get_taxonomy());
|
||||
$tax_name = '';
|
||||
if ($taxonomy instanceof Entities\Taxonomy) {
|
||||
$tax_name = $taxonomy->get_name();
|
||||
}
|
||||
|
||||
|
||||
if ($this->current_action == 'delete') {
|
||||
$log->set_title( sprintf( __( 'Term "%1$s" was permanently deleted from "%2$s" taxonomy', 'tainacan'), $entity->get_name(), $tax_name ) );
|
||||
} elseif ($this->current_action == 'trash') {
|
||||
$log->set_title( sprintf( __( 'Term "%1$s" was moved to trash in "%2$s" taxonomy', 'tainacan'), $entity->get_name(), $tax_name ) );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$object_type = get_class($entity);
|
||||
$object_id = $entity->get_id();
|
||||
|
||||
|
||||
$diff = $this->current_diff;
|
||||
|
||||
|
||||
$log->set_collection_id($collection_id);
|
||||
$log->set_object_type($object_type);
|
||||
$log->set_object_id($object_id);
|
||||
$log->set_action($this->current_action);
|
||||
|
||||
|
||||
if ( $permanent ) {
|
||||
$log->set_old_value( $this->current_deleting_entity );
|
||||
} else {
|
||||
$log->set_old_value( ['status' => $entity->get_status()] );
|
||||
$log->set_new_value( ['status' => 'trash'] );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if ( $log->validate() ) {
|
||||
$this->insert($log);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private function insert_item_metadata( Entities\Item_Metadata_Entity $entity ) {
|
||||
if($this->current_diff == false) {
|
||||
return;
|
||||
}
|
||||
$log = new Entities\Log();
|
||||
|
||||
|
||||
$item_id = $entity->get_item()->get_id();
|
||||
$collection_id = $entity->get_item()->get_collection_id();
|
||||
$object_type = get_class($entity);
|
||||
$object_id = $entity->get_metadatum()->get_id();
|
||||
|
||||
|
||||
$diff = $this->current_diff;
|
||||
|
||||
|
||||
$log->set_collection_id($collection_id);
|
||||
$log->set_object_type($object_type);
|
||||
$log->set_object_id($object_id);
|
||||
|
@ -759,20 +759,20 @@ class Logs extends Repository {
|
|||
$log->set_old_value($diff['old']);
|
||||
$log->set_new_value($diff['new']);
|
||||
$log->set_action($this->current_action);
|
||||
|
||||
|
||||
$meta_name = $entity->get_metadatum()->get_name();
|
||||
$item_title = $entity->get_item()->get_title();
|
||||
|
||||
|
||||
$title = sprintf( __( 'Value for %1$s metadatum was updated in item "%2$s"', 'tainacan' ), $meta_name, $item_title );
|
||||
|
||||
|
||||
$log->set_title($title);
|
||||
|
||||
|
||||
if ( $log->validate() ) {
|
||||
$this->insert($log);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function filter_log_title($title) {
|
||||
if (defined('TAINACAN_DOING_IMPORT') && true === TAINACAN_DOING_IMPORT) {
|
||||
$_title = __('Importer', 'tainacan');
|
||||
|
@ -781,4 +781,4 @@ class Logs extends Repository {
|
|||
return $title;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -92,6 +92,13 @@ class Metadata extends Repository {
|
|||
//'on_error' => __('The description should be a text value', 'tainacan'),
|
||||
//'validation' => v::stringType()->notEmpty(),
|
||||
],
|
||||
'placeholder' => [
|
||||
'map' => 'meta',
|
||||
'title' => __( 'Placeholder', 'tainacan' ),
|
||||
'type' => 'string',
|
||||
'description' => __( 'The metadatum placeholder. This is a simple message that will appear inside textual input and may indicate to the user what kind of information is expected.', 'tainacan' ),
|
||||
'default' => '',
|
||||
],
|
||||
'metadata_type' => [
|
||||
'map' => 'meta',
|
||||
'title' => __( 'Type', 'tainacan' ),
|
||||
|
@ -114,7 +121,7 @@ class Metadata extends Repository {
|
|||
'title' => __( 'Unique value', 'tainacan' ),
|
||||
'type' => 'string',
|
||||
'description' => __( 'Metadata value should be unique accross all items in this collection', 'tainacan' ),
|
||||
'on_error' => __( 'You can not have two items with the same value for this metadatum', 'tainacan' ),
|
||||
'on_error' => __( 'You cannot have two items with the same value for this metadatum', 'tainacan' ),
|
||||
'validation' => v::stringType()->in( [ 'yes', 'no' ] ), // yes or no
|
||||
'default' => 'no'
|
||||
],
|
||||
|
@ -412,7 +419,7 @@ class Metadata extends Repository {
|
|||
$original_meta_q = isset( $args['meta_query'] ) ? $args['meta_query'] : [];
|
||||
|
||||
/**
|
||||
* Since we introduced roles & capabalities management, we can not rely
|
||||
* Since we introduced roles & capabalities management, we cannot rely
|
||||
* on WordPress behavior when handling default post status values.
|
||||
* WordPress checks if the current user can read_priva_posts, but this is
|
||||
* not enough for us. We have to handle this ourselves to mimic WordPress behavior
|
||||
|
@ -518,7 +525,7 @@ class Metadata extends Repository {
|
|||
$original_meta_q = isset( $args['meta_query'] ) ? $args['meta_query'] : [];
|
||||
|
||||
/**
|
||||
* Since we introduced roles & capabalities management, we can not rely
|
||||
* Since we introduced roles & capabalities management, we cannot rely
|
||||
* on WordPress behavior when handling default post status values.
|
||||
* WordPress checks if the current user can read_priva_posts, but this is
|
||||
* not enough for us. We have to handle this ourselves to mimic WordPress behavior
|
||||
|
@ -736,21 +743,19 @@ class Metadata extends Repository {
|
|||
private function get_data_core_metadata( Entities\Collection $collection ) {
|
||||
|
||||
return $data_core_metadata = [
|
||||
'core_description' => [
|
||||
'name' => 'Description',
|
||||
'description' => 'description',
|
||||
'collection_id' => $collection->get_id(),
|
||||
'metadata_type' => 'Tainacan\Metadata_Types\Core_Description',
|
||||
'status' => 'publish',
|
||||
],
|
||||
'core_title' => [
|
||||
'name' => 'Title',
|
||||
'description' => 'title',
|
||||
'name' => __('Title', 'tainacan'),
|
||||
'collection_id' => $collection->get_id(),
|
||||
'metadata_type' => 'Tainacan\Metadata_Types\Core_Title',
|
||||
'status' => 'publish',
|
||||
'display' => 'yes',
|
||||
],
|
||||
'core_description' => [
|
||||
'name' => __('Description', 'tainacan'),
|
||||
'collection_id' => $collection->get_id(),
|
||||
'metadata_type' => 'Tainacan\Metadata_Types\Core_Description',
|
||||
'status' => 'publish',
|
||||
]
|
||||
];
|
||||
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ abstract class Repository {
|
|||
*/
|
||||
protected function __construct() {
|
||||
add_action( 'init', array( &$this, 'register_post_type' ) );
|
||||
add_action( 'init', array( &$this, 'init_objects' ) );
|
||||
add_action( 'init', array( &$this, 'init_objects' ) );
|
||||
|
||||
add_filter( 'tainacan-get-map-' . $this->get_name(), array( $this, 'get_default_properties' ) );
|
||||
}
|
||||
|
|
|
@ -152,14 +152,14 @@ $Tainacan_Embed = \Tainacan\Embed::get_instance();
|
|||
require_once(__DIR__ . '/../views/class-tainacan-admin.php');
|
||||
$Tainacan_Admin = \Tainacan\Admin::get_instance();
|
||||
|
||||
require_once(__DIR__ . '/../views/class-tainacan-admin-hooks.php');
|
||||
require_once(__DIR__ . '/../views/admin-hooks-functions.php');
|
||||
require_once(__DIR__ . '/../views/admin/classes/hooks/class-tainacan-admin-hooks.php');
|
||||
require_once(__DIR__ . '/../views/admin/classes/hooks/admin-hooks-functions.php');
|
||||
$Tainacan_Admin_Hooks = \Tainacan\Admin_Hooks::get_instance();
|
||||
|
||||
require_once(__DIR__ . '/../views/class-tainacan-component-hooks.php');
|
||||
require_once(__DIR__ . '/../views/admin/classes/hooks/class-tainacan-component-hooks.php');
|
||||
$Tainacan_Component_Hooks = \Tainacan\Component_Hooks::get_instance();
|
||||
|
||||
require_once(__DIR__ . '/../views/class-tainacan-plugin-hooks.php');
|
||||
require_once(__DIR__ . '/../views/admin/classes/hooks/class-tainacan-plugin-hooks.php');
|
||||
$Tainacan_Plugin_Hooks = \Tainacan\Plugin_Hooks::get_instance();
|
||||
|
||||
require_once(__DIR__ . '/theme-helper/class-tainacan-theme-helper.php');
|
||||
|
|
|
@ -49,6 +49,7 @@ class Theme_Helper {
|
|||
add_shortcode( 'tainacan-search', array($this, 'search_shortcode'));
|
||||
add_shortcode( 'tainacan-item-submission', array($this, 'item_submission_shortcode'));
|
||||
add_shortcode( 'tainacan-items-carousel', array($this, 'get_tainacan_items_carousel'));
|
||||
add_shortcode( 'tainacan-dynamic-items-list', array($this, 'get_tainacan_dynamic_items_list'));
|
||||
add_shortcode( 'tainacan-related-items-carousel', array($this, 'get_tainacan_related_items_carousel'));
|
||||
|
||||
add_action( 'generate_rewrite_rules', array( &$this, 'rewrite_rules' ), 10, 1 );
|
||||
|
@ -406,7 +407,7 @@ class Theme_Helper {
|
|||
* @type int $default_items_per_page Default number of items per page loaded
|
||||
* @type bool $show_filters_button_inside_search_control Display the "hide filters" button inside of the search control instead of floating
|
||||
* @type bool $start_with_filters_hidden Loads the filters list hidden from start
|
||||
* @type bool $filters_as_modal Display the filters as a modal instead of a collapsable region on desktop
|
||||
* @type bool $filters_as_modal Display the filters as a modal instead of a collapsible region on desktop
|
||||
* @type bool $show_inline_view_mode_options Display view modes as inline icon buttons instead of the dropdown
|
||||
* @type bool $show_fullscreen_with_view_modes Lists fullscreen viewmodes alongside with other view modes istead of separatelly
|
||||
* @type string $default_view_mode The default view mode
|
||||
|
@ -422,15 +423,15 @@ class Theme_Helper {
|
|||
|
||||
// Loads info related to view modes
|
||||
$view_modes = tainacan_get_the_view_modes();
|
||||
$default_view_mode = $view_modes['default_view_mode'];
|
||||
$enabled_view_modes = $view_modes['enabled_view_modes'];
|
||||
|
||||
if( isset($args['default_view_mode']) ) {
|
||||
$enabled_view_modes = $view_modes['enabled_view_modes'];
|
||||
if ( isset($args['default_view_mode']) ) {
|
||||
$default_view_mode = $args['default_view_mode'];
|
||||
unset($args['default_view_mode']);
|
||||
}
|
||||
|
||||
if( isset($args['enabled_view_modes']) ) {
|
||||
$default_view_mode = $view_modes['default_view_mode'];
|
||||
if ( isset($args['enabled_view_modes']) ) {
|
||||
$enabled_view_modes = $args['enabled_view_modes'];
|
||||
if ( !in_array($default_view_mode, $enabled_view_modes) ) {
|
||||
$default_view_mode = $enabled_view_modes[0];
|
||||
|
@ -438,13 +439,28 @@ class Theme_Helper {
|
|||
unset($args['enabled_view_modes']);
|
||||
}
|
||||
|
||||
// Loads info related to sorting
|
||||
$default_order = 'ASC';
|
||||
if ( isset($args['default_order']) ) {
|
||||
$default_order = $args['default_order'];
|
||||
unset($args['default_order']);
|
||||
}
|
||||
|
||||
$default_orderby = 'date';
|
||||
if ( isset($args['default_orderby']) ) {
|
||||
$default_orderby = $args['default_orderby'];
|
||||
unset($args['default_orderby']);
|
||||
}
|
||||
|
||||
// If in a collection page
|
||||
$collection = tainacan_get_collection($args);
|
||||
if ($collection) {
|
||||
$props .= 'collection-id="' . $collection->get_id() . '" ';
|
||||
$props .= "collection-id='" . $collection->get_id() . "' ";
|
||||
$default_view_mode = $collection->get_default_view_mode();
|
||||
$enabled_view_modes = $collection->get_enabled_view_modes();
|
||||
|
||||
$default_order = $collection->get_default_order();
|
||||
$default_orderby = $collection->get_default_orderby();
|
||||
|
||||
// Gets hideItemsThumbnail info from collection setting
|
||||
$args['hide-items-thumbnail'] = $collection->get_hide_items_thumbnail_on_lists() == 'yes' ? true : false;
|
||||
}
|
||||
|
@ -452,17 +468,19 @@ class Theme_Helper {
|
|||
// If in a tainacan taxonomy
|
||||
$term = tainacan_get_term($args);
|
||||
if ($term) {
|
||||
$props .= 'term-id="' . $term->term_id . '" ';
|
||||
$props .= 'taxonomy="' . $term->taxonomy . '" ';
|
||||
$props .= "term-id='" . $term->term_id . "' ";
|
||||
$props .= "taxonomy='" . $term->taxonomy . "' ";
|
||||
}
|
||||
|
||||
$props .= 'default-view-mode="' . $default_view_mode . '" ';
|
||||
$props .= 'enabled-view-modes="' . implode(',', $enabled_view_modes) . '" ';
|
||||
$props .= "default-view-mode='" . $default_view_mode . "' ";
|
||||
$props .= "enabled-view-modes='" . implode(',', $enabled_view_modes) . "' ";
|
||||
$props .= "default-order='" . $default_order . "' ";
|
||||
$props .= "default-orderby='" . (is_array($default_orderby) ? json_encode($default_orderby) : $default_orderby) . "' ";
|
||||
|
||||
// Passes arguments to custom props
|
||||
foreach ($args as $key => $value) {
|
||||
if ($value == true || $value == 'true') {
|
||||
$props .= str_replace('_', '-', $key) . '="' . $value . '" ';
|
||||
$props .= str_replace("_", "-", $key) . "='" . $value . "' ";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -861,7 +879,7 @@ class Theme_Helper {
|
|||
'collection_text_color' => '#ffffff',
|
||||
'tainacan_api_root' => '',
|
||||
'tainacan_base_url' => '',
|
||||
'class_name' => '',
|
||||
'class_name' => ''
|
||||
);
|
||||
$args = wp_parse_args($args, $defaults);
|
||||
|
||||
|
@ -879,26 +897,104 @@ class Theme_Helper {
|
|||
$props .= (str_replace('_', '-', $key) . "='" . $value . "' ");
|
||||
}
|
||||
|
||||
return "<div data-module='carousel-items-list' id='tainacan-items-carousel-shortcode' $props ></div>";
|
||||
return "<div data-module='carousel-items-list' id='tainacan-items-carousel-shortcode_" . uniqid() . "' $props ></div>";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a group of related items carousels
|
||||
* Returns the div used by Vue to render the Dynamic List of Related Items
|
||||
*
|
||||
* @param array $args {
|
||||
* Optional. Array of arguments.
|
||||
* @type string $collection_id The Collection ID
|
||||
* @type string $search_URL A query string to fetch items from, if load strategy is 'search'
|
||||
* @type array $selected_items An array of item IDs to fetch items from, if load strategy is 'selection' and an array of items, if the load strategy is 'parent'
|
||||
* @type string $load_strategy Either 'search' or 'selection', to determine how items will be fetch
|
||||
* @type integer $max_items_number Maximum number of items to be fetch
|
||||
* @type integer $max_columns_count Maximum columns cound (used by grid and list layouts)
|
||||
* @type integer $grid_margin Margin around items in every layout
|
||||
* @type string $show_name Show the item title
|
||||
* @type string $show_image Show the item thumbnail
|
||||
* @type string $layout Either 'grid', 'list' or 'mosaic'
|
||||
* @type string $crop_images_to_square Force images shape to be squared
|
||||
* @type bool $show_collection_header Should it display a small version of the collection header?
|
||||
* @type bool $show_collection_label Should it displar a 'Collection' label before the collection name on the collection header?
|
||||
* @type string $collection_background_color Color of the collection header background
|
||||
* @type string $collection_text_color Color of the collection header text
|
||||
* @type string $tainacan_api_root Path of the Tainacan api root (to make the items request)
|
||||
* @type string $tainacan_base_url Path of the Tainacan base URL (to make the links to the items)
|
||||
* @type string $class_name Extra class to add to the wrapper, besides the default wp-block-tainacan-carousel-items-list
|
||||
* @type string $mosaic_height Height of the panel in the 'mosaic' layout
|
||||
* @type string $mosaic_density
|
||||
* @type string $mosaic_grid_rows
|
||||
* @type string $mosaic_grid_columns
|
||||
* @type string $mosaic_item_focal_point_x
|
||||
* @type string $mosaic_item_focal_point_y
|
||||
* @return string The HTML div to be used for rendering the items carousel vue component
|
||||
*/
|
||||
public function get_tainacan_dynamic_items_list($args = []) {
|
||||
if (!is_array($args))
|
||||
return __('There are missing parameters for Tainacan Items Block/shortcode', 'tainacan');
|
||||
|
||||
$defaults = array(
|
||||
'max_items_number' => 12,
|
||||
'max_columns_count' => 6,
|
||||
'grid_margin' => 12,
|
||||
'show_name' => true,
|
||||
'show_image' => true,
|
||||
'layout' => 'grid',
|
||||
'crop_images_to_square' => true,
|
||||
'show_collection_header' => false,
|
||||
'show_collection_label' => false,
|
||||
'collection_background_color' => '#454647',
|
||||
'collection_text_color' => '#ffffff',
|
||||
'tainacan_api_root' => '',
|
||||
'tainacan_base_url' => '',
|
||||
'class_name' => '',
|
||||
'mosaic_height' => 280,
|
||||
'mosaic_density' => 5,
|
||||
'mosaic_grid_rows' => 3,
|
||||
'mosaic_grid_columns' => 4,
|
||||
'mosaic_item_focal_point_x' => 0.5,
|
||||
'mosaic_item_focal_point_y' => 0.5
|
||||
);
|
||||
$args = wp_parse_args($args, $defaults);
|
||||
|
||||
$props = ' ';
|
||||
|
||||
// Always pass the class needed by Vue to mount the component;
|
||||
$args['class'] = $args['class_name'] . ' wp-block-tainacan-dynamic-items-list';
|
||||
unset($args['class_name']);
|
||||
|
||||
// Builds parameters to the html div rendered by Vue
|
||||
foreach ($args as $key => $value) {
|
||||
if (is_bool($value))
|
||||
$value = $value ? 'true' : 'false';
|
||||
// Changes from PHP '_' notation to HTML '-' notation
|
||||
$props .= (str_replace('_', '-', $key) . "='" . $value . "' ");
|
||||
}
|
||||
|
||||
return "<div data-module='dynamic-items-list' id='tainacan-dynamic-items-list-shortcode_" . uniqid(). "' $props ></div>";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a group of related items list
|
||||
* For each metatada, the collection name, the metadata name and a button linking
|
||||
* the items list filtered is presented
|
||||
*
|
||||
* @param array $args {
|
||||
* Optional. Array of arguments.
|
||||
* @type string $item_id The Item ID
|
||||
* @type string $items_list_layout The type of list to be rendered. Accepts 'grid', 'list', 'mosaic' and 'carousel'.
|
||||
* @type string $class_name Extra class to add to the wrapper, besides the default wp-block-tainacan-carousel-related-items
|
||||
* @type string $collection_heading_class_name Extra class to add to the collection name wrapper. Defaults to ''
|
||||
* @type string $collection_heading_tag Tag to be used as wrapper of the collection name. Defaults to h2
|
||||
* @type string $metadata_label_class_name Extra class to add to the metadata label wrapper. Defaults to ''
|
||||
* @type string $metadata_label_tag Tag to be used as wrapper of the metadata label. Defaults to p
|
||||
* @type array $carousel_args Array of arguments to be passed to the get_tainacan_items_carousel function
|
||||
* @type array $carousel_args Array of arguments to be passed to the get_tainacan_items_carousel function if $items_list_layout == carousel
|
||||
* @type array $dynamic_items_args Array of arguments to be passed to the get_tainacan_dynamic_items function if $items_list_layout != carousel
|
||||
* @return string The HTML div to be used for rendering the related items vue component
|
||||
*/
|
||||
public function get_tainacan_related_items_carousel($args = []) {
|
||||
public function get_tainacan_related_items_list($args = []) {
|
||||
global $TAINACAN_BASE_URL;
|
||||
global $TAINACAN_VERSION;
|
||||
|
||||
|
@ -908,7 +1004,8 @@ class Theme_Helper {
|
|||
'collection_heading_tag' => 'h2',
|
||||
'metadata_label_class_name' => '',
|
||||
'metadata_label_tag' => 'p',
|
||||
'carousel_args' => []
|
||||
'carousel_args' => [],
|
||||
'dynamic_items_args' => []
|
||||
);
|
||||
$args = wp_parse_args($args, $defaults);
|
||||
|
||||
|
@ -922,8 +1019,8 @@ class Theme_Helper {
|
|||
if (!count($related_items))
|
||||
return;
|
||||
|
||||
// Always pass the default class;
|
||||
$output = '<div data-module="carousel-related-items" class="' . $args['class_name'] . ' wp-block-tainacan-carousel-related-items' . '">';
|
||||
// Always pass the default class. We force passing the wp-block-tainacan-carousel-related-items because themes might have used it to style before the other layouts exist;
|
||||
$output = '<div data-module="related-items-list" class="' . $args['class_name'] . ' wp-block-tainacan-carousel-related-items wp-block-tainacan-related-items' . '">';
|
||||
|
||||
foreach($related_items as $collection_id => $related_group) {
|
||||
|
||||
|
@ -942,23 +1039,34 @@ class Theme_Helper {
|
|||
}
|
||||
|
||||
// Sets the carousel, from the items carousel template tag.
|
||||
$carousel_div = '';
|
||||
$items_list_div = '';
|
||||
if ( isset($related_group['collection_id']) ) {
|
||||
|
||||
$carousel_args = wp_parse_args([
|
||||
'collection_id' => $related_group['collection_id'],
|
||||
'load_strategy' => 'parent',
|
||||
'selected_items' => json_encode($related_group['items'])
|
||||
], $args['carousel_args']);
|
||||
if ( isset($args['items_list_layout']) && $args['items_list_layout'] !== 'carousel' ) {
|
||||
$items_list_args = wp_parse_args([
|
||||
'collection_id' => $related_group['collection_id'],
|
||||
'load_strategy' => 'parent',
|
||||
'selected_items' => json_encode($related_group['items']),
|
||||
'layout' => $args['items_list_layout']
|
||||
], $args['dynamic_items_args']);
|
||||
|
||||
$carousel_div = $this->get_tainacan_items_carousel($carousel_args);
|
||||
$items_list_div = $this->get_tainacan_dynamic_items_list($items_list_args);
|
||||
} else {
|
||||
$items_list_args = wp_parse_args([
|
||||
'collection_id' => $related_group['collection_id'],
|
||||
'load_strategy' => 'parent',
|
||||
'selected_items' => json_encode($related_group['items'])
|
||||
], $args['carousel_args']);
|
||||
|
||||
$items_list_div = $this->get_tainacan_items_carousel($items_list_args);
|
||||
}
|
||||
}
|
||||
|
||||
$output .= '<div class="wp-block-group">
|
||||
<div class="wp-block-group__inner-container">' .
|
||||
$collection_heading .
|
||||
$metadata_label .
|
||||
$carousel_div .
|
||||
$items_list_div .
|
||||
(
|
||||
$related_group['total_items'] > 1 ?
|
||||
'<div class="wp-block-buttons">
|
||||
|
@ -981,5 +1089,15 @@ class Theme_Helper {
|
|||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a group of related items list carousel
|
||||
* This is just a pre-set version of the get_tainacan_related_items function kept for
|
||||
* compatibility with previous versions.
|
||||
*/
|
||||
public function get_tainacan_related_items_carousel($args = []) {
|
||||
$args = wp_parse_args($args, [ 'items_list_layout' => 'carousel' ]);
|
||||
return $this->get_tainacan_related_items_list($args);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ use \Tainacan\Repositories;
|
|||
* @type bool $exclude_core Exclude Core Metadata (title and description) from result. Default false
|
||||
* @type bool $hide_empty Wether to hide or not metadata the item has no value to
|
||||
* Default: true
|
||||
* @type string $empty_value_message Message string to display if $hide_empty is false and there is not metadata value. Default ''
|
||||
* @type string $before String to be added before each metadata block
|
||||
* Default '<div class="metadata-type-$type">' where $type is the metadata type slug
|
||||
* @type string $after String to be added after each metadata block
|
||||
|
@ -335,13 +336,21 @@ function tainacan_get_the_media_component(
|
|||
if ( $args['has_media_main'] || $args['has_media_thumbs'] ) :
|
||||
// Modal lightbox layer for rendering photoswipe
|
||||
add_action('wp_footer', 'tainacan_get_the_media_modal_layer');
|
||||
|
||||
wp_enqueue_style( 'tainacan-media-component', $TAINACAN_BASE_URL . '/assets/css/media-component.css', array(), TAINACAN_VERSION);
|
||||
wp_enqueue_script( 'tainacan-media-component', $TAINACAN_BASE_URL . '/assets/js/media_component.js', ['wp-i18n'], TAINACAN_VERSION, true );
|
||||
wp_localize_script('tainacan-media-component', 'tainacan_plugin', \Tainacan\Admin::get_instance()->get_admin_js_localization_params());
|
||||
|
||||
wp_enqueue_style( 'tainacan-media-component', $TAINACAN_BASE_URL . '/assets/css/tainacan-gutenberg-block-item-gallery.css', array(), TAINACAN_VERSION);
|
||||
?>
|
||||
|
||||
<div class="tainacan-media-component">
|
||||
<script>
|
||||
try {
|
||||
tainacan_plugin = (typeof tainacan_plugin != undefined) ? tainacan_plugin : {};
|
||||
} catch(err) {
|
||||
tainacan_plugin = {};
|
||||
}
|
||||
tainacan_plugin.tainacan_media_components = (typeof tainacan_plugin.tainacan_media_components != "undefined") ? tainacan_plugin.tainacan_media_components : {};
|
||||
tainacan_plugin.tainacan_media_components['<?php echo $args['media_id'] ?>'] = <?php echo json_encode($args) ?>;
|
||||
</script>
|
||||
|
||||
<div id="<?php echo $media_id ?>" class="tainacan-media-component" data-module='item-gallery'>
|
||||
|
||||
<?php if ( $args['has_media_main'] ) : ?>
|
||||
|
||||
|
@ -410,23 +419,7 @@ function tainacan_get_the_media_component(
|
|||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php if ( isset( $_REQUEST['wp_customize'] ) ) : ?>
|
||||
<script>
|
||||
try {
|
||||
tainacan_plugin = (typeof tainacan_plugin != undefined) ? tainacan_plugin : {};
|
||||
} catch(err) {
|
||||
tainacan_plugin = {};
|
||||
}
|
||||
tainacan_plugin.tainacan_media_components = (typeof tainacan_plugin.tainacan_media_components != "undefined") ? tainacan_plugin.tainacan_media_components : {};
|
||||
tainacan_plugin.tainacan_media_components['<?php echo $args['media_id'] ?>'] = <?php echo json_encode($args) ?>;
|
||||
</script>
|
||||
<?php else :
|
||||
wp_add_inline_script( 'tainacan-media-component', '
|
||||
tainacan_plugin.tainacan_media_components = (typeof tainacan_plugin != undefined && typeof tainacan_plugin.tainacan_media_components != "undefined") ? tainacan_plugin.tainacan_media_components : {};
|
||||
tainacan_plugin.tainacan_media_components["' . $args['media_id'] . '"] = '. json_encode($args) . ';
|
||||
', 'before' );
|
||||
endif; ?>
|
||||
|
||||
<?php endif; ?> <!-- End of if ($args['has_media_main'] || $args['has_media_thumbs'] ) -->
|
||||
|
||||
<?php
|
||||
|
@ -693,7 +686,7 @@ function tainacan_is_view_mode_enabled($view_mode_slug) {
|
|||
* @type int $default_items_per_page Default number of items per page loaded
|
||||
* @type bool $show_filters_button_inside_search_control Display the "hide filters" button inside of the search control instead of floating
|
||||
* @type bool $start_with_filters_hidden Loads the filters list hidden from start
|
||||
* @type bool $filters_as_modal Display the filters as a modal instead of a collapsable region on desktop
|
||||
* @type bool $filters_as_modal Display the filters as a modal instead of a collapsible region on desktop
|
||||
* @type bool $show_inline_view_mode_options Display view modes as inline icon buttons instead of the dropdown
|
||||
* @type bool $show_fullscreen_with_view_modes Lists fullscreen viewmodes alongside with other view modes istead of separatelly
|
||||
* @type string $default_view_mode The default view mode
|
||||
|
@ -1038,7 +1031,7 @@ function tainacan_the_items_carousel($args = []) {
|
|||
}
|
||||
|
||||
/**
|
||||
* Displays a group of related items carousels
|
||||
* Displays a group of related items lists
|
||||
* For each metatada, the collection name, the metadata name and a button linking
|
||||
* the items list filtered is presented
|
||||
*
|
||||
|
@ -1047,10 +1040,24 @@ function tainacan_the_items_carousel($args = []) {
|
|||
* @type string $item_id The Item ID
|
||||
* @return void
|
||||
*/
|
||||
function tainacan_the_related_items($args = []) {
|
||||
echo \Tainacan\Theme_Helper::get_instance()->get_tainacan_related_items_list($args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a group of related items carousels
|
||||
* This is a preset version of tainacan_the_related_items, to keep compatibility with previous versions
|
||||
*
|
||||
* @param array $args {
|
||||
* Optional. Array of arguments.
|
||||
* @type string $item_id The Item ID
|
||||
* @return void
|
||||
*/
|
||||
function tainacan_the_related_items_carousel($args = []) {
|
||||
echo \Tainacan\Theme_Helper::get_instance()->get_tainacan_related_items_carousel($args);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks if the current item has or not related items
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
namespace Tainacan\Traits;
|
||||
|
||||
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
||||
|
||||
/**
|
||||
* Class for formatter texts
|
||||
* @author Vinicius Nunus - L3P/Medialab
|
||||
*
|
||||
*/
|
||||
trait Singleton_Instance {
|
||||
|
||||
private static $instance = null;
|
||||
|
||||
public static function get_instance() {
|
||||
if ( ! isset( self::$instance ) ) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
private function __construct() {
|
||||
$this->init();
|
||||
}
|
||||
}
|
|
@ -4,87 +4,87 @@ Tags: museums, libraries, archives, GLAM, collections, repository
|
|||
Requires at least: 5.0
|
||||
Tested up to: 5.8
|
||||
Requires PHP: 5.6
|
||||
Stable tag: 0.18.6
|
||||
Stable tag: 0.18.7
|
||||
License: GPLv2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
|
||||
Tainacan is an open-source, powerful and flexible digital repository platform for WordPress. With all the tools of a professional repository platform, you can manage and publish your digital collections as easily as posting to your blog. It is versatile and can be used to create a digital collection, a digital library or a digital repository for your institutional or personal collection.
|
||||
|
||||
|
||||
== Description ==
|
||||
|
||||
[Tainacan](https://tainacan.org/) is an [open-source](https://github.com/tainacan/tainacan), powerful and flexible digital repository platform for WordPress. Manage and publish your digital collections just as easily as you post to your blog, having all the tools of a professional repository platform. It can be used for the creation of a digital collection, a digital library or a digital repository for your institutional or personal collection.
|
||||
|
||||
[Tainacan](https://tainacan.org/) is an [open-source](https://github.com/tainacan/tainacan), powerful and flexible digital repository platform for WordPress. Manage and publish your digital collections just as easily as you post to your blog, having all the tools of a professional repository platform. It can be used for the creation of a digital collection, a digital library or a digital repository for your institutional or personal collection.
|
||||
|
||||
Tainacan aims to facilitate the activities of organizing, documenting, disseminating and displaying digital objects based on simple and accessible principles of digital curation. The plugin integrates with the Wordpress block engine, making it easy to reuse objects for different and varied uses.
|
||||
|
||||
|
||||
|
||||
|
||||
= Features =
|
||||
|
||||
|
||||
* "Metadata and Filters": Use a metadata standard or choose whatever set of metadata you want to describe the items in your collections. Also, choose which metadata will be used as a filter when browsing collections.
|
||||
|
||||
|
||||
* "Faceted Search". Browse your collection (and let the public browse it) using a faceted search interface with the filters you have chosen.
|
||||
|
||||
|
||||
* "Manage Taxonomies": Manage vocabularies that can be used across all your collections.
|
||||
|
||||
|
||||
* "Themes": The Tainacan plugin has its own default theme, which helps you to showcase your collections in a beautiful and effective manner. But it can also work with any WordPress theme, so interface developers can easily add Tainacan specific features to an existing theme.
|
||||
|
||||
|
||||
* "API and Interoperability": Tainacan implements a RESTful API (read and write) to allow other applications to interact with your repository. That way, you can expose your collection in different formats, such as JSON, JsonLD, OAI-PMH and others. If your collection has a specific set of metadata, you can map this metadata to match the patterns you want to use.
|
||||
|
||||
|
||||
* "Gutenberg blocks": Tell stories with your collections. Tainacan offers you several Gutenberg blocks so you can present your collections to the public in many different ways!
|
||||
|
||||
|
||||
== Getting Started ==
|
||||
|
||||
|
||||
After installation, you will see a new menu item in your admin panel called "Tainacan". Click on it to open the Tainacan admin interface.
|
||||
|
||||
|
||||
To get an overview of the main concepts of Tainacan, please visit [this page](https://tainacan.github.io/tainacan-wiki/#/general-concepts).
|
||||
|
||||
|
||||
= Create a collection =
|
||||
|
||||
|
||||
Click "New Collection" to create a new collection, use a mapping standard or import it using one of our importers.
|
||||
|
||||
|
||||
= Configure your collection =
|
||||
|
||||
|
||||
Navigate to the top menu to set your collection up. Create the metadata that items in this collection will have, and choose, from these metadata, which ones are going to be used as a filter.
|
||||
|
||||
|
||||
= Add items =
|
||||
|
||||
|
||||
Back to the "Items" screen, click "Add new" to create a new item.
|
||||
|
||||
|
||||
= Manage and browse your collection =
|
||||
|
||||
|
||||
Through this admin interface you can manage your collection and browse its item using the faceted search interface or advanced search interface.
|
||||
|
||||
|
||||
If you want to visit your collections in the public side of your site, using your current theme, visit http://your-site/collections and you will get the list of your collections.
|
||||
|
||||
|
||||
= Set up Taxonomies =
|
||||
|
||||
|
||||
You can also have metadata as taxonomies, which you can configure with a set of hierarchical terms of your own vocabulary.
|
||||
|
||||
|
||||
= Add links to your menu =
|
||||
|
||||
Edit your menu and links directly to your collections. Click "Screen options" at the top of the Menu edition page and enable "Collections".
|
||||
|
||||
|
||||
Edit your menu and links directly to your collections. Click "Screen options" at the top of the Edit Menu page and enable "Collections".
|
||||
|
||||
If you want to add a link to the list of collections, click "View all" tab on the Collections box on the left, and then add the first item named "Collections" to the menu.
|
||||
|
||||
|
||||
= Faceted search in your theme =
|
||||
|
||||
To have a fully-featured faceted search in your theme, you can either make it compatible with a few templates or use our Faceted Search Block.
|
||||
|
||||
|
||||
To have a fully-featured faceted search in your theme, you can either make it compatible with a few templates or use our Faceted Search Block.
|
||||
|
||||
== Installation ==
|
||||
|
||||
|
||||
Upload the files to the plugins directory and activate it. You can also install and activate directly from the admin panel.
|
||||
|
||||
|
||||
If you have Imagick installed in your server, Tainacan will be able to automatically generate a thumbnail from your PDF files. This is desired but not required.
|
||||
|
||||
|
||||
== Find out more ==
|
||||
|
||||
|
||||
* Visit our official website: [https://tainacan.org/](https://tainacan.org/)
|
||||
* Contribute to the source code: [https://github.com/tainacan/tainacan](https://github.com/tainacan/tainacan)
|
||||
* Check our documentation Wiki: [https://wiki.tainacan.org/](https://wiki.tainacan.org/)
|
||||
|
||||
|
||||
== Screenshots ==
|
||||
|
||||
|
||||
1. Manage your repository
|
||||
2. Set up your collection
|
||||
3. Choose the metadata and filters for your collection
|
||||
|
|
|
@ -4,17 +4,17 @@ Plugin Name: Tainacan
|
|||
Plugin URI: https://tainacan.org/
|
||||
Description: Open source, powerful and flexible repository platform for WordPress. Manage and publish you digital collections as easily as publishing a post to your blog, while having all the tools of a professional repository platform.
|
||||
Author: Tainacan.org
|
||||
Version: 0.18.6
|
||||
Version: 0.18.7
|
||||
Requires at least: 5.0
|
||||
Tested up to: 5.8
|
||||
Requires PHP: 5.6
|
||||
Stable tag: 0.18.6
|
||||
Stable tag: 0.18.7
|
||||
Text Domain: tainacan
|
||||
License: GPLv2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
||||
*/
|
||||
|
||||
const TAINACAN_VERSION = '0.18.6';
|
||||
const TAINACAN_VERSION = '0.18.7';
|
||||
|
||||
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
||||
$TAINACAN_BASE_URL = plugins_url('', __FILE__);
|
||||
|
@ -43,4 +43,83 @@ add_action('init', ['Tainacan\Migrations', 'run_migrations']);
|
|||
//https://core.trac.wordpress.org/ticket/23022#comment:13
|
||||
add_filter( 'wp_untrash_post_status', function( $new_status, $post_id, $previous_status ) {
|
||||
return $previous_status;
|
||||
}, 10, 3 );
|
||||
}, 10, 3 );
|
||||
|
||||
/*
|
||||
*
|
||||
* Adds Edit links to Tainacan item and collection pages
|
||||
*/
|
||||
function tainacan_add_admin_bar_items ( WP_Admin_Bar $admin_bar ) {
|
||||
|
||||
// No need to add this shortcuts on the admin
|
||||
if ( !is_admin() ) {
|
||||
|
||||
// We should only do this in singular pages, as the items list also return the first item on loop
|
||||
if ( is_singular() ) {
|
||||
|
||||
$item = tainacan_get_item();
|
||||
|
||||
// There should exist a Tainacan item and the user should have permission for this
|
||||
if ( isset($item) && $item->can_edit() ) {
|
||||
|
||||
$url = $item->get_edit_url();
|
||||
|
||||
// The item edition link must be valid!
|
||||
if ( $url ) {
|
||||
|
||||
$admin_bar->add_menu( array(
|
||||
'id' => 'tainacan-item-edition-link',
|
||||
'parent' => null,
|
||||
'group' => null,
|
||||
'title' => __( 'Edit item', 'tainacan' ),
|
||||
'href' => $url,
|
||||
'meta' => [
|
||||
'title' => __( 'Edit this item on Tainacan Admin', 'tainacan' )
|
||||
]
|
||||
) );
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// In the collection and items list, we can also display links
|
||||
else if ( is_archive() ) {
|
||||
|
||||
$collection = tainacan_get_collection();
|
||||
|
||||
// There should exist a Tainacan collection and the user should have permission for edit it
|
||||
if ( $collection && $collection->can_edit() ) {
|
||||
|
||||
$url = admin_url( '?page=tainacan_admin#/collections/' . $collection->get_ID() . '/settings' );
|
||||
|
||||
$admin_bar->add_menu( array(
|
||||
'id' => 'tainacan-collection-edition-link',
|
||||
'parent' => null,
|
||||
'group' => null,
|
||||
'title' => __( 'Edit collection', 'tainacan' ),
|
||||
'href' => $url,
|
||||
'meta' => [
|
||||
'title' => __( 'Edit this collection on Tainacan Admin', 'tainacan' )
|
||||
]
|
||||
) );
|
||||
|
||||
// If no single collection is found, we may be in a collections list
|
||||
} else if ( is_post_type_archive('tainacan-collection') ) {
|
||||
|
||||
$url = admin_url( '?page=tainacan_admin#/collections/' );
|
||||
|
||||
$admin_bar->add_menu( array(
|
||||
'id' => 'tainacan-collections-edition-link',
|
||||
'parent' => null,
|
||||
'group' => null,
|
||||
'title' => __( 'Edit collections', 'tainacan' ),
|
||||
'href' => $url,
|
||||
'meta' => [
|
||||
'title' => __( 'Edit the collections on Tainacan Admin', 'tainacan' )
|
||||
]
|
||||
) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
add_action( 'admin_bar_menu', 'tainacan_add_admin_bar_items', 500 );
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div
|
||||
id="tainacan-admin-app"
|
||||
class="columns is-fullheight"
|
||||
class="has-mounted columns is-fullheight"
|
||||
:class="{
|
||||
'tainacan-admin-iframe-mode': isIframeMode,
|
||||
'tainacan-admin-read-mode': isReadMode
|
||||
|
@ -24,7 +24,7 @@
|
|||
content: $i18n.get('label_shrink_menu'),
|
||||
autoHide: true,
|
||||
placement: 'auto-end',
|
||||
classes: ['tooltip', 'repository-tooltip']
|
||||
classes: ['tainacan-tooltip', 'tooltip', 'repository-tooltip']
|
||||
}"
|
||||
class="icon">
|
||||
<i
|
||||
|
@ -111,7 +111,8 @@
|
|||
},
|
||||
ariaRole: 'alertdialog',
|
||||
ariaModal: true,
|
||||
customClass: 'tainacan-modal'
|
||||
customClass: 'tainacan-modal',
|
||||
closeButtonAriaLabel: this.$i18n.get('close')
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
* @see \Tainacan\Admin_Hooks->register()
|
||||
*/
|
||||
function tainacan_register_admin_hook( $context, $callback, $position = 'end-left' ) {
|
||||
$admin_hooks = \Tainacan\Admin_Hooks::get_instance();
|
||||
return $admin_hooks->register( $context, $callback, $position );
|
||||
$admin_hooks = \Tainacan\Admin_Hooks::get_instance();
|
||||
return $admin_hooks->register( $context, $callback, $position );
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
<?php
|
||||
|
||||
namespace Tainacan;
|
||||
|
||||
|
||||
class Admin_Hooks {
|
||||
|
||||
|
||||
private $registered_hooks = [];
|
||||
|
||||
private static $instance = null;
|
||||
|
||||
public static function get_instance() {
|
||||
if ( ! isset( self::$instance ) ) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
private function __construct() {
|
||||
add_action('init', [$this, 'init']);
|
||||
}
|
||||
|
||||
function init() {
|
||||
do_action('tainacan-register-admin-hooks');
|
||||
}
|
||||
|
||||
public function get_available_positions() {
|
||||
return apply_filters('tainacan-admin-hooks-positions', ['begin-left', 'begin-right', 'end-left', 'end-right']);
|
||||
}
|
||||
|
||||
public function get_available_contexts() {
|
||||
return apply_filters('tainacan-admin-hooks-contexts', ['collection', 'metadatum', 'item', 'taxonomy', 'term', 'filter']);
|
||||
}
|
||||
|
||||
public function get_registered_hooks() {
|
||||
return $this->registered_hooks;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $context The context to add the hook to (collection, metadatum, item, taxonomy, term or filter)
|
||||
* @param string $position The position inside the page to hook. (begin, end, begin-left, begin-right, end-left, end-right)
|
||||
* @param callable $callback The callback that will output the form HTML
|
||||
*/
|
||||
public function register( $context, $callback, $position = 'end-left' ) {
|
||||
|
||||
$contexts = $this->get_available_contexts();
|
||||
$positions = $this->get_available_positions();
|
||||
|
||||
if ( !in_array($context, $contexts) || !in_array($position, $positions) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$result = call_user_func($callback);
|
||||
if (is_string($result)){
|
||||
$this->registered_hooks[$context][$position][] = $result;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -198,6 +198,53 @@
|
|||
{{ $i18n.get('label_create_new_page') }}</a>
|
||||
</b-field>
|
||||
|
||||
<!-- Change Default OrderBy Select and Order Button-->
|
||||
<b-field
|
||||
:addons="false"
|
||||
:label="$i18n.get('label_default_orderby')"
|
||||
:type="editFormErrors['default_orderby'] != undefined ? 'is-danger' : ''"
|
||||
:message="editFormErrors['default_orderby'] != undefined ? editFormErrors['default_orderby'] : $i18n.get('info_default_orderby')">
|
||||
<help-button
|
||||
:title="$i18n.getHelperTitle('collections', 'default_orderby')"
|
||||
:message="$i18n.getHelperMessage('collections', 'default_orderby')"/>
|
||||
<div class="control sorting-options">
|
||||
<label class="label">{{ $i18n.get('label_sort') }} </label>
|
||||
<b-select
|
||||
id="tainacan-select-default_order"
|
||||
v-model="form.default_order">
|
||||
<option
|
||||
role="button"
|
||||
:class="{ 'is-active': form.default_order == 'DESC' }"
|
||||
:value="'DESC'">
|
||||
{{ $i18n.get('label_descending') }}
|
||||
</option>
|
||||
<option
|
||||
role="button"
|
||||
:class="{ 'is-active': form.default_order == 'ASC' }"
|
||||
:value="'ASC'">
|
||||
{{ $i18n.get('label_ascending') }}
|
||||
</option>
|
||||
</b-select>
|
||||
<span
|
||||
class="label"
|
||||
style="padding: 0 0.65em;">
|
||||
{{ $i18n.get('info_by_inner') }}
|
||||
</span>
|
||||
<b-select
|
||||
expanded
|
||||
:loading="isLoadingMetadata"
|
||||
v-model="localDefaultOrderBy"
|
||||
id="tainacan-select-default_orderby">
|
||||
<option
|
||||
v-for="metadatum of sortingMetadata"
|
||||
:value="metadatum.id"
|
||||
:key="metadatum.id">
|
||||
{{ metadatum.name }}
|
||||
</option>
|
||||
</b-select>
|
||||
</div>
|
||||
</b-field>
|
||||
|
||||
<!-- Hide Items Thumbnail on Lists ------------------------ -->
|
||||
<b-field
|
||||
:addons="false"
|
||||
|
@ -332,7 +379,7 @@
|
|||
</div>
|
||||
</b-field>
|
||||
|
||||
<!-- Header Page -------------------------------- -->
|
||||
<!-- Header Image -------------------------------- -->
|
||||
<b-field :addons="false">
|
||||
<label class="label">{{ $i18n.get('label_header_image') }}</label>
|
||||
<div class="header-field">
|
||||
|
@ -628,7 +675,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { mapActions } from 'vuex';
|
||||
import { mapGetters, mapActions } from 'vuex';
|
||||
import wpMediaFrames from '../../js/wp-media-frames';
|
||||
import FileItem from '../other/file-item.vue';
|
||||
import { wpAjax, formHooks } from '../../js/mixins';
|
||||
|
@ -655,6 +702,8 @@ export default {
|
|||
files:[],
|
||||
enabled_view_modes: [],
|
||||
default_view_mode: [],
|
||||
default_order: 'ASC',
|
||||
default_orderby: 'creation_date',
|
||||
allow_comments: 'closed',
|
||||
allows_submission: 'no',
|
||||
submission_default_status: 'draft',
|
||||
|
@ -687,9 +736,18 @@ export default {
|
|||
reCAPTCHASettingsPagePath: tainacan_plugin.admin_url + 'admin.php?page=tainacan_item_submission',
|
||||
newPagePath: tainacan_plugin.admin_url + 'post-new.php?post_type=page',
|
||||
isUpdatingSlug: false,
|
||||
entityName: 'collection'
|
||||
entityName: 'collection',
|
||||
metadataSearchCancel: undefined,
|
||||
isLoadingMetadata: true,
|
||||
sortingMetadata: [],
|
||||
localDefaultOrderBy: 'creation_date'
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('metadata', {
|
||||
'metadata': 'getMetadata'
|
||||
})
|
||||
},
|
||||
watch: {
|
||||
'form.hide_items_thumbnail_on_lists' (newValue) {
|
||||
if (newValue == 'yes') {
|
||||
|
@ -711,11 +769,19 @@ export default {
|
|||
} else {
|
||||
this.registeredViewModes = tainacan_plugin.registered_view_modes;
|
||||
}
|
||||
},
|
||||
localDefaultOrderBy(newValue) {
|
||||
if (this.sortingMetadata && this.sortingMetadata.length && newValue) {
|
||||
let sortingMetadatumIndex = this.sortingMetadata.findIndex(aMetadatum => aMetadatum.id == newValue);
|
||||
if (sortingMetadatumIndex >= 0)
|
||||
this.form.default_orderby = this.$orderByHelper.getOrderByForMetadatum(this.sortingMetadata[sortingMetadatumIndex].metadata_type ? this.sortingMetadata[sortingMetadatumIndex] : this.sortingMetadata[sortingMetadatumIndex].id);
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
this.$root.$emit('onCollectionBreadCrumbUpdate', [{ path: '', label: this.$i18n.get('settings') }]);
|
||||
|
||||
|
||||
if (this.$route.query.fromImporter != undefined)
|
||||
this.fromImporter = this.$route.query.fromImporter;
|
||||
|
||||
|
@ -753,6 +819,8 @@ export default {
|
|||
this.form.parent = this.collection.parent;
|
||||
this.form.default_view_mode = this.collection.default_view_mode;
|
||||
this.form.enabled_view_modes = JSON.parse(JSON.stringify(this.collection.enabled_view_modes.reduce((result, viewMode) => { typeof viewMode == 'string' ? result.push(viewMode) : null; return result }, [])));
|
||||
this.form.default_order = this.collection.default_order;
|
||||
this.form.default_orderby = this.collection.default_orderby;
|
||||
this.form.allow_comments = this.collection.allow_comments;
|
||||
this.form.allows_submission = this.collection.allows_submission;
|
||||
this.form.submission_anonymous_user = this.collection.submission_anonymous_user;
|
||||
|
@ -796,6 +864,9 @@ export default {
|
|||
// this.isFetchingCollections = false;
|
||||
// });
|
||||
|
||||
// Prepares list of metadata available for sorting
|
||||
this.getMetadataForSorting();
|
||||
|
||||
this.isLoading = false;
|
||||
});
|
||||
} else {
|
||||
|
@ -821,6 +892,9 @@ export default {
|
|||
'fetchPage',
|
||||
'fetchAllCollectionNames'
|
||||
]),
|
||||
...mapActions('metadata', [
|
||||
'fetchMetadata'
|
||||
]),
|
||||
updateSlug: _.debounce(function() {
|
||||
if (!this.form.name || this.form.name.length <= 0)
|
||||
return;
|
||||
|
@ -856,6 +930,8 @@ export default {
|
|||
parent: this.form.parent,
|
||||
enabled_view_modes: this.form.enabled_view_modes,
|
||||
default_view_mode: this.form.default_view_mode,
|
||||
default_order: this.form.default_order,
|
||||
default_orderby: this.form.default_orderby,
|
||||
allows_submission: this.form.allows_submission,
|
||||
submission_anonymous_user: this.form.submission_anonymous_user,
|
||||
submission_default_status: this.form.submission_default_status,
|
||||
|
@ -882,6 +958,8 @@ export default {
|
|||
this.form.enable_cover_page = this.collection.enable_cover_page;
|
||||
this.form.enabled_view_modes = this.collection.enabled_view_modes.map((viewMode) => viewMode.viewMode);
|
||||
this.form.default_view_mode = this.collection.default_view_mode;
|
||||
this.form.default_order = this.collection.default_order;
|
||||
this.form.default_orderby = this.collection.default_orderby;
|
||||
this.form.allow_comments = this.collection.allow_comments;
|
||||
this.form.allows_submission = this.collection.allows_submission;
|
||||
this.form.submission_anonymous_user = this.collection.submission_anonymous_user;
|
||||
|
@ -939,6 +1017,8 @@ export default {
|
|||
this.form.slug = this.collection.slug;
|
||||
this.form.parent = this.collection.parent;
|
||||
this.form.default_view_mode = this.collection.default_view_mode;
|
||||
this.form.default_order = this.collection.default_order;
|
||||
this.form.default_orderby = this.collection.default_orderby;
|
||||
this.form.enabled_view_modes = [];
|
||||
this.form.allow_comments = this.collection.allow_comments;
|
||||
this.form.allows_submission = this.collection.allows_submission;
|
||||
|
@ -969,6 +1049,9 @@ export default {
|
|||
// this.isFetchingCollections = false;
|
||||
// });
|
||||
|
||||
// Prepares list of metadata available for sorting
|
||||
this.getMetadataForSorting();
|
||||
|
||||
this.isLoading = false;
|
||||
|
||||
})
|
||||
|
@ -1063,12 +1146,12 @@ export default {
|
|||
deleteThumbnail() {
|
||||
|
||||
this.updateThumbnail({collectionId: this.collectionId, thumbnailId: 0})
|
||||
.then(() => {
|
||||
this.collection.thumbnail = false;
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$console.error(error);
|
||||
});
|
||||
.then(() => {
|
||||
this.collection.thumbnail = false;
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$console.error(error);
|
||||
});
|
||||
},
|
||||
deleteHeaderImage() {
|
||||
|
||||
|
@ -1117,6 +1200,69 @@ export default {
|
|||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
getMetadataForSorting() {
|
||||
|
||||
// Cancels previous Request
|
||||
if (this.metadataSearchCancel != undefined)
|
||||
this.metadataSearchCancel.cancel('Metadata search Canceled.');
|
||||
|
||||
this.isLoadingMetadata = true;
|
||||
|
||||
// Processing is done inside a local variable
|
||||
this.fetchMetadata({
|
||||
collectionId: this.collectionId,
|
||||
isContextEdit: false,
|
||||
includeControlMetadataTypes: true,
|
||||
metaquery: [{
|
||||
key: 'metadata_type',
|
||||
compare: 'NOT IN',
|
||||
value: [ // Not every metadata can be used for sorting
|
||||
'Tainacan\\Metadata_Types\\Core_Description',
|
||||
'Tainacan\\Metadata_Types\\Taxonomy',
|
||||
'Tainacan\\Metadata_Types\\Relationship',
|
||||
'Tainacan\\Metadata_Types\\Compound',
|
||||
'Tainacan\\Metadata_Types\\User'
|
||||
]
|
||||
}]
|
||||
}).then((resp) => {
|
||||
resp.request
|
||||
.then(() => {
|
||||
// Not every metadata can be used for sorting
|
||||
this.sortingMetadata = JSON.parse(JSON.stringify(this.metadata));
|
||||
|
||||
// Adds creation date as it is the default
|
||||
this.sortingMetadata.push({
|
||||
name: this.$i18n.get('label_creation_date'),
|
||||
metadata_type: undefined,
|
||||
slug: 'creation_date',
|
||||
id: 'creation_date'
|
||||
});
|
||||
|
||||
// Updates localDefaultOrder variable that needs only the ID of the metadata
|
||||
if (this.form.default_orderby.metakey)
|
||||
this.localDefaultOrderBy = this.form.default_orderby.metakey;
|
||||
else {
|
||||
if (this.form.default_orderby == 'title') {
|
||||
const localDefaultOrderByIndex = this.sortingMetadata.findIndex((aMetadatum) => aMetadatum.metadata_type == 'Tainacan\\Metadata_Types\\Core_Title');
|
||||
this.localDefaultOrderBy = localDefaultOrderByIndex >= 0 ? this.sortingMetadata[localDefaultOrderByIndex].id : 'title';
|
||||
} else if (this.form.default_orderby == 'description') {
|
||||
const localDefaultOrderByIndex = this.sortingMetadata.findIndex((aMetadatum) => aMetadatum.metadata_type == 'Tainacan\\Metadata_Types\\Core_Description');
|
||||
this.localDefaultOrderBy = localDefaultOrderByIndex >= 0 ? this.sortingMetadata[localDefaultOrderByIndex].id : 'description';
|
||||
} else {
|
||||
this.localDefaultOrderBy = this.form.default_orderby;
|
||||
}
|
||||
}
|
||||
|
||||
this.isLoadingMetadata = false;
|
||||
})
|
||||
.catch(() => {
|
||||
this.isLoadingMetadata = false;
|
||||
})
|
||||
// Search Request Token for cancelling
|
||||
this.metadataSearchCancel = resp.source;
|
||||
})
|
||||
.catch(() => this.isLoadingMetadata = false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1243,6 +1389,15 @@ export default {
|
|||
.icon { color: var(--tainacan-gray2); }
|
||||
}
|
||||
}
|
||||
.sorting-options {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.label {
|
||||
font-weight: normal;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
.status-radios {
|
||||
display: flex;
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
content: $i18n.get('remove_value'),
|
||||
autoHide: true,
|
||||
placement: 'bottom',
|
||||
classes: ['tooltip', 'repository-tooltip'],
|
||||
classes: ['tainacan-tooltip', 'tooltip', 'repository-tooltip'],
|
||||
}"
|
||||
class="icon">
|
||||
<i class="tainacan-icon tainacan-icon-18px tainacan-icon-close"/>
|
||||
|
|
|
@ -47,37 +47,40 @@
|
|||
v-if="importerSourceInfo != undefined &&
|
||||
importerSourceInfo != null &&
|
||||
!isLoading">
|
||||
<a
|
||||
v-if="importerSourceInfo.source_metadata && importerSourceInfo.source_metadata.length > 0"
|
||||
style="margin-left: 2rem; font-size: 0.875em;"
|
||||
class="is-inline is-pulled-right add-link has-text-secondary"
|
||||
@click="createAllMetadata()">
|
||||
<span class="icon">
|
||||
<i class="tainacan-icon tainacan-icon-approvedcircle"/>
|
||||
</span>
|
||||
{{ $i18n.get('label_set_all_create_metadada') }}
|
||||
</a>
|
||||
<a
|
||||
v-if="collectionId != null && collectionId != undefined && importerSourceInfo.source_metadata &&importerSourceInfo.source_metadata.length > 0 && collection && collection.current_user_can_edit_metadata"
|
||||
style="font-size: 0.875em;"
|
||||
class="is-inline is-pulled-right add-link has-text-secondary"
|
||||
@click="createNewMetadatum()">
|
||||
<span class="icon">
|
||||
<i class="tainacan-icon tainacan-icon-add"/>
|
||||
</span>
|
||||
{{ $i18n.get('label_add_more_metadata') }}
|
||||
</a>
|
||||
<div class="mapping-control">
|
||||
<a
|
||||
v-if="importerSourceInfo.source_metadata && importerSourceInfo.source_metadata.length > 0"
|
||||
style="margin-left: 2rem; font-size: 0.875em;"
|
||||
class="is-inline is-pulled-right add-link has-text-secondary"
|
||||
@click="createAllMetadata()">
|
||||
<span class="icon">
|
||||
<i class="tainacan-icon tainacan-icon-approvedcircle"/>
|
||||
</span>
|
||||
{{ $i18n.get('label_set_all_create_metadata') }}
|
||||
</a>
|
||||
<a
|
||||
v-if="collectionId != null && collectionId != undefined && importerSourceInfo.source_metadata &&importerSourceInfo.source_metadata.length > 0 && collection && collection.current_user_can_edit_metadata"
|
||||
style="font-size: 0.875em;"
|
||||
class="is-inline is-pulled-right add-link has-text-secondary"
|
||||
@click="createNewMetadatum()">
|
||||
<span class="icon">
|
||||
<i class="tainacan-icon tainacan-icon-add"/>
|
||||
</span>
|
||||
{{ $i18n.get('label_add_more_metadata') }}
|
||||
</a>
|
||||
</div>
|
||||
<div
|
||||
class="mapping-header"
|
||||
v-if="importerSourceInfo.source_metadata.length > 0 || (importerSourceInfo.source_special_fields && importerSourceInfo.source_special_fields.length > 0)">
|
||||
<p>{{ $i18n.get('label_from_source_collection') }}</p>
|
||||
<hr>
|
||||
<span class="icon">
|
||||
<i class="tainacan-icon tainacan-icon-pointer" />
|
||||
<i class="tainacan-icon tainacan-icon-pointer tainacan-icon-1-25em" />
|
||||
</span>
|
||||
<hr>
|
||||
<p>{{ $i18n.get('label_to_target_collection') }}</p>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="source-metadatum"
|
||||
v-for="(sourceMetadatum, index) of importerSourceInfo.source_metadata"
|
||||
|
@ -195,14 +198,18 @@
|
|||
<p style="font-style: italic">{{ specialField }}</p>
|
||||
<p>{{ $i18n.get('info_special_fields_mapped_default') }}</p>
|
||||
</div>
|
||||
|
||||
<p v-if="importerSourceInfo.source_metadata.length <= 0">{{ $i18n.get('info_no_metadata_source_file') }}<br></p>
|
||||
|
||||
<p v-if="(!importerSourceInfo.source_special_fields || importerSourceInfo.source_special_fields.length <= 0)">{{ $i18n.get('info_no_special_fields_available') }}<br></p>
|
||||
|
||||
<b-modal
|
||||
@close="onMetadatumEditionCanceled()"
|
||||
:active.sync="isNewMetadatumModalActive"
|
||||
trap-focus
|
||||
aria-modal
|
||||
aria-role="dialog"
|
||||
:close-button-aria-label="$i18n.get('close')"
|
||||
custom-class="tainacan-modal">
|
||||
<div
|
||||
autofocus="true"
|
||||
|
@ -289,7 +296,8 @@
|
|||
:can-cancel="false"
|
||||
:width="820"
|
||||
scroll="keep"
|
||||
trap-focus
|
||||
trap-focus
|
||||
:close-button-aria-label="$i18n.get('close')"
|
||||
autofocus
|
||||
role="dialog"
|
||||
tabindex="-1"
|
||||
|
@ -837,6 +845,10 @@ export default {
|
|||
}
|
||||
}
|
||||
|
||||
.page-container {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.field {
|
||||
position: relative;
|
||||
}
|
||||
|
@ -850,6 +862,13 @@ export default {
|
|||
|
||||
.form-submit {
|
||||
margin-top: 24px;
|
||||
position: sticky !important;
|
||||
bottom: 0;
|
||||
background: var(--tainacan-background-color, white);
|
||||
z-index: 9;
|
||||
padding: 12px;
|
||||
border-top: 1px solid var(--tainacan-gray3);
|
||||
box-shadow: 0 -5px 12px -14px var(--tainacan-gray5);
|
||||
}
|
||||
|
||||
.section-label {
|
||||
|
@ -860,22 +879,40 @@ export default {
|
|||
}
|
||||
|
||||
.source-metadatum {
|
||||
padding: 2px 0 2px 8px;
|
||||
padding: 2px 0;
|
||||
min-height: 35px;
|
||||
border-bottom: 1px solid var(--tainacan-gray2);
|
||||
width: 100%;
|
||||
margin-bottom: 6px;
|
||||
width: calc(100% - 32px);
|
||||
margin: 3px 16px 6px 16px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
position: relative;
|
||||
|
||||
&::before {
|
||||
display: block;
|
||||
content: '';
|
||||
position: absolute;
|
||||
height: 1px;
|
||||
width: 100%;
|
||||
background-color: var(--tainacan-gray2);
|
||||
z-index: -1;
|
||||
}
|
||||
&>p {
|
||||
font-weight: normal;
|
||||
transition: font-weight 0.1s ease;
|
||||
padding-right: 6px;
|
||||
overflow: hidden;
|
||||
word-wrap: break-word;
|
||||
background-color: var(--tainacan-background-color, white);
|
||||
}
|
||||
.control {
|
||||
max-width: 60%;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
--tainacan-input-border-color: var(--tainacan-gray4);
|
||||
&::before {
|
||||
background-color: var(--tainacan-gray4);
|
||||
}
|
||||
&>p {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
@ -907,11 +944,23 @@ export default {
|
|||
.is-inline .control{
|
||||
display: inline;
|
||||
}
|
||||
.drop-inner{
|
||||
.drop-inner {
|
||||
padding: 1em 3em;
|
||||
}
|
||||
|
||||
.mapping-control {
|
||||
background-color: var(--tainacan-background-color, white);
|
||||
position: sticky;
|
||||
top: -34px;
|
||||
z-index: 9;
|
||||
height: 2.5rem;
|
||||
padding-top: 12px;
|
||||
}
|
||||
.mapping-header {
|
||||
background-color: var(--tainacan-background-color, white);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 9;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
@ -919,7 +968,9 @@ export default {
|
|||
color: var(--tainacan-info-color);
|
||||
font-size: 0.875em;
|
||||
font-weight: bold;
|
||||
margin: 18px 0 6px 0;
|
||||
margin: 0 0 12px 0;
|
||||
border-bottom: 1px solid var(--tainacan-gray3);
|
||||
box-shadow: 0 5px 12px -14px var(--tainacan-gray5);
|
||||
|
||||
p {
|
||||
white-space: nowrap;
|
||||
|
@ -929,6 +980,7 @@ export default {
|
|||
margin-left: 12px;
|
||||
margin-right: 12px;
|
||||
height: 1px;
|
||||
background: linear-gradient(90deg, #f2f2f2 ,#dbdbdb, #f2f2f2);
|
||||
}
|
||||
|
||||
@media screen and (max-width: 768px) {
|
||||
|
|
|
@ -331,7 +331,8 @@ export default {
|
|||
},
|
||||
width: 'calc(100% - (2 * var(--tainacan-one-column)))',
|
||||
trapFocus: true,
|
||||
customClass: 'tainacan-modal'
|
||||
customClass: 'tainacan-modal',
|
||||
closeButtonAriaLabel: this.$i18n.get('close')
|
||||
});
|
||||
},
|
||||
deleteOneItem(itemId, index) {
|
||||
|
@ -353,7 +354,8 @@ export default {
|
|||
}
|
||||
},
|
||||
trapFocus: true,
|
||||
customClass: 'tainacan-modal'
|
||||
customClass: 'tainacan-modal',
|
||||
closeButtonAriaLabel: this.$i18n.get('close')
|
||||
});
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<div>
|
||||
<div :class="isCreatingNewItem ? 'item-creation-container' : 'item-edition-container'"><!-- Do NOT remove this classes, they may be used by third party plugins -->
|
||||
<b-loading
|
||||
:is-full-page="false"
|
||||
:active.sync="isLoading"
|
||||
|
@ -555,7 +555,8 @@
|
|||
trap-focus
|
||||
aria-modal
|
||||
aria-role="dialog"
|
||||
custom-class="tainacan-modal">
|
||||
custom-class="tainacan-modal"
|
||||
:close-button-aria-label="$i18n.get('close')">
|
||||
<div class="tainacan-modal-content">
|
||||
<div class="tainacan-modal-title">
|
||||
<h2>{{ $i18n.get('label_thumbnail_alt') }}</h2>
|
||||
|
@ -593,7 +594,8 @@
|
|||
trap-focus
|
||||
aria-modal
|
||||
aria-role="dialog"
|
||||
custom-class="tainacan-modal">
|
||||
custom-class="tainacan-modal"
|
||||
:close-button-aria-label="$i18n.get('close')">
|
||||
<div class="tainacan-modal-content">
|
||||
<div class="tainacan-modal-title">
|
||||
<h2>{{ $i18n.get('instruction_write_text') }}</h2>
|
||||
|
@ -635,7 +637,8 @@
|
|||
tabindex="-1"
|
||||
aria-modal
|
||||
aria-role="dialog"
|
||||
custom-class="tainacan-modal">
|
||||
custom-class="tainacan-modal"
|
||||
:close-button-aria-label="$i18n.get('close')">
|
||||
<div class="tainacan-modal-content">
|
||||
<div class="tainacan-modal-title">
|
||||
<h2>{{ $i18n.get('instruction_insert_url') }}</h2>
|
||||
|
@ -681,6 +684,19 @@
|
|||
class="help">
|
||||
{{ $i18n.get('info_iframe_dimensions') }}
|
||||
</p>
|
||||
<br>
|
||||
<b-field
|
||||
v-if="urlForcedIframe"
|
||||
:addons="false"
|
||||
:label="$i18n.get('label_document_option_is_image')">
|
||||
|
||||
<b-switch
|
||||
size="is-small"
|
||||
v-model="urlIsImage" />
|
||||
<help-button
|
||||
:title="$i18n.get('label_document_option_is_image')"
|
||||
:message="$i18n.get('info_document_option_is_image')" />
|
||||
</b-field>
|
||||
|
||||
<div class="field is-grouped form-submit">
|
||||
<div class="control">
|
||||
|
@ -1008,7 +1024,8 @@ export default {
|
|||
isThumbnailAltTextModalActive: false,
|
||||
urlForcedIframe: false,
|
||||
urlIframeWidth: 600,
|
||||
urlIframeHeight: 450
|
||||
urlIframeHeight: 450,
|
||||
urlIsImage: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
@ -1160,7 +1177,8 @@ export default {
|
|||
},
|
||||
},
|
||||
trapFocus: true,
|
||||
customClass: 'tainacan-modal'
|
||||
customClass: 'tainacan-modal',
|
||||
closeButtonAriaLabel: this.$i18n.get('close')
|
||||
});
|
||||
} else {
|
||||
next()
|
||||
|
@ -1430,7 +1448,8 @@ export default {
|
|||
this.form.document_options = {
|
||||
forced_iframe: this.urlForcedIframe,
|
||||
forced_iframe_width: this.urlIframeWidth,
|
||||
forced_iframe_height: this.urlIframeHeight
|
||||
forced_iframe_height: this.urlIframeHeight,
|
||||
is_image: this.urlIsImage
|
||||
}
|
||||
this.updateItemDocument({
|
||||
item_id: this.itemId,
|
||||
|
@ -1465,6 +1484,7 @@ export default {
|
|||
this.isURLModalActive = false;
|
||||
this.urlLink = '';
|
||||
this.urlForcedIframe = this.form.document_options && this.form.document_options['forced_iframe'] !== undefined ? this.form.document_options['forced_iframe'] : false;
|
||||
this.urlIsImage = this.form.document_options && this.form.document_options['is_image'] !== undefined ? this.form.document_options['is_image'] : false;
|
||||
this.urlIframeWidth = this.form.document_options && this.form.document_options['forced_iframe_width'] !== undefined ? this.form.document_options['forced_iframe_width'] : 600;
|
||||
this.urlIframeHeight = this.form.document_options && this.form.document_options['forced_iframe_height'] !== undefined ? this.form.document_options['forced_iframe_height'] : 450;
|
||||
},
|
||||
|
@ -1542,7 +1562,8 @@ export default {
|
|||
}
|
||||
},
|
||||
trapFocus: true,
|
||||
customClass: 'tainacan-modal'
|
||||
customClass: 'tainacan-modal',
|
||||
closeButtonAriaLabel: this.$i18n.get('close')
|
||||
});
|
||||
|
||||
},
|
||||
|
@ -1665,7 +1686,8 @@ export default {
|
|||
}
|
||||
},
|
||||
trapFocus: true,
|
||||
customClass: 'tainacan-modal'
|
||||
customClass: 'tainacan-modal',
|
||||
closeButtonAriaLabel: this.$i18n.get('close')
|
||||
});
|
||||
},
|
||||
loadExistingItem() {
|
||||
|
@ -1725,6 +1747,8 @@ export default {
|
|||
|
||||
if (this.form.document_options !== undefined && this.form.document_options['forced_iframe'] !== undefined)
|
||||
this.urlForcedIframe = this.form.document_options['forced_iframe'];
|
||||
if (this.form.document_options !== undefined && this.form.document_options['is_image'] !== undefined)
|
||||
this.urlIsImage = this.form.document_options['is_image'];
|
||||
if (this.form.document_options !== undefined && this.form.document_options['forced_iframe_width'] !== undefined)
|
||||
this.urlIframeWidth = this.form.document_options['forced_iframe_width'];
|
||||
if (this.form.document_options !== undefined && this.form.document_options['forced_iframe_height'] !== undefined)
|
||||
|
@ -1929,9 +1953,9 @@ export default {
|
|||
}
|
||||
}
|
||||
|
||||
.b-tabs {
|
||||
overflow: hidden !important;
|
||||
}
|
||||
// .b-tabs {
|
||||
// overflow: hidden !important;
|
||||
// }
|
||||
}
|
||||
|
||||
.section-label {
|
||||
|
@ -1956,6 +1980,7 @@ export default {
|
|||
|
||||
.collapse-all {
|
||||
font-size: 0.75em;
|
||||
white-space: nowrap;
|
||||
.icon {
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
|
|
@ -18,7 +18,9 @@
|
|||
</a> -->
|
||||
<hr>
|
||||
</div>
|
||||
<div class="tainacan-form">
|
||||
<div
|
||||
class="tainacan-form"
|
||||
:class="'tainacan-metadatum-edition-form--type-' + editForm.metadata_type_object.component">
|
||||
<div class="options-columns">
|
||||
<b-field
|
||||
:addons="false"
|
||||
|
@ -68,6 +70,23 @@
|
|||
@focus="clearErrors('description')"/>
|
||||
</b-field>
|
||||
|
||||
<b-field
|
||||
v-if="editForm.metadata_type_object.component != 'tainacan-compound'"
|
||||
:addons="false"
|
||||
:type="formErrors['placeholder'] != undefined ? 'is-danger' : ''"
|
||||
:message="formErrors['placeholder'] != undefined ? formErrors['placeholder'] : ''">
|
||||
<label class="label is-inline">
|
||||
{{ $i18n.getHelperTitle('metadata', 'placeholder') }}
|
||||
<help-button
|
||||
:title="$i18n.getHelperTitle('metadata', 'placeholder')"
|
||||
:message="$i18n.getHelperMessage('metadata', 'placeholder')"/>
|
||||
</label>
|
||||
<b-input
|
||||
v-model="editForm.placeholder"
|
||||
name="placeholder"
|
||||
@focus="clearErrors('placeholder')"/>
|
||||
</b-field>
|
||||
|
||||
<b-field
|
||||
v-if="editForm.parent == 0"
|
||||
:addons="false"
|
||||
|
@ -532,7 +551,7 @@
|
|||
white-space: normal;
|
||||
}
|
||||
.metadata-form-section {
|
||||
margin: 0.75em 0 0.5em 0;
|
||||
margin: 1.5em 0 0.5em -1.5em;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
|
||||
|
@ -558,9 +577,6 @@
|
|||
margin-left: 42px;
|
||||
}
|
||||
}
|
||||
.metadata-form-section+.options-columns {
|
||||
padding-left: 1.75em;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 768px) {
|
||||
.options-columns {
|
||||
|
|
|
@ -300,7 +300,8 @@
|
|||
}
|
||||
},
|
||||
trapFocus: true,
|
||||
customClass: 'tainacan-modal'
|
||||
customClass: 'tainacan-modal',
|
||||
closeButtonAriaLabel: this.$i18n.get('close')
|
||||
});
|
||||
} else if (this.isEditingTerm) {
|
||||
this.$buefy.modal.open({
|
||||
|
@ -315,7 +316,8 @@
|
|||
}
|
||||
},
|
||||
trapFocus: true,
|
||||
customClass: 'tainacan-modal'
|
||||
customClass: 'tainacan-modal',
|
||||
closeButtonAriaLabel: this.$i18n.get('close')
|
||||
});
|
||||
} else {
|
||||
next();
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
:is="isModal ? 'header' : 'div'"
|
||||
class="tainacan-page-title"
|
||||
:class="{ 'tainacan-modal-title': isModal }">
|
||||
<h2>{{ editForm & editForm.id && editForm.id != 'new' ? $i18n.get("title_term_edition") : $i18n.get("title_term_creation") }}</h2>
|
||||
<h2>{{ editForm & editForm.id && editForm.id != 'new' ? $i18n.get("title_term_edit") : $i18n.get("title_term_creation") }}</h2>
|
||||
<a
|
||||
v-if="editForm && editForm.url != undefined && editForm.url!= ''"
|
||||
target="_blank"
|
||||
|
@ -86,7 +86,7 @@
|
|||
v-tooltip="{
|
||||
content: $i18n.get('edit'),
|
||||
autoHide: true,
|
||||
classes: ['tooltip', 'repository-tooltip'],
|
||||
classes: ['tainacan-tooltip', 'tooltip', 'repository-tooltip'],
|
||||
placement: 'bottom'
|
||||
}"
|
||||
class="icon is-small">
|
||||
|
@ -102,7 +102,7 @@
|
|||
v-tooltip="{
|
||||
content: $i18n.get('delete'),
|
||||
autoHide: true,
|
||||
classes: ['tooltip', 'repository-tooltip'],
|
||||
classes: ['tainacan-tooltip', 'tooltip', 'repository-tooltip'],
|
||||
placement: 'bottom'
|
||||
}"
|
||||
class="icon is-small">
|
||||
|
|
|
@ -149,12 +149,6 @@
|
|||
} else {
|
||||
this.label = '';
|
||||
this.selected = '';
|
||||
this.$emit('input', {
|
||||
filter: 'autocomplete',
|
||||
metadatum_id: this.metadatumId,
|
||||
collection_id: this.collectionId,
|
||||
value: this.selected
|
||||
});
|
||||
}
|
||||
}, 500),
|
||||
searchMore: _.debounce(function () {
|
||||
|
@ -176,12 +170,9 @@
|
|||
|
||||
axios.get(endpoint)
|
||||
.then( res => {
|
||||
|
||||
let item = res.data;
|
||||
this.label = item.title;
|
||||
this.selected = item.title;
|
||||
|
||||
this.$emit( 'sendValuesToTags', { label: this.label, value: this.selected, metadatumName: this.metadatumName });
|
||||
})
|
||||
.catch(error => {
|
||||
this.$console.log(error);
|
||||
|
@ -189,7 +180,6 @@
|
|||
} else {
|
||||
this.label = metadata.value;
|
||||
this.selected = metadata.value;
|
||||
this.$emit( 'sendValuesToTags', { label: this.label, value: this.selected, metadatumName: this.metadatumName });
|
||||
}
|
||||
} else {
|
||||
this.label = '';
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
<p
|
||||
v-if="isLoadingOptions == false && options.length != undefined && options.length <= 0"
|
||||
class="no-options-placeholder">
|
||||
{{ $i18n.get('info_no_options_avialable_filtering') }}
|
||||
{{ $i18n.get('info_no_options_available_filtering') }}
|
||||
</p>
|
||||
</template>
|
||||
<template v-else>
|
||||
|
@ -163,26 +163,8 @@
|
|||
return false;
|
||||
|
||||
let index = this.query.metaquery.findIndex(newMetadatum => newMetadatum.key == this.metadatumId );
|
||||
|
||||
if ( index >= 0){
|
||||
let query = this.query.metaquery.slice();
|
||||
this.selected = query[ index ].value;
|
||||
} else {
|
||||
this.selected = [];
|
||||
}
|
||||
|
||||
let onlyLabels = [];
|
||||
if (!isNaN(this.selected[0])){
|
||||
for (let aSelected of this.selected) {
|
||||
let valueIndex = this.options.findIndex(option => option.value == aSelected);
|
||||
|
||||
if (valueIndex >= 0) {
|
||||
onlyLabels.push(this.options[valueIndex].label);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.$emit( 'sendValuesToTags', { label: onlyLabels.length ? onlyLabels : this.selected, value: this.selected, metadatumName: this.metadatumName });
|
||||
this.selected = index >= 0 ? this.query.metaquery.slice()[ index ].value : [];
|
||||
},
|
||||
openCheckboxModal() {
|
||||
this.$buefy.modal.open({
|
||||
|
@ -206,7 +188,8 @@
|
|||
}
|
||||
},
|
||||
trapFocus: true,
|
||||
customClass: 'tainacan-modal'
|
||||
customClass: 'tainacan-modal',
|
||||
closeButtonAriaLabel: this.$i18n.get('close')
|
||||
});
|
||||
},
|
||||
}
|
||||
|
@ -243,5 +226,6 @@
|
|||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
line-height: 1.45em;
|
||||
break-inside: avoid;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
@ -131,13 +131,6 @@
|
|||
const dateValueEnd = new Date(metadata.value[1].replace(/-/g, '/'));
|
||||
this.dateEnd = moment(dateValueEnd, moment.ISO_8601).toDate();
|
||||
}
|
||||
|
||||
if (metadata.value[0] != undefined && metadata.value[1] != undefined)
|
||||
this.$emit('sendValuesToTags', {
|
||||
label: this.parseDateToNavigatorLanguage(metadata.value[0]) + ' - ' + this.parseDateToNavigatorLanguage(metadata.value[1]),
|
||||
value: [metadata.value[0], metadata.value[1]],
|
||||
metadatumName: this.metadatumName
|
||||
});
|
||||
} else {
|
||||
this.dateInit = null;
|
||||
this.dateEnd = null;
|
||||
|
@ -167,13 +160,6 @@
|
|||
collection_id: this.collectionId,
|
||||
value: values
|
||||
});
|
||||
|
||||
if (values[0] != undefined && values[1] != undefined)
|
||||
this.$emit( 'sendValuesToTags', {
|
||||
label: this.parseDateToNavigatorLanguage(values[0]) + ' - ' + this.parseDateToNavigatorLanguage(values[1]),
|
||||
value: [ values[0], values[1] ],
|
||||
metadatumName: this.metadatumName
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,35 +9,63 @@ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
|||
*/
|
||||
class Date_Interval extends Filter_Type {
|
||||
|
||||
function __construct(){
|
||||
$this->set_name( __('Date Interval', 'tainacan') );
|
||||
$this->set_supported_types(['date']);
|
||||
$this->set_component('tainacan-filter-date-interval');
|
||||
$this->set_use_max_options(false);
|
||||
$this->set_preview_template('
|
||||
<div>
|
||||
<div class="datepicker control is-small">
|
||||
<div class="dropdown is-bottom-left is-mobile-modal">
|
||||
<div role="button" class="dropdown-trigger">
|
||||
<div class="control has-icons-left is-small is-clearfix">
|
||||
<input type="text" autocomplete="off" placeholder=" '. __('Select a date', 'tainacan') .'" class="input is-small">
|
||||
<span class="icon is-left is-small"><i class="mdi mdi-calendar-today"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="is-size-7 has-text-centered is-marginless">until</p>
|
||||
<div class="datepicker control is-small">
|
||||
<div class="dropdown is-bottom-left is-mobile-modal">
|
||||
<div role="button" class="dropdown-trigger">
|
||||
<div class="control has-icons-left is-small is-clearfix">
|
||||
<input type="text" autocomplete="off" placeholder=" '. __('Select a date', 'tainacan') .'" class="input is-small">
|
||||
<span class="icon is-left is-small"><i class="mdi mdi-calendar-today"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
');
|
||||
}
|
||||
}
|
||||
function __construct(){
|
||||
$this->set_name( __('Date Interval', 'tainacan') );
|
||||
$this->set_supported_types(['date']);
|
||||
$this->set_component('tainacan-filter-date-interval');
|
||||
$this->set_use_max_options(false);
|
||||
$this->set_preview_template('
|
||||
<div>
|
||||
<div class="datepicker control is-small">
|
||||
<div class="dropdown is-bottom-left is-mobile-modal">
|
||||
<div role="button" class="dropdown-trigger">
|
||||
<div class="control has-icons-left is-small is-clearfix">
|
||||
<input type="text" autocomplete="off" placeholder=" '. __('Select a date', 'tainacan') .'" class="input is-small">
|
||||
<span class="icon is-left is-small"><i class="mdi mdi-calendar-today"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="is-size-7 has-text-centered is-marginless">until</p>
|
||||
<div class="datepicker control is-small">
|
||||
<div class="dropdown is-bottom-left is-mobile-modal">
|
||||
<div role="button" class="dropdown-trigger">
|
||||
<div class="control has-icons-left is-small is-clearfix">
|
||||
<input type="text" autocomplete="off" placeholder=" '. __('Select a date', 'tainacan') .'" class="input is-small">
|
||||
<span class="icon is-left is-small"><i class="mdi mdi-calendar-today"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
');
|
||||
}
|
||||
}
|
||||
|
||||
class Date_Interval_Interval_Helper {
|
||||
use \Tainacan\Traits\Singleton_Instance;
|
||||
|
||||
protected function init() {
|
||||
add_filter( 'tainacan-api-items-tainacan-filter-date-interval-filter-arguments', [$this, 'format_filter_arguments']);
|
||||
}
|
||||
|
||||
function format_filter_arguments( $filter_arguments ) {
|
||||
if (
|
||||
!isset($filter_arguments['compare']) ||
|
||||
!isset($filter_arguments['label'])
|
||||
) {
|
||||
return $filter_arguments;
|
||||
}
|
||||
|
||||
if (
|
||||
strtoupper($filter_arguments['compare']) === 'BETWEEN' &&
|
||||
is_array($filter_arguments['label']) &&
|
||||
count($filter_arguments['label']) === 2
|
||||
) {
|
||||
$filter_arguments['label'] = $filter_arguments['label'][0] . ' - ' . $filter_arguments['label'][1];
|
||||
}
|
||||
|
||||
return $filter_arguments;
|
||||
}
|
||||
}
|
||||
Date_Interval_Interval_Helper::get_instance();
|
|
@ -174,12 +174,6 @@
|
|||
|
||||
const dateValue = new Date(textValue.replace(/-/g, '/'));
|
||||
this.value = moment(dateValue, moment.ISO_8601).toDate();
|
||||
|
||||
this.$emit('sendValuesToTags', {
|
||||
label: this.comparator + ' ' + this.parseDateToNavigatorLanguage(textValue),
|
||||
value: textValue,
|
||||
metadatumName: this.metadatumName
|
||||
});
|
||||
}
|
||||
|
||||
} else {
|
||||
|
@ -221,11 +215,6 @@
|
|||
collection_id: this.collectionId,
|
||||
value: valueQuery
|
||||
});
|
||||
this.$emit('sendValuesToTags', {
|
||||
label: this.comparator + ' ' + moment(this.value, moment.ISO_8601).format(this.dateFormat),
|
||||
value: valueQuery,
|
||||
metadatumName: this.metadatumName
|
||||
});
|
||||
},
|
||||
onChangeComparator(newComparator) {
|
||||
this.comparator = newComparator;
|
||||
|
|
|
@ -9,67 +9,113 @@ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
|||
*/
|
||||
class Date extends Filter_Type {
|
||||
|
||||
function __construct(){
|
||||
$this->set_name( __('Date', 'tainacan') );
|
||||
$this->set_supported_types(['date']);
|
||||
$this->set_component('tainacan-filter-date');
|
||||
// $this->set_form_component('tainacan-filter-form-date');
|
||||
$this->set_use_max_options(false);
|
||||
// $this->set_default_options([
|
||||
// 'type' => 'day'
|
||||
// ]);
|
||||
$this->set_preview_template('
|
||||
<div>
|
||||
<div>
|
||||
<div class="date-filter-container">
|
||||
<div class="dropdown is-active">
|
||||
<div role="button" class="dropdown-trigger">
|
||||
<button class="button is-white">
|
||||
<span class="icon is-small">
|
||||
<i>=</i>
|
||||
</span>
|
||||
<span class="icon">
|
||||
<i class="tainacan-icon tainacan-icon-20px tainacan-icon-arrowdown"></i>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="background" style="display: none;"></div>
|
||||
<div class="dropdown-menu" style="display: none;">
|
||||
<div role="list" class="dropdown-content">
|
||||
<a class="dropdown-item is-active">= ' . __('Equal', 'tainacan') .'</a>
|
||||
<a class="dropdown-item">≠ '. __('Not equal', 'tainacan') .'</a>
|
||||
<a class="dropdown-item">> '. __('After', 'tainacan') .'</a>
|
||||
<a class="dropdown-item">≥ '. __('After (inclusive)', 'tainacan') .'</a>
|
||||
<a class="dropdown-item">< '. __('Before', 'tainacan') .'</a>
|
||||
<a class="dropdown-item">≤ '. __('Before (inclusive)', 'tainacan') .'</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="datepicker control is-small">
|
||||
<div class="dropdown is-bottom-left is-mobile-modal">
|
||||
<div role="button" class="dropdown-trigger">
|
||||
<div class="control has-icons-left is-small is-clearfix">
|
||||
<input type="text" autocomplete="off" placeholder=" '. __('Select a date', 'tainacan') .'" class="input is-small">
|
||||
<span class="icon is-left is-small"><i class="mdi mdi-calendar-today"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
');
|
||||
}
|
||||
function __construct(){
|
||||
$this->set_name( __('Date', 'tainacan') );
|
||||
$this->set_supported_types(['date']);
|
||||
$this->set_component('tainacan-filter-date');
|
||||
// $this->set_form_component('tainacan-filter-form-date');
|
||||
$this->set_use_max_options(false);
|
||||
// $this->set_default_options([
|
||||
// 'type' => 'day'
|
||||
// ]);
|
||||
$this->set_preview_template('
|
||||
<div>
|
||||
<div>
|
||||
<div class="date-filter-container">
|
||||
<div class="dropdown is-active">
|
||||
<div role="button" class="dropdown-trigger">
|
||||
<button class="button is-white">
|
||||
<span class="icon is-small">
|
||||
<i>=</i>
|
||||
</span>
|
||||
<span class="icon">
|
||||
<i class="tainacan-icon tainacan-icon-20px tainacan-icon-arrowdown"></i>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="background" style="display: none;"></div>
|
||||
<div class="dropdown-menu" style="display: none;">
|
||||
<div role="list" class="dropdown-content">
|
||||
<a class="dropdown-item is-active">= ' . __('Equal', 'tainacan') .'</a>
|
||||
<a class="dropdown-item">≠ '. __('Not equal', 'tainacan') .'</a>
|
||||
<a class="dropdown-item">> '. __('After', 'tainacan') .'</a>
|
||||
<a class="dropdown-item">≥ '. __('After (inclusive)', 'tainacan') .'</a>
|
||||
<a class="dropdown-item">< '. __('Before', 'tainacan') .'</a>
|
||||
<a class="dropdown-item">≤ '. __('Before (inclusive)', 'tainacan') .'</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="datepicker control is-small">
|
||||
<div class="dropdown is-bottom-left is-mobile-modal">
|
||||
<div role="button" class="dropdown-trigger">
|
||||
<div class="control has-icons-left is-small is-clearfix">
|
||||
<input type="text" autocomplete="off" placeholder=" '. __('Select a date', 'tainacan') .'" class="input is-small">
|
||||
<span class="icon is-left is-small"><i class="mdi mdi-calendar-today"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
');
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @inheritdoc
|
||||
// */
|
||||
// public function get_form_labels(){
|
||||
// return [
|
||||
// 'type' => [
|
||||
// 'title' => __( 'Type', 'tainacan' ),
|
||||
// 'description' => __( 'The type of the date picker, may be for day, month or year.', 'tainacan' ),
|
||||
// ]
|
||||
// ];
|
||||
// }
|
||||
}
|
||||
// /**
|
||||
// * @inheritdoc
|
||||
// */
|
||||
// public function get_form_labels(){
|
||||
// return [
|
||||
// 'type' => [
|
||||
// 'title' => __( 'Type', 'tainacan' ),
|
||||
// 'description' => __( 'The type of the date picker, may be for day, month or year.', 'tainacan' ),
|
||||
// ]
|
||||
// ];
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
class Date_Helper {
|
||||
use \Tainacan\Traits\Singleton_Instance;
|
||||
|
||||
protected function init() {
|
||||
add_filter( 'tainacan-api-items-tainacan-filter-date-filter-arguments', [$this, 'format_filter_arguments']);
|
||||
}
|
||||
|
||||
function format_filter_arguments( $filter_arguments ) {
|
||||
if (
|
||||
!isset($filter_arguments['compare']) ||
|
||||
!isset($filter_arguments['label'])
|
||||
) {
|
||||
return $filter_arguments;
|
||||
}
|
||||
|
||||
if (count($filter_arguments['label']) === 1) {
|
||||
switch ($filter_arguments['compare']) {
|
||||
case '=':
|
||||
$filter_arguments['label'] = '= ' . $filter_arguments['label'][0];
|
||||
break;
|
||||
case '!=':
|
||||
$filter_arguments['label'] = '≠ ' . $filter_arguments['label'][0];
|
||||
break;
|
||||
case '>':
|
||||
$filter_arguments['label'] = '> ' . $filter_arguments['label'][0];
|
||||
break;
|
||||
case '>=':
|
||||
$filter_arguments['label'] = '≥ ' . $filter_arguments['label'][0];
|
||||
break;
|
||||
case '<':
|
||||
$filter_arguments['label'] = '< ' . $filter_arguments['label'][0];
|
||||
break;
|
||||
case '<=':
|
||||
$filter_arguments['label'] = '≤ ' . $filter_arguments['label'][0];
|
||||
break;
|
||||
default:
|
||||
$filter_arguments['label'] = $filter_arguments['label'][0];
|
||||
}
|
||||
}
|
||||
|
||||
return $filter_arguments;
|
||||
}
|
||||
}
|
||||
Date_Helper::get_instance();
|
|
@ -90,25 +90,19 @@
|
|||
collection_id: this.collectionId,
|
||||
value: values
|
||||
});
|
||||
|
||||
if (values[0] != undefined && values[1] != undefined)
|
||||
this.$emit('sendValuesToTags', { label: values[0] + ' - ' + values[1], value: values, metadatumName: this.metadatumName });
|
||||
},
|
||||
updateSelectedValues(){
|
||||
if ( !this.query || !this.query.metaquery || !Array.isArray( this.query.metaquery ) )
|
||||
return false;
|
||||
|
||||
let index = this.query.metaquery.findIndex(newMetadatum => newMetadatum.key == this.metadatumId );
|
||||
if ( index >= 0 ){
|
||||
if ( index >= 0 ) {
|
||||
|
||||
let metaquery = this.query.metaquery[ index ];
|
||||
if ( metaquery.value && metaquery.value.length > 1 ) {
|
||||
this.valueInit = new Number(metaquery.value[0]);
|
||||
this.valueEnd = new Number(metaquery.value[1]);
|
||||
}
|
||||
|
||||
if (metaquery.value[0] != undefined && metaquery.value[1] != undefined)
|
||||
this.$emit('sendValuesToTags', { label: this.valueInit + ' - ' + this.valueEnd, value: metaquery.value, metadatumName: this.metadatumName });
|
||||
|
||||
} else {
|
||||
this.valueInit = null;
|
||||
this.valueEnd = null;
|
||||
|
|
|
@ -9,67 +9,95 @@ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
|||
*/
|
||||
class Numeric_Interval extends Filter_Type {
|
||||
|
||||
function __construct(){
|
||||
$this->set_name( __('Numeric Interval', 'tainacan') );
|
||||
$this->set_supported_types(['float']);
|
||||
$this->set_component('tainacan-filter-numeric-interval');
|
||||
$this->set_form_component('tainacan-filter-form-numeric-interval');
|
||||
$this->set_use_max_options(false);
|
||||
$this->set_default_options([
|
||||
'step' => 1
|
||||
]);
|
||||
$this->set_preview_template('
|
||||
<div>
|
||||
<div class="b-numberinput field is-grouped">
|
||||
<p class="control">
|
||||
<button type="button" class="button is-primary is-small">
|
||||
<span class="icon is-small">
|
||||
<i class="mdi mdi-minus"></i>
|
||||
</span>
|
||||
</button>
|
||||
</p>
|
||||
<div class="control is-small is-clearfix">
|
||||
<input type="number" step="0.01" class="input is-small" value="6">
|
||||
</div>
|
||||
<p class="control">
|
||||
<button type="button" class="button is-primary is-small">
|
||||
<span class="icon is-small">
|
||||
<i class="mdi mdi-plus"></i>
|
||||
</span>
|
||||
</button>
|
||||
</p>
|
||||
</div>
|
||||
<p class="is-size-7 has-text-centered is-marginless">until</p>
|
||||
<div class="b-numberinput field is-grouped">
|
||||
<p class="control">
|
||||
<button type="button" class="button is-primary is-small">
|
||||
<span class="icon is-small">
|
||||
<i class="mdi mdi-minus"></i>
|
||||
</span>
|
||||
</button>
|
||||
</p>
|
||||
<div class="control is-small is-clearfix">
|
||||
<input type="number" step="0.01" class="input is-small" value="10">
|
||||
</div>
|
||||
<p class="control">
|
||||
<button type="button" class="button is-primary is-small">
|
||||
<span class="icon is-small">
|
||||
<i class="mdi mdi-plus"></i>
|
||||
</span>
|
||||
</button>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
');
|
||||
}
|
||||
|
||||
public function get_form_labels(){
|
||||
return [
|
||||
'step' => [
|
||||
'title' => __( 'Step', 'tainacan' ),
|
||||
'description' => __( 'The amount to be increased or decreased when clicking on the filter control buttons. This also defines whether the input accepts decimal numbers.', 'tainacan' ),
|
||||
],
|
||||
'custom' => ['title' => __('Custom interval','tainacan')],
|
||||
];
|
||||
}
|
||||
}
|
||||
function __construct(){
|
||||
$this->set_name( __('Numeric Interval', 'tainacan') );
|
||||
$this->set_supported_types(['float']);
|
||||
$this->set_component('tainacan-filter-numeric-interval');
|
||||
$this->set_form_component('tainacan-filter-form-numeric-interval');
|
||||
$this->set_use_max_options(false);
|
||||
$this->set_default_options([
|
||||
'step' => 1
|
||||
]);
|
||||
$this->set_preview_template('
|
||||
<div>
|
||||
<div class="b-numberinput field is-grouped">
|
||||
<p class="control">
|
||||
<button type="button" class="button is-primary is-small">
|
||||
<span class="icon is-small">
|
||||
<i class="mdi mdi-minus"></i>
|
||||
</span>
|
||||
</button>
|
||||
</p>
|
||||
<div class="control is-small is-clearfix">
|
||||
<input type="number" step="0.01" class="input is-small" value="6">
|
||||
</div>
|
||||
<p class="control">
|
||||
<button type="button" class="button is-primary is-small">
|
||||
<span class="icon is-small">
|
||||
<i class="mdi mdi-plus"></i>
|
||||
</span>
|
||||
</button>
|
||||
</p>
|
||||
</div>
|
||||
<p class="is-size-7 has-text-centered is-marginless">until</p>
|
||||
<div class="b-numberinput field is-grouped">
|
||||
<p class="control">
|
||||
<button type="button" class="button is-primary is-small">
|
||||
<span class="icon is-small">
|
||||
<i class="mdi mdi-minus"></i>
|
||||
</span>
|
||||
</button>
|
||||
</p>
|
||||
<div class="control is-small is-clearfix">
|
||||
<input type="number" step="0.01" class="input is-small" value="10">
|
||||
</div>
|
||||
<p class="control">
|
||||
<button type="button" class="button is-primary is-small">
|
||||
<span class="icon is-small">
|
||||
<i class="mdi mdi-plus"></i>
|
||||
</span>
|
||||
</button>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
');
|
||||
}
|
||||
|
||||
public function get_form_labels(){
|
||||
return [
|
||||
'step' => [
|
||||
'title' => __( 'Step', 'tainacan' ),
|
||||
'description' => __( 'The amount to be increased or decreased when clicking on the filter control buttons. This also defines whether the input accepts decimal numbers.', 'tainacan' ),
|
||||
],
|
||||
'custom' => ['title' => __('Custom interval','tainacan')],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
class Numeric_Interval_Interval_Helper {
|
||||
use \Tainacan\Traits\Singleton_Instance;
|
||||
|
||||
protected function init() {
|
||||
add_filter( 'tainacan-api-items-tainacan-filter-numeric-interval-filter-arguments', [$this, 'format_filter_arguments']);
|
||||
}
|
||||
|
||||
function format_filter_arguments( $filter_arguments ) {
|
||||
if (
|
||||
!isset($filter_arguments['compare']) ||
|
||||
!isset($filter_arguments['label'])
|
||||
) {
|
||||
return $filter_arguments;
|
||||
}
|
||||
|
||||
if (
|
||||
strtoupper($filter_arguments['compare']) === 'BETWEEN' &&
|
||||
is_array($filter_arguments['label']) &&
|
||||
count($filter_arguments['label']) === 2
|
||||
) {
|
||||
$filter_arguments['label'] = $filter_arguments['label'][0] . ' - ' . $filter_arguments['label'][1];
|
||||
}
|
||||
|
||||
return $filter_arguments;
|
||||
}
|
||||
}
|
||||
Numeric_Interval_Interval_Helper::get_instance();
|
|
@ -53,7 +53,6 @@
|
|||
});
|
||||
this.valueEnd = null;
|
||||
this.valueInit = null;
|
||||
this.$emit('sendValuesToTags', { label: '', value: null, metadatumName: this.metadatumName });
|
||||
}
|
||||
},
|
||||
// emit the operation for listeners
|
||||
|
@ -67,11 +66,6 @@
|
|||
collection_id: this.collectionId,
|
||||
value: values
|
||||
});
|
||||
|
||||
if (values[0] != undefined && values[1] != undefined && this.selectedInterval !== '') {
|
||||
let labelValue = this.filterTypeOptions.intervals[this.selectedInterval].label + (this.filterTypeOptions.showIntervalOnTag ? ` (${values[0]}-${values[1]})` : '');
|
||||
this.$emit('sendValuesToTags', { label: labelValue, value: values, metadatumName: this.metadatumName });
|
||||
}
|
||||
},
|
||||
updateSelectedValues(){
|
||||
if ( !this.query || !this.query.metaquery || !Array.isArray( this.query.metaquery ) )
|
||||
|
@ -95,10 +89,6 @@
|
|||
);
|
||||
this.selectedInterval = this.selectedInterval >= 0 ? this.selectedInterval : '';
|
||||
|
||||
if (this.selectedInterval !== '') {
|
||||
let labelValue = this.filterTypeOptions.intervals[this.selectedInterval].label + (this.filterTypeOptions.showIntervalOnTag ? ` (${this.valueInit}-${this.valueEnd})` : '');
|
||||
this.$emit('sendValuesToTags', { label: labelValue, value: [ this.valueInit, this.valueEnd ], metadatumName: this.metadatumName });
|
||||
}
|
||||
} else {
|
||||
this.valueInit = null;
|
||||
this.valueEnd = null;
|
||||
|
|
|
@ -9,50 +9,85 @@ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
|||
*/
|
||||
class Numeric_List_Interval extends Filter_Type {
|
||||
|
||||
function __construct(){
|
||||
$this->set_name( __('Numeric Interval List', 'tainacan') );
|
||||
$this->set_supported_types(['float']);
|
||||
$this->set_component('tainacan-filter-numeric-list-interval');
|
||||
$this->set_form_component('tainacan-filter-form-numeric-list-interval');
|
||||
$this->set_use_max_options(false);
|
||||
$this->set_default_options([
|
||||
'intervals' => [],
|
||||
'showIntervalOnTag' => false
|
||||
]);
|
||||
$this->set_preview_template('
|
||||
<div class="collapse show">
|
||||
<div class="dropdown is-active">
|
||||
<div role="button" class="dropdown-trigger">
|
||||
<button class="button is-white">
|
||||
List
|
||||
<span class="icon">
|
||||
<i class="tainacan-icon tainacan-icon-20px tainacan-icon-arrowdown"></i>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="background"></div>
|
||||
<div class="dropdown-menu">
|
||||
<div role="list" class="dropdown-content">
|
||||
<a class="dropdown-item is-active">Top 10</a>
|
||||
<a class="dropdown-item">Top 20</a>
|
||||
<a class="dropdown-item">Top 30</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
');
|
||||
}
|
||||
|
||||
public function get_form_labels() {
|
||||
return [
|
||||
'intervals' => [
|
||||
'title' => __('Predefined intervals','tainacan'),
|
||||
'description' => __('A list of predefined intervals that the filter will offer on a select box.','tainacan')
|
||||
],
|
||||
'showIntervalOnTag' => [
|
||||
'title' => __('Interval on tags', 'tainacan'),
|
||||
'description' => __('Whether the applyed interval values should appear on filter tags.')
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
function __construct(){
|
||||
$this->set_name( __('Numeric Interval List', 'tainacan') );
|
||||
$this->set_supported_types(['float']);
|
||||
$this->set_component('tainacan-filter-numeric-list-interval');
|
||||
$this->set_form_component('tainacan-filter-form-numeric-list-interval');
|
||||
$this->set_use_max_options(false);
|
||||
$this->set_default_options([
|
||||
'intervals' => [],
|
||||
'showIntervalOnTag' => false
|
||||
]);
|
||||
$this->set_preview_template('
|
||||
<div class="collapse show">
|
||||
<div class="dropdown is-active">
|
||||
<div role="button" class="dropdown-trigger">
|
||||
<button class="button is-white">
|
||||
List
|
||||
<span class="icon">
|
||||
<i class="tainacan-icon tainacan-icon-20px tainacan-icon-arrowdown"></i>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="background"></div>
|
||||
<div class="dropdown-menu">
|
||||
<div role="list" class="dropdown-content">
|
||||
<a class="dropdown-item is-active">Top 10</a>
|
||||
<a class="dropdown-item">Top 20</a>
|
||||
<a class="dropdown-item">Top 30</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
');
|
||||
}
|
||||
|
||||
public function get_form_labels() {
|
||||
return [
|
||||
'intervals' => [
|
||||
'title' => __('Predefined intervals','tainacan'),
|
||||
'description' => __('A list of predefined intervals that the filter will offer on a select box.','tainacan')
|
||||
],
|
||||
'showIntervalOnTag' => [
|
||||
'title' => __('Interval on tags', 'tainacan'),
|
||||
'description' => __('Whether the applied interval values should appear on filter tags.')
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
class Numeric_List_Interval_Helper {
|
||||
use \Tainacan\Traits\Singleton_Instance;
|
||||
|
||||
protected function init() {
|
||||
add_filter( 'tainacan-api-items-tainacan-filter-numeric-list-interval-filter-arguments', [$this, 'format_filter_arguments']);
|
||||
}
|
||||
|
||||
function format_filter_arguments( $filter_arguments ) {
|
||||
if (
|
||||
!isset($filter_arguments['filter']) ||
|
||||
!isset($filter_arguments['filter']['filter_type_options']) ||
|
||||
!isset($filter_arguments['filter']['filter_type_options']['intervals'])
|
||||
) {
|
||||
return $filter_arguments;
|
||||
}
|
||||
|
||||
$intervals = $filter_arguments['filter']['filter_type_options']['intervals'];
|
||||
foreach($intervals as $interval) {
|
||||
if (
|
||||
$interval['from'] == $filter_arguments['value'][0] &&
|
||||
$interval['to'] == $filter_arguments['value'][1]
|
||||
) {
|
||||
$filter_arguments['label'] = $interval['label'];
|
||||
|
||||
if ( isset($filter_arguments['filter']['filter_type_options']['showIntervalOnTag']) && $filter_arguments['filter']['filter_type_options']['showIntervalOnTag'] )
|
||||
$filter_arguments['label'] .= ' (' . $filter_arguments['value'][0] . '-' . $filter_arguments['value'][1] . ')';
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $filter_arguments;
|
||||
}
|
||||
}
|
||||
Numeric_List_Interval_Helper::get_instance();
|
||||
|
|
|
@ -113,7 +113,7 @@
|
|||
|
||||
let index = this.query.metaquery.findIndex(newMetadatum => newMetadatum.key == this.metadatumId );
|
||||
|
||||
if ( index >= 0){
|
||||
if ( index >= 0) {
|
||||
let metadata = this.query.metaquery[ index ];
|
||||
|
||||
if ( metadata.value && metadata.value.length > 0)
|
||||
|
@ -122,9 +122,6 @@
|
|||
if ( metadata.compare)
|
||||
this.comparator = metadata.compare;
|
||||
|
||||
if (this.value != undefined)
|
||||
this.$emit('sendValuesToTags', { label: this.comparator + ' ' + this.value, value: this.value, metadatumName: this.metadatumName });
|
||||
|
||||
} else {
|
||||
this.value = null;
|
||||
}
|
||||
|
@ -144,8 +141,6 @@
|
|||
value: this.value,
|
||||
type: 'NUMERIC'
|
||||
});
|
||||
|
||||
this.$emit('sendValuesToTags', { label: this.comparator + ' ' + this.value, value: this.value, metadatumName: this.metadatumName });
|
||||
|
||||
},
|
||||
onChangeComparator(newComparator) {
|
||||
|
|
|
@ -9,92 +9,135 @@ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
|||
*/
|
||||
class Numeric extends Filter_Type {
|
||||
|
||||
function __construct(){
|
||||
$this->set_name( __('Numeric', 'tainacan') );
|
||||
$this->set_supported_types(['float']);
|
||||
$this->set_component('tainacan-filter-numeric');
|
||||
$this->set_form_component('tainacan-filter-form-numeric');
|
||||
$this->set_use_max_options(false);
|
||||
$this->set_default_options([
|
||||
'step' => 1
|
||||
]);
|
||||
$this->set_preview_template('
|
||||
<div>
|
||||
<div>
|
||||
<div class="numeric-filter-container">
|
||||
<div class="dropdown is-active">
|
||||
<div role="button" class="dropdown-trigger">
|
||||
<button class="button is-white">
|
||||
<span class="icon is-small">
|
||||
<i>=</i>
|
||||
</span>
|
||||
<span class="icon">
|
||||
<i class="tainacan-icon tainacan-icon-20px tainacan-icon-arrowdown"></i>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="background" style="display: none;"></div>
|
||||
<div class="dropdown-menu" style="display: none;">
|
||||
<div role="list" class="dropdown-content">
|
||||
<a class="dropdown-item is-active">= ' . __('Equal', 'tainacan') .'</a>
|
||||
<a class="dropdown-item">≠ '. __('Not equal', 'tainacan') .'</a>
|
||||
<a class="dropdown-item">> '. __('Greater than', 'tainacan') .'</a>
|
||||
<a class="dropdown-item">≥ '. __('Greater than or equal to', 'tainacan') .'</a>
|
||||
<a class="dropdown-item">< '. __('Less than', 'tainacan') .'</a>
|
||||
<a class="dropdown-item">≤ '. __('Less than or equal to', 'tainacan') .'</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="b-numberinput field is-grouped">
|
||||
<p class="control">
|
||||
<button type="button" class="button is-primary is-small">
|
||||
<span class="icon is-small">
|
||||
<i class="mdi mdi-minus"></i>
|
||||
</span>
|
||||
</button>
|
||||
</p>
|
||||
<div class="control is-small is-clearfix">
|
||||
<input type="number" step="0.01" class="input is-small" value="1.5">
|
||||
</div>
|
||||
<p class="control">
|
||||
<button type="button" class="button is-primary is-small">
|
||||
<span class="icon is-small">
|
||||
<i class="mdi mdi-plus"></i>
|
||||
</span>
|
||||
</button>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
');
|
||||
}
|
||||
function __construct(){
|
||||
$this->set_name( __('Numeric', 'tainacan') );
|
||||
$this->set_supported_types(['float']);
|
||||
$this->set_component('tainacan-filter-numeric');
|
||||
$this->set_form_component('tainacan-filter-form-numeric');
|
||||
$this->set_use_max_options(false);
|
||||
$this->set_default_options([
|
||||
'step' => 1
|
||||
]);
|
||||
$this->set_preview_template('
|
||||
<div>
|
||||
<div>
|
||||
<div class="numeric-filter-container">
|
||||
<div class="dropdown is-active">
|
||||
<div role="button" class="dropdown-trigger">
|
||||
<button class="button is-white">
|
||||
<span class="icon is-small">
|
||||
<i>=</i>
|
||||
</span>
|
||||
<span class="icon">
|
||||
<i class="tainacan-icon tainacan-icon-20px tainacan-icon-arrowdown"></i>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="background" style="display: none;"></div>
|
||||
<div class="dropdown-menu" style="display: none;">
|
||||
<div role="list" class="dropdown-content">
|
||||
<a class="dropdown-item is-active">= ' . __('Equal', 'tainacan') .'</a>
|
||||
<a class="dropdown-item">≠ '. __('Not equal', 'tainacan') .'</a>
|
||||
<a class="dropdown-item">> '. __('Greater than', 'tainacan') .'</a>
|
||||
<a class="dropdown-item">≥ '. __('Greater than or equal to', 'tainacan') .'</a>
|
||||
<a class="dropdown-item">< '. __('Less than', 'tainacan') .'</a>
|
||||
<a class="dropdown-item">≤ '. __('Less than or equal to', 'tainacan') .'</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="b-numberinput field is-grouped">
|
||||
<p class="control">
|
||||
<button type="button" class="button is-primary is-small">
|
||||
<span class="icon is-small">
|
||||
<i class="mdi mdi-minus"></i>
|
||||
</span>
|
||||
</button>
|
||||
</p>
|
||||
<div class="control is-small is-clearfix">
|
||||
<input type="number" step="0.01" class="input is-small" value="1.5">
|
||||
</div>
|
||||
<p class="control">
|
||||
<button type="button" class="button is-primary is-small">
|
||||
<span class="icon is-small">
|
||||
<i class="mdi mdi-plus"></i>
|
||||
</span>
|
||||
</button>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
');
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function get_form_labels(){
|
||||
return [
|
||||
'step' => [
|
||||
'title' => __( 'Step', 'tainacan' ),
|
||||
'description' => __( 'The amount to be increased or decreased when clicking on the filter control buttons. This also defines whether the input accepts decimal numbers.', 'tainacan' ),
|
||||
]
|
||||
];
|
||||
}
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function get_form_labels(){
|
||||
return [
|
||||
'step' => [
|
||||
'title' => __( 'Step', 'tainacan' ),
|
||||
'description' => __( 'The amount to be increased or decreased when clicking on the filter control buttons. This also defines whether the input accepts decimal numbers.', 'tainacan' ),
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Tainacan\Entities\Filter $filter
|
||||
* @return array|bool true if is validate or array if has error
|
||||
*/
|
||||
public function validate_options(\Tainacan\Entities\Filter $filter) {
|
||||
if ( !in_array($filter->get_status(), apply_filters('tainacan-status-require-validation', ['publish','future','private'])) )
|
||||
return true;
|
||||
/**
|
||||
* @param \Tainacan\Entities\Filter $filter
|
||||
* @return array|bool true if is validate or array if has error
|
||||
*/
|
||||
public function validate_options(\Tainacan\Entities\Filter $filter) {
|
||||
if ( !in_array($filter->get_status(), apply_filters('tainacan-status-require-validation', ['publish','future','private'])) )
|
||||
return true;
|
||||
|
||||
if ( empty($this->get_option('step')) ) {
|
||||
return [
|
||||
'step' => __('"Step" value is required','tainacan')
|
||||
];
|
||||
}
|
||||
if ( empty($this->get_option('step')) ) {
|
||||
return [
|
||||
'step' => __('"Step" value is required','tainacan')
|
||||
];
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
class Numeric_Helper {
|
||||
use \Tainacan\Traits\Singleton_Instance;
|
||||
|
||||
protected function init() {
|
||||
add_filter( 'tainacan-api-items-tainacan-filter-numeric-filter-arguments', [$this, 'format_filter_arguments']);
|
||||
}
|
||||
|
||||
function format_filter_arguments( $filter_arguments ) {
|
||||
if (
|
||||
!isset($filter_arguments['compare']) ||
|
||||
!isset($filter_arguments['label'])
|
||||
) {
|
||||
return $filter_arguments;
|
||||
}
|
||||
|
||||
if (count($filter_arguments['label']) === 1) {
|
||||
switch ($filter_arguments['compare']) {
|
||||
case '=':
|
||||
$filter_arguments['label'] = '= ' . $filter_arguments['label'][0];
|
||||
break;
|
||||
case '!=':
|
||||
$filter_arguments['label'] = '≠ ' . $filter_arguments['label'][0];
|
||||
break;
|
||||
case '>':
|
||||
$filter_arguments['label'] = '> ' . $filter_arguments['label'][0];
|
||||
break;
|
||||
case '>=':
|
||||
$filter_arguments['label'] = '≥ ' . $filter_arguments['label'][0];
|
||||
break;
|
||||
case '<':
|
||||
$filter_arguments['label'] = '< ' . $filter_arguments['label'][0];
|
||||
break;
|
||||
case '<=':
|
||||
$filter_arguments['label'] = '≤ ' . $filter_arguments['label'][0];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $filter_arguments;
|
||||
}
|
||||
}
|
||||
Numeric_Helper::get_instance();
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue