Lines Matching refs:tag

24         $this->taghelper = $this->loadHelper('tag');
57 * Search in Tagindex for tags that matches the tag pattern and are in requested namespace
62 * @return string[]|false with tag=>label pairs
74 foreach ($tags as $tag) {
75 if ($this->matchesTagExpression($tagExpression, $tag) && $this->isTagInNamespace($tag, $ns, $aclSafe)) {
76 $matchedTag_label[$tag] = $this->getTagLabel($tag);
85 * Test if tag matches with requested pattern
88 * @param string $tag
91 public function matchesTagExpression($tagExpression, $tag)
93 return (bool)@preg_match('/^' . $tagExpression . '$/i', $tag);
97 * Returns latest part of tag as label
99 * @param string $tag
102 public function getTagLabel($tag)
104 $label = strrchr($tag, ':');
105 $label = $label != '' ? $label : $tag;
155 * @param string $tag1 tag being searched
156 * @param string $tag2 tag from index
166 * Checks if tag is used in the namespace, eventually can consider read permission as well
168 * @param string $tag
170 * @param bool $aclSafe if true, uses tag from a page only if user has read permissions
173 protected function isTagInNamespace($tag, $ns, $aclSafe = true)
183 $pages = $indexer->lookupKey('subject', $tag, [$this, 'tagCompare']);
225 * @param string $tag space separated tags
229 public function getPagesByTag($tag, $ns = '')
231 $tags = explode(' ', $tag);
328 * @param string $tag
331 public function getImageLinkByTag($tag)
333 $id = $this->getConf('nsTagImage') . ':' . str_replace([' ', ':'], '_', $tag);
364 foreach ($this->tagsPerPage[$id] as $tag) {
365 if ($this->matchesTagExpression($col, $tag)) {
366 $foundTags[] = hsc($this->getTagLabel($tag));
437 * partially copied from tag->helper with less checks (on cache) and no meta lookups
461 * @param $tag
464 public function getTagCategory($tag)
466 $label = strstr($tag, ':', true);
467 $label = $label != '' ? $label : $tag;
506 foreach ($this->tagsPerPage[$id] as $tag) {
507 if ($this->matchesTagExpression($column, $tag)) {
508 $foundTags[] = hsc($this->getTagLabel($tag));
516 * Returns per tag the pages where these are used as array with: tag=>array with pages
517 * The tags matches the tag regexp pattern and only shown if it is used at pages in requested namespace, these pages
518 * are listed in an array per tag
522 * @param string $tags tag expression e.g. "status:.*"
524 * @return array [tag]=>array pages where tag is used
536 foreach ($indexTags as $tag) {
538 if ($this->matchesTagExpression($tagExpr, $tag))
539 $matchedTags[] = $tag;
545 foreach ($matchedTags as $tag) {
546 $pages = $this->taghelper->getIndexedPagesMatchingTagQuery([$tag]);
549 $matchedPages[$tag] = array_filter($pages, function ($pageid) use ($ns) {