aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/LinkDB.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/LinkDB.php')
-rw-r--r--application/LinkDB.php11
1 files changed, 7 insertions, 4 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;