Esempio n. 1
0
         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);
     }
     // search wiki
 // search wiki
Esempio n. 2
0
        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
    // show differences
    case 'diff':
        require_once 'lib/lib.diff.php';