aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/PageBuilder.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2018-01-24 18:46:31 +0100
committerArthurHoaro <arthur@hoa.ro>2018-01-24 18:46:31 +0100
commitd2f6d909e529898c43b32defb890ec8e2d6b72f5 (patch)
tree1c75ee1302f9968e8a25d5157347d5d4c8c52519 /application/PageBuilder.php
parent9d4736a3e95332198896f97ecc8a83abb0cbe85b (diff)
downloadShaarli-d2f6d909e529898c43b32defb890ec8e2d6b72f5.tar.gz
Shaarli-d2f6d909e529898c43b32defb890ec8e2d6b72f5.tar.zst
Shaarli-d2f6d909e529898c43b32defb890ec8e2d6b72f5.zip
Public/private filter: use two separate buttons
#1038
Diffstat (limited to 'application/PageBuilder.php')
-rw-r--r--application/PageBuilder.php21
1 files changed, 0 insertions, 21 deletions
diff --git a/application/PageBuilder.php b/application/PageBuilder.php
index 0902d00d..3233d6b6 100644
--- a/application/PageBuilder.php
+++ b/application/PageBuilder.php
@@ -85,7 +85,6 @@ class PageBuilder
85 $this->tpl->assign('scripturl', index_url($_SERVER)); 85 $this->tpl->assign('scripturl', index_url($_SERVER));
86 $visibility = ! empty($_SESSION['visibility']) ? $_SESSION['visibility'] : ''; 86 $visibility = ! empty($_SESSION['visibility']) ? $_SESSION['visibility'] : '';
87 $this->tpl->assign('visibility', $visibility); 87 $this->tpl->assign('visibility', $visibility);
88 $this->tpl->assign('nextVisibility', $this->getNextVisibility($visibility));
89 $this->tpl->assign('untaggedonly', !empty($_SESSION['untaggedonly'])); 88 $this->tpl->assign('untaggedonly', !empty($_SESSION['untaggedonly']));
90 $this->tpl->assign('pagetitle', $this->conf->get('general.title', 'Shaarli')); 89 $this->tpl->assign('pagetitle', $this->conf->get('general.title', 'Shaarli'));
91 if ($this->conf->exists('general.header_link')) { 90 if ($this->conf->exists('general.header_link')) {
@@ -172,24 +171,4 @@ class PageBuilder
172 $this->tpl->assign('error_message', $message); 171 $this->tpl->assign('error_message', $message);
173 $this->renderPage('404'); 172 $this->renderPage('404');
174 } 173 }
175
176 /**
177 * Return the next visibility option:
178 * private -> public -> all
179 *
180 * @param string $current visibility value
181 *
182 * @return string next visibility value
183 */
184 protected function getNextVisibility($current)
185 {
186 switch ($current) {
187 case 'private':
188 return 'public';
189 case 'public':
190 return '';
191 default:
192 return 'private';
193 }
194 }
195} 174}