/** * search callback function * * filter out pages which can't be approved by the current user * then check if they need approving */ function _search_helper(&$data, $base, $file, $type, $lvl, $opts) { $ns = $opts[0]; $valid_ns = $opts[1]; $invalid_ns = $opts[2]; if ($type == 'd') { return $this->hlp->in_sub_namespace($valid_ns, $ns . ':' . str_replace('/', ':', $file)); } if (!preg_match('#\\.txt$#', $file)) { return false; } $id = pathID($ns . $file); if (!$this->hlp->in_namespace($valid_ns, $id)) { return false; } if ($this->hlp->in_namespace($invalid_ns, $id)) { return false; } if (auth_quickaclcheck($id) < AUTH_DELETE) { return false; } $meta = $this->hlp->getMeta($id); if ($this->hlp->isCurrentRevisionApproved($id)) { // Already approved return false; } $data[] = array($id, $meta['approval'], $meta['last_change']['date']); return false; }