diff options
author | ArthurHoaro <arthur@hoa.ro> | 2018-05-22 22:44:38 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2018-10-06 12:55:05 +0200 |
commit | 4154c25b5f2f8044a37d7f84e04173bb54f2375b (patch) | |
tree | e7f61835072a54eee8590286496bdbbbef0e4a37 /application/Updater.php | |
parent | 10a7b5cee96a742fbe86edbea977f3c55c92e9aa (diff) | |
download | Shaarli-4154c25b5f2f8044a37d7f84e04173bb54f2375b.tar.gz Shaarli-4154c25b5f2f8044a37d7f84e04173bb54f2375b.tar.zst Shaarli-4154c25b5f2f8044a37d7f84e04173bb54f2375b.zip |
Add a button to set links as sticky
Meaning that they always appear on top of all links
Fixes #186
Diffstat (limited to 'application/Updater.php')
-rw-r--r-- | application/Updater.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/application/Updater.php b/application/Updater.php index 480bff82..5dde47cb 100644 --- a/application/Updater.php +++ b/application/Updater.php | |||
@@ -517,6 +517,26 @@ class Updater | |||
517 | 517 | ||
518 | return true; | 518 | return true; |
519 | } | 519 | } |
520 | |||
521 | /** | ||
522 | * Set sticky = false on all links | ||
523 | * | ||
524 | * @return bool true if the update is successful, false otherwise. | ||
525 | */ | ||
526 | public function updateMethodSetSticky() | ||
527 | { | ||
528 | foreach ($this->linkDB as $key => $link) { | ||
529 | if (isset($link['sticky'])) { | ||
530 | return true; | ||
531 | } | ||
532 | $link['sticky'] = false; | ||
533 | $this->linkDB[$key] = $link; | ||
534 | } | ||
535 | |||
536 | $this->linkDB->save($this->conf->get('resource.page_cache')); | ||
537 | |||
538 | return true; | ||
539 | } | ||
520 | } | 540 | } |
521 | 541 | ||
522 | /** | 542 | /** |