aboutsummaryrefslogtreecommitdiffhomepage
path: root/application
diff options
context:
space:
mode:
Diffstat (limited to 'application')
-rw-r--r--application/LinkDB.php11
-rw-r--r--application/PageBuilder.php2
-rw-r--r--application/Updater.php15
3 files changed, 8 insertions, 20 deletions
diff --git a/application/LinkDB.php b/application/LinkDB.php
index 0d3c85bd..7802cc8a 100644
--- a/application/LinkDB.php
+++ b/application/LinkDB.php
@@ -452,14 +452,17 @@ You use the community supported version of the original Shaarli project, by Seba
452 } 452 }
453 453
454 /** 454 /**
455 * Returns the list of all tags 455 * Returns the list tags appearing in the links with the given tags
456 * Output: associative array key=tags, value=0 456 * @param $filteringTags: tags selecting the links to consider
457 * @param $visibility: process only all/private/public links
458 * @return: a tag=>linksCount array
457 */ 459 */
458 public function allTags() 460 public function linksCountPerTag($filteringTags = [], $visibility = 'all')
459 { 461 {
462 $links = empty($filteringTags) ? $this->links : $this->filterSearch(['searchtags' => $filteringTags], false, $visibility);
460 $tags = array(); 463 $tags = array();
461 $caseMapping = array(); 464 $caseMapping = array();
462 foreach ($this->links as $link) { 465 foreach ($links as $link) {
463 foreach (preg_split('/\s+/', $link['tags'], 0, PREG_SPLIT_NO_EMPTY) as $tag) { 466 foreach (preg_split('/\s+/', $link['tags'], 0, PREG_SPLIT_NO_EMPTY) as $tag) {
464 if (empty($tag)) { 467 if (empty($tag)) {
465 continue; 468 continue;
diff --git a/application/PageBuilder.php b/application/PageBuilder.php
index 50e3f124..c86621a2 100644
--- a/application/PageBuilder.php
+++ b/application/PageBuilder.php
@@ -89,7 +89,7 @@ class PageBuilder
89 $this->tpl->assign('hide_timestamps', $this->conf->get('privacy.hide_timestamps', false)); 89 $this->tpl->assign('hide_timestamps', $this->conf->get('privacy.hide_timestamps', false));
90 $this->tpl->assign('token', getToken($this->conf)); 90 $this->tpl->assign('token', getToken($this->conf));
91 if ($this->linkDB !== null) { 91 if ($this->linkDB !== null) {
92 $this->tpl->assign('tags', $this->linkDB->allTags()); 92 $this->tpl->assign('tags', $this->linkDB->linksCountPerTag());
93 } 93 }
94 // To be removed with a proper theme configuration. 94 // To be removed with a proper theme configuration.
95 $this->tpl->assign('conf', $this->conf); 95 $this->tpl->assign('conf', $this->conf);
diff --git a/application/Updater.php b/application/Updater.php
index 03d93a6f..40a15906 100644
--- a/application/Updater.php
+++ b/application/Updater.php
@@ -329,21 +329,6 @@ class Updater
329 } 329 }
330 330
331 /** 331 /**
332 * While the new default theme is in an unstable state
333 * continue to use the vintage theme
334 */
335 public function updateMethodDefaultThemeVintage()
336 {
337 if ($this->conf->get('resource.theme') !== 'default') {
338 return true;
339 }
340 $this->conf->set('resource.theme', 'vintage');
341 $this->conf->write($this->isLoggedIn);
342
343 return true;
344 }
345
346 /**
347 * * `markdown_escape` is a new setting, set to true as default. 332 * * `markdown_escape` is a new setting, set to true as default.
348 * 333 *
349 * If the markdown plugin was already enabled, escaping is disabled to avoid 334 * If the markdown plugin was already enabled, escaping is disabled to avoid