Lines Matching refs:pages
82 'desc' => 'returns a list of pages tagged with the given keyword',
88 'return' => ['pages' => 'array'],
92 'desc' => 'refines an array of pages with tags',
94 'pages to refine' => 'array',
97 'return' => ['pages' => 'array'],
179 * @param bool $dynamic if the link class shall be changed if no pages with the specified tag exist
207 $pages = $this->getTopic('', 1, $svtag);
208 if (empty($pages)) {
234 * Returns a list of pages with a certain tag; very similar to ft_backlinks()
236 * @param string $ns A namespace to which all pages need to belong, "." for only the root namespace
237 * @param int $num The maximum number of pages that shall be returned
239 * @return array The list of pages
251 // find the pages using subject_w.idx
252 $pages = $this->getIndexedPagesMatchingTagQuery($queryTags);
253 if (!count($pages)) {
257 foreach ($pages as $page) {
258 // exclude pages depending on ACL and namespace
336 * Refine found pages with tags (+tag: AND, -tag: (AND) NOT)
338 * @param array $pages The pages that shall be filtered, each page needs to be an array with a key "id"
340 * @return array The filtered list of pages
342 public function tagRefine($pages, $tagquery) {
343 if (!is_array($pages)) {
345 return $pages;
350 foreach ($pages as $key => $page) {
352 unset($pages[$key]);
356 return $pages;
365 * @param boolean $isRecursive boolean if counting of pages in subnamespaces is allowed
392 // just to be sure remove duplicate pages from the list of pages
393 $pages = array_unique($indexedPagesWithTags[$tag]);
395 // don't count hidden pages or pages the user can't access
397 $pages = array_filter($pages, [$this, 'isVisible']);
399 if (empty($pages)) continue;
402 // count all pages
403 $tagOccurrences[$tag] = count($pages);
407 foreach ($pages as $page) {
415 foreach ($pages as $page) {
424 // don't return tags without pages
447 * Returns pages from index matching the tag query
465 $pages = $indexer->lookupKey('subject', $cleanTags, [$this, 'tagCompare']);
466 // use all pages as basis if the first tag isn't an "or"-tag or if there are no tags given
473 if (!is_array($pages[$tag])) {
474 $pages[$tag] = [];
478 $result = array_intersect($result, $pages[$tag]);
480 $result = array_diff($result, $pages[$tag]);
482 $result = array_unique(array_merge($result, $pages[$tag]));
635 // discard hidden pages
646 // root namespace is specified, discard all pages who lay outside the root namespace
731 * Returns pages from index matching the tag query