Upgrade to 3.2.5
This commit is contained in:
@@ -49,7 +49,7 @@ class Page extends ModelWithContent
|
||||
/**
|
||||
* The PageBlueprint object
|
||||
*
|
||||
* @var Kirby\Cms\PageBlueprint
|
||||
* @var \Kirby\Cms\PageBlueprint
|
||||
*/
|
||||
protected $blueprint;
|
||||
|
||||
@@ -92,7 +92,7 @@ class Page extends ModelWithContent
|
||||
* The template, that should be loaded
|
||||
* if it exists
|
||||
*
|
||||
* @var Kirby\Cms\Template
|
||||
* @var \Kirby\Cms\Template
|
||||
*/
|
||||
protected $intendedTemplate;
|
||||
|
||||
@@ -111,7 +111,7 @@ class Page extends ModelWithContent
|
||||
/**
|
||||
* The parent page
|
||||
*
|
||||
* @var Kirby\Cms\Page|null
|
||||
* @var \Kirby\Cms\Page|null
|
||||
*/
|
||||
protected $parent;
|
||||
|
||||
@@ -125,7 +125,7 @@ class Page extends ModelWithContent
|
||||
/**
|
||||
* The parent Site object
|
||||
*
|
||||
* @var Kirby\Cms\Site|null
|
||||
* @var \Kirby\Cms\Site|null
|
||||
*/
|
||||
protected $site;
|
||||
|
||||
@@ -154,7 +154,7 @@ class Page extends ModelWithContent
|
||||
* Magic caller
|
||||
*
|
||||
* @param string $method
|
||||
* @param array $args
|
||||
* @param array $arguments
|
||||
* @return mixed
|
||||
*/
|
||||
public function __call(string $method, array $arguments = [])
|
||||
@@ -192,7 +192,7 @@ class Page extends ModelWithContent
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function __debuginfo(): array
|
||||
public function __debugInfo(): array
|
||||
{
|
||||
return array_merge($this->toArray(), [
|
||||
'content' => $this->content(),
|
||||
@@ -222,7 +222,7 @@ class Page extends ModelWithContent
|
||||
/**
|
||||
* Returns the blueprint object
|
||||
*
|
||||
* @return Kirby\Cms\PageBlueprint
|
||||
* @return \Kirby\Cms\PageBlueprint
|
||||
*/
|
||||
public function blueprint()
|
||||
{
|
||||
@@ -236,6 +236,7 @@ class Page extends ModelWithContent
|
||||
/**
|
||||
* Returns an array with all blueprints that are available for the page
|
||||
*
|
||||
* @param string $inSection
|
||||
* @return array
|
||||
*/
|
||||
public function blueprints(string $inSection = null): array
|
||||
@@ -300,6 +301,8 @@ class Page extends ModelWithContent
|
||||
* Prepares the content for the write method
|
||||
*
|
||||
* @internal
|
||||
* @param array $data
|
||||
* @param string $languageCode
|
||||
* @return array
|
||||
*/
|
||||
public function contentFileData(array $data, string $languageCode = null): array
|
||||
@@ -405,15 +408,20 @@ class Page extends ModelWithContent
|
||||
* gets dragged onto a textarea
|
||||
*
|
||||
* @internal
|
||||
* @param string $type (auto|kirbytext|markdown)
|
||||
* @return string
|
||||
*/
|
||||
public function dragText($type = 'kirbytext'): string
|
||||
public function dragText(string $type = 'auto'): string
|
||||
{
|
||||
if ($type === 'auto') {
|
||||
$type = option('panel.kirbytext', true) ? 'kirbytext' : 'markdown';
|
||||
}
|
||||
|
||||
switch ($type) {
|
||||
case 'kirbytext':
|
||||
return '(link: ' . $this->id() . ' text: ' . $this->title() . ')';
|
||||
case 'markdown':
|
||||
return '[' . $this->title() . '](' . $this->url() . ')';
|
||||
default:
|
||||
return '(link: ' . $this->id() . ' text: ' . $this->title() . ')';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -432,6 +440,7 @@ class Page extends ModelWithContent
|
||||
* takes page models into account.
|
||||
*
|
||||
* @internal
|
||||
* @param mixed $props
|
||||
* @return self
|
||||
*/
|
||||
public static function factory($props)
|
||||
@@ -477,7 +486,7 @@ class Page extends ModelWithContent
|
||||
* Returns the template that should be
|
||||
* loaded if it exists.
|
||||
*
|
||||
* @return Kirby\Cms\Template
|
||||
* @return \Kirby\Cms\Template
|
||||
*/
|
||||
public function intendedTemplate()
|
||||
{
|
||||
@@ -514,12 +523,12 @@ class Page extends ModelWithContent
|
||||
/**
|
||||
* Compares the current object with the given page object
|
||||
*
|
||||
* @param Kirby\Cms\Page|string $page
|
||||
* @param \Kirby\Cms\Page|string $page
|
||||
* @return bool
|
||||
*/
|
||||
public function is($page): bool
|
||||
{
|
||||
if (is_a($page, Page::class) === false) {
|
||||
if (is_a($page, 'Kirby\Cms\Page') === false) {
|
||||
if (is_string($page) === false) {
|
||||
return false;
|
||||
}
|
||||
@@ -527,7 +536,7 @@ class Page extends ModelWithContent
|
||||
$page = $this->kirby()->page($page);
|
||||
}
|
||||
|
||||
if (is_a($page, Page::class) === false) {
|
||||
if (is_a($page, 'Kirby\Cms\Page') === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -553,6 +562,7 @@ class Page extends ModelWithContent
|
||||
/**
|
||||
* Checks if the page is a direct or indirect ancestor of the given $page object
|
||||
*
|
||||
* @param Page $child
|
||||
* @return boolean
|
||||
*/
|
||||
public function isAncestorOf(Page $child): bool
|
||||
@@ -617,7 +627,7 @@ class Page extends ModelWithContent
|
||||
/**
|
||||
* Checks if the page is a child of the given page
|
||||
*
|
||||
* @param Kirby\Cms\Page|string $parent
|
||||
* @param \Kirby\Cms\Page|string $parent
|
||||
* @return boolean
|
||||
*/
|
||||
public function isChildOf($parent): bool
|
||||
@@ -632,7 +642,7 @@ class Page extends ModelWithContent
|
||||
/**
|
||||
* Checks if the page is a descendant of the given page
|
||||
*
|
||||
* @param Kirby\Cms\Page|string $parent
|
||||
* @param \Kirby\Cms\Page|string $parent
|
||||
* @return boolean
|
||||
*/
|
||||
public function isDescendantOf($parent): bool
|
||||
@@ -920,7 +930,7 @@ class Page extends ModelWithContent
|
||||
*
|
||||
* @internal
|
||||
* @param string|null $query
|
||||
* @return Kirby\Cms\File|Kirby\Cms\Asset|null
|
||||
* @return \Kirby\Cms\File|\Kirby\Cms\Asset|null
|
||||
*/
|
||||
protected function panelImageSource(string $query = null)
|
||||
{
|
||||
@@ -972,6 +982,7 @@ class Page extends ModelWithContent
|
||||
* in the panel
|
||||
*
|
||||
* @internal
|
||||
* @param bool $relative
|
||||
* @return string
|
||||
*/
|
||||
public function panelUrl(bool $relative = false): string
|
||||
@@ -986,7 +997,7 @@ class Page extends ModelWithContent
|
||||
/**
|
||||
* Returns the parent Page object
|
||||
*
|
||||
* @return Kirby\Cms\Page|null
|
||||
* @return \Kirby\Cms\Page|null
|
||||
*/
|
||||
public function parent()
|
||||
{
|
||||
@@ -1014,7 +1025,7 @@ class Page extends ModelWithContent
|
||||
* or the Site
|
||||
*
|
||||
* @internal
|
||||
* @return Kirby\Cms\Page|Kirby\Cms\Site
|
||||
* @return \Kirby\Cms\Page|\Kirby\Cms\Site
|
||||
*/
|
||||
public function parentModel()
|
||||
{
|
||||
@@ -1024,11 +1035,11 @@ class Page extends ModelWithContent
|
||||
/**
|
||||
* Returns a list of all parents and their parents recursively
|
||||
*
|
||||
* @return Kirby\Cms\Pages
|
||||
* @return \Kirby\Cms\Pages
|
||||
*/
|
||||
public function parents()
|
||||
{
|
||||
$parents = new Pages;
|
||||
$parents = new Pages();
|
||||
$page = $this->parent();
|
||||
|
||||
while ($page !== null) {
|
||||
@@ -1042,7 +1053,7 @@ class Page extends ModelWithContent
|
||||
/**
|
||||
* Returns the permissions object for this page
|
||||
*
|
||||
* @return Kirby\Cms\PagePermissions
|
||||
* @return \Kirby\Cms\PagePermissions
|
||||
*/
|
||||
public function permissions()
|
||||
{
|
||||
@@ -1146,7 +1157,8 @@ class Page extends ModelWithContent
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @return Kirby\Cms\Template
|
||||
* @param mixed $type
|
||||
* @return \Kirby\Cms\Template
|
||||
*/
|
||||
public function representation($type)
|
||||
{
|
||||
@@ -1177,7 +1189,7 @@ class Page extends ModelWithContent
|
||||
* which is being used in various methods
|
||||
* to check for valid actions and input.
|
||||
*
|
||||
* @return Kirby\Cms\PageRules
|
||||
* @return \Kirby\Cms\PageRules
|
||||
*/
|
||||
protected function rules()
|
||||
{
|
||||
@@ -1189,7 +1201,7 @@ class Page extends ModelWithContent
|
||||
*
|
||||
* @param string $query
|
||||
* @param array $params
|
||||
* @return Kirby\Cms\Pages
|
||||
* @return \Kirby\Cms\Pages
|
||||
*/
|
||||
public function search(string $query = null, $params = [])
|
||||
{
|
||||
@@ -1246,14 +1258,14 @@ class Page extends ModelWithContent
|
||||
*/
|
||||
protected function setNum(int $num = null)
|
||||
{
|
||||
$this->num = $num === null ? $num : intval($num);
|
||||
$this->num = $num === null ? $num : (int)$num;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the parent page object
|
||||
*
|
||||
* @param Kirby\Cms\Page|null $parent
|
||||
* @param \Kirby\Cms\Page|null $parent
|
||||
* @return self
|
||||
*/
|
||||
protected function setParent(Page $parent = null)
|
||||
@@ -1360,7 +1372,7 @@ class Page extends ModelWithContent
|
||||
/**
|
||||
* Returns the final template
|
||||
*
|
||||
* @return Kirby\Cms\Template
|
||||
* @return \Kirby\Cms\Template
|
||||
*/
|
||||
public function template()
|
||||
{
|
||||
@@ -1380,7 +1392,7 @@ class Page extends ModelWithContent
|
||||
/**
|
||||
* Returns the title field or the slug as fallback
|
||||
*
|
||||
* @return Kirby\Cms\Field
|
||||
* @return \Kirby\Cms\Field
|
||||
*/
|
||||
public function title()
|
||||
{
|
||||
|
Reference in New Issue
Block a user