aboutsummaryrefslogtreecommitdiff
path: root/app/class/user.php
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2019-08-21 11:35:40 +0200
committervincent-peugnet <v.peugnet@free.fr>2019-08-21 11:35:40 +0200
commit63202efc75a63ef30e58c12d602ea95a960a0976 (patch)
tree1c8bc40941ab8abdb18f68066d6ab64674f465d5 /app/class/user.php
parent388bd7c3aff8b440febd83598003f96d5a746505 (diff)
downloadwcms-63202efc75a63ef30e58c12d602ea95a960a0976.tar.gz
wcms-63202efc75a63ef30e58c12d602ea95a960a0976.zip
New feature : bookmarks
- public bookmarks stored in config.json - personnal bookmarks stored in user data
Diffstat (limited to 'app/class/user.php')
-rw-r--r--app/class/user.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/app/class/user.php b/app/class/user.php
index ba3dfea..68eed91 100644
--- a/app/class/user.php
+++ b/app/class/user.php
@@ -11,6 +11,7 @@ class User
protected $columns = ['title', 'datemodif', 'datecreation', 'secure', 'visitcount'];
protected $connectcount = 0;
protected $expiredate = false;
+ protected $bookmark = [];
public function __construct($datas = [])
{
@@ -114,6 +115,11 @@ class User
}
}
+ public function bookmark()
+ {
+ return $this->bookmark;
+ }
+
// _______________________ S E T _______________________
@@ -185,6 +191,15 @@ class User
}
}
+ public function setbookmark($bookmark)
+ {
+ if(is_array($bookmark)) {
+ $this->bookmark = $bookmark;
+ }
+ }
+
+
+
@@ -246,6 +261,20 @@ class User
$this->connectcount ++;
}
+ public function addbookmark(string $id, string $query)
+ {
+ $id = idclean($id);
+ $this->bookmark[$id] = $query;
+ }
+
+ public function deletebookmark(string $id)
+ {
+ if(key_exists($id, $this->bookmark)) {
+ unset($this->bookmark[$id]);
+ }
+ }
+
+
}