Lines Matching refs:opts

23  * @param   array     $opts option array will be given to the Callback
30 function search(&$data, $base, $func, $opts, $dir = '', $lvl = 1, $sort = 'natural') argument
65 if (call_user_func_array($func, [&$data, $base, $dir, 'd', $lvl, $opts])) {
66 search($data, $base, $func, $opts, $dir, $lvl + 1, $sort);
71 call_user_func_array($func, [&$data, $base, $file, 'f', $lvl, $opts]);
108 * @param array $opts
112 function search_qsearch(&$data, $base, $file, $type, $lvl, $opts) argument
114 $opts = [
115 'idmatch' => '(^|:)' . preg_quote($opts['query'], '/') . '/',
119 return search_universal($data, $base, $file, $type, $lvl, $opts);
134 * @param array $opts
138 function search_index(&$data, $base, $file, $type, $lvl, $opts) argument
141 $ns = $opts['ns'] ?? '';
142 $opts = [
145 'listfiles' => empty($opts['nofiles']),
151 return search_universal($data, $base, $file, $type, $lvl, $opts);
164 * @param array $opts
168 function search_namespaces(&$data, $base, $file, $type, $lvl, $opts) argument
170 $opts = ['listdirs' => true];
171 return search_universal($data, $base, $file, $type, $lvl, $opts);
189 * @param array $opts
193 function search_media(&$data, $base, $file, $type, $lvl, $opts) argument
198 if (empty($opts['depth'])) return true; // recurse forever
200 if ($depth >= $opts['depth']) return false; // depth reached
207 if (!empty($opts['showmsg']))
214 if (empty($opts['skipacl']) && $info['perm'] < AUTH_READ) {
219 if (!empty($opts['pattern']) && !@preg_match($opts['pattern'], $info['id'])) {
233 if (!empty($opts['hash'])) {
257 * @param array $opts
261 function search_mediafiles(&$data, $base, $file, $type, $lvl, $opts) argument
266 if (empty($opts['depth'])) return true; // recurse forever
268 if ($depth >= $opts['depth']) return false; // depth reached
274 if ($opts['showmsg'])
281 if (empty($opts['skipacl']) && $info['perm'] < AUTH_READ) {
286 if (!empty($opts['pattern']) && !@preg_match($opts['pattern'], $id)) {
305 * @param array $opts
309 function search_list(&$data, $base, $file, $type, $lvl, $opts) argument
337 * @param array $opts
341 function search_pagename(&$data, $base, $file, $type, $lvl, $opts) argument
349 if (!empty($opts['query'])) {
350 if (strpos($file, (string) $opts['query']) !== false) {
376 * @param array $opts
380 function search_allpages(&$data, $base, $file, $type, $lvl, $opts) argument
382 if (($opts['depth'] ?? 0) > 0) {
385 ($type == 'd' && count($parts) >= $opts['depth'])
386 || ($type != 'd' && count($parts) > $opts['depth'])
402 if (empty($opts['skipacl']) && auth_quickaclcheck($item['id']) < AUTH_READ) {
409 if (!empty($opts['hash'])) {
495 * @param array $opts - option array as given to search()
501 function search_universal(&$data, $base, $file, $type, $lvl, $opts) argument
507 $item['id'] = pathID($file, ($type == 'd' || !empty($opts['keeptxt'])));
509 if (!empty($opts['showmsg'])) {
518 if (empty($opts['depth'])) {
522 if ($depth >= $opts['depth']) {
530 $match = empty($opts['recmatch']) || preg_match('/' . $opts['recmatch'] . '/', $file);
538 if (empty($opts['skipacl'])) {
550 if (empty($opts['listdirs'])) return $return;
552 …if (empty($opts['skipacl']) && !empty($opts['sneakyacl']) && $item['perm'] < AUTH_READ) return fal…
553 …if (!empty($opts['dirmatch']) && !preg_match('/' . $opts['dirmatch'] . '/', $file)) return $return;
554 …if (!empty($opts['nsmatch']) && !preg_match('/' . $opts['nsmatch'] . '/', $item['ns'])) return $re…
556 if (empty($opts['listfiles'])) return $return;
557 if (empty($opts['skipacl']) && $item['perm'] < AUTH_READ) return $return;
558 if (!empty($opts['pagesonly']) && !str_ends_with($file, '.txt')) return $return;
559 if (empty($opts['showhidden']) && isHiddenPage($item['id'])) return $return;
560 …if (!empty($opts['filematch']) && !preg_match('/' . $opts['filematch'] . '/', $file)) return $retu…
561 …if (!empty($opts['idmatch']) && !preg_match('/' . $opts['idmatch'] . '/', $item['id'])) return $re…
569 if (!empty($opts['meta'])) {
579 if (!empty($opts['hash'])) $item['hash'] = md5(io_readFile($base . '/' . $file, false));
580 …if (!empty($opts['firsthead'])) $item['title'] = p_get_first_heading($item['id'], METADATA_DONT_RE…