$exportDir = get_conf('coursesRepositorySys') . '/' . claro_get_course_path() . '/document'; $exportFile = replace_dangerous_char($wikiTitle, 'strict') . $groupPart; $i = 1; while (file_exists($exportDir . '/' . $exportFile . '_' . $i . '.html')) { $i++; } $wikiFileName = $exportFile . '_' . $i . '.html'; $exportPath = $exportDir . '/' . $wikiFileName; file_put_contents($exportPath, $contents); } break; case 'exSearch': require_once "lib/class.wikisearchengine.php"; $pattern = isset($_REQUEST['searchPattern']) ? trim($_REQUEST['searchPattern']) : null; if (!empty($pattern)) { $searchEngine = new WikiSearchEngine($con, $config); $searchResult = $searchEngine->searchAllWiki($pattern, $groupId, CLWIKI_SEARCH_ANY); if ($searchEngine->hasError()) { $message = $searchEngine->getError(); $dialogBox->error($message); $action = 'error'; break; } if (is_null($searchResult)) { $searchResult = array(); } $wikiList = $searchResult; break; } else { $message = '<p>' . get_lang("Missing search keywords") . '</p>'; $dialogBox->error($message);
} else { // something weird's happened die("{$langWrongWikiPageTitle}"); draw($tool_content, 2, null, $head_content); } } // --------- Start of wiki command processing ---------- // init message $message = ''; switch ($action) { case 'rqSearch': break; case 'exSearch': $pattern = isset($_REQUEST['searchPattern']) ? trim($_REQUEST['searchPattern']) : null; if (!empty($pattern)) { $searchEngine = new WikiSearchEngine(); $searchResult = $searchEngine->searchInWiki($pattern, $wikiId, CLWIKI_SEARCH_ANY); if (is_null($searchResult)) { $searchResult = array(); } $wikiList = $searchResult; } else { $message = $langWikiSearchMissingKeywords; $style = 'caution'; $action = 'rqSearch'; } break; // show differences // show differences case 'diff': include 'modules/wiki/lib/lib.diff.php';
init_wiki_main_page($con, $wikiId, $creatorId); } else { // something weird's happened claro_die(get_lang("Wrong page title")); } } // --------- Start of wiki command processing ---------- // init message $message = ''; switch ($action) { case 'rqSearch': break; case 'exSearch': $pattern = isset($_REQUEST['searchPattern']) ? trim($_REQUEST['searchPattern']) : null; if (!empty($pattern)) { $searchEngine = new WikiSearchEngine($con, $config); $searchResult = $searchEngine->searchInWiki($pattern, $wikiId, CLWIKI_SEARCH_ANY); if ($searchEngine->hasError()) { claro_die($searchEngine->getError()); } if (is_null($searchResult)) { $searchResult = array(); } $wikiList = $searchResult; } else { $message = get_lang("Missing search keywords"); $dialogBox->error($message); $action = 'rqSearch'; } break; // show differences