mirror of
https://github.com/processwire/processwire.git
synced 2025-08-09 00:06:55 +02:00
Add PagesPathFinder class to core
This commit is contained in:
@@ -3826,7 +3826,7 @@ class Page extends WireData implements \Countable, WireMatchable {
|
||||
*
|
||||
*/
|
||||
public function status($value = false, $status = null) {
|
||||
if($value !== true) return $this->setStatus($value);
|
||||
if($value !== true && $value !== false) return $this->setStatus($value);
|
||||
if($status === null) $status = $this->status;
|
||||
if($value === false) return $status;
|
||||
return PageProperties::statusToNames($status);
|
||||
@@ -4021,7 +4021,7 @@ class Page extends WireData implements \Countable, WireMatchable {
|
||||
*/
|
||||
public function secureFiles() {
|
||||
if($this->wire()->config->pagefileSecure && !$this->isPublic()) return true;
|
||||
$template = $this->template();
|
||||
$template = $this->getAccessTemplate();
|
||||
if(!$template) return null;
|
||||
$value = $template->pagefileSecure;
|
||||
if($value < 1) return false; // 0: disabled
|
||||
|
@@ -2343,7 +2343,7 @@ class PageFinder extends Wire {
|
||||
$pages = $this->pages;
|
||||
$database = $this->database;
|
||||
$user = $this->wire()->user;
|
||||
$language = $this->languages && $user->language ? $user->language : null;
|
||||
$language = $this->languages && $user && $user->language ? $user->language : null;
|
||||
|
||||
// support `sort=a|b|c` in correct order (because orderby prepend used below)
|
||||
if(count($values) > 1) $values = array_reverse($values);
|
||||
|
1439
wire/core/PagesPathFinder.php
Normal file
1439
wire/core/PagesPathFinder.php
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1124,9 +1124,10 @@ class Sanitizer extends Wire {
|
||||
if($charset === 'UTF8' && $beautify === self::okUTF8) {
|
||||
$value = $this->pagePathNameUTF8($value);
|
||||
} else {
|
||||
if(in_array($beautify, array(self::okUTF8, self::toUTF8, self::toAscii))) $beautify = false;
|
||||
$b = $beautify;
|
||||
if(in_array($beautify, array(self::okUTF8, self::toUTF8, self::toAscii))) $b = false;
|
||||
// regular ascii path
|
||||
$value = $this->name($value, $beautify, $maxLength, '-', $options);
|
||||
$value = $this->name($value, $b, $maxLength, '-', $options);
|
||||
}
|
||||
|
||||
// disallow double slashes
|
||||
|
Reference in New Issue
Block a user