Merge branch 'release/0.18'

This commit is contained in:
vnmedeiros 2021-06-07 15:08:25 -03:00
commit 533b727804
296 changed files with 16249 additions and 5706 deletions

4
.gitignore vendored
View File

@ -30,7 +30,11 @@ report.txt
demosaved.csv
src/assets/css/tainacan-embeds.css
src/assets/css/tainacan-embeds.css.map
src/assets/css/tainacan-reports.css
src/assets/css/tainacan-reports.css.map
.DS_Store
src/.DS_Store
src/assets/css/tainacan-gutenberg-block-dynamic-items-list.css
src/assets/css/tainacan-gutenberg-block-dynamic-items-list.css.map
tests/wordpress-test
tests/wordpress-tests-lib

View File

@ -1,8 +1,9 @@
sudo: true
language: php
php:
- 7.1
#- 8.0
- 7.2
- 7.1
- 5.6
matrix:
allow_failures:
@ -32,7 +33,7 @@ install:
- sudo mv ./tests/bootstrap-config-sample.php ./tests/bootstrap-config.php
- sudo ./tests/bin/install-wp-tests.sh test travis "" /tmp/wordpress localhost latest
true
- composer install
- if [[ $TRAVIS_PHP_VERSION = 7.1 || $TRAVIS_PHP_VERSION = 5.6 ]]; then composer install --ignore-platform-reqs; else composer install; fi
- sudo mkdir /tmp/wordpress/wordpress-test/wp-content/uploads
- sudo chmod -R 777 /tmp/wordpress/wordpress-test/wp-content/uploads
- sudo wget https://phar.phpunit.de/phpunit-6.5.7.phar -P /tmp

View File

@ -20,17 +20,23 @@ Tainacan is a software solution for building, managing and publishing digital re
### Features
**Easy installation**. As a WordPress plugin, Tainacan can be easily installed on and integrated to an existing WordPress website.
#### Easy install
- As a WordPress plugin, Tainacan can be easily installed on and integrated to an existing WordPress website.
**Metadata and filters**. Use a metadata standard or choose whatever set of metadata you want to describe the items in your collections. You can choose which metadata will be used as a filter when browsing the collection.
#### Metadata and filters
- Use standard metadata or choose whatever set of metadata you want to describe the items in your collections. You can choose which metadata will be used as a filter when browsing the collection.
**Faceted search**. Browse your collection (and let the public browse it) using a faceted search interface with the filters you have chosen.
#### Faceted search
- Browse (and let the public browse it) your collection using a faceted search interface with filters you have chosen.
**Manage taxonomies**. Manage vocabularies that can be used accross all your collections.
#### Manage taxonomies
- Manage vocabularies that can be used accross all your collections.
**Themes**. Tainacan [has its own default theme](https://wordpress.org/themes/tainacan-interface/), which helps you present your collections in a beautiful and effective way as it is developed to incorporate all of Tainacan functionalities. However, it will also work with any WordPress theme. For developers, it will be easy to add Tainacan specific features to an existing theme.
#### Themes
- Tainacan [has its own default theme](https://wordpress.org/themes/tainacan-interface/), which helps you present your collections in a beautiful and effective way as it is developed to incorporate all of Tainacan functionalities. However, it will also work with any WordPress theme. For developers, it will be easy to 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. Expose you collection in different formats, such as JSON, JSON-LD and OAI-PMH. If your collection uses a custom standard, you can map it to well-known stardards such as DublinCore.
#### API and interoperability
- Tainacan implements a RESTful API (read and write) to allow other applications to interact with your repository. Expose you collection in different formats, such as JSON, JSON-LD and OAI-PMH. If your collection uses a custom standard, you can map it to well-known stardards such as DublinCore.
### Showcases

View File

@ -3,5 +3,3 @@
return [
'tests_dir' => '/tmp/wordpress-tests-lib',
];
?>

View File

@ -1,12 +1,11 @@
#!/bin/bash
## Run the build script whenever there is a change in src folder
## Runs build script whenever there is a change in src folder
echo 'Watching changes on src/'
current_OS=`uname`
# For macOS (Darwin) is needed fsevents-tools installed (you can use homebrew install fsevents-tools)
# For macOS (Darwin), you can install fsevents-tools via Homebrew: `brew install fsevents-tools`
if [ $current_OS == "Darwin" ]; then
echo
notifyloop src ./build.sh

View File

@ -1,5 +1,6 @@
#!/bin/bash
# Loads user-defined variables at build-config file
source build-config.cfg
## Only run npm build if there was a change in a .js or .vue file
@ -18,7 +19,7 @@ if [ $current_OS == "Darwin" ]; then
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/gutenberg-blocks ./src/views/gutenberg-blocks/tainacan-collections/collections-list ./src/views/gutenberg-blocks/tainacan-facets/facets-list ./src/views/gutenberg-blocks/tainacan-items/dynamic-items-list ./src/views/gutenberg-blocks/tainacan-items/items-list ./src/views/gutenberg-blocks/tainacan-terms/terms-list -type f \( -name "*.scss" \) -exec md5sum {} \; | sort -k 2 | md5sum > last-sass-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-collections/collections-list ./src/views/gutenberg-blocks/tainacan-facets/facets-list ./src/views/gutenberg-blocks/tainacan-items/dynamic-items-list ./src/views/gutenberg-blocks/tainacan-items/items-list ./src/views/gutenberg-blocks/tainacan-terms/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

View File

@ -2,42 +2,45 @@
# Executa o comando 'sass' para verificar se existe (veja http://stackoverflow.com/a/677212/329911)
command -v sass >/dev/null 2>&1 || {
echo >&2 "SASS parece não está disponivel.";
echo >&2 "Sass parece não estar disponivel.";
exit 1;
}
# Define o caminho.
echo "Compilando Sass..."
sass -E 'UTF-8' --cache-location .tmp/sass-cache-1 src/views/admin/scss/tainacan-admin.scss:src/assets/css/tainacan-admin.css
sass -E 'UTF-8' --cache-location .tmp/sass-cache-2 src/views/roles/tainacan-roles.scss:src/assets/css/tainacan-roles.css
sass -E 'UTF-8' --cache-location .tmp/sass-cache-3 src/views/gutenberg-blocks/tainacan-collections/collections-list/collections-list.scss:src/assets/css/tainacan-gutenberg-block-collections-list.css
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/gutenberg-blocks/tainacan-collections/carousel-collections-list/carousel-collections-list.scss:src/assets/css/tainacan-gutenberg-block-carousel-collections-list.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-5 src/views/gutenberg-blocks/tainacan-items/items-list/items-list.scss:src/assets/css/tainacan-gutenberg-block-items-list.css
sass -E 'UTF-8' --cache-location .tmp/sass-cache-5 src/views/gutenberg-blocks/tainacan-collections/collections-list/collections-list.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-items/dynamic-items-list/dynamic-items-list.scss:src/assets/css/tainacan-gutenberg-block-dynamic-items-list.css
sass -E 'UTF-8' --cache-location .tmp/sass-cache-6 src/views/gutenberg-blocks/tainacan-collections/carousel-collections-list/carousel-collections-list.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-items/search-bar/search-bar.scss:src/assets/css/tainacan-gutenberg-block-search-bar.css
sass -E 'UTF-8' --cache-location .tmp/sass-cache-7 src/views/gutenberg-blocks/tainacan-items/items-list/items-list.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-items/carousel-items-list/carousel-items-list.scss:src/assets/css/tainacan-gutenberg-block-carousel-items-list.css
sass -E 'UTF-8' --cache-location .tmp/sass-cache-8 src/views/gutenberg-blocks/tainacan-items/dynamic-items-list/dynamic-items-list.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-items/carousel-items-list/carousel-items-list.scss:src/assets/css/tainacan-gutenberg-block-carousel-items-list.css
sass -E 'UTF-8' --cache-location .tmp/sass-cache-9 src/views/gutenberg-blocks/tainacan-items/search-bar/search-bar.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-terms/terms-list/terms-list.scss:src/assets/css/tainacan-gutenberg-block-terms-list.css
sass -E 'UTF-8' --cache-location .tmp/sass-cache-10 src/views/gutenberg-blocks/tainacan-items/carousel-items-list/carousel-items-list.scss:src/assets/css/tainacan-gutenberg-block-carousel-items-list.css
sass -E 'UTF-8' --cache-location .tmp/sass-cache-11 src/views/gutenberg-blocks/tainacan-facets/facets-list/facets-list.scss:src/assets/css/tainacan-gutenberg-block-facets-list.css
sass -E 'UTF-8' --cache-location .tmp/sass-cache-12 src/views/gutenberg-blocks/tainacan-items/carousel-items-list/carousel-items-list.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-terms/carousel-terms-list/carousel-terms-list.scss:src/assets/css/tainacan-gutenberg-block-carousel-terms-list.css
sass -E 'UTF-8' --cache-location .tmp/sass-cache-12 src/views/gutenberg-blocks/tainacan-terms/terms-list/terms-list.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-facets/faceted-search/faceted-search.scss:src/assets/css/tainacan-gutenberg-block-faceted-search.css
sass -E 'UTF-8' --cache-location .tmp/sass-cache-13 src/views/gutenberg-blocks/tainacan-facets/facets-list/facets-list.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-items/item-submission-form/item-submission-form.scss:src/assets/css/tainacan-gutenberg-block-item-submission-form.css
sass -E 'UTF-8' --cache-location .tmp/sass-cache-14 src/views/gutenberg-blocks/tainacan-terms/carousel-terms-list/carousel-terms-list.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/gutenberg-blocks-style.scss:src/assets/css/tainacan-gutenberg-block-common-styles.css
sass -E 'UTF-8' --cache-location .tmp/sass-cache-15 src/views/gutenberg-blocks/tainacan-facets/faceted-search/faceted-search.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-items/item-submission-form/item-submission-form.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/gutenberg-blocks-style.scss:src/assets/css/tainacan-gutenberg-block-common-styles.css
echo "Compilação do Sass Concluído!"
exit 0

View File

@ -1,22 +1,24 @@
{
"name": "medialabufg/tainacan",
"name": "tainacan/tainacan",
"description": "Transforme seu site wordpress em um repositório digital.",
"type": "wordpress-plugin",
"require": {
"respect/validation": "^1.1",
"smalot/pdfparser": "*"
"smalot/pdfparser": "*",
"kornrunner/blurhash": "^1.1"
},
"require-dev": {
"squizlabs/php_codesniffer": "^2.2 || ^3.0.2",
"wimg/php-compatibility": "*"
"phpcompatibility/php-compatibility": "*"
},
"prefer-stable" : true,
"minimum-stability": "dev",
"config": {
"vendor-dir": "src/vendor"
"vendor-dir": "src/vendor",
"platform-check": false
},
"scripts": {
"post-install-cmd": "\"src/vendor/bin/phpcs\" --config-set installed_paths src/vendor/wimg/php-compatibility",
"post-update-cmd" : "\"src/vendor/bin/phpcs\" --config-set installed_paths src/vendor/wimg/php-compatibility"
"post-install-cmd": "\"src/vendor/bin/phpcs\" --config-set installed_paths src/vendor/phpcompatibility/php-compatibility",
"post-update-cmd" : "\"src/vendor/bin/phpcs\" --config-set installed_paths src/vendor/phpcompatibility/php-compatibility"
}
}

274
composer.lock generated
View File

@ -4,8 +4,51 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "e2a614836d1857e45c4f9be57073c2b2",
"content-hash": "8eb9217097c6d62dba6409b24f81c0ad",
"packages": [
{
"name": "kornrunner/blurhash",
"version": "v1.1.0",
"source": {
"type": "git",
"url": "https://github.com/kornrunner/php-blurhash.git",
"reference": "5a09325353229c108c8d2ff129ec08b447753f9b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/kornrunner/php-blurhash/zipball/5a09325353229c108c8d2ff129ec08b447753f9b",
"reference": "5a09325353229c108c8d2ff129ec08b447753f9b",
"shasum": ""
},
"require": {
"php": "^7.2"
},
"require-dev": {
"ocramius/package-versions": "<1.5",
"phpstan/phpstan": "^0.12",
"phpunit/phpunit": "^8.2",
"vimeo/psalm": "^3.4"
},
"type": "library",
"autoload": {
"psr-4": {
"kornrunner\\Blurhash\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Boris Momčilović",
"email": "boris.momcilovic@gmail.com"
}
],
"description": "Pure PHP implementation of Blurhash",
"homepage": "https://github.com/kornrunner/php-blurhash",
"time": "2020-04-15T22:06:04+00:00"
},
{
"name": "respect/validation",
"version": "1.1.31",
@ -71,26 +114,26 @@
},
{
"name": "smalot/pdfparser",
"version": "v0.14.0",
"version": "v0.18.1",
"source": {
"type": "git",
"url": "https://github.com/smalot/pdfparser.git",
"reference": "ec72a99028ba5e21a0acad92047b85e128cbf81f"
"reference": "b47f26425e32a814dc1ee55e3ce669b9e73b8458"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/smalot/pdfparser/zipball/ec72a99028ba5e21a0acad92047b85e128cbf81f",
"reference": "ec72a99028ba5e21a0acad92047b85e128cbf81f",
"url": "https://api.github.com/repos/smalot/pdfparser/zipball/b47f26425e32a814dc1ee55e3ce669b9e73b8458",
"reference": "b47f26425e32a814dc1ee55e3ce669b9e73b8458",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"ext-zlib": "*",
"php": ">=5.3.0",
"tecnickcom/tcpdf": "~6.0"
"php": ">=5.6",
"symfony/polyfill-mbstring": "^1.18"
},
"require-dev": {
"atoum/atoum": "^2.8 | ^3.0"
"friendsofphp/php-cs-fixer": "^2.16",
"symfony/phpunit-bridge": "^5.2"
},
"type": "library",
"autoload": {
@ -104,12 +147,12 @@
],
"authors": [
{
"name": "Sebastien Malot",
"name": "Sebastien MALOT",
"email": "sebastien@malot.fr"
}
],
"description": "Pdf parser library. Can read and extract information from pdf file.",
"homepage": "http://www.pdfparser.org",
"homepage": "https://www.pdfparser.org",
"keywords": [
"extract",
"parse",
@ -117,24 +160,24 @@
"pdf",
"text"
],
"time": "2019-01-23T09:14:37+00:00"
"time": "2021-01-05T08:52:07+00:00"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.12.0",
"version": "v1.20.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17"
"reference": "39d483bdf39be819deabf04ec872eb0b2410b531"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b42a2f66e8f1b15ccf25652c3424265923eb4f17",
"reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/39d483bdf39be819deabf04ec872eb0b2410b531",
"reference": "39d483bdf39be819deabf04ec872eb0b2410b531",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
"php": ">=7.1"
},
"suggest": {
"ext-mbstring": "For best performance"
@ -142,7 +185,11 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.12-dev"
"dev-main": "1.20-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
@ -176,135 +223,39 @@
"portable",
"shim"
],
"time": "2019-08-06T08:03:45+00:00"
},
{
"name": "tecnickcom/tcpdf",
"version": "6.2.26",
"source": {
"type": "git",
"url": "https://github.com/tecnickcom/TCPDF.git",
"reference": "367241059ca166e3a76490f4448c284e0a161f15"
"support": {
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.20.0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/367241059ca166e3a76490f4448c284e0a161f15",
"reference": "367241059ca166e3a76490f4448c284e0a161f15",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"autoload": {
"classmap": [
"config",
"include",
"tcpdf.php",
"tcpdf_parser.php",
"tcpdf_import.php",
"tcpdf_barcodes_1d.php",
"tcpdf_barcodes_2d.php",
"include/tcpdf_colors.php",
"include/tcpdf_filters.php",
"include/tcpdf_font_data.php",
"include/tcpdf_fonts.php",
"include/tcpdf_images.php",
"include/tcpdf_static.php",
"include/barcodes/datamatrix.php",
"include/barcodes/pdf417.php",
"include/barcodes/qrcode.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0"
],
"authors": [
"funding": [
{
"name": "Nicola Asuni",
"email": "info@tecnick.com",
"role": "lead"
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"description": "TCPDF is a PHP class for generating PDF documents and barcodes.",
"homepage": "http://www.tcpdf.org/",
"keywords": [
"PDFD32000-2008",
"TCPDF",
"barcodes",
"datamatrix",
"pdf",
"pdf417",
"qrcode"
],
"time": "2018-10-16T17:24:05+00:00"
"time": "2020-10-23T14:02:19+00:00"
}
],
"packages-dev": [
{
"name": "squizlabs/php_codesniffer",
"version": "3.4.2",
"source": {
"type": "git",
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
"reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8",
"reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8",
"shasum": ""
},
"require": {
"ext-simplexml": "*",
"ext-tokenizer": "*",
"ext-xmlwriter": "*",
"php": ">=5.4.0"
},
"require-dev": {
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
},
"bin": [
"bin/phpcs",
"bin/phpcbf"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.x-dev"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Greg Sherwood",
"role": "lead"
}
],
"description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
"homepage": "https://github.com/squizlabs/PHP_CodeSniffer",
"keywords": [
"phpcs",
"standards"
],
"time": "2019-04-10T23:49:02+00:00"
},
{
"name": "wimg/php-compatibility",
"version": "9.3.1",
"name": "phpcompatibility/php-compatibility",
"version": "9.3.5",
"source": {
"type": "git",
"url": "https://github.com/PHPCompatibility/PHPCompatibility.git",
"reference": "9999344e47e7af6b00e1a898eacc4e4368fb7196"
"reference": "9fb324479acf6f39452e0655d2429cc0d3914243"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9999344e47e7af6b00e1a898eacc4e4368fb7196",
"reference": "9999344e47e7af6b00e1a898eacc4e4368fb7196",
"url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243",
"reference": "9fb324479acf6f39452e0655d2429cc0d3914243",
"shasum": ""
},
"require": {
@ -349,8 +300,58 @@
"phpcs",
"standards"
],
"abandoned": "phpcompatibility/php-compatibility",
"time": "2019-09-05T18:36:49+00:00"
"time": "2019-12-27T09:44:58+00:00"
},
{
"name": "squizlabs/php_codesniffer",
"version": "3.5.8",
"source": {
"type": "git",
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
"reference": "9d583721a7157ee997f235f327de038e7ea6dac4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/9d583721a7157ee997f235f327de038e7ea6dac4",
"reference": "9d583721a7157ee997f235f327de038e7ea6dac4",
"shasum": ""
},
"require": {
"ext-simplexml": "*",
"ext-tokenizer": "*",
"ext-xmlwriter": "*",
"php": ">=5.4.0"
},
"require-dev": {
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
},
"bin": [
"bin/phpcs",
"bin/phpcbf"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.x-dev"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Greg Sherwood",
"role": "lead"
}
],
"description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
"homepage": "https://github.com/squizlabs/PHP_CodeSniffer",
"keywords": [
"phpcs",
"standards"
],
"time": "2020-10-23T02:01:07+00:00"
}
],
"aliases": [],
@ -359,5 +360,6 @@
"prefer-stable": true,
"prefer-lowest": false,
"platform": [],
"platform-dev": []
"platform-dev": [],
"plugin-api-version": "2.0.0"
}

310
package-lock.json generated
View File

@ -1665,6 +1665,19 @@
}
}
},
"apexcharts": {
"version": "3.26.3",
"resolved": "https://registry.npmjs.org/apexcharts/-/apexcharts-3.26.3.tgz",
"integrity": "sha512-zbP7RBBV2CGffoVMIuTCUG64YbEUzV8IIT7iNVLMtY/OAVXTjPksDxSqKIniTvgJoscKe6sx4P56qDpBSU19VA==",
"requires": {
"svg.draggable.js": "^2.2.2",
"svg.easing.js": "^2.0.0",
"svg.filter.js": "^2.0.2",
"svg.pathmorphing.js": "^0.1.3",
"svg.resize.js": "^1.4.3",
"svg.select.js": "^3.0.1"
}
},
"aproba": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz",
@ -2145,6 +2158,11 @@
"integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==",
"dev": true
},
"blurhash": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/blurhash/-/blurhash-1.1.3.tgz",
"integrity": "sha512-yUhPJvXexbqbyijCIE/T2NCXcj9iNPhWmOKbPTuR/cm7Q5snXYIfnVnz6m7MWOXxODMz/Cr3UcVkRdHiuDVRDw=="
},
"bn.js": {
"version": "4.11.8",
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz",
@ -2367,11 +2385,11 @@
}
},
"buefy": {
"version": "0.9.4",
"resolved": "https://registry.npmjs.org/buefy/-/buefy-0.9.4.tgz",
"integrity": "sha512-LRSIYVNrKTPQhmNRegASkntX+ObtZ7aSSA/3cybDKXzGtPNy8g8cl2tp79Rl8/LBVH/KkRT5rmmzJ21nxz9IcQ==",
"version": "0.9.7",
"resolved": "https://registry.npmjs.org/buefy/-/buefy-0.9.7.tgz",
"integrity": "sha512-Fli0ZjNDgtFtHm0LItWmfhNJ1oLjDwPzUWccvwXXoo2mADXaH8JQxyhY+drUuUV5/GMu5PtwqQSqPgZy942VZg==",
"requires": {
"bulma": "0.9.1"
"bulma": "0.9.2"
}
},
"buffer": {
@ -2410,9 +2428,9 @@
"dev": true
},
"bulma": {
"version": "0.9.1",
"resolved": "https://registry.npmjs.org/bulma/-/bulma-0.9.1.tgz",
"integrity": "sha512-LSF69OumXg2HSKl2+rN0/OEXJy7WFEb681wtBlNS/ulJYR27J3rORHibdXZ6GVb/vyUzzYK/Arjyh56wjbFedA=="
"version": "0.9.2",
"resolved": "https://registry.npmjs.org/bulma/-/bulma-0.9.2.tgz",
"integrity": "sha512-e14EF+3VSZ488yL/lJH0tR8mFWiEQVCMi/BQUMi2TGMBOk+zrDg4wryuwm/+dRSHJw0gMawp2tsW7X1JYUCE3A=="
},
"bytes": {
"version": "3.0.0",
@ -2987,6 +3005,11 @@
}
}
},
"countup.js": {
"version": "2.0.7",
"resolved": "https://registry.npmjs.org/countup.js/-/countup.js-2.0.7.tgz",
"integrity": "sha512-FO0nQdvG1iQwHp28wdvkErxnNUSbdkzztqZ6YNHKLHydngD2tdiKEW8dFrqpahF3tj+Ma70h0vyYrCBzxlVWdg=="
},
"create-ecdh": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz",
@ -3508,18 +3531,32 @@
"dev": true
},
"elliptic": {
"version": "6.5.3",
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz",
"integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==",
"version": "6.5.4",
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz",
"integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==",
"dev": true,
"requires": {
"bn.js": "^4.4.0",
"brorand": "^1.0.1",
"bn.js": "^4.11.9",
"brorand": "^1.1.0",
"hash.js": "^1.0.0",
"hmac-drbg": "^1.0.0",
"inherits": "^2.0.1",
"minimalistic-assert": "^1.0.0",
"minimalistic-crypto-utils": "^1.0.0"
"hmac-drbg": "^1.0.1",
"inherits": "^2.0.4",
"minimalistic-assert": "^1.0.1",
"minimalistic-crypto-utils": "^1.0.1"
},
"dependencies": {
"bn.js": {
"version": "4.12.0",
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz",
"integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==",
"dev": true
},
"inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
"dev": true
}
}
},
"emoji-regex": {
@ -3687,9 +3724,9 @@
}
},
"lodash": {
"version": "4.17.19",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
"integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==",
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"dev": true
},
"ms": {
@ -5434,9 +5471,9 @@
"dev": true
},
"hosted-git-info": {
"version": "2.8.8",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz",
"integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg=="
"version": "2.8.9",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz",
"integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw=="
},
"hpack.js": {
"version": "2.1.6",
@ -5755,9 +5792,9 @@
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
},
"ini": {
"version": "1.3.7",
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.7.tgz",
"integrity": "sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ==",
"version": "1.3.8",
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
"integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==",
"dev": true
},
"inquirer": {
@ -5814,9 +5851,9 @@
"dev": true
},
"lodash": {
"version": "4.17.19",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
"integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==",
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"dev": true
},
"string-width": {
@ -6422,9 +6459,15 @@
}
},
"lodash": {
"version": "4.17.19",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
"integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ=="
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
},
"lodash.difference": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.difference/-/lodash.difference-4.5.0.tgz",
"integrity": "sha1-nMtOUF1Ia5FlE0V3KIWi3yf9AXw=",
"dev": true
},
"loglevel": {
"version": "1.6.8",
@ -6799,6 +6842,15 @@
"resolved": "https://registry.npmjs.org/moment/-/moment-2.25.3.tgz",
"integrity": "sha512-PuYv0PHxZvzc15Sp8ybUCoQ+xpyPWvjOuK72a5ovzp2LI32rJXOiIfyoFoYvG3s6EwwrdkMyWuRiEHSZRLJNdg=="
},
"moment-locales-webpack-plugin": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/moment-locales-webpack-plugin/-/moment-locales-webpack-plugin-1.2.0.tgz",
"integrity": "sha512-QAi5v0OlPUP7GXviKMtxnpBAo8WmTHrUNN7iciAhNOEAd9evCOvuN0g1N7ThIg3q11GLCkjY1zQ2saRcf/43nQ==",
"dev": true,
"requires": {
"lodash.difference": "^4.5.0"
}
},
"move-concurrently": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz",
@ -6890,9 +6942,9 @@
"dev": true
},
"node-forge": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.9.0.tgz",
"integrity": "sha512-7ASaDa3pD+lJ3WvXFsxekJQelBKRpne+GOVbLbtHYdd7pFspyeuJHnWfLplGf3SwKGbfs/aYl5V/JCIaHVUKKQ==",
"version": "0.10.0",
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz",
"integrity": "sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA==",
"dev": true
},
"node-gyp": {
@ -7534,6 +7586,11 @@
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
"integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
},
"photoswipe": {
"version": "4.1.3",
"resolved": "https://registry.npmjs.org/photoswipe/-/photoswipe-4.1.3.tgz",
"integrity": "sha512-89Z43IRUyw7ycTolo+AaiDn3W1EEIfox54hERmm9bI12IB9cvRfHSHez3XhAyU8XW2EAFrC+2sKMhh7SJwn0bA=="
},
"pify": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
@ -8238,9 +8295,9 @@
"dev": true
},
"querystringify": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.1.tgz",
"integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==",
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz",
"integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==",
"dev": true
},
"randombytes": {
@ -8410,8 +8467,7 @@
"regenerator-runtime": {
"version": "0.13.5",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz",
"integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==",
"dev": true
"integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA=="
},
"regenerator-transform": {
"version": "0.14.4",
@ -8855,12 +8911,12 @@
"dev": true
},
"selfsigned": {
"version": "1.10.7",
"resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-1.10.7.tgz",
"integrity": "sha512-8M3wBCzeWIJnQfl43IKwOmC4H/RAp50S8DF60znzjW5GVqTcSe2vWclt7hmYVPkKPlHWOu5EaWOMZ2Y6W8ZXTA==",
"version": "1.10.8",
"resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-1.10.8.tgz",
"integrity": "sha512-2P4PtieJeEwVgTU9QEcwIRDQ/mXJLX8/+I3ur+Pg16nS8oNbrGxEso9NyYWy8NAmXiNl4dlAp5MwoNeCWzON4w==",
"dev": true,
"requires": {
"node-forge": "0.9.0"
"node-forge": "^0.10.0"
}
},
"semver": {
@ -9465,9 +9521,9 @@
"integrity": "sha512-NXzN+/HPObKAx191H3zKlYomE5WrVIkoCB5IaSdvKokxTpjBdWfr0RaP+1Z5KOfDT0ZVz+2tdtiBkhsEQ9p+0A=="
},
"ssri": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.0.tgz",
"integrity": "sha512-aq/pz989nxVYwn16Tsbj1TqFpD5LLrQxHf5zaHuieFV+R0Bbr4y8qUsOA45hXT/N4/9UNXTarBjnjVmjSOVaAA==",
"version": "8.0.1",
"resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz",
"integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==",
"dev": true,
"requires": {
"minipass": "^3.1.1"
@ -9978,6 +10034,70 @@
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
"integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc="
},
"svg.draggable.js": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/svg.draggable.js/-/svg.draggable.js-2.2.2.tgz",
"integrity": "sha512-JzNHBc2fLQMzYCZ90KZHN2ohXL0BQJGQimK1kGk6AvSeibuKcIdDX9Kr0dT9+UJ5O8nYA0RB839Lhvk4CY4MZw==",
"requires": {
"svg.js": "^2.0.1"
}
},
"svg.easing.js": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/svg.easing.js/-/svg.easing.js-2.0.0.tgz",
"integrity": "sha1-iqmUawqOJ4V6XEChDrpAkeVpHxI=",
"requires": {
"svg.js": ">=2.3.x"
}
},
"svg.filter.js": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/svg.filter.js/-/svg.filter.js-2.0.2.tgz",
"integrity": "sha1-kQCOFROJ3ZIwd5/L5uLJo2LRwgM=",
"requires": {
"svg.js": "^2.2.5"
}
},
"svg.js": {
"version": "2.7.1",
"resolved": "https://registry.npmjs.org/svg.js/-/svg.js-2.7.1.tgz",
"integrity": "sha512-ycbxpizEQktk3FYvn/8BH+6/EuWXg7ZpQREJvgacqn46gIddG24tNNe4Son6omdXCnSOaApnpZw6MPCBA1dODA=="
},
"svg.pathmorphing.js": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/svg.pathmorphing.js/-/svg.pathmorphing.js-0.1.3.tgz",
"integrity": "sha512-49HWI9X4XQR/JG1qXkSDV8xViuTLIWm/B/7YuQELV5KMOPtXjiwH4XPJvr/ghEDibmLQ9Oc22dpWpG0vUDDNww==",
"requires": {
"svg.js": "^2.4.0"
}
},
"svg.resize.js": {
"version": "1.4.3",
"resolved": "https://registry.npmjs.org/svg.resize.js/-/svg.resize.js-1.4.3.tgz",
"integrity": "sha512-9k5sXJuPKp+mVzXNvxz7U0uC9oVMQrrf7cFsETznzUDDm0x8+77dtZkWdMfRlmbkEEYvUn9btKuZ3n41oNA+uw==",
"requires": {
"svg.js": "^2.6.5",
"svg.select.js": "^2.1.2"
},
"dependencies": {
"svg.select.js": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/svg.select.js/-/svg.select.js-2.1.2.tgz",
"integrity": "sha512-tH6ABEyJsAOVAhwcCjF8mw4crjXSI1aa7j2VQR8ZuJ37H2MBUbyeqYr5nEO7sSN3cy9AR9DUwNg0t/962HlDbQ==",
"requires": {
"svg.js": "^2.2.5"
}
}
}
},
"svg.select.js": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/svg.select.js/-/svg.select.js-3.0.1.tgz",
"integrity": "sha512-h5IS/hKkuVCbKSieR9uQCj9w+zLHoPh+ce19bBYyqF53g6mnPB8sAtIbe1s9dh2S2fCmYX2xel1Ln3PJBbK4kw==",
"requires": {
"svg.js": "^2.6.5"
}
},
"swiper": {
"version": "5.4.5",
"resolved": "https://registry.npmjs.org/swiper/-/swiper-5.4.5.tgz",
@ -10017,9 +10137,9 @@
"dev": true
},
"lodash": {
"version": "4.17.19",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
"integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==",
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"dev": true
},
"string-width": {
@ -10602,9 +10722,9 @@
}
},
"url-parse": {
"version": "1.4.7",
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.7.tgz",
"integrity": "sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg==",
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.1.tgz",
"integrity": "sha512-HOfCOUJt7iSYzEx/UqgtwKRMC6EU91NFhsCHMv9oM03VJcVo2Qrp8T8kI9D7amFf1cu+/3CEhgb3rF9zL7k85Q==",
"dev": true,
"requires": {
"querystringify": "^2.1.1",
@ -10643,13 +10763,29 @@
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A=="
},
"v-tooltip": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/v-tooltip/-/v-tooltip-2.0.3.tgz",
"integrity": "sha512-KZZY3s+dcijzZmV2qoDH4rYmjMZ9YKGBVoUznZKQX0e3c2GjpJm3Sldzz8HHH2Ud87JqhZPB4+4gyKZ6m98cKQ==",
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/v-tooltip/-/v-tooltip-2.1.3.tgz",
"integrity": "sha512-xXngyxLQTOx/yUEy50thb8te7Qo4XU6h4LZB6cvEfVd9mnysUxLEoYwGWDdqR+l69liKsy3IPkdYff3J1gAJ5w==",
"requires": {
"lodash": "^4.17.15",
"popper.js": "^1.16.0",
"vue-resize": "^0.4.5"
"@babel/runtime": "^7.13.10",
"lodash": "^4.17.21",
"popper.js": "^1.16.1",
"vue-resize": "^1.0.1"
},
"dependencies": {
"@babel/runtime": {
"version": "7.14.0",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.14.0.tgz",
"integrity": "sha512-JELkvo/DlpNdJ7dlyw/eY7E0suy5i5GQH+Vlxaq1nsNJ+H7f4Vtv3jMeCEgRhZZQFXTjldYfQgv2qmM6M1v5wA==",
"requires": {
"regenerator-runtime": "^0.13.4"
}
},
"lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
}
}
},
"v8-compile-cache": {
@ -10694,11 +10830,26 @@
"resolved": "https://registry.npmjs.org/vue/-/vue-2.6.11.tgz",
"integrity": "sha512-VfPwgcGABbGAue9+sfrD4PuwFar7gPb1yl1UK1MwXoQPAw0BKSqWfoYCT/ThFrdEVWoI51dBuyCoiNU9bZDZxQ=="
},
"vue-apexcharts": {
"version": "1.6.1",
"resolved": "https://registry.npmjs.org/vue-apexcharts/-/vue-apexcharts-1.6.1.tgz",
"integrity": "sha512-ILn3/55IvZQUgsc7+jKDjPfHfGUlcUQi/lDrLjRe5g7gfjj99o8otXoHwMeib3CBHYdQXNG9foe1vzv7RdUzXA=="
},
"vue-awesome-swiper": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/vue-awesome-swiper/-/vue-awesome-swiper-4.1.1.tgz",
"integrity": "sha512-50um10t6N+lJaORkpwSi1wWuMmBI1sgFc9Znsi5oUykw2cO5DzLaBHcO2JNX21R+Ue4TGoIJDhhxjBHtkFrTEQ=="
},
"vue-blurhash": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/vue-blurhash/-/vue-blurhash-0.1.4.tgz",
"integrity": "sha512-B76GgfHXHkdmYgAfI2rZl3BgCMD9OxAgn4Jw2Ro0a8ZoAKa6gqTWUrTo5EGXOftm/EKuMYi1Cc+UcAvV0jnoRw=="
},
"vue-countup-v2": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/vue-countup-v2/-/vue-countup-v2-4.0.0.tgz",
"integrity": "sha512-XjKeHo1ndRlJtXvHd6B1eWOpbrJDdNU3rdYZwVPv2YlUXbvthsBT4kms5Fc/mn9RdXPrMX2H/ktAAQtKjWFisw=="
},
"vue-eslint-parser": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-5.0.0.tgz",
@ -10766,9 +10917,22 @@
"integrity": "sha512-viecHQiHVLez7HlYUQsv1wJb2MT/RDSzkDp6m3In41vPrk6OsBmT2qRE8LZqYIA4daIwrnx/Xm8h4fjOpuE3hw=="
},
"vue-resize": {
"version": "0.4.5",
"resolved": "https://registry.npmjs.org/vue-resize/-/vue-resize-0.4.5.tgz",
"integrity": "sha512-bhP7MlgJQ8TIkZJXAfDf78uJO+mEI3CaLABLjv0WNzr4CcGRGPIAItyWYnP6LsPA4Oq0WE+suidNs6dgpO4RHg=="
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/vue-resize/-/vue-resize-1.0.1.tgz",
"integrity": "sha512-z5M7lJs0QluJnaoMFTIeGx6dIkYxOwHThlZDeQnWZBizKblb99GSejPnK37ZbNE/rVwDcYcHY+Io+AxdpY952w==",
"requires": {
"@babel/runtime": "^7.13.10"
},
"dependencies": {
"@babel/runtime": {
"version": "7.14.0",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.14.0.tgz",
"integrity": "sha512-JELkvo/DlpNdJ7dlyw/eY7E0suy5i5GQH+Vlxaq1nsNJ+H7f4Vtv3jMeCEgRhZZQFXTjldYfQgv2qmM6M1v5wA==",
"requires": {
"regenerator-runtime": "^0.13.4"
}
}
}
},
"vue-router": {
"version": "3.1.6",
@ -10934,15 +11098,6 @@
"stream-each": "^1.1.0",
"through2": "^2.0.0"
}
},
"ssri": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz",
"integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==",
"dev": true,
"requires": {
"figgy-pudding": "^3.5.1"
}
}
}
},
@ -11028,6 +11183,15 @@
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"dev": true
},
"ssri": {
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.2.tgz",
"integrity": "sha512-cepbSq/neFK7xB6A50KHN0xHDotYzq58wWCa5LeWqnPrHG8GzfEjO/4O8kpmcGW+oaxkvhEJCWgbgNk4/ZV93Q==",
"dev": true,
"requires": {
"figgy-pudding": "^3.5.1"
}
},
"tapable": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz",
@ -11915,9 +12079,9 @@
"dev": true
},
"y18n": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz",
"integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w=="
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz",
"integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ=="
},
"yallist": {
"version": "2.1.2",

View File

@ -8,21 +8,28 @@
"build-prod": "cross-env NODE_ENV=production webpack --config webpack.prod.js --display-error-details --progress --hide-modules"
},
"dependencies": {
"apexcharts": "^3.26.3",
"countup.js": "^2.0.7",
"axios": "^0.21.1",
"buefy": "^0.9.4",
"bulma": "^0.9.1",
"blurhash": "^1.1.3",
"buefy": "^0.9.7",
"bulma": "^0.9.2",
"css-vars-ponyfill": "^2.3.1",
"mdi": "^2.2.43",
"moment": "^2.25.3",
"node-sass": "^4.14.1",
"photoswipe": "^4.1.3",
"qs": "^6.9.4",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"swiper": "^5.2.0",
"t": "^0.5.1",
"v-tooltip": "^2.0.3",
"v-tooltip": "^2.1.3",
"vue": "^2.6.11",
"vue-apexcharts": "^1.6.1",
"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",
@ -42,6 +49,7 @@
"eslint-loader": "^2.2.1",
"eslint-plugin-vue": "^5.2.3",
"file-loader": "^2.0.0",
"moment-locales-webpack-plugin": "^1.2.0",
"postcss-loader": "^3.0.0",
"sass-loader": "^7.3.1",
"style-loader": "^0.23.1",

View File

@ -1,4 +1,4 @@
#!/bin/bash
echo "Running unit tests in PHPUnit..."
echo "Running all unit tests [PHPUnit] ..."
phpunit

View File

@ -0,0 +1,945 @@
/*! 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, #ffffff);
--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, #ffffff); }
/* 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-bottom: 30px; }
.tainacan-media-component__swiper-main ul.swiper-wrapper[data-pswp-uid] li.swiper-slide img {
cursor: zoom-in !important; }
.tainacan-media-component__swiper-main li.swiper-slide {
height: 100%;
max-width: calc(100% - var(--swiper-navigation-size, 44px) - var(--swiper-navigation-size, 44px));
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; }
.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__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; }
.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);
margin-bottom: 30px; }
.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);
cursor: zoom-in; }
@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, #ffffff);
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 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 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: rgba(0, 0, 0, 0.5); }
.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=media-component.css.map */

File diff suppressed because one or more lines are too long

View File

@ -1,20 +1,64 @@
.tainacan-embed-container {
position: relative;
height: 0;
overflow: hidden;
/* TAINACAN EMBEDS
* This file copies most of Gutenberg's logic for responsive blocks,
* but uses different classes to avoid future conflicts.
* Check their original css: /packages/block-library/src/embed/style.scss
*/
/*
* The embed container is in a `figure` element, and many themes zero this out.
* This rule explicitly sets it, to ensure at least some bottom-margin in the flow.
*/
:not(.wp-block-embed__wrapper)>.tainacan-content-embed {
margin-bottom: 1em;
margin-left: 0;
margin-right: 0;
clear: both;
}
/* Don't allow iframe to overflow it's container. */
:not(.wp-block-embed__wrapper)>.tainacan-content-embed iframe {
max-width: 100%;
height: auto;
}
.tainacan-embed-container:not(.tainacan-embed-without-iframe) {
padding-bottom: 56.25%;
padding-top: 30px;
:not(.wp-block-embed__wrapper)>.tainacan-content-embed .tainacan-content-embed__wrapper {
position: relative;
}
.tainacan-embed-container iframe,
.tainacan-embed-container object,
.tainacan-embed-container embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
/* Add responsiveness to embeds with aspect ratios. */
:not(.wp-block-embed__wrapper)>.tainacan-has-aspect-ratio .tainacan-content-embed__wrapper::before {
content: "";
display: block;
padding-top: 50%; /* Default to 2:1 aspect ratio. */
}
:not(.wp-block-embed__wrapper)>.tainacan-has-aspect-ratio iframe {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
height: 100%;
width: 100%;
}
:not(.wp-block-embed__wrapper)>.tainacan-embed-aspect-21-9 .tainacan-content-embed__wrapper::before {
padding-top: 42.85%; /* 9 / 21 * 100 */
}
:not(.wp-block-embed__wrapper)>.tainacan-embed-aspect-18-9 .tainacan-content-embed__wrapper::before {
padding-top: 50%; /* 9 / 18 * 100 */
}
:not(.wp-block-embed__wrapper)>.tainacan-embed-aspect-16-9 .tainacan-content-embed__wrapper::before {
padding-top: 56.25%; /* 9 / 16 * 100 */
}
:not(.wp-block-embed__wrapper)>.tainacan-embed-aspect-4-3 .tainacan-content-embed__wrapper::before {
padding-top: 75%; /* 3 / 4 * 100 */
}
:not(.wp-block-embed__wrapper)>.tainacan-embed-aspect-1-1 .tainacan-content-embed__wrapper::before {
padding-top: 100%; /* 1 / 1 * 100 */
}
:not(.wp-block-embed__wrapper)>.tainacan-embed-aspect-9-16 .tainacan-content-embed__wrapper::before {
padding-top: 177.77%; /* 16 / 9 * 100 */
}
:not(.wp-block-embed__wrapper)>.tainacan-embed-aspect-3-4 .tainacan-content-embed__wrapper::before {
padding-top: 133.33%; /* 4 / 3 * 100 */
}
:not(.wp-block-embed__wrapper)>.tainacan-embed-aspect-1-2 .tainacan-content-embed__wrapper::before {
padding-top: 200%; /* 2 / 1 * 100 */
}

View File

@ -18,16 +18,16 @@
display: flex;
display: -ms-grid;
display: grid;
-ms-grid-columns: 33% 33% 33%;
grid-template-columns: 33% 33% 33%;
-ms-grid-rows: 50% 50%;
grid-template-rows: 50% 50%;
grid-column-gap: 2px;
grid-row-gap: 2px;
-ms-grid-columns: 1fr 1fr 1fr;
grid-template-columns: 1fr 1fr 1fr;
-ms-grid-rows: 1fr 1fr;
grid-template-rows: 1fr 1fr;
grid-gap: 5px;
gap: 5px;
width: 60px;
height: 40px;
margin: 4px auto 8px auto; }
.components-panel__body .collection-carousel-view-modes button.collection-carousel-view-mode-grid div > div:first-of-type {
.components-panel__body .collection-carousel-view-modes button.collection-carousel-view-mode-grid div > *:first-of-type {
flex-basis: 100%;
-ms-grid-column: 1;
-ms-grid-column-span: 2;
@ -35,12 +35,12 @@
-ms-grid-row-span: 2;
grid-column: 1/3;
grid-row: 1/3;
width: 41px;
height: 42px; }
.components-panel__body .collection-carousel-view-modes button.collection-carousel-view-mode-grid div > div {
width: 100%;
height: 100%; }
.components-panel__body .collection-carousel-view-modes button.collection-carousel-view-mode-grid div > * {
flex-basis: 50%;
width: 20px;
height: 20px;
width: 100%;
height: 100%;
background: var(--tainacan-block-gray4, #555758);
transition: background-color ease 0.5s; }
.components-panel__body .collection-carousel-view-modes button.collection-carousel-view-mode-thumbnail {
@ -139,11 +139,13 @@
display: flex;
display: -ms-grid;
display: grid;
grid-template-columns: 33% 33% 33%;
grid-template-rows: 50% 50%;
grid-template-columns: 1fr 1fr 1fr;
grid-template-rows: 1fr 1fr;
width: 100%;
grid-gap: 5px;
gap: 5px;
box-sizing: border-box; }
.wp-block-tainacan-carousel-collections-list .tainacan-carousel .swiper-container .swiper-slide.collection-list-item-grid .collection-items-grid img:first-of-type {
.wp-block-tainacan-carousel-collections-list .tainacan-carousel .swiper-container .swiper-slide.collection-list-item-grid .collection-items-grid > *:first-of-type {
flex-basis: 100%;
-ms-grid-column: 1;
-ms-grid-column-span: 2;
@ -151,11 +153,10 @@
-ms-grid-row-span: 2;
grid-column: 1/3;
grid-row: 1/3; }
.wp-block-tainacan-carousel-collections-list .tainacan-carousel .swiper-container .swiper-slide.collection-list-item-grid .collection-items-grid img {
.wp-block-tainacan-carousel-collections-list .tainacan-carousel .swiper-container .swiper-slide.collection-list-item-grid .collection-items-grid > * {
flex-basis: 50%;
width: 100%;
height: auto;
padding: 2px;
margin-bottom: 0px; }
.wp-block-tainacan-carousel-collections-list .preview-warning {
width: 100%;
@ -268,6 +269,8 @@
top: 0px;
justify-content: center;
z-index: 999; }
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item button .dashicon {
margin: 0px; }
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item:hover button {
height: auto;
visibility: visible;
@ -313,9 +316,11 @@
display: flex;
display: -ms-grid;
display: grid;
grid-template-columns: 33% 33% 33%;
grid-template-rows: 50% 50%; }
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item .collection-items-grid img:first-of-type {
grid-template-columns: 1fr 1fr 1fr;
grid-template-rows: 1fr 1fr;
grid-gap: 5px;
gap: 5px; }
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item .collection-items-grid > *:first-of-type {
flex-basis: 100%;
-ms-grid-column: 1;
-ms-grid-column-span: 2;
@ -323,9 +328,8 @@
-ms-grid-row-span: 2;
grid-column: 1/3;
grid-row: 1/3; }
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item .collection-items-grid img {
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item .collection-items-grid > * {
flex-basis: 50%;
padding: 2px;
margin-bottom: 0px; }
@media only screen and (max-width: 1686px) {
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item {

File diff suppressed because one or more lines are too long

View File

@ -222,6 +222,7 @@
line-height: normal; }
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item img {
height: auto;
display: block;
padding: 0px;
margin-bottom: 0.5em; }
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item:hover a {
@ -241,6 +242,8 @@
top: 0px;
justify-content: center;
z-index: 999; }
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item button .dashicon {
margin: 0px; }
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item:hover button {
height: auto;
visibility: visible;

File diff suppressed because one or more lines are too long

View File

@ -18,12 +18,12 @@
display: flex;
display: -ms-grid;
display: grid;
-ms-grid-columns: 33% 33% 33%;
grid-template-columns: 33% 33% 33%;
-ms-grid-columns: 1fr 1fr 1fr;
grid-template-columns: 1fr 1fr 1fr;
-ms-grid-rows: 50% 50%;
grid-template-rows: 50% 50%;
grid-column-gap: 2px;
grid-row-gap: 2px;
grid-gap: 5px;
gap: 5px;
width: 60px;
height: 40px;
margin: 4px auto 8px auto; }
@ -35,12 +35,12 @@
-ms-grid-row-span: 2;
grid-column: 1/3;
grid-row: 1/3;
width: 41px;
height: 42px; }
width: 100%;
height: 100%; }
.components-panel__body .term-carousel-view-modes button.term-carousel-view-mode-grid div > div {
flex-basis: 50%;
width: 20px;
height: 20px;
width: 100%;
height: 100%;
background: var(--tainacan-block-gray4, #555758);
transition: background-color ease 0.5s; }
.components-panel__body .term-carousel-view-modes button.term-carousel-view-mode-thumbnail {
@ -139,10 +139,13 @@
display: flex;
display: -ms-grid;
display: grid;
grid-template-columns: 33% 33% 33%;
grid-template-rows: 50% 50%;
width: 100%; }
.wp-block-tainacan-carousel-terms-list .tainacan-carousel .swiper-container .swiper-slide.term-list-item-grid .term-items-grid img:first-of-type {
grid-template-columns: 1fr 1fr 1fr;
grid-template-rows: 1fr 1fr;
width: 100%;
grid-gap: 5px;
gap: 5px;
box-sizing: border-box; }
.wp-block-tainacan-carousel-terms-list .tainacan-carousel .swiper-container .swiper-slide.term-list-item-grid .term-items-grid > *:first-of-type {
flex-basis: 100%;
-ms-grid-column: 1;
-ms-grid-column-span: 2;
@ -150,11 +153,10 @@
-ms-grid-row-span: 2;
grid-column: 1/3;
grid-row: 1/3; }
.wp-block-tainacan-carousel-terms-list .tainacan-carousel .swiper-container .swiper-slide.term-list-item-grid .term-items-grid img {
.wp-block-tainacan-carousel-terms-list .tainacan-carousel .swiper-container .swiper-slide.term-list-item-grid .term-items-grid > * {
flex-basis: 50%;
width: 100%;
height: auto;
padding: 2px;
margin-bottom: 0px; }
.wp-block-tainacan-carousel-terms-list .preview-warning {
width: 100%;
@ -268,6 +270,8 @@
top: 0px;
justify-content: center;
z-index: 999; }
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.term-list-item button .dashicon {
margin: 0px; }
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.term-list-item:hover button {
height: auto;
visibility: visible;
@ -313,7 +317,7 @@
display: flex;
display: -ms-grid;
display: grid;
grid-template-columns: 33% 33% 33%;
grid-template-columns: 1fr 1fr 1fr;
grid-template-rows: 50% 50%; }
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.term-list-item .term-items-grid img:first-of-type {
flex-basis: 100%;

File diff suppressed because one or more lines are too long

View File

@ -79,6 +79,8 @@
top: 0px;
justify-content: center;
z-index: 999; }
.wp-block-tainacan-collections-list ul.collections-list-edit li.collection-list-item button .dashicon {
margin: 0px; }
.wp-block-tainacan-collections-list ul.collections-list-edit li.collection-list-item:hover button {
height: auto;
visibility: visible;

View File

@ -1,6 +1,6 @@
{
"version": 3,
"mappings": "AAEA,mCAAoC;EAChC,MAAM,EAAE,QAAQ;EAGhB,uDAAoB;IAChB,QAAQ,EAAE,QAAQ;IAClB,KAAK,EAAE,CAAC;EAIZ;gGAC2D;IACvD,OAAO,EAAE,IAAI;IACb,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,CAAC;EAId;8FACyD;IACrD,qBAAqB,EAAE,wBAAwB;IAC/C,eAAe,EAAE,iBAAiB;IAClC,kBAAkB,EAAE,eAAe;IAEnC;mGAAG;MACC,UAAU,EAAE,YAAY;MACxB,YAAY,EAAE,YAAY;MAC1B,WAAW,EAAE,YAAY;MACzB,MAAM,EAAE,gBAAgB;MAExB;yGAAI;QACA,MAAM,EAAE,gBAAgB;QACxB,aAAa,EAAE,cAAc;EAIzC;sFACiD;IAC7C,OAAO,EAAE,CAAC;ICtCd,SAAS,EAAE,IAAI;IACf,OAAO,EA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B,UAAU,EAAE,IAAI;MAChB,SAAS,EAAE,gBAAgB;MAC3B,KAAK,EAAE,gBAAgB;MAEvB;oHAAE;QACE,KAAK,EAAE,oCAAmC;QAC1C,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,MAAM;QACnB,UAAU,EAAE,SAAS;QACrB,UAAU,EAAE,UAAU;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;0HAAU;QACN,KAAK,EAAE,oCAAmC;QAC1C,eAAe,EAAE,IAAI;MAGzB,0CAA2C;QAnC/C;oHAAwB;UAoChB,SAAS,EAAE,gBAAgB;UAC3B,KAAK,EAAE,gBAAgB;MAG3B,0CAA2C;QAxC/C;oHAAwB;UAyChB,SAAS,EAAE,oBAAoB;UAC/B,KAAK,EAAE,oBAAoB;MAG/B,yCAA0C;QA7C9C;oHAAwB;UA8ChB,SAAS,EAAE,gBAAgB;UAC3B,KAAK,EAAE,gBAAgB;MAG3B,yCAA0C;QAlD9C;oHAAwB;UAmDhB,SAAS,EAAE,iBAAiB;UAC5B,KAAK,EAAE,iBAAiB",
"sources": ["../../views/gutenberg-blocks/tainacan-collections/collections-list/collections-list.scss","../../views/gutenberg-blocks/gutenberg-blocks-variables.scss"],
"names": [],
"file": "tainacan-gutenberg-block-collections-list.css"

View File

@ -158,6 +158,10 @@
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field .modal-checkbox-list-item label,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field .components-radio-control__option label {
max-width: 80%; } }
.wp-block-tainacan-modal .modal-checkbox-list .components-radio-control__option .components-radio-control__input,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field .components-radio-control__option .components-radio-control__input {
min-width: 20px;
min-height: 20px; }
.wp-block-tainacan-modal .modal-checkbox-list .components-radio-control__option .components-radio-control__input::before,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field .components-radio-control__option .components-radio-control__input::before {
border-width: 0px; }

View File

@ -1,6 +1,6 @@
{
"version": 3,
"mappings": "AAIA,KAAM;EACF,sBAAsB,CAAC,QAAU;EACjC,sBAAsB,CAAC,QAAU;EACjC,sBAAsB,CAAC,QAAU;EACjC,sBAAsB,CAAC,QAAU;EACjC,sBAAsB,CAAC,QAAU;EACjC,sBAAsB,CAAC,QAAU;EACjC,wBAAwB,CAAC,QAAY;;AAIzC,kDAAmD;EAC/C,WAAW,EAAE,iBAAiB;EAC9B,aAAa,EAAE,YAAY;EAC3B,UAAU,EAAE,oCAAmC;EAE/C,iFAA+B;IAC3B,aAAa,EAAE,CAAC;EAEpB,oFAAkC;IAC9B,OAAO,EAAE,IAAI;IACb,cAAc,EAAE,GAAG;IACnB,eAAe,EAAE,MAAM;IACvB,WAAW,EAAE,QAAQ;IACrB,KAAK,EAAE,IAAI;IACX,SAAS,EAAE,GAAG;IACd,SAAS,EAAE,IAAI;IACf,OAAO,EAAE,CAAC;IAEV,sFAAE;MACE,SAAS,EAAE,cAAc;MACzB,MAAM,EAAE,IAAI;MACZ,KAAK,EAAE,oCAAmC;MAC1C,IAAI,EAAE,oCAAmC;MAEzC,0FAAI;QACA,YAAY,EAAE,GAAG;QACjB,GAAG,EAAE,GAAG;QACR,QAAQ,EAAE,QAAQ;QAClB,IAAI,EAAE,oCAAmC;IAGjD,uGAAmB;MACf,MAAM,EAAE,CAAC;;AAMrB,wBAAyB;EACrB,KAAK,EAAE,GAAG;EAEV,0CAA2C;IAH/C,wBAAyB;MAGyB,KAAK,EAAE,GAAG;EACxD,yCAA0C;IAJ9C,wBAAyB;MAIuB,KAAK,EAAE,IAAI;EAGvD,sCAAgB;IACZ,KAAK,EAAE,GAAG;IACV,MAAM,EAAE,GAAG;IACX,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,IAAI;IAEZ,6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utenberg-blocks-style.scss","../../views/gutenberg-blocks/gutenberg-blocks-variables.scss"],
"names": [],
"file": "tainacan-gutenberg-block-common-styles.css"

View File

@ -1,5 +1,9 @@
.wp-block-tainacan-dynamic-items-list {
margin: 2em auto; }
margin-top: 2em;
margin-bottom: 2em; }
.wp-block-tainacan-dynamic-items-list:not(.alignfull) {
margin-left: auto;
margin-right: auto; }
.wp-block-tainacan-dynamic-items-list .spinner-container {
min-height: 56px;
padding: 1em;
@ -117,19 +121,23 @@
top: -78px !important; }
.wp-block-tainacan-dynamic-items-list .dynamic-items-collection-header .collection-header-image {
background-color: transparent; } }
.wp-block-tainacan-dynamic-items-list.alignfull .dynamic-items-search-bar {
padding: 1.00em 2em 0.75em 2em; }
.wp-block-tainacan-dynamic-items-list .dynamic-items-search-bar {
width: 100%;
display: flex;
align-items: center;
border-bottom: 1px solid var(--tainacan-block-gray3, #cbcbcb);
padding: 1.00em 0.5em 0.75em 0.5em; }
padding: 1.00em 0.5em 0.75em 0.5em;
position: relative; }
@media only screen and (max-width: 768px) {
.wp-block-tainacan-dynamic-items-list .dynamic-items-search-bar {
flex-wrap: wrap; }
.wp-block-tainacan-dynamic-items-list .dynamic-items-search-bar .search-button {
order: 4;
position: absolute;
margin-top: 0.75em; }
bottom: 0.875em;
left: 1.0em; }
.wp-block-tainacan-dynamic-items-list .dynamic-items-search-bar input {
width: 100% !important;
order: 5;
@ -181,28 +189,6 @@
width: 100%;
border: 1px solid var(--tainacan-block-gray3, #cbcbcb);
box-shadow: none; }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list.items-list-without-margin,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list.items-list-without-margin,
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.items-list-without-margin,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.items-list-without-margin {
grid-template-columns: repeat(auto-fill, 185px);
justify-content: center !important;
grid-template-rows: auto !important;
list-style: none; }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list.items-list-without-margin li,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list.items-list-without-margin li,
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.items-list-without-margin li,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.items-list-without-margin li {
margin-top: 0 !important;
margin-right: 0 !important;
margin-left: 0 !important;
height: 185px !important; }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list.items-list-without-margin li img,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list.items-list-without-margin li img,
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.items-list-without-margin li img,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.items-list-without-margin li img {
height: 185px !important;
margin-bottom: 0px !important; }
.wp-block-tainacan-dynamic-items-list ul.items-list-edit li.item-list-item {
display: flex;
align-items: flex-start; }
@ -236,38 +222,140 @@
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid {
padding: 0;
margin: 0;
flex-wrap: wrap;
display: flex;
display: -ms-grid;
display: grid;
-ms-grid-columns: 220px 220px 220px 220px 220px;
grid-template-columns: repeat(auto-fill, 220px);
grid-gap: 0px;
grid-gap: 24px;
gap: 24px;
justify-content: space-evenly;
list-style-type: none;
margin: 0; }
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) {
-ms-grid-columns: 220px 220px 220px 220px;
grid-template-columns: repeat(4, 1fr); }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.max-columns-count-7,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.max-columns-count-7 {
-ms-grid-columns: 220px 220px 220px 220px 220px 220px 220px;
grid-template-columns: repeat(7, 1fr); }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.max-columns-count-6,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.max-columns-count-6 {
-ms-grid-columns: 220px 220px 220px 220px 220px 220px;
grid-template-columns: repeat(6, 1fr); }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.max-columns-count-5,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.max-columns-count-5 {
-ms-grid-columns: 220px 220px 220px 220px 220px;
grid-template-columns: repeat(5, 1fr); }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.max-columns-count-4,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.max-columns-count-4 {
-ms-grid-columns: 220px 220px 220px 220px;
grid-template-columns: repeat(4, 1fr); }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.max-columns-count-3,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.max-columns-count-3 {
-ms-grid-columns: 220px 220px 220px;
grid-template-columns: repeat(3, 1fr); }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.max-columns-count-2,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.max-columns-count-2 {
-ms-grid-columns: 220px 220px;
grid-template-columns: repeat(2, 1fr); }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.max-columns-count-1,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.max-columns-count-1 {
-ms-grid-columns: 220px;
grid-template-columns: repeat(1, 1fr); }
@media only screen and (max-width: 1600px) {
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.max-columns-count-7, .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.max-columns-count-6,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.max-columns-count-7,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.max-columns-count-6 {
-ms-grid-columns: 220px 220px 220px 220px 220px 220px;
grid-template-columns: repeat(6, 1fr); } }
@media only screen and (max-width: 1400px) {
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.max-columns-count-7, .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.max-columns-count-6, .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.max-columns-count-5,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.max-columns-count-7,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.max-columns-count-6,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.max-columns-count-5 {
-ms-grid-columns: 220px 220px 220px 220px 220px;
grid-template-columns: repeat(5, 1fr); } }
@media only screen and (max-width: 1280px) {
.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.items-layout-grid.max-columns-count-7, .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.max-columns-count-6, .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.max-columns-count-5, .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.max-columns-count-4,
.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),
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.max-columns-count-7,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.max-columns-count-6,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.max-columns-count-5,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.max-columns-count-4 {
-ms-grid-columns: 220px 220px 220px 220px;
grid-template-columns: repeat(4, 1fr); } }
@media only screen and (max-width: 1024px) {
.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.items-layout-grid.max-columns-count-7, .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.max-columns-count-6, .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.max-columns-count-5, .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.max-columns-count-4, .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.max-columns-count-3,
.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),
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.max-columns-count-7,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.max-columns-count-6,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.max-columns-count-5,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.max-columns-count-4,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.max-columns-count-3 {
-ms-grid-columns: 220px 220px 220px;
grid-template-columns: repeat(3, 1fr); } }
@media only screen and (max-width: 768px) {
.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.items-layout-grid.max-columns-count-7, .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.max-columns-count-6, .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.max-columns-count-5, .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.max-columns-count-4, .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.max-columns-count-3, .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.max-columns-count-2,
.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),
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.max-columns-count-7,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.max-columns-count-6,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.max-columns-count-5,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.max-columns-count-4,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.max-columns-count-3,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.max-columns-count-2 {
-ms-grid-columns: 220px 220px;
grid-template-columns: repeat(2, 1fr); } }
@media only screen and (max-width: 498px) {
.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.items-layout-grid.max-columns-count-7, .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.max-columns-count-6, .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.max-columns-count-5, .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.max-columns-count-4, .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.max-columns-count-3, .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.max-columns-count-2, .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.max-columns-count-1,
.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),
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.max-columns-count-7,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.max-columns-count-6,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.max-columns-count-5,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.max-columns-count-4,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.max-columns-count-3,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.max-columns-count-2,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.max-columns-count-1 {
-ms-grid-columns: 220px;
grid-template-columns: repeat(1, 1fr); } }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid li.item-list-item,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid li.item-list-item {
position: relative;
display: block;
margin: 12px 12px 24px 12px;
margin-bottom: 12px;
width: 185px; }
display: flex;
flex-wrap: wrap;
width: 100%;
flex-basis: 100%;
justify-content: center;
align-items: center; }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid li.item-list-item a,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid li.item-list-item a {
color: var(--tainacan-block-gray5, #454647);
border: none;
font-weight: bold;
line-height: normal; }
line-height: normal;
display: flex;
flex-basis: 100%;
justify-content: center;
align-items: center;
flex-direction: column; }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid li.item-list-item a > div,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid li.item-list-item a > div {
width: 100%; }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid li.item-list-item img,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid li.item-list-item img {
flex-basis: 100%;
height: auto;
width: 185px;
min-width: 185px;
padding: 0px;
width: 100%;
padding: 0px; }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid li.item-list-item a:not(.item-without-title),
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid li.item-list-item a:not(.item-without-title) {
margin-bottom: 0.5em; }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid li.item-list-item a.item-without-title span,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid li.item-list-item a.item-without-title span {
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid li.item-list-item a > span,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid li.item-list-item a > span {
margin-right: auto;
margin-top: 0.5em; }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid li.item-list-item a.item-without-title > span,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid li.item-list-item a.item-without-title > span {
display: none; }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid li.item-list-item:hover a,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid li.item-list-item:hover a {
@ -286,19 +374,127 @@
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list {
padding: 0;
display: flex;
padding-left: 0;
margin: 0;
margin-left: 0;
flex-wrap: wrap;
align-items: center;
list-style-type: none;
margin: 0; }
display: flex;
display: -ms-grid;
display: grid;
align-items: self-start;
list-style-type: none; }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list.max-columns-count-7,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list.max-columns-count-7 {
grid-template-columns: repeat(7, auto); }
@media only screen and (max-width: 1600px) {
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list.max-columns-count-7,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list.max-columns-count-7 {
grid-template-columns: repeat(6, auto); } }
@media only screen and (max-width: 1400px) {
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list.max-columns-count-7,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list.max-columns-count-7 {
grid-template-columns: repeat(5, auto); } }
@media only screen and (max-width: 1280px) {
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list.max-columns-count-7,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list.max-columns-count-7 {
grid-template-columns: repeat(4, auto); } }
@media only screen and (max-width: 1024px) {
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list.max-columns-count-7,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list.max-columns-count-7 {
grid-template-columns: repeat(3, auto); } }
@media only screen and (max-width: 768px) {
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list.max-columns-count-7,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list.max-columns-count-7 {
grid-template-columns: repeat(2, auto); } }
@media only screen and (max-width: 498px) {
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list.max-columns-count-7,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list.max-columns-count-7 {
grid-template-columns: repeat(1, auto); } }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list.max-columns-count-6,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list.max-columns-count-6 {
grid-template-columns: repeat(6, auto); }
@media only screen and (max-width: 1400px) {
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list.max-columns-count-6,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list.max-columns-count-6 {
grid-template-columns: repeat(5, auto); } }
@media only screen and (max-width: 1280px) {
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list.max-columns-count-6,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list.max-columns-count-6 {
grid-template-columns: repeat(4, auto); } }
@media only screen and (max-width: 1024px) {
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list.max-columns-count-6,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list.max-columns-count-6 {
grid-template-columns: repeat(3, auto); } }
@media only screen and (max-width: 768px) {
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list.max-columns-count-6,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list.max-columns-count-6 {
grid-template-columns: repeat(2, auto); } }
@media only screen and (max-width: 498px) {
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list.max-columns-count-6,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list.max-columns-count-6 {
grid-template-columns: repeat(1, auto); } }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list.max-columns-count-5,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list.max-columns-count-5 {
grid-template-columns: repeat(5, auto); }
@media only screen and (max-width: 1280px) {
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list.max-columns-count-5,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list.max-columns-count-5 {
grid-template-columns: repeat(4, auto); } }
@media only screen and (max-width: 1024px) {
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list.max-columns-count-5,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list.max-columns-count-5 {
grid-template-columns: repeat(3, auto); } }
@media only screen and (max-width: 768px) {
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list.max-columns-count-5,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list.max-columns-count-5 {
grid-template-columns: repeat(2, auto); } }
@media only screen and (max-width: 498px) {
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list.max-columns-count-5,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list.max-columns-count-5 {
grid-template-columns: repeat(1, auto); } }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list.max-columns-count-4,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list.max-columns-count-4 {
grid-template-columns: repeat(4, auto); }
@media only screen and (max-width: 1024px) {
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list.max-columns-count-4,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list.max-columns-count-4 {
grid-template-columns: repeat(3, auto); } }
@media only screen and (max-width: 768px) {
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list.max-columns-count-4,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list.max-columns-count-4 {
grid-template-columns: repeat(2, auto); } }
@media only screen and (max-width: 498px) {
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list.max-columns-count-4,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list.max-columns-count-4 {
grid-template-columns: repeat(1, auto); } }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list.max-columns-count-3,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list.max-columns-count-3 {
grid-template-columns: repeat(3, auto); }
@media only screen and (max-width: 768px) {
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list.max-columns-count-3,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list.max-columns-count-3 {
grid-template-columns: repeat(2, auto); } }
@media only screen and (max-width: 498px) {
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list.max-columns-count-3,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list.max-columns-count-3 {
grid-template-columns: repeat(1, auto); } }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list.max-columns-count-2,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list.max-columns-count-2 {
grid-template-columns: repeat(2, auto); }
@media only screen and (max-width: 498px) {
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list.max-columns-count-2,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list.max-columns-count-2 {
grid-template-columns: repeat(1, auto); } }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list.max-columns-count-1,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list.max-columns-count-1 {
grid-template-columns: repeat(1, auto); }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list > div,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list > div {
flex-basis: 220px; }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list li.item-list-item,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list li.item-list-item {
position: relative;
margin: 12px 12px 24px 12px;
margin-bottom: 12px;
min-height: 54px;
min-width: calc(20% - 24px);
width: calc(20% - 24px); }
display: inline-block;
padding: 12px 12px 24px 12px; }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list li.item-list-item a,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list li.item-list-item a {
color: var(--tainacan-block-gray5, #454647);
@ -307,6 +503,14 @@
align-items: center;
word-break: break-all;
word-break: break-word; }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list li.item-list-item a > div,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list li.item-list-item a > div {
padding: 0px;
padding-bottom: 0px !important;
margin-right: 20px;
display: block;
height: 54px;
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;
@ -321,26 +525,6 @@
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list li.item-list-item:hover a {
color: var(--tainacan-block-gray5, #454647);
text-decoration: none; }
@media only screen and (max-width: 1600px) {
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list li.item-list-item,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list li.item-list-item {
min-width: calc(25% - 24px);
width: calc(25% - 24px); } }
@media only screen and (max-width: 1024px) {
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list li.item-list-item,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list li.item-list-item {
min-width: calc(33.333% - 24px);
width: calc(33.333% - 24px); } }
@media only screen and (max-width: 768px) {
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list li.item-list-item,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list li.item-list-item {
min-width: calc(50% - 24px);
width: calc(50% - 24px); } }
@media only screen and (max-width: 498px) {
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list li.item-list-item,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list li.item-list-item {
min-width: calc(100% - 24px);
width: calc(100% - 24px); } }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic {
width: auto;
@ -372,7 +556,8 @@
min-width: 100%;
background-size: cover;
background-position: center;
margin: 0; }
margin: 0;
overflow: hidden; }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container li.item-list-item a,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container li.item-list-item a {
width: 100%;
@ -384,8 +569,8 @@
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container li.item-list-item img,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container li.item-list-item img {
display: none; }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container li.item-list-item a span,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container li.item-list-item a span {
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container li.item-list-item a > span,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container li.item-list-item a > span {
display: block;
position: absolute;
background: rgba(255, 255, 255, 0.75);
@ -397,8 +582,8 @@
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container li.item-list-item:hover a span,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container li.item-list-item:hover a span {
opacity: 1; }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container li.item-list-item a.item-without-title span,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container li.item-list-item a.item-without-title span {
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container li.item-list-item a.item-without-title > span,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container li.item-list-item a.item-without-title > span {
display: none; }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container li.item-list-item:hover a,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container li.item-list-item:hover a {

File diff suppressed because one or more lines are too long

View File

@ -115,6 +115,8 @@
top: -78px !important; }
.wp-block-tainacan-facets-list .facets-collection-header .collection-header-image {
background-color: transparent; } }
.wp-block-tainacan-facets-list.alignfull .facets-search-bar {
padding: 1.00em 2em 0.75em 2em; }
.wp-block-tainacan-facets-list .facets-search-bar {
width: 100%;
display: flex;
@ -211,7 +213,7 @@
border: 1px solid var(--tainacan-block-gray3, #cbcbcb) !important; }
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid {
padding: 0;
padding: 0 2em;
flex-wrap: wrap;
display: flex;
display: -ms-grid;

File diff suppressed because one or more lines are too long

View File

@ -83,6 +83,8 @@
top: 0px;
justify-content: center;
z-index: 999; }
.wp-block-tainacan-items-list ul.items-list-edit li.item-list-item button .dashicon {
margin: 0px; }
.wp-block-tainacan-items-list ul.items-list-edit li.item-list-item:hover button {
height: auto;
visibility: visible;

View File

@ -1,6 +1,6 @@
{
"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;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,oCAAmC;QAC1C,MAAM,EAAE,IAAI;QACZ,WAAW,EAAE,IAAI;QACjB,WAA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AO,EAAE,GAAG;QACZ,YAAY,EAAE,IAAI;MAGtB;mHAAyB;QACrB,OAAO,EAAE,IAAI;MAGjB;kGAAU;QACN,KAAK,EAAE,oCAAmC;QAC1C,eAAe,EAAE,IAAI;MAGzB,0CAA2C;QAlC/C;4FAAkB;UAmCV,SAAS,EAAE,gBAAgB;UAC3B,KAAK,EAAE,gBAAgB;MAG3B,0CAA2C;QAvC/C;4FAAkB;UAwCV,SAAS,EAAE,oBAAoB;UAC/B,KAAK,EAAE,oBAAoB;MAG/B,yCAA0C;QA5C9C;4FAAkB;UA6CV,SAAS,EAAE,gBAAgB;UAC3B,KAAK,EAAE,gBAAgB;MAG3B,yCAA0C;QAjD9C;4FAAkB;UAkDV,SAAS,EAAE,iBAAiB;UAC5B,KAAK,EAAE,iBAAiB",
"sources": ["../../views/gutenberg-blocks/tainacan-items/items-list/items-list.scss","../../views/gutenberg-blocks/gutenberg-blocks-variables.scss"],
"names": [],
"file": "tainacan-gutenberg-block-items-list.css"

View File

@ -64,6 +64,8 @@
top: 0px;
justify-content: center;
z-index: 999; }
.wp-block-tainacan-terms-list ul.terms-list-edit li.term-list-item button .dashicon {
margin: 0px; }
.wp-block-tainacan-terms-list ul.terms-list-edit li.term-list-item:hover button {
height: auto;
visibility: visible;

View File

@ -1,6 +1,6 @@
{
"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,E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KAAK,EAAE,oCAAmC;QAC1C,eAAe,EAAE,IAAI;MAGzB,0CAA2C;QAlC/C;4FAAkB;UAmCV,SAAS,EAAE,gBAAgB;UAC3B,KAAK,EAAE,gBAAgB;MAG3B,0CAA2C;QAvC/C;4FAAkB;UAwCV,SAAS,EAAE,oBAAoB;UAC/B,KAAK,EAAE,oBAAoB;MAG/B,yCAA0C;QA5C9C;4FAAkB;UA6CV,SAAS,EAAE,gBAAgB;UAC3B,KAAK,EAAE,gBAAgB;MAG3B,yCAA0C;QAjD9C;4FAAkB;UAkDV,SAAS,EAAE,iBAAiB;UAC5B,KAAK,EAAE,iBAAiB",
"sources": ["../../views/gutenberg-blocks/tainacan-terms/terms-list/terms-list.scss","../../views/gutenberg-blocks/gutenberg-blocks-variables.scss"],
"names": [],
"file": "tainacan-gutenberg-block-terms-list.css"

View File

@ -16,7 +16,6 @@ body:not([class]) > iframe {
min-height: 80vh;
border: none;
}
body:not([class]) > audio,
body:not([class]) > video {
width: 100%;
height: auto;
@ -25,6 +24,11 @@ body:not([class]) > video {
}
body:not([class]) > audio {
width: 100%;
height: auto;
border-radius: 20px;
background: black;
min-height: 38px;
max-height: 100%;
}
body:not([class]) > a,
body:not([class]) > p {

View File

@ -0,0 +1,160 @@
#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 {
display: flex;
justify-content: space-between;
align-items: center;
margin: 10px 24px 10px 0px; }
#tainacan-reports-app .tainacan-reports-header .wp-heading-inline {
margin: 0rem; }
#tainacan-reports-app .tainacan-reports-header select {
margin-right: auto;
margin-left: 6px; }
#tainacan-reports-app .tainacan-reports-subheader {
display: flex;
align-items: center;
margin: 6px 0px 36px 0px;
color: var(--tainacan-block-gray4, #555758); }
#tainacan-reports-app .tainacan-reports-subheader .tainacan-reports-subheader-box:not(:first-child) {
padding-left: 14px;
border-left: 1px solid var(--tainacan-block-gray3, #cbcbcb); }
#tainacan-reports-app .tainacan-reports-subheader .tainacan-reports-subheader-box__title {
font-weight: bold;
margin-left: 2px; }
#tainacan-reports-app .tainacan-reports-subheader .tainacan-reports-subheader-box__content {
display: flex;
align-items: center;
margin: 0px 14px 0px 0px;
flex-wrap: wrap; }
#tainacan-reports-app .tainacan-reports-subheader .tainacan-reports-subheader-box__content.tainacan-reports-subheader-box__content--two-columns li {
flex-basis: calc(50% - 8px); }
@media screen and (max-width: 986px) {
#tainacan-reports-app .tainacan-reports-subheader .tainacan-reports-subheader-box__content.tainacan-reports-subheader-box__content--two-columns li {
flex-basis: 100%; } }
#tainacan-reports-app .tainacan-reports-subheader .tainacan-reports-subheader-box__content.tainacan-reports-subheader-box__content--three-columns li {
flex-basis: calc(33.3333% - 8px); }
@media screen and (max-width: 1024px) {
#tainacan-reports-app .tainacan-reports-subheader .tainacan-reports-subheader-box__content.tainacan-reports-subheader-box__content--three-columns li {
flex-basis: calc(50% - 8px); } }
@media screen and (max-width: 768px) {
#tainacan-reports-app .tainacan-reports-subheader .tainacan-reports-subheader-box__content.tainacan-reports-subheader-box__content--three-columns li {
flex-basis: 100%; } }
#tainacan-reports-app .tainacan-reports-subheader .tainacan-reports-subheader-box__content li {
display: flex;
align-items: center;
margin: 0px 8px 0px 0px;
flex-basis: 100%; }
#tainacan-reports-app .tainacan-reports-subheader .icon svg {
fill: var(--tainacan-block-gray4, #555758);
margin-left: -0.5rem;
cursor: default; }
#tainacan-reports-app .tainacan-reports-subheader .apexcharts-pan-icon svg {
fill: transparent;
stroke: var(--tainacan-block-gray4, #555758); }
#tainacan-reports-app .tainacan-reports-subheader .apexcharts-reset-icon {
margin-left: 0; }
#tainacan-reports-app .columns {
max-width: 100%;
align-items: flex-start;
justify-content: center; }
#tainacan-reports-app .columns .column {
max-width: 100%;
padding: 0;
position: relative;
box-sizing: content-box; }
#tainacan-reports-app .columns .column .postbox {
margin: 0.75rem; }
#tainacan-reports-app .columns .column .box-last-cached-on {
position: absolute;
bottom: calc(1px + 0.75rem);
right: calc(1px + 0.75rem);
display: inline-block;
padding: 0px 10px;
background-color: var(--tainacan-block-gray2, #dbdbdb);
color: var(--tainacan-block-gray4, #555758);
font-size: 0.875em;
border-top-left-radius: 3px;
opacity: 0.0;
transition: opacity 0.3s ease; }
#tainacan-reports-app .columns .column .box-last-cached-on button {
border: none;
background: none;
cursor: pointer; }
#tainacan-reports-app .columns .column .box-last-cached-on button:hover {
color: var(--wp-admin-theme-color, #007cba); }
#tainacan-reports-app .columns .column .postbox:hover + .box-last-cached-on,
#tainacan-reports-app .columns .column .postbox:hover + .box-last-cached-on + .box-last-cached-on,
#tainacan-reports-app .columns .column .box-last-cached-on:hover {
opacity: 1.0; }
#tainacan-reports-app .postbox {
padding: 1.125rem 1.25rem;
margin-bottom: 0;
height: 100%;
min-height: 380px;
background-color: var(--tainacan-block-gray0, #f6f6f6); }
#tainacan-reports-app .postbox label {
font-weight: bold;
font-size: 0.875rem; }
#tainacan-reports-app .postbox .box-header {
display: flex;
align-items: baseline;
justify-content: space-between;
flex-wrap: wrap; }
#tainacan-reports-app .postbox .box-header .box-header__item {
margin-bottom: 10px;
line-height: 2rem; }
#tainacan-reports-app .empty-postbox-placeholder {
display: flex;
align-items: center;
justify-content: center;
padding: 1rem;
min-height: 380px;
flex-direction: column;
opacity: 0.75; }
#tainacan-reports-app .empty-postbox-placeholder p {
color: var(--tainacan-block-gray4, #555758); }
#tainacan-reports-app .graph-mode-switch {
display: inline-block; }
#tainacan-reports-app .graph-mode-switch button {
border: none !important;
background: none !important;
box-shadow: none !important;
padding: 0;
cursor: pointer; }
#tainacan-reports-app .graph-mode-switch button.current {
color: var(--wp-admin-theme-color, #007cba); }
#tainacan-reports-app .tainacan-custom-tooltip {
padding: 0;
display: flex;
justify-content: center;
align-items: flex-start;
flex-direction: column; }
#tainacan-reports-app .tainacan-custom-tooltip .tainacan-custom-tooltip__header {
background-color: var(--tainacan-block-gray1, #f2f2f2);
display: flex;
justify-content: flex-start;
align-items: center;
width: 100%;
padding: 6px 10px 4px 10px; }
#tainacan-reports-app .tainacan-custom-tooltip .tainacan-custom-tooltip__header + .tainacan-custom-tooltip__body {
padding: 4px 10px 6px 10px; }
#tainacan-reports-app .tainacan-custom-tooltip .tainacan-custom-tooltip__body {
width: 100%;
padding: 6px 10px;
display: flex;
justify-content: center;
align-items: flex-start;
flex-direction: column; }
#tainacan-reports-app .tainacan-custom-tooltip .tainacan-custom-tooltip__body p {
margin-bottom: 4px;
font-size: 0.85rem; }
#tainacan-reports-app .apexcharts-legend-series {
display: flex;
align-items: center; }
/*# sourceMappingURL=tainacan-reports.css.map */

View File

@ -0,0 +1,7 @@
{
"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,eAAe;QAE3B,oCAAq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AAM;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"
}

View File

@ -7,7 +7,7 @@
url("../fonts/TainacanIcons.woff") format("woff"),
url("../fonts/TainacanIcons.ttf") format("truetype"),
url("../fonts/TainacanIcons.svg") format("svg");
font-weight: normal;
font-weight: normal;
font-style: normal;
text-rendering: optimizeLegibility;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
id="svg39"
version="1.1"
viewBox="0 0 264 88"
height="88"
width="264">
<metadata
id="metadata45">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>default-skin 2</dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs43" />
<title
id="title2">default-skin 2</title>
<path
id="Shape"
d="m 67.002,59.5 v 3.768 C 60.695,64.108 57.818,69.018 57,73 59.22,70.17 62.564,67.902 67.002,67.902 V 71.5 L 73,65.585 Z"
style="fill:#ffffff;fill-rule:evenodd" />
<g
style="fill:#ffffff;fill-rule:evenodd"
id="g7">
<path
id="path5"
d="m 13,29 v -5 h 2 v 3 h 3 v 2 z m 0,-14 h 5 v 2 h -3 v 3 h -2 z m 18,0 v 5 h -2 v -3 h -3 v -2 z m 0,14 h -5 v -2 h 3 v -3 h 2 z" />
</g>
<g
style="fill:#ffffff;fill-rule:evenodd"
id="g11">
<path
id="path9"
d="m 62,24 v 5 h -2 v -3 h -3 v -2 z m 0,-4 h -5 v -2 h 3 v -3 h 2 z m 8,0 v -5 h 2 v 3 h 3 v 2 z m 0,4 h 5 v 2 h -3 v 3 h -2 z" />
</g>
<path
id="path13"
d="M 20.586,66 14.93,60.344 16.344,58.93 22,64.586 27.656,58.93 29.07,60.344 23.414,66 29.07,71.656 27.656,73.07 22,67.414 16.344,73.07 14.93,71.656 Z"
style="fill:#ffffff;fill-rule:evenodd" />
<path
id="path15"
d="m 108.09738,65.891437 -2.03999,-1.748574 c 1.38784,-1.589364 1.3957,-1.596523 4.44849,-5.142894 -2.91228,-3.313711 -2.89516,-3.3306 -4.44849,-5.142833 L 108.09738,52.179419 114.05739,59 Z"
style="fill:#ffffff;fill-rule:evenodd;stroke-width:1.14285851" />
<path
id="path17"
d="m 155.5635,65.896657 2.04,-1.748571 c -1.49112,-1.796968 -1.49059,-1.799812 -4.33482,-5.142858 3.02761,-3.609572 3.02493,-3.60229 4.33482,-5.142857 l -2.04,-1.677714 -5.96,6.820571 z"
style="fill:#ffffff;fill-rule:evenodd;stroke-width:1.14285719" />
<g
id="g23"
style="fill:none;fill-rule:evenodd">
<path
style="fill:#ffffff"
d="m 160.957,28.543 -3.25,-3.25 -1.413,1.414 3.25,3.25 z"
id="Rectangle-11" />
<path
style="stroke:#ffffff;stroke-width:1.5"
id="Oval-1"
d="m 152.5,27 c 3.038,0 5.5,-2.462 5.5,-5.5 0,-3.038 -2.462,-5.5 -5.5,-5.5 -3.038,0 -5.5,2.462 -5.5,5.5 0,3.038 2.462,5.5 5.5,5.5 z" />
<path
style="fill:#ffffff"
id="path21"
d="m 150,21 h 5 v 1 h -5 z" />
</g>
<g
id="g33"
style="fill:none;fill-rule:evenodd">
<path
style="fill:#ffffff"
id="path25"
d="m 116.957,28.543 -1.414,1.414 -3.25,-3.25 1.414,-1.414 z" />
<path
style="stroke:#ffffff;stroke-width:1.5"
id="path27"
d="m 108.5,27 c 3.038,0 5.5,-2.462 5.5,-5.5 0,-3.038 -2.462,-5.5 -5.5,-5.5 -3.038,0 -5.5,2.462 -5.5,5.5 0,3.038 2.462,5.5 5.5,5.5 z" />
<path
style="fill:#ffffff"
id="path29"
d="m 106,21 h 5 v 1 h -5 z" />
<path
style="fill:#ffffff"
id="path31"
d="m 109.043,19.008 -0.085,5 -1,-0.017 0.085,-5 z" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 859 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1010 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 573 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 814 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 161 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 699 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 621 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 866 B

View File

@ -4,7 +4,6 @@ namespace Tainacan\API;
class REST_Controller extends \WP_REST_Controller {
/**
* REST_Controller constructor.
*/
@ -624,7 +623,6 @@ class REST_Controller extends \WP_REST_Controller {
}
function get_permissions_schema() {
return [
@ -655,5 +653,3 @@ class REST_Controller extends \WP_REST_Controller {
}
}
?>

View File

@ -231,7 +231,6 @@ class REST_Background_Processes_Controller extends REST_Controller {
$result = $this->prepare_item_for_response($result, $request);
return new \WP_REST_Response( $result, 200 );
}
public function prepare_item_for_response($item, $request) {
@ -309,8 +308,6 @@ class REST_Background_Processes_Controller extends REST_Controller {
$result = $this->prepare_item_for_response($result, $request);
return new \WP_REST_Response( $result, 200 );
}
public function delete_item( $request ) {
@ -334,7 +331,6 @@ class REST_Background_Processes_Controller extends REST_Controller {
// TODO: delete log files
return new \WP_REST_Response( $result, 200 );
}
public function get_log_url($id, $action, $type = '') {
@ -352,7 +348,6 @@ class REST_Background_Processes_Controller extends REST_Controller {
$logs_url = $upload_url . 'tainacan/' . $filename;
return $logs_url;
}
}

View File

@ -382,8 +382,9 @@ class REST_Bulkedit_Controller extends REST_Controller {
global $Tainacan_Generic_Process_Handler;
$process = $Tainacan_Generic_Process_Handler->get_process_instance_by_session_id($bulk_id);
if ($process !== false) {
$bulk_edit_value = isset($body['new_value']) ? $body['new_value'] : (isset($body['value']) ? $body['value'] : null);
$bulk_edit_data = [
"value" => isset($body['new_value']) ? $body['new_value'] : $body['value'],
"value" => $bulk_edit_value,
"method" => $method,
"old_value" => isset($body['old_value']) ? $body['old_value'] : null,
"metadatum_id" => isset($body['metadatum_id']) ? $body['metadatum_id'] : null,

View File

@ -13,79 +13,79 @@ use Tainacan\Entities\Collection;
* @uses Entities\Collection and Repositories\Collections
* */
class REST_Collections_Controller extends REST_Controller {
private $collections_repository;
private $collection;
private $collections_repository;
private $collection;
/**
* REST_Collections_Controller constructor.
* Define the namespace, rest base and instantiate your attributes.
*/
public function __construct(){
$this->rest_base = 'collections';
$this->rest_base = 'collections';
parent::__construct();
add_action('init', array(&$this, 'init_objects'), 11);
}
add_action('init', array(&$this, 'init_objects'), 11);
}
/**
* Initialize objects after post_type register
*/
public function init_objects() {
$this->collections_repository = Repositories\Collections::get_instance();
$this->collection = new Entities\Collection();
}
/**
* Initialize objects after post_type register
*/
public function init_objects() {
$this->collections_repository = Repositories\Collections::get_instance();
$this->collection = new Entities\Collection();
}
/**
* Register the collections route and their endpoints
*/
public function register_routes(){
register_rest_route($this->namespace, '/' . $this->rest_base, array(
array(
'methods' => \WP_REST_Server::READABLE,
'callback' => array($this, 'get_items'),
'permission_callback' => array($this, 'get_items_permissions_check'),
'args' => $this->get_endpoint_args_for_item_schema(\WP_REST_Server::READABLE),
),
array(
'methods' => \WP_REST_Server::CREATABLE,
'callback' => array($this, 'create_item'),
'permission_callback' => array($this, 'create_item_permissions_check'),
'args' => $this->get_endpoint_args_for_item_schema(\WP_REST_Server::CREATABLE),
),
register_rest_route($this->namespace, '/' . $this->rest_base, array(
array(
'methods' => \WP_REST_Server::READABLE,
'callback' => array($this, 'get_items'),
'permission_callback' => array($this, 'get_items_permissions_check'),
'args' => $this->get_endpoint_args_for_item_schema(\WP_REST_Server::READABLE),
),
array(
'methods' => \WP_REST_Server::CREATABLE,
'callback' => array($this, 'create_item'),
'permission_callback' => array($this, 'create_item_permissions_check'),
'args' => $this->get_endpoint_args_for_item_schema(\WP_REST_Server::CREATABLE),
),
'schema' => [$this, 'get_schema'],
));
register_rest_route($this->namespace, '/' . $this->rest_base . '/(?P<collection_id>[\d]+)', array(
array(
'methods' => \WP_REST_Server::READABLE,
'callback' => array($this, 'get_item'),
'permission_callback' => array($this, 'get_item_permissions_check'),
'args' => $this->get_wp_query_params(),
));
register_rest_route($this->namespace, '/' . $this->rest_base . '/(?P<collection_id>[\d]+)', array(
array(
'methods' => \WP_REST_Server::READABLE,
'callback' => array($this, 'get_item'),
'permission_callback' => array($this, 'get_item_permissions_check'),
'args' => $this->get_wp_query_params(),
),
array(
'methods' => \WP_REST_Server::EDITABLE,
'callback' => array($this, 'update_item'),
'permission_callback' => array($this, 'update_item_permissions_check'),
'args' => $this->get_endpoint_args_for_item_schema(\WP_REST_Server::EDITABLE),
),
array(
'methods' => \WP_REST_Server::DELETABLE,
'callback' => array($this, 'delete_item'),
'permission_callback' => array($this, 'delete_item_permissions_check'),
'args' => array(
'permanently' => array(
'description' => __('To delete permanently, you can pass \'permanently\' as 1. By default this will only trash collection'),
),
array(
'methods' => \WP_REST_Server::EDITABLE,
'callback' => array($this, 'update_item'),
'permission_callback' => array($this, 'update_item_permissions_check'),
'args' => $this->get_endpoint_args_for_item_schema(\WP_REST_Server::EDITABLE),
),
array(
'methods' => \WP_REST_Server::DELETABLE,
'callback' => array($this, 'delete_item'),
'permission_callback' => array($this, 'delete_item_permissions_check'),
'args' => array(
'permanently' => array(
'description' => __('To delete permanently, you can pass \'permanently\' as 1. By default this will only trash collection'),
'default' => '0',
),
)
),
),
)
),
'schema' => [$this, 'get_schema'],
));
register_rest_route($this->namespace, '/' . $this->rest_base . '/(?P<collection_id>[\d]+)/metadata_order', array(
array(
'methods' => \WP_REST_Server::EDITABLE,
'callback' => array($this, 'update_metadata_order'),
'permission_callback' => array($this, 'update_metadata_order_permissions_check'),
'args' => [
array(
'methods' => \WP_REST_Server::EDITABLE,
'callback' => array($this, 'update_metadata_order'),
'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' ),
'required' => true,
@ -96,11 +96,11 @@ class REST_Collections_Controller extends REST_Controller {
'schema' => [$this, 'get_schema'],
));
register_rest_route($this->namespace, '/' . $this->rest_base . '/(?P<collection_id>[\d]+)/filters_order', array(
array(
'methods' => \WP_REST_Server::EDITABLE,
'callback' => array($this, 'update_filters_order'),
'permission_callback' => array($this, 'update_filters_order_permissions_check'),
'args' => [
array(
'methods' => \WP_REST_Server::EDITABLE,
'callback' => array($this, 'update_filters_order'),
'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' ),
'required' => true,
@ -109,8 +109,8 @@ class REST_Collections_Controller extends REST_Controller {
],
),
'schema' => [$this, 'get_schema'],
));
}
));
}
/**
* Return a array of Collections objects in JSON
@ -123,7 +123,7 @@ class REST_Collections_Controller extends REST_Controller {
public function get_items($request){
$args = $this->prepare_filters($request);
$collections = $this->collections_repository->fetch($args);
$collections = $this->collections_repository->fetch($args);
$response = [];
if($collections->have_posts()){
@ -141,17 +141,17 @@ class REST_Collections_Controller extends REST_Controller {
$total_collections = $collections->found_posts;
$max_pages = ceil($total_collections / (int) $collections->query_vars['posts_per_page']);
$rest_response = new \WP_REST_Response($response, 200);
$rest_response = new \WP_REST_Response($response, 200);
$rest_response->header('X-WP-Total', (int) $total_collections);
$rest_response->header('X-WP-TotalPages', (int) $max_pages);
$rest_response->header('X-WP-Total', (int) $total_collections);
$rest_response->header('X-WP-TotalPages', (int) $max_pages);
$total_collections = wp_count_posts( 'tainacan-collection', 'readable' );
if (isset($total_collections->publish) ||
isset($total_collections->private) ||
isset($total_collections->trash) ||
isset($total_collections->draft)) {
isset($total_collections->private) ||
isset($total_collections->trash) ||
isset($total_collections->draft)) {
$rest_response->header('X-Tainacan-total-collections-trash', $total_collections->trash);
$rest_response->header('X-Tainacan-total-collections-publish', $total_collections->publish);
@ -159,8 +159,8 @@ class REST_Collections_Controller extends REST_Controller {
$rest_response->header('X-Tainacan-total-collections-private', $total_collections->private);
}
return $rest_response;
}
return $rest_response;
}
/**
* Return a Collection object in JSON
@ -170,13 +170,13 @@ class REST_Collections_Controller extends REST_Controller {
* @return \WP_Error|\WP_REST_Response
*/
public function get_item($request){
$collection_id = $request['collection_id'];
$collection = $this->collections_repository->fetch($collection_id);
$collection_id = $request['collection_id'];
$collection = $this->collections_repository->fetch($collection_id);
$response = $this->prepare_item_for_response($collection, $request );
$response = $this->prepare_item_for_response($collection, $request );
return new \WP_REST_Response($response, 200);
}
return new \WP_REST_Response($response, 200);
}
/**
*
@ -188,14 +188,14 @@ class REST_Collections_Controller extends REST_Controller {
* @return mixed|string|void|\WP_Error|\WP_REST_Response
*/
public function prepare_item_for_response($item, $request){
if(!empty($item)){
if(!empty($item)){
if(!isset($request['fetch_only'])) {
if(!isset($request['fetch_only'])) {
$item_arr = $item->_toArray();
$item_arr = $item->_toArray();
if ( $request['context'] === 'edit' ) {
$item_arr['current_user_can_edit'] = $item->can_edit();
if ( $request['context'] === 'edit' ) {
$item_arr['current_user_can_edit'] = $item->can_edit();
$item_arr['current_user_can_delete'] = $item->can_delete();
$collection_caps = \tainacan_roles()->get_collection_caps_slugs();
@ -208,24 +208,24 @@ class REST_Collections_Controller extends REST_Controller {
$item_arr[$cap_key] = current_user_can( $cap_check );
}
}
}
} else {
$attributes_to_filter = $request['fetch_only'];
} else {
$attributes_to_filter = $request['fetch_only'];
# Always returns id
if(is_array($attributes_to_filter)) {
# Always returns id
if(is_array($attributes_to_filter)) {
$attributes_to_filter[] = 'id';
} elseif(!strstr($attributes_to_filter, ',')){
$attributes_to_filter = array($attributes_to_filter, 'id');
} else {
$attributes_to_filter .= ',id';
}
} elseif(!strstr($attributes_to_filter, ',')){
$attributes_to_filter = array($attributes_to_filter, 'id');
} else {
$attributes_to_filter .= ',id';
}
$item_arr = $this->filter_object_by_attributes($item, $attributes_to_filter);
$item_arr = $this->filter_object_by_attributes($item, $attributes_to_filter);
if ( $request['context'] === 'edit' ) {
$item_arr['current_user_can_edit'] = $item->can_edit();
if ( $request['context'] === 'edit' ) {
$item_arr['current_user_can_edit'] = $item->can_edit();
$item_arr['current_user_can_delete'] = $item->can_delete();
$collection_caps = \tainacan_roles()->get_collection_caps_slugs();
@ -307,10 +307,10 @@ class REST_Collections_Controller extends REST_Controller {
}
return $item_arr;
}
}
return $item;
}
return $item;
}
/**
*
@ -391,8 +391,8 @@ class REST_Collections_Controller extends REST_Controller {
* @throws \Exception
*/
public function create_item_permissions_check( $request ) {
return current_user_can($this->collections_repository->get_capabilities()->edit_posts);
}
return current_user_can($this->collections_repository->get_capabilities()->edit_posts);
}
/**
* Prepare collection for insertion on database
@ -408,8 +408,8 @@ class REST_Collections_Controller extends REST_Controller {
if(method_exists($this->collection, $set_)) $this->collection->$set_($value);
}
return $this->collection;
}
return $this->collection;
}
/**
* Delete a collection
@ -424,9 +424,9 @@ class REST_Collections_Controller extends REST_Controller {
if(! $collection instanceof Entities\Collection) {
return new \WP_REST_Response([
'error_message' => __('Collection with this ID was not found', 'tainacan' ),
'collection_id' => $collection_id
], 400);
'error_message' => __('Collection with this ID was not found', 'tainacan' ),
'collection_id' => $collection_id
], 400);
}
if($permanently == true) {
@ -438,7 +438,7 @@ class REST_Collections_Controller extends REST_Controller {
$prepared_collection = $this->prepare_item_for_response($collection, $request);
return new \WP_REST_Response($prepared_collection, 200);
}
}
/**
* Verify if current user has permission to delete a collection
@ -456,7 +456,7 @@ class REST_Collections_Controller extends REST_Controller {
}
return false;
}
}
/**
* Update a collection
@ -466,48 +466,48 @@ class REST_Collections_Controller extends REST_Controller {
* @return string|\WP_Error|\WP_REST_Response
*/
public function update_item( $request ) {
$collection_id = $request['collection_id'];
$collection_id = $request['collection_id'];
$body = json_decode($request->get_body(), true);
$body = json_decode($request->get_body(), true);
if(!empty($body)){
$attributes = [];
if(!empty($body)){
$attributes = [];
foreach ($body as $att => $value){
$attributes[$att] = $value;
}
foreach ($body as $att => $value){
$attributes[$att] = $value;
}
$collection = $this->collections_repository->fetch($collection_id);
$collection = $this->collections_repository->fetch($collection_id);
if($collection) {
$prepared_collection = $this->prepare_item_for_updating( $collection, $attributes );
if($collection) {
$prepared_collection = $this->prepare_item_for_updating( $collection, $attributes );
if ( $prepared_collection->validate() ) {
$updated_collection = $this->collections_repository->update( $collection );
if ( $prepared_collection->validate() ) {
$updated_collection = $this->collections_repository->update( $collection );
$response = $this->prepare_item_for_response($updated_collection, $request);
$response = $this->prepare_item_for_response($updated_collection, $request);
return new \WP_REST_Response( $response, 200 );
}
return new \WP_REST_Response( $response, 200 );
}
return new \WP_REST_Response([
'error_message' => __('One or more values are invalid.', 'tainacan'),
'errors' => $prepared_collection->get_errors(),
'collection' => $this->prepare_item_for_response($prepared_collection, $request)
], 400);
}
return new \WP_REST_Response([
'error_message' => __('One or more values are invalid.', 'tainacan'),
'errors' => $prepared_collection->get_errors(),
'collection' => $this->prepare_item_for_response($prepared_collection, $request)
], 400);
}
return new \WP_REST_Response([
'error_message' => __('Collection with this ID was not found', 'tainacan' ),
'collection_id' => $collection_id
], 400);
}
return new \WP_REST_Response([
'error_message' => __('Collection with this ID was not found', 'tainacan' ),
'collection_id' => $collection_id
], 400);
}
return new \WP_REST_Response([
'error_message' => __('The body could not be empty', 'tainacan'),
'body' => $body
], 400);
}
return new \WP_REST_Response([
'error_message' => __('The body could not be empty', 'tainacan'),
'body' => $body
], 400);
}
/**
@ -557,43 +557,43 @@ class REST_Collections_Controller extends REST_Controller {
* @return string|\WP_Error|\WP_REST_Response
*/
public function update_metadata_order( $request ) {
$collection_id = $request['collection_id'];
$collection_id = $request['collection_id'];
$body = json_decode($request->get_body(), true);
$body = json_decode($request->get_body(), true);
if( !empty($body) && isset($body['metadata_order']) ) {
if( !empty($body) && isset($body['metadata_order']) ) {
$collection = $this->collections_repository->fetch($collection_id);
$collection = $this->collections_repository->fetch($collection_id);
if( $collection instanceof Entities\Collection) {
$collection->set_metadata_order( $body['metadata_order'] );
if( $collection instanceof Entities\Collection) {
$collection->set_metadata_order( $body['metadata_order'] );
if ( $collection->validate() ) {
$updated_collection = $this->collections_repository->update( $collection );
if ( $collection->validate() ) {
$updated_collection = $this->collections_repository->update( $collection );
$response = $this->prepare_item_for_response($updated_collection, $request);
$response = $this->prepare_item_for_response($updated_collection, $request);
return new \WP_REST_Response( $response, 200 );
}
return new \WP_REST_Response( $response, 200 );
}
return new \WP_REST_Response([
'error_message' => __('One or more values are invalid.', 'tainacan'),
'errors' => $collection->get_errors(),
'collection' => $this->prepare_item_for_response($collection, $request)
], 400);
}
return new \WP_REST_Response([
'error_message' => __('One or more values are invalid.', 'tainacan'),
'errors' => $collection->get_errors(),
'collection' => $this->prepare_item_for_response($collection, $request)
], 400);
}
return new \WP_REST_Response([
'error_message' => __('Collection with this ID was not found', 'tainacan' ),
'collection_id' => $collection_id
], 400);
}
return new \WP_REST_Response([
'error_message' => __('Collection with this ID was not found', 'tainacan' ),
'collection_id' => $collection_id
], 400);
}
return new \WP_REST_Response([
'error_message' => __('The body could not be empty', 'tainacan'),
'body' => $body
], 400);
}
return new \WP_REST_Response([
'error_message' => __('The body could not be empty', 'tainacan'),
'body' => $body
], 400);
}
/**
@ -622,43 +622,43 @@ class REST_Collections_Controller extends REST_Controller {
* @return string|\WP_Error|\WP_REST_Response
*/
public function update_filters_order( $request ) {
$collection_id = $request['collection_id'];
$collection_id = $request['collection_id'];
$body = json_decode($request->get_body(), true);
$body = json_decode($request->get_body(), true);
if( !empty($body) && isset($body['filters_order']) ) {
if( !empty($body) && isset($body['filters_order']) ) {
$collection = $this->collections_repository->fetch($collection_id);
$collection = $this->collections_repository->fetch($collection_id);
if( $collection instanceof Entities\Collection) {
$collection->set_filters_order( $body['filters_order'] );
if( $collection instanceof Entities\Collection) {
$collection->set_filters_order( $body['filters_order'] );
if ( $collection->validate() ) {
$updated_collection = $this->collections_repository->update( $collection );
if ( $collection->validate() ) {
$updated_collection = $this->collections_repository->update( $collection );
$response = $this->prepare_item_for_response($updated_collection, $request);
$response = $this->prepare_item_for_response($updated_collection, $request);
return new \WP_REST_Response( $response, 200 );
}
return new \WP_REST_Response( $response, 200 );
}
return new \WP_REST_Response([
'error_message' => __('One or more values are invalid.', 'tainacan'),
'errors' => $prepared_collection->get_errors(),
'collection' => $this->prepare_item_for_response($prepared_collection, $request)
], 400);
}
return new \WP_REST_Response([
'error_message' => __('One or more values are invalid.', 'tainacan'),
'errors' => $prepared_collection->get_errors(),
'collection' => $this->prepare_item_for_response($prepared_collection, $request)
], 400);
}
return new \WP_REST_Response([
'error_message' => __('Collection with this ID was not found', 'tainacan' ),
'collection_id' => $collection_id
], 400);
}
return new \WP_REST_Response([
'error_message' => __('Collection with this ID was not found', 'tainacan' ),
'collection_id' => $collection_id
], 400);
}
return new \WP_REST_Response([
'error_message' => __('The body could not be empty', 'tainacan'),
'body' => $body
], 400);
}
return new \WP_REST_Response([
'error_message' => __('The body could not be empty', 'tainacan'),
'body' => $body
], 400);
}
/**
@ -677,7 +677,7 @@ class REST_Collections_Controller extends REST_Controller {
}
return false;
}
}
/**
* @param string $method
@ -688,17 +688,17 @@ class REST_Collections_Controller extends REST_Controller {
$endpoint_args = [];
if($method === \WP_REST_Server::READABLE) {
$endpoint_args['name'] = array(
'description' => __('Limits the result set to collections with a specific name'),
'type' => 'string',
);
$endpoint_args['name'] = array(
'description' => __('Limits the result set to collections with a specific name'),
'type' => 'string',
);
$endpoint_args = array_merge(
$endpoint_args,
parent::get_wp_query_params(),
parent::get_fetch_only_param(),
parent::get_meta_queries_params()
);
$endpoint_args = array_merge(
$endpoint_args,
parent::get_wp_query_params(),
parent::get_fetch_only_param(),
parent::get_meta_queries_params()
);
} elseif ($method === \WP_REST_Server::CREATABLE || $method === \WP_REST_Server::EDITABLE) {
$map = $this->collections_repository->get_map();
@ -715,8 +715,8 @@ class REST_Collections_Controller extends REST_Controller {
$endpoint_args = $map;
}
return $endpoint_args;
}
return $endpoint_args;
}
function get_schema() {
$schema = [

View File

@ -187,27 +187,21 @@ class REST_Item_Metadata_Controller extends REST_Controller {
public function update_item( $request ) {
$body = json_decode( $request->get_body(), true );
if($body) {
$item_id = $request['item_id'];
if ($body) {
$item_id = $request['item_id'];
$value = $body['values'];
$metadatum_id = $request['metadatum_id'];
$value = $body['values'];
$parent_meta_id = isset( $body['parent_meta_id'] ) && $body['parent_meta_id'] > 0 ? $body['parent_meta_id'] : null;
$item = $this->item_repository->fetch( $item_id );
$metadatum = $this->metadatum_repository->fetch( $metadatum_id );
$item = $this->item_repository->fetch($item_id);
$metadatum = $this->metadatum_repository->fetch($metadatum_id);
$item_metadata = new Entities\Item_Metadata_Entity( $item, $metadatum, null, $parent_meta_id);
if($item_metadata->is_multiple()) {
$item_metadata->set_value( $value );
} elseif(is_array($value)) {
$item_metadata->set_value(implode(' ', $value));
} else {
$item_metadata->set_value($value);
}
$value = $this->get_metadata_value($item_metadata->is_multiple(), $value);
$item_metadata->set_value($value);
if ( $item_metadata->validate() ) {
if ($item_metadata->validate()) {
if($item->can_edit()) {
$updated_item_metadata = $this->item_metadata_repository->update( $item_metadata );
@ -279,7 +273,7 @@ class REST_Item_Metadata_Controller extends REST_Controller {
$endpoint_args = array_merge(
$endpoint_args,
$this->get_wp_query_params()
);
);
} elseif ($method === \WP_REST_Server::EDITABLE) {
$endpoint_args['values'] = [
'type' => ['array', 'string', 'object', 'integer'],
@ -378,6 +372,12 @@ class REST_Item_Metadata_Controller extends REST_Controller {
}
}
private function get_metadata_value($is_multiple, $value) {
if ($is_multiple) {
return $value;
} elseif (is_array($value)) {
return implode(' ', $value);
}
return $value;
}
}
?>

View File

@ -283,6 +283,7 @@ class REST_Items_Controller extends REST_Controller {
if( isset($item_arr['thumbnail']) ) {
$item_arr['thumbnail_alt'] = get_post_meta( $item->get__thumbnail_id(), '_wp_attachment_image_alt', true );
$item_arr['thumbnail_id'] = $item->get__thumbnail_id();
$item_arr['document_mimetype'] = $item->get_document_mimetype(); // In case the thumbnail is requested, we need the document mime type to generate proper placeholders
}
$item_arr['url'] = get_permalink( $item_arr['id'] );
@ -707,10 +708,9 @@ class REST_Items_Controller extends REST_Controller {
*/
public function update_item( $request ) {
$item_id = $request['item_id'];
$body = json_decode($request->get_body(), true);
if(!empty($body)){
if (!empty($body)) {
$attributes = [];
foreach ($body as $att => $value){
@ -883,7 +883,7 @@ class REST_Items_Controller extends REST_Controller {
return new \WP_REST_Response( [
'error_message' => __( 'Please verify, invalid value(s)', 'tainacan' ),
'errors' => $item_metadata->get_errors(),
'item_metadata' => $this->prepare_item_for_response($item_metadata, $request),
'item_metadata' => $this->prepare_item_for_response($item_metadata->get_item(), $request),
], 400 );
}
}

View File

@ -9,7 +9,6 @@ use Tainacan\Repositories\Repository;
class REST_Logs_Controller extends REST_Controller {
private $logs_repository;
private $log;
/**
* REST_Logs_Controller constructor.
@ -364,5 +363,3 @@ class REST_Logs_Controller extends REST_Controller {
return $schema;
}
}
?>

View File

@ -308,14 +308,17 @@ class REST_Metadata_Controller extends REST_Controller {
$item_arr = $item->_toArray();
$item_arr['metadata_type_object'] = $item->get_metadata_type_object()->_toArray();
if(isset($item_arr['metadata_type_options']) && isset($item_arr['metadata_type_options']['taxonomy_id'])){
if ( isset($request['include_options_as_html']) && $request['include_options_as_html'] == 'yes' )
$item_arr['options_as_html'] = $item->get_metadata_type_object()->get_options_as_html();
if ( isset($item_arr['metadata_type_options']) && isset($item_arr['metadata_type_options']['taxonomy_id']) ) {
$taxonomy = Repositories\Taxonomies::get_instance()->get_db_identifier_by_id( $item_arr['metadata_type_options']['taxonomy_id'] );
//$taxonomy = new Entities\Taxonomy($item_arr['metadata_type_options']['taxonomy_id']);
//$item_arr['metadata_type_options']['taxonomy'] = $taxonomy->get_db_identifier();
$item_arr['metadata_type_options']['taxonomy'] = $taxonomy;
}
if($request['context'] === 'edit'){
if ($request['context'] === 'edit') {
$item_arr['current_user_can_edit'] = $item->can_edit();
$item_arr['current_user_can_delete'] = $item->can_delete();
ob_start();

View File

@ -0,0 +1,866 @@
<?php
namespace Tainacan\API\EndPoints;
use \Tainacan\API\REST_Controller;
use Tainacan\Entities;
use Tainacan\Repositories;
class REST_Reports_Controller extends REST_Controller {
public function __construct() {
$this->rest_base = 'reports';
parent::__construct();
add_action('init', array(&$this, 'init_objects'), 11);
}
public function init_objects() {
$this->items_repository = Repositories\Items::get_instance();
$this->taxonomy_repository = Repositories\Taxonomies::get_instance();
$this->metadatum_repository = Repositories\Metadata::get_instance();
$this->collections_repository = Repositories\Collections::get_instance();
}
/**
*
*
* @throws \Exception
*/
public function register_routes() {
register_rest_route($this->namespace, $this->rest_base . '/collection',
array(
array(
'methods' => \WP_REST_Server::READABLE,
'callback' => array($this, 'get_collections'),
'permission_callback' => array($this, 'reports_permissions_check'),
'args' => [
'force' => [
'title' => __( 'Force regenerate', 'tainacan' ),
'type' => 'string',
'default' => 'no',
'description' => __( 'Force generating the report, despite presence of cache.', 'tainacan' ),
'enum' => array(
'no',
'yes'
)
]
]
),
)
);
register_rest_route($this->namespace, $this->rest_base . '/collection/(?P<collection_id>[\d]+)/summary',
array(
array(
'methods' => \WP_REST_Server::READABLE,
'callback' => array($this, 'get_summary'),
'permission_callback' => array($this, 'reports_permissions_check'),
'args' => [
'force' => [
'title' => __( 'Force regenerate', 'tainacan' ),
'type' => 'string',
'default' => 'no',
'description' => __( 'Force generating the report, despite presence of cache.', 'tainacan' ),
'enum' => array(
'no',
'yes'
)
]
]
),
)
);
register_rest_route($this->namespace, $this->rest_base . '/collection/(?P<collection_id>[\d]+)/metadata',
array(
array(
'methods' => \WP_REST_Server::READABLE,
'callback' => array($this, 'get_stats_collection_metadata'),
'permission_callback' => array($this, 'reports_permissions_check'),
'args' => [
'force' => [
'title' => __( 'Force regenerate', 'tainacan' ),
'type' => 'string',
'default' => 'no',
'description' => __( 'Force generating the report, despite presence of cache.', 'tainacan' ),
'enum' => array(
'no',
'yes'
)
]
]
),
)
);
register_rest_route($this->namespace, $this->rest_base . '/metadata',
array(
array(
'methods' => \WP_REST_Server::READABLE,
'callback' => array($this, 'get_stats_collection_metadata'),
'permission_callback' => array($this, 'reports_permissions_check'),
'args' => [
'force' => [
'title' => __( 'Force regenerate', 'tainacan' ),
'type' => 'string',
'default' => 'no',
'description' => __( 'Force generating the report, despite presence of cache.', 'tainacan' ),
'enum' => array(
'no',
'yes'
)
]
]
),
)
);
register_rest_route($this->namespace, $this->rest_base . '/repository/summary',
array(
array(
'methods' => \WP_REST_Server::READABLE,
'callback' => array($this, 'get_summary'),
'permission_callback' => array($this, 'reports_permissions_check'),
'args' => [
'force' => [
'title' => __( 'Force regenerate', 'tainacan' ),
'type' => 'string',
'default' => 'no',
'description' => __( 'Force generating the report, despite presence of cache.', 'tainacan' ),
'enum' => array(
'no',
'yes'
)
]
]
),
)
);
register_rest_route($this->namespace, $this->rest_base . '/taxonomy',
array(
array(
'methods' => \WP_REST_Server::READABLE,
'callback' => array($this, 'get_taxonomies_list'),
'permission_callback' => array($this, 'reports_permissions_check'),
'args' => [
'force' => [
'title' => __( 'Force regenerate', 'tainacan' ),
'type' => 'string',
'default' => 'no',
'description' => __( 'Force generating the report, despite presence of cache.', 'tainacan' ),
'enum' => array(
'no',
'yes'
)
]
]
),
)
);
register_rest_route($this->namespace, $this->rest_base . '/taxonomy/(?P<taxonomy_id>[\d]+)',
array(
array(
'methods' => \WP_REST_Server::READABLE,
'callback' => array($this, 'get_taxonomy'),
'permission_callback' => array($this, 'reports_permissions_check'),
'args' => [
'force' => [
'title' => __( 'Force regenerate', 'tainacan' ),
'type' => 'string',
'default' => 'no',
'description' => __( 'Force generating the report, despite presence of cache.', 'tainacan' ),
'enum' => array(
'no',
'yes'
)
]
]
),
)
);
register_rest_route($this->namespace, $this->rest_base . '/activities',
array(
array(
'methods' => \WP_REST_Server::READABLE,
'callback' => array($this, 'get_activities'),
'permission_callback' => array($this, 'reports_permissions_check'),
'args' => [
'start' => [
'title' => __( 'start Date', 'tainacan' ),
'type' => 'string',
'format' => 'date-time',
],
'end' => [
'title' => __( 'start Date', 'tainacan' ),
'type' => 'string',
'format' => 'date-time', // RFC3339. https://tools.ietf.org/html/rfc3339#section-5.8
],
'force' => [
'title' => __( 'Force regenerate', 'tainacan' ),
'type' => 'string',
'default' => 'no',
'description' => __( 'Force generating the report, despite presence of cache.', 'tainacan' ),
'enum' => array(
'no',
'yes'
)
]
]
),
)
);
register_rest_route($this->namespace, $this->rest_base . '/collection/(?P<collection_id>[\d]+)/activities',
array(
array(
'methods' => \WP_REST_Server::READABLE,
'callback' => array($this, 'get_activities'),
'permission_callback' => array($this, 'reports_permissions_check'),
'args' => [
'start' => [
'title' => __( 'start Date', 'tainacan' ),
'type' => 'string',
'format' => 'date-time',
],
'end' => [
'title' => __( 'start Date', 'tainacan' ),
'type' => 'string',
'format' => 'date-time', // RFC3339. https://tools.ietf.org/html/rfc3339#section-5.8
],
'force' => [
'title' => __( 'Force regenerate', 'tainacan' ),
'type' => 'string',
'default' => 'no',
'description' => __( 'Force generating the report, despite presence of cache.', 'tainacan' ),
'enum' => array(
'no',
'yes'
)
]
]
),
)
);
register_rest_route($this->namespace, $this->rest_base . '/collection/(?P<collection_id>[\d]+)/metadata/(?P<metadata_id>[\d]+)',
array(
array(
'methods' => \WP_REST_Server::READABLE,
'callback' => array($this, 'get_metadata'),
'permission_callback' => array($this, 'reports_permissions_check'),
'args' => [
'parent' => [
'title' => __( 'parent', 'tainacan' ),
'type' => 'integer',
],
'force' => [
'title' => __( 'Force regenerate', 'tainacan' ),
'type' => 'string',
'default' => 'no',
'description' => __( 'Force generating the report, despite presence of cache.', 'tainacan' ),
'enum' => array(
'no',
'yes'
)
]
]
),
)
);
}
public function reports_permissions_check($request) {
return \is_user_logged_in() && current_user_can('read');
}
public function get_collections($request) {
$response = array(
'list' => []
);
$key_cache_object = 'collections';
$cached_object = $this->get_cache_object($key_cache_object, $request);
if($cached_object !== false ) return new \WP_REST_Response($cached_object, 200);
$collections = $this->collections_repository->fetch([]);
if($collections->have_posts()) {
while ($collections->have_posts()) {
$collections->the_post();
$collection = new Entities\Collection($collections->post);
$total_items = wp_count_posts( $collection->get_db_identifier(), 'readable' );
if (isset($total_items->publish) || isset($total_items->private) ||
isset($total_items->trash) || isset($total_items->draft)) {
$response['list'][$collection->get_db_identifier()] = array(
'id' => $collection->get_id(),
'name' => $collection->get_name(),
'items' => array(
'trash' => intval($total_items->trash),
'draft' => intval($total_items->draft),
'publish' => intval($total_items->publish),
'private' => intval($total_items->private),
'total' => $total_items->trash + $total_items->draft + $total_items->publish + $total_items->private
)
);
}
}
wp_reset_postdata();
}
$this->set_cache_object($key_cache_object, $response);
return new \WP_REST_Response($response, 200);
}
public function get_summary($request) {
$response = array(
'totals'=> array(
'items' => array(
'total' => 0,
'trash' => 0,
'draft' => 0,
'publish' => 0,
'private' => 0,
'restrict' => 0,
'not_restrict' => 0
)
)
);
if(isset($request['collection_id'])) {
$collection_id = $request['collection_id'];
$key_cache_object = 'summary_' . $collection_id;
$cached_object = $this->get_cache_object($key_cache_object, $request);
if($cached_object !== false ) return new \WP_REST_Response($cached_object, 200);
$collection = $this->collections_repository->fetch($collection_id);
$total_items = wp_count_posts( $collection->get_db_identifier(), 'readable' );
if (isset($total_items->publish) ||
isset($total_items->private) ||
isset($total_items->trash) ||
isset($total_items->draft)) {
$response['totals']['items']['trash'] = intval($total_items->trash);
$response['totals']['items']['draft'] = intval($total_items->draft);
$response['totals']['items']['publish'] = intval($total_items->publish);
$response['totals']['items']['private'] = intval($total_items->private);
if ( \is_post_status_viewable( $collection->get_status() ) === true ) {
$response['totals']['items']['not_restrict'] += isset($total_items->publish) ? intval($total_items->publish) : 0;
} else {
$response['totals']['items']['restrict'] += (
//(isset($total_items->trash) ? intval($total_items->trash) : 0) +
(isset($total_items->draft) ? intval($total_items->draft) : 0) +
(isset($total_items->publish) ? intval($total_items->publish) : 0) +
(isset($total_items->private) ? intval($total_items->private) : 0)
);
}
}
} else {
$key_cache_object = 'summary';
$cached_object = $this->get_cache_object($key_cache_object, $request);
if($cached_object !== false ) return new \WP_REST_Response($cached_object, 200);
$collections = $this->collections_repository->fetch(['status'=> ['publish', 'private', 'trash']]);
$response['totals']['collections'] = array(
'total' => 0,
'trash' => 0,
'publish' => 0,
'private' => 0
);
if($collections->have_posts()) {
while ($collections->have_posts()) {
$collections->the_post();
$collection = new Entities\Collection($collections->post);
$response['totals']['collections'][$collection->get_status()]++;
$response['totals']['collections']['total']++;
$total_items = wp_count_posts( $collection->get_db_identifier(), 'readable' );
$response['totals']['items']['trash'] += isset($total_items->trash) ? intval($total_items->trash) : 0;
$response['totals']['items']['draft'] += isset($total_items->draft) ? intval($total_items->draft) : 0;
$response['totals']['items']['publish'] += isset($total_items->publish)? intval($total_items->publish) : 0;
$response['totals']['items']['private'] += isset($total_items->private)? intval($total_items->private) : 0;
if ( \is_post_status_viewable( $collection->get_status() ) === true ) {
$response['totals']['items']['not_restrict'] += isset($total_items->publish) ? intval($total_items->publish) : 0;
} else {
$response['totals']['items']['restrict'] += (
//(isset($total_items->trash) ? intval($total_items->trash) : 0) +
(isset($total_items->draft) ? intval($total_items->draft) : 0) +
(isset($total_items->publish) ? intval($total_items->publish) : 0) +
(isset($total_items->private) ? intval($total_items->private) : 0)
);
}
}
wp_reset_postdata();
}
$response['totals']['taxonomies'] = array(
'total' => 0,
'trash' => 0,
'publish' => 0,
'draft' => 0,
'private' => 0,
'used' => 0,
'not_used'=> 0
);
$total_taxonomies = wp_count_posts( 'tainacan-taxonomy', 'readable' );
$response['totals']['taxonomies']['trash'] = isset($total_taxonomies->trash) ? intval($total_taxonomies->trash) : 0;
$response['totals']['taxonomies']['draft'] = isset($total_taxonomies->draft) ? intval($total_taxonomies->draft) : 0;
$response['totals']['taxonomies']['publish'] = isset($total_taxonomies->publish)? intval($total_taxonomies->publish) : 0;
$response['totals']['taxonomies']['private'] = isset($total_taxonomies->private)? intval($total_taxonomies->private) : 0;
$response['totals']['taxonomies']['total'] = $response['totals']['taxonomies']['trash'] + $response['totals']['taxonomies']['publish'] + $response['totals']['taxonomies']['draft'] + $response['totals']['taxonomies']['private'];
$response['totals']['taxonomies']['used'] = $this->query_count_used_taxononomies();
$response['totals']['taxonomies']['not_used'] = $response['totals']['taxonomies']['total'] - $response['totals']['taxonomies']['used'];
}
$response['totals']['items']['total'] = ($response['totals']['items']['trash'] + $response['totals']['items']['draft'] + $response['totals']['items']['publish'] + $response['totals']['items']['private']);
$this->set_cache_object($key_cache_object, $response);
return new \WP_REST_Response($response, 200);
}
public function get_taxonomies_list($request) {
$response = array(
'list'=> array(
)
);
$key_cache_object = 'taxonomies_list';
$cached_object = $this->get_cache_object($key_cache_object, $request);
if($cached_object !== false ) return new \WP_REST_Response($cached_object, 200);
$taxonomies = $this->taxonomy_repository->fetch();
if($taxonomies->have_posts()){
while ($taxonomies->have_posts()){
$taxonomies->the_post();
$taxonomy = new Entities\Taxonomy($taxonomies->post);
$total_terms = intval(wp_count_terms( $taxonomy->get_db_identifier(), array('hide_empty'=> false) ));
$total_terms_used = intval(wp_count_terms( $taxonomy->get_db_identifier(), array('hide_empty'=> true) ));
$total_terms_not_used = $total_terms - $total_terms_used;
$response['list'][$taxonomy->get_db_identifier()] = array(
'id' => $taxonomy->get_id(),
'name' => $taxonomy->get_name(),
'total_terms' => $total_terms,
'total_terms_used' => $total_terms_used,
'total_terms_not_used' => $total_terms_not_used
);
}
wp_reset_postdata();
}
$this->set_cache_object($key_cache_object, $response);
return new \WP_REST_Response($response, 200);
}
public function get_taxonomy($request) {
$response = array(
'terms'=> array()
);
$taxonomy_id = $request['taxonomy_id'];
$taxonomy = $this->taxonomy_repository->fetch($taxonomy_id);
$taxonomy_identifier = $taxonomy->get_db_identifier();
$taxonomy_total_terms = wp_count_terms($taxonomy_identifier, array('hide_empty' => false) );
$limit = 100;
$offset = 0;
if ( !$taxonomy_total_terms) {
$taxonomy_total_terms = 0;
} else {
$key_cache_object = 'taxonomy_' . $taxonomy_identifier;
$cached_object = $this->get_cache_object($key_cache_object, $request);
if($cached_object !== false ) return new \WP_REST_Response($cached_object, 200);
}
while($offset < $taxonomy_total_terms) {
$terms = get_terms( array(
'taxonomy' => $taxonomy->get_db_identifier(),
'number' => $limit,
'offset' => $offset,
'hide_empty' => false,
) );
foreach ($terms as $term) {
$response['terms'][$term->term_id] = array(
'id' => $term->term_id,
'name' => $term->name,
'count' => $term->count
);
}
$offset+=$limit;
}
$this->set_cache_object($key_cache_object, $response);
return new \WP_REST_Response($response, 200);
}
public function get_metadata($request) {
$response = array(
'list' => array()
);
$collection_id = $request['collection_id'];
$taxonomy_metadata_id = $request['metadata_id'];;
$parent_id = 0;
if ( isset($request['parent']) ) {
$parent_id = (int) $request['parent'];
}
$key_cache_object = "facet_taxonomy_$taxonomy_metadata_id-$collection_id-$parent_id";
$cached_object = $this->get_cache_object($key_cache_object, $request);
if($cached_object !== false ) return new \WP_REST_Response($cached_object, 200);
$metadatum = $this->metadatum_repository->fetch($taxonomy_metadata_id);
$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'),
'metadatum_type' => $metadatum_type
], 400);
}
$args = [
'collection_id' => $collection_id,
'parent_id' => $parent_id,
'count_items'=> true,
];
$data = $this->metadatum_repository->fetch_all_metadatum_values($taxonomy_metadata_id, $args);
$response['list'] = array_map(function($item) {
return [
'type' => $item['type'],
'value' => $item['value'],
'label' => $item['label'],
'parent' => $item['parent'] == null ? 0 : $item['parent'],
'total_items' => intval($item['total_items']),
'total_children' => intval($item['total_children']),
];
}, $data['values']);
$this->set_cache_object($key_cache_object, $response);
return new \WP_REST_Response($response, 200);
}
public function get_stats_collection_metadata($request) {
$response = array(
'totals'=> array(
'metadata' => array(
'total' => 0,
'publish' => 0,
'private' => 0
),
'metadata_per_type' => array()
),
'distribution' => array(
)
);
if(isset($request['collection_id'])) {
$collection_id = $request['collection_id'];
$key_cache_object = 'stats_collection_metadata_' . $collection_id;
$cached_object = $this->get_cache_object($key_cache_object, $request);
if($cached_object !== false ) return new \WP_REST_Response($cached_object, 200);
$collection = new Entities\Collection( $collection_id );
$result_metadatum = $this->metadatum_repository->fetch_by_collection( $collection, [] );
$response['totals']['metadata']['total'] = count($result_metadatum);
$meta_ids=[];
foreach($result_metadatum as $metadatum) {
$meta_type = explode('\\', $metadatum->get_metadata_type()) ;
$meta_type = strtolower($meta_type[sizeof($meta_type)-1]);
$meta_type_name = $metadatum->get_metadata_type_object()->get_name();
if( in_array($meta_type, ['core_description','core_title']) ) {
$meta_type = 'text';
$meta_type_name = (new \Tainacan\Metadata_Types\Text())->get_name();
}
$response['totals']['metadata'][$metadatum->get_status()]++;
if ( !isset($response['totals']['metadata_per_type'][$meta_type]) ) {
$response['totals']['metadata_per_type'][$meta_type] = array(
'name' => $meta_type_name,
'count' => 0,
);
}
$response['totals']['metadata_per_type'][$meta_type]['count']++;
if ( $metadatum->get_metadata_type() == 'Tainacan\Metadata_Types\Compound' ) {
$metadatum_childs = $this->metadatum_repository->fetch(['parent' => $metadatum->get_id()], 'OBJECT');
foreach($metadatum_childs as $childs) {
$meta_ids[] = $childs->get_id();
}
} else {
$meta_ids[] = $metadatum->get_id();
}
}
$response['distribution'] = $this->query_item_metadata_distribution($meta_ids, $collection->get_db_identifier());
//wp_count_posts()
} else {
$args = [
'meta_query' => [
[
'key' => 'collection_id',
'value' => 'default',
'compare' => '='
]
]
];
$key_cache_object = 'stats_collection_metadata';
$cached_object = $this->get_cache_object($key_cache_object, $request);
if($cached_object !== false ) return new \WP_REST_Response($cached_object, 200);
$result_metadatum = $this->metadatum_repository->fetch( $args, 'OBJECT' );
$meta_ids=[];
foreach($result_metadatum as $metadatum) {
$meta_type = explode('\\', $metadatum->get_metadata_type()) ;
$meta_type = strtolower($meta_type[sizeof($meta_type)-1]);
$meta_type_name = $metadatum->get_metadata_type_object()->get_name();
if( in_array($meta_type, ['core_description','core_title']) ) {
$meta_type = 'text';
$meta_type_name = (new \Tainacan\Metadata_Types\Text())->get_name();
}
$response['totals']['metadata'][$metadatum->get_status()]++;
$response['totals']['metadata_per_type'][$meta_type]['name'] = $meta_type_name;
$response['totals']['metadata_per_type'][$meta_type]['count']++;
$meta_ids[] = $metadatum->get_id();
}
$response['distribution'] = $this->query_item_metadata_distribution($meta_ids, 'default');
}
$this->set_cache_object($key_cache_object, $response);
return new \WP_REST_Response($response, 200);
}
private function query_item_metadata_distribution($meta_ids, $collection_post_type) {
$count_posts = wp_count_posts( $collection_post_type, 'readable' );
$total_items = intval($count_posts->trash) + intval($count_posts->draft) +
intval($count_posts->publish) + intval($count_posts->private);
global $wpdb;
$string_meta_ids = "'".implode("','", $meta_ids)."'";
$sql_statement = $wpdb->prepare(
"SELECT p.post_title AS 'name', pp.post_title AS 'parent_name', p.id AS id, IFNULL(((m.total/$total_items) * 100), 0) as fill_percentage
FROM
$wpdb->posts p
LEFT JOIN $wpdb->posts pp ON (p.post_parent = pp.id)
LEFT JOIN
(
SELECT meta_key, count(DISTINCT post_id) AS total
FROM $wpdb->postmeta
WHERE $wpdb->postmeta.meta_key IN ($string_meta_ids)
AND $wpdb->postmeta.post_id IN (
SELECT id
FROM $wpdb->posts
WHERE $wpdb->posts.post_type = '$collection_post_type'
)
GROUP BY $wpdb->postmeta.meta_key
UNION
SELECT mt.meta_key, count(DISTINCT tr.object_id) AS total
FROM $wpdb->term_taxonomy tt
INNER JOIN $wpdb->term_relationships tr ON tt.term_taxonomy_id = tr.term_taxonomy_id
INNER JOIN (
SELECT post_id as 'meta_key', concat('tnc_tax_', meta_value) as 'tax_id'
FROM $wpdb->postmeta
WHERE meta_key='_option_taxonomy_id'
) mt ON tt.taxonomy = mt.tax_id
WHERE mt.meta_key IN ($string_meta_ids)
AND tr.object_id IN (
SELECT id
FROM $wpdb->posts
WHERE $wpdb->posts.post_type = '$collection_post_type'
)
GROUP BY mt.meta_key
) m
ON (p.id = m.meta_key)
WHERE p.id IN($string_meta_ids)
", []
);
$res = $wpdb->get_results($sql_statement);
//return ['t' => $res, 's' => $sql_statement];
return $res;
}
private function query_count_used_taxononomies() {
global $wpdb;
$sql_statement = $wpdb->prepare(
"SELECT COUNT(DISTINCT($wpdb->postmeta.meta_value))
FROM $wpdb->postmeta
WHERE meta_key = '_option_taxonomy_id'
", []
);
$res = intval($wpdb->get_var( $sql_statement ));
return $res;
}
public function get_activities($request) {
$response = array(
'totals' => []
);
$collection_id = false;
if(isset($request['collection_id'])) {
$collection_id = $request['collection_id'];
}
if( isset($request['start']) ) {
$start = new \DateTime($request['start']);
$key_cache_object = 'activities_' . $start->format('Y-m-d') . '_' . $collection_id;
$cached_object = $this->get_cache_object($key_cache_object, $request);
if($cached_object !== false ) return new \WP_REST_Response($cached_object, 200);
$end_limit = $start->add(new \DateInterval('P1Y1D'))->setTime(0,0,0);
$end = isset($request['end']) ? new \DateTime($request['end']) : $end_limit;
if($end > $end_limit)
$end = $end_limit;
$interval = [
'start' => (new \DateTime($request['start']))->format('Y-m-d H:i:s'),
'end' => $end->format('Y-m-d H:i:s')
];
} else {
$key_cache_object = 'activities_' . $collection_id;
$cached_object = $this->get_cache_object($key_cache_object, $request);
if($cached_object !== false ) return new \WP_REST_Response($cached_object, 200);
$end = (new \DateTime())->add(new \DateInterval('P1D'))->setTime(0,0,0);
$interval = [
'end' => $end->format('Y-m-d H:i:s'),
'start' => $end->sub(new \DateInterval('P1Y1D'))->format('Y-m-d H:i:s')
];
}
$response['totals'] = array(
'by_interval' => array(
'start' => $interval['start'],
'end' => $interval['end'],
'general' => $this->get_activities_general($collection_id, $interval),
'by_user' => $this->get_activities_general_by_user($collection_id, $interval)
),
'by_user' => $this->get_activities_users($collection_id)
);
$this->set_cache_object($key_cache_object, $response);
return new \WP_REST_Response($response, 200);
}
private function get_activities_general($collection_id = false, $interval) {
global $wpdb;
$collection_from = "";
$start = $interval['start'];
$end = $interval['end'];
if($collection_id !== false) {
$collection_from = "INNER JOIN $wpdb->postmeta pm ON p.id = pm.post_id AND (pm.meta_key='collection_id' AND pm.meta_value='$collection_id')";
}
$sql_statement = $wpdb->prepare(
"SELECT count(DISTINCT (unix_timestamp(p.post_date) DIV 60)) as total, DATE(p.post_date) as date
FROM $wpdb->posts p $collection_from
WHERE p.post_type='tainacan-log' AND p.post_date BETWEEN '$start' AND '$end'
GROUP BY DATE(p.post_date)
ORDER BY DATE(p.post_date)", []
);
return $wpdb->get_results($sql_statement);
}
private function get_activities_general_by_user($collection_id = false, $interval) {
global $wpdb;
$collection_from = "";
$start = $interval['start'];
$end = $interval['end'];
if($collection_id !== false) {
$collection_from = "INNER JOIN $wpdb->postmeta pm ON p.id = pm.post_id AND (pm.meta_key='collection_id' AND pm.meta_value='$collection_id')";
}
$sql_statement = $wpdb->prepare(
"SELECT p.post_author as user_id, count(DISTINCT (unix_timestamp(p.post_date) DIV 60)) as total, DATE(p.post_date) as date
FROM $wpdb->posts p $collection_from
WHERE p.post_type='tainacan-log' AND p.post_date BETWEEN '$start' AND '$end'
GROUP BY p.post_author, DATE(p.post_date)
ORDER BY DATE(p.post_date)", []
);
$data =$wpdb->get_results($sql_statement);
$arr = array();
$avatar_sizes = rest_get_avatar_sizes();
foreach ($data as $item) {
if(!isset($arr[$item->user_id])) {
$user_data = get_userdata($item->user_id);
$urls = array();
foreach ( $avatar_sizes as $size ) {
$urls[ $size ] = get_avatar_url( $user_data, array( 'size' => $size ) );
}
$arr[$item->user_id] = [
'user' => !$user_data ? [] : [
'id' => $user_data->ID,
'username' => $user_data->user_login,
'name' => $user_data->display_name,
'first_name' => $user_data->first_name,
'last_name' => $user_data->last_name,
'email' => $user_data->user_email,
'avatar_urls' => $urls,
],
'user_id' => $item->user_id,
'total' => 0,
'by_date' => []
];
}
$arr[$item->user_id]['by_date'][] = $item;
$arr[$item->user_id]['total'] += $item->total;
}
return array_values($arr);
}
private function get_activities_users($collection_id = false) {
global $wpdb;
$collection_from = "";
if($collection_id !== false) {
$collection_from = "INNER JOIN $wpdb->postmeta pm_col ON p.id = pm_col.post_id AND (pm_col.meta_key='collection_id' AND pm_col.meta_value='$collection_id')";
}
$sql_statement = $wpdb->prepare(
"SELECT count(DISTINCT (unix_timestamp(p.post_date) DIV 60)) as total, p.post_author as user, pm.meta_value as action
FROM $wpdb->posts p
INNER JOIN $wpdb->postmeta pm ON p.id = pm.post_id AND pm.meta_key = 'action'
$collection_from
WHERE p.post_type='tainacan-log'
GROUP BY p.post_author, pm.meta_value
ORDER BY total DESC", []
);
$results = $wpdb->get_results($sql_statement);
$response = [];
$avatar_sizes = rest_get_avatar_sizes();
foreach($results as $key => $result) {
$user = $result->user;
$total = $result->total;
$action = $result->action;
if(!isset($response[$user])) {
$user_data = get_userdata($user);
$urls = array();
foreach ( $avatar_sizes as $size ) {
$urls[ $size ] = get_avatar_url( $user_data, array( 'size' => $size ) );
}
$response[$user] = [
'user' => !$user_data ? [] : [
'id' => $user_data->ID,
'username' => $user_data->user_login,
'name' => $user_data->display_name,
'first_name' => $user_data->first_name,
'last_name' => $user_data->last_name,
'email' => $user_data->user_email,
'avatar_urls' => $urls,
],
'user_id' => $user,
'total' => 0,
'by_action' => []
];
}
$response[$user]['by_action'][$action] = intval($total);
$response[$user]['total'] += $total;
}
return array_values($response);
}
private $prefix_transient_cahce = 'reports_tnc_';
private function get_cache_object($key, $request) {
if ( !isset($request['force']) || $request['force'] == 'no' ) {
$transient = get_transient($this->prefix_transient_cahce . $key);
return $transient;
}
return false;
}
private function set_cache_object($key, $data) {
$expiration = 604800; //one week
$data['report_cached_on'] = (new \DateTime())->format('Y-m-d H:i:s');
return set_transient($this->prefix_transient_cahce . $key, $data, $expiration);
}
}
?>

View File

@ -2,27 +2,28 @@
const TAINACAN_REST_NAMESPACE = 'tainacan/v2';
//$rest_controller = new \Tainacan\API\REST_Controller();
$rest_collections_controller = new \Tainacan\API\EndPoints\REST_Collections_Controller();
$rest_items_controller = new \Tainacan\API\EndPoints\REST_Items_Controller();
$rest_metadata_controller = new \Tainacan\API\EndPoints\REST_Metadata_Controller();
$rest_taxonomies_controller = new \Tainacan\API\EndPoints\REST_Taxonomies_Controller();
$rest_terms_controller = new \Tainacan\API\EndPoints\REST_Terms_Controller();
$rest_filters_controller = new \Tainacan\API\EndPoints\REST_Filters_Controller();
$rest_item_metadata_controller = new \Tainacan\API\EndPoints\REST_Item_Metadata_Controller();
$rest_logs_controller = new \Tainacan\API\EndPoints\REST_Logs_Controller();
$rest_metadata_types_controller = new \Tainacan\API\EndPoints\REST_Metadata_Types_Controller();
$rest_filter_types_controller = new \Tainacan\API\EndPoints\REST_Filter_Types_Controller();
$rest_importers_controller = new \Tainacan\API\EndPoints\REST_Importers_Controller();
$rest_exporters_controller = new \Tainacan\API\EndPoints\REST_Exporters_Controller();
$rest_background_processes_controller = new \Tainacan\API\EndPoints\REST_Background_Processes_Controller();
$rest_bulkedit_controller = new \Tainacan\API\EndPoints\REST_Bulkedit_Controller();
$rest_exposers_controller = new \Tainacan\API\EndPoints\REST_Exposers_Controller();
$rest_roles_controller = new \Tainacan\API\EndPoints\REST_Roles_Controller();
new \Tainacan\API\EndPoints\REST_Metadatum_Mappers_Controller();
$rest_facets_controller = new \Tainacan\API\EndPoints\REST_Facets_Controller();
$rest_oaipmh_expose_controller = new \Tainacan\API\EndPoints\REST_Oaipmh_Expose_Controller();
$rest_sequence_edit_controller = new \Tainacan\API\EndPoints\REST_Sequence_Edit_Controller();
//$rest_controller = new \Tainacan\API\REST_Controller();
$rest_items_controller = new \Tainacan\API\EndPoints\REST_Items_Controller();
$rest_terms_controller = new \Tainacan\API\EndPoints\REST_Terms_Controller();
$rest_logs_controller = new \Tainacan\API\EndPoints\REST_Logs_Controller();
$rest_roles_controller = new \Tainacan\API\EndPoints\REST_Roles_Controller();
$rest_facets_controller = new \Tainacan\API\EndPoints\REST_Facets_Controller();
$rest_reports_controller = new \Tainacan\API\EndPoints\REST_Reports_Controller();
$rest_filters_controller = new \Tainacan\API\EndPoints\REST_Filters_Controller();
$rest_exposers_controller = new \Tainacan\API\EndPoints\REST_Exposers_Controller();
$rest_bulkedit_controller = new \Tainacan\API\EndPoints\REST_Bulkedit_Controller();
$rest_metadata_controller = new \Tainacan\API\EndPoints\REST_Metadata_Controller();
$rest_importers_controller = new \Tainacan\API\EndPoints\REST_Importers_Controller();
$rest_exporters_controller = new \Tainacan\API\EndPoints\REST_Exporters_Controller();
$rest_taxonomies_controller = new \Tainacan\API\EndPoints\REST_Taxonomies_Controller();
$rest_collections_controller = new \Tainacan\API\EndPoints\REST_Collections_Controller();
$rest_filter_types_controller = new \Tainacan\API\EndPoints\REST_Filter_Types_Controller();
$rest_oaipmh_expose_controller = new \Tainacan\API\EndPoints\REST_Oaipmh_Expose_Controller();
$rest_item_metadata_controller = new \Tainacan\API\EndPoints\REST_Item_Metadata_Controller();
$rest_sequence_edit_controller = new \Tainacan\API\EndPoints\REST_Sequence_Edit_Controller();
$rest_metadata_types_controller = new \Tainacan\API\EndPoints\REST_Metadata_Types_Controller();
$rest_metadatum_mappers_controller = new \Tainacan\API\EndPoints\REST_Metadatum_Mappers_Controller();
$rest_background_processes_controller = new \Tainacan\API\EndPoints\REST_Background_Processes_Controller();
// Add here other endpoints imports
?>

View File

@ -191,6 +191,9 @@ abstract class Background_Process extends \Tainacan_WP_Background_Process {
if ($status == 'finished') {
$params['progress_label'] = __('Process completed','tainacan');
$params['progress_value'] = 100;
} else if ($status == 'finished-errors') {
$params['progress_label'] = __('Process completed with errors','tainacan');
$params['progress_value'] = 100;
}
$wpdb->update(
$this->table,
@ -279,16 +282,14 @@ abstract class Background_Process extends \Tainacan_WP_Background_Process {
*/
protected function handle() {
$this->lock_process();
// while we are debugging performance
$newRequest = true;
$batch = $this->get_batch();
if ($newRequest) {
$this->write_log($batch->key, ['New Request']);
$newRequest = false;
if($this->process_lock_in_time != get_site_transient( $this->identifier . '_process_lock' )) {
$this->write_log($batch->key, [['datetime' => date("Y-m-d H:i:s"), 'message' => 'New request has ignored']]);
wp_die();
}
$this->write_log($batch->key, [['datetime' => date("Y-m-d H:i:s"), 'message' => 'New Request']]);
register_shutdown_function(function() use($batch) {
$error = error_get_last();
@ -308,8 +309,8 @@ abstract class Background_Process extends \Tainacan_WP_Background_Process {
$this->debug('Shutdown with Fatal error captured');
$this->debug($error_str);
$this->write_error_log($batch->key, ['Fatal Error: ' . $error_str]);
$this->write_error_log($batch->key, ['Process aborted']);
$this->write_error_log($batch->key, [['datetime' => date("Y-m-d H:i:s"), 'message' => 'Fatal Error: ' . $error_str]] );
$this->write_error_log($batch->key, [['datetime' => date("Y-m-d H:i:s"), 'message' => 'Process aborted']]);
$this->close( $batch->key, 'errored' );
$this->debug('Batch closed due to captured error');
$this->unlock_process();
@ -323,8 +324,8 @@ abstract class Background_Process extends \Tainacan_WP_Background_Process {
$task = $this->task( $task );
} catch (\Exception $e) {
// TODO: Add Stacktrace
$this->write_error_log($batch->key, ['Fatal Error: ' . $e->getMessage()]);
$this->write_error_log($batch->key, ['Process aborted']);
$this->write_error_log($batch->key, [['datetime' => date("Y-m-d H:i:s"), 'message' => 'Fatal Error: ' . $e->getMessage()]]);
$this->write_error_log($batch->key, [['datetime' => date("Y-m-d H:i:s"), 'message' => 'Process aborted']]);
$task = false;
$close_status = 'errored';
}
@ -352,7 +353,7 @@ abstract class Background_Process extends \Tainacan_WP_Background_Process {
} else {
$this->debug('Complete');
$this->complete();
$this->write_log($batch->key, ['Process Finished']);
$this->write_log($batch->key, [['datetime' => date("Y-m-d H:i:s"), 'message' => 'Process Finished']] );
}
$this->debug('dying');
@ -436,18 +437,21 @@ abstract class Background_Process extends \Tainacan_WP_Background_Process {
private function recursive_stingify_log_array(array $log, $break = true) {
$return = '';
foreach ($log as $k => $l) {
$l_datetime = $l['datetime'];
$l_message = $l['message'];
$return .= "[$l_datetime] ";
if (!is_numeric($k)) {
$return .= $k . ': ';
}
if (is_array($l)) {
//$return .= $this->recursive_stingify_log_array($l, false);
$return .= print_r($l, true);
} elseif (is_string($l)) {
$return .= $l;
if (is_array($l_message)) {
//$return .= $this->recursive_stingify_log_array($l_message, false);
$return .= print_r($l_message, true);
} elseif (is_string($l_message)) {
$return .= $l_message;
}
$return .="\n";
//$return .= $break ? "\n" : ', ';
}
return $return;

View File

@ -83,10 +83,10 @@ class Elastic_Press {
return $formatted_args;
} );
// add_action('ep_add_query_log', function($query) { //using to DEBUG
//add_action('ep_add_query_log', function($query) { //using to DEBUG
// error_log("DEGUG:");
// error_log($query["args"]["body"]);
// });
//});
}
function elasticpress_config_mapping( $mapping ) {
@ -517,7 +517,7 @@ class Elastic_Press {
if (!empty($filter['include'])) {
$custom_filter_include = $custom_filter;
$custom_filter_include['bool']['must'][] = ["bool" => [ "must"=> [ [ "terms" => ["$field.term_id" => $filter['include'] ] ] ] ] ];
$terms_id_inlcude = \implode( "|", $filter['include']);
$terms_id_include = \implode( "|", $filter['include']);
$aggs[$id.'.include'] = [
"filter" => $custom_filter_include,
"aggs" => array(
@ -525,14 +525,14 @@ class Elastic_Press {
"terms"=>array(
"order" => ["_key" => "asc" ],
"field" => "$field.term_name.id",
"include" => "(.)*.($terms_id_inlcude).parent=$parent",
"include" => "(.)*.($terms_id_include).parent=$parent",
"min_doc_count" => 0
)
// "terms"=>array(
// "script" => [
// "lang" => "painless",
// "source" => "def c= ['']; for (int i = 0; i < doc['$field.term_id'].length; ++i) { if( [$terms_id_inlcude].contains(doc['$field.term_id'][i]) ) { c.add(doc['$field.term_name.id'][i]); } } return c;"
// //"source"=> "def c= ['']; if(!params._source.terms.empty && params._source.$field != null) { for(term in params._source.$field) { if( [$terms_id_inlcude].contains(term.term_id) ) { c.add(term.term_id); }}} return c;"
// "source" => "def c= ['']; for (int i = 0; i < doc['$field.term_id'].length; ++i) { if( [$terms_id_include].contains(doc['$field.term_id'][i]) ) { c.add(doc['$field.term_name.id'][i]); } } return c;"
// //"source"=> "def c= ['']; if(!params._source.terms.empty && params._source.$field != null) { for(term in params._source.$field) { if( [$terms_id_include].contains(term.term_id) ) { c.add(term.term_id); }}} return c;"
// ]
// )
)
@ -565,7 +565,7 @@ class Elastic_Press {
"terms"=>array(
"script" => [
"lang" => "painless",
"source"=> "def c= ['']; if(!params._source.meta.empty && params._source.$meta_label != null) { for(meta in params._source.$meta_label) { if([$meta_id_inlcude].contains(meta.raw)) { c.add(meta.raw); }}} return c;"
"source"=> "def c= []; if(!params._source.meta.empty && params._source.$meta_label != null) { for(meta in params._source.$meta_label) { if([$meta_id_inlcude].contains(meta.raw)) { c.add(meta.raw); }}} return c;"
]
//"field"=> $filter['field']
)
@ -632,6 +632,9 @@ class Elastic_Press {
$field = $filter['field'];
if ($filter['metadata_type'] == 'Tainacan\Metadata_Types\Taxonomy') {
$parent = $filter['parent'];
$source = !empty($search) ?
"if ( doc.containsKey('$field.term_name.id') ) {List l = new ArrayList(doc['$field.term_name.id']); return l;} return[];" :
"if ( doc.containsKey('$field.term_name.id') ) {List l = new ArrayList(doc['$field.term_name.id']); l.removeIf(item->!item.endsWith('.parent=$parent')); return l;} return[];" ;
$aggs[$id] = [
"composite" => array(
"size" => $filter['pagesize'],
@ -641,7 +644,8 @@ class Elastic_Press {
"order" => "asc",
"script" => [
"lang" => "painless",
"source" => "if ( doc.containsKey('$field.term_name.id') ) {List l = new ArrayList(doc['$field.term_name.id']); l.removeIf(item->!item.endsWith('.parent=$parent')); return l;} return[];"
"source" => $source
//"source" => "if ( doc.containsKey('$field.term_name.id') ) {List l = new ArrayList(doc['$field.term_name.id']); l.removeIf(item->!item.endsWith('.parent=$parent')); return l;} return[];"
//"source" => "for (int i = 0; i < doc['$field.parent'].length; ++i) { if (doc['$field.parent'][i] == $parent) { return doc['$field.term_name.id'][i]; }}",
//"source" => "for (int i = 0; i < doc['$field.parent'].length; ++i) { if (doc['$field.parent'][i] == $parent) { return doc['$field.term_id'][i]; }}",
//"source" => "def c= ['']; if(!params._source.terms.empty && params._source.$field != null) { for(term in params._source.$field) { if(term.parent==$parent) { c.add(term.term_id); }}} return c;"
@ -764,7 +768,11 @@ class Elastic_Press {
$metadatadum = \Tainacan\Repositories\Metadata::get_instance()->fetch($metada_id);
if ( isset($metadatadum->get_metadata_type_options()['collection_id'])) {
$item = \Tainacan\Repositories\Items::get_instance()->fetch(intval($term['key']));
$label = $item->get_title();
if( $item instanceof Entities\Item) {
$label = $item->get_title();
} else {
continue;
}
}
}
$fct = [
@ -855,7 +863,11 @@ class Elastic_Press {
$metadatadum = \Tainacan\Repositories\Metadata::get_instance()->fetch($metada_id);
if ( isset($metadatadum->get_metadata_type_options()['collection_id'])) {
$item = \Tainacan\Repositories\Items::get_instance()->fetch($term['key'][$key]);
$label = $item->get_title();
if( $item instanceof Entities\Item) {
$label = $item->get_title();
} else {
continue;
}
}
}

View File

@ -12,6 +12,19 @@ class Embed {
return self::$instance;
}
private static $aspect_ratios = array(
// Common video resolutions.
array("ratio" => '2.33', "className" => 'tainacan-embed-aspect-21-9'),
array("ratio" => '2.00', "className" => 'tainacan-embed-aspect-18-9'),
array("ratio" => '1.78', "className" => 'tainacan-embed-aspect-16-9'),
array("ratio" => '1.33', "className" => 'tainacan-embed-aspect-4-3'),
// Vertical video and instagram square video support.
array("ratio" => '1.00', "className" => 'tainacan-embed-aspect-1-1' ),
array("ratio" => '0.75', "className" => 'tainacan-embed-aspect-3-4'),
array("ratio" => '0.56', "className" => 'tainacan-embed-aspect-9-16'),
array("ratio" => '0.50', "className" => 'tainacan-embed-aspect-1-2' )
);
protected function __construct() {
@ -24,7 +37,7 @@ class Embed {
/**
* Add responsiveness to embeds
*/
add_filter('embed_oembed_html', [$this, 'responsive_embed'], 10, 3);
add_filter( 'embed_oembed_html', [$this, 'responsive_embed'], 10, 3);
add_action( 'admin_enqueue_scripts', array( &$this, 'add_css' ) );
add_action( 'wp_enqueue_scripts', array( &$this, 'add_css' ) );
@ -74,7 +87,7 @@ class Embed {
);
$args = array_merge($attr, $defaults);
$dimensions = '';
if ( ! empty( $args['width'] ) && ! empty( $args['height'] ) ) {
$dimensions .= sprintf( "width='%s' ", $args['width'] );
@ -109,7 +122,6 @@ class Embed {
}
/**
* Responsiveness
*/
@ -117,6 +129,69 @@ class Embed {
global $TAINACAN_BASE_URL;
wp_enqueue_style( 'tainacan-embeds', $TAINACAN_BASE_URL . '/assets/css/tainacan-embeds.css', [], TAINACAN_VERSION );
}
/**
* Get responsive class based on aspect ratio
* This code is heavily inspired by Gutenberg plugin's "getClassNames" function.
* Check their source code for more details: /packages/block-library/src/embed/util.js
*
* @param {string} html The preview HTML that possibly contains an iframe with width and height set.
* @param {string} existingClassNames Any existing class names.
* @return {string} Deduped class names.
*/
public function add_responsive_wrapper( $html, $existingClassNames = '' ) {
$height = false;
$width = false;
$dom = new \DOMDocument();
$dom->loadHTML($html);
// If we have a fixed aspect iframe, and it's a responsive embed content.
if ($dom) {
$externalContentElement = $dom->getElementsByTagName('iframe');
if (!$externalContentElement)
$externalContentElement = $dom->getElementsByTagName('embed');
if (!$externalContentElement)
$externalContentElement = $dom->getElementsByTagName('object');
if ($externalContentElement) {
foreach($externalContentElement as $element) {
foreach($element->attributes as $attribute) {
if ($attribute->nodeName == 'width')
$width = $attribute->nodeValue;
if ($attribute->nodeName == 'height')
$height = $attribute->nodeValue;
if ($attribute->nodeName == 'class' && $attribute->nodeValue == 'wp-embedded-content') {
$height = false;
$width = false;
break;
}
}
}
}
if ( $height && $width ) {
$aspect_ratio = number_format(( $width / $height ), 2, '.', "");
// Given the actual aspect ratio, find the widest ratio to support it.
for ($ratioIndex = 0; $ratioIndex < count(self::$aspect_ratios); $ratioIndex++) {
$potentialRatio = self::$aspect_ratios[ $ratioIndex ];
if ( $aspect_ratio >= $potentialRatio['ratio'] ) {
$class = $potentialRatio['className'] . ' tainacan-content-embed tainacan-has-aspect-ratio';
return '<figure class="' . $class . '"><div class="tainacan-content-embed__wrapper">' . $html . '</div></figure>';
}
}
}
}
return $html;
}
/**
* Adds a responsive embed wrapper around oEmbed content
* @param string $html The oEmbed markup
@ -126,12 +201,9 @@ class Embed {
*/
function responsive_embed($html, $url, $attr) {
$class = 'tainacan-embed-container';
$element = $this->add_responsive_wrapper($html);
if ( !preg_match('/(?:<iframe[^>]*)(?:(?:\/>)|(?:>.*?<\/iframe>))/i', $html ) && !preg_match('/(?:<object[^>]*)(?:(?:\/>)|(?:>.*?<\/object>))/i', $html) && !preg_match('/(?:<embed[^>]*)(?:(?:\/>)|(?:>.*?<\/embed>))/i', $html ) )
$class .= ' tainacan-embed-without-iframe';
return $html !== '' ? '<div class="' . $class . '">'.$html.'</div>' : '';
return $element;
}
}

View File

@ -21,8 +21,6 @@ class Media {
protected function __construct() {
add_action( 'init', [$this, 'add_attachment_page_rewrite_rule'] );
add_action( 'admin_enqueue_scripts', array( &$this, 'add_css' ) );
add_action( 'wp_enqueue_scripts', array( &$this, 'add_css' ) );
add_filter( 'query_vars', [$this, 'attachment_page_add_var'] );
add_action( 'template_redirect', [$this, 'attachment_page'] );
@ -105,7 +103,6 @@ class Media {
* @return string the file path
*/
public function save_remote_file($url) {
set_time_limit(0);
$filename = tempnam(sys_get_temp_dir(), basename($url));
@ -136,7 +133,7 @@ class Media {
# Assign a callback function to the CURL Write-Function
curl_setopt($ch, CURLOPT_WRITEFUNCTION, $callback);
# Exceute the download - note we DO NOT put the result into a variable!
# Execute the download - note we DO NOT put the result into a variable!
curl_exec($ch);
if (curl_errno($ch)) {
$error_msg = curl_error($ch);
@ -367,6 +364,7 @@ class Media {
$output .= $img;
} else {
$this->add_css();
wp_print_styles('tainacan-media-page');
global $wp_embed;

View File

@ -31,7 +31,6 @@ class Item_Metadata_Entity extends Entity {
* @param int $meta_id ID for a specific meta row
*/
function __construct(Item $item = null, Metadatum $metadatum = null, $meta_id = null, $parent_meta_id = null) {
$this->set_item($item);
$this->set_metadatum($metadatum);
@ -136,17 +135,15 @@ class Item_Metadata_Entity extends Entity {
* Get the value as a HTML string, with markup and links
* @return string
*/
public function get_value_as_html(){
public function get_value_as_html() {
$metadatum = $this->get_metadatum();
if (is_object($metadatum)) {
$fto = $metadatum->get_metadata_type_object();
if (is_object($fto)) {
if ( method_exists($fto, 'get_value_as_html') ) {
return $fto->get_value_as_html($this);
}
}
}
@ -155,7 +152,6 @@ class Item_Metadata_Entity extends Entity {
$return = '';
if ( $this->is_multiple() ) {
$total = sizeof($value);
$count = 0;
$prefix = $this->get_multivalue_prefix();
@ -163,25 +159,19 @@ class Item_Metadata_Entity extends Entity {
$separator = $this->get_multivalue_separator();
foreach ($value as $v) {
$return .= $prefix;
$return .= (string) $v;
$return .= $suffix;
$count ++;
if ($count < $total)
$return .= $separator;
}
} else {
$return = (string) $value;
}
return $return;
}
/**
@ -199,10 +189,9 @@ class Item_Metadata_Entity extends Entity {
public function get_value_as_array() {
$value = $this->get_value();
$primitive_type = $this->get_metadatum()->get_metadata_type_object()->get_primitive_type();
if ( $this->is_multiple() ) {
$return = [];
$return = [];
if ($this->is_multiple()) {
foreach ($value as $v) {
if( is_array($v) ) {
$options = $this->get_metadatum()->get_metadata_type_object()->get_options();
@ -227,12 +216,8 @@ class Item_Metadata_Entity extends Entity {
$return[] = $v;
}
}
} else {
$return = '';
if( $primitive_type === 'compound' ) {
if ($primitive_type === 'compound') {
$compounds = [];
$compounds_not_ordinate = [];
$options = $this->get_metadatum()->get_metadata_type_object()->get_options();
@ -274,7 +259,6 @@ class Item_Metadata_Entity extends Entity {
}
return $return;
}
/**
@ -285,7 +269,7 @@ class Item_Metadata_Entity extends Entity {
*
* @return array the representation of this object as an array
*/
public function _toArray( $formatted_values = true, $cascade = false ){
public function _toArray( $formatted_values = true, $cascade = false ){
$as_array = [];
$as_array['value'] = $this->get_value_as_array();
@ -303,40 +287,40 @@ class Item_Metadata_Entity extends Entity {
$as_array['item'] = $this->get_item()->_toArray();
$as_array['metadatum'] = $this->get_metadatum()->_toArray();
}
return apply_filters('tainacan-item-metadata-to-array', $as_array, $this);
}
/**
* Define the item
*
* @param Item $item
* @return void
*/
function set_item(Item $item = null) {
$this->item = $item;
}
/**
* Define the metadatum value
*
* @param [integer | string] $value
* @return void
*/
function set_value($value) {
$this->value = $value;
}
/**
* Define the metadatum
*
* @param Metadatum $metadatum
* @return void
*/
function set_metadatum(Metadatum $metadatum = null) {
$this->metadatum = $metadatum;
}
}
/**
* Define the item
*
* @param Item $item
* @return void
*/
function set_item(Item $item = null) {
$this->item = $item;
}
/**
* Define the metadatum value
*
* @param [integer | string] $value
* @return void
*/
function set_value($value) {
$this->value = $value;
}
/**
* Define the metadatum
*
* @param Metadatum $metadatum
* @return void
*/
function set_metadatum(Metadatum $metadatum = null) {
$this->metadatum = $metadatum;
}
/**
* Set the specific meta ID for this metadata.
@ -370,135 +354,128 @@ class Item_Metadata_Entity extends Entity {
}
return false;
}
/**
* Return the item
*
* @return Item
*/
function get_item() {
return $this->item;
}
/**
* Return the metadatum
*
* @return Metadatum
*/
function get_metadatum() {
return $this->metadatum;
}
/**
* Return the meta_id
*
* @return Metadatum
*/
function get_meta_id() {
return isset($this->meta_id) ? $this->meta_id : null;
}
* Return the item
*
* @return Item
*/
function get_item() {
return $this->item;
}
/**
* Return the meta_id
*
* @return Metadatum
*/
function get_parent_meta_id() {
return isset($this->parent_meta_id) ? $this->parent_meta_id : 0;
}
/**
* Return the metadatum value
*
* @return string | integer
*/
function get_value() {
if (isset($this->value))
return $this->value;
$Tainacan_Item_Metadata = \Tainacan\Repositories\Item_Metadata::get_instance();
return $Tainacan_Item_Metadata->get_value($this);
}
* Return the metadatum
*
* @return Metadatum
*/
function get_metadatum() {
return $this->metadatum;
}
/**
* Check wether the item has a value stored in the database or not
*
* @return bool
*/
function has_value() {
if (isset($this->has_value))
return $this->has_value;
* Return the meta_id
*
* @return Metadatum
*/
function get_meta_id() {
return isset($this->meta_id) ? $this->meta_id : null;
}
/**
* Return the meta_id
*
* @return Metadatum
*/
function get_parent_meta_id() {
return isset($this->parent_meta_id) ? $this->parent_meta_id : 0;
}
/**
* Return the metadatum value
*
* @return string|integer|Array
*/
function get_value() {
if (isset($this->value))
return $this->value;
$Tainacan_Item_Metadata = \Tainacan\Repositories\Item_Metadata::get_instance();
return $Tainacan_Item_Metadata->get_value($this);
}
/**
* Check wether the item has a value stored in the database or not
*
* @return bool
*/
function has_value() {
if (isset($this->has_value))
return $this->has_value;
$value = $this->get_value();
$this->has_value = (is_array($value)) ? !empty(array_filter($value)) : !empty($value);
$this->has_value = (is_array($value)) ? !empty(array_filter($value)) : (is_numeric($value) || !empty($value));
return $this->has_value;
}
/**
* Return true if metadatum is multiple, else return false
*
* @return boolean
*/
function is_multiple() {
return $this->get_metadatum()->is_multiple();
}
/**
* Return true if metadatum is key
*
* @return boolean
*/
function is_collection_key() {
return $this->get_metadatum()->is_collection_key();
}
/**
* Return true if metadatum is required
*
* @return boolean
*/
function is_required() {
return $this->get_metadatum()->is_required();
}
/**
* Validate attributes
*
* @return boolean
*/
}
/**
* Return true if metadatum is multiple, else return false
*
* @return boolean
*/
function is_multiple() {
return $this->get_metadatum()->is_multiple();
}
/**
* Return true if metadatum is key
*
* @return boolean
*/
function is_collection_key() {
return $this->get_metadatum()->is_collection_key();
}
/**
* Return true if metadatum is required
*
* @return boolean
*/
function is_required() {
return $this->get_metadatum()->is_required();
}
/**
* Returns whether metadata value is valid
*
* @return boolean
*/
function validate() {
$value = $this->get_value();
$metadatum = $this->get_metadatum();
$item = $this->get_item();
if( !isset($metadatum) ) {
if (!isset($metadatum)) {
$this->add_error('not_found', ['metadatum not found'] );
return false;
}
if (empty($value) && $this->is_required() && in_array( $item->get_status(), apply_filters( 'tainacan-status-require-validation', [
'publish',
'future',
'private'
] ) )
) {
$this->add_error('required', $metadatum->get_name() . ' is required');
return false;
} elseif (empty($value) && !$this->is_required()) {
$this->set_as_valid();
return true;
} elseif(empty($value) && $this->is_required() && !in_array( $item->get_status(), apply_filters( 'tainacan-status-require-validation', [
'publish',
'future',
'private'
] ) )) {
$this->set_as_valid();
return true;
if (empty($value) && $value !== '0' && $value !== 0) {
if ($this->is_required()) {
$validation_statuses = ['publish', 'future', 'private'];
if (in_array($item->get_status(), apply_filters( 'tainacan-status-require-validation', $validation_statuses) )) {
$this->add_error('required', $metadatum->get_name() . ' is required');
return false;
} else {
return $this->set_as_valid();
}
} else {
return $this->set_as_valid();
}
}
$classMetadatumType = $metadatum->get_metadata_type_object();
if( is_object( $classMetadatumType ) ){
if (is_object($classMetadatumType)) {
if( method_exists ( $classMetadatumType , 'validate' ) ){
if( ! $classMetadatumType->validate( $this ) ) {
$this->add_error('metadata_type_error', $classMetadatumType->get_errors() );

View File

@ -9,23 +9,23 @@ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
*/
class Item extends Entity {
use \Tainacan\Traits\Entity_Collection_Relation;
protected
$terms,
$diplay_name,
$full,
$_thumbnail_id,
$modification_date,
$creation_date,
$author_id,
$url,
$id,
$title,
$order,
$parent,
$decription,
$document_type,
$document,
$collection_id;
protected
$terms,
$diplay_name,
$full,
$_thumbnail_id,
$modification_date,
$creation_date,
$author_id,
$url,
$id,
$title,
$order,
$parent,
$decription,
$document_type,
$document,
$collection_id;
/**
* {@inheritDoc}
@ -57,7 +57,7 @@ class Item extends Entity {
$array_item['url'] = get_permalink( $this->get_id() );
$array_item['creation_date'] = $this->get_date_i18n( explode( ' ', $array_item['creation_date'] )[0] );
$array_item['modification_date'] = $this->get_date_i18n( explode( ' ', $array_item['modification_date'] )[0] );
$array_item['document_mimetype'] = $this->get_document_mimetype();
return apply_filters('tainacan-item-to-array', $array_item, $this);
}
@ -116,26 +116,66 @@ class Item extends Entity {
return apply_filters("tainacan-item-get-author-name", $name, $this);
}
/**
* Gets the thumbnail list of files
*
* Each size is represented as an array in the format returned by
* @see https://developer.wordpress.org/reference/functions/wp_get_attachment_image_src/
*
* @return array
*/
function get_thumbnail() {
/**
* Gets the thumbnail list of files
*
* Each size is represented as an array in the format returned by
* @see https://developer.wordpress.org/reference/functions/wp_get_attachment_image_src/
*
* @return array
*/
function get_thumbnail() {
$sizes = get_intermediate_image_sizes();
$sizes = get_intermediate_image_sizes();
array_unshift($sizes, 'full');
array_unshift($sizes, 'full');
foreach ( $sizes as $size ) {
$thumbs[$size] = wp_get_attachment_image_src( $this->get__thumbnail_id(), $size );
}
if( in_array('tainacan-small', $sizes ) ) {
$tmp_src = wp_get_attachment_image_src( $this->get__thumbnail_id(), 'tainacan-small' );
$blurhash = $this->get_image_blurhash($tmp_src[0], $tmp_src[1], $tmp_src[2]);
}
return apply_filters("tainacan-item-get-thumbnail", $thumbs, $this);
}
foreach ( $sizes as $size ) {
$thumbs[$size] = wp_get_attachment_image_src( $this->get__thumbnail_id(), $size );
if (is_array($thumbs[$size]) && count($thumbs[$size]) == 4)
$thumbs[$size][] = $blurhash;
}
return apply_filters("tainacan-item-get-thumbnail", $thumbs, $this);
}
public function get_image_blurhash($file_path, $width, $height) {
if (
!(version_compare(PHP_VERSION, '7.2.0') >= 0) ||
!$image = @imagecreatefromstring(file_get_contents($file_path))
) {
return "V4P?:h00Rj~qM{of%MRjWBRjD%%MRjayofj[%M-;RjRj";
}
if($image == false)
return '';
$max_width = 45;
if( $width > $max_width ) {
$image = imagescale($image, $max_width);
$width = imagesx($image);
$height = imagesy($image);
}
$pixels = [];
for ($y = 0; $y < $height; ++$y) {
$row = [];
for ($x = 0; $x < $width; ++$x) {
$index = imagecolorat($image, $x, $y);
$colors = imagecolorsforindex($image, $index);
$row[] = [$colors['red'], $colors['green'], $colors['blue']];
}
$pixels[] = $row;
}
$components_x = 4;
$components_y = 3;
$blurhash = \kornrunner\Blurhash\Blurhash::encode($pixels, $components_x, $components_y);
return $blurhash;
}
/**
* @param $id
@ -148,10 +188,10 @@ class Item extends Entity {
* @return int|string
*/
function get__thumbnail_id() {
$_thumbnail_id = $this->get_mapped_property("_thumbnail_id");
if ( isset( $_thumbnail_id ) ) {
return $_thumbnail_id;
}
$_thumbnail_id = $this->get_mapped_property("_thumbnail_id");
if ( isset( $_thumbnail_id ) ) {
return $_thumbnail_id;
}
return get_post_thumbnail_id( $this->get_id() );
}
@ -238,6 +278,15 @@ class Item extends Entity {
return $this->get_mapped_property( 'document_type' );
}
/**
* Return the document mimetype
*
* @return string
*/
function get_document_mimetype() {
return $this->get_document_type() == 'attachment' ? get_post_mime_type($this->get_document()) : $this->get_document_type();
}
/**
* Return the item document
*
@ -271,7 +320,7 @@ class Item extends Entity {
* @return string "open"|"closed"
*/
public function get_comment_status() {
return apply_filters('comments_open', $this->get_mapped_property('comment_status'), $this->get_id());
return apply_filters('comments_open', $this->get_mapped_property('comment_status'), $this->get_id());
}
/**
@ -383,7 +432,7 @@ class Item extends Entity {
* @param $value string "open"|"closed"
*/
public function set_comment_status( $value ) {
$this->set_mapped_property('comment_status', $value);
$this->set_mapped_property('comment_status', $value);
}
/**
@ -451,26 +500,20 @@ class Item extends Entity {
public function _toHtml() {
$return = '';
$id = $this->get_id();
if ( $id ) {
$link = get_permalink( (int) $id );
if (is_string($link)) {
$return = "<a data-linkto='item' data-id='$id' href='$link'>";
$return.= $this->get_title();
$return .= "</a>";
}
}
return $return;
}
/**
@ -676,7 +719,7 @@ class Item extends Entity {
}
$output .= $_embed;
} elseif ( $type == 'text' ) {
$output .= $this->get_document();
$output .= '<article>' . $this->get_document() . '</article>';
} elseif ( $type == 'attachment' ) {
if ( wp_attachment_is_image($this->get_document()) ) {

View File

@ -168,7 +168,7 @@ class Metadatum extends Entity {
/**
* Return the an object child of \Tainacan\metadatum_Types\Metadata_Type with options
*
* @return \Tainacan\Metadata_Types\Metadata_Type The metadatum type class with filled options
* @return \Tainacan\Metadata_Types\Metadata_Type|Object The metadatum type class with filled options
*/
function get_metadata_type_object(){
$class_name = $this->get_metadata_type();

View File

@ -44,8 +44,8 @@ class Taxonomy extends Entity {
*/
static $db_identifier_prefix = 'tnc_tax_';
public function __toString(){
return apply_filters("tainacan-taxonomy-to-string", $this->get_name(), $this);
public function __toString() {
return (string) apply_filters("tainacan-taxonomy-to-string", $this->get_name(), $this);
}
/**
@ -54,18 +54,19 @@ class Taxonomy extends Entity {
* @return bool
*/
function tainacan_register_taxonomy() {
$labels = array(
'name' => $this->get_name(),
'singular_name' => $this->get_name(),
'search_items' => __( sprintf('Search terms in %s', $this->get_name()), 'tainacan' ),
'all_items' => __( sprintf('All terms in %s', $this->get_name()), 'tainacan' ),
$taxonomy_name = $this->get_name();
$labels = array(
'name' => $taxonomy_name,
'singular_name' => $taxonomy_name,
'search_items' => __( sprintf('Search terms in %s', $taxonomy_name), 'tainacan' ),
'all_items' => __( sprintf('All terms in %s', $taxonomy_name), 'tainacan' ),
'parent_item' => __( 'Parent term', 'tainacan' ),
'parent_item_colon' => __( 'Parent term:', 'tainacan' ),
'edit_item' => __( 'Edit term', 'tainacan' ),
'update_item' => __( 'Update term', 'tainacan' ),
'add_new_item' => __( 'Add New term', 'tainacan' ),
'new_item_name' => __( 'New Genre term', 'tainacan' ),
'menu_name' => $this->get_name(),
'menu_name' => $taxonomy_name,
);
$enabled_post_types = $this->get_enabled_post_types();
@ -88,8 +89,6 @@ class Taxonomy extends Entity {
unregister_taxonomy($this->get_db_identifier());
}
register_taxonomy(
$this->get_db_identifier(),
$enabled_post_types,

View File

@ -51,11 +51,11 @@ class Term extends Entity {
}
}
public function __toString(){
return apply_filters("tainacan-term-to-string", $this->get_name(), $this);
public function __toString() {
return (string) apply_filters("tainacan-term-to-string", $this->get_name(), $this);
}
public function _toArray(){
public function _toArray() {
$term_array = parent::_toArray();
$term_id = $term_array['term_id'];
@ -245,25 +245,19 @@ class Term extends Entity {
}
public function _toHtml() {
$return = '';
$id = $this->get_id();
if ( $id ) {
$link = get_term_link( (int) $id );
if (is_string($link)) {
$return = "<a data-linkto='term' data-id='$id' href='$link'>";
$return.= $this->get_name();
$return .= "</a>";
}
}
return apply_filters('tainacan-term-to-html', $return, $this);
return apply_filters('tainacan-term-to-html', $return, $this);
}
}

View File

@ -60,6 +60,19 @@ class CSV extends Exporter {
$line[] = $rel;
} elseif ($meta->get_metadatum()->get_metadata_type() == 'Tainacan\Metadata_Types\Compound') {
$line[] = $this->get_compound_metadata_cell($meta);
} elseif ($meta->get_metadatum()->get_metadata_type() == 'Tainacan\Metadata_Types\Date' ) {
$metadatum = $meta->get_metadatum();
$date_value = 'ERROR ON FORMATING DATE';
if (is_object($metadatum)) {
$fto = $metadatum->get_metadata_type_object();
if (is_object($fto)) {
if ( method_exists($fto, 'get_value_as_html') ) {
$fto->output_date_format = 'Y-m-d';
$date_value = $fto->get_value_as_html($meta);
}
}
}
$line[] = $date_value;
} else {
$line[] = $meta->get_value_as_string();
}

View File

@ -193,7 +193,8 @@ abstract class Exporter {
$current_collection_item = $this->get_current_collection_item();
$collections = $this->get_collections();
$collection = $collections[$current_collection];
$current_collection_item ++;
$length_items = $this->get_step_length_items();
$current_collection_item += $length_items;
$this->set_current_collection_item($current_collection_item);
if ($current_collection_item >= $collection['total_items']) {
return $this->next_collection();
@ -248,6 +249,10 @@ abstract class Exporter {
return $this->current_collection_item;
}
public function get_step_length_items() {
return apply_filters('exporter_step_length_items', 20, $this->get_current_step());
}
public function set_current_collection_item($value) {
$this->current_collection_item = $value;
}
@ -350,11 +355,11 @@ abstract class Exporter {
}
public function add_log($message ) {
$this->log[] = $message;
$this->log[] = ['datetime' => date("Y-m-d H:i:s"), 'message' => $message];
}
public function add_error_log($message ) {
$this->error_log[] = $message;
$this->error_log[] = ['datetime' => date("Y-m-d H:i:s"), 'message' => $message];
}
public function is_finished() {
@ -562,20 +567,19 @@ abstract class Exporter {
$this->add_error_log('Collection misconfigured');
return false;
}
$this->add_log('Processing item ' . $current_collection_item);
$length_items = $this->get_step_length_items();
$this->add_log("Processing batch with $length_items items, starting from item $current_collection_item");
$this->process_header($current_collection_item, $collection_definition);
$init = microtime(true);
$processed_items = $this->get_items($current_collection_item, $collection_definition);
foreach ($processed_items as $processed_item) {
$init = microtime(true);
$this->process_item( $processed_item['item'], $processed_item['metadata'] );
$final = microtime(true);
$total = ($final - $init);
$time_log = sprintf( __('Processed in %f seconds', 'tainacan'), $total );
$this->add_log($time_log);
}
$final = microtime(true);
$total = ($final - $init);
$time_log = sprintf( __('Processed in %f seconds', 'tainacan'), $total );
$this->add_log($time_log);
$this->process_footer($current_collection_item, $collection_definition);
return $this->next_item();
@ -595,7 +599,7 @@ abstract class Exporter {
}
private function process_footer($current_collection_item, $collection_definition) {
if ($current_collection_item == $collection_definition['total_items']-1) {
if ($current_collection_item > $collection_definition['total_items']) {
$this->output_footer();
}
}
@ -608,17 +612,18 @@ abstract class Exporter {
private function get_items($index, $collection_definition) {
$collection_id = $collection_definition['id'];
$tainacan_items = \Tainacan\Repositories\Items::get_instance();
$per_page = $this->get_step_length_items();
$page = intdiv($index, $per_page) + 1;
$filters = [
'posts_per_page' => 1,
'paged' => $index+1,
'posts_per_page' => $per_page,
'paged' => $page,
'order' => 'DESC',
'orderby' => 'ID'
];
$this->add_log('Proccessing item index ' . $index . ' in collection ' . $collection_definition['id'] );
$this->add_log("Retrieving $per_page items on page index: $index, in collection " . $collection_definition['id'] );
$items = $tainacan_items->fetch($filters, $collection_id, 'WP_Query');
if ( !isset($collection_definition['total_items']) ) {
$collection_definition['total_items'] = $items->found_posts;
$this->update_current_collection($collection_definition);
@ -805,7 +810,7 @@ abstract class Exporter {
if (method_exists($this, $method_name)) {
$author = $this->get_transient('author');
$this->add_log('User in process: ' . $author . ' (' . date("Y-m-d H:i:s") . ')');
$this->add_log('User in process: ' . $author);
wp_set_current_user($author);
$result = $this->$method_name();
} else {

View File

@ -278,7 +278,8 @@ class Bulk_Edit_Process extends Generic_Process {
private function clear_value(\Tainacan\Entities\Item $item) {
$metadatum = $this->metadatum_repository->fetch($this->bulk_edit_data['metadatum_id']);
$item_metadata = new Entities\Item_Metadata_Entity( $item, $metadatum );
$parent_meta_id = $this->get_parent_meta_id($item, $metadatum);
$item_metadata = new Entities\Item_Metadata_Entity( $item, $metadatum, null, $parent_meta_id );
$item_metadata->set_value("");
return $this->save_item_metadata($item_metadata, $item);
}
@ -286,8 +287,9 @@ class Bulk_Edit_Process extends Generic_Process {
private function set_value(\Tainacan\Entities\Item $item) {
$metadatum = $this->metadatum_repository->fetch($this->bulk_edit_data['metadatum_id']);
$value = $this->bulk_edit_data['value'];
$parent_meta_id = $this->get_parent_meta_id($item, $metadatum);
$item_metadata = new Entities\Item_Metadata_Entity( $item, $metadatum );
$item_metadata = new Entities\Item_Metadata_Entity( $item, $metadatum, null, $parent_meta_id );
if($item_metadata->is_multiple()) {
$value = is_array( $value ) ? $value : [$value];
@ -300,6 +302,22 @@ class Bulk_Edit_Process extends Generic_Process {
}
private function get_parent_meta_id($item, $metadatum) {
$metadatum_parent_id = $metadatum->get_parent();
if ($metadatum_parent_id > 0) {
$metadatum_parent = $this->metadatum_repository->fetch($metadatum_parent_id);
$compoundItem = new Entities\Item_Metadata_Entity($item, $metadatum_parent);
$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
$parent_meta_id = $compoundValue[$key]->get_parent_meta_id();
return $parent_meta_id;
} // elseif ((is_array($compoundValue) && sizeof($compoundValue) > 0))
}
return null;
}
private function add_value(\Tainacan\Entities\Item $item) {
$metadatum_id = $this->bulk_edit_data['metadatum_id'];
$metadatum = $this->metadatum_repository->fetch($metadatum_id);

View File

@ -38,7 +38,7 @@ class Generic_Process_Handler {
$data = $process_object->_to_Array(true);
$process = $this->get_generic_process_by_object($process_object);
$process_name = sprintf( __('%s process', 'tainacan'), $process['name'] );
$process_name = sprintf( __('%s processing', 'tainacan'), $process['name'] );
$bg_process = $this->bg_process->data($data)->set_name($process_name)->save();
if ( is_wp_error($bg_process->dispatch()) ) {

View File

@ -146,11 +146,11 @@ abstract class Generic_Process {
}
public function add_log($message ) {
$this->log[] = $message;
$this->log[] = ['datetime' => date("Y-m-d H:i:s"), 'message' => $message];
}
public function add_error_log($message ) {
$this->error_log[] = $message;
$this->error_log[] = ['datetime' => date("Y-m-d H:i:s"), 'message' => $message];
}
public function is_finished() {

View File

@ -12,7 +12,8 @@ class CSV extends Importer {
'delimiter' => ',',
'multivalued_delimiter' => '||',
'encode' => 'utf8',
'enclosure' => ''
'enclosure' => '',
'escape_empty_value' => '[empty value]'
]);
}
@ -35,13 +36,15 @@ class CSV extends Importer {
}
$columns = [];
if( $rawColumns ) {
if ($rawColumns) {
foreach( $rawColumns as $index => $rawColumn ) {
if( strpos($rawColumn,'special_') === 0 ) {
if( $rawColumn === 'special_document' ) {
$this->set_option('document_index', $index);
} else if( $rawColumn === 'special_attachments' ||
} else if ($rawColumn === 'special_document|REPLACE') {
$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|REPLACE' ) {
$this->set_option('attachment_index', $index);
@ -83,7 +86,7 @@ class CSV extends Importer {
if( $rawColumns ) {
foreach( $rawColumns as $index => $rawColumn ) {
if( strpos($rawColumn,'special_') === 0 ) {
if( in_array( $rawColumn, ['special_document', 'special_attachments', 'special_item_status', 'special_item_id', 'special_comment_status', 'special_attachments|APPEND', 'special_attachments|REPLACE'] ) ) {
if( in_array( $rawColumn, ['special_document', 'special_attachments', 'special_item_status', 'special_item_id', 'special_comment_status', 'special_attachments|APPEND', 'special_attachments|REPLACE', 'special_document|REPLACE'] ) ) {
$columns[] = $rawColumn;
}
}
@ -196,8 +199,10 @@ class CSV extends Importer {
$returnValue = [];
foreach($valueToInsert as $index => $metadatumValue) {
$childrenHeaders = str_getcsv($compoundHeaders[$key], $this->get_option('delimiter'), $this->get_option('enclosure'));
$childrenValue = str_getcsv($metadatumValue, $this->get_option('delimiter'), $this->get_option('enclosure'));
$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'));
if ( sizeof($childrenHeaders) != sizeof($childrenValue) ) {
$this->add_error_log('Mismatch count headers childrens and row columns. file value:' . $metadatumValue);
return false;
@ -385,6 +390,31 @@ class CSV extends Importer {
</div>
</div>
</div>
<div class="column">
<div class="field">
<label class="label"><?php _e('Empty value', 'tainacan'); ?></label>
<span class="help-wrapper">
<a class="help-button has-text-secondary">
<span class="icon is-small">
<i class="tainacan-icon tainacan-icon-help" ></i>
</span>
</a>
<div class="help-tooltip">
<div class="help-tooltip-header">
<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>
</div>
</div>
</span>
<div class="control is-clearfix">
<input class="input" type="text" name="escape_empty_value" value="<?php echo $this->get_option('escape_empty_value'); ?>">
</div>
</div>
</div>
</div>
<div class="columns">
@ -488,7 +518,14 @@ class CSV extends Importer {
}
} else if( strpos($column_value,'file:') === 0 ) {
$correct_value = trim(substr($column_value, 5));
if( isset(parse_url($correct_value)['scheme'] ) ) {
//removing the old document attachment
if ($this->get_option('document_import_mode') === 'replace' && $item_inserted->get_document_type() == 'attachment' ) {
$this->add_log('Item Document will be replaced ... ');
wp_delete_attachment($item_inserted->get_document(), true);
$this->add_log('Deleted previous Item Documents ... ');
}
if (isset(parse_url($correct_value)['scheme'] )) {
$id = $TainacanMedia->insert_attachment_from_url($correct_value, $item_inserted->get_id());
if(!$id){
@ -545,15 +582,7 @@ class CSV extends Importer {
break;
case 'REPLACE':
$this->add_log('Attachment REPLACE file ');
$args['post_parent'] = $item_inserted->get_id();
$args['post_type'] = 'attachment';
$args['post_status'] = 'any';
$args['post__not_in'] = [$item_inserted->get_document()];
$posts_query = new \WP_Query();
$query_result = $posts_query->query( $args );
foreach ( $query_result as $post ) {
wp_delete_attachment( $post->ID, true );
}
$this->delete_previous_document_imgs($item_inserted->get_id(), $item_inserted->get_document());
break;
}
@ -598,10 +627,10 @@ class CSV extends Importer {
$line = substr($line, $cut_start);
}
$end = substr($line, ( strlen($line) - strlen($this->get_option('enclosure')) ) , strlen($this->get_option('enclosure')));
$end = substr($line, ( strlen($line) - strlen($this->get_option('enclosure')) ) , strlen($this->get_option('enclosure')));
if( $this->get_option('enclosure') === $end ) {
$line = substr($line, 0, ( strlen($line) - strlen($this->get_option('enclosure')) ) );
$line = substr($line, 0, ( strlen($line) - strlen($this->get_option('enclosure')) ) );
}
$delimiter = $this->get_option('enclosure').$this->get_option('delimiter').$this->get_option('enclosure');
@ -655,7 +684,7 @@ class CSV extends Importer {
* its value or values
* @param integer $collection_index The index in the $this->collections array of the collection the item is being inserted into
*
* @return Tainacan\Entities\Item Item inserted
* @return bool|Tainacan\Entities\Item Item inserted
*/
public function insert( $processed_item, $collection_index ) {
remove_action( 'post_updated', 'wp_save_post_revision' );
@ -677,14 +706,13 @@ class CSV extends Importer {
$Tainacan_Item_Metadata = \Tainacan\Repositories\Item_Metadata::get_instance();
$Tainacan_Items = \Tainacan\Repositories\Items::get_instance();
// $Tainacan_Items->disable_logs();
// $Tainacan_Metadata->disable_logs();
// $Tainacan_Item_Metadata->disable_logs();
$itemMetadataArray = [];
$updating_item = false;
$Tainacan_Items->disable_logs();
$Tainacan_Metadata->disable_logs();
$Tainacan_Item_Metadata->disable_logs();
if ( is_numeric($this->get_transient('item_id')) ) {
$item = $Tainacan_Items->fetch( (int) $this->get_transient('item_id') );
@ -739,7 +767,9 @@ class CSV extends Importer {
if ($metadatum instanceof Entities\Metadatum) {
$singleItemMetadata = new Entities\Item_Metadata_Entity( $item, $metadatum); // *empty item will be replaced by inserted in the next foreach
if( $metadatum->get_metadata_type() == 'Tainacan\Metadata_Types\Taxonomy' ) {
if ($this->is_clear_value($values)) {
$singleItemMetadata->set_value("");
} else if( $metadatum->get_metadata_type() == 'Tainacan\Metadata_Types\Taxonomy' ) {
if( !is_array( $values ) ) {
$tmp = $this->insert_hierarchy( $metadatum, $values);
if ($tmp !== false) {
@ -763,7 +793,12 @@ class CSV extends Importer {
foreach($children_mapping as $tainacan_children_metadatum_id => $tainacan_children_header) {
$metadatumChildren = $Tainacan_Metadata->fetch( $tainacan_children_metadatum_id, 'OBJECT' );
$compoundItemMetadata = new Entities\Item_Metadata_Entity( $item, $metadatumChildren);
$compoundItemMetadata->set_value($compoundValue[$tainacan_children_header]);
$childrenCompoundvalue = $compoundValue[$tainacan_children_header];
if ($this->is_clear_value($childrenCompoundvalue)) {
$compoundItemMetadata->set_value("");
} else {
$compoundItemMetadata->set_value($childrenCompoundvalue);
}
$tmp[] = $compoundItemMetadata;
}
$singleItemMetadata[] = $tmp;
@ -787,7 +822,8 @@ class CSV extends Importer {
$this->add_error_log( $item->get_errors() );
return false;
}
global $wpdb;
$wpdb->query( 'SET autocommit = 0;' );
foreach ( $itemMetadataArray as $itemMetadata ) {
if($itemMetadata instanceof Entities\Item_Metadata_Entity ) {
$itemMetadata->set_item( $insertedItem ); // *I told you
@ -826,6 +862,8 @@ class CSV extends Importer {
// $this->add_error_log( 'Item ' . $insertedItem->get_id() . ' has an error' );
//}
}
$wpdb->query( 'COMMIT;' );
$wpdb->query( 'SET autocommit = 1;' );
if ( ! $updating_item ) {
$insertedItem->set_status('publish' );
@ -847,12 +885,18 @@ class CSV extends Importer {
}
}
private function is_assoc(array $arr) {
if (array() === $arr) return false;
return array_keys($arr) !== range(0, count($arr) - 1);
}
private function deleteAllValuesCompoundItemMetadata($item, $compoundMetadataID) {
$Tainacan_Metadata = \Tainacan\Repositories\Metadata::get_instance();
$Tainacan_Item_Metadata = \Tainacan\Repositories\Item_Metadata::get_instance();
$compound_metadata = $Tainacan_Metadata->fetch($compoundMetadataID, 'OBJECT');
$compound_item_metadata = new Entities\Item_Metadata_Entity($item, $compound_metadata);
$compound_item_metadata_value = $compound_item_metadata->get_value();
$compound_item_metadata_value = $this->is_assoc($compound_item_metadata_value) ? [$compound_item_metadata_value] : $compound_item_metadata_value;
foreach($compound_item_metadata_value as $item_metadata_value) {
foreach ($item_metadata_value as $itemMetadata) {
$Tainacan_Item_Metadata->remove_compound_value($item, $compound_metadata, $itemMetadata->get_parent_meta_id());
@ -872,14 +916,23 @@ class CSV extends Importer {
}
}
/**
* @param $value
* @return bool
*/
private function is_clear_value($value) {
if( !empty($value) && is_array($value) )
return false;
return $this->get_option('escape_empty_value') == $value;
}
/**
* @param $metadatum the metadata
* @param $values the categories names
*
* @return array empty with no category or array with IDs
* @return bool|array empty with no category or array with IDs
*/
private function insert_hierarchy( $metadatum, $values ){
private function insert_hierarchy( $metadatum, $values ) {
if (empty($values)) {
return false;
}
@ -942,14 +995,13 @@ class CSV extends Importer {
/**
* @param $collection_id
*
* @return array/bool false if has no mapping or associated array with metadata id and header
* @return array|bool false if has no mapping or associated array with metadata id and header
*/
public function get_mapping( $collection_id ){
$mapping = get_post_meta( $collection_id, 'metadata_mapping', true );
return ( $mapping ) ? $mapping : false;
return $mapping ?: false;
}
/**
* @inheritdoc
*
@ -1041,4 +1093,19 @@ class CSV extends Importer {
return $message;
}
private function delete_previous_document_imgs($item_id, $item_document) {
$previous_imgs = [
'post_parent' => $item_id,
'post_type' => 'attachment',
'post_status' => 'any',
'post__not_in' => [$item_document]
];
$posts_query = new \WP_Query();
$attachs = $posts_query->query($previous_imgs);
foreach ($attachs as $att) {
$this->add_log( "Deleting attachment [". $att->ID . "] " . $att->post_title);
wp_delete_attachment($att->ID, true);
}
}
}

View File

@ -44,7 +44,7 @@ class Importer_Handler {
$this->register_importer([
'name' => 'Vocabulary CSV',
'description' => __('Import a vaculary from a CSV file into a taxonomy', 'tainacan'),
'description' => __('Import a vocabulary from a CSV file into a taxonomy', 'tainacan'),
'slug' => 'terms',
'class_name' => '\Tainacan\Importer\Term_Importer',
'manual_collection' => false,

View File

@ -5,14 +5,14 @@ use Tainacan\Entities;
abstract class Importer {
/**
* The ID for this importer session
*
* When creating a new importer session via API, an id is returned and used to access this
* importer instance. This is temporarily stored in the database and discarded after the bg process is triggered
*
* @var identifier
*/
/**
* The ID for this importer session
*
* When creating a new importer session via API, an id is returned and used to access this
* importer instance. This is temporarily stored in the database and discarded after the bg process is triggered
*
* @var identifier
*/
private $id;
/**
@ -59,7 +59,7 @@ abstract class Importer {
private $options = [];
/**
* Stores the default options for the importer options
* Stores default options for importer options
* @var array
*/
protected $default_options = [];
@ -114,7 +114,7 @@ abstract class Importer {
private $error_log = [];
/**
* Wether to abort importer execution.
* Whether to abort importer execution.
* @var bool
*/
private $abort = false;
@ -136,8 +136,7 @@ abstract class Importer {
'tmp_file'
];
public function __construct($attributess = array()) {
public function __construct($attributess = array()) {
$this->id = uniqid();
$author = get_current_user_id();
@ -153,8 +152,6 @@ abstract class Importer {
}
}
}
}
public function _to_Array($short = false) {
@ -181,41 +178,39 @@ abstract class Importer {
/////////////////////
// Getters and setters
/**
* @return string
*/
public function get_id(){
return $this->id;
}
/**
* @return string
*/
public function get_id(){
return $this->id;
}
/**
* Set URL
* @param $url string
* @return bool
*/
public function set_url($url)
{
if(!empty($url) && !is_array($url))
{
$this->url = rtrim(trim($url), "/");
return true;
}
/**
* Set URL
* @param $url string
* @return bool
*/
public function set_url($url) {
if(!empty($url) && !is_array($url))
{
$this->url = rtrim(trim($url), "/");
return true;
}
return false;
}
return false;
}
/**
* @return string or bool
*/
public function get_url()
{
if(!empty($this->url))
{
return $this->url;
}
/**
* @return string or bool
*/
public function get_url() {
if(!empty($this->url))
{
return $this->url;
}
return false;
}
return false;
}
public function get_current_step() {
return $this->current_step;
@ -250,12 +245,12 @@ abstract class Importer {
}
public function get_tmp_file(){
return $this->tmp_file;
}
return $this->tmp_file;
}
public function set_tmp_file($filepath){
$this->tmp_file = $filepath;
}
$this->tmp_file = $filepath;
}
public function get_collections() {
return $this->collections;
@ -266,13 +261,13 @@ abstract class Importer {
}
/**
* Gets the options for this importer, including default values for options
* that were not set yet.
* @return array Importer options
*/
public function get_options() {
return array_merge($this->default_options, $this->options);
}
* Gets the options for this importer, including default values for options
* that were not set yet.
* @return array Importer options
*/
public function get_options() {
return array_merge($this->default_options, $this->options);
}
/**
* Set the options array
@ -293,15 +288,13 @@ abstract class Importer {
$this->default_options = $options;
}
public function set_steps($steps) {
$this->steps = $steps;
}
public function set_steps($steps) {
$this->steps = $steps;
}
public function get_steps() {
return $this->steps;
}
return $this->steps;
}
private function get_transients() {
return $this->transients;
@ -323,33 +316,33 @@ abstract class Importer {
// Utilities
/**
* @param $file File to be managed by importer
* @return bool
*/
public function add_file( $file ){
$new_file = $this->upload_file( $file );
if ( is_numeric( $new_file ) ) {
/**
* @param $file File to be managed by importer
* @return bool
*/
public function add_file( $file ){
$new_file = $this->upload_file( $file );
if ( is_numeric( $new_file ) ) {
$this->tmp_file = get_attached_file( $new_file );
return true;
} else {
return false;
}
}
} else {
return false;
}
}
/**
* log the actions from importer
*
* @param $type
* @param $messagelog
*/
public function add_log($message ){
$this->log[] = $message;
}
public function add_error_log($message ){
$this->error_log[] = $message;
}
/**
* log the actions from importer
*
* @param $type
* @param $messagelog
*/
public function add_log($message ) {
$this->log[] = ['datetime' => date("Y-m-d H:i:s"), 'message' => $message];
}
public function add_error_log($message ) {
$this->error_log[] = ['datetime' => date("Y-m-d H:i:s"), 'message' => $message];
}
public function add_collection(array $collection) {
if (isset($collection['id'])) {
@ -367,17 +360,17 @@ abstract class Importer {
}
}
/**
* internal function to upload the file
*
* @param $path_file
* @return array $response
*/
private function upload_file( $file_array ){
//$name = basename( $path_file );
//$file_array['name'] = $name;
//$file_array['tmp_name'] = $path_file;
//$file_array['size'] = filesize( $path_file );
/**
* internal function to upload the file
*
* @param $path_file
* @return array $response
*/
private function upload_file( $file_array ){
//$name = basename( $path_file );
//$file_array['name'] = $name;
//$file_array['tmp_name'] = $path_file;
//$file_array['size'] = filesize( $path_file );
if ( !function_exists('media_handle_upload') ) {
require_once(ABSPATH . "wp-admin" . '/includes/image.php');
@ -386,36 +379,36 @@ abstract class Importer {
}
//var_dump(media_handle_sideload( $file_array, 0 )); die;
return media_handle_sideload( $file_array, 0 );
}
}
/**
* get the content form url and creates a file
*
* @param $url
* @return array
*/
public function fetch_from_remote( $url ){
$tmp = wp_remote_get( $url );
if( !is_wp_error($tmp) && isset( $tmp['body'] ) ){
$file = fopen( $this->get_id().'.txt', 'w' );
fwrite( $file, $tmp['body'] );
fclose( $file );
return $this->add_file( $this->get_id().'.txt' );
}
}
/**
* get the content form url and creates a file
*
* @param $url
* @return array
*/
public function fetch_from_remote( $url ){
$tmp = wp_remote_get( $url );
if( !is_wp_error($tmp) && isset( $tmp['body'] ) ){
$file = fopen( $this->get_id().'.txt', 'w' );
fwrite( $file, $tmp['body'] );
fclose( $file );
return $this->add_file( $this->get_id().'.txt' );
}
}
/**
* Gets one option from the options array.
*
* Checks if option exist or if it have a default value. Otherwise return an empty string
*
* @param string $key the desired option
* @return mixed the option value, the default value or an empty string
*/
public function get_option($key) {
$options = $this->get_options();
return isset($options[$key]) ? $options[$key] : '';
}
/**
* Gets one option from the options array.
*
* Checks if option exist or if it have a default value. Otherwise return an empty string
*
* @param string $key the desired option
* @return mixed the option value, the default value or an empty string
*/
public function get_option($key) {
$options = $this->get_options();
return isset($options[$key]) ? $options[$key] : '';
}
/**
* Adds a new method accepeted by the importer
@ -464,15 +457,15 @@ abstract class Importer {
return null;
}
public function is_finished()
{
if($this->current_step >= count($this->steps))
{
return true;
}
public function is_finished()
{
if($this->current_step >= count($this->steps))
{
return true;
}
return false;
}
return false;
}
/**
* Cancel Scheduled abortion at the end of run()
@ -559,7 +552,6 @@ abstract class Importer {
$step = $steps[$current_step];
if ($step['callback'] == 'process_collections') {
$totalItems = 0;
$currentItem = $this->get_current_collection_item();
$current_collection = $this->get_current_collection();
@ -577,18 +569,12 @@ abstract class Importer {
if ($totalItems > 0) {
$value = round( ($currentItem/$totalItems) * 100 );
}
} else {
if ( isset($step['total']) && is_numeric($step['total']) && $step['total'] > 0 ) {
$current = $this->get_in_step_count();
$value = round( ($current/$step['total']) * 100 );
}
}
}
return $value;
}
@ -628,26 +614,26 @@ abstract class Importer {
// Abstract methods
/**
* get the metadata of file/url to allow mapping
* should return an array
*
* Used when $manual_mapping is set to true, to build the mapping interface
*
* @return array $metadata_source the metadata from the source
*/
public function get_source_metadata() {}
/**
* get the metadata of file/url to allow mapping
* should return an array
*
* Used when $manual_mapping is set to true, to build the mapping interface
*
* @return array $metadata_source the metadata from the source
*/
public function get_source_metadata() {}
/**
* get values for a single item
*
* @param $index
* @return array with metadatum_source's as the index and values for the
* item
*
* Ex: [ 'Metadatum1' => 'value1', 'Metadatum2' => [ 'value2','value3' ]
*/
abstract public function process_item( $index, $collection_id );
/**
* get values for a single item
*
* @param $index
* @return array with metadatum_source's as the index and values for the
* item
*
* Ex: [ 'Metadatum1' => 'value1', 'Metadatum2' => [ 'value2','value3' ]
*/
abstract public function process_item( $index, $collection_id );
@ -679,11 +665,11 @@ abstract class Importer {
////////////////////////////////////////
// Core methods
/**
* process an item from the collections queue
*
*/
public function process_collections() {
/**
* process an item from the collections queue
*
*/
public function process_collections() {
$current_collection = $this->get_current_collection();
$collections = $this->get_collections();
@ -705,7 +691,7 @@ abstract class Importer {
}
return $this->next_item();
}
}
protected function next_item() {
@ -718,8 +704,8 @@ abstract class Importer {
$this->set_current_collection_item($current_collection_item);
if( $this->get_transient('change_total') ){
$collection['total_items'] = $this->get_transient('change_total');
}
$collection['total_items'] = $this->get_transient('change_total');
}
if ($current_collection_item >= $collection['total_items']) {
return $this->next_collection();
@ -763,23 +749,23 @@ abstract class Importer {
return false;
}
/**
* insert processed item from source to Tainacan
*
* @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 ) {
/**
* insert processed item from source to Tainacan
*
* @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 ) {
remove_action( 'post_updated', 'wp_save_post_revision' );
$collections = $this->get_collections();
$collection_definition = isset($collections[$collection_index]) ? $collections[$collection_index] : false;
if ( !$collection_definition || !is_array($collection_definition) || !isset($collection_definition['id']) || !isset($collection_definition['mapping']) ) {
$this->add_error_log('Collection misconfigured');
return false;
return false;
}
$collection = \Tainacan\Repositories\Collections::get_instance()->fetch($collection_definition['id']);
@ -790,96 +776,96 @@ abstract class Importer {
}
$Tainacan_Metadata = \Tainacan\Repositories\Metadata::get_instance();
$Tainacan_Item_Metadata = \Tainacan\Repositories\Item_Metadata::get_instance();
$Tainacan_Item_Metadata = \Tainacan\Repositories\Item_Metadata::get_instance();
$Tainacan_Items = \Tainacan\Repositories\Items::get_instance();
$Tainacan_Items->disable_logs();
$Tainacan_Metadata->disable_logs();
$Tainacan_Item_Metadata->disable_logs();
$item = new Entities\Item( ( $this->get_transient('item_id') ) ? $this->get_transient('item_id') : 0 );
$item = new Entities\Item( ( $this->get_transient('item_id') ) ? $this->get_transient('item_id') : 0 );
$itemMetadataArray = [];
if( is_array( $processed_item ) ){
foreach ( $processed_item as $metadatum_source => $values ){
$tainacan_metadatum_id = array_search( $metadatum_source, $collection_definition['mapping'] );
$metadatum = $Tainacan_Metadata->fetch( $tainacan_metadatum_id );
if( is_array( $processed_item ) ){
foreach ( $processed_item as $metadatum_source => $values ){
$tainacan_metadatum_id = array_search( $metadatum_source, $collection_definition['mapping'] );
$metadatum = $Tainacan_Metadata->fetch( $tainacan_metadatum_id );
if( $metadatum instanceof Entities\Metadatum ){
$singleItemMetadata = new Entities\Item_Metadata_Entity( $item, $metadatum); // *empty item will be replaced by inserted in the next foreach
$singleItemMetadata->set_value( $values );
$itemMetadataArray[] = $singleItemMetadata;
} else {
if( $metadatum instanceof Entities\Metadatum ){
$singleItemMetadata = new Entities\Item_Metadata_Entity( $item, $metadatum); // *empty item will be replaced by inserted in the next foreach
$singleItemMetadata->set_value( $values );
$itemMetadataArray[] = $singleItemMetadata;
} else {
$this->add_error_log('Metadata ' . $metadatum_source . ' not found');
}
}
}
}
}
if( !empty( $itemMetadataArray ) && $collection instanceof Entities\Collection ){
if( !empty( $itemMetadataArray ) && $collection instanceof Entities\Collection ){
$item->set_collection( $collection );
if( $item->validate() ){
if( $item->validate() ){
$insertedItem = $Tainacan_Items->insert( $item );
} else {
$this->add_error_log( 'Error inserting item' );
$this->add_error_log( $item->get_errors() );
return false;
}
} else {
$this->add_error_log( 'Error inserting item' );
$this->add_error_log( $item->get_errors() );
return false;
}
foreach ( $itemMetadataArray as $itemMetadata ) {
$itemMetadata->set_item( $insertedItem ); // *I told you
foreach ( $itemMetadataArray as $itemMetadata ) {
$itemMetadata->set_item( $insertedItem ); // *I told you
if( $itemMetadata->validate() ){
if( $itemMetadata->validate() ){
$result = $Tainacan_Item_Metadata->insert( $itemMetadata );
} else {
$this->add_error_log('Error saving value for ' . $itemMetadata->get_metadatum()->get_name());
$this->add_error_log($itemMetadata->get_errors());
continue;
}
} else {
$this->add_error_log('Error saving value for ' . $itemMetadata->get_metadatum()->get_name());
$this->add_error_log($itemMetadata->get_errors());
continue;
}
//if( $result ){
// $values = ( is_array( $itemMetadata->get_value() ) ) ? implode( PHP_EOL, $itemMetadata->get_value() ) : $itemMetadata->get_value();
// $this->add_log( 'Item ' . $insertedItem->get_id() .
// ' has inserted the values: ' . $values . ' on metadata: ' . $itemMetadata->get_metadatum()->get_name() );
//} else {
// $this->add_error_log( 'Item ' . $insertedItem->get_id() . ' has an error' );
//}
//if( $result ){
// $values = ( is_array( $itemMetadata->get_value() ) ) ? implode( PHP_EOL, $itemMetadata->get_value() ) : $itemMetadata->get_value();
// $this->add_log( 'Item ' . $insertedItem->get_id() .
// ' has inserted the values: ' . $values . ' on metadata: ' . $itemMetadata->get_metadatum()->get_name() );
//} else {
// $this->add_error_log( 'Item ' . $insertedItem->get_id() . ' has an error' );
//}
}
$insertedItem->set_status('publish' );
if($insertedItem->validate()) {
if($insertedItem->validate()) {
$insertedItem = $Tainacan_Items->update( $insertedItem );
$this->after_inserted_item( $insertedItem, $collection_index );
} else {
$this->add_error_log( 'Error publishing Item' );
$this->add_error_log( $insertedItem->get_errors() );
return false;
} else {
$this->add_error_log( 'Error publishing Item' );
$this->add_error_log( $insertedItem->get_errors() );
return false;
}
return $insertedItem;
return $insertedItem;
} else {
$this->add_error_log( 'Collection not set');
return false;
}
} else {
$this->add_error_log( 'Collection not set');
return false;
}
}
/**
* allow importers executes process after item is insertes
* @param array $insertedItem Associative array with inserted item
* @param integer $collection_index The index in the $this->collections array of the collection the item is beeing inserted into
* @param integer $collection_index The index in the $this->collections array of the collection the item is beeing inserted into
*
*/
public function after_inserted_item($insertedItem, $collection_index){}
/**
* runs one iteration
*/
public function run(){
/**
* runs one iteration
*/
public function run(){
if ($this->is_finished()) {
return false;
@ -893,7 +879,6 @@ abstract class Importer {
$author = $this->get_transient('author');
$this->add_log('---------------------------');
$this->add_log('Starting processing new item');
$this->add_log(date("Y-m-d H:i:s"));
$this->add_log('User in process: ' . $author);
wp_set_current_user($author);
$result = $this->$method_name();
@ -911,41 +896,41 @@ abstract class Importer {
}
return $return;
}
}
/**
* @param $metadata_description
* @param $collection_id
* @return bool
* @throws \Exception
*/
public function create_new_metadata( $metadata_description, $collection_id, $parent_id = null){
$taxonomy_repo = \Tainacan\Repositories\Taxonomies::get_instance();
$metadata_repo = \Tainacan\Repositories\Metadata::get_instance();
/**
* @param $metadata_description
* @param $collection_id
* @return bool
* @throws \Exception
*/
public function create_new_metadata( $metadata_description, $collection_id, $parent_id = null){
$taxonomy_repo = \Tainacan\Repositories\Taxonomies::get_instance();
$metadata_repo = \Tainacan\Repositories\Metadata::get_instance();
if(is_array($metadata_description)) {
$parent_metadata_description = key($metadata_description);
$parent_compound = $this->create_new_metadata($parent_metadata_description, $collection_id);
if($parent_compound == false) return false;
$children_mapping = [];
foreach($metadata_description[$parent_metadata_description] as $children_metadata_description) {
$children_compound = $this->create_new_metadata($children_metadata_description, $collection_id, $parent_compound->get_id());
if ( $children_compound == false )
return false;
$children_mapping[$children_compound->get_id()] = $children_metadata_description;
}
return [$parent_compound, $children_mapping];
}
$properties = array_filter( explode('|', $metadata_description) );
if(is_array($metadata_description)) {
$parent_metadata_description = key($metadata_description);
$parent_compound = $this->create_new_metadata($parent_metadata_description, $collection_id);
if($parent_compound == false) return false;
$children_mapping = [];
foreach($metadata_description[$parent_metadata_description] as $children_metadata_description) {
$children_compound = $this->create_new_metadata($children_metadata_description, $collection_id, $parent_compound->get_id());
if ( $children_compound == false )
return false;
$children_mapping[$children_compound->get_id()] = $children_metadata_description;
}
return [$parent_compound, $children_mapping];
}
$properties = array_filter( explode('|', $metadata_description) );
if( is_array($properties) && count($properties) < 2 ){
$properties[1] = 'text';
} else if( !$properties ){
return false;
}
if( is_array($properties) && count($properties) < 2 ){
$properties[1] = 'text';
} else if( !$properties ){
return false;
}
$name = $properties[0];
$type = $properties[1];
$name = $properties[0];
$type = $properties[1];
$supported_types = \Tainacan\Repositories\Metadata::get_instance()->fetch_metadata_types('NAME');
$supported_types = array_map('strtolower', $supported_types);
@ -956,89 +941,89 @@ abstract class Importer {
$type = 'text';
}
$newMetadatum = new Entities\Metadatum();
$newMetadatum->set_name($name);
$newMetadatum = new Entities\Metadatum();
$newMetadatum->set_name($name);
$type = ucfirst($type);
$newMetadatum->set_metadata_type('Tainacan\Metadata_Types\\'.$type);
$newMetadatum->set_collection_id( (isset($collection_id)) ? $collection_id : 'default');
$newMetadatum->set_status('auto-draft');
if($newMetadatum->validate()) {
$newMetadatum = $metadata_repo->insert( $newMetadatum );
} else {
$this->add_log('Error creating metadata ' . $name . ' in collection ' . $collection_id);
$this->add_log($newMetadatum->get_errors());
return false;
}
$newMetadatum->set_status('publish');
$type = ucfirst($type);
$newMetadatum->set_metadata_type('Tainacan\Metadata_Types\\'.$type);
$newMetadatum->set_collection_id( (isset($collection_id)) ? $collection_id : 'default');
$newMetadatum->set_status('auto-draft');
if($newMetadatum->validate()) {
$newMetadatum = $metadata_repo->insert( $newMetadatum );
} else {
$this->add_log('Error creating metadata ' . $name . ' in collection ' . $collection_id);
$this->add_log($newMetadatum->get_errors());
return false;
}
$newMetadatum->set_status('publish');
if( strcmp(strtolower($type), "taxonomy") === 0 ){
$taxonomy = new Entities\Taxonomy();
$taxonomy->set_name($name);
$taxonomy->set_status('publish');
$taxonomy->set_allow_insert('yes');
if( strcmp(strtolower($type), "taxonomy") === 0 ){
$taxonomy = new Entities\Taxonomy();
$taxonomy->set_name($name);
$taxonomy->set_status('publish');
$taxonomy->set_allow_insert('yes');
if( $taxonomy->validate() ){
$inserted_tax = $taxonomy_repo->insert( $taxonomy );
if(is_array($properties) && in_array( 'multiple', $properties) ){
$newMetadatum->set_metadata_type_options([
'taxonomy_id' => $inserted_tax->get_id(),
'allow_new_terms' => 'yes',
'input_type' => 'tainacan-taxonomy-checkbox'
]);
} else {
$newMetadatum->set_metadata_type_options([
'taxonomy_id' => $inserted_tax->get_id(),
'allow_new_terms' => 'no',
'input_type' => 'tainacan-taxonomy-radio'
]);
}
}
}
if( $taxonomy->validate() ){
$inserted_tax = $taxonomy_repo->insert( $taxonomy );
if(is_array($properties) && in_array( 'multiple', $properties) ){
$newMetadatum->set_metadata_type_options([
'taxonomy_id' => $inserted_tax->get_id(),
'allow_new_terms' => 'yes',
'input_type' => 'tainacan-taxonomy-checkbox'
]);
} else {
$newMetadatum->set_metadata_type_options([
'taxonomy_id' => $inserted_tax->get_id(),
'allow_new_terms' => 'no',
'input_type' => 'tainacan-taxonomy-radio'
]);
}
}
}
/*Properties of metadatum*/
if( is_array($properties) && in_array( 'required', $properties)){
$newMetadatum->set_required('yes');
}
/*Properties of metadatum*/
if( is_array($properties) && in_array( 'required', $properties)){
$newMetadatum->set_required('yes');
}
if(is_array($properties) && in_array( 'multiple', $properties) ){
$newMetadatum->set_multiple('yes');
}
if(is_array($properties) && in_array( 'multiple', $properties) ){
$newMetadatum->set_multiple('yes');
}
if( is_array($properties) && in_array( 'display_yes', $properties) ){
$newMetadatum->set_display('yes');
} else if(is_array($properties) && in_array( 'display_no', $properties) ){
$newMetadatum->set_display('no');
} else if(is_array($properties) && in_array( 'display_never', $properties) ){
$newMetadatum->set_display('never');
}
if( is_array($properties) && in_array( 'display_yes', $properties) ){
$newMetadatum->set_display('yes');
} else if(is_array($properties) && in_array( 'display_no', $properties) ){
$newMetadatum->set_display('no');
} else if(is_array($properties) && in_array( 'display_never', $properties) ){
$newMetadatum->set_display('never');
}
if( is_array($properties) && in_array( 'status_public', $properties) ){
$newMetadatum->set_status('publish');
} else if( is_array($properties) && in_array( 'status_private', $properties) ){
$newMetadatum->set_status('private');
}
if( is_array($properties) && in_array( 'status_public', $properties) ){
$newMetadatum->set_status('publish');
} else if( is_array($properties) && in_array( 'status_private', $properties) ){
$newMetadatum->set_status('private');
}
if( is_array($properties) && in_array( 'collection_key_yes', $properties) ){
$newMetadatum->set_collection_key('yes');
} else if( is_array($properties) && in_array( 'collection_key_no', $properties) ){
$newMetadatum->set_collection_key('no');
}
if( is_array($properties) && in_array( 'collection_key_yes', $properties) ){
$newMetadatum->set_collection_key('yes');
} else if( is_array($properties) && in_array( 'collection_key_no', $properties) ){
$newMetadatum->set_collection_key('no');
}
if(isset($parent_id) && $parent_id != null) {
$newMetadatum->set_parent($parent_id);
}
if(isset($parent_id) && $parent_id != null) {
$newMetadatum->set_parent($parent_id);
}
if($newMetadatum->validate()){
$inserted_metadata = $metadata_repo->insert( $newMetadatum );
if($newMetadatum->validate()){
$inserted_metadata = $metadata_repo->insert( $newMetadatum );
$this->add_log('Metadata created: ' . $inserted_metadata->get_name());
return $inserted_metadata;
} else {
$this->add_log('Error creating metadata ' . $name . ' in collection ' . $collection_id);
$this->add_log($newMetadatum->get_errors());
$this->add_log('Metadata created: ' . $inserted_metadata->get_name());
return $inserted_metadata;
} else {
$this->add_log('Error creating metadata ' . $name . ' in collection ' . $collection_id);
$this->add_log($newMetadatum->get_errors());
return false;
}
}
return false;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,6 @@ use \Tainacan\Entities;
class Old_Tainacan extends Importer{
protected $steps = [
[
'name' => 'Create Taxonomies',
'progress_label' => 'Creating taxonomies',
@ -33,7 +32,6 @@ class Old_Tainacan extends Importer{
'callback' => 'link_relationships',
'total' => 5
]
];
protected $tainacan_api_address, $wordpress_api_address, $actual_collection;
@ -64,8 +62,7 @@ class Old_Tainacan extends Importer{
*
*/
public function create_taxonomies() {
if(!$this->get_url()){
if (!$this->get_url()) {
$this->add_error_log('Site url not found');
$this->abort();
return false;
@ -74,57 +71,49 @@ class Old_Tainacan extends Importer{
$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 = new Entities\Taxonomy();
$tax->set_name( $taxonomy->name );
$tax->set_description( $taxonomy->description );
$tax->set_allow_insert('yes');
$tax->set_status('publish');
if ($tax->validate()) {
$tax = $this->tax_repo->insert($tax);
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_transient('tax_' . $taxonomy->term_id . '_id', $tax->get_id());
$this->add_transient('tax_' . $taxonomy->term_id . '_name', $tax->get_name());
$this->add_transient('tax_' . $taxonomy->term_id . '_id', $tax->get_id());
$this->add_transient('tax_' . $taxonomy->term_id . '_name', $tax->get_name());
if (isset($taxonomy->children) && $tax) {
$this->add_all_terms($tax, $taxonomy->children);
}
if (isset($taxonomy->children) && $tax) {
$this->add_all_terms($tax, $taxonomy->children);
}
} else {
$this->add_log('Error creating taxonomy ' . $taxonomy->name );
$this->add_log($tax->get_errors());
}
$this->add_log('Error creating taxonomy ' . $taxonomy->name );
$this->add_log($tax->get_errors());
}
}
}
return false;
}
}
/**
* create the repository metadata which each collection inherits by default
*
*/
public function create_repo_metadata(){
$this->add_log('Creating repository metadata');
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 );
} elseif ( strpos($metadata->slug, 'socialdb_property_fixed_tags') !== false ) {
$metadatum_id = $this->create_metadata( $metadata );
}
}
if (isset($metadata->slug) && strpos($metadata->slug, 'socialdb_property_fixed') === false) {
$metadatum_id = $this->create_metadata( $metadata );
} elseif ( strpos($metadata->slug, 'socialdb_property_fixed_tags') !== false ){
$metadatum_id = $this->create_metadata( $metadata );
}
}
$this->add_log('FInished repository metadata');
return false;
}
$this->add_log('FInished repository metadata');
return false;
}
/**
* create all collections and its metadata

View File

@ -316,11 +316,9 @@ class Test_Importer extends Importer {
</div>
</div>
</div>
</div>
<?php
return ob_get_clean();
}
@ -334,7 +332,6 @@ class Test_Importer extends Importer {
if ($tax1->validate()) {
$tax1 = $this->tax_repo->insert($tax1);
} else {
/**
* In these set up steps, if we have an error adding
* a taxonomy, collection or metadatum, there is no point
@ -345,14 +342,12 @@ class Test_Importer extends Importer {
$this->add_error_log('Error creating taxonomy Color');
$this->add_error_log($tax1->get_errors());
$this->abort();
return false;
return false;
}
$this->add_transient('tax_1_id', $tax1->get_id());
return false;
}
public function create_collections() {
@ -366,11 +361,9 @@ class Test_Importer extends Importer {
$this->add_error_log('Error creating Collection 1');
$this->add_error_log($col1->get_errors());
$this->abort();
return false;
return false;
}
$col1_map = [];
// metadata
@ -696,8 +689,7 @@ class Test_Importer extends Importer {
* @param $collection
*
*/
private function create_metadata( $args, $collection ){
private function create_metadata( $args, $collection ) {
$metadatum = new Entities\Metadatum();
$metadatum->set_name($args['name']);
$metadatum->set_collection($collection);
@ -758,7 +750,6 @@ class Test_Importer extends Importer {
return $array;
}
public function get_col2_item($index) {
return [
'field1' => 'Collection 2 item ' . $index,
@ -766,7 +757,5 @@ class Test_Importer extends Importer {
'field3' => 'Collection 2 whatever ' . $index,
];
}
}

View File

@ -226,6 +226,7 @@
$this->debug('process already running');
return true;
}
$this->debug('process not already running');
return false;
}
@ -241,10 +242,11 @@
$this->debug('locking process: ' . $this->identifier);
$this->start_time = time(); // Set start time of current process.
$max_execution_time = ini_get('max_execution_time');
$lock_duration = ( property_exists( $this, 'queue_lock_time' ) ) ? $this->queue_lock_time : ( empty($max_execution_time) ? 60 : $max_execution_time ); // 1 minute
$lock_duration = ( property_exists( $this, 'queue_lock_time' ) ) ? $this->queue_lock_time : ( empty($max_execution_time) ? 60 : ($max_execution_time * 1.5) ); // 1 minute
$lock_duration = apply_filters( $this->identifier . '_queue_lock_time', $lock_duration );
set_site_transient( $this->identifier . '_process_lock', microtime(), $lock_duration );
$this->process_lock_in_time = microtime();
if(!$this->is_process_running())
set_site_transient( $this->identifier . '_process_lock', $this->process_lock_in_time, $lock_duration );
}
/**

View File

@ -26,7 +26,7 @@ class Collections extends Repository {
* {@inheritDoc}
* @see \Tainacan\Repositories\Repository::get_map()
*/
protected function _get_map() {
protected function _get_map() {
return apply_filters( 'tainacan-get-map-' . $this->get_name(), [
'name' => [
'map' => 'post_title',
@ -40,7 +40,7 @@ class Collections extends Repository {
'title' => __( 'Status', 'tainacan' ),
'type' => 'string',
'default' => '',
'description' => __( 'The current situation of the post', 'tainacan' )
'description' => __( 'The current situation of the collection. It also affects the visibility of the collection items, as public items from private collections do not appear in the site.', 'tainacan' )
],
'author_id' => [
'map' => 'post_author',
@ -169,7 +169,7 @@ class Collections extends Repository {
'map' => 'meta',
'title' => __( 'Header Image', 'tainacan' ),
'type' => 'string',
'description' => __( 'The image to be used in collection header', 'tainacan' ),
'description' => __( 'The image to be used in collection header, if the theme has one.', 'tainacan' ),
'on_error' => __( 'Invalid image', 'tainacan' ),
//'validation' => v::numeric(),
'default' => ''
@ -189,10 +189,10 @@ class Collections extends Repository {
],
'allow_comments' => [
'map' => 'meta',
'title' => __( 'Allow Items Comments', 'tainacan' ),
'type' => 'string',
'description' => __( 'Collection items comment status: "open" means comments are allowed, "closed" means comments are not allowed.', 'tainacan' ),
'default' => 'open',
'title' => __( 'Allow enabling comments on items', 'tainacan' ),
'type' => 'string',
'description' => __( 'If this option is enabled, items of this collection can be set to enable a comments section on their page. "open" means comments are allowed, "closed" means comments are not allowed.', 'tainacan' ),
'default' => 'closed',
'validation' => v::optional(v::stringType()->in( [ 'open', 'closed' ] )),
],
'submission_anonymous_user' => [
@ -303,10 +303,9 @@ class Collections extends Repository {
* @see \Tainacan\Repositories\Repository::insert()
*/
public function insert( $collection ) {
$this->pre_process( $collection );
$this->pre_process( $collection );
$this->handle_parent_order_clone( $collection );
$new_collection = parent::insert( $collection );
$this->handle_core_metadata( $new_collection );
@ -389,12 +388,9 @@ class Collections extends Repository {
}
function pre_process( $collection ) {
$this->old_collection = $this->fetch( $collection->get_id() );
$this->old_core_title = $collection->get_core_title_metadatum();
$this->old_core_description = $collection->get_core_description_metadatum();
}
function handle_core_metadata( $collection ) {

Some files were not shown because too many files have changed in this diff Show More