excludedFiles = $excludedFiles; $this->pregOn = $pregOn; $this->pregOff = $pregOff; $this->pregTitleOn = $pregTitleOn; $this->pregTitleOff = $pregTitleOff; $this->useTitle = $useTitle; $this->sortPageById = $sortPageById; $this->useIdAndTitle = $useIdAndTitle; $this->sortPageByDate = $sortPageByDate; $this->sortByCreationDate = $sortByCreationDate; } function isFileWanted($file, $useTitle) { $nameToFilterOn = $useTitle ? $file['title'] : noNS($file['id']); $pregOn = $useTitle ? $this->pregTitleOn : $this->pregOn; $pregOff = $useTitle ? $this->pregTitleOff : $this->pregOff; if (in_array($nameToFilterOn, $this->excludedFiles)) { return false; } foreach($pregOn as $preg) { if (!preg_match($preg, $nameToFilterOn)) { return false; } } foreach($pregOff as $preg) { if (preg_match($preg, $nameToFilterOn)) { return false; } } return true; } abstract function prepareFile(&$file); abstract function prepareFileTitle(&$file); }