(Grav GitSync) Automatic Commit from dan

This commit is contained in:
dan 2022-08-14 11:03:40 +12:00 committed by GitSync
parent 4edb9f5728
commit 89d18918b1
21 changed files with 191 additions and 108 deletions

View file

@ -1,3 +1,9 @@
# v1.10.35
## 08/04/2022
1. [](#improved)
* Improvements in CodeMirror editor in RTL mode [#359](https://github.com/getgrav/grav-plugin-admin/issues/359), [#2297](https://github.com/getgrav/grav-plugin-admin/pull/2297)
# v1.10.34 # v1.10.34
## 06/22/2022 ## 06/22/2022

View file

@ -1,7 +1,7 @@
name: Admin Panel name: Admin Panel
slug: admin slug: admin
type: plugin type: plugin
version: 1.10.34 version: 1.10.35
description: Adds an advanced administration panel to manage your site description: Adds an advanced administration panel to manage your site
icon: empire icon: empire
author: author:

View file

@ -190,16 +190,16 @@
}, },
{ {
"name": "scssphp/scssphp", "name": "scssphp/scssphp",
"version": "v1.10.3", "version": "v1.10.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/scssphp/scssphp.git", "url": "https://github.com/scssphp/scssphp.git",
"reference": "0f1e1516ed2412ad43e42a6a319e77624ba1f713" "reference": "8ed20753db2d3d82629e6f5d35535bbbd3893b0c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/scssphp/scssphp/zipball/0f1e1516ed2412ad43e42a6a319e77624ba1f713", "url": "https://api.github.com/repos/scssphp/scssphp/zipball/8ed20753db2d3d82629e6f5d35535bbbd3893b0c",
"reference": "0f1e1516ed2412ad43e42a6a319e77624ba1f713", "reference": "8ed20753db2d3d82629e6f5d35535bbbd3893b0c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -226,6 +226,12 @@
"bin/pscss" "bin/pscss"
], ],
"type": "library", "type": "library",
"extra": {
"bamarni-bin": {
"forward-command": false,
"bin-links": false
}
},
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"ScssPhp\\ScssPhp\\": "src/" "ScssPhp\\ScssPhp\\": "src/"
@ -258,9 +264,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/scssphp/scssphp/issues", "issues": "https://github.com/scssphp/scssphp/issues",
"source": "https://github.com/scssphp/scssphp/tree/v1.10.3" "source": "https://github.com/scssphp/scssphp/tree/v1.10.4"
}, },
"time": "2022-05-16T07:22:18+00:00" "time": "2022-07-26T16:28:33+00:00"
} }
], ],
"packages-dev": [ "packages-dev": [
@ -697,24 +703,24 @@
}, },
{ {
"name": "guzzlehttp/guzzle", "name": "guzzlehttp/guzzle",
"version": "6.5.7", "version": "6.5.8",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/guzzle.git", "url": "https://github.com/guzzle/guzzle.git",
"reference": "724562fa861e21a4071c652c8a159934e4f05592" "reference": "a52f0440530b54fa079ce76e8c5d196a42cad981"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/724562fa861e21a4071c652c8a159934e4f05592", "url": "https://api.github.com/repos/guzzle/guzzle/zipball/a52f0440530b54fa079ce76e8c5d196a42cad981",
"reference": "724562fa861e21a4071c652c8a159934e4f05592", "reference": "a52f0440530b54fa079ce76e8c5d196a42cad981",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"ext-json": "*", "ext-json": "*",
"guzzlehttp/promises": "^1.0", "guzzlehttp/promises": "^1.0",
"guzzlehttp/psr7": "^1.6.1", "guzzlehttp/psr7": "^1.9",
"php": ">=5.5", "php": ">=5.5",
"symfony/polyfill-intl-idn": "^1.17.0" "symfony/polyfill-intl-idn": "^1.17"
}, },
"require-dev": { "require-dev": {
"ext-curl": "*", "ext-curl": "*",
@ -792,7 +798,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/guzzle/guzzle/issues", "issues": "https://github.com/guzzle/guzzle/issues",
"source": "https://github.com/guzzle/guzzle/tree/6.5.7" "source": "https://github.com/guzzle/guzzle/tree/6.5.8"
}, },
"funding": [ "funding": [
{ {
@ -808,7 +814,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2022-06-09T21:36:50+00:00" "time": "2022-06-20T22:16:07+00:00"
}, },
{ {
"name": "guzzlehttp/promises", "name": "guzzlehttp/promises",
@ -896,16 +902,16 @@
}, },
{ {
"name": "guzzlehttp/psr7", "name": "guzzlehttp/psr7",
"version": "1.8.5", "version": "1.9.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/psr7.git", "url": "https://github.com/guzzle/psr7.git",
"reference": "337e3ad8e5716c15f9657bd214d16cc5e69df268" "reference": "e98e3e6d4f86621a9b75f623996e6bbdeb4b9318"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/337e3ad8e5716c15f9657bd214d16cc5e69df268", "url": "https://api.github.com/repos/guzzle/psr7/zipball/e98e3e6d4f86621a9b75f623996e6bbdeb4b9318",
"reference": "337e3ad8e5716c15f9657bd214d16cc5e69df268", "reference": "e98e3e6d4f86621a9b75f623996e6bbdeb4b9318",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -926,7 +932,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.7-dev" "dev-master": "1.9-dev"
} }
}, },
"autoload": { "autoload": {
@ -986,7 +992,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/guzzle/psr7/issues", "issues": "https://github.com/guzzle/psr7/issues",
"source": "https://github.com/guzzle/psr7/tree/1.8.5" "source": "https://github.com/guzzle/psr7/tree/1.9.0"
}, },
"funding": [ "funding": [
{ {
@ -1002,7 +1008,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2022-03-20T21:51:18+00:00" "time": "2022-06-20T21:43:03+00:00"
}, },
{ {
"name": "myclabs/deep-copy", "name": "myclabs/deep-copy",
@ -2662,16 +2668,16 @@
}, },
{ {
"name": "symfony/console", "name": "symfony/console",
"version": "v4.4.42", "version": "v4.4.43",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/console.git", "url": "https://github.com/symfony/console.git",
"reference": "cce7a9f99e22937a71a16b23afa762558808d587" "reference": "8a2628d2d5639f35113dc1b833ecd91e1ed1cf46"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/cce7a9f99e22937a71a16b23afa762558808d587", "url": "https://api.github.com/repos/symfony/console/zipball/8a2628d2d5639f35113dc1b833ecd91e1ed1cf46",
"reference": "cce7a9f99e22937a71a16b23afa762558808d587", "reference": "8a2628d2d5639f35113dc1b833ecd91e1ed1cf46",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2732,7 +2738,7 @@
"description": "Eases the creation of beautiful and testable command line interfaces", "description": "Eases the creation of beautiful and testable command line interfaces",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/console/tree/v4.4.42" "source": "https://github.com/symfony/console/tree/v4.4.43"
}, },
"funding": [ "funding": [
{ {
@ -2748,7 +2754,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2022-05-14T12:35:33+00:00" "time": "2022-06-23T12:22:25+00:00"
}, },
{ {
"name": "symfony/css-selector", "name": "symfony/css-selector",
@ -2818,7 +2824,7 @@
}, },
{ {
"name": "symfony/deprecation-contracts", "name": "symfony/deprecation-contracts",
"version": "v2.5.1", "version": "v2.5.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/deprecation-contracts.git", "url": "https://github.com/symfony/deprecation-contracts.git",
@ -2865,7 +2871,7 @@
"description": "A generic function and convention to trigger deprecation notices", "description": "A generic function and convention to trigger deprecation notices",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.1" "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2"
}, },
"funding": [ "funding": [
{ {
@ -3043,7 +3049,7 @@
}, },
{ {
"name": "symfony/event-dispatcher-contracts", "name": "symfony/event-dispatcher-contracts",
"version": "v1.1.12", "version": "v1.1.13",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/event-dispatcher-contracts.git", "url": "https://github.com/symfony/event-dispatcher-contracts.git",
@ -3102,7 +3108,7 @@
"standards" "standards"
], ],
"support": { "support": {
"source": "https://github.com/symfony/event-dispatcher-contracts/tree/v1.1.12" "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v1.1.13"
}, },
"funding": [ "funding": [
{ {
@ -3665,16 +3671,16 @@
}, },
{ {
"name": "symfony/service-contracts", "name": "symfony/service-contracts",
"version": "v2.5.1", "version": "v2.5.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/service-contracts.git", "url": "https://github.com/symfony/service-contracts.git",
"reference": "24d9dc654b83e91aa59f9d167b131bc3b5bea24c" "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/24d9dc654b83e91aa59f9d167b131bc3b5bea24c", "url": "https://api.github.com/repos/symfony/service-contracts/zipball/4b426aac47d6427cc1a1d0f7e2ac724627f5966c",
"reference": "24d9dc654b83e91aa59f9d167b131bc3b5bea24c", "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3728,7 +3734,7 @@
"standards" "standards"
], ],
"support": { "support": {
"source": "https://github.com/symfony/service-contracts/tree/v2.5.1" "source": "https://github.com/symfony/service-contracts/tree/v2.5.2"
}, },
"funding": [ "funding": [
{ {
@ -3744,20 +3750,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2022-03-13T20:07:29+00:00" "time": "2022-05-30T19:17:29+00:00"
}, },
{ {
"name": "symfony/yaml", "name": "symfony/yaml",
"version": "v4.4.37", "version": "v4.4.43",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/yaml.git", "url": "https://github.com/symfony/yaml.git",
"reference": "d7f637cc0f0cc14beb0984f2bb50da560b271311" "reference": "07e392f0ef78376d080d5353c081a5e5704835bd"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/d7f637cc0f0cc14beb0984f2bb50da560b271311", "url": "https://api.github.com/repos/symfony/yaml/zipball/07e392f0ef78376d080d5353c081a5e5704835bd",
"reference": "d7f637cc0f0cc14beb0984f2bb50da560b271311", "reference": "07e392f0ef78376d080d5353c081a5e5704835bd",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3799,7 +3805,7 @@
"description": "Loads and dumps YAML files", "description": "Loads and dumps YAML files",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/yaml/tree/v4.4.37" "source": "https://github.com/symfony/yaml/tree/v4.4.43"
}, },
"funding": [ "funding": [
{ {
@ -3815,7 +3821,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2022-01-24T20:11:01+00:00" "time": "2022-06-20T08:31:17+00:00"
}, },
{ {
"name": "theseer/tokenizer", "name": "theseer/tokenizer",
@ -3941,5 +3947,5 @@
"platform-overrides": { "platform-overrides": {
"php": "7.3.6" "php": "7.3.6"
}, },
"plugin-api-version": "2.2.0" "plugin-api-version": "2.3.0"
} }

View file

@ -263,6 +263,8 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
.CodeMirror-widget {} .CodeMirror-widget {}
.CodeMirror-rtl pre { direction: rtl; }
.CodeMirror-code { .CodeMirror-code {
outline: none; outline: none;
} }

View file

@ -2,6 +2,11 @@
// autoload.php @generated by Composer // autoload.php @generated by Composer
if (PHP_VERSION_ID < 50600) {
echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
exit(1);
}
require_once __DIR__ . '/composer/autoload_real.php'; require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit38a448a612c5797456d245c809d4a914::getLoader(); return ComposerAutoloaderInit38a448a612c5797456d245c809d4a914::getLoader();

View file

@ -66,6 +66,16 @@ if (PHP_VERSION_ID < 80000) {
return $operation ? flock($this->handle, $operation) : true; return $operation ? flock($this->handle, $operation) : true;
} }
public function stream_seek($offset, $whence)
{
if (0 === fseek($this->handle, $offset, $whence)) {
$this->position = ftell($this->handle);
return true;
}
return false;
}
public function stream_tell() public function stream_tell()
{ {
return $this->position; return $this->position;
@ -98,7 +108,10 @@ if (PHP_VERSION_ID < 80000) {
} }
} }
if (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) { if (
(function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true))
|| (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
) {
include("phpvfscomposer://" . __DIR__ . '/..'.'/scssphp/scssphp/bin/pscss'); include("phpvfscomposer://" . __DIR__ . '/..'.'/scssphp/scssphp/bin/pscss');
exit(0); exit(0);
} }

View file

@ -21,12 +21,14 @@ use Composer\Semver\VersionParser;
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions * See also https://getcomposer.org/doc/07-runtime.md#installed-versions
* *
* To require its presence, you can require `composer-runtime-api ^2.0` * To require its presence, you can require `composer-runtime-api ^2.0`
*
* @final
*/ */
class InstalledVersions class InstalledVersions
{ {
/** /**
* @var mixed[]|null * @var mixed[]|null
* @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
*/ */
private static $installed; private static $installed;
@ -37,7 +39,7 @@ class InstalledVersions
/** /**
* @var array[] * @var array[]
* @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}> * @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
*/ */
private static $installedByVendor = array(); private static $installedByVendor = array();
@ -241,7 +243,7 @@ class InstalledVersions
/** /**
* @return array * @return array
* @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string} * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
*/ */
public static function getRootPackage() public static function getRootPackage()
{ {
@ -255,7 +257,7 @@ class InstalledVersions
* *
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
* @return array[] * @return array[]
* @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
*/ */
public static function getRawData() public static function getRawData()
{ {
@ -278,7 +280,7 @@ class InstalledVersions
* Returns the raw data of all installed.php which are currently loaded for custom implementations * Returns the raw data of all installed.php which are currently loaded for custom implementations
* *
* @return array[] * @return array[]
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}> * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
*/ */
public static function getAllRawData() public static function getAllRawData()
{ {
@ -301,7 +303,7 @@ class InstalledVersions
* @param array[] $data A vendor/composer/installed.php data set * @param array[] $data A vendor/composer/installed.php data set
* @return void * @return void
* *
* @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
*/ */
public static function reload($data) public static function reload($data)
{ {
@ -311,7 +313,7 @@ class InstalledVersions
/** /**
* @return array[] * @return array[]
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}> * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
*/ */
private static function getInstalled() private static function getInstalled()
{ {

View file

@ -2,7 +2,7 @@
// autoload_classmap.php @generated by Composer // autoload_classmap.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__)); $vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir); $baseDir = dirname($vendorDir);
return array( return array(

View file

@ -2,7 +2,7 @@
// autoload_files.php @generated by Composer // autoload_files.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__)); $vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir); $baseDir = dirname($vendorDir);
return array( return array(

View file

@ -2,7 +2,7 @@
// autoload_namespaces.php @generated by Composer // autoload_namespaces.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__)); $vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir); $baseDir = dirname($vendorDir);
return array( return array(

View file

@ -2,7 +2,7 @@
// autoload_psr4.php @generated by Composer // autoload_psr4.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__)); $vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir); $baseDir = dirname($vendorDir);
return array( return array(

View file

@ -25,38 +25,15 @@ class ComposerAutoloaderInit38a448a612c5797456d245c809d4a914
require __DIR__ . '/platform_check.php'; require __DIR__ . '/platform_check.php';
spl_autoload_register(array('ComposerAutoloaderInit38a448a612c5797456d245c809d4a914', 'loadClassLoader'), true, true); spl_autoload_register(array('ComposerAutoloaderInit38a448a612c5797456d245c809d4a914', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit38a448a612c5797456d245c809d4a914', 'loadClassLoader')); spl_autoload_unregister(array('ComposerAutoloaderInit38a448a612c5797456d245c809d4a914', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); require __DIR__ . '/autoload_static.php';
if ($useStaticLoader) { call_user_func(\Composer\Autoload\ComposerStaticInit38a448a612c5797456d245c809d4a914::getInitializer($loader));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit38a448a612c5797456d245c809d4a914::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->set($namespace, $path);
}
$map = require __DIR__ . '/autoload_psr4.php';
foreach ($map as $namespace => $path) {
$loader->setPsr4($namespace, $path);
}
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
$loader->addClassMap($classMap);
}
}
$loader->register(true); $loader->register(true);
if ($useStaticLoader) { $includeFiles = \Composer\Autoload\ComposerStaticInit38a448a612c5797456d245c809d4a914::$files;
$includeFiles = Composer\Autoload\ComposerStaticInit38a448a612c5797456d245c809d4a914::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) { foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire38a448a612c5797456d245c809d4a914($fileIdentifier, $file); composerRequire38a448a612c5797456d245c809d4a914($fileIdentifier, $file);
} }

View file

@ -193,17 +193,17 @@
}, },
{ {
"name": "scssphp/scssphp", "name": "scssphp/scssphp",
"version": "v1.10.3", "version": "v1.10.4",
"version_normalized": "1.10.3.0", "version_normalized": "1.10.4.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/scssphp/scssphp.git", "url": "https://github.com/scssphp/scssphp.git",
"reference": "0f1e1516ed2412ad43e42a6a319e77624ba1f713" "reference": "8ed20753db2d3d82629e6f5d35535bbbd3893b0c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/scssphp/scssphp/zipball/0f1e1516ed2412ad43e42a6a319e77624ba1f713", "url": "https://api.github.com/repos/scssphp/scssphp/zipball/8ed20753db2d3d82629e6f5d35535bbbd3893b0c",
"reference": "0f1e1516ed2412ad43e42a6a319e77624ba1f713", "reference": "8ed20753db2d3d82629e6f5d35535bbbd3893b0c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -226,11 +226,17 @@
"ext-iconv": "Can be used as fallback when ext-mbstring is not available", "ext-iconv": "Can be used as fallback when ext-mbstring is not available",
"ext-mbstring": "For best performance, mbstring should be installed as it is faster than ext-iconv" "ext-mbstring": "For best performance, mbstring should be installed as it is faster than ext-iconv"
}, },
"time": "2022-05-16T07:22:18+00:00", "time": "2022-07-26T16:28:33+00:00",
"bin": [ "bin": [
"bin/pscss" "bin/pscss"
], ],
"type": "library", "type": "library",
"extra": {
"bamarni-bin": {
"forward-command": false,
"bin-links": false
}
},
"installation-source": "dist", "installation-source": "dist",
"autoload": { "autoload": {
"psr-4": { "psr-4": {
@ -264,7 +270,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/scssphp/scssphp/issues", "issues": "https://github.com/scssphp/scssphp/issues",
"source": "https://github.com/scssphp/scssphp/tree/v1.10.3" "source": "https://github.com/scssphp/scssphp/tree/v1.10.4"
}, },
"install-path": "../scssphp/scssphp" "install-path": "../scssphp/scssphp"
} }

View file

@ -1,40 +1,40 @@
<?php return array( <?php return array(
'root' => array( 'root' => array(
'name' => 'getgrav/grav-plugin-admin',
'pretty_version' => 'dev-develop', 'pretty_version' => 'dev-develop',
'version' => 'dev-develop', 'version' => 'dev-develop',
'reference' => '713002e2b83b9660bfcefe5bb0d76954eedf2b90',
'type' => 'grav-plugin', 'type' => 'grav-plugin',
'install_path' => __DIR__ . '/../../', 'install_path' => __DIR__ . '/../../',
'aliases' => array(), 'aliases' => array(),
'reference' => '0a5b51b9e2c2eb9626b17c8b164dcfc3296ccf3c',
'name' => 'getgrav/grav-plugin-admin',
'dev' => false, 'dev' => false,
), ),
'versions' => array( 'versions' => array(
'getgrav/grav-plugin-admin' => array( 'getgrav/grav-plugin-admin' => array(
'pretty_version' => 'dev-develop', 'pretty_version' => 'dev-develop',
'version' => 'dev-develop', 'version' => 'dev-develop',
'reference' => '713002e2b83b9660bfcefe5bb0d76954eedf2b90',
'type' => 'grav-plugin', 'type' => 'grav-plugin',
'install_path' => __DIR__ . '/../../', 'install_path' => __DIR__ . '/../../',
'aliases' => array(), 'aliases' => array(),
'reference' => '0a5b51b9e2c2eb9626b17c8b164dcfc3296ccf3c',
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'laminas/laminas-xml' => array( 'laminas/laminas-xml' => array(
'pretty_version' => '1.4.0', 'pretty_version' => '1.4.0',
'version' => '1.4.0.0', 'version' => '1.4.0.0',
'reference' => 'dcadeefdb6d7ed6b39d772b47e3845003d6ea60f',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../laminas/laminas-xml', 'install_path' => __DIR__ . '/../laminas/laminas-xml',
'aliases' => array(), 'aliases' => array(),
'reference' => 'dcadeefdb6d7ed6b39d772b47e3845003d6ea60f',
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'laminas/laminas-zendframework-bridge' => array( 'laminas/laminas-zendframework-bridge' => array(
'pretty_version' => '1.4.1', 'pretty_version' => '1.4.1',
'version' => '1.4.1.0', 'version' => '1.4.1.0',
'reference' => '88bf037259869891afce6504cacc4f8a07b24d0f',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../laminas/laminas-zendframework-bridge', 'install_path' => __DIR__ . '/../laminas/laminas-zendframework-bridge',
'aliases' => array(), 'aliases' => array(),
'reference' => '88bf037259869891afce6504cacc4f8a07b24d0f',
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'miniflux/picofeed' => array( 'miniflux/picofeed' => array(
@ -46,19 +46,19 @@
'p3k/picofeed' => array( 'p3k/picofeed' => array(
'pretty_version' => 'v0.1.40', 'pretty_version' => 'v0.1.40',
'version' => '0.1.40.0', 'version' => '0.1.40.0',
'reference' => '356fd66d48779193b10ac28532cb4a4e11bb801c',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../p3k/picofeed', 'install_path' => __DIR__ . '/../p3k/picofeed',
'aliases' => array(), 'aliases' => array(),
'reference' => '356fd66d48779193b10ac28532cb4a4e11bb801c',
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'scssphp/scssphp' => array( 'scssphp/scssphp' => array(
'pretty_version' => 'v1.10.3', 'pretty_version' => 'v1.10.4',
'version' => '1.10.3.0', 'version' => '1.10.4.0',
'reference' => '8ed20753db2d3d82629e6f5d35535bbbd3893b0c',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../scssphp/scssphp', 'install_path' => __DIR__ . '/../scssphp/scssphp',
'aliases' => array(), 'aliases' => array(),
'reference' => '0f1e1516ed2412ad43e42a6a319e77624ba1f713',
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'symfony/polyfill-php72' => array( 'symfony/polyfill-php72' => array(

View file

@ -107,5 +107,11 @@
"allow-plugins": { "allow-plugins": {
"bamarni/composer-bin-plugin": true "bamarni/composer-bin-plugin": true
} }
},
"extra": {
"bamarni-bin": {
"forward-command": false,
"bin-links": false
}
} }
} }

View file

@ -3544,11 +3544,11 @@ EOL;
// 1. op[op name][left type][right type] // 1. op[op name][left type][right type]
// 2. op[left type][right type] (passing the op as first arg) // 2. op[left type][right type] (passing the op as first arg)
// 3. op[op name] // 3. op[op name]
if (\is_callable([$this, $fn = "op${ucOpName}${ucLType}${ucRType}"])) { if (\is_callable([$this, $fn = "op{$ucOpName}{$ucLType}{$ucRType}"])) {
$out = $this->$fn($left, $right, $shouldEval); $out = $this->$fn($left, $right, $shouldEval);
} elseif (\is_callable([$this, $fn = "op${ucLType}${ucRType}"])) { } elseif (\is_callable([$this, $fn = "op{$ucLType}{$ucRType}"])) {
$out = $this->$fn($op, $left, $right, $shouldEval); $out = $this->$fn($op, $left, $right, $shouldEval);
} elseif (\is_callable([$this, $fn = "op${ucOpName}"])) { } elseif (\is_callable([$this, $fn = "op{$ucOpName}"])) {
$out = $this->$fn($left, $right, $shouldEval); $out = $this->$fn($left, $right, $shouldEval);
} else { } else {
$out = null; $out = null;
@ -3892,7 +3892,7 @@ EOL;
// Special functions overriding a CSS function are case-insensitive. We normalize them as lowercase // Special functions overriding a CSS function are case-insensitive. We normalize them as lowercase
// to avoid the deprecation warning about the wrong case being used. // to avoid the deprecation warning about the wrong case being used.
if ($lowercasedName === 'min' || $lowercasedName === 'max') { if ($lowercasedName === 'min' || $lowercasedName === 'max' || $lowercasedName === 'rgb' || $lowercasedName === 'rgba' || $lowercasedName === 'hsl' || $lowercasedName === 'hsla') {
$normalizedName = $lowercasedName; $normalizedName = $lowercasedName;
} }

View file

@ -19,5 +19,5 @@ namespace ScssPhp\ScssPhp;
*/ */
class Version class Version
{ {
const VERSION = '1.10.3'; const VERSION = '1.10.4';
} }

View file

@ -1,3 +1,18 @@
# v2.0.1
## 08/04/2022
1. [](#bugfix)
* Fixed exception thrown instead of **404 Page not found** [#66](https://github.com/getgrav/grav-plugin-langswitcher/issues/66)
# v2.0.0
## 07/25/2022
1. [](#new)
* Support for translated slugs!!!! [#50](https://github.com/getgrav/grav-plugin-langswitcher/pull/50)
* Require Grav `1.7`
1. [](#improved)
* Improved support for home URL [#59](https://github.com/getgrav/grav-plugin-langswitcher/pull/59)
# v1.5.0 # v1.5.0
## 07/01/2021 ## 07/01/2021

View file

@ -1,5 +1,5 @@
name: LangSwitcher name: LangSwitcher
version: 1.5.0 version: 2.0.1
description: LangSwitcher is a [Grav](http://github.com/getgrav/grav) plugin that provides native language text links to switch between [multiple languages](http://learn.getgrav.org/content/multi-language) in Grav **v0.9.30** or greater. description: LangSwitcher is a [Grav](http://github.com/getgrav/grav) plugin that provides native language text links to switch between [multiple languages](http://learn.getgrav.org/content/multi-language) in Grav **v0.9.30** or greater.
icon: globe icon: globe
author: author:
@ -11,7 +11,7 @@ keywords: mulitlang, multilanguage, translation, switcher
bugs: https://github.com/getgrav/grav-plugin-langswitcher/issues bugs: https://github.com/getgrav/grav-plugin-langswitcher/issues
license: MIT license: MIT
dependencies: dependencies:
- { name: grav, version: '>=1.6.0' } - { name: grav, version: '>=1.7.0' }
form: form:
validation: strict validation: strict

View file

@ -67,6 +67,43 @@ class LangSwitcherPlugin extends Plugin
$this->grav['twig']->twig_paths[] = __DIR__ . '/templates'; $this->grav['twig']->twig_paths[] = __DIR__ . '/templates';
} }
/**
* Generate localized route based on the translated slugs found through the pages hierarchy
*/
protected function getTranslatedUrl($lang, $path)
{
$translated_url_parts = array();
$pages = $this->grav['pages'];
$page = $pages->get($path);
$current_node = $page;
$max_recursions = 10;
while ($max_recursions > 0 && $current_node !== null && $current_node->slug() != 'pages' && $path != 'pages') {
$translated_md_filepath = "{$path}/{$current_node->template()}.{$lang}.md";
if (file_exists($translated_md_filepath)) {
$translated_page = new Page();
$translated_page->init(new \SplFileInfo($translated_md_filepath));
$translated_slug = $translated_page->slug();
if (!empty($translated_slug)) {
array_unshift($translated_url_parts, $translated_slug);
} else {
$untranslated_slug = $current_node->slug();
if (!empty($untranslated_slug)) {
array_unshift($translated_url_parts, $untranslated_slug);
}
}
$current_node = $current_node->parent();
$path = dirname($path);
}
$max_recursions--;
}
if (!empty($translated_url_parts)) {
array_unshift($translated_url_parts, '');
return implode('/', $translated_url_parts);
} else {
return '';
}
}
/** /**
* Set needed variables to display Langswitcher. * Set needed variables to display Langswitcher.
*/ */
@ -98,6 +135,14 @@ class LangSwitcherPlugin extends Plugin
$data->translated_pages = $translated_pages; $data->translated_pages = $translated_pages;
} }
$data->translated_routes = array();
foreach ($data->languages as $language) {
$data->translated_routes[$language] = $this->getTranslatedUrl($language, $page->path());
if (empty($data->translated_routes[$language])) {
$data->translated_routes[$language] = $data->page_route;
}
}
$data->current = $this->grav['language']->getLanguage(); $data->current = $this->grav['language']->getLanguage();
$this->grav['twig']->twig_vars['langswitcher'] = $this->grav['langswitcher'] = $data; $this->grav['twig']->twig_vars['langswitcher'] = $this->grav['langswitcher'] = $data;

View file

@ -8,7 +8,7 @@
{% set active_class = ' active' %} {% set active_class = ' active' %}
{% else %} {% else %}
{% set base_lang_url = base_url_simple ~ grav.language.getLanguageURLPrefix(language) %} {% set base_lang_url = base_url_simple ~ grav.language.getLanguageURLPrefix(language) %}
{% set lang_url = base_lang_url ~ langswitcher.page_route ~ page.urlExtension %} {% set lang_url = base_lang_url ~ langswitcher.translated_routes[language] ~ page.urlExtension %}
{% set untranslated_pages_behavior = grav.config.plugins.langswitcher.untranslated_pages_behavior %} {% set untranslated_pages_behavior = grav.config.plugins.langswitcher.untranslated_pages_behavior %}
{% if untranslated_pages_behavior != 'none' %} {% if untranslated_pages_behavior != 'none' %}
{% set translated_page = langswitcher.translated_pages[language] %} {% set translated_page = langswitcher.translated_pages[language] %}