aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar maTh <math-home@web.de> 2022-07-19 12:56:09 +0200
committerGravatar GitHub <noreply@github.com> 2022-07-19 12:56:09 +0200
commit2d807e06b1abffdbc40a60c3623e22e3c6b818c6 (patch)
treeab2178b30434ebd4d8ec911d12ee39a8f2cd0522 /lib
parent6352a1dccbac03a9582810e5d284ebac54f24f5b (diff)
Fix/Improved: Slider mobile (#4416)
* add close button, add content slider div * add &ajax=1#slider to the links * CSS * fix showPW functionality * open slider after received Ajax * do not show empty slider * RTL CSS * fixed code smell * improved: links prep via JS * Redirect anchor * enable #anchors in printuri() * enable #slider when config was saved * Active sliding via JS Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'lib')
-rw-r--r--lib/Minz/Url.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Minz/Url.php b/lib/Minz/Url.php
index 40cadb49a..d6af50364 100644
--- a/lib/Minz/Url.php
+++ b/lib/Minz/Url.php
@@ -63,6 +63,7 @@ class Minz_Url {
private static function printUri($url, $encodage) {
$uri = '';
$separator = '?';
+ $anchor = '';
if ($encodage === 'html') {
$and = '&amp;';
@@ -70,6 +71,11 @@ class Minz_Url {
$and = '&';
}
+ if (!empty($url['params']['#'])) {
+ $anchor = '#' . ($encodage === 'html' ? htmlspecialchars($url['params']['#'], ENT_QUOTES, 'UTF-8') : $url['params']['#']);
+ unset($url['params']['#']);
+ }
+
if (isset($url['c'])
&& $url['c'] != Minz_Request::defaultControllerName()) {
$uri .= $separator . 'c=' . $url['c'];
@@ -91,6 +97,12 @@ class Minz_Url {
}
}
+ if (!empty($url['#'])) {
+ $uri .= '#' . ($encodage === 'html' ? htmlspecialchars($url['#'], ENT_QUOTES, 'UTF-8') : $url['#']);
+ }
+
+ $uri .= $anchor;
+
return $uri;
}