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
197 if (empty($opts['depth'])) return true; // recurse forever
199 if ($depth >= $opts['depth']) return false; // depth reached
206 if (!empty($opts['showmsg']))
213 if (empty($opts['skipacl']) && $info['perm'] < AUTH_READ) {
218 if (!empty($opts['pattern']) && !@preg_match($opts['pattern'], $info['id'])) {
232 if (!empty($opts['hash'])) {
256 * @param array $opts
260 function search_mediafiles(&$data, $base, $file, $type, $lvl, $opts) argument
265 if (empty($opts['depth'])) return true; // recurse forever
267 if ($depth >= $opts['depth']) return false; // depth reached
273 if ($opts['showmsg'])
280 if (empty($opts['skipacl']) && $info['perm'] < AUTH_READ) {
285 if (!empty($opts['pattern']) && !@preg_match($opts['pattern'], $id)) {
304 * @param array $opts
308 function search_list(&$data, $base, $file, $type, $lvl, $opts) argument
336 * @param array $opts
340 function search_pagename(&$data, $base, $file, $type, $lvl, $opts) argument
348 if (!empty($opts['query'])) {
349 if (str_contains($file, (string) $opts['query'])) {
375 * @param array $opts
379 function search_allpages(&$data, $base, $file, $type, $lvl, $opts) argument
381 if (($opts['depth'] ?? 0) > 0) {
384 ($type == 'd' && count($parts) >= $opts['depth'])
385 || ($type != 'd' && count($parts) > $opts['depth'])
401 if (empty($opts['skipacl']) && auth_quickaclcheck($item['id']) < AUTH_READ) {
408 if (!empty($opts['hash'])) {
494 * @param array $opts - option array as given to search()
500 function search_universal(&$data, $base, $file, $type, $lvl, $opts) argument
506 $item['id'] = pathID($file, ($type == 'd' || !empty($opts['keeptxt'])));
508 if (!empty($opts['showmsg'])) {
517 if (empty($opts['depth'])) {
521 if ($depth >= $opts['depth']) {
529 $match = empty($opts['recmatch']) || preg_match('/' . $opts['recmatch'] . '/', $file);
537 if (empty($opts['skipacl'])) {
549 if (empty($opts['listdirs'])) return $return;
551 …if (empty($opts['skipacl']) && !empty($opts['sneakyacl']) && $item['perm'] < AUTH_READ) return fal…
552 …if (!empty($opts['dirmatch']) && !preg_match('/' . $opts['dirmatch'] . '/', $file)) return $return;
553 …if (!empty($opts['nsmatch']) && !preg_match('/' . $opts['nsmatch'] . '/', $item['ns'])) return $re…
555 if (empty($opts['listfiles'])) return $return;
556 if (empty($opts['skipacl']) && $item['perm'] < AUTH_READ) return $return;
557 if (!empty($opts['pagesonly']) && !str_ends_with($file, '.txt')) return $return;
558 if (empty($opts['showhidden']) && isHiddenPage($item['id'])) return $return;
559 …if (!empty($opts['filematch']) && !preg_match('/' . $opts['filematch'] . '/', $file)) return $retu…
560 …if (!empty($opts['idmatch']) && !preg_match('/' . $opts['idmatch'] . '/', $item['id'])) return $re…
568 if (!empty($opts['meta'])) {
578 if (!empty($opts['hash'])) $item['hash'] = md5(io_readFile($base . '/' . $file, false));
579 if (!empty($opts['firsthead'])) {