Lines Matching refs:tags

11  * Helper part of the tag plugin, allows to query and print tags
65 'desc' => 'returns the header for the tags column for pagelist',
77 'params' => ['tags' => 'array'],
92 'desc' => 'refines an array of pages with tags',
95 'refinement tags' => 'string'
101 'desc' => 'returns a list of tags with their number of occurrences',
103 'list of tags to get the occurrences for' => 'array',
105 'if all tags shall be returned (then the first parameter is ignored)' => 'boolean',
108 'return' => ['tags' => 'array'],
134 return $this->getLang('tags');
157 * Returns the links for given tags
159 * @param array $tags an array of tags
160 * @return string HTML link tags
162 public function tagLinks($tags) {
163 if (empty($tags) || ($tags[0] == '')) {
168 foreach ($tags as $tag) {
314 'tags' => $taglinks,
336 * Refine found pages with tags (+tag: AND, -tag: (AND) NOT)
339 * @param string $tagquery The list of tags in the form "tag +tag2 -tag3". The tags will be cleaned.
360 * Get count of occurrences for a list of tags
362 * @param array $tags array of tags
363 * @param array $namespaces array of namespaces where to count the tags
364 * @param boolean $allTags boolean if all available tags should be counted
369 public function tagOccurrences($tags, $namespaces = null, $allTags = false, $isRecursive = null) {
370 // map with trim here in order to remove newlines from tags
372 $tags = array_map('trim', idx_getIndex('subject', '_w'));
374 $tags = $this->cleanTagList($tags);
382 $indexedPagesWithTags = $indexer->lookupKey('subject', $tags, array($this, 'tagCompare'));
389 foreach ($tags as $tag) {
424 // don't return tags without pages
433 * Get tags from the 'subject' metadata field
439 $tags = p_get_metadata($id, 'subject');
440 if (!is_array($tags)) {
441 $tags = explode(' ', $tags);
443 return array_unique($tags);
449 * @param array $queryTags the tags to filter e.g. ['tag'(OR), '+tag'(AND), '-tag'(NOT)]
466 // use all pages as basis if the first tag isn't an "or"-tag or if there are no tags given
492 * Splits a string into an array of tags
494 * @param string $tags tag string, if containing spaces use quotes e.g. "tag with spaces", will be replaced by underscores
498 public function parseTagList($tags, $clean = false) {
500 // support for "quoted phrase tags", replaces spaces by underscores
501 if (preg_match_all('#".*?"#', $tags, $matches)) {
504 $tags = str_replace($match, $replace, $tags);
508 $tags = preg_split('/ /', $tags, -1, PREG_SPLIT_NO_EMPTY);
511 return $this->cleanTagList($tags);
513 return $tags;
518 * Clean a list (array) of tags using _cleanTag
520 * @param string[] $tags
523 public function cleanTagList($tags) {
524 return array_unique(array_map([$this, 'cleanTag'], $tags));
544 * Makes user or date dependent topic lists possible by replacing placeholders in tags
671 * Check if the page is a real candidate for the result of the getTopic by comparing its tags with the wanted tags
673 * @param string[] $pageTags cleaned tags from the metadata of the page
674 * @param string[] $queryTags tags we are looking ['tag', '+tag', '-tag']
697 * @param string $tags
701 public function _parseTagList($tags, $clean = false) {
702 return $this->parseTagList($tags, $clean);
719 * Clean a list (array) of tags using _cleanTag
723 * @param string[] $tags
726 public function _cleanTagList($tags) {
727 return $this->cleanTagList($tags);
733 * @param array $queryTags the tags to filter e.g. ['tag'(OR), '+tag'(AND), '-tag'(NOT)]