From 0d8e8400ceb0faba0a428bf7ddfe48e16a8f5aa0 Mon Sep 17 00:00:00 2001 From: John James Jacoby Date: Sun, 29 Nov 2020 19:38:33 -0600 Subject: [PATCH] WIP - Release/2.1.0 (#88) Merge 2.1.0 to master. Co-authored-by: Jon Christopher Co-authored-by: Pippin Williamson Co-authored-by: Phil Derksen --- .gitignore | 1 + .travis.yml | 26 +- Gruntfile.js | 21 + composer.json | 16 + package-lock.json | 903 ++++++++++-------- package.json | 10 +- phpunit.xml | 7 +- readme.txt | 4 +- sugar-calendar-lite.php | 2 +- sugar-calendar/includes/admin/assets.php | 20 +- .../admin/assets/css/ltr/sc-calendar.css | 17 +- .../admin/assets/css/ltr/sc-taxonomy.css | 87 ++ .../admin/assets/css/min/ltr/sc-calendar.css | 2 +- .../admin/assets/css/min/ltr/sc-taxonomy.css | 1 + .../admin/assets/css/min/rtl/sc-calendar.css | 2 +- .../admin/assets/css/min/rtl/sc-taxonomy.css | 1 + .../admin/assets/css/rtl/sc-calendar.css | 17 +- .../admin/assets/css/rtl/sc-taxonomy.css | 87 ++ .../includes/admin/assets/js/sc-meta-box.js | 2 +- .../includes/admin/assets/js/sc-taxonomy.js | 89 ++ .../includes/admin/assets/js/term-timezone.js | 20 + sugar-calendar/includes/admin/general.php | 40 +- sugar-calendar/includes/admin/help.php | 38 +- sugar-calendar/includes/admin/hooks.php | 4 +- .../list-tables/class-wp-list-table-base.php | 327 ++++--- .../list-tables/class-wp-list-table-day.php | 32 +- .../list-tables/class-wp-list-table-list.php | 156 ++- .../list-tables/class-wp-list-table-month.php | 10 +- .../list-tables/class-wp-list-table-week.php | 46 +- sugar-calendar/includes/admin/menu.php | 10 +- sugar-calendar/includes/admin/meta-boxes.php | 313 ++++-- sugar-calendar/includes/admin/nav.php | 23 +- sugar-calendar/includes/admin/posts.php | 12 +- .../includes/admin/screen-options.php | 29 +- sugar-calendar/includes/admin/settings.php | 193 +++- sugar-calendar/includes/admin/upgrades.php | 6 +- .../classes/database/engine/class-base.php | 2 +- .../classes/database/engine/class-column.php | 10 +- .../classes/database/engine/class-query.php | 70 +- .../classes/database/engine/class-table.php | 159 +-- .../classes/database/events/class-row.php | 17 +- .../class-term-colors.php | 4 +- .../classes/terms/class-term-timezones.php | 249 +++++ .../class-term-meta-ui.php | 0 .../classes/utilities/ical-to-array.php | 4 +- sugar-calendar/includes/common/assets.php | 2 +- sugar-calendar/includes/common/editor.php | 14 + sugar-calendar/includes/common/general.php | 215 ++++- sugar-calendar/includes/common/hooks.php | 3 + .../includes/common/preferences.php | 75 +- sugar-calendar/includes/common/settings.php | 34 + sugar-calendar/includes/common/time-zones.php | 902 +++++++++++++++++ sugar-calendar/includes/common/time.php | 15 +- sugar-calendar/includes/events/functions.php | 22 +- sugar-calendar/includes/events/meta-data.php | 11 + .../includes/languages/sugar-calendar.pot | 609 ++++++------ sugar-calendar/includes/post/feed.php | 4 +- sugar-calendar/includes/post/functions.php | 90 +- sugar-calendar/includes/post/meta.php | 8 +- .../includes/post/query-filters.php | 10 +- sugar-calendar/includes/post/taxonomies.php | 1 + .../includes/themes/legacy/calendar.php | 8 +- .../includes/themes/legacy/event-display.php | 60 +- .../includes/themes/legacy/events-list.php | 13 +- .../includes/themes/legacy/functions.php | 393 ++++---- .../themes/legacy/js/sc-time-zones.js | 32 + .../includes/themes/legacy/scripts.php | 30 +- sugar-calendar/sugar-calendar.php | 14 +- tests/phpunit/bootstrap.php | 2 +- tests/phpunit/listener-loader.php | 7 + .../phpunit/phpunit7/speed-trap-listener.php | 307 ++++++ tests/phpunit/speed-trap-listener.php | 2 +- .../testcases/admin/tests-meta-box.php | 20 +- .../testcases/common/tests-time-zones.php | 120 +++ .../testcases/legacy/tests-settings.php | 80 +- .../phpunit/testcases/post/tests-taxonomy.php | 6 +- 76 files changed, 4616 insertions(+), 1582 deletions(-) create mode 100644 composer.json create mode 100644 sugar-calendar/includes/admin/assets/css/ltr/sc-taxonomy.css create mode 100644 sugar-calendar/includes/admin/assets/css/min/ltr/sc-taxonomy.css create mode 100644 sugar-calendar/includes/admin/assets/css/min/rtl/sc-taxonomy.css create mode 100644 sugar-calendar/includes/admin/assets/css/rtl/sc-taxonomy.css create mode 100644 sugar-calendar/includes/admin/assets/js/sc-taxonomy.js create mode 100644 sugar-calendar/includes/admin/assets/js/term-timezone.js rename sugar-calendar/includes/classes/{term-colors => terms}/class-term-colors.php (94%) create mode 100644 sugar-calendar/includes/classes/terms/class-term-timezones.php rename sugar-calendar/includes/classes/{term-colors => utilities}/class-term-meta-ui.php (100%) create mode 100644 sugar-calendar/includes/common/settings.php create mode 100644 sugar-calendar/includes/common/time-zones.php create mode 100644 sugar-calendar/includes/themes/legacy/js/sc-time-zones.js create mode 100644 tests/phpunit/listener-loader.php create mode 100644 tests/phpunit/phpunit7/speed-trap-listener.php create mode 100644 tests/phpunit/testcases/common/tests-time-zones.php diff --git a/.gitignore b/.gitignore index 80b03182..673b7962 100644 --- a/.gitignore +++ b/.gitignore @@ -42,6 +42,7 @@ tests/clover.xml # Node node_modules +pnpm-lock.yaml # Vendor /vendor diff --git a/.travis.yml b/.travis.yml index d5f38562..2bd18a79 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,11 +10,10 @@ notifications: branches: only: - - master + - /^release\/.*$/ cache: directories: - - vendor - $HOME/.composer/cache matrix: @@ -45,7 +44,28 @@ before_script: - | if [[ ! -z "$WP_VERSION" ]] ; then bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION - composer global require "phpunit/phpunit=4.8.*|5.7.*" + fi + - | + # Install the specified version of PHPUnit depending on the PHP version: + if [[ "$WP_TRAVISCI" == "travis:phpunit" ]]; then + case "$TRAVIS_PHP_VERSION" in + 7.4|7.3|nightly) + echo "Using PHPUnit 7.x" + composer global require "phpunit/phpunit:^7" + ;; + 7.2|7.1|7.0) + echo "Using PHPUnit 6.x" + composer global require "phpunit/phpunit:^6" + ;; + 5.6|5.5|5.4) + echo "Using PHPUnit 4.x" + composer global require "phpunit/phpunit:^4" + ;; + *) + echo "No PHPUnit version handling for PHP version $TRAVIS_PHP_VERSION" + exit 1 + ;; + esac fi script: diff --git a/Gruntfile.js b/Gruntfile.js index c573679a..54eb7fb6 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -106,6 +106,13 @@ module.exports = function( grunt ) { dest: '<%= pkg.name %>/includes/admin/assets/css/rtl', ext: '.css', }, + { + expand: true, + cwd: '<%= pkg.name %>/includes/admin/assets/css/ltr', + src: [ 'sc-taxonomy.css' ], + dest: '<%= pkg.name %>/includes/admin/assets/css/rtl', + ext: '.css', + }, ], }, }, @@ -172,6 +179,13 @@ module.exports = function( grunt ) { dest: '<%= pkg.name %>/includes/admin/assets/css/min/ltr', ext: '.css', }, + { + expand: true, + cwd: '<%= pkg.name %>/includes/admin/assets/css/ltr', + src: [ 'sc-taxonomy.css' ], + dest: '<%= pkg.name %>/includes/admin/assets/css/min/ltr', + ext: '.css', + }, ], }, rtl: { @@ -232,6 +246,13 @@ module.exports = function( grunt ) { dest: '<%= pkg.name %>/includes/admin/assets/css/min/rtl', ext: '.css', }, + { + expand: true, + cwd: '<%= pkg.name %>/includes/admin/assets/css/rtl', + src: [ 'sc-taxonomy.css' ], + dest: '<%= pkg.name %>/includes/admin/assets/css/min/rtl', + ext: '.css', + }, ], }, }, diff --git a/composer.json b/composer.json new file mode 100644 index 00000000..5a99fffa --- /dev/null +++ b/composer.json @@ -0,0 +1,16 @@ +{ + "name": "sugarcalendar/core", + "type": "wordpress-plugin", + "description": "Sugar Calendar Plugin for WordPress", + "keywords": ["wordpress", "sugarcalendar", "calendar", "events"], + "homepage": "https://sugarcalendar.com", + "license": "GPL-2.0+", + "require": { + "php": ">=7.0.0", + "composer/installers": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "4.8.* || 5.7.*" + }, + "minimum-stability": "dev" +} diff --git a/package-lock.json b/package-lock.json index 27598cad..c97bcef7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "sugar-calendar", - "version": "2.0.21", + "version": "2.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1068,9 +1068,9 @@ } }, "@types/json-schema": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.5.tgz", - "integrity": "sha512-7+2BITlgjgDhH0vvwZU/HZJVyk+2XUlvxXe8dFMedNX/aMkaOq++rMAFXc0tM7ij15QaWlbdQASBR9dihi+bDQ==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz", + "integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==", "dev": true }, "@webassemblyjs/ast": { @@ -1327,21 +1327,13 @@ "dev": true }, "aggregate-error": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", - "integrity": "sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", "dev": true, "requires": { "clean-stack": "^2.0.0", "indent-string": "^4.0.0" - }, - "dependencies": { - "indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "dev": true - } } }, "ajv": { @@ -1519,10 +1511,10 @@ "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=", "dev": true }, - "array-find-index": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", - "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "array-each": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", + "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=", "dev": true }, "array-includes": { @@ -1595,6 +1587,12 @@ } } }, + "array-slice": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz", + "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==", + "dev": true + }, "array-union": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", @@ -2350,24 +2348,6 @@ "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true }, - "camelcase-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", - "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", - "dev": true, - "requires": { - "camelcase": "^2.0.0", - "map-obj": "^1.0.0" - }, - "dependencies": { - "camelcase": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", - "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", - "dev": true - } - } - }, "caniuse-lite": { "version": "1.0.30001104", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001104.tgz", @@ -2552,12 +2532,6 @@ "dev": true, "optional": true }, - "coffeescript": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/coffeescript/-/coffeescript-1.10.0.tgz", - "integrity": "sha1-56qDAZF+9iGzXYo580jc3R234z4=", - "dev": true - }, "collection-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", @@ -2686,21 +2660,21 @@ "dev": true }, "copy-webpack-plugin": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-6.0.3.tgz", - "integrity": "sha512-q5m6Vz4elsuyVEIUXr7wJdIdePWTubsqVbEMvf1WQnHGv0Q+9yPRu7MtYFPt+GBOXRav9lvIINifTQ1vSCs+eA==", + "version": "6.3.2", + "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-6.3.2.tgz", + "integrity": "sha512-MgJ1uouLIbDg4ST1GzqrGQyKoXY5iPqi6fghFqarijam7FQcBa/r6Rg0VkoIuzx75Xq8iAMghyOueMkWUQ5OaA==", "dev": true, "requires": { - "cacache": "^15.0.4", + "cacache": "^15.0.5", "fast-glob": "^3.2.4", "find-cache-dir": "^3.3.1", "glob-parent": "^5.1.1", "globby": "^11.0.1", "loader-utils": "^2.0.0", "normalize-path": "^3.0.0", - "p-limit": "^3.0.1", - "schema-utils": "^2.7.0", - "serialize-javascript": "^4.0.0", + "p-limit": "^3.0.2", + "schema-utils": "^3.0.0", + "serialize-javascript": "^5.0.1", "webpack-sources": "^1.4.3" }, "dependencies": { @@ -2954,15 +2928,6 @@ "randomfill": "^1.0.3" } }, - "currently-unhandled": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", - "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", - "dev": true, - "requires": { - "array-find-index": "^1.0.1" - } - }, "cyclist": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", @@ -2976,14 +2941,10 @@ "dev": true }, "dateformat": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.12.tgz", - "integrity": "sha1-nxJLZ1lMk3/3BpMuSmQsyo27/uk=", - "dev": true, - "requires": { - "get-stdin": "^4.0.1", - "meow": "^3.3.0" - } + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", + "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==", + "dev": true }, "debug": { "version": "4.1.1", @@ -3135,14 +3096,6 @@ "dev": true, "requires": { "path-type": "^4.0.0" - }, - "dependencies": { - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true - } } }, "doctrine": { @@ -3280,15 +3233,6 @@ "prr": "~1.0.1" } }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, "es-abstract": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", @@ -3620,6 +3564,12 @@ "homedir-polyfill": "^1.0.1" } }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, "extend-shallow": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", @@ -3750,9 +3700,9 @@ "dev": true }, "fastq": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.8.0.tgz", - "integrity": "sha512-SMIZoZdLh/fgofivvIkmknUXyPnvxRE3DhtZ5Me3Mrsk5gyPL42F0xr51TdRXskBxHfMp+07bcYzfsYEsSQA9Q==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.9.0.tgz", + "integrity": "sha512-i7FVWL8HhVY+CTkwFxkN2mk3h+787ixS5S63eb78diVRc1MCssarHq3W5cj0av7YDSwmaV928RNag+U1etRQ7w==", "dev": true, "requires": { "reusify": "^1.0.4" @@ -3866,6 +3816,25 @@ } } }, + "fined": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fined/-/fined-1.2.0.tgz", + "integrity": "sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==", + "dev": true, + "requires": { + "expand-tilde": "^2.0.2", + "is-plain-object": "^2.0.3", + "object.defaults": "^1.1.0", + "object.pick": "^1.2.0", + "parse-filepath": "^1.0.1" + } + }, + "flagged-respawn": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz", + "integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==", + "dev": true + }, "flat-cache": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", @@ -3909,6 +3878,15 @@ "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", "dev": true }, + "for-own": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", + "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", + "dev": true, + "requires": { + "for-in": "^1.0.1" + } + }, "fragment-cache": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", @@ -4044,12 +4022,6 @@ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, - "get-stdin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", - "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", - "dev": true - }, "get-value": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", @@ -4186,67 +4158,97 @@ "dev": true }, "grunt": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.1.0.tgz", - "integrity": "sha512-+NGod0grmviZ7Nzdi9am7vuRS/h76PcWDsV635mEXF0PEQMUV6Kb+OjTdsVxbi0PZmfQOjCMKb3w8CVZcqsn1g==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.3.0.tgz", + "integrity": "sha512-6ILlMXv11/4cxuhSMfSU+SfvbxrPuqZrAtLN64+tZpQ3DAKfSQPQHRbTjSbdtxfyQhGZPtN0bDZJ/LdCM5WXXA==", "dev": true, "requires": { - "coffeescript": "~1.10.0", - "dateformat": "~1.0.12", + "dateformat": "~3.0.3", "eventemitter2": "~0.4.13", - "exit": "~0.1.1", + "exit": "~0.1.2", "findup-sync": "~0.3.0", - "glob": "~7.0.0", - "grunt-cli": "~1.2.0", + "glob": "~7.1.6", + "grunt-cli": "~1.3.2", "grunt-known-options": "~1.1.0", - "grunt-legacy-log": "~2.0.0", - "grunt-legacy-util": "~1.1.1", + "grunt-legacy-log": "~3.0.0", + "grunt-legacy-util": "~2.0.0", "iconv-lite": "~0.4.13", - "js-yaml": "~3.13.1", - "minimatch": "~3.0.2", - "mkdirp": "~1.0.3", + "js-yaml": "~3.14.0", + "minimatch": "~3.0.4", + "mkdirp": "~1.0.4", "nopt": "~3.0.6", - "path-is-absolute": "~1.0.0", - "rimraf": "~2.6.2" + "rimraf": "~3.0.2" }, "dependencies": { "glob": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.0.6.tgz", - "integrity": "sha1-IRuvr0nlJbjNkyYNFKsTYVKz9Xo=", + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.2", + "minimatch": "^3.0.4", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } }, "grunt-cli": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.2.0.tgz", - "integrity": "sha1-VisRnrsGndtGSs4oRVAb6Xs1tqg=", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.3.2.tgz", + "integrity": "sha512-8OHDiZZkcptxVXtMfDxJvmN7MVJNE8L/yIcPb4HB7TlyFD1kDvjHrb62uhySsU14wJx9ORMnTuhRMQ40lH/orQ==", "dev": true, "requires": { - "findup-sync": "~0.3.0", "grunt-known-options": "~1.1.0", - "nopt": "~3.0.6", - "resolve": "~1.1.0" + "interpret": "~1.1.0", + "liftoff": "~2.5.0", + "nopt": "~4.0.1", + "v8flags": "~3.1.1" + }, + "dependencies": { + "nopt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", + "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", + "dev": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + } } }, - "mkdirp": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.3.tgz", - "integrity": "sha512-6uCP4Qc0sWsgMLy1EOqqS/3rjDHOEnsStVr/4vtAIK2Y5i2kA7lFFejYrpIyiN9w0pYf4ckeCYT9f1r1P9KX5g==", + "interpret": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz", + "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=", "dev": true }, - "resolve": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", - "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "js-yaml": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", + "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } } } }, @@ -4471,15 +4473,15 @@ "dev": true }, "grunt-legacy-log": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/grunt-legacy-log/-/grunt-legacy-log-2.0.0.tgz", - "integrity": "sha512-1m3+5QvDYfR1ltr8hjiaiNjddxGdQWcH0rw1iKKiQnF0+xtgTazirSTGu68RchPyh1OBng1bBUjLmX8q9NpoCw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/grunt-legacy-log/-/grunt-legacy-log-3.0.0.tgz", + "integrity": "sha512-GHZQzZmhyq0u3hr7aHW4qUH0xDzwp2YXldLPZTCjlOeGscAOWWPftZG3XioW8MasGp+OBRIu39LFx14SLjXRcA==", "dev": true, "requires": { "colors": "~1.1.2", - "grunt-legacy-log-utils": "~2.0.0", + "grunt-legacy-log-utils": "~2.1.0", "hooker": "~0.2.3", - "lodash": "~4.17.5" + "lodash": "~4.17.19" }, "dependencies": { "colors": { @@ -4491,28 +4493,87 @@ } }, "grunt-legacy-log-utils": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/grunt-legacy-log-utils/-/grunt-legacy-log-utils-2.0.1.tgz", - "integrity": "sha512-o7uHyO/J+i2tXG8r2bZNlVk20vlIFJ9IEYyHMCQGfWYru8Jv3wTqKZzvV30YW9rWEjq0eP3cflQ1qWojIe9VFA==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/grunt-legacy-log-utils/-/grunt-legacy-log-utils-2.1.0.tgz", + "integrity": "sha512-lwquaPXJtKQk0rUM1IQAop5noEpwFqOXasVoedLeNzaibf/OPWjKYvvdqnEHNmU+0T0CaReAXIbGo747ZD+Aaw==", "dev": true, "requires": { - "chalk": "~2.4.1", - "lodash": "~4.17.10" + "chalk": "~4.1.0", + "lodash": "~4.17.19" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } } }, "grunt-legacy-util": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/grunt-legacy-util/-/grunt-legacy-util-1.1.1.tgz", - "integrity": "sha512-9zyA29w/fBe6BIfjGENndwoe1Uy31BIXxTH3s8mga0Z5Bz2Sp4UCjkeyv2tI449ymkx3x26B+46FV4fXEddl5A==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/grunt-legacy-util/-/grunt-legacy-util-2.0.0.tgz", + "integrity": "sha512-ZEmYFB44bblwPE2oz3q3ygfF6hseQja9tx8I3UZIwbUik32FMWewA+d1qSFicMFB+8dNXDkh35HcDCWlpRsGlA==", "dev": true, "requires": { "async": "~1.5.2", "exit": "~0.1.1", "getobject": "~0.1.0", "hooker": "~0.2.3", - "lodash": "~4.17.10", - "underscore.string": "~3.3.4", + "lodash": "~4.17.20", + "underscore.string": "~3.3.5", "which": "~1.3.0" + }, + "dependencies": { + "lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "dev": true + } } }, "grunt-rtlcss": { @@ -4773,12 +4834,6 @@ "integrity": "sha1-uDT3I8xKJCqmWWNFnfbZhMXT2Vk=", "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==", - "dev": true - }, "https-browserify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", @@ -4853,13 +4908,10 @@ "dev": true }, "indent-string": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", - "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", - "dev": true, - "requires": { - "repeating": "^2.0.0" - } + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true }, "infer-owner": { "version": "1.0.4", @@ -5012,6 +5064,16 @@ "loose-envify": "^1.0.0" } }, + "is-absolute": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", + "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", + "dev": true, + "requires": { + "is-relative": "^1.0.0", + "is-windows": "^1.0.1" + } + }, "is-accessor-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", @@ -5032,12 +5094,6 @@ } } }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, "is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -5117,12 +5173,6 @@ "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "dev": true }, - "is-finite": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", - "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==", - "dev": true - }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", @@ -5162,6 +5212,15 @@ "has": "^1.0.1" } }, + "is-relative": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", + "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", + "dev": true, + "requires": { + "is-unc-path": "^1.0.0" + } + }, "is-string": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", @@ -5177,11 +5236,14 @@ "has-symbols": "^1.0.0" } }, - "is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", - "dev": true + "is-unc-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", + "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", + "dev": true, + "requires": { + "unc-path-regex": "^0.1.2" + } }, "is-windows": { "version": "1.0.2", @@ -5327,6 +5389,148 @@ "type-check": "~0.3.2" } }, + "liftoff": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-2.5.0.tgz", + "integrity": "sha1-IAkpG7Mc6oYbvxCnwVooyvdcMew=", + "dev": true, + "requires": { + "extend": "^3.0.0", + "findup-sync": "^2.0.0", + "fined": "^1.0.1", + "flagged-respawn": "^1.0.0", + "is-plain-object": "^2.0.4", + "object.map": "^1.0.0", + "rechoir": "^0.6.2", + "resolve": "^1.1.7" + }, + "dependencies": { + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "findup-sync": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", + "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", + "dev": true, + "requires": { + "detect-file": "^1.0.0", + "is-glob": "^3.1.0", + "micromatch": "^3.0.4", + "resolve-dir": "^1.0.1" + } + }, + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + } + } + }, "load-grunt-tasks": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/load-grunt-tasks/-/load-grunt-tasks-3.5.2.tgz", @@ -5339,27 +5543,6 @@ "resolve-pkg": "^0.1.0" } }, - "load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - } - } - }, "loader-runner": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.4.0.tgz", @@ -5413,16 +5596,6 @@ "js-tokens": "^3.0.0 || ^4.0.0" } }, - "loud-rejection": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", - "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", - "dev": true, - "requires": { - "currently-unhandled": "^0.4.1", - "signal-exit": "^3.0.0" - } - }, "lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -5441,6 +5614,15 @@ "pify": "^3.0.0" } }, + "make-iterator": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz", + "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==", + "dev": true, + "requires": { + "kind-of": "^6.0.2" + } + }, "makepot": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/makepot/-/makepot-0.3.0.tgz", @@ -5459,12 +5641,6 @@ "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", "dev": true }, - "map-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", - "dev": true - }, "map-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", @@ -5568,24 +5744,6 @@ "readable-stream": "^2.0.1" } }, - "meow": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", - "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", - "dev": true, - "requires": { - "camelcase-keys": "^2.0.0", - "decamelize": "^1.1.2", - "loud-rejection": "^1.0.0", - "map-obj": "^1.0.1", - "minimist": "^1.1.3", - "normalize-package-data": "^2.3.4", - "object-assign": "^4.0.1", - "read-pkg-up": "^1.0.1", - "redent": "^1.0.0", - "trim-newlines": "^1.0.0" - } - }, "merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -5688,18 +5846,18 @@ } }, "minipass-pipeline": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.3.tgz", - "integrity": "sha512-cFOknTvng5vqnwOpDsZTWhNll6Jf8o2x+/diplafmxpuIymAjzoOolZG0VvQf3V2HgqzJNhnuKHYp2BqDgz8IQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", + "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", "dev": true, "requires": { "minipass": "^3.0.0" } }, "minizlib": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.0.tgz", - "integrity": "sha512-EzTZN/fjSvifSX0SlqUERCN39o6T40AMarPbv0MrarSFtIITCBh7bi+dU8nxGFHuqs9jdIAeoYoKuQAAASsPPA==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", "dev": true, "requires": { "minipass": "^3.0.0", @@ -5947,18 +6105,6 @@ "abbrev": "1" } }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, - "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, "normalize-path": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", @@ -6057,6 +6203,18 @@ "object-keys": "^1.0.11" } }, + "object.defaults": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", + "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=", + "dev": true, + "requires": { + "array-each": "^1.0.1", + "array-slice": "^1.0.0", + "for-own": "^1.0.0", + "isobject": "^3.0.0" + } + }, "object.entries": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.2.tgz", @@ -6208,6 +6366,16 @@ "es-abstract": "^1.5.1" } }, + "object.map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz", + "integrity": "sha1-z4Plncj8wK1fQlDh94s7gb2AHTc=", + "dev": true, + "requires": { + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" + } + }, "object.pick": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", @@ -6326,12 +6494,28 @@ "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", "dev": true }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true + }, "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, + "osenv": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", + "dev": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, "p-limit": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.1.0.tgz", @@ -6405,13 +6589,15 @@ "safe-buffer": "^5.1.1" } }, - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "parse-filepath": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz", + "integrity": "sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE=", "dev": true, "requires": { - "error-ex": "^1.2.0" + "is-absolute": "^1.0.0", + "map-cache": "^0.2.0", + "path-root": "^0.1.1" } }, "parse-passwd": { @@ -6469,25 +6655,27 @@ "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, - "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "path-root": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz", + "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=", "dev": true, "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - } + "path-root-regex": "^0.1.0" } }, + "path-root-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz", + "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=", + "dev": true + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, "pbkdf2": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", @@ -6780,48 +6968,6 @@ "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", "dev": true }, - "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", - "dev": true, - "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", - "dev": true, - "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - }, - "dependencies": { - "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", - "dev": true, - "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "dev": true, - "requires": { - "pinkie-promise": "^2.0.0" - } - } - } - }, "readable-stream": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", @@ -6847,14 +6993,13 @@ "picomatch": "^2.2.1" } }, - "redent": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", - "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", "dev": true, "requires": { - "indent-string": "^2.1.0", - "strip-indent": "^1.0.1" + "resolve": "^1.1.6" } }, "regenerate": { @@ -7027,15 +7172,6 @@ "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", "dev": true }, - "repeating": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", - "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", - "dev": true, - "requires": { - "is-finite": "^1.0.0" - } - }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -7193,9 +7329,9 @@ "dev": true }, "run-parallel": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", - "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==", + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.10.tgz", + "integrity": "sha512-zb/1OuZ6flOlH6tQyMPUrE3x3Ulxjlo9WIVXR4yVYi4H9UXQaeIsPbLn2R3O3vQCnDKkAl2qHiuocKKX4Tz/Sw==", "dev": true }, "run-queue": { @@ -7238,14 +7374,34 @@ "dev": true }, "schema-utils": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.0.tgz", - "integrity": "sha512-0ilKFI6QQF5nxDZLFn2dMjvc4hjg/Wkg7rHd3jK6/A4a1Hl9VFdQWvgB1UMGoU94pad1P/8N7fMcEnLnSiju8A==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.0.0.tgz", + "integrity": "sha512-6D82/xSzO094ajanoOSbe4YvXWMfn2A//8Y1+MUqFAJul5Bs+yn36xbK9OtNDcRVSBJ9jjeoXftM6CfztsjOAA==", "dev": true, "requires": { - "@types/json-schema": "^7.0.4", - "ajv": "^6.12.2", - "ajv-keywords": "^3.4.1" + "@types/json-schema": "^7.0.6", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + }, + "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true + } } }, "semver": { @@ -7255,9 +7411,9 @@ "dev": true }, "serialize-javascript": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", - "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", + "integrity": "sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==", "dev": true, "requires": { "randombytes": "^2.1.0" @@ -7605,38 +7761,6 @@ "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", "dev": true }, - "spdx-correct": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", - "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", - "dev": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", - "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", - "dev": true - }, - "spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", - "dev": true, - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", - "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", - "dev": true - }, "split-string": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", @@ -7966,24 +8090,6 @@ "ansi-regex": "^3.0.0" } }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "dev": true, - "requires": { - "is-utf8": "^0.2.0" - } - }, - "strip-indent": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", - "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", - "dev": true, - "requires": { - "get-stdin": "^4.0.1" - } - }, "strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", @@ -8052,15 +8158,15 @@ "dev": true }, "tar": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.0.2.tgz", - "integrity": "sha512-Glo3jkRtPcvpDlAs/0+hozav78yoXKFr+c4wgw62NNMO3oo4AaJdCo21Uu7lcwr55h39W2XD1LMERc64wtbItg==", + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.0.5.tgz", + "integrity": "sha512-0b4HOimQHj9nXNEAA7zWwMM91Zhhba3pspja6sQbgTpynOJf+bkjBnfybNYzbpLbnwXnbyB4LOREvlyXLkCHSg==", "dev": true, "requires": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", "minipass": "^3.0.0", - "minizlib": "^2.1.0", + "minizlib": "^2.1.1", "mkdirp": "^1.0.3", "yallist": "^4.0.0" }, @@ -8424,12 +8530,6 @@ "is-number": "^7.0.0" } }, - "trim-newlines": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", - "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", - "dev": true - }, "trim-right": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", @@ -8598,6 +8698,12 @@ } } }, + "unc-path-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", + "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", + "dev": true + }, "underscore": { "version": "1.10.2", "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.10.2.tgz", @@ -8789,14 +8895,13 @@ "integrity": "sha512-8OQ9CL+VWyt3JStj7HX7/ciTL2V3Rl1Wf5OL+SNTm0yK1KvtReVulksyeRnCANHHuUxHlQig+JJDlUhBt1NQDQ==", "dev": true }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "v8flags": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.1.3.tgz", + "integrity": "sha512-amh9CCg3ZxkzQ48Mhcb8iX7xpAfYJgePHxWMQCBWECpOSqJUXgY26ncA61UTV0BkPqfhcy6mzwCIoP4ygxpW8w==", "dev": true, "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" + "homedir-polyfill": "^1.0.1" } }, "vm-browserify": { diff --git a/package.json b/package.json index 973702d6..d1b67d48 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sugar-calendar", - "version": "2.0.21", + "version": "2.1.0", "description": "A calendar with a sweet disposition.", "private": true, "license": "GPL-2.0-or-later", @@ -35,18 +35,18 @@ "@wordpress/browserslist-config": "2.3.0", "@wordpress/eslint-plugin": "2.1.0", "babel-loader": "8.0.5", - "copy-webpack-plugin": "^6.0.3", + "copy-webpack-plugin": "^6.3.2", "cross-env": "5.2.0", "eslint": "5.16.0", - "grunt": "^1.0.4", + "grunt": "^1.3.0", "grunt-checktextdomain": "^1.0.1", "grunt-contrib-clean": "^1.1.0", - "grunt-contrib-compress": "^1.4.3", + "grunt-contrib-compress": "^1.6.0", "grunt-contrib-copy": "^1.0.0", "grunt-contrib-cssmin": "^2.2.1", "grunt-force-task": "^2.0.0", "grunt-git": "^1.0.14", - "grunt-rtlcss": "~2.0.1", + "grunt-rtlcss": "~2.0.2", "grunt-text-replace": "^0.4.0", "grunt-wp-i18n": "^1.0.3", "grunt-wp-readme-to-markdown": "~1.0.0", diff --git a/phpunit.xml b/phpunit.xml index da9f5f47..44bd164c 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,3 +1,4 @@ + - + ./tests/phpunit/ - + - 150 + 250 diff --git a/readme.txt b/readme.txt index c3489a51..d6f132ac 100644 --- a/readme.txt +++ b/readme.txt @@ -8,8 +8,8 @@ License: GNU General Public License v2 or later Tags: simple calendar, event calendar, event management, event list, schedule Requires PHP: 5.6.20 Requires at least: 5.1 -Tested up to: 5.6 -Stable tag: 2.0.21 +Tested up to: 5.7 +Stable tag: 2.1.0 You can easily manage events with this lightweight calendar. No complicated configuration. Simple to use. Sweeeet! diff --git a/sugar-calendar-lite.php b/sugar-calendar-lite.php index 71e6d06f..a0c51bd7 100755 --- a/sugar-calendar-lite.php +++ b/sugar-calendar-lite.php @@ -11,7 +11,7 @@ * Domain Path: /sugar-calendar/includes/languages/ * Requires PHP: 5.6.20 * Requires at least: 5.1 - * Version: 2.0.21 + * Version: 2.1.0 */ // Exit if accessed directly diff --git a/sugar-calendar/includes/admin/assets.php b/sugar-calendar/includes/admin/assets.php index 124e3f15..844a1c9f 100644 --- a/sugar-calendar/includes/admin/assets.php +++ b/sugar-calendar/includes/admin/assets.php @@ -9,7 +9,7 @@ // Exit if accessed directly defined( 'ABSPATH' ) || exit; -use Sugar_Calendar\Core\Common\Assets as Assets; +use Sugar_Calendar\Common\Assets as Assets; /** * Register assets. @@ -29,6 +29,8 @@ function register() { $deps = array(); $chosen = array( 'sugar_calendar_vendor_chosen' ); $general = array( 'sugar_calendar_admin_general' ); + $dialog = array_push( $general, 'jquery-ui-dialog' ); + $wpui = array( 'wp-jquery-ui-dialog' ); /** Scripts ***************************************************************/ @@ -44,9 +46,12 @@ function register() { // Calendar wp_register_script( 'sugar_calendar_admin_calendar', "{$url}js/sc-calendar.js", $general, $ver, false ); - // Calendar + // Settings wp_register_script( 'sugar_calendar_admin_settings', "{$url}js/sc-settings.js", $general, $ver, false ); + // Taxonomy + wp_register_script( 'sugar_calendar_admin_taxonomy', "{$url}js/sc-taxonomy.js", $dialog, $ver, false ); + /** Styles ****************************************************************/ // Chosen @@ -68,6 +73,9 @@ function register() { // Settings wp_register_style( 'sugar_calendar_admin_settings', "{$url}css/{$path}sc-settings.css", $deps, $ver, 'all' ); + + // Taxonomy + wp_register_style( 'sugar_calendar_admin_taxonomy', "{$url}css/{$path}sc-taxonomy.css", $wpui, $ver, 'all' ); } /** @@ -121,6 +129,14 @@ function enqueue() { wp_enqueue_script( 'sugar_calendar_admin_meta_box' ); wp_enqueue_style( 'sugar_calendar_admin_meta_box' ); } + + // Taxonomy Pages + if ( sugar_calendar_admin_is_taxonomy_page() ) { + + // Taxonomy + wp_enqueue_script( 'sugar_calendar_admin_taxonomy' ); + wp_enqueue_style( 'sugar_calendar_admin_taxonomy' ); + } } /** diff --git a/sugar-calendar/includes/admin/assets/css/ltr/sc-calendar.css b/sugar-calendar/includes/admin/assets/css/ltr/sc-calendar.css index 7e1497d5..4f5bd034 100644 --- a/sugar-calendar/includes/admin/assets/css/ltr/sc-calendar.css +++ b/sugar-calendar/includes/admin/assets/css/ltr/sc-calendar.css @@ -13,8 +13,11 @@ body.sugar-calendar #post-body-content { margin-top: 20px; } -.event-time { +.event-date, +.event-time, +.event-time-zone { display: inline-block; + padding: 4px 0; } .sugar_calendar_datepicker { max-width: 105px; @@ -38,6 +41,11 @@ body.sugar-calendar #post-body-content { max-width: 50px; } +body.sugar-calendar.js div.sugar-calendar-wrap div.event-time-zone select:not(.sc-select-chosen), +body.sugar-calendar.js div.sugar-calendar-wrap div.event-time-zone div.sc-select-chosen { + min-width: 222px; +} + @media only screen and ( max-width: 782px ) { .event-time input, @@ -617,6 +625,13 @@ table.day th.column-sunday { } } +table.list span.sc-timechange, +table.list span.sc-timezone, +.wp-pointer-content span.sc-timezone { + font-size: 11px; + color: rgba(0, 0, 0, 0.4); +} + /** Screen Options ************************************************************/ body.sugar-calendar form#adv-settings .metabox-prefs label { diff --git a/sugar-calendar/includes/admin/assets/css/ltr/sc-taxonomy.css b/sugar-calendar/includes/admin/assets/css/ltr/sc-taxonomy.css new file mode 100644 index 00000000..2187a690 --- /dev/null +++ b/sugar-calendar/includes/admin/assets/css/ltr/sc-taxonomy.css @@ -0,0 +1,87 @@ +/* WordPress Overrides */ +body.js.sugar-calendar.edit-tags-php #wpbody { + position: inherit; +} + +body.js.sugar-calendar.edit-tags-php #col-left { + float: none; + width: auto; + display: none; +} + +body.js.sugar-calendar.edit-tags-php #col-left h2 { + display: none; +} + +body.js.sugar-calendar.edit-tags-php #col-right { + float: none; + width: auto; +} + +body.js.sugar-calendar.edit-tags-php #col-right .col-wrap { + padding: 0; +} + +/* Search Form */ +body.js.sugar-calendar.edit-tags-php .search-form { + display: inline-block; + position: relative; + box-sizing: border-box; + margin: 2px 0 25px; + padding: 11px; + width: 100%; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); + border: 1px solid #ccd0d4; + background: #fff; + color: #555; + font-size: 13px; +} + +body.js.sugar-calendar.edit-tags-php .search-form #search-submit { + display: none; +} + +/* List Table Columns */ + +body.js.sugar-calendar.edit-tags-php .column-color { + width: 74px; +} + +body.js.sugar-calendar.edit-tags-php .column-slug { + width: 10%; +} + +body.js.sugar-calendar.edit-tags-php .column-description { + width: 20%; +} + +/* Small Screens */ +@media screen and (max-width: 782px) { + body.js.sugar-calendar.edit-tags-php.auto-fold #wpcontent { + position: inherit; + margin-left: 0; + padding-left: 0; + } + + body.js.sugar-calendar.edit-tags-php.auto-fold #wpbody { + padding-left: 10px; + } + + body.js.sugar-calendar.edit-tags-php.auto-fold #col-left { + top: -45px; + height: calc( 100% + 45px ); + } + + body.js.sugar-calendar.edit-tags-php.auto-fold .search-form, + body.js.sugar-calendar.edit-tags-php.auto-fold p.search-box input[name="s"] { + margin-bottom: 0; + } + + body.js.sugar-calendar.edit-tags-php.auto-fold p.search-box { + float: none; + position: initial; + width: auto; + height: auto; + margin-bottom: 0; + } +} diff --git a/sugar-calendar/includes/admin/assets/css/min/ltr/sc-calendar.css b/sugar-calendar/includes/admin/assets/css/min/ltr/sc-calendar.css index 92d87610..3595f691 100644 --- a/sugar-calendar/includes/admin/assets/css/min/ltr/sc-calendar.css +++ b/sugar-calendar/includes/admin/assets/css/min/ltr/sc-calendar.css @@ -1 +1 @@ -body.sugar-calendar #post-body-content{margin-bottom:0}.sugar-calendar-editor #wp-content-editor-tools{background-color:#fff;padding-top:0}#above_event_editor-sortables{margin-top:20px}.event-time{display:inline-block}.sugar_calendar_datepicker{max-width:105px;height:30px;vertical-align:middle}.sugar_calendar_datepicker:after{display:inline-block;font:normal 20px/34px dashicons;color:#000;speak:none;vertical-align:top;text-align:center;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;width:34px;height:34px;content:"\f508"}.event-time input{max-width:50px}@media only screen and (max-width:782px){.event-time div.sc-select-chosen,.event-time input,.event-time select:not(.sc-select-chosen){max-width:100px!important;display:inline-block!important}.sugar_calendar_datepicker{height:auto}}.widefat .column-duration,.widefat .column-end,.widefat .column-start{width:15%}.widefat .column-repeat{width:12%}body.sugar-calendar .wp-filter{margin-bottom:5px}.tablenav.top input[type=number]{width:80px;height:30px;vertical-align:middle}body.sugar-calendar .tablenav .tablenav-pages{margin-bottom:5px}.tablenav .tablenav-pages a.button,.tablenav .tablenav-pages a.screen-options{margin:0;min-height:30px;min-width:30px}.tablenav .tablenav-pages a.screen-options{padding:0;text-decoration:none;text-align:center}.tablenav .tablenav-pages a.screen-options .dashicons{color:#b4b9be;padding:5px;vertical-align:middle;margin-top:-3px}.tablenav .tablenav-pages a.screen-options:hover .dashicons{color:#727272}body.sugar-calendar .view-switch .view-list:before{content:'\f214'}.view-switch .view-month:before{content:'\f508';font-size:23px;margin-top:-3px;font-weight:500;-webkit-font-smoothing:subpixel-antialiased}.view-switch .view-week:before{content:'\f164'}.view-switch .view-day:before{content:'\f163'}table.calendar:not(.list){table-layout:fixed;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}table.calendar:not(.list) tfoot th,table.calendar:not(.list) thead th{text-align:center}table.calendar.striped>tbody>:nth-child(even) td{background-color:#fff}table.calendar.striped>tbody>:nth-child(odd) td{background-color:#f9f9f9}table.calendar:not(.list) tbody td{padding:0;position:relative;text-align:left;border-bottom:1px solid #e1e1e1;border-right:1px solid #e1e1e1}table.calendar:not(.day) tbody td.saturday,table.calendar:not(.day) tbody td.sunday{background-color:#f1f1f1}table.calendar:not(.list) tbody td:hover{box-shadow:inset 0 0 0 1px #ccc!important}table.calendar a.sugar-calendar{display:block;-o-text-overflow:ellipsis;text-overflow:ellipsis;overflow-x:hidden;white-space:nowrap;margin:0;padding:0 5px}table.calendar a.sugar-calendar{position:relative;padding:0 0 0 20px}table.calendar a.sugar-calendar:before{font:normal 15px/18px dashicons;display:inline-block;position:absolute;left:2px;top:.5px;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;width:18px;height:18px;margin:0}table.calendar.list a.sugar-calendar{display:inline;border-radius:3px;padding:5px 5px 5px 22px}table.calendar.list a.sugar-calendar:before{top:4.5px;left:5px}table.calendar.list .row-actions{margin-left:5px;margin-top:2px}.wp-pointer.sugar-calendar .wp-pointer-arrow{left:calc(50% - 15px)}.wp-pointer.sugar-calendar .wp-pointer-arrow-inner{border-top-color:#f4f4f4}.wp-pointer-content h3.type-sc_event:before,table.calendar a.type-sc_event:before{content:'\f145'}.wp-pointer-content h3.type-post:before,table.calendar a.type-post:before{content:'\f109'}.wp-pointer-content h3.type-page:before,table.calendar a.type-page:before{content:'\f105'}.wp-pointer-content h3.status-trash:before,table.calendar a.status-trash:before{content:'\f182'}.wp-pointer-content h3.status-private:before,table.calendar a.status-private:before{content:'\f530'}.wp-pointer-content h3.post-password-required:before,table.calendar a.post-password-required:before{content:'\f315'}.wp-pointer-content h3.has-location:before,table.calendar a.has-location:before{content:"\f230"}.wp-pointer-content h3.all-day:before,table.calendar a.all-day:before{content:'\f469'}.wp-pointer.sugar-calendar .wp-pointer-content p span,.wp-pointer.sugar-calendar .wp-pointer-content p strong{display:block}.wp-pointer.sugar-calendar .wp-pointer-content p span{margin-bottom:20px}.wp-pointer-actions{border-top:1px solid #ddd;background-color:#f4f4f4;padding:12px 10px 14px;margin:0 0 -38px;min-height:19px}.wp-pointer-actions .action{position:relative;margin-left:20px;margin-right:10px}.wp-pointer-actions .action a{text-decoration:none}.wp-pointer-actions .action a:before{background:0 0;color:#72777c;display:block!important;font:normal 16px/1 dashicons;speak:none;text-align:center;-webkit-font-smoothing:antialiased!important;width:10px;height:100%;position:absolute;left:-18px;top:0}.wp-pointer-actions .event-delete a{color:#dc3232}.wp-pointer-actions .event-delete a:active,.wp-pointer-actions .event-delete a:hover{color:#a00}.wp-pointer-actions .event-edit a:before{content:"\f464"}.wp-pointer-actions .event-restore a:before{content:"\f171"}.wp-pointer-actions .event-delete a:before{content:"\f158"}.wp-pointer-actions .event-view a:before{content:"\f103"}table.calendar a.status-draft{opacity:.5}@media screen and (max-width:782px){body.sugar-calendar .tablenav-pages{float:right;text-align:right;margin:7px 0 0 0;width:auto}table.calendar:not(.list) #the-list tr:last-child td:not(:last-child){border-bottom:1px solid #e1e1e1!important}table.calendar:not(.list) tr:not(.inline-edit-row):not(.no-items):not(.unspam):not(.untrash) td:not(.check-column){display:block}table.calendar.list tr:not(.inline-edit-row):not(.no-items):not(.unspam):not(.untrash) td:not(.column-primary)::before{left:32px}}table.month tbody td a.add-event-for-day,table.month tbody td a.day-number{padding:0;margin:0;position:absolute;top:0;height:26px;width:26px;text-align:center;color:#aaa;line-height:1.9em;font-weight:600;background-color:rgba(255,255,255,.8);border:1px solid transparent;border-bottom:1px solid #e1e1e1}table.month tbody td a.day-number{border-right:1px solid #e1e1e1;border-bottom-right-radius:5px}table.month tbody td a.add-event-for-day{border-left:1px solid #e1e1e1;right:0;visibility:hidden}table.month tbody td a.add-event-for-day:hover,table.month tbody td a.day-number:hover{background:rgba(245,245,245,.8)}table.month tbody td:hover a.add-event-for-day{visibility:visible}table.month tbody td:hover a.add-event-for-day,table.month tbody td:hover a.day-number{border-color:#ccc}table.month tbody td{position:relative}table.month tbody th{height:80px;background-color:#fff;border-bottom:1px solid #e1e1e1}table.month tbody tr th:last-of-type{border-right:1px solid #e1e1e1}table.month tbody tr td:nth-child(8){border-right:none}table.calendar.month tbody td.today{background:#ffe}table.month div.events-for-cell{margin:30px 0 5px;min-height:80px}table.month tbody td a i{line-height:1.9em;font-size:15px;overflow:hidden}table.month th.column-week{border-right:1px solid #e1e1e1}table.month tbody th.column-week{border-bottom:none;background-color:#fff;position:relative;text-align:center;z-index:1}table.month tbody th.column-week a{margin:auto auto;padding:10px;border:1px solid transparent;border-radius:5px;font-weight:600;color:#aaa;background-color:rgba(255,255,255,.8);z-index:3}table.month tbody th.column-week a:hover{background-color:#f1f1f1;border:1px solid #e1e1e1}.wp-pointer-content h3 a{color:#fff;text-decoration:none}.wp-pointer-content h3 a:hover{color:#eee}input#year{width:90px}@media screen and (max-width:782px){table.month div.events-for-cell{margin:0;padding-top:30px}table.month tbody th.padding{display:none}table.month tbody td{border-width:0 0 1px 0!important;padding:0;margin:0}}table.day td div.events-for-cell,table.day th,table.week td div.events-for-cell,table.week th{min-height:34px;position:relative}table.day th,table.week th{width:30px;background-color:#fff;color:#333;border-bottom:1px solid #e1e1e1;border-right:1px solid #e1e1e1;text-align:center;cursor:default}table.day tbody tr td:last-of-type,table.day tfoot tr th:last-of-type,table.day thead tr th:last-of-type,table.week tbody tr td:last-of-type,table.week tfoot tr th:last-of-type,table.week thead tr th:last-of-type{border-right:none}table.day tfoot tr th:not(:first-child),table.day thead tr th:not(:first-child),table.week tfoot tr th:not(:first-child),table.week thead tr th:not(:first-child){border-right:none}table.day tfoot tr:last-of-type th,table.week tfoot tr:last-of-type th{border-bottom:none}table.day tbody tr:not(.multi-day) th:first-of-type,table.week tbody tr:not(.multi-day) th:first-of-type{border-bottom:none}table.calendar.day tr.all-day td,table.calendar.day tr.multi-day td,table.calendar.week tr.all-day td,table.calendar.week tr.multi-day td{background-color:#efe}table.calendar.day tbody tr.this-hour td,table.calendar.week tbody tr.this-hour td{background:#ffe}table.day tr.multi-day td,table.day tr.multi-day th,table.week tr.multi-day td,table.week tr.multi-day th{border-bottom:2px solid #e1e1e1}table.day th.column-hour,table.week th.column-hour{width:100px}table.day th.column-friday,table.day th.column-monday,table.day th.column-saturday,table.day th.column-sunday,table.day th.column-thursday,table.day th.column-tuesday,table.day th.column-wednesday,table.week th.column-friday,table.week th.column-monday,table.week th.column-saturday,table.week th.column-sunday,table.week th.column-thursday,table.week th.column-tuesday,table.week th.column-wednesday{width:100%}@media screen and (max-width:782px){table.day tr.multi-day td,table.day tr.multi-day th,table.week tr.multi-day td,table.week tr.multi-day th{border-bottom:1px solid #e1e1e1}table.day th.column-friday,table.day th.column-monday,table.day th.column-saturday,table.day th.column-sunday,table.day th.column-thursday,table.day th.column-tuesday,table.day th.column-wednesday,table.week th.column-friday,table.week th.column-monday,table.week th.column-saturday,table.week th.column-sunday,table.week th.column-thursday,table.week th.column-tuesday,table.week th.column-wednesday{display:block;width:auto}table.day tfoot th:nth-child(n+3),table.day thead th:nth-child(n+3),table.week tfoot th:nth-child(n+3),table.week thead th:nth-child(n+3){border-top:none}table.day tr:not(.inline-edit-row):not(.no-items) td:not(.check-column),table.week tr:not(.inline-edit-row):not(.no-items) td:not(.check-column){min-height:35px}table.month th.column-week{display:none}}body.sugar-calendar form#adv-settings .metabox-prefs label{display:block;margin-top:-8px;margin-left:200px}body.sugar-calendar form#adv-settings .metabox-prefs legend+label{margin-top:-30px}body.sugar-calendar form#adv-settings .metabox-prefs{margin-bottom:10px}body.sugar-calendar form#adv-settings table.form-table{margin:0;padding:0}body.sugar-calendar form#adv-settings table.form-table *{font-size:13px;line-height:1.5em}body.sugar-calendar form#adv-settings table.form-table td,body.sugar-calendar form#adv-settings table.form-table th{padding:10px 0} \ No newline at end of file +body.sugar-calendar #post-body-content{margin-bottom:0}.sugar-calendar-editor #wp-content-editor-tools{background-color:#fff;padding-top:0}#above_event_editor-sortables{margin-top:20px}.event-date,.event-time,.event-time-zone{display:inline-block;padding:4px 0}.sugar_calendar_datepicker{max-width:105px;height:30px;vertical-align:middle}.sugar_calendar_datepicker:after{display:inline-block;font:normal 20px/34px dashicons;color:#000;speak:none;vertical-align:top;text-align:center;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;width:34px;height:34px;content:"\f508"}.event-time input{max-width:50px}body.sugar-calendar.js div.sugar-calendar-wrap div.event-time-zone div.sc-select-chosen,body.sugar-calendar.js div.sugar-calendar-wrap div.event-time-zone select:not(.sc-select-chosen){min-width:222px}@media only screen and (max-width:782px){.event-time div.sc-select-chosen,.event-time input,.event-time select:not(.sc-select-chosen){max-width:100px!important;display:inline-block!important}.sugar_calendar_datepicker{height:auto}}.widefat .column-duration,.widefat .column-end,.widefat .column-start{width:15%}.widefat .column-repeat{width:12%}body.sugar-calendar .wp-filter{margin-bottom:5px}.tablenav.top input[type=number]{width:80px;height:30px;vertical-align:middle}body.sugar-calendar .tablenav .tablenav-pages{margin-bottom:5px}.tablenav .tablenav-pages a.button,.tablenav .tablenav-pages a.screen-options{margin:0;min-height:30px;min-width:30px}.tablenav .tablenav-pages a.screen-options{padding:0;text-decoration:none;text-align:center}.tablenav .tablenav-pages a.screen-options .dashicons{color:#b4b9be;padding:5px;vertical-align:middle;margin-top:-3px}.tablenav .tablenav-pages a.screen-options:hover .dashicons{color:#727272}body.sugar-calendar .view-switch .view-list:before{content:'\f214'}.view-switch .view-month:before{content:'\f508';font-size:23px;margin-top:-3px;font-weight:500;-webkit-font-smoothing:subpixel-antialiased}.view-switch .view-week:before{content:'\f164'}.view-switch .view-day:before{content:'\f163'}table.calendar:not(.list){table-layout:fixed;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}table.calendar:not(.list) tfoot th,table.calendar:not(.list) thead th{text-align:center}table.calendar.striped>tbody>:nth-child(even) td{background-color:#fff}table.calendar.striped>tbody>:nth-child(odd) td{background-color:#f9f9f9}table.calendar:not(.list) tbody td{padding:0;position:relative;text-align:left;border-bottom:1px solid #e1e1e1;border-right:1px solid #e1e1e1}table.calendar:not(.day) tbody td.saturday,table.calendar:not(.day) tbody td.sunday{background-color:#f1f1f1}table.calendar:not(.list) tbody td:hover{box-shadow:inset 0 0 0 1px #ccc!important}table.calendar a.sugar-calendar{display:block;-o-text-overflow:ellipsis;text-overflow:ellipsis;overflow-x:hidden;white-space:nowrap;margin:0;padding:0 5px}table.calendar a.sugar-calendar{position:relative;padding:0 0 0 20px}table.calendar a.sugar-calendar:before{font:normal 15px/18px dashicons;display:inline-block;position:absolute;left:2px;top:.5px;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;width:18px;height:18px;margin:0}table.calendar.list a.sugar-calendar{display:inline;border-radius:3px;padding:5px 5px 5px 22px}table.calendar.list a.sugar-calendar:before{top:4.5px;left:5px}table.calendar.list .row-actions{margin-left:5px;margin-top:2px}.wp-pointer.sugar-calendar .wp-pointer-arrow{left:calc(50% - 15px)}.wp-pointer.sugar-calendar .wp-pointer-arrow-inner{border-top-color:#f4f4f4}.wp-pointer-content h3.type-sc_event:before,table.calendar a.type-sc_event:before{content:'\f145'}.wp-pointer-content h3.type-post:before,table.calendar a.type-post:before{content:'\f109'}.wp-pointer-content h3.type-page:before,table.calendar a.type-page:before{content:'\f105'}.wp-pointer-content h3.status-trash:before,table.calendar a.status-trash:before{content:'\f182'}.wp-pointer-content h3.status-private:before,table.calendar a.status-private:before{content:'\f530'}.wp-pointer-content h3.post-password-required:before,table.calendar a.post-password-required:before{content:'\f315'}.wp-pointer-content h3.has-location:before,table.calendar a.has-location:before{content:"\f230"}.wp-pointer-content h3.all-day:before,table.calendar a.all-day:before{content:'\f469'}.wp-pointer.sugar-calendar .wp-pointer-content p span,.wp-pointer.sugar-calendar .wp-pointer-content p strong{display:block}.wp-pointer.sugar-calendar .wp-pointer-content p span{margin-bottom:20px}.wp-pointer-actions{border-top:1px solid #ddd;background-color:#f4f4f4;padding:12px 10px 14px;margin:0 0 -38px;min-height:19px}.wp-pointer-actions .action{position:relative;margin-left:20px;margin-right:10px}.wp-pointer-actions .action a{text-decoration:none}.wp-pointer-actions .action a:before{background:0 0;color:#72777c;display:block!important;font:normal 16px/1 dashicons;speak:none;text-align:center;-webkit-font-smoothing:antialiased!important;width:10px;height:100%;position:absolute;left:-18px;top:0}.wp-pointer-actions .event-delete a{color:#dc3232}.wp-pointer-actions .event-delete a:active,.wp-pointer-actions .event-delete a:hover{color:#a00}.wp-pointer-actions .event-edit a:before{content:"\f464"}.wp-pointer-actions .event-restore a:before{content:"\f171"}.wp-pointer-actions .event-delete a:before{content:"\f158"}.wp-pointer-actions .event-view a:before{content:"\f103"}table.calendar a.status-draft{opacity:.5}@media screen and (max-width:782px){body.sugar-calendar .tablenav-pages{float:right;text-align:right;margin:7px 0 0 0;width:auto}table.calendar:not(.list) #the-list tr:last-child td:not(:last-child){border-bottom:1px solid #e1e1e1!important}table.calendar:not(.list) tr:not(.inline-edit-row):not(.no-items):not(.unspam):not(.untrash) td:not(.check-column){display:block}table.calendar.list tr:not(.inline-edit-row):not(.no-items):not(.unspam):not(.untrash) td:not(.column-primary)::before{left:32px}}table.month tbody td a.add-event-for-day,table.month tbody td a.day-number{padding:0;margin:0;position:absolute;top:0;height:26px;width:26px;text-align:center;color:#aaa;line-height:1.9em;font-weight:600;background-color:rgba(255,255,255,.8);border:1px solid transparent;border-bottom:1px solid #e1e1e1}table.month tbody td a.day-number{border-right:1px solid #e1e1e1;border-bottom-right-radius:5px}table.month tbody td a.add-event-for-day{border-left:1px solid #e1e1e1;right:0;visibility:hidden}table.month tbody td a.add-event-for-day:hover,table.month tbody td a.day-number:hover{background:rgba(245,245,245,.8)}table.month tbody td:hover a.add-event-for-day{visibility:visible}table.month tbody td:hover a.add-event-for-day,table.month tbody td:hover a.day-number{border-color:#ccc}table.month tbody td{position:relative}table.month tbody th{height:80px;background-color:#fff;border-bottom:1px solid #e1e1e1}table.month tbody tr th:last-of-type{border-right:1px solid #e1e1e1}table.month tbody tr td:nth-child(8){border-right:none}table.calendar.month tbody td.today{background:#ffe}table.month div.events-for-cell{margin:30px 0 5px;min-height:80px}table.month tbody td a i{line-height:1.9em;font-size:15px;overflow:hidden}table.month th.column-week{border-right:1px solid #e1e1e1}table.month tbody th.column-week{border-bottom:none;background-color:#fff;position:relative;text-align:center;z-index:1}table.month tbody th.column-week a{margin:auto auto;padding:10px;border:1px solid transparent;border-radius:5px;font-weight:600;color:#aaa;background-color:rgba(255,255,255,.8);z-index:3}table.month tbody th.column-week a:hover{background-color:#f1f1f1;border:1px solid #e1e1e1}.wp-pointer-content h3 a{color:#fff;text-decoration:none}.wp-pointer-content h3 a:hover{color:#eee}input#year{width:90px}@media screen and (max-width:782px){table.month div.events-for-cell{margin:0;padding-top:30px}table.month tbody th.padding{display:none}table.month tbody td{border-width:0 0 1px 0!important;padding:0;margin:0}}table.day td div.events-for-cell,table.day th,table.week td div.events-for-cell,table.week th{min-height:34px;position:relative}table.day th,table.week th{width:30px;background-color:#fff;color:#333;border-bottom:1px solid #e1e1e1;border-right:1px solid #e1e1e1;text-align:center;cursor:default}table.day tbody tr td:last-of-type,table.day tfoot tr th:last-of-type,table.day thead tr th:last-of-type,table.week tbody tr td:last-of-type,table.week tfoot tr th:last-of-type,table.week thead tr th:last-of-type{border-right:none}table.day tfoot tr th:not(:first-child),table.day thead tr th:not(:first-child),table.week tfoot tr th:not(:first-child),table.week thead tr th:not(:first-child){border-right:none}table.day tfoot tr:last-of-type th,table.week tfoot tr:last-of-type th{border-bottom:none}table.day tbody tr:not(.multi-day) th:first-of-type,table.week tbody tr:not(.multi-day) th:first-of-type{border-bottom:none}table.calendar.day tr.all-day td,table.calendar.day tr.multi-day td,table.calendar.week tr.all-day td,table.calendar.week tr.multi-day td{background-color:#efe}table.calendar.day tbody tr.this-hour td,table.calendar.week tbody tr.this-hour td{background:#ffe}table.day tr.multi-day td,table.day tr.multi-day th,table.week tr.multi-day td,table.week tr.multi-day th{border-bottom:2px solid #e1e1e1}table.day th.column-hour,table.week th.column-hour{width:100px}table.day th.column-friday,table.day th.column-monday,table.day th.column-saturday,table.day th.column-sunday,table.day th.column-thursday,table.day th.column-tuesday,table.day th.column-wednesday,table.week th.column-friday,table.week th.column-monday,table.week th.column-saturday,table.week th.column-sunday,table.week th.column-thursday,table.week th.column-tuesday,table.week th.column-wednesday{width:100%}@media screen and (max-width:782px){table.day tr.multi-day td,table.day tr.multi-day th,table.week tr.multi-day td,table.week tr.multi-day th{border-bottom:1px solid #e1e1e1}table.day th.column-friday,table.day th.column-monday,table.day th.column-saturday,table.day th.column-sunday,table.day th.column-thursday,table.day th.column-tuesday,table.day th.column-wednesday,table.week th.column-friday,table.week th.column-monday,table.week th.column-saturday,table.week th.column-sunday,table.week th.column-thursday,table.week th.column-tuesday,table.week th.column-wednesday{display:block;width:auto}table.day tfoot th:nth-child(n+3),table.day thead th:nth-child(n+3),table.week tfoot th:nth-child(n+3),table.week thead th:nth-child(n+3){border-top:none}table.day tr:not(.inline-edit-row):not(.no-items) td:not(.check-column),table.week tr:not(.inline-edit-row):not(.no-items) td:not(.check-column){min-height:35px}table.month th.column-week{display:none}}.wp-pointer-content span.sc-timezone,table.list span.sc-timechange,table.list span.sc-timezone{font-size:11px;color:rgba(0,0,0,.4)}body.sugar-calendar form#adv-settings .metabox-prefs label{display:block;margin-top:-8px;margin-left:200px}body.sugar-calendar form#adv-settings .metabox-prefs legend+label{margin-top:-30px}body.sugar-calendar form#adv-settings .metabox-prefs{margin-bottom:10px}body.sugar-calendar form#adv-settings table.form-table{margin:0;padding:0}body.sugar-calendar form#adv-settings table.form-table *{font-size:13px;line-height:1.5em}body.sugar-calendar form#adv-settings table.form-table td,body.sugar-calendar form#adv-settings table.form-table th{padding:10px 0} \ No newline at end of file diff --git a/sugar-calendar/includes/admin/assets/css/min/ltr/sc-taxonomy.css b/sugar-calendar/includes/admin/assets/css/min/ltr/sc-taxonomy.css new file mode 100644 index 00000000..4814d708 --- /dev/null +++ b/sugar-calendar/includes/admin/assets/css/min/ltr/sc-taxonomy.css @@ -0,0 +1 @@ +body.js.sugar-calendar.edit-tags-php #wpbody{position:inherit}body.js.sugar-calendar.edit-tags-php #col-left{float:none;width:auto;display:none}body.js.sugar-calendar.edit-tags-php #col-left h2{display:none}body.js.sugar-calendar.edit-tags-php #col-right{float:none;width:auto}body.js.sugar-calendar.edit-tags-php #col-right .col-wrap{padding:0}body.js.sugar-calendar.edit-tags-php .search-form{display:inline-block;position:relative;box-sizing:border-box;margin:2px 0 25px;padding:11px;width:100%;box-shadow:0 1px 1px rgba(0,0,0,.04);border:1px solid #ccd0d4;background:#fff;color:#555;font-size:13px}body.js.sugar-calendar.edit-tags-php .search-form #search-submit{display:none}body.js.sugar-calendar.edit-tags-php .column-color{width:74px}body.js.sugar-calendar.edit-tags-php .column-slug{width:10%}body.js.sugar-calendar.edit-tags-php .column-description{width:20%}@media screen and (max-width:782px){body.js.sugar-calendar.edit-tags-php.auto-fold #wpcontent{position:inherit;margin-left:0;padding-left:0}body.js.sugar-calendar.edit-tags-php.auto-fold #wpbody{padding-left:10px}body.js.sugar-calendar.edit-tags-php.auto-fold #col-left{top:-45px;height:calc(100% + 45px)}body.js.sugar-calendar.edit-tags-php.auto-fold .search-form,body.js.sugar-calendar.edit-tags-php.auto-fold p.search-box input[name="s"]{margin-bottom:0}body.js.sugar-calendar.edit-tags-php.auto-fold p.search-box{float:none;position:initial;width:auto;height:auto;margin-bottom:0}} \ No newline at end of file diff --git a/sugar-calendar/includes/admin/assets/css/min/rtl/sc-calendar.css b/sugar-calendar/includes/admin/assets/css/min/rtl/sc-calendar.css index dd1f741d..0202e027 100644 --- a/sugar-calendar/includes/admin/assets/css/min/rtl/sc-calendar.css +++ b/sugar-calendar/includes/admin/assets/css/min/rtl/sc-calendar.css @@ -1 +1 @@ -body.sugar-calendar #post-body-content{margin-bottom:0}.sugar-calendar-editor #wp-content-editor-tools{background-color:#fff;padding-top:0}#above_event_editor-sortables{margin-top:20px}.event-time{display:inline-block}.sugar_calendar_datepicker{max-width:105px;height:30px;vertical-align:middle}.sugar_calendar_datepicker:after{display:inline-block;font:normal 20px/34px dashicons;color:#000;speak:none;vertical-align:top;text-align:center;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;width:34px;height:34px;content:"\f508"}.event-time input{max-width:50px}@media only screen and (max-width:782px){.event-time div.sc-select-chosen,.event-time input,.event-time select:not(.sc-select-chosen){max-width:100px!important;display:inline-block!important}.sugar_calendar_datepicker{height:auto}}.widefat .column-duration,.widefat .column-end,.widefat .column-start{width:15%}.widefat .column-repeat{width:12%}body.sugar-calendar .wp-filter{margin-bottom:5px}.tablenav.top input[type=number]{width:80px;height:30px;vertical-align:middle}body.sugar-calendar .tablenav .tablenav-pages{margin-bottom:5px}.tablenav .tablenav-pages a.button,.tablenav .tablenav-pages a.screen-options{margin:0;min-height:30px;min-width:30px}.tablenav .tablenav-pages a.screen-options{padding:0;text-decoration:none;text-align:center}.tablenav .tablenav-pages a.screen-options .dashicons{color:#b4b9be;padding:5px;vertical-align:middle;margin-top:-3px}.tablenav .tablenav-pages a.screen-options:hover .dashicons{color:#727272}body.sugar-calendar .view-switch .view-list:before{content:'\f214'}.view-switch .view-month:before{content:'\f508';font-size:23px;margin-top:-3px;font-weight:500;-webkit-font-smoothing:subpixel-antialiased}.view-switch .view-week:before{content:'\f164'}.view-switch .view-day:before{content:'\f163'}table.calendar:not(.list){table-layout:fixed;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}table.calendar:not(.list) tfoot th,table.calendar:not(.list) thead th{text-align:center}table.calendar.striped>tbody>:nth-child(even) td{background-color:#fff}table.calendar.striped>tbody>:nth-child(odd) td{background-color:#f9f9f9}table.calendar:not(.list) tbody td{padding:0;position:relative;text-align:right;border-bottom:1px solid #e1e1e1;border-left:1px solid #e1e1e1}table.calendar:not(.day) tbody td.saturday,table.calendar:not(.day) tbody td.sunday{background-color:#f1f1f1}table.calendar:not(.list) tbody td:hover{box-shadow:inset 0 0 0 1px #ccc!important}table.calendar a.sugar-calendar{display:block;-o-text-overflow:ellipsis;text-overflow:ellipsis;overflow-x:hidden;white-space:nowrap;margin:0;padding:0 5px}table.calendar a.sugar-calendar{position:relative;padding:0 20px 0 0}table.calendar a.sugar-calendar:before{font:normal 15px/18px dashicons;display:inline-block;position:absolute;right:2px;top:.5px;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;width:18px;height:18px;margin:0}table.calendar.list a.sugar-calendar{display:inline;border-radius:3px;padding:5px 22px 5px 5px}table.calendar.list a.sugar-calendar:before{top:4.5px;right:5px}table.calendar.list .row-actions{margin-right:5px;margin-top:2px}.wp-pointer.sugar-calendar .wp-pointer-arrow{right:calc(50% - 15px)}.wp-pointer.sugar-calendar .wp-pointer-arrow-inner{border-top-color:#f4f4f4}.wp-pointer-content h3.type-sc_event:before,table.calendar a.type-sc_event:before{content:'\f145'}.wp-pointer-content h3.type-post:before,table.calendar a.type-post:before{content:'\f109'}.wp-pointer-content h3.type-page:before,table.calendar a.type-page:before{content:'\f105'}.wp-pointer-content h3.status-trash:before,table.calendar a.status-trash:before{content:'\f182'}.wp-pointer-content h3.status-private:before,table.calendar a.status-private:before{content:'\f530'}.wp-pointer-content h3.post-password-required:before,table.calendar a.post-password-required:before{content:'\f315'}.wp-pointer-content h3.has-location:before,table.calendar a.has-location:before{content:"\f230"}.wp-pointer-content h3.all-day:before,table.calendar a.all-day:before{content:'\f469'}.wp-pointer.sugar-calendar .wp-pointer-content p span,.wp-pointer.sugar-calendar .wp-pointer-content p strong{display:block}.wp-pointer.sugar-calendar .wp-pointer-content p span{margin-bottom:20px}.wp-pointer-actions{border-top:1px solid #ddd;background-color:#f4f4f4;padding:12px 10px 14px;margin:0 0 -38px;min-height:19px}.wp-pointer-actions .action{position:relative;margin-right:20px;margin-left:10px}.wp-pointer-actions .action a{text-decoration:none}.wp-pointer-actions .action a:before{background:0 0;color:#72777c;display:block!important;font:normal 16px/1 dashicons;speak:none;text-align:center;-webkit-font-smoothing:antialiased!important;width:10px;height:100%;position:absolute;right:-18px;top:0}.wp-pointer-actions .event-delete a{color:#dc3232}.wp-pointer-actions .event-delete a:active,.wp-pointer-actions .event-delete a:hover{color:#a00}.wp-pointer-actions .event-edit a:before{content:"\f464"}.wp-pointer-actions .event-restore a:before{content:"\f171"}.wp-pointer-actions .event-delete a:before{content:"\f158"}.wp-pointer-actions .event-view a:before{content:"\f103"}table.calendar a.status-draft{opacity:.5}@media screen and (max-width:782px){body.sugar-calendar .tablenav-pages{float:left;text-align:left;margin:7px 0 0 0;width:auto}table.calendar:not(.list) #the-list tr:last-child td:not(:last-child){border-bottom:1px solid #e1e1e1!important}table.calendar:not(.list) tr:not(.inline-edit-row):not(.no-items):not(.unspam):not(.untrash) td:not(.check-column){display:block}table.calendar.list tr:not(.inline-edit-row):not(.no-items):not(.unspam):not(.untrash) td:not(.column-primary)::before{right:32px}}table.month tbody td a.add-event-for-day,table.month tbody td a.day-number{padding:0;margin:0;position:absolute;top:0;height:26px;width:26px;text-align:center;color:#aaa;line-height:1.9em;font-weight:600;background-color:rgba(255,255,255,.8);border:1px solid transparent;border-bottom:1px solid #e1e1e1}table.month tbody td a.day-number{border-left:1px solid #e1e1e1;border-bottom-left-radius:5px}table.month tbody td a.add-event-for-day{border-right:1px solid #e1e1e1;left:0;visibility:hidden}table.month tbody td a.add-event-for-day:hover,table.month tbody td a.day-number:hover{background:rgba(245,245,245,.8)}table.month tbody td:hover a.add-event-for-day{visibility:visible}table.month tbody td:hover a.add-event-for-day,table.month tbody td:hover a.day-number{border-color:#ccc}table.month tbody td{position:relative}table.month tbody th{height:80px;background-color:#fff;border-bottom:1px solid #e1e1e1}table.month tbody tr th:last-of-type{border-left:1px solid #e1e1e1}table.month tbody tr td:nth-child(8){border-left:none}table.calendar.month tbody td.today{background:#ffe}table.month div.events-for-cell{margin:30px 0 5px;min-height:80px}table.month tbody td a i{line-height:1.9em;font-size:15px;overflow:hidden}table.month th.column-week{border-left:1px solid #e1e1e1}table.month tbody th.column-week{border-bottom:none;background-color:#fff;position:relative;text-align:center;z-index:1}table.month tbody th.column-week a{margin:auto auto;padding:10px;border:1px solid transparent;border-radius:5px;font-weight:600;color:#aaa;background-color:rgba(255,255,255,.8);z-index:3}table.month tbody th.column-week a:hover{background-color:#f1f1f1;border:1px solid #e1e1e1}.wp-pointer-content h3 a{color:#fff;text-decoration:none}.wp-pointer-content h3 a:hover{color:#eee}input#year{width:90px}@media screen and (max-width:782px){table.month div.events-for-cell{margin:0;padding-top:30px}table.month tbody th.padding{display:none}table.month tbody td{border-width:0 0 1px 0!important;padding:0;margin:0}}table.day td div.events-for-cell,table.day th,table.week td div.events-for-cell,table.week th{min-height:34px;position:relative}table.day th,table.week th{width:30px;background-color:#fff;color:#333;border-bottom:1px solid #e1e1e1;border-left:1px solid #e1e1e1;text-align:center;cursor:default}table.day tbody tr td:last-of-type,table.day tfoot tr th:last-of-type,table.day thead tr th:last-of-type,table.week tbody tr td:last-of-type,table.week tfoot tr th:last-of-type,table.week thead tr th:last-of-type{border-left:none}table.day tfoot tr th:not(:first-child),table.day thead tr th:not(:first-child),table.week tfoot tr th:not(:first-child),table.week thead tr th:not(:first-child){border-left:none}table.day tfoot tr:last-of-type th,table.week tfoot tr:last-of-type th{border-bottom:none}table.day tbody tr:not(.multi-day) th:first-of-type,table.week tbody tr:not(.multi-day) th:first-of-type{border-bottom:none}table.calendar.day tr.all-day td,table.calendar.day tr.multi-day td,table.calendar.week tr.all-day td,table.calendar.week tr.multi-day td{background-color:#efe}table.calendar.day tbody tr.this-hour td,table.calendar.week tbody tr.this-hour td{background:#ffe}table.day tr.multi-day td,table.day tr.multi-day th,table.week tr.multi-day td,table.week tr.multi-day th{border-bottom:2px solid #e1e1e1}table.day th.column-hour,table.week th.column-hour{width:100px}table.day th.column-friday,table.day th.column-monday,table.day th.column-saturday,table.day th.column-sunday,table.day th.column-thursday,table.day th.column-tuesday,table.day th.column-wednesday,table.week th.column-friday,table.week th.column-monday,table.week th.column-saturday,table.week th.column-sunday,table.week th.column-thursday,table.week th.column-tuesday,table.week th.column-wednesday{width:100%}@media screen and (max-width:782px){table.day tr.multi-day td,table.day tr.multi-day th,table.week tr.multi-day td,table.week tr.multi-day th{border-bottom:1px solid #e1e1e1}table.day th.column-friday,table.day th.column-monday,table.day th.column-saturday,table.day th.column-sunday,table.day th.column-thursday,table.day th.column-tuesday,table.day th.column-wednesday,table.week th.column-friday,table.week th.column-monday,table.week th.column-saturday,table.week th.column-sunday,table.week th.column-thursday,table.week th.column-tuesday,table.week th.column-wednesday{display:block;width:auto}table.day tfoot th:nth-child(n+3),table.day thead th:nth-child(n+3),table.week tfoot th:nth-child(n+3),table.week thead th:nth-child(n+3){border-top:none}table.day tr:not(.inline-edit-row):not(.no-items) td:not(.check-column),table.week tr:not(.inline-edit-row):not(.no-items) td:not(.check-column){min-height:35px}table.month th.column-week{display:none}}body.sugar-calendar form#adv-settings .metabox-prefs label{display:block;margin-top:-8px;margin-right:200px}body.sugar-calendar form#adv-settings .metabox-prefs legend+label{margin-top:-30px}body.sugar-calendar form#adv-settings .metabox-prefs{margin-bottom:10px}body.sugar-calendar form#adv-settings table.form-table{margin:0;padding:0}body.sugar-calendar form#adv-settings table.form-table *{font-size:13px;line-height:1.5em}body.sugar-calendar form#adv-settings table.form-table td,body.sugar-calendar form#adv-settings table.form-table th{padding:10px 0} \ No newline at end of file +body.sugar-calendar #post-body-content{margin-bottom:0}.sugar-calendar-editor #wp-content-editor-tools{background-color:#fff;padding-top:0}#above_event_editor-sortables{margin-top:20px}.event-date,.event-time,.event-time-zone{display:inline-block;padding:4px 0}.sugar_calendar_datepicker{max-width:105px;height:30px;vertical-align:middle}.sugar_calendar_datepicker:after{display:inline-block;font:normal 20px/34px dashicons;color:#000;speak:none;vertical-align:top;text-align:center;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;width:34px;height:34px;content:"\f508"}.event-time input{max-width:50px}body.sugar-calendar.js div.sugar-calendar-wrap div.event-time-zone div.sc-select-chosen,body.sugar-calendar.js div.sugar-calendar-wrap div.event-time-zone select:not(.sc-select-chosen){min-width:222px}@media only screen and (max-width:782px){.event-time div.sc-select-chosen,.event-time input,.event-time select:not(.sc-select-chosen){max-width:100px!important;display:inline-block!important}.sugar_calendar_datepicker{height:auto}}.widefat .column-duration,.widefat .column-end,.widefat .column-start{width:15%}.widefat .column-repeat{width:12%}body.sugar-calendar .wp-filter{margin-bottom:5px}.tablenav.top input[type=number]{width:80px;height:30px;vertical-align:middle}body.sugar-calendar .tablenav .tablenav-pages{margin-bottom:5px}.tablenav .tablenav-pages a.button,.tablenav .tablenav-pages a.screen-options{margin:0;min-height:30px;min-width:30px}.tablenav .tablenav-pages a.screen-options{padding:0;text-decoration:none;text-align:center}.tablenav .tablenav-pages a.screen-options .dashicons{color:#b4b9be;padding:5px;vertical-align:middle;margin-top:-3px}.tablenav .tablenav-pages a.screen-options:hover .dashicons{color:#727272}body.sugar-calendar .view-switch .view-list:before{content:'\f214'}.view-switch .view-month:before{content:'\f508';font-size:23px;margin-top:-3px;font-weight:500;-webkit-font-smoothing:subpixel-antialiased}.view-switch .view-week:before{content:'\f164'}.view-switch .view-day:before{content:'\f163'}table.calendar:not(.list){table-layout:fixed;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}table.calendar:not(.list) tfoot th,table.calendar:not(.list) thead th{text-align:center}table.calendar.striped>tbody>:nth-child(even) td{background-color:#fff}table.calendar.striped>tbody>:nth-child(odd) td{background-color:#f9f9f9}table.calendar:not(.list) tbody td{padding:0;position:relative;text-align:right;border-bottom:1px solid #e1e1e1;border-left:1px solid #e1e1e1}table.calendar:not(.day) tbody td.saturday,table.calendar:not(.day) tbody td.sunday{background-color:#f1f1f1}table.calendar:not(.list) tbody td:hover{box-shadow:inset 0 0 0 1px #ccc!important}table.calendar a.sugar-calendar{display:block;-o-text-overflow:ellipsis;text-overflow:ellipsis;overflow-x:hidden;white-space:nowrap;margin:0;padding:0 5px}table.calendar a.sugar-calendar{position:relative;padding:0 20px 0 0}table.calendar a.sugar-calendar:before{font:normal 15px/18px dashicons;display:inline-block;position:absolute;right:2px;top:.5px;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;width:18px;height:18px;margin:0}table.calendar.list a.sugar-calendar{display:inline;border-radius:3px;padding:5px 22px 5px 5px}table.calendar.list a.sugar-calendar:before{top:4.5px;right:5px}table.calendar.list .row-actions{margin-right:5px;margin-top:2px}.wp-pointer.sugar-calendar .wp-pointer-arrow{right:calc(50% - 15px)}.wp-pointer.sugar-calendar .wp-pointer-arrow-inner{border-top-color:#f4f4f4}.wp-pointer-content h3.type-sc_event:before,table.calendar a.type-sc_event:before{content:'\f145'}.wp-pointer-content h3.type-post:before,table.calendar a.type-post:before{content:'\f109'}.wp-pointer-content h3.type-page:before,table.calendar a.type-page:before{content:'\f105'}.wp-pointer-content h3.status-trash:before,table.calendar a.status-trash:before{content:'\f182'}.wp-pointer-content h3.status-private:before,table.calendar a.status-private:before{content:'\f530'}.wp-pointer-content h3.post-password-required:before,table.calendar a.post-password-required:before{content:'\f315'}.wp-pointer-content h3.has-location:before,table.calendar a.has-location:before{content:"\f230"}.wp-pointer-content h3.all-day:before,table.calendar a.all-day:before{content:'\f469'}.wp-pointer.sugar-calendar .wp-pointer-content p span,.wp-pointer.sugar-calendar .wp-pointer-content p strong{display:block}.wp-pointer.sugar-calendar .wp-pointer-content p span{margin-bottom:20px}.wp-pointer-actions{border-top:1px solid #ddd;background-color:#f4f4f4;padding:12px 10px 14px;margin:0 0 -38px;min-height:19px}.wp-pointer-actions .action{position:relative;margin-right:20px;margin-left:10px}.wp-pointer-actions .action a{text-decoration:none}.wp-pointer-actions .action a:before{background:0 0;color:#72777c;display:block!important;font:normal 16px/1 dashicons;speak:none;text-align:center;-webkit-font-smoothing:antialiased!important;width:10px;height:100%;position:absolute;right:-18px;top:0}.wp-pointer-actions .event-delete a{color:#dc3232}.wp-pointer-actions .event-delete a:active,.wp-pointer-actions .event-delete a:hover{color:#a00}.wp-pointer-actions .event-edit a:before{content:"\f464"}.wp-pointer-actions .event-restore a:before{content:"\f171"}.wp-pointer-actions .event-delete a:before{content:"\f158"}.wp-pointer-actions .event-view a:before{content:"\f103"}table.calendar a.status-draft{opacity:.5}@media screen and (max-width:782px){body.sugar-calendar .tablenav-pages{float:left;text-align:left;margin:7px 0 0 0;width:auto}table.calendar:not(.list) #the-list tr:last-child td:not(:last-child){border-bottom:1px solid #e1e1e1!important}table.calendar:not(.list) tr:not(.inline-edit-row):not(.no-items):not(.unspam):not(.untrash) td:not(.check-column){display:block}table.calendar.list tr:not(.inline-edit-row):not(.no-items):not(.unspam):not(.untrash) td:not(.column-primary)::before{right:32px}}table.month tbody td a.add-event-for-day,table.month tbody td a.day-number{padding:0;margin:0;position:absolute;top:0;height:26px;width:26px;text-align:center;color:#aaa;line-height:1.9em;font-weight:600;background-color:rgba(255,255,255,.8);border:1px solid transparent;border-bottom:1px solid #e1e1e1}table.month tbody td a.day-number{border-left:1px solid #e1e1e1;border-bottom-left-radius:5px}table.month tbody td a.add-event-for-day{border-right:1px solid #e1e1e1;left:0;visibility:hidden}table.month tbody td a.add-event-for-day:hover,table.month tbody td a.day-number:hover{background:rgba(245,245,245,.8)}table.month tbody td:hover a.add-event-for-day{visibility:visible}table.month tbody td:hover a.add-event-for-day,table.month tbody td:hover a.day-number{border-color:#ccc}table.month tbody td{position:relative}table.month tbody th{height:80px;background-color:#fff;border-bottom:1px solid #e1e1e1}table.month tbody tr th:last-of-type{border-left:1px solid #e1e1e1}table.month tbody tr td:nth-child(8){border-left:none}table.calendar.month tbody td.today{background:#ffe}table.month div.events-for-cell{margin:30px 0 5px;min-height:80px}table.month tbody td a i{line-height:1.9em;font-size:15px;overflow:hidden}table.month th.column-week{border-left:1px solid #e1e1e1}table.month tbody th.column-week{border-bottom:none;background-color:#fff;position:relative;text-align:center;z-index:1}table.month tbody th.column-week a{margin:auto auto;padding:10px;border:1px solid transparent;border-radius:5px;font-weight:600;color:#aaa;background-color:rgba(255,255,255,.8);z-index:3}table.month tbody th.column-week a:hover{background-color:#f1f1f1;border:1px solid #e1e1e1}.wp-pointer-content h3 a{color:#fff;text-decoration:none}.wp-pointer-content h3 a:hover{color:#eee}input#year{width:90px}@media screen and (max-width:782px){table.month div.events-for-cell{margin:0;padding-top:30px}table.month tbody th.padding{display:none}table.month tbody td{border-width:0 0 1px 0!important;padding:0;margin:0}}table.day td div.events-for-cell,table.day th,table.week td div.events-for-cell,table.week th{min-height:34px;position:relative}table.day th,table.week th{width:30px;background-color:#fff;color:#333;border-bottom:1px solid #e1e1e1;border-left:1px solid #e1e1e1;text-align:center;cursor:default}table.day tbody tr td:last-of-type,table.day tfoot tr th:last-of-type,table.day thead tr th:last-of-type,table.week tbody tr td:last-of-type,table.week tfoot tr th:last-of-type,table.week thead tr th:last-of-type{border-left:none}table.day tfoot tr th:not(:first-child),table.day thead tr th:not(:first-child),table.week tfoot tr th:not(:first-child),table.week thead tr th:not(:first-child){border-left:none}table.day tfoot tr:last-of-type th,table.week tfoot tr:last-of-type th{border-bottom:none}table.day tbody tr:not(.multi-day) th:first-of-type,table.week tbody tr:not(.multi-day) th:first-of-type{border-bottom:none}table.calendar.day tr.all-day td,table.calendar.day tr.multi-day td,table.calendar.week tr.all-day td,table.calendar.week tr.multi-day td{background-color:#efe}table.calendar.day tbody tr.this-hour td,table.calendar.week tbody tr.this-hour td{background:#ffe}table.day tr.multi-day td,table.day tr.multi-day th,table.week tr.multi-day td,table.week tr.multi-day th{border-bottom:2px solid #e1e1e1}table.day th.column-hour,table.week th.column-hour{width:100px}table.day th.column-friday,table.day th.column-monday,table.day th.column-saturday,table.day th.column-sunday,table.day th.column-thursday,table.day th.column-tuesday,table.day th.column-wednesday,table.week th.column-friday,table.week th.column-monday,table.week th.column-saturday,table.week th.column-sunday,table.week th.column-thursday,table.week th.column-tuesday,table.week th.column-wednesday{width:100%}@media screen and (max-width:782px){table.day tr.multi-day td,table.day tr.multi-day th,table.week tr.multi-day td,table.week tr.multi-day th{border-bottom:1px solid #e1e1e1}table.day th.column-friday,table.day th.column-monday,table.day th.column-saturday,table.day th.column-sunday,table.day th.column-thursday,table.day th.column-tuesday,table.day th.column-wednesday,table.week th.column-friday,table.week th.column-monday,table.week th.column-saturday,table.week th.column-sunday,table.week th.column-thursday,table.week th.column-tuesday,table.week th.column-wednesday{display:block;width:auto}table.day tfoot th:nth-child(n+3),table.day thead th:nth-child(n+3),table.week tfoot th:nth-child(n+3),table.week thead th:nth-child(n+3){border-top:none}table.day tr:not(.inline-edit-row):not(.no-items) td:not(.check-column),table.week tr:not(.inline-edit-row):not(.no-items) td:not(.check-column){min-height:35px}table.month th.column-week{display:none}}.wp-pointer-content span.sc-timezone,table.list span.sc-timechange,table.list span.sc-timezone{font-size:11px;color:rgba(0,0,0,.4)}body.sugar-calendar form#adv-settings .metabox-prefs label{display:block;margin-top:-8px;margin-right:200px}body.sugar-calendar form#adv-settings .metabox-prefs legend+label{margin-top:-30px}body.sugar-calendar form#adv-settings .metabox-prefs{margin-bottom:10px}body.sugar-calendar form#adv-settings table.form-table{margin:0;padding:0}body.sugar-calendar form#adv-settings table.form-table *{font-size:13px;line-height:1.5em}body.sugar-calendar form#adv-settings table.form-table td,body.sugar-calendar form#adv-settings table.form-table th{padding:10px 0} \ No newline at end of file diff --git a/sugar-calendar/includes/admin/assets/css/min/rtl/sc-taxonomy.css b/sugar-calendar/includes/admin/assets/css/min/rtl/sc-taxonomy.css new file mode 100644 index 00000000..0c880943 --- /dev/null +++ b/sugar-calendar/includes/admin/assets/css/min/rtl/sc-taxonomy.css @@ -0,0 +1 @@ +body.js.sugar-calendar.edit-tags-php #wpbody{position:inherit}body.js.sugar-calendar.edit-tags-php #col-left{float:none;width:auto;display:none}body.js.sugar-calendar.edit-tags-php #col-left h2{display:none}body.js.sugar-calendar.edit-tags-php #col-right{float:none;width:auto}body.js.sugar-calendar.edit-tags-php #col-right .col-wrap{padding:0}body.js.sugar-calendar.edit-tags-php .search-form{display:inline-block;position:relative;box-sizing:border-box;margin:2px 0 25px;padding:11px;width:100%;box-shadow:0 1px 1px rgba(0,0,0,.04);border:1px solid #ccd0d4;background:#fff;color:#555;font-size:13px}body.js.sugar-calendar.edit-tags-php .search-form #search-submit{display:none}body.js.sugar-calendar.edit-tags-php .column-color{width:74px}body.js.sugar-calendar.edit-tags-php .column-slug{width:10%}body.js.sugar-calendar.edit-tags-php .column-description{width:20%}@media screen and (max-width:782px){body.js.sugar-calendar.edit-tags-php.auto-fold #wpcontent{position:inherit;margin-right:0;padding-right:0}body.js.sugar-calendar.edit-tags-php.auto-fold #wpbody{padding-right:10px}body.js.sugar-calendar.edit-tags-php.auto-fold #col-left{top:-45px;height:calc(100% + 45px)}body.js.sugar-calendar.edit-tags-php.auto-fold .search-form,body.js.sugar-calendar.edit-tags-php.auto-fold p.search-box input[name="s"]{margin-bottom:0}body.js.sugar-calendar.edit-tags-php.auto-fold p.search-box{float:none;position:initial;width:auto;height:auto;margin-bottom:0}} \ No newline at end of file diff --git a/sugar-calendar/includes/admin/assets/css/rtl/sc-calendar.css b/sugar-calendar/includes/admin/assets/css/rtl/sc-calendar.css index 7e7e3c98..e07bab1c 100644 --- a/sugar-calendar/includes/admin/assets/css/rtl/sc-calendar.css +++ b/sugar-calendar/includes/admin/assets/css/rtl/sc-calendar.css @@ -13,8 +13,11 @@ body.sugar-calendar #post-body-content { margin-top: 20px; } -.event-time { +.event-date, +.event-time, +.event-time-zone { display: inline-block; + padding: 4px 0; } .sugar_calendar_datepicker { max-width: 105px; @@ -38,6 +41,11 @@ body.sugar-calendar #post-body-content { max-width: 50px; } +body.sugar-calendar.js div.sugar-calendar-wrap div.event-time-zone select:not(.sc-select-chosen), +body.sugar-calendar.js div.sugar-calendar-wrap div.event-time-zone div.sc-select-chosen { + min-width: 222px; +} + @media only screen and ( max-width: 782px ) { .event-time input, @@ -617,6 +625,13 @@ table.day th.column-sunday { } } +table.list span.sc-timechange, +table.list span.sc-timezone, +.wp-pointer-content span.sc-timezone { + font-size: 11px; + color: rgba(0, 0, 0, 0.4); +} + /** Screen Options ************************************************************/ body.sugar-calendar form#adv-settings .metabox-prefs label { diff --git a/sugar-calendar/includes/admin/assets/css/rtl/sc-taxonomy.css b/sugar-calendar/includes/admin/assets/css/rtl/sc-taxonomy.css new file mode 100644 index 00000000..b6536ac1 --- /dev/null +++ b/sugar-calendar/includes/admin/assets/css/rtl/sc-taxonomy.css @@ -0,0 +1,87 @@ +/* WordPress Overrides */ +body.js.sugar-calendar.edit-tags-php #wpbody { + position: inherit; +} + +body.js.sugar-calendar.edit-tags-php #col-left { + float: none; + width: auto; + display: none; +} + +body.js.sugar-calendar.edit-tags-php #col-left h2 { + display: none; +} + +body.js.sugar-calendar.edit-tags-php #col-right { + float: none; + width: auto; +} + +body.js.sugar-calendar.edit-tags-php #col-right .col-wrap { + padding: 0; +} + +/* Search Form */ +body.js.sugar-calendar.edit-tags-php .search-form { + display: inline-block; + position: relative; + box-sizing: border-box; + margin: 2px 0 25px; + padding: 11px; + width: 100%; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); + border: 1px solid #ccd0d4; + background: #fff; + color: #555; + font-size: 13px; +} + +body.js.sugar-calendar.edit-tags-php .search-form #search-submit { + display: none; +} + +/* List Table Columns */ + +body.js.sugar-calendar.edit-tags-php .column-color { + width: 74px; +} + +body.js.sugar-calendar.edit-tags-php .column-slug { + width: 10%; +} + +body.js.sugar-calendar.edit-tags-php .column-description { + width: 20%; +} + +/* Small Screens */ +@media screen and (max-width: 782px) { + body.js.sugar-calendar.edit-tags-php.auto-fold #wpcontent { + position: inherit; + margin-right: 0; + padding-right: 0; + } + + body.js.sugar-calendar.edit-tags-php.auto-fold #wpbody { + padding-right: 10px; + } + + body.js.sugar-calendar.edit-tags-php.auto-fold #col-left { + top: -45px; + height: calc( 100% + 45px ); + } + + body.js.sugar-calendar.edit-tags-php.auto-fold .search-form, + body.js.sugar-calendar.edit-tags-php.auto-fold p.search-box input[name="s"] { + margin-bottom: 0; + } + + body.js.sugar-calendar.edit-tags-php.auto-fold p.search-box { + float: none; + position: initial; + width: auto; + height: auto; + margin-bottom: 0; + } +} diff --git a/sugar-calendar/includes/admin/assets/js/sc-meta-box.js b/sugar-calendar/includes/admin/assets/js/sc-meta-box.js index 021e6c29..34c2c7bf 100644 --- a/sugar-calendar/includes/admin/assets/js/sc-meta-box.js +++ b/sugar-calendar/includes/admin/assets/js/sc-meta-box.js @@ -63,7 +63,7 @@ jQuery( document ).ready( function ( $ ) { // Toggle time field visibility if all-day $( '#all_day' ).on( 'click', function() { var checked = $( this ).prop( 'checked' ), - times = $( '.event-time' ); + times = $( '.time-zone-row, .event-time-zone, .event-time' ); // Toggle ( true === checked ) diff --git a/sugar-calendar/includes/admin/assets/js/sc-taxonomy.js b/sugar-calendar/includes/admin/assets/js/sc-taxonomy.js new file mode 100644 index 00000000..45908699 --- /dev/null +++ b/sugar-calendar/includes/admin/assets/js/sc-taxonomy.js @@ -0,0 +1,89 @@ +jQuery( document ).ready( function( $ ) { + 'use strict'; + + // Get the vars necessary to transform the "Add New" form into a modal + var add_new = $( 'h2.sc-nav-tab-wrapper .page-title-action' ), + wrapper = $( '#col-left' ), + form = wrapper.find( 'form' ), + submit = form.find( '#submit' ), + tag_name = form.find( '#tag-name' ), + + // Search + sinput = $( '#tag-search-input' ), + ssubmit = $( '#search-submit' ), + + // URL + hash = window.location.hash, + + // Dialog + vwidth = $( window ).width(), + vheight = $( window ).height(), + dwidth = ( vwidth <= 782 ) ? vwidth - 40 : 600, + dheight = ( vwidth <= 782 ) ? vheight - 40 : 500, + title = wrapper.find( 'h2' ).text(), + dialog = wrapper.dialog( { + modal : true, + autoOpen : false, + resizable : false, + draggable : false, + title : title, + width : dwidth, + height : dheight, + create: function() { + $( this ) + .parent() + .css( 'maxWidth', '90vw' ) + .css( 'maxHeight', '70vh' ); + }, + } ); + + // Set search placeholder text, since the button is now hidden + sinput.attr( 'placeholder', ssubmit.attr( 'value' ) ); + + /** + * Maybe open the dialog + * + * Done here, like this, to avoid rendering issues with autoOpen in Safari. + */ + if ( '#tag-name' === hash ) { + setTimeout( function() { + dialog.dialog( 'open' ); + }, 100 ); + } + + /** + * Show on "Add New" click + * + * @since 2.1.0 + * @param {object} e + */ + add_new.on( 'click', function( e ) { + e.preventDefault(); + + // Open the dialog + dialog.dialog( 'open' ); + + // Set focus on the first input + setTimeout( function() { + tag_name.focus(); + } ); + } ); + + /** + * Hide on form submission + * + * @since 2.1.0 + */ + submit.on( 'click', function() { + setTimeout( function() { + + // Look for invalid fields + var invalid = form.find( '.form-field.form-invalid' ); + + // Hide if no invalid fields + if ( 0 === invalid.length ) { + dialog.dialog( 'close' ); + } + }, 100 ); + } ); +} ); diff --git a/sugar-calendar/includes/admin/assets/js/term-timezone.js b/sugar-calendar/includes/admin/assets/js/term-timezone.js new file mode 100644 index 00000000..f2319d93 --- /dev/null +++ b/sugar-calendar/includes/admin/assets/js/term-timezone.js @@ -0,0 +1,20 @@ +jQuery( document ).ready( function() { + 'use strict'; + + // Target the parent + jQuery( 'table.wp-list-table.tags #the-list' ).on( 'click', function( e ) { + var target = jQuery( e.target ); + + // Bail if not the "Quick Edit" button + if ( ! target.hasClass( 'editinline' ) ) { + return; + } + + // Get the color from the data attribute + var tag_id = jQuery( target ).parents( 'tr' ).attr( 'id' ), + timezone = jQuery( 'td.timezone span', '#' + tag_id ).attr( 'data-timezone' ); + + // Update the input value + jQuery( 'select[name="term-timezone"]', '.inline-edit-row' ).val( timezone ); + } ); +} ); diff --git a/sugar-calendar/includes/admin/general.php b/sugar-calendar/includes/admin/general.php index d457b435..260de035 100644 --- a/sugar-calendar/includes/admin/general.php +++ b/sugar-calendar/includes/admin/general.php @@ -46,17 +46,16 @@ function sugar_calendar_admin_get_primary_page() { * @return boolean */ function sugar_calendar_is_admin() { - $screen = get_current_screen(); if ( - // Add if the event post type - post_type_supports( $screen->post_type, 'events' ) + // Is Events Page + sugar_calendar_admin_is_events_page() || - // Or if Events pages - sugar_calendar_get_admin_page_id() === $screen->id + // Is Taxonomy Page + sugar_calendar_admin_is_taxonomy_page() || @@ -95,6 +94,37 @@ function sugar_calendar_admin_is_events_page() { return false; } +/** + * Is this an admin area page used for displaying or interacting with Events? + * + * @since 2.1.0 + * + * @return boolean + */ +function sugar_calendar_admin_is_taxonomy_page() { + $screen = get_current_screen(); + + if ( + + // Add if the event post type + post_type_supports( $screen->post_type, 'events' ) + + && + + // And Taxonomy page + ! empty( $screen->taxonomy ) + + && + + // And is supported Taxonomy + in_array( $screen->taxonomy, sugar_calendar_get_object_taxonomies(), true ) + ) { + return true; + } + + return false; +} + /** * Return the base admin-area URL. * diff --git a/sugar-calendar/includes/admin/help.php b/sugar-calendar/includes/admin/help.php index f7378fd0..d1e2d703 100644 --- a/sugar-calendar/includes/admin/help.php +++ b/sugar-calendar/includes/admin/help.php @@ -378,20 +378,20 @@ function add_settings_tabs() { // Time table $time_table = ob_get_clean(); - // Timezone table + // Time zone table ob_start(); ?> - + - + @@ -415,13 +415,13 @@ function add_settings_tabs() { - + - + @@ -429,7 +429,7 @@ function add_settings_tabs() { $time_table ) ); - // Timezone + // Time zone get_current_screen()->add_help_tab( array( - 'id' => 'timezone-format', - 'title' => __( '— Timezone', 'sugar-calendar' ), + 'id' => 'time-zone-format', + 'title' => __( '— Time zone', 'sugar-calendar' ), 'content' => $timezone_table ) ); @@ -547,6 +547,26 @@ function add_settings_tabs() { 'content' => $full_table ) ); + // Time Zones + get_current_screen()->add_help_tab( array( + 'id' => 'time-zones', + 'title' => esc_html__( 'Time Zones', 'sugar-calendar' ), + 'content' => + '

' . esc_html__( 'Ranges', 'sugar-calendar' ) . '

' . + '

' . esc_html__( 'Adds time zone support to Events and Calendars.', 'sugar-calendar' ) . '

    ' . + '
  • ' . esc_html__( '"Off" is the default value. Leave off if you are unsure.', 'sugar-calendar' ) . '
  • ' . + '
  • ' . esc_html__( '"Single" means Event Start & End are the same.', 'sugar-calendar' ) . '
  • ' . + '
  • ' . esc_html__( '"Multi" means Event Start & End can be different.', 'sugar-calendar' ) . '
' . + '

' . esc_html__( 'Default Time Zone', 'sugar-calendar' ) . '

' . + '

' . esc_html__( 'What to use when nothing else is specified.', 'sugar-calendar' ) . '

    ' . + '
  • ' . esc_html__( 'Categorized by region. Ordered alphabetically', 'sugar-calendar' ) . '
  • ' . + '
  • ' . esc_html__( '"UTC" should only be used if location is not available.', 'sugar-calendar' ) . '
  • ' . + '
  • ' . esc_html__( '"Floating" means "no time zone" or relative to the user.', 'sugar-calendar' ) . '
' . + '

' . esc_html__( 'Visitor Conversion', 'sugar-calendar' ) . '

' . + '

' . esc_html__( 'Enable this to make times relative to the site visitor.', 'sugar-calendar' ) . '

    ' . + '
  • ' . esc_html__( 'Relies on browser support. May not always be accurate.', 'sugar-calendar' ) . '
' + ) ); + // Help Sidebar get_current_screen()->set_help_sidebar( '

' . esc_html__( 'Regular Event', 'sugar-calendar' ) . '

' . diff --git a/sugar-calendar/includes/admin/hooks.php b/sugar-calendar/includes/admin/hooks.php index d3fe5052..b0d80d4e 100644 --- a/sugar-calendar/includes/admin/hooks.php +++ b/sugar-calendar/includes/admin/hooks.php @@ -22,14 +22,14 @@ add_action( 'admin_notices', __NAMESPACE__ . '\\Upgrades\\notices' ); // Admin Settings -add_action( 'admin_menu', __NAMESPACE__ . '\\Settings\\menu' ); -add_action( 'admin_init', __NAMESPACE__ . '\\Settings\\register_settings' ); +add_action( 'admin_menu', __NAMESPACE__ . '\\Settings\\menu' ); // Admin meta box add_action( 'add_meta_boxes', __NAMESPACE__ . '\\Editor\\Meta\\add' ); add_action( 'save_post', __NAMESPACE__ . '\\Editor\\Meta\\save', 10, 2 ); add_filter( 'register_taxonomy_args', __NAMESPACE__ . '\\Editor\\Meta\\taxonomy_args', 10, 2 ); add_filter( 'wp_terms_checklist_args', __NAMESPACE__ . '\\Editor\\Meta\\checklist_args', 10, 1 ); +add_filter( 'sc_event_supports', __NAMESPACE__ . '\\Editor\\Meta\\custom_fields' ); // Admin meta box Save add_filter( 'sugar_calendar_event_to_save', __NAMESPACE__ . '\\Editor\\Meta\\add_location_to_save' ); diff --git a/sugar-calendar/includes/admin/list-tables/class-wp-list-table-base.php b/sugar-calendar/includes/admin/list-tables/class-wp-list-table-base.php index 0e6d7bb6..12523a16 100644 --- a/sugar-calendar/includes/admin/list-tables/class-wp-list-table-base.php +++ b/sugar-calendar/includes/admin/list-tables/class-wp-list-table-base.php @@ -463,6 +463,21 @@ protected function get_human_diff_time( $older_date, $newer_date = false ) { return sugar_calendar_human_diff_time( $older_date, $newer_date ); } + /** + * Return a human-readable time difference as a string. + * + * @since 2.1.0 + * + * @param string $timezone1 First Olson time zone ID. + * @param string $timezone2 Optional. Default: 'UTC' Second Olson time zone ID. + * @param mixed $datetime Optional. Default: 'now' Time to use for diff + * + * @return string String representing the time difference - "2.5 hours" + */ + protected function get_human_diff_timezone( $timezone1 = '', $timezone2 = 'UTC', $datetime = 'now' ) { + return sugar_calendar_human_diff_timezone( $timezone1, $timezone2, $datetime ); + } + /** * Return the color of an event. * @@ -584,9 +599,9 @@ protected function get_persistent_url( $args = array() ) { */ protected function get_today_url() { return $this->get_persistent_url( array( - 'cy' => date_i18n( 'Y', $this->now ), - 'cm' => date_i18n( 'n', $this->now ), - 'cd' => date_i18n( 'j', $this->now ), + 'cy' => gmdate( 'Y', $this->now ), + 'cm' => gmdate( 'n', $this->now ), + 'cd' => gmdate( 'j', $this->now ), ) ); } @@ -643,7 +658,7 @@ protected function get_day_offset( $date_time = '' ) { : $date_time; // Get date properties - $this_month = (int) date_i18n( 'w', $timestamp ); + $this_month = (int) gmdate( 'w', $timestamp ); $days = array_keys( $this->get_week_days() ); // Return the offset @@ -734,7 +749,7 @@ protected function get_object_type() { * @return int */ protected function get_month() { - return $this->get_request_var( 'cm', 'intval', date_i18n( 'n', $this->now ) ); + return $this->get_request_var( 'cm', 'intval', gmdate( 'n', $this->now ) ); } /** @@ -745,7 +760,7 @@ protected function get_month() { * @return int */ protected function get_day() { - return $this->get_request_var( 'cd', 'intval', date_i18n( 'j', $this->now ) ); + return $this->get_request_var( 'cd', 'intval', gmdate( 'j', $this->now ) ); } /** @@ -756,7 +771,7 @@ protected function get_day() { * @return int */ protected function get_year() { - return $this->get_request_var( 'cy', 'intval', date_i18n( 'Y', $this->now ) ); + return $this->get_request_var( 'cy', 'intval', gmdate( 'Y', $this->now ) ); } /** @@ -1104,16 +1119,16 @@ protected function modify_datetime( $datetime = '', $args = array() ) { // Parse arguments $r = wp_parse_args( $args, array( - 'Y' => date_i18n( 'Y', $time ), - 'm' => date_i18n( 'm', $time ), - 'd' => date_i18n( 'd', $time ), - 'H' => date_i18n( 'H', $time ), - 'i' => date_i18n( 'i', $time ), - 's' => date_i18n( 's', $time ) + 'Y' => gmdate( 'Y', $time ), + 'm' => gmdate( 'm', $time ), + 'd' => gmdate( 'd', $time ), + 'H' => gmdate( 'H', $time ), + 'i' => gmdate( 'i', $time ), + 's' => gmdate( 's', $time ) ) ); // Return merged - return date_i18n( 'Y-m-d H:i:s', mktime( + return gmdate( 'Y-m-d H:i:s', gmmktime( $r['H'], $r['i'], $r['s'], @@ -1393,28 +1408,28 @@ protected function set_current_cell( $args = array() ) { // Add date parts for start if ( ! empty( $r['start'] ) ) { - $r['start_year'] = date_i18n( 'Y', $r['start'] ); - $r['start_month'] = date_i18n( 'm', $r['start'] ); - $r['start_day'] = date_i18n( 'd', $r['start'] ); - $r['start_dow'] = date_i18n( 'w', $r['start'] ); - $r['start_doy'] = date_i18n( 'z', $r['start'] ); - $r['start_woy'] = date_i18n( 'W', $r['start'] ); - $r['start_hour'] = date_i18n( 'H', $r['start'] ); - $r['start_minutes'] = date_i18n( 'i', $r['start'] ); - $r['start_seconds'] = date_i18n( 's', $r['start'] ); + $r['start_year'] = gmdate( 'Y', $r['start'] ); + $r['start_month'] = gmdate( 'm', $r['start'] ); + $r['start_day'] = gmdate( 'd', $r['start'] ); + $r['start_dow'] = gmdate( 'w', $r['start'] ); + $r['start_doy'] = gmdate( 'z', $r['start'] ); + $r['start_woy'] = gmdate( 'W', $r['start'] ); + $r['start_hour'] = gmdate( 'H', $r['start'] ); + $r['start_minutes'] = gmdate( 'i', $r['start'] ); + $r['start_seconds'] = gmdate( 's', $r['start'] ); } // Add date parts for end if ( ! empty( $r['end'] ) ) { - $r['end_year'] = date_i18n( 'Y', $r['end'] ); - $r['end_month'] = date_i18n( 'm', $r['end'] ); - $r['end_day'] = date_i18n( 'd', $r['end'] ); - $r['end_dow'] = date_i18n( 'w', $r['end'] ); - $r['end_doy'] = date_i18n( 'z', $r['end'] ); - $r['end_woy'] = date_i18n( 'W', $r['end'] ); - $r['end_hour'] = date_i18n( 'H', $r['end'] ); - $r['end_minutes'] = date_i18n( 'i', $r['end'] ); - $r['end_seconds'] = date_i18n( 's', $r['end'] ); + $r['end_year'] = gmdate( 'Y', $r['end'] ); + $r['end_month'] = gmdate( 'm', $r['end'] ); + $r['end_day'] = gmdate( 'd', $r['end'] ); + $r['end_dow'] = gmdate( 'w', $r['end'] ); + $r['end_doy'] = gmdate( 'z', $r['end'] ); + $r['end_woy'] = gmdate( 'W', $r['end'] ); + $r['end_hour'] = gmdate( 'H', $r['end'] ); + $r['end_minutes'] = gmdate( 'i', $r['end'] ); + $r['end_seconds'] = gmdate( 's', $r['end'] ); } // Set the current cell @@ -1458,7 +1473,7 @@ protected function get_current_cell( $key = '', $default = null ) { * @return string */ protected function get_event_date( $date = '' ) { - return date_i18n( $this->date_format, strtotime( $date ) ); + return sugar_calendar_format_date_i18n( $this->date_format, $date ); } /** @@ -1466,12 +1481,38 @@ protected function get_event_date( $date = '' ) { * * @since 2.0.0 * - * @param string $date + * @param string $date * * @return string */ protected function get_event_time( $date = '' ) { - return date_i18n( $this->time_format, strtotime( $date ) ); + return sugar_calendar_format_date_i18n( $this->time_format, $date ); + } + + /** + * Get the time zone + * + * @since 2.1.0 + * + * @param string $timezone + * + * @return string + */ + protected function get_time_zone( $timezone = '' ) { + return sugar_calendar_format_timezone( $timezone ); + } + + /** + * Get the time zone offset + * + * @since 2.1.0 + * + * @param array $args + * + * @return string + */ + protected function get_time_zone_offset( $args = array() ) { + return sugar_calendar_get_timezone_offset( $args ); } /** Pointers **************************************************************/ @@ -1491,45 +1532,12 @@ protected function setup_pointer( $event = false, $cell = false ) { return; } - // Reset all pointer content - $pointer_content = array(); - - // Pointer content - $pointer_content['title'] = '

' . $this->get_pointer_title( $event ) . '

'; - $pointer_content['text'] = '

' . $this->get_pointer_text( $event ) . '

'; - - // Reset links array - $links = array(); - - // Trashed, so maybe offer to Restore or Delete - if ( 'trash' === $event->status ) { - - // Maybe add restore link - if ( $this->current_user_can_delete( $event ) ) { - $links['restore'] = '' . $this->get_event_restore_link( $event, esc_html__( 'Restore', 'sugar-calendar' ) ) . ''; - } - - // Maybe add delete link - if ( $this->current_user_can_delete( $event ) ) { - $links['delete'] = '' . $this->get_event_delete_link( $event, esc_html__( 'Delete', 'sugar-calendar' ) ) . ''; - } - - // Not trashed, so offer to Edit or View - } else { - - // Maybe add edit link - if ( $this->current_user_can_edit( $event ) ) { - $links['edit'] = '' . $this->get_event_edit_link( $event, esc_html__( 'Edit', 'sugar-calendar' ) ) . ''; - } - - // Add view link - if ( $this->current_user_can_view( $event ) ) { - $links['view'] = '' . $this->get_event_view_link( $event, esc_html_x( 'View', 'verb', 'sugar-calendar' ) ) . ''; - } - } - - // Setup actions - $pointer_content['links'] = '
' . implode( '', $links ) . '
'; + // Get all pointer contents + $pointer_content = array( + 'title' => '

' . $this->get_pointer_title( $event ) . '

', + 'text' => '

' . $this->get_pointer_text( $event ) . '

', + 'links' => '
' . $this->get_pointer_links( $event ) . '
' + ); // Filter $pointer_content = (array) apply_filters( 'sugar_calendar_admin_pointer_content', $pointer_content, $event, $cell ); @@ -1570,10 +1578,54 @@ protected function get_pointer_title( $event = false ) { $retval = $this->get_event_view_link( $event, $retval ); } - // Filter & return the pointer title + // Return return $retval; } + /** + * Return the pointer links HTML + * + * @since 2.1.0 + * + * @param object $event + * @return string + */ + protected function get_pointer_links( $event = false ) { + + // Default no links + $links = array(); + + // Trashed, so maybe offer to Restore or Delete + if ( 'trash' === $event->status ) { + + // Maybe add restore link + if ( $this->current_user_can_delete( $event ) ) { + $links['restore'] = '' . $this->get_event_restore_link( $event, esc_html__( 'Restore', 'sugar-calendar' ) ) . ''; + } + + // Maybe add delete link + if ( $this->current_user_can_delete( $event ) ) { + $links['delete'] = '' . $this->get_event_delete_link( $event, esc_html__( 'Delete', 'sugar-calendar' ) ) . ''; + } + + // Not trashed, so offer to Edit or View + } else { + + // Maybe add edit link + if ( $this->current_user_can_edit( $event ) ) { + $links['edit'] = '' . $this->get_event_edit_link( $event, esc_html__( 'Edit', 'sugar-calendar' ) ) . ''; + } + + // Add view link + if ( $this->current_user_can_view( $event ) ) { + $links['view'] = '' . $this->get_event_view_link( $event, esc_html_x( 'View', 'verb', 'sugar-calendar' ) ) . ''; + } + } + + // Return + return implode( '', $links ); + } + /** * Get the link used to edit an event. * @@ -1850,6 +1902,22 @@ protected function get_pointer_details( $event = false ) { protected function get_pointer_dates( $event = false ) { $pointer_dates = array(); + // Default time zone offset strings + $stz = ''; + $etz = ''; + + // Start time zone + if ( ! empty( $event->start_tz ) ) { + $stz = '' . esc_html( $this->get_time_zone( $event->start_tz ) ) . ''; + } + + // End time zone + if ( ! empty( $event->end_tz ) ) { + $etz = '' . esc_html( $this->get_time_zone( $event->end_tz ) ) . ''; + } elseif ( ! empty( $stz ) ) { + $etz = $stz; + } + // All day, single-day event if ( $event->is_all_day() ) { @@ -1859,29 +1927,29 @@ protected function get_pointer_dates( $event = false ) { // Yearly if ( 'yearly' === $event->recurrence ) { $pointer_dates['start_title'] = '' . esc_html__( 'Start', 'sugar-calendar' ) . ''; - $pointer_dates['start'] = $event->start_date( 'F j' ) . ''; + $pointer_dates['start'] = esc_html( $event->start_date( 'F j' ) ) . ''; $pointer_dates['end_title'] = '' . esc_html__( 'End', 'sugar-calendar' ) . ''; - $pointer_dates['end'] = $event->end_date( 'F j' ) . ''; + $pointer_dates['end'] = esc_html( $event->end_date( 'F j' ) ) . ''; // Monthly } elseif ( 'monthly' === $event->recurrence ) { $pointer_dates['start_title'] = '' . esc_html__( 'Start', 'sugar-calendar' ) . ''; - $pointer_dates['start'] = $event->start_date( 'F j' ) . ''; + $pointer_dates['start'] = esc_html( $event->start_date( 'F j' ) ) . ''; $pointer_dates['end_title'] = '' . esc_html__( 'End', 'sugar-calendar' ) . ''; - $pointer_dates['end'] = $event->end_date( 'F j' ) . ''; + $pointer_dates['end'] = esc_html( $event->end_date( 'F j' ) ) . ''; // No recurrence } else { $pointer_dates['start_title'] = '' . esc_html__( 'Start', 'sugar-calendar' ) . ''; - $pointer_dates['start'] = $this->get_event_date( $event->start ) . ''; + $pointer_dates['start'] = esc_html( $this->get_event_date( $event->start ) ) . ''; $pointer_dates['end_title'] = '' . esc_html__( 'End', 'sugar-calendar' ) . ''; - $pointer_dates['end'] = $this->get_event_date( $event->end ) . ''; + $pointer_dates['end'] = esc_html( $this->get_event_date( $event->end ) ) . ''; } // Single all-day } else { $pointer_dates['all_day_title'] = '' . esc_html__( 'All Day', 'sugar-calendar' ) . ''; - $pointer_dates['all_day'] = '' . $this->get_event_date( $event->start ) . ''; + $pointer_dates['all_day'] = '' . esc_html( $this->get_event_date( $event->start ) ) . ''; } // All other events @@ -1893,23 +1961,23 @@ protected function get_pointer_dates( $event = false ) { // Yearly if ( 'yearly' === $event->recurrence ) { $pointer_dates['start_title'] = '' . esc_html__( 'Start', 'sugar-calendar' ) . ''; - $pointer_dates['start'] = '' . $event->start_date( 'F j' ) . ''; + $pointer_dates['start'] = '' . esc_html( $event->start_date( 'F j' ) ) . ''; $pointer_dates['end_title'] = '' . esc_html__( 'End', 'sugar-calendar' ) . ''; - $pointer_dates['end'] = '' . $event->end_date( 'F j' ) . ''; + $pointer_dates['end'] = '' . esc_html( $event->end_date( 'F j' ) ) . ''; // Monthly } elseif ( 'monthly' === $event->recurrence ) { $pointer_dates['start_title'] = '' . esc_html__( 'Start', 'sugar-calendar' ) . ''; - $pointer_dates['start'] = '' . $event->start_date( 'F j' ) . ''; + $pointer_dates['start'] = '' . esc_html( $event->start_date( 'F j' ) ) . ''; $pointer_dates['end_title'] = '' . esc_html__( 'End', 'sugar-calendar' ) . ''; - $pointer_dates['end'] = '' . $event->end_date( 'F j' ) . ''; + $pointer_dates['end'] = '' . esc_html( $event->end_date( 'F j' ) ) . ''; // No recurrence } else { $pointer_dates['start_title'] = '' . esc_html__( 'Start', 'sugar-calendar' ) . ''; - $pointer_dates['start'] = '' . $this->get_event_date( $event->start ) . ''; + $pointer_dates['start'] = '' . esc_html( $this->get_event_date( $event->start ) ) . ''; $pointer_dates['end_title'] = '' . esc_html__( 'End', 'sugar-calendar' ) . ''; - $pointer_dates['end'] = '' . $this->get_event_date( $event->end ) . ''; + $pointer_dates['end'] = '' . esc_html( $this->get_event_date( $event->end ) ) . ''; } // Single day @@ -1917,14 +1985,36 @@ protected function get_pointer_dates( $event = false ) { // Date & Time if ( ! $event->is_empty_date( $event->start ) ) { + $start = esc_html( sprintf( + esc_html_x( '%s on %s', '20:00 on Friday', 'sugar-calendar' ), + $this->get_event_time( $event->start ), + $GLOBALS['wp_locale']->get_weekday( $event->start_date( 'w' ) ) + ) ); + + // Maybe append time zone + if ( ! empty( $stz ) ) { + $start .= '
' . $stz; + } + $pointer_dates['start_title'] = '' . esc_html__( 'Start', 'sugar-calendar' ) . ''; - $pointer_dates['start'] = '' . sprintf( esc_html_x( '%s on %s', '20:00 on Friday', 'sugar-calendar' ), $this->get_event_time( $event->start ), $GLOBALS['wp_locale']->get_weekday( $event->start_date( 'w' ) ) ) . ''; + $pointer_dates['start'] = '' . $start . ''; // Unescaped } // Date & Time if ( ! $event->is_empty_date( $event->end ) && ( $event->start !== $event->end ) ) { + $end = esc_html( sprintf( + esc_html_x( '%s on %s', '20:00 on Friday', 'sugar-calendar' ), + $this->get_event_time( $event->end ), + $GLOBALS['wp_locale']->get_weekday( $event->end_date( 'w' ) ) + ) ); + + // Maybe append time zone + if ( ! empty( $etz ) ) { + $end .= '
' . $etz; + } + $pointer_dates['end_title'] = '' . esc_html__( 'End', 'sugar-calendar' ) . ''; - $pointer_dates['end'] = '' . sprintf( esc_html_x( '%s on %s', '20:00 on Friday', 'sugar-calendar' ), $this->get_event_time( $event->end ), $GLOBALS['wp_locale']->get_weekday( $event->end_date( 'w' ) ) ) . ''; + $pointer_dates['end'] = '' . $end . ''; // Unescaped } } } @@ -1939,29 +2029,36 @@ protected function get_pointer_dates( $event = false ) { // No end if ( empty( $event->recurrence_end ) ) { - $pointer_dates['interval'] = $intervals[ $event->recurrence ]; + $pointer_dates['interval'] = esc_html( $intervals[ $event->recurrence ] ); // Recurrence ends } elseif ( ! $event->is_empty_date( $event->recurrence_end ) ) { - $pointer_dates['recurrence_end'] = '' . sprintf( + $recurring = sprintf( esc_html_x( '%s from %s until %s', 'Weekly from December 1, 2030 until December 31, 2030', 'sugar-calendar' ), $intervals[ $event->recurrence ], $this->get_event_date( $event->start ), $this->get_event_date( $event->recurrence_end ) - ) . ''; + ); + + $pointer_dates['recurrence_end'] = '' . esc_html( $recurring ) . ''; // Recurrence goes forever } elseif ( ! $event->is_empty_date( $event->end ) && ( $event->start === $event->end ) ) { - $pointer_dates['recurrence_end'] = '' . sprintf( + $recurring = sprintf( esc_html_x( '%s starting %s', 'Weekly forever, starting May 15, 1980', 'sugar-calendar' ), $intervals[ $event->recurrence ], $this->get_event_date( $event->start ) - ) . ''; + ); + + $pointer_dates['recurrence_end'] = '' . esc_html( $recurring ) . ''; + } else { - $pointer_dates['recurrence_end'] = '' . sprintf( + $recurring = sprintf( esc_html_x( '%s', 'Weekly forever', 'sugar-calendar' ), $intervals[ $event->recurrence ] - ) . ''; + ); + + $pointer_dates['recurrence_end'] = '' . esc_html( $recurring ) . ''; } } } @@ -2016,7 +2113,7 @@ protected function get_allowed_pointer_tags() { return array( 'a' => array(), 'strong' => array(), - 'span' => array(), + 'span' => array( 'class' => 1 ), 'em' => array(), 'img' => array(), 'br' => array() @@ -2584,9 +2681,9 @@ protected function get_event_classes( $event = 0, $cell = 0 ) { * @return boolean */ protected function is_today( $month, $day, $year ) { - $_month = (bool) ( $month == date_i18n( 'n', $this->now ) ); - $_day = (bool) ( $day == date_i18n( 'j', $this->now ) ); - $_year = (bool) ( $year == date_i18n( 'Y', $this->now ) ); + $_month = (bool) ( $month == gmdate( 'n', $this->now ) ); + $_day = (bool) ( $day == gmdate( 'j', $this->now ) ); + $_year = (bool) ( $year == gmdate( 'Y', $this->now ) ); return (bool) ( true === $_month && true === $_day && true === $_year ); } @@ -2832,7 +2929,7 @@ protected function extra_tablenav( $which = '' ) { // After action do_action( "sugar_calendar_admin_after_extra_tablenav_{$which}", $this ); - // Filter & return + // Return return ob_get_clean(); } @@ -2868,20 +2965,20 @@ protected function pagination( $args = array() ) { $next_large = strtotime( "+{$r['large']}", $this->today ); // Week - $prev_small_d = date_i18n( 'j', $prev_small ); - $prev_small_m = date_i18n( 'n', $prev_small ); - $prev_small_y = date_i18n( 'Y', $prev_small ); - $next_small_d = date_i18n( 'j', $next_small ); - $next_small_m = date_i18n( 'n', $next_small ); - $next_small_y = date_i18n( 'Y', $next_small ); + $prev_small_d = gmdate( 'j', $prev_small ); + $prev_small_m = gmdate( 'n', $prev_small ); + $prev_small_y = gmdate( 'Y', $prev_small ); + $next_small_d = gmdate( 'j', $next_small ); + $next_small_m = gmdate( 'n', $next_small ); + $next_small_y = gmdate( 'Y', $next_small ); // Month - $prev_large_d = date_i18n( 'j', $prev_large ); - $prev_large_m = date_i18n( 'n', $prev_large ); - $prev_large_y = date_i18n( 'Y', $prev_large ); - $next_large_d = date_i18n( 'j', $next_large ); - $next_large_m = date_i18n( 'n', $next_large ); - $next_large_y = date_i18n( 'Y', $next_large ); + $prev_large_d = gmdate( 'j', $prev_large ); + $prev_large_m = gmdate( 'n', $prev_large ); + $prev_large_y = gmdate( 'Y', $prev_large ); + $next_large_d = gmdate( 'j', $next_large ); + $next_large_m = gmdate( 'n', $next_large ); + $next_large_y = gmdate( 'Y', $next_large ); // Setup month args $prev_small_args = array( 'cy' => $prev_small_y, 'cm' => $prev_small_m, 'cd' => $prev_small_d ); @@ -2932,7 +3029,7 @@ protected function pagination( $args = array() ) { grid_end = strtotime( 'tomorrow -1 second', $this->grid_start ); // Setup the day ranges - $view_start = date_i18n( 'Y-m-d H:i:s', $this->grid_start ); - $view_end = date_i18n( 'Y-m-d H:i:s', $this->grid_end ); + $view_start = gmdate( 'Y-m-d H:i:s', $this->grid_start ); + $view_end = gmdate( 'Y-m-d H:i:s', $this->grid_end ); // Setup views $this->set_view( $view_start, $view_end ); @@ -67,12 +67,12 @@ public function __construct( $args = array() ) { public function get_columns() { // Lowercase day, for column key - $day = strtolower( date_i18n( 'l', $this->grid_start ) ); + $day = strtolower( gmdate( 'l', $this->grid_start ) ); // Return Week & Day return array( - 'hour' => sprintf( esc_html_x( 'Wk. %s', 'Week number', 'sugar-calendar' ), date_i18n( 'W', $this->today ) ), - $day => date_i18n( 'l, F j, Y', $this->grid_start ), + 'hour' => sprintf( esc_html_x( 'Wk. %s', 'Week number', 'sugar-calendar' ), gmdate( 'W', $this->today ) ), + $day => gmdate( 'l, F j, Y', $this->grid_start ), ); } @@ -174,7 +174,7 @@ protected function get_hour_class() { protected function get_all_day_row() { // Set the day - $day = date_i18n( 'd', $this->grid_start ); + $day = gmdate( 'd', $this->grid_start ); // Start an output buffer ob_start(); ?> @@ -186,8 +186,8 @@ protected function get_all_day_row() { // Set the current cell $this->set_current_cell( array( - 'start' => mktime( 0, 0, 0, $this->month, $day, $this->year ), - 'end' => mktime( 23, 59, 0, $this->month, $day, $this->year ), + 'start' => gmmktime( 0, 0, 0, $this->month, $day, $this->year ), + 'end' => gmmktime( 23, 59, 0, $this->month, $day, $this->year ), 'type' => 'all_day', 'index' => 0 ) ); @@ -209,7 +209,7 @@ protected function get_all_day_row() { protected function get_multi_day_row() { // Set the day - $day = date_i18n( 'd', $this->grid_start ); + $day = gmdate( 'd', $this->grid_start ); // Start an output buffer ob_start(); ?> @@ -221,8 +221,8 @@ protected function get_multi_day_row() { // Set the current cell $this->set_current_cell( array( - 'start' => mktime( 0, 0, 0, $this->month, $day, $this->year ), - 'end' => mktime( 23, 59, 0, $this->month, $day, $this->year ), + 'start' => gmmktime( 0, 0, 0, $this->month, $day, $this->year ), + 'end' => gmmktime( 23, 59, 0, $this->month, $day, $this->year ), 'type' => 'multi_day', 'index' => 0 ) ); @@ -267,7 +267,7 @@ protected function get_row_start() { $start = $this->get_current_cell( 'start' ); // Hour for row - $hour = date_i18n( 'H', $start ); + $hour = gmdate( 'H', $start ); // No row classes $classes = array( @@ -276,7 +276,7 @@ protected function get_row_start() { ); // Is this the current hour? - if ( date_i18n( 'H', $this->now ) === $hour ) { + if ( gmdate( 'H', $this->now ) === $hour ) { $classes[] = 'this-hour'; } @@ -285,7 +285,7 @@ protected function get_row_start() { set_current_cell( array( - 'start' => mktime( $row, 0, 0, $this->month, $this->day, $this->year ), - 'end' => mktime( $row, 59, 0, $this->month, $this->day, $this->year ), + 'start' => gmmktime( $row, 0, 0, $this->month, $this->day, $this->year ), + 'end' => gmmktime( $row, 59, 0, $this->month, $this->day, $this->year ), 'row' => $row, 'index' => $i, 'offset' => 0 diff --git a/sugar-calendar/includes/admin/list-tables/class-wp-list-table-list.php b/sugar-calendar/includes/admin/list-tables/class-wp-list-table-list.php index 24883fae..66f2746a 100644 --- a/sugar-calendar/includes/admin/list-tables/class-wp-list-table-list.php +++ b/sugar-calendar/includes/admin/list-tables/class-wp-list-table-list.php @@ -75,7 +75,7 @@ public function __construct( $args = array() ) { $this->list_end = strtotime( $boundary, $this->list_start ); // View end - $view_end = date_i18n( 'Y-m-d H:i:s', $this->list_end ); + $view_end = gmdate( 'Y-m-d H:i:s', $this->list_end ); // Set the view $this->set_view( $view_start, $view_end ); @@ -309,17 +309,54 @@ public function column_start( $item = null ) { // Default return value $retval = '—'; - // Start - if ( ! $item->is_empty_date( $item->start ) ) { - $dt = $item->format_date( 'Y-m-d\TH:i:s\Z', $item->start ); - $retval = 'grid_start + $offset ); - $month = date_i18n( 'm', $this->grid_start + $offset ); - $year = date_i18n( 'Y', $this->grid_start + $offset ); + $day = gmdate( 'd', $this->grid_start + $offset ); + $month = gmdate( 'm', $this->grid_start + $offset ); + $year = gmdate( 'Y', $this->grid_start + $offset ); // Setup cell boundaries $this->set_current_cell( array( - 'start' => mktime( $row, 0, 0, $month, $day, $year ), - 'end' => mktime( $row, 59, 0, $month, $day, $year ), + 'start' => gmmktime( $row, 0, 0, $month, $day, $year ), + 'end' => gmmktime( $row, 59, 0, $month, $day, $year ), 'row' => $row, 'index' => $i, 'offset' => $column diff --git a/sugar-calendar/includes/admin/menu.php b/sugar-calendar/includes/admin/menu.php index 1728daf1..185c3c9a 100644 --- a/sugar-calendar/includes/admin/menu.php +++ b/sugar-calendar/includes/admin/menu.php @@ -217,7 +217,7 @@ function body_class( $class = '' ) { // Add class if in an admin page if ( sugar_calendar_admin_is_events_page() ) { - $class .= 'sugar-calendar'; + $class .= ' sugar-calendar'; } // Return class string @@ -251,8 +251,11 @@ function maybe_empty_trash() { // Get trashed events $trashed = sugar_calendar_get_events( array( - 'number' => -1, - 'status' => 'trash' + 'status' => 'trash', + 'number' => false, + 'update_item_cache' => false, + 'update_meta_cache' => false, + 'no_found_rows' => true ) ); // Bail if nothing in trash @@ -274,7 +277,6 @@ function maybe_empty_trash() { // Delete all trashed events, regardless of their object relationships sugar_calendar_delete_events( array( - 'number' => -1, 'status' => 'trash' ) ); diff --git a/sugar-calendar/includes/admin/meta-boxes.php b/sugar-calendar/includes/admin/meta-boxes.php index 6f300fa9..0ced4cb8 100644 --- a/sugar-calendar/includes/admin/meta-boxes.php +++ b/sugar-calendar/includes/admin/meta-boxes.php @@ -11,6 +11,29 @@ use Sugar_Calendar\Common\Editor as Editor; +/** + * Maybe add custom fields support to supported post types. + * + * @since 2.1.0 + * + * @param array $supports + * + * @return array + */ +function custom_fields( $supports = array() ) { + + // Get the custom fields setting + $supported = Editor\custom_fields(); + + // Add custom fields support + if ( ! empty( $supported ) ) { + array_push( $supports, 'custom-fields' ); + } + + // Return supported + return $supports; +} + /** * Event Types Meta-box * Output radio buttons instead of the default WordPress mechanism @@ -250,17 +273,32 @@ function save( $object_id = 0, $object = null ) { } // Prepare event parameters - $all_day = prepare_all_day(); - $start = prepare_start(); - $end = prepare_end(); + $all_day = prepare_all_day(); + $start = prepare_start(); + $end = prepare_end(); - // Sanitize start & end to prevent data entry errors - $start = sanitize_start( $start, $end, $all_day ); - $end = sanitize_end( $end, $start, $all_day ); - $all_day = sanitize_all_day( $all_day, $start, $end ); + // Not all-day, so check time zones + if ( empty( $all_day ) ) { - // Time zones (empty for UTC by default) - $start_tz = $end_tz = ''; + // All time zone types save start + $start_tz = prepare_timezone( 'start' ); + + // Multi time zone uses its own end + $end_tz = ( 'multi' === sugar_calendar_get_timezone_type() ) + ? prepare_timezone( 'end' ) + : $start_tz; + + // All-day events have no time zones + } else { + $start_tz = $end_tz = ''; + } + + // Sanitize to prevent data entry errors + $start = sanitize_start( $start, $end, $all_day ); + $end = sanitize_end( $end, $start, $all_day ); + $all_day = sanitize_all_day( $all_day, $start, $end ); + $start_tz = sanitize_timezone( $start_tz ); + $end_tz = sanitize_timezone( $end_tz ); // Shim these for now (need to make functions for them) $title = $object->post_title; @@ -390,13 +428,13 @@ function prepare_date_time( $prefix = 'start' ) { $now = sugar_calendar_get_request_time(); // Get the current Year, Month, and Day, without any time - $nt = date( 'Y-m-d H:i:s', mktime( + $nt = gmdate( 'Y-m-d H:i:s', gmmktime( 0, 0, 0, - date( 'n', $now ), - date( 'j', $now ), - date( 'Y', $now ) + gmdate( 'n', $now ), + gmdate( 'j', $now ), + gmdate( 'Y', $now ) ) ); // Calendar date is set @@ -432,22 +470,49 @@ function prepare_date_time( $prefix = 'start' ) { } // Make timestamp from pieces - $timestamp = mktime( + $timestamp = gmmktime( intval( $hour ), intval( $minutes ), intval( $seconds ), - date( 'n', $date ), - date( 'j', $date ), - date( 'Y', $date ) + gmdate( 'n', $date ), + gmdate( 'j', $date ), + gmdate( 'Y', $date ) ); // Format for MySQL - $retval = date( 'Y-m-d H:i:s', $timestamp ); + $retval = gmdate( 'Y-m-d H:i:s', $timestamp ); // Return return $retval; } +/** + * Prepare a time zone value to be saved to the database. + * + * @since 2.1.0 + * + * @return string The PHP/Olson time zone to save + */ +function prepare_timezone( $prefix = 'start' ) { + + // Sanity check the prefix + if ( empty( $prefix ) || ! is_string( $prefix ) ) { + $prefix = 'start'; + } + + // Sanitize the prefix, and append an underscore + $prefix = sanitize_key( $prefix ) . '_'; + $field = "{$prefix}tz"; + + // Sanitize time zone + $zone = ! empty( $_POST[ $field ] ) + ? sanitize_text_field( $_POST[ $field ] ) + : ''; + + // Return the prepared time zone + return $zone; +} + /** * Sanitizes the start MySQL datetime, so that: * @@ -473,18 +538,18 @@ function sanitize_start( $start = '', $end = '', $all_day = false ) { // All day events end at the final second if ( true === $all_day ) { - $start_int = mktime( + $start_int = gmmktime( 0, 0, 0, - date( 'n', $start_int ), - date( 'j', $start_int ), - date( 'Y', $start_int ) + gmdate( 'n', $start_int ), + gmdate( 'j', $start_int ), + gmdate( 'Y', $start_int ) ); } // Format - $retval = date( 'Y-m-d H:i:s', $start_int ); + $retval = gmdate( 'Y-m-d H:i:s', $start_int ); // Return the new start return $retval; @@ -516,9 +581,9 @@ function sanitize_all_day( $all_day = false, $start = '', $end = '' ) { // Starts at midnight and ends 1 second before if ( - ( '00:00:00' === date( 'H:i:s', $start_int ) ) + ( '00:00:00' === gmdate( 'H:i:s', $start_int ) ) && - ( '23:59:59' === date( 'H:i:s', $end_int ) ) + ( '23:59:59' === gmdate( 'H:i:s', $end_int ) ) ) { $all_day = true; } @@ -591,23 +656,38 @@ function sanitize_end( $end = '', $start = '', $all_day = false ) { // All day events end at the final second if ( true === $all_day ) { - $end_int = mktime( + $end_int = gmmktime( 23, 59, 59, - date( 'n', $end_int ), - date( 'j', $end_int ), - date( 'Y', $end_int ) + gmdate( 'n', $end_int ), + gmdate( 'j', $end_int ), + gmdate( 'Y', $end_int ) ); } // Format - $retval = date( 'Y-m-d H:i:s', $end_int ); + $retval = gmdate( 'Y-m-d H:i:s', $end_int ); // Return the new end return $retval; } +/** + * Sanitize a timezone value, so that: + * + * - it can be empty (Floating) + * - it can be valid PHP/Olson time zone (America/Chicago) + * - it can be UTC offset (UTC-13) + * + * @since 2.1.0 + * + * @param string $timezone + */ +function sanitize_timezone( $timezone = '' ) { + return sugar_calendar_sanitize_timezone( $timezone ); +} + /** * Maybe save event location in eventmeta * @@ -776,9 +856,11 @@ function calendars( $post, $box ) { function section_duration( $event = null ) { // Get clock type, hours, and minutes - $clock = sugar_calendar_get_clock_type(); - $hours = sugar_calendar_get_hours(); - $minutes = sugar_calendar_get_minutes(); + $tztype = sugar_calendar_get_timezone_type(); + $timezone = sugar_calendar_get_timezone(); + $clock = sugar_calendar_get_clock_type(); + $hours = sugar_calendar_get_hours(); + $minutes = sugar_calendar_get_minutes(); // Get the hour format based on the clock type $hour_format = ( '12' === $clock ) @@ -796,7 +878,7 @@ function section_duration( $event = null ) { // Default AM/PM $am_pm = $end_am_pm = ''; - /** All Day ***********************************************************/ + /** All Day ***************************************************************/ $all_day = ! empty( $event->all_day ) ? (bool) $event->all_day @@ -806,7 +888,7 @@ function section_duration( $event = null ) { ? ' style="display: none;"' : ''; - /** Ends **************************************************************/ + /** Ends ******************************************************************/ // Get date_time $end_date_time = ! $event->is_empty_date( $event->end ) && ( $event->start !== $event->end ) @@ -817,32 +899,37 @@ function section_duration( $event = null ) { if ( ! empty( $end_date_time ) ) { // Date - $end_date = date( 'Y-m-d', $end_date_time ); + $end_date = gmdate( 'Y-m-d', $end_date_time ); // Only if not all-day if ( empty( $all_day ) ) { // Hour - $end_hour = date( $hour_format, $end_date_time ); + $end_hour = gmdate( $hour_format, $end_date_time ); if ( empty( $end_hour ) ) { $end_hour = ''; } // Minute - $end_minute = date( 'i', $end_date_time ); + $end_minute = gmdate( 'i', $end_date_time ); if ( empty( $end_hour ) || empty( $end_minute )) { $end_minute = ''; } // Day/night - $end_am_pm = date( 'a', $end_date_time ); + $end_am_pm = gmdate( 'a', $end_date_time ); if ( empty( $end_hour ) && empty( $end_minute ) ) { $end_am_pm = ''; } } } - /** Starts ************************************************************/ + // Time zone + if ( ! empty( $tztype ) && empty( $event->end_tz ) && ! $event->exists() ) { + $event->end_tz = $timezone; + } + + /** Starts ****************************************************************/ // Get date_time if ( ! empty( $_GET['start_day'] ) ) { @@ -855,25 +942,25 @@ function section_duration( $event = null ) { // Date if ( ! empty( $date_time ) ) { - $date = date( 'Y-m-d', $date_time ); + $date = gmdate( 'Y-m-d', $date_time ); // Only if not all-day if ( empty( $all_day ) ) { // Hour - $hour = date( $hour_format, $date_time ); + $hour = gmdate( $hour_format, $date_time ); if ( empty( $hour ) ) { $hour = ''; } // Minute - $minute = date( 'i', $date_time ); + $minute = gmdate( 'i', $date_time ); if ( empty( $hour ) || empty( $minute ) ) { $minute = ''; } // Day/night - $am_pm = date( 'a', $date_time ); + $am_pm = gmdate( 'a', $date_time ); if ( empty( $hour ) && empty( $minute ) ) { $am_pm = ''; } @@ -884,7 +971,20 @@ function section_duration( $event = null ) { } } - /** Let's Go! *********************************************************/ + // Time zone + if ( ! empty( $tztype ) && empty( $event->start_tz ) && ! $event->exists() ) { + $event->start_tz = $timezone; + } + + /** Time Zones ************************************************************/ + + // All day Events have no time zone data + if ( ! empty( $all_day ) ) { + $event->start_tz = ''; + $event->end_tz = ''; + } + + /** Let's Go! *************************************************************/ // Start an output buffer ob_start(); ?> @@ -910,18 +1010,27 @@ function section_duration( $event = null ) { + start_tz !== $event->end_tz ) ) ) : + + ?>
'start_tz', + 'name' => 'start_tz', + 'current' => $event->start_tz + ) ); + + ?>
@@ -947,18 +1073,27 @@ function section_duration( $event = null ) { + start_tz !== $event->end_tz ) ) ) : + + ?>
'end_tz', + 'name' => 'end_tz', + 'current' => $event->end_tz + ) ); + + ?>
+ + start_tz === $event->end_tz ) ) ) : ?> + + > + + + + + + +
e UTC, GMT, Atlantic/Azores
T EST, MDT ...
ZWest of UTC is negative.
East of UTC is positive.', 'sugar-calendar' ); ?>
West of UTC is negative.
East of UTC is positive.', 'sugar-calendar' ); ?>
-43200 through 50400', 'sugar-calendar' ); ?>
- +
- + - +
+ +
+
> - - + ' ', 'id' => 'start_time_hour', 'name' => 'start_time_hour', 'items' => $hours, 'selected' => $hour - ) ); ?> - : - : ' ', 'id' => 'start_time_minute', 'name' => 'start_time_minute', @@ -929,15 +1038,32 @@ function section_duration( $event = null ) { 'selected' => $minute ) ); - if ( '12' === $clock ) : ?> - - - -
-
- +
+ +
+
> - - + ' ', 'id' => 'end_time_hour', 'name' => 'end_time_hour', 'items' => $hours, 'selected' => $end_hour - ) ); ?> - : - : ' ', 'id' => 'end_time_minute', 'name' => 'end_time_minute', @@ -966,16 +1101,56 @@ function section_duration( $event = null ) { 'selected' => $end_minute ) ); - if ( '12' === $clock ) : ?> - - - -
-
+ + +
'start_tz', + 'name' => 'start_tz', + 'current' => $event->start_tz + ) ); + + ?>
+
diff --git a/sugar-calendar/includes/admin/nav.php b/sugar-calendar/includes/admin/nav.php index 1452fe10..cb299970 100644 --- a/sugar-calendar/includes/admin/nav.php +++ b/sugar-calendar/includes/admin/nav.php @@ -210,8 +210,20 @@ function add_new() { return; } - ?> - + // Singular name for Post type or Taxonomy + if ( sugar_calendar_admin_is_taxonomy_page() ) { + $name = get_taxonomy( get_current_screen()->taxonomy )->labels->singular_name; + $url = '#tag-name'; + } else { + $name = $post_type_object->labels->singular_name; + $url = $url = add_query_arg( array( 'post_type' => $post_type ), admin_url( 'post-new.php' ) ); + } + + // Default "Add New" text + $text = sprintf( esc_html__( 'Add %s', 'sugar-calendar' ), $name ); + + ?> +
+ +
+ %2$s', esc_url( $preview_url ), esc_html__( 'Preview event', 'sugar-calendar' ) ); - // Scheduled post preview link. + // Scheduled post preview link $scheduled_post_link_html = sprintf( ' %2$s', esc_url( $permalink ), esc_html__( 'Preview event', 'sugar-calendar' ) ); - // View post link. + // View post link $view_post_link_html = sprintf( ' %2$s', esc_url( $permalink ), esc_html__( 'View event', 'sugar-calendar' ) ); - // Scheduled - $scheduled_date = date_i18n( esc_html_x( 'M j, Y @ H:i', 'Date formatting', 'sugar-calendar' ), strtotime( $post->post_date ) ); + // Scheduled (uses WordPress site locale & timezone) + $format = esc_html_x( 'M j, Y @ H:i', 'Date formatting', 'sugar-calendar' ); + $timestamp = strtotime( $post->post_date ); + $scheduled_date = date_i18n( $format, $timestamp ); // Add post type to messages array $messages[ sugar_calendar_get_event_post_type_id() ] = array( diff --git a/sugar-calendar/includes/admin/screen-options.php b/sugar-calendar/includes/admin/screen-options.php index 4ed6df3f..9069a4f8 100644 --- a/sugar-calendar/includes/admin/screen-options.php +++ b/sugar-calendar/includes/admin/screen-options.php @@ -56,6 +56,7 @@ function display( $settings = '', $screen = false ) { * @since 2.0.0 */ function preferences() { + global $wp_locale; // Get the preferences $preferences = array( @@ -87,13 +88,13 @@ function preferences() {

@@ -106,10 +107,10 @@ function preferences() { -
-
-
-
+
+
+
+
@@ -118,9 +119,9 @@ function preferences() { -
-
-
+
+
+
diff --git a/sugar-calendar/includes/admin/settings.php b/sugar-calendar/includes/admin/settings.php index 5852c860..5e502923 100644 --- a/sugar-calendar/includes/admin/settings.php +++ b/sugar-calendar/includes/admin/settings.php @@ -163,6 +163,12 @@ function get_subsections( $section = '' ) { 'name' => esc_html__( 'Editing', 'sugar-calendar' ), 'url' => admin_url( 'admin.php?page=sc-settings' ), 'func' => 'Sugar_Calendar\\Admin\\Settings\\editing_subsection' + ), + 'timezones' => array( + 'id' => 'timezones', + 'name' => esc_html__( 'Time Zones', 'sugar-calendar' ), + 'url' => admin_url( 'admin.php?page=sc-settings' ), + 'func' => 'Sugar_Calendar\\Admin\\Settings\\time_zone_subsection' ) ) ); @@ -401,25 +407,6 @@ function page() { + $custom_time_checked = ! in_array( $sc_time_format, $time_formats, true ); + + // Format and translate + $looks_like_date = sugar_calendar_format_date_i18n( $sc_date_format ); + $looks_like_time = sugar_calendar_format_date_i18n( $sc_time_format ); ?> @@ -483,13 +477,13 @@ function display_subsection() { + + + + + + +

@@ -515,11 +509,14 @@ function display_subsection() { : ''; // Checked? - $checked = checked( $format, $sc_date_format, false ); ?> + $checked = checked( $format, $sc_date_format, false ); + + // Format and translate + $date = sugar_calendar_format_date_i18n( $format ); ?>
@@ -544,7 +541,7 @@ function display_subsection() {

- +

@@ -569,11 +566,14 @@ function display_subsection() { : ''; // Checked? - $checked = checked( $format, $sc_time_format, false ); ?> + $checked = checked( $format, $sc_time_format, false ); + + // Format and translate + $time = sugar_calendar_format_date_i18n( $format ); ?>
@@ -598,7 +598,7 @@ function display_subsection() {

- +

@@ -617,8 +617,9 @@ function display_subsection() { */ function editing_subsection() { - // Get the current editor - $type = Editor\current(); + // Get the current editor settings + $type = Editor\current(); + $fields = Editor\custom_fields(); // Get the registered editors $editors = Editor\registered(); ?> @@ -649,6 +650,94 @@ function editing_subsection() {

+ + + +

+ events.', 'sugar-calendar' ); ?> +

+
+ + esc_html__( 'Off', 'sugar-calendar' ), + 'single' => esc_html__( 'Single', 'sugar-calendar' ), + 'multi' => esc_html__( 'Multi', 'sugar-calendar' ) + ); ?> + + + + + + + + + + + + + + + + +
+ + + +

+ "Single" allows Events to have one time zone.
"Multi" allows Events to have different start & end time zones.
"Single" and "Multi" will enable time zones for Calendars.', 'sugar-calendar' ); ?> +

+
+ + + $timezone + ) ); ?> +

+ If you are unsure, leave empty or pick the time zone you are in.', 'sugar-calendar' ); ?> +

+
+ + + +

+ Depends on client-side browser support. May not work for all visitors.', 'sugar-calendar' ); ?> +

+
@@ -661,7 +750,20 @@ function editing_subsection() { * @since 2.0.14 */ function ajax_date_format() { - wp_die( date_i18n( sanitize_option( 'date_format', wp_unslash( $_POST['sc_date'] ) ) ) ); + + // Sanitize + $date = ! empty( $_POST['sc_date'] ) + ? wp_unslash( $_POST['sc_date'] ) + : ''; + + // Get format + $format = sanitize_option( 'date_format', $date ); + + // Format and translate + $retval = sugar_calendar_format_date_i18n( $format ); + + // Output + wp_die( $retval ); } /** @@ -670,7 +772,20 @@ function ajax_date_format() { * @since 2.0.14 */ function ajax_time_format() { - wp_die( date_i18n( sanitize_option( 'time_format', wp_unslash( $_POST['sc_date'] ) ) ) ); + + // Sanitize + $time = ! empty( $_POST['sc_date'] ) + ? wp_unslash( $_POST['sc_date'] ) + : ''; + + // Get format + $format = sanitize_option( 'time_format', $time ); + + // Format and translate + $retval = sugar_calendar_format_date_i18n( $format ); + + // Output + wp_die( $retval ); } /** diff --git a/sugar-calendar/includes/admin/upgrades.php b/sugar-calendar/includes/admin/upgrades.php index 8105c8fc..15597ca3 100644 --- a/sugar-calendar/includes/admin/upgrades.php +++ b/sugar-calendar/includes/admin/upgrades.php @@ -372,8 +372,8 @@ function do_20_migration() { $all_day = false; // Format the start & end - $start = date( 'Y-m-d H:i:s', $start ); - $end = date( 'Y-m-d H:i:s', $end ); + $start = gmdate( 'Y-m-d H:i:s', $start ); + $end = gmdate( 'Y-m-d H:i:s', $end ); // Sanitize start & end to prevent data entry errors $start_date_time = \Sugar_Calendar\Admin\Editor\Meta\sanitize_start( $start, $end, $all_day ); @@ -391,7 +391,7 @@ function do_20_migration() { // Format recurrence end $recur_end = (int) get_post_meta( $post->ID, 'sc_recur_until', true ); $recur_end = ! empty( $recur_end ) - ? date( 'Y-m-d H:i:s', $recur_end ) + ? gmdate( 'Y-m-d H:i:s', $recur_end ) : ''; // Add the event diff --git a/sugar-calendar/includes/classes/database/engine/class-base.php b/sugar-calendar/includes/classes/database/engine/class-base.php index 169fe195..9787330a 100644 --- a/sugar-calendar/includes/classes/database/engine/class-base.php +++ b/sugar-calendar/includes/classes/database/engine/class-base.php @@ -274,7 +274,7 @@ protected function set_vars( $args = array() ) { * * @since 1.0.0 * - * @return object Database interface, or False if not set + * @return \wpdb Database interface, or False if not set */ protected function get_db() { diff --git a/sugar-calendar/includes/classes/database/engine/class-column.php b/sugar-calendar/includes/classes/database/engine/class-column.php index e2694ca7..967f913c 100644 --- a/sugar-calendar/includes/classes/database/engine/class-column.php +++ b/sugar-calendar/includes/classes/database/engine/class-column.php @@ -710,7 +710,7 @@ private function sanitize_validation( $callback = '' ) { $callback = array( $this, 'validate_decimal' ); // Intval fallback - } elseif ( $this->is_type( array( 'tinyint', 'int' ) ) ) { + } elseif ( $this->is_numeric() ) { $callback = 'intval'; } @@ -729,16 +729,16 @@ private function sanitize_validation( $callback = '' ) { * updated to support different default values based on the environment. * * @since 1.0.0 - * @param string $value Default '0000-00-00 00:00:00'. A datetime value that needs validating + * @param string $value Default ''. A datetime value that needs validating * @return string A valid datetime value */ - public function validate_datetime( $value = '0000-00-00 00:00:00' ) { + public function validate_datetime( $value = '' ) { // Handle "empty" values if ( empty( $value ) || ( '0000-00-00 00:00:00' === $value ) ) { - $value = ! empty( $this->default ) + $value = ! empty( $this->default ) || ( ( true === $this->allow_null ) && is_null( $this->default ) ) ? $this->default - : '0000-00-00 00:00:00'; + : ''; // Convert to MySQL datetime format via date() && strtotime } elseif ( function_exists( 'date' ) ) { diff --git a/sugar-calendar/includes/classes/database/engine/class-query.php b/sugar-calendar/includes/classes/database/engine/class-query.php index 741015b0..36808a02 100644 --- a/sugar-calendar/includes/classes/database/engine/class-query.php +++ b/sugar-calendar/includes/classes/database/engine/class-query.php @@ -295,6 +295,7 @@ class Query extends Base { * * @type string $fields Site fields to return. Accepts 'ids' (returns an array of item IDs) * or empty (returns an array of complete item objects). Default empty. + * To do a date query against a field, append the field name with _query * @type bool $count Whether to return a item count (true) or array of item objects. * Default false. * @type int $number Limit number of items to retrieve. Use 0 for no limit. @@ -665,7 +666,7 @@ public function is_query_var_default( $key = '' ) { * * @param array $args See Queries\Meta * - * @return Meta + * @return Queries\Meta */ private function get_meta_query( $args = array() ) { return new Queries\Meta( $args ); @@ -678,7 +679,7 @@ private function get_meta_query( $args = array() ) { * * @param array $args See Queries\Compare * - * @return Compare + * @return Queries\Compare */ private function get_compare_query( $args = array() ) { return new Queries\Compare( $args ); @@ -802,7 +803,7 @@ private function get_columns( $args = array(), $operator = 'and', $field = false * * @param string $column_name Name of database column * @param string $column_value Value to query for - * @return mixed False if empty/error, Object if successful + * @return object|false False if empty/error, Object if successful */ private function get_item_raw( $column_name = '', $column_value = '' ) { @@ -954,8 +955,8 @@ private function get_item_ids() { * * @since 1.0.0 * - * @param array $pieces A compacted array of item query clauses. - * @param object &$this Current instance passed by reference. + * @param array $pieces A compacted array of item query clauses. + * @param Query &$this Current instance passed by reference. */ $clauses = (array) apply_filters_ref_array( $this->apply_prefix( "{$this->item_name_plural}_query_clauses" ), array( $query, &$this ) ); @@ -1569,14 +1570,22 @@ private function get_item_fields( $items = array() ) { * @return int */ private function shape_item_id( $item = 0 ) { + + // Default return value $retval = 0; + + // Get the primary column name $primary = $this->get_primary_column_name(); - // Item ID + // Numeric item ID if ( is_numeric( $item ) ) { $retval = $item; + + // Object item } elseif ( is_object( $item ) && isset( $item->{$primary} ) ) { $retval = $item->{$primary}; + + // Array item } elseif ( is_array( $item ) && isset( $item[ $primary ] ) ) { $retval = $item[ $primary ]; } @@ -1588,33 +1597,44 @@ private function shape_item_id( $item = 0 ) { /** Queries ***************************************************************/ /** - * Get a single database row by the primary column ID, possibly from cache + * Get a single database row by the primary column ID, possibly from cache. + * + * Accepts an integer, object, or array, and attempts to get the ID from it, + * then attempts to retrieve that item fresh from the database or cache. * * @since 1.0.0 * - * @param int $item_id - * @return mixed False if empty/error, Object if successful + * @param int|array|object $item_id The ID of the item + * @return object|false False if empty/error, Object if successful */ public function get_item( $item_id = 0 ) { - // Bail if no item to get by + // Shape the item ID $item_id = $this->shape_item_id( $item_id ); + + // Bail if no item to get by if ( empty( $item_id ) ) { return false; } + // Get the primary column name + $column_name = $this->get_primary_column_name(); + // Get item by ID - return $this->get_item_by( $this->get_primary_column_name(), $item_id ); + return $this->get_item_by( $column_name, $item_id ); } /** * Get a single database row by any column and value, possibly from cache. * + * Take care to only use this method on columns with unique values, + * preferably with a cache group for that column. See: get_item(). + * * @since 1.0.0 * - * @param string $column_name Name of database column - * @param string $column_value Value to query for - * @return mixed False if empty/error, Object if successful + * @param string $column_name Name of database column + * @param int|string $column_value Value to query for + * @return object|false False if empty/error, Object if successful */ public function get_item_by( $column_name = '', $column_value = '' ) { @@ -1626,6 +1646,16 @@ public function get_item_by( $column_name = '', $column_value = '' ) { return $retval; } + // Bail if name is not a string + if ( ! is_string( $column_name ) ) { + return $retval; + } + + // Bail if value is not scalar (null values also not allowed) + if ( ! is_scalar( $column_value ) ) { + return $retval; + } + // Get column names $columns = $this->get_column_names(); @@ -1942,7 +1972,7 @@ private function shape_item( $item = 0 ) { * @since 1.0.0 * * @param array $item - * @return mixed False on error, Array of validated values on success + * @return array|false False on error, Array of validated values on success */ private function validate_item( $item = array() ) { @@ -2135,7 +2165,7 @@ private function transition_item( $new_data = array(), $old_data = array() ) { * * @param mixed $old_value The value being transitioned FROM. * @param mixed $new_value The value being transitioned TO. - * @param int $item_Id The ID of the item that is transitioning. + * @param int $item_id The ID of the item that is transitioning. */ do_action( $key_action, $old_value, $new_value, $item_id ); } @@ -2152,7 +2182,7 @@ private function transition_item( $new_data = array(), $old_data = array() ) { * @param string $meta_key * @param string $meta_value * @param string $unique - * @return mixed + * @return int|false The meta ID on success, false on failure. */ protected function add_item_meta( $item_id = 0, $meta_key = '', $meta_value = '', $unique = false ) { @@ -2182,7 +2212,7 @@ protected function add_item_meta( $item_id = 0, $meta_key = '', $meta_value = '' * @param int $item_id * @param string $meta_key * @param bool $single - * @return mixed + * @return mixed Single metadata value, or array of values */ protected function get_item_meta( $item_id = 0, $meta_key = '', $single = false ) { @@ -2213,7 +2243,7 @@ protected function get_item_meta( $item_id = 0, $meta_key = '', $single = false * @param string $meta_key * @param string $meta_value * @param string $prev_value - * @return mixed + * @return bool True on successful update, false on failure. */ protected function update_item_meta( $item_id = 0, $meta_key = '', $meta_value = '', $prev_value = '' ) { @@ -2244,7 +2274,7 @@ protected function update_item_meta( $item_id = 0, $meta_key = '', $meta_value = * @param string $meta_key * @param string $meta_value * @param string $delete_all - * @return mixed + * @return bool True on successful delete, false on failure. */ protected function delete_item_meta( $item_id = 0, $meta_key = '', $meta_value = '', $delete_all = false ) { diff --git a/sugar-calendar/includes/classes/database/engine/class-table.php b/sugar-calendar/includes/classes/database/engine/class-table.php index 51aaf0e3..8aa6428d 100644 --- a/sugar-calendar/includes/classes/database/engine/class-table.php +++ b/sugar-calendar/includes/classes/database/engine/class-table.php @@ -64,14 +64,6 @@ abstract class Table extends Base { */ protected $global = false; - /** - * Passed directly into register_activation_hook() - * - * @since 1.0.0 - * @var string - */ - protected $file = ''; - /** * Database version key (saved in _options or _sitemeta) * @@ -168,24 +160,6 @@ public function __construct() { } } - /** - * Compatibility for clone() method for PHP versions less than 7.0. - * - * See: https://github.com/sugarcalendar/core/issues/105 - * - * This shim will be removed at a later date. - * - * @since 2.0.20 - * - * @param string $function - * @param array $args - */ - public function __call( $function = '', $args = array() ) { - if ( 'clone' === $function ) { - call_user_func_array( array( $this, '_clone' ), $args ); - } - } - /** Abstract **************************************************************/ /** @@ -354,7 +328,7 @@ public function exists() { // Bail if no database interface is available if ( empty( $db ) ) { - return; + return false; } // Query statement @@ -367,33 +341,6 @@ public function exists() { return $this->is_success( $result ); } - /** - * Check if table already exists. - * - * @since 1.0.0 - * - * @return bool - */ - public function column_exists( $name = '' ) { - - // Get the database interface - $db = $this->get_db(); - - // Bail if no database interface is available - if ( empty( $db ) ) { - return; - } - - // Query statement - $query = "SHOW COLUMNS FROM {$this->table_name} LIKE %s"; - $like = $db->esc_like( $name ); - $prepared = $db->prepare( $query, $like ); - $result = $db->query( $prepared ); - - // Does the table exist? - return $this->is_success( $result ); - } - /** * Create the table. * @@ -408,7 +355,7 @@ public function create() { // Bail if no database interface is available if ( empty( $db ) ) { - return; + return false; } // Query statement @@ -424,7 +371,7 @@ public function create() { * * @since 1.0.0 * - * @return mixed + * @return bool */ public function drop() { @@ -433,7 +380,7 @@ public function drop() { // Bail if no database interface is available if ( empty( $db ) ) { - return; + return false; } // Query statement @@ -449,7 +396,7 @@ public function drop() { * * @since 1.0.0 * - * @return mixed + * @return bool */ public function truncate() { @@ -458,7 +405,7 @@ public function truncate() { // Bail if no database interface is available if ( empty( $db ) ) { - return; + return false; } // Query statement @@ -474,7 +421,7 @@ public function truncate() { * * @since 1.0.0 * - * @return mixed + * @return bool */ public function delete_all() { @@ -483,7 +430,7 @@ public function delete_all() { // Bail if no database interface is available if ( empty( $db ) ) { - return; + return false; } // Query statement @@ -503,16 +450,16 @@ public function delete_all() { * * @param string $new_table_name The name of the new table, without prefix * - * @return mixed + * @return bool */ - public function _clone( $new_table_name = '' ) { + public function clone( $new_table_name = '' ) { // Get the database interface $db = $this->get_db(); // Bail if no database interface is available if ( empty( $db ) ) { - return; + return false; } // Sanitize the new table name @@ -520,7 +467,7 @@ public function _clone( $new_table_name = '' ) { // Bail if new table name is invalid if ( empty( $table_name ) ) { - return; + return false; } // Query statement @@ -541,7 +488,7 @@ public function _clone( $new_table_name = '' ) { * * @param string $new_table_name The name of the new table, without prefix * - * @return mixed + * @return bool */ public function copy( $new_table_name = '' ) { @@ -550,7 +497,7 @@ public function copy( $new_table_name = '' ) { // Bail if no database interface is available if ( empty( $db ) ) { - return; + return false; } // Sanitize the new table name @@ -558,7 +505,7 @@ public function copy( $new_table_name = '' ) { // Bail if new table name is invalid if ( empty( $table_name ) ) { - return; + return false; } // Query statement @@ -575,7 +522,7 @@ public function copy( $new_table_name = '' ) { * * @since 1.0.0 * - * @return mixed + * @return int */ public function count() { @@ -584,7 +531,7 @@ public function count() { // Bail if no database interface is available if ( empty( $db ) ) { - return; + return 0; } // Query statement @@ -592,7 +539,66 @@ public function count() { $count = $db->get_var( $query ); // Query success/fail - return $count; + return intval( $count ); + } + + /** + * Check if column already exists. + * + * @since 1.0.0 + * + * @param string $name Value + * + * @return bool + */ + public function column_exists( $name = '' ) { + + // Get the database interface + $db = $this->get_db(); + + // Bail if no database interface is available + if ( empty( $db ) ) { + return false; + } + + // Query statement + $query = "SHOW COLUMNS FROM {$this->table_name} LIKE %s"; + $like = $db->esc_like( $name ); + $prepared = $db->prepare( $query, $like ); + $result = $db->query( $prepared ); + + // Does the column exist? + return $this->is_success( $result ); + } + + /** + * Check if index already exists. + * + * @since 1.0.0 + * + * @param string $name Value + * @param string $column Column name + * + * @return bool + */ + public function index_exists( $name = '', $column = 'Key_name' ) { + + // Get the database interface + $db = $this->get_db(); + + // Bail if no database interface is available + if ( empty( $db ) ) { + return false; + } + + // Query statement + $query = "SHOW INDEXES FROM {$this->table_name} WHERE %s LIKE %s"; + $like = $db->esc_like( $name ); + $prepared = $db->prepare( $query, $column, $like ); + $result = $db->query( $prepared ); + + // Does the index exist? + return $this->is_success( $result ); } /** Upgrades **************************************************************/ @@ -602,7 +608,7 @@ public function count() { * * @since 1.0.0 * - * return bool + * @return bool */ public function upgrade() { @@ -737,7 +743,7 @@ private function setup() { // Maybe create database key if ( empty( $this->db_version_key ) ) { - $this->db_version_key = "wpdb_{$this->prefixed_name}_version"; + $this->db_version_key = "{$this->db_global}_{$this->prefixed_name}_version"; } } @@ -839,8 +845,8 @@ private function get_db_version() { */ private function delete_db_version() { $this->db_version = $this->is_global() - ? delete_network_option( get_main_network_id(), $this->db_version_key, false ) - : delete_option( $this->db_version_key, false ); + ? delete_network_option( get_main_network_id(), $this->db_version_key ) + : delete_option( $this->db_version_key ); } /** @@ -850,9 +856,6 @@ private function delete_db_version() { */ private function add_hooks() { - // Activation hook - register_activation_hook( $this->file, array( $this, 'maybe_upgrade' ) ); - // Add table to the global database object add_action( 'switch_blog', array( $this, 'switch_blog' ) ); add_action( 'admin_init', array( $this, 'maybe_upgrade' ) ); diff --git a/sugar-calendar/includes/classes/database/events/class-row.php b/sugar-calendar/includes/classes/database/events/class-row.php index ddb76697..a1ed8a34 100644 --- a/sugar-calendar/includes/classes/database/events/class-row.php +++ b/sugar-calendar/includes/classes/database/events/class-row.php @@ -369,19 +369,14 @@ public function recurrence_end_date( $format = 'Y-m-d H:i:s' ) { * * @since 2.0.0 * - * @param string $format - * @param string $datetime + * @param string $format Defaults to MySQL datetime format. + * @param mixed $time Defaults to "now". + * @param string $timezone Defaults to time zone preference. + * @param string $locale Defaults to user/site preference. * * @return string */ - public static function format_date( $format = 'Y-m-d H:i:s', $datetime = '' ) { - - // Maybe format - $date = is_string( $datetime ) - ? strtotime( $datetime ) - : (int) $datetime; - - // Return date part - return date_i18n( $format, $date ); + public static function format_date( $format = 'Y-m-d H:i:s', $time = null, $timezone = null, $locale = null ) { + return sugar_calendar_format_date_i18n( $format, $time, $timezone, $locale ); } } diff --git a/sugar-calendar/includes/classes/term-colors/class-term-colors.php b/sugar-calendar/includes/classes/terms/class-term-colors.php similarity index 94% rename from sugar-calendar/includes/classes/term-colors/class-term-colors.php rename to sugar-calendar/includes/classes/terms/class-term-colors.php index d9260cf6..8b0ffb35 100644 --- a/sugar-calendar/includes/classes/term-colors/class-term-colors.php +++ b/sugar-calendar/includes/classes/terms/class-term-colors.php @@ -128,8 +128,8 @@ public function sanitize_callback( $data = '' ) { public function help_tabs() { get_current_screen()->add_help_tab( array( 'id' => 'wp_term_color_help_tab', - 'title' => __( 'Calendar Color', 'sugar-calendar' ), - 'content' => '

' . __( 'Calendars can have unique colors to help separate them from each other.', 'sugar-calendar' ) . '

', + 'title' => esc_html__( 'Color', 'sugar-calendar' ), + 'content' => '

' . esc_html__( 'Calendars can have unique colors to help separate them from each other.', 'sugar-calendar' ) . '

', ) ); } diff --git a/sugar-calendar/includes/classes/terms/class-term-timezones.php b/sugar-calendar/includes/classes/terms/class-term-timezones.php new file mode 100644 index 00000000..c4552953 --- /dev/null +++ b/sugar-calendar/includes/classes/terms/class-term-timezones.php @@ -0,0 +1,249 @@ +url = SC_PLUGIN_URL . 'includes/admin/assets/'; + } + + /** Taxonomy **************************************************************/ + + /** + * Setup the labels. + * + * @since 2.1.0 + * + * @param array $args + * @return array + */ + public function setup_labels() { + + // Setup the labels + $this->labels = array( + 'singular' => esc_html__( 'Time Zone', 'sugar-calendar' ), + 'plural' => esc_html__( 'Time Zones', 'sugar-calendar' ), + 'description' => esc_html__( 'Assign calendars a time zone for events to inherit their settings from.', 'sugar-calendar' ) + ); + } + + /** + * Only add time zones to taxonomies that support them. + * + * @since 2.1.0 + * + * @param array $args + * @return array + */ + public function filter_taxonomies( $args = array() ) { + $args['timezones'] = true; + + return $args; + } + + /** Assets ****************************************************************/ + + /** + * Enqueue quick-edit JS + * + * @since 2.1.0 + */ + public function enqueue_scripts() { + + // Version + $ver = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG + ? time() + : $this->db_version; + + // Enqueue fancy time zone; includes quick-edit + wp_enqueue_script( 'term-timezone', $this->url . 'js/term-timezone.js', array(), $ver, true ); + } + + /** + * Sanitizing the hex time zone + * + * @since 2.1.0 + * + * @param string $data + * @return string + */ + public function sanitize_callback( $data = '' ) { + return sugar_calendar_sanitize_timezone( $data ); + } + + /** + * Add help tabs for `timezone` column + * + * @since 2.1.0 + */ + public function help_tabs() { + get_current_screen()->add_help_tab( array( + 'id' => 'wp_term_timezone_help_tab', + 'title' => esc_html__( 'Time Zone', 'sugar-calendar' ), + 'content' => '

' . esc_html__( 'Time zones.', 'sugar-calendar' ) . '

', + ) ); + } + + /** + * Align custom `timezone` column + * + * @since 2.1.0 + */ + public function admin_head() { + ?> + + + + term_id ) + ? $this->get_meta( $term->term_id ) + : ''; + + sugar_calendar_timezone_dropdown( array( + 'id' => 'term-' . $this->meta_key, + 'name' => 'term-' . $this->meta_key, + 'class' => 'sc-select-chosen', + 'current' => $value, + + // What time zones to allow + 'allow_empty' => true, + 'allow_utc' => true, + 'allow_manual' => false, + ) ); + } + + /** + * Output the form field + * + * @since 2.0.0 + * + * @param $term + */ + protected function quick_edit_form_field() { + sugar_calendar_timezone_dropdown( array( + 'id' => 'term-' . $this->meta_key, + 'name' => 'term-' . $this->meta_key, + 'class' => 'ptitle', + 'current' => '', + + // What time zones to allow + 'allow_empty' => true, + 'allow_utc' => true, + 'allow_manual' => false, + ) ); + } + + /** + * Return the formatted output for the column row + * + * @since 2.1.0 + * + * @param string $meta + */ + protected function format_output( $meta = '' ) { + + // Replace underscores with spaces + $tz = str_replace( '_', ' ', $meta ); + + // Get offset + $offset = sugar_calendar_human_diff_timezone( $meta ); + + // Escape & return + return '' . esc_html( $tz ) . ''; + } +} diff --git a/sugar-calendar/includes/classes/term-colors/class-term-meta-ui.php b/sugar-calendar/includes/classes/utilities/class-term-meta-ui.php similarity index 100% rename from sugar-calendar/includes/classes/term-colors/class-term-meta-ui.php rename to sugar-calendar/includes/classes/utilities/class-term-meta-ui.php diff --git a/sugar-calendar/includes/classes/utilities/ical-to-array.php b/sugar-calendar/includes/classes/utilities/ical-to-array.php index 41a62531..edadbfc7 100644 --- a/sugar-calendar/includes/classes/utilities/ical-to-array.php +++ b/sugar-calendar/includes/classes/utilities/ical-to-array.php @@ -1305,7 +1305,7 @@ protected function ical_date_to_unix( $ical_date = '' ) { // Maybe strip the "T" for time $ical_date = str_replace( 'T', '', $ical_date ); - // Maybe strip the "Z" for timezone + // Maybe strip the "Z" for time zone $ical_date = str_replace( 'Z', '', $ical_date ); // Maybe strip out empty spaces, because some services seem to use them? @@ -1339,7 +1339,7 @@ protected function ical_date_to_unix( $ical_date = '' ) { $date = array_map( array( $this, 'sanitize_absint' ), $date ); // Convert date array to a Unix time - $time = mktime( + $time = gmmktime( $date[ 4 ], $date[ 5 ], $date[ 6 ], diff --git a/sugar-calendar/includes/common/assets.php b/sugar-calendar/includes/common/assets.php index bda6d866..caa30b16 100644 --- a/sugar-calendar/includes/common/assets.php +++ b/sugar-calendar/includes/common/assets.php @@ -4,7 +4,7 @@ * * @package Plugins/Site/Events/Common/Assets */ -namespace Sugar_Calendar\Core\Common\Assets; +namespace Sugar_Calendar\Common\Assets; // Exit if accessed directly defined( 'ABSPATH' ) || exit; diff --git a/sugar-calendar/includes/common/editor.php b/sugar-calendar/includes/common/editor.php index dfb2c4a6..6d997cd1 100644 --- a/sugar-calendar/includes/common/editor.php +++ b/sugar-calendar/includes/common/editor.php @@ -69,3 +69,17 @@ function registered() { ), ) ); } + +/** + * Get the currently selected Editor custom fields setting. + * + * @since 2.1.0 + * + * @return bool + */ +function custom_fields() { + $retval = get_option( 'sc_custom_fields', false ); + + // Filter & return + return apply_filters( 'sugar_calendar_get_custom_fields', $retval, false ); +} diff --git a/sugar-calendar/includes/common/general.php b/sugar-calendar/includes/common/general.php index 3dacc276..ec6c533e 100644 --- a/sugar-calendar/includes/common/general.php +++ b/sugar-calendar/includes/common/general.php @@ -40,7 +40,7 @@ function sugar_calendar_get_updater() { * @return boolean */ function sugar_calendar_doing_script_debug() { - return Sugar_Calendar\Core\Common\Assets\doing_debug(); + return Sugar_Calendar\Common\Assets\doing_debug(); } /** @@ -51,5 +51,216 @@ function sugar_calendar_doing_script_debug() { * @return string */ function sugar_calendar_get_assets_version() { - return Sugar_Calendar\Core\Common\Assets\get_version(); + return Sugar_Calendar\Common\Assets\get_version(); +} + +/** + * Format a timestamp, possibly by time zone. + * + * To transmogrify the date format into a language-specific variant, please use + * sugar_calendar_date_i18n() instead. + * + * @since 2.1.0 + * + * @param string $format Defaults to MySQL datetime format. + * @param mixed $time Defaults to "now". + * @param string $timezone Defaults to time zone preference. + * + * @return string + */ +function sugar_calendar_format_date( $format = 'Y-m-d H:i:s', $time = null, $timezone = null ) { + + // Get DateTime object (with time zone) and use it to format + $dto = sugar_calendar_get_datetime_object( $time, $timezone ); + + // Format + $retval = $dto->format( $format ); + + // Filter & return + return apply_filters( 'sugar_calendar_date', $retval, $format, $time, $timezone ); +} + +/** + * Translate a timestamp into a specific format, possibly by time zone. + * + * Loosely based on wp_date() but without the site-specific time zone fallback. + * + * @since 2.1.0 + * + * @param string $format Defaults to MySQL datetime format. + * @param mixed $time Defaults to "now". + * @param string $timezone Defaults to time zone preference. + * @param string $locale Defaults to user/site preference. + * + * @return string + */ +function sugar_calendar_format_date_i18n( $format = 'Y-m-d H:i:s', $time = null, $timezone = null, $locale = null ) { + global $wp_locale; + + // Switch! + if ( ! empty( $locale ) ) { + switch_to_locale( $locale ); + } + + // Get DateTime object (with time zone) and use it to format + $dto = sugar_calendar_get_datetime_object( $time, $timezone ); + + // No locale available, so fallback to regular date formatting + if ( empty( $wp_locale->month ) || empty( $wp_locale->weekday ) ) { + $retval = $dto->format( $format ); + + // Can localize, so try... + } else { + + // We need to unpack shorthand `r` format because it has parts that might be localized. + $format = preg_replace( '/(?get_month( $dto->format( 'm' ) ); + $weekday = $wp_locale->get_weekday( $dto->format( 'w' ) ); + + for ( $i = 0; $i < $format_length; $i ++ ) { + switch ( $format[ $i ] ) { + case 'D' : + $str = $wp_locale->get_weekday_abbrev( $weekday ); + $new_format .= addcslashes( $str, $slashes ); + break; + + case 'F' : + $new_format .= addcslashes( $month, $slashes ); + break; + + case 'l' : + $new_format .= addcslashes( $weekday, $slashes ); + break; + + case 'M' : + $str = $wp_locale->get_month_abbrev( $month ); + $new_format .= addcslashes( $str, $slashes ); + break; + + case 'a' : + $str = $wp_locale->get_meridiem( $dto->format( 'a' ) ); + $new_format .= addcslashes( $str, $slashes ); + break; + + case 'A' : + $str = $wp_locale->get_meridiem( $dto->format( 'A' ) ); + $new_format .= addcslashes( $str, $slashes ); + break; + + case '\\' : + $new_format .= $format[ $i ]; + + // If character follows a slash, we add it without translating. + if ( $i < $format_length ) { + $new_format .= $format[ ++$i ]; + } + break; + + default : + $new_format .= $format[ $i ]; + break; + } + } + + // Use the new format + $date = $dto->format( $new_format ); + + // Prevent impossible dates + $retval = wp_maybe_decline_date( $date, $format ); + } + + // Unswitch! + if ( ! empty( $locale ) ) { + restore_previous_locale(); + } + + // Filter & return + return apply_filters( 'sugar_calendar_date_i18n', $retval, $format, $time, $timezone, $locale ); +} + +/** + * Generate the HTML for a