Beispiel #1
0
                 Session::Messages($langWikiDeletePageError, 'alert-danger');
                 redirect_to_home_page("modules/wiki/page.php?course={$course_code}&action=show&title=" . rawurlencode($wiki_title) . "&wikiId={$wikiId}");
             }
         } else {
             Session::Messages($langWikiPageNotFound);
             redirect_to_home_page("modules/wiki/page.php?course={$course_code}&wikiId={$wikiId}&action=show");
         }
     }
     break;
     // page preview
 // page preview
 case "preview":
     if (!isset($content)) {
         $content = '';
     }
     $tool_content .= claro_disp_wiki_preview($wikiRenderer, $wiki_title, $content);
     $tool_content .= claro_disp_wiki_preview_buttons($wikiId, $wiki_title, $content, $changelog);
     break;
     // view page
 // view page
 case "show":
     if ($wikiPage->hasError()) {
         $tool_content .= $wikiPage->getError();
     } else {
         //unlock after edit cancellation
         //only if current user is the lock owner (to avoid unlocking with GET)
         $lock_manager = new LockManager();
         if ($lock_manager->getLockOwner($wiki_title, $wikiId) == $uid) {
             $lock_manager->releaseLock($wiki_title, $wikiId);
         }
         // get localized value for wiki main page title
Beispiel #2
0
     if (!$wiki->pageExists($title) && !$is_allowedToCreate) {
         $out .= get_lang("You are not allowed to create pages");
     } elseif ($wiki->pageExists($title) && !$is_allowedToEdit) {
         $out .= get_lang("You are not allowed to edit this page");
     } else {
         $script = claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF']));
         $out .= claro_disp_wiki_editor($wikiId, $title, $versionId, $content, $script, get_conf('showWikiEditorToolbar'), get_conf('forcePreviewBeforeSaving'));
     }
     break;
     // page preview
 // page preview
 case 'preview':
     if (!isset($content)) {
         $content = '';
     }
     $out .= claro_disp_wiki_preview($wikiRenderer, $title, $content);
     $out .= claro_disp_wiki_preview_buttons($wikiId, $title, $content);
     break;
     // view page
 // view page
 case 'show':
     if ($wikiPage->hasError()) {
         $out .= $wikiPage->getError();
     } else {
         // get localized value for wiki main page title
         if ('__MainPage__' === $title) {
             $displaytitle = get_lang("Main page");
         } else {
             $displaytitle = $title;
         }
         if ($versionId != 0) {