Lines Matching refs:data

70 		$data = array('displayType' => CATLIST_DISPLAY_LIST, 'nsInBold' => true, 'expand' => 6,
94 $data['index_priority'][] = $_index_priority_map[$index_type];
99 $this->_checkOption($match, "displayList", $data['displayType'], CATLIST_DISPLAY_LIST);
100 $this->_checkOption($match, "displayLine", $data['displayType'], CATLIST_DISPLAY_LINE);
101 $this->_checkOption($match, "noNSInBold", $data['nsInBold'], false);
103 $data['expand'] = intval($found[1]);
106 $this->_checkOption($match, "noHeadTitle", $data['useheading'], false);
107 $this->_checkOption($match, "forceHeadTitle", $data['useheading'], true);
108 $data['nsuseheading'] = $data['useheading'];
109 $this->_checkOption($match, "noNSHeadTitle", $data['nsuseheading'], false);
110 $this->_checkOption($match, "hideNotFoundMsg", $data['show_notfound_error'], false);
113 $this->_checkOption($match, "forceLinks", $data['nsLinks'], CATLIST_NSLINK_FORCE); // /!\ Deprecated
114 $this->_checkOptionParam($match, "nsLinks", $data['nsLinks'], array( "none" => CATLIST_NSLINK_NONE,
123 $data[substr($option,0,-1)][] = array('regex' => $found[3], 'neg' => true);
125 $data[$option][] = array('regex' => $found[3], 'neg' => false);
130 $data[strtolower($found[1])] = true;
134 $this->_checkOption($match, "excludeOnID", $data['exclutype'], 'id');
135 $this->_checkOption($match, "excludeOnName", $data['exclutype'], 'name');
136 $this->_checkOption($match, "excludeOnTitle", $data['exclutype'], 'title');
138 $data['excludelist'] = array();
141 $data['excludelist'] = array_merge($data['excludelist'], $list);
147 $data['maxdepth'] = intval($found[1]);
153 $data['columns'] = intval($found[1]);
158 $this->_checkOption($match, "noHead", $data['head'], false);
159 $this->_checkOption($match, "showHead", $data['head'], true);
160 $this->_checkOption($match, "smallHead", $data['smallHead'], true);
161 $this->_checkOption($match, "noLinkStartHead", $data['linkStartHead'], false);
163 $data['hn'] = $found[1];
167 $data['headTitle'] = $found[1];
172 $this->_checkOption($match, "noAddPageButton", $data['createPageButtonNs'], false);
173 $this->_checkOption($match, "addPageButtonEach", $data['createPageButtonSubs'], true);
176 $this->_checkOption($match, "sortAscending", $data['sort_order'], CATLIST_SORT_ASCENDING);
177 $this->_checkOption($match, "sortDescending", $data['sort_order'], CATLIST_SORT_DESCENDING);
178 $this->_checkOption($match, "sortByTitle", $data['sort_by_title'], true);
179 $this->_checkOption($match, "sortByType", $data['sort_by_type'], true);
180 $this->_checkOption($match, "sortByCreationDate", $data['sort_by_date'], 'created');
181 $this->_checkOption($match, "sortByModifDate", $data['sort_by_date'], 'modified');
184 $this->_checkOption($match, "ACLshowPage", $data['show_pgnoread'], true);
185 $this->_checkOption($match, "ACLhideNs", $data['hide_nsnotr'], true);
220 $data['ns'] = implode(':', $split);
221 return $data;
285 * $data contains the various options initialized and parsed in handle(), and will be passed along
286 * the tree walking. Moreover, $data['tree'] is filled by the pages found by _walk_recurse(), and
290 function _walk (&$data) {
294 $ns = $data['ns'];
298 if ($data['show_notfound_error'])
310 if ($data['headTitle'] !== NULL)
311 $main['title'] = $data['headTitle'];
313 if ($data['useheading'] && $main['exist'])
320 $data['main'] = $main;
323 if (!isset($data['sort_collator']) || $data['sort_collator'] == "")
324 $data['sort_collator'] = NULL;
326 $locale = $data['sort_collator'];
330 $data['sort_collator'] = NULL;
334 $data['sort_collator'] = $coll;
339 if (!isset($data['excludelist'])) // temporary, for transitioning to v2021-07-21
340 $data['excludelist'] = array();
341 $data['tree'] = array();
342 $data['index_pages'] = array( $main['id'] );
343 $this->_walk_recurse($data, $path, $ns, "", false, false, 1/*root depth is 1*/, $data['tree']/*root*/);
353 * $data is described above. $data['tree'] is not modified directly, but only through
354 * $_TREE which is the *local* tree view (ie. a reference of a $data['tree'] node) and
357 * sub-pages/namespaces should be excluded. Fills $data['index_pages'] with all
360 function _walk_recurse (&$data, $path, $ns, $relns, $excluPages, $excluNS, $depth, &$_TREE) {
374 if (in_array($rel_id, $data['excludelist'])) continue;
379 list($index_exists, $index_id, $index_filepath) = $this->_getStartPage($data['index_priority'], $ns, $path, $name, ($data['nsLinks']==CATLIST_NSLINK_FORCE));
381 $data['index_pages'][] = $index_id;
384 if ($this->_isExcluded($item, $data['exclutype'], $data['excluns'])) continue;
388 if ($data['nsuseheading'] && isset($item['metadata']['title']))
393 $item['linkdisp'] = ($index_exists && ($data['nsLinks']==CATLIST_NSLINK_AUTO)) || ($data['nsLinks']==CATLIST_NSLINK_FORCE);
396 $item['buttonid'] = $data['createPageButtonSubs'] ? $id.':' : NULL;
399 $okdepth = ($depth < $data['maxdepth']) || ($data['maxdepth'] == 0);
400 $exclude_content = $this->_isExcluded($item, $data['exclutype'], $data['exclunsall'])
401 || in_array($rel_id.':', $data['excludelist']);
403 $exclunspages = $this->_isExcluded($item, $data['exclutype'], $data['exclunspages']);
404 $exclunsns = $this->_isExcluded($item, $data['exclutype'], $data['exclunsns']);
405 $this->_walk_recurse($data, $path.'/'.$file, $id, $rel_id, $exclunspages, $exclunsns, $depth+1, $item['_']);
416 if ($data['useheading'] && isset($item['metadata']['title'])) {
422 if ($this->_isExcluded($item, $data['exclutype'], $data['exclupage'])) continue;
428 if ($data['sort_order'] != CATLIST_SORT_NONE) {
429 usort($_TREE, function ($a, $b) use ($data) {
433 if ($data['sort_by_type'] && ($a_is_folder xor $b_is_folder ))
436 if ($data['sort_by_date'] === false) {
438 $a_title = ($data['sort_by_title'] ? $a['title'] : $a['name']);
439 $b_title = ($data['sort_by_title'] ? $b['title'] : $b['name']);
440 if (!is_null($data['sort_collator']))
441 $r = $data['sort_collator']->compare($a_title, $b_title);
446 $field = $data['sort_by_date'];
451 if ($data['sort_order'] == CATLIST_SORT_DESCENDING)
462 function render ($mode, Doku_Renderer $renderer, $data) {
463 if (!is_array($data)) return false;
465 if ($data['ns'] == '%%CURRENT_NAMESPACE%%')
466 $data['ns'] = getNS(cleanID(getID())); // update namespace to the one currently displayed
467 $ns = $data['ns'];
470 if ($data['nocache'])
474 $r = $this->_walk($data);
479 if (!isset($data['pagename_sanitize'])) // temporary, for transitioning to v2022-06-25
480 $data['pagename_sanitize'] = true;
481 $renderer->doc .= '<script type="text/javascript"> catlist_baseurl = "'.DOKU_URL.'"; catlist_basescript = "'.DOKU_SCRIPT.'"; catlist_useslash = '.$conf['useslash'].'; catlist_userewrite = '.$conf['userewrite'].'; catlist_sepchar = "'.$conf['sepchar'].'"; catlist_deaccent = '.$conf['deaccent'].'; catlist_pagename_sanitize = '.$data['pagename_sanitize'].'; </script>';
484 if ($data['head']) {
485 $html_tag_small = ($data['nsInBold']) ? 'strong' : 'span';
486 $html_tag = ($data['smallHead']) ? $html_tag_small : $data['hn'];
488 $main = $data['main'];
489 if (($main['exist'] && $data['linkStartHead'] && !($data['nsLinks']==CATLIST_NSLINK_NONE)) || ($data['nsLinks']==CATLIST_NSLINK_FORCE))
498 if ($data['columns'] != 0) {
499 $global_ul_attr = 'column-count: '.$data['columns'].';';
505 if ($data['displayType'] == CATLIST_DISPLAY_LIST) $renderer->doc .= '<ul '.$global_ul_attr.'>';
506 $this->_recurse($renderer, $data, $data['tree']);
509 if ($data['createPageButtonNs'] && $perm_create)
510 $this->_displayAddPageButton($renderer, $ns_button, $data['displayType']);
511 if ($data['displayType'] == CATLIST_DISPLAY_LIST)
526 function _any_child_perms ($data, $_TREE) {
530 if ($perms >= AUTH_READ || $this->_any_child_perms($data, $item['_']))
541 function _recurse (&$renderer, $data, $_TREE) {
546 $perms_exemption = $data['show_perms'];
550 if ($data['show_leading_ns'] && $this->_any_child_perms($data, $item['_'])) {
553 if ($data['hide_nsnotr']) continue;
554 if ($data['show_pgnoread'])
561 $this->_displayNSBegin($renderer, $data, $item['title'], $linkdisp, $item['linkid'], ($data['show_perms'] ? $perms : NULL));
563 $this->_recurse($renderer, $data, $item['_']);
564 $this->_displayNSEnd($renderer, $data['displayType'], $item['buttonid']);
568 if ($perms < AUTH_READ && !$data['show_perms'] && !$data['show_pgnoread'])
570 if ($data['hide_index'] && in_array($item['id'], $data['index_pages']))
572 $displayLink = $perms >= AUTH_READ || $data['show_perms'];
573 $this->_displayPage($renderer, $item, $data['displayType'], ($data['show_perms'] ? $perms : NULL), $displayLink);
578 function _displayNSBegin (&$renderer, $data, $title, $displayLink, $idLink, $perms) {
579 if ($data['displayType'] == CATLIST_DISPLAY_LIST) {
580 $warper_ns = ($data['nsInBold']) ? 'strong' : 'span';
588 else if ($data['displayType'] == CATLIST_DISPLAY_LINE) {
589 if ($data['nsInBold']) $renderer->doc .= '<strong>';
592 if ($data['nsInBold']) $renderer->doc .= '</strong>';