aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/LinkDB.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2017-05-25 13:39:31 +0200
committerGitHub <noreply@github.com>2017-05-25 13:39:31 +0200
commit7481dd6e66c132ae064613de19e73dab0ca2de19 (patch)
treeae99823d461435577abd25b8bb24ef07692b99a1 /application/LinkDB.php
parent61c15aa5554431893ea5ebe800a9a625dca5aff9 (diff)
parent6ccd0b218fbd34de750f55b78f3dc43bb3d9fa8e (diff)
downloadShaarli-7481dd6e66c132ae064613de19e73dab0ca2de19.tar.gz
Shaarli-7481dd6e66c132ae064613de19e73dab0ca2de19.tar.zst
Shaarli-7481dd6e66c132ae064613de19e73dab0ca2de19.zip
Merge pull request #878 from Lucas-C/master
Adding the ability to display subtags in the tagcloud
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;