aboutsummaryrefslogtreecommitdiff
path: root/app/class/Modelpage.php
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2020-03-23 21:04:15 +0100
committervincent-peugnet <v.peugnet@free.fr>2020-03-23 21:04:46 +0100
commit1a93d70c938f3ae2b050f3a102c961cf1cc3cefc (patch)
treeb7ae3dd51fc3008169295d693f320fae901b14af /app/class/Modelpage.php
parenta7174bb27de46b2f64118181221fad3658f511d3 (diff)
downloadwcms-1a93d70c938f3ae2b050f3a102c961cf1cc3cefc.tar.gz
wcms-1a93d70c938f3ae2b050f3a102c961cf1cc3cefc.zip
filter map and orphans hide
Diffstat (limited to 'app/class/Modelpage.php')
-rw-r--r--app/class/Modelpage.php26
1 files changed, 22 insertions, 4 deletions
diff --git a/app/class/Modelpage.php b/app/class/Modelpage.php
index 9344089..43ba117 100644
--- a/app/class/Modelpage.php
+++ b/app/class/Modelpage.php
@@ -27,7 +27,7 @@ class Modelpage extends Modeldb
/**
* Scan library for all pages as objects
*
- * @return array of Pages objects
+ * @return array of Pages objects as `id => Page`
*/
public function getlister()
{
@@ -232,7 +232,7 @@ class Modelpage extends Modeldb
public function pagelistsort(&$pagelist, $sortby, $order = 1)
{
- return usort($pagelist, $this->buildsorter($sortby, $order));
+ return uasort($pagelist, $this->buildsorter($sortby, $order));
}
@@ -241,7 +241,7 @@ class Modelpage extends Modeldb
* @param array $tagchecked list of tags
* @param string $tagcompare string, can be 'OR' or 'AND', set the tag filter method
*
- * @return array $array
+ * @return array $array of `string` page id
*/
public function filtertagfilter(array $pagelist, array $tagchecked, $tagcompare = 'OR')
@@ -267,6 +267,16 @@ class Modelpage extends Modeldb
return $filteredlist;
}
+
+
+ /**
+ * @param array $pagelist List of Page
+ * @param array $authorchecked list of authors
+ * @param string $authorcompare, can be 'OR' or 'AND', set the author filter method
+ *
+ * @return array $array of `string` page id
+ */
+
public function filterauthorfilter(array $pagelist, array $authorchecked, $authorcompare = 'OR')
{
@@ -290,7 +300,15 @@ class Modelpage extends Modeldb
return $filteredlist;
}
- public function filtersecure(array $pagelist, $secure) : array
+ /**
+ * @param array $pagelist List of Page
+ * @param int $secure secure level
+ * @param string $authorcompare, can be 'OR' or 'AND', set the author filter method
+ *
+ * @return array $array of `string` page id
+ */
+
+ public function filtersecure(array $pagelist, int $secure) : array
{
$filteredlist = [];
foreach ($pagelist as $page) {