4 include_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
 
    5 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
 
   23         function __construct($a_id = 0, $a_old_nr = 0, $a_wiki_ref_id = 0)
 
   33                 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
 
   35                 $tpl->setCurrentBlock(
"SyntaxStyle");
 
   36                 $tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
 
   38                 $tpl->parseCurrentBlock();
 
   57                 $this->wiki_ref_id = $a_ref_id;
 
   62                 return $this->wiki_ref_id;
 
   70                 global 
$ilCtrl, $ilTabs, $ilUser;
 
   72                 $next_class = $this->ctrl->getNextClass($this);
 
   73                 $cmd = $this->ctrl->getCmd();
 
   79                                 $ilTabs->setTabActive(
"pg");
 
   84                                 include_once(
"./Services/Rating/classes/class.ilRatingGUI.php");
 
   86                                 $rating_gui->setObject($this->
getPageObject()->getParentId(), 
"wiki",
 
   88                                 $this->ctrl->forwardCommand($rating_gui);
 
   89                                 $ilCtrl->redirect($this, 
"preview");
 
   92                         case "ilpageobjectgui":
 
   95                                 $page_gui->setPresentationTitle($this->
getWikiPage()->getTitle());
 
   96                                 return $ilCtrl->forwardCommand($page_gui);
 
  102                                         include_once 
"./Services/Notification/classes/class.ilNotification.php";
 
  122                                    $ilCtrl->redirect($this, 
"preview");
 
  153         static function getGUIForTitle($a_wiki_id, $a_title, $a_old_nr = 0, $a_wiki_ref_id = 0)
 
  157                 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
 
  159                 $page_gui = 
new ilWikiPageGUI($id, $a_old_nr, $a_wiki_ref_id);
 
  169                 include_once(
"./Modules/Wiki/classes/class.ilWikiSideBlockGUI.php");
 
  171                 $wiki_side_block->setPageObject($this->
getWikiPage());
 
  174                 include_once(
"./Modules/Wiki/classes/class.ilWikiSearchBlockGUI.php");
 
  176                 $rcontent = $wiki_side_block->getHTML().$wiki_search_block->getHTML();
 
  178                 $tpl->setRightContent($rcontent);
 
  190                 $wtpl = 
new ilTemplate(
"tpl.wiki_page_view_main_column.html",
 
  191                         true, 
true, 
"Modules/Wiki");
 
  195                 $page_commands = 
false;
 
  196                 if ($ilAccess->checkAccess(
"write", 
"", 
$_GET[
"ref_id"]))
 
  201                                 $wtpl->setCurrentBlock(
"page_command");
 
  202                                 $wtpl->setVariable(
"HREF_PAGE_CMD",
 
  203                                         $ilCtrl->getLinkTarget($this, 
"deleteWikiPageConfirmationScreen"));
 
  204                                 $wtpl->setVariable(
"TXT_PAGE_CMD", $lng->txt(
"delete"));
 
  205                                 $wtpl->parseCurrentBlock();
 
  210                         $wtpl->setCurrentBlock(
"page_commands");
 
  211                         $wtpl->parseCurrentBlock();
 
  215                 if ($ilUser->getId() != ANONYMOUS_USER_ID)
 
  217                         $wtpl->setCurrentBlock(
"notification");
 
  218                         include_once 
"./Services/Notification/classes/class.ilNotification.php";
 
  219                         $wtpl->setVariable(
"TXT_NOTIFICATION", $lng->txt(
"wiki_notification_toggle_info"));
 
  222                                 $ilCtrl->setParameter($this, 
"ntf", 1);
 
  223                                 $wtpl->setVariable(
"URL_NOTIFICATION_TOGGLE_WIKI", $ilCtrl->getLinkTarget($this));
 
  225                                 $wtpl->setVariable(
"TXT_NOTIFICATION_TOGGLE_WIKI", $lng->txt(
"wiki_notification_toggle_wiki_deactivate"));
 
  229                                 $ilCtrl->setParameter($this, 
"ntf", 2);
 
  230                                 $wtpl->setVariable(
"URL_NOTIFICATION_TOGGLE_WIKI", $ilCtrl->getLinkTarget($this));
 
  232                                 $wtpl->setVariable(
"TXT_NOTIFICATION_TOGGLE_WIKI", $lng->txt(
"wiki_notification_toggle_wiki_activate"));
 
  233                                 $wtpl->setVariable(
"TXT_NOTIFICATION_TOGGLE_DIVIDER", 
"|");
 
  237                                         $ilCtrl->setParameter($this, 
"ntf", 3);
 
  238                                         $wtpl->setVariable(
"URL_NOTIFICATION_TOGGLE_PAGE", $ilCtrl->getLinkTarget($this));
 
  240                                         $wtpl->setVariable(
"TXT_NOTIFICATION_TOGGLE_PAGE", $lng->txt(
"wiki_notification_toggle_page_deactivate"));
 
  244                                         $ilCtrl->setParameter($this, 
"ntf", 4);
 
  245                                         $wtpl->setVariable(
"URL_NOTIFICATION_TOGGLE_PAGE", $ilCtrl->getLinkTarget($this));
 
  247                                         $wtpl->setVariable(
"TXT_NOTIFICATION_TOGGLE_PAGE", $lng->txt(
"wiki_notification_toggle_page_activate"));
 
  250                         $ilCtrl->setParameter($this, 
"ntf", 
"");
 
  251                         $wtpl->parseCurrentBlock();
 
  258                         include_once(
"./Services/Rating/classes/class.ilRatingGUI.php");
 
  260                         $rating_gui->setObject($this->
getPageObject()->getParentId(), 
"wiki",
 
  262                         $wtpl->setVariable(
"RATING", $ilCtrl->getHtml($rating_gui));
 
  266                 include_once(
"Services/Notes/classes/class.ilNoteGUI.php");
 
  270                 if ($ilAccess->checkAccess(
"write", 
"", 
$_GET[
"ref_id"]))
 
  272                         $notes_gui->enablePublicNotesDeletion(
true);
 
  274                 $notes_gui->enablePrivateNotes();
 
  277                         $notes_gui->enablePublicNotes();
 
  280                 $next_class = $this->ctrl->getNextClass($this);
 
  281                 if ($next_class == 
"ilnotegui")
 
  283                         $html = $this->ctrl->forwardCommand($notes_gui);
 
  287                         $html = $notes_gui->getNotesHTML();
 
  289                 $wtpl->setVariable(
"NOTES", $html);
 
  292                 $append = (
$_GET[
"page"] != 
"")
 
  295                 include_once(
"./Services/PermanentLink/classes/class.ilPermanentLinkGUI.php");
 
  297                 $wtpl->setVariable(
"PERMA_LINK", $perma_link->getHTML());
 
  299                 $wtpl->setVariable(
"PAGE", parent::preview());
 
  301                 $tpl->setLoginTargetPar(
"wiki_".
$_GET[
"ref_id"].$append);
 
  304                 if (
$_GET[
"srcstring"] != 
"")
 
  306                         include_once 
'./Services/Search/classes/class.ilUserSearchCache.php';
 
  309                         $search_string = $cache->getQuery();
 
  311                         include_once(
"./Services/UIComponent/TextHighlighter/classes/class.ilTextHighlighterGUI.php");
 
  312                         include_once(
"./Services/Search/classes/class.ilQueryParser.php");
 
  316                         $words = $p->getQuotedWords();
 
  317                         if (is_array($words))
 
  319                                 foreach ($words as $w)
 
  324                         $this->fill_on_load_code = 
true;
 
  355                 include_once(
"./Modules/Wiki/classes/class.ilWikiUtil.php");
 
  368                 include_once(
"./Modules/Wiki/classes/class.ilWikiPagesTableGUI.php");
 
  374                 $tpl->setContent($table_gui->getHTML());
 
  383                 $ilCtrl->setParameterByClass(
"ilobjwikigui", 
"wpg_id",
 
  388                 $ilTabs->addTarget(
"wiki_what_links_here",
 
  389                         $this->ctrl->getLinkTargetByClass(
"ilwikipagegui",
 
  390                         "whatLinksHere"), 
"whatLinksHere");
 
  394                 $ilTabs->addTarget(
"wiki_print_view",
 
  395                         $this->ctrl->getLinkTargetByClass(
"ilwikipagegui",
 
  396                         "printViewSelection"), 
"printViewSelection");
 
  407                 if ($ilAccess->checkAccess(
"write", 
"", 
$_GET[
"ref_id"]))
 
  409                         include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
 
  411                         $confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
 
  412                         $confirmation_gui->setHeaderText($lng->txt(
"wiki_page_deletion_confirmation"));
 
  413                         $confirmation_gui->setCancel($lng->txt(
"cancel"), 
"cancelWikiPageDeletion");
 
  414                         $confirmation_gui->setConfirm($lng->txt(
"delete"), 
"confirmWikiPageDeletion");
 
  416                         $dtpl = 
new ilTemplate(
"tpl.wiki_page_deletion_confirmation.html", 
true,
 
  417                                 true, 
"Modules/Wiki");
 
  419                         $dtpl->setVariable(
"PAGE_TITLE", $this->
getWikiPage()->getTitle());
 
  422                         $dtpl->setVariable(
"TXT_OTHER_PAGES", $lng->txt(
"wiki_other_pages_linking"));
 
  425                         if (count($pages) > 0)
 
  427                                 foreach($pages as $page)
 
  429                                         $dtpl->setCurrentBlock(
"lpage");
 
  430                                         $dtpl->setVariable(
"TXT_LINKING_PAGE", $page[
"title"]);
 
  431                                         $dtpl->parseCurrentBlock();
 
  436                                 $dtpl->setCurrentBlock(
"lpage");
 
  437                                 $dtpl->setVariable(
"TXT_LINKING_PAGE", 
"-");
 
  438                                 $dtpl->parseCurrentBlock();
 
  442                         $dtpl->setVariable(
"TXT_CONTRIBUTORS", $lng->txt(
"wiki_contributors"));
 
  444                         foreach($contributors as $contributor)
 
  446                                 $dtpl->setCurrentBlock(
"contributor");
 
  447                                 $dtpl->setVariable(
"TXT_CONTRIBUTOR",
 
  448                                         $contributor[
"lastname"].
", ".$contributor[
"firstname"]);
 
  449                                 $dtpl->parseCurrentBlock();
 
  453                         include_once(
"./Services/Notes/classes/class.ilNote.php");
 
  456                         $dtpl->setVariable(
"TXT_NUMBER_USERS_NOTES_OR_COMMENTS",
 
  457                                 $lng->txt(
"wiki_number_users_notes_or_comments"));
 
  458                         $dtpl->setVariable(
"TXT_NR_NOTES_COMMENTS", $cnt_note_users);
 
  460                         $confirmation_gui->addItem(
"", 
"", $dtpl->get());
 
  462                         $tpl->setContent($confirmation_gui->getHTML());
 
  473                 $ilCtrl->redirect($this, 
"preview");
 
  484                 if ($ilAccess->checkAccess(
"write", 
"", 
$_GET[
"ref_id"]))
 
  491                 $ilCtrl->redirectByClass(
"ilobjwikigui", 
"allPages");
 
  508                 $ilToolbar->setFormAction($ilCtrl->getFormActionByClass(
"ilobjwikigui", 
"printView"),
 
  509                         false, 
"print_view");
 
  510                 $ilToolbar->addFormButton($lng->txt(
"cont_show_print_view"), 
"printView");
 
  511                 $ilToolbar->setCloseFormTag(
false);
 
  515                 $tpl->setContent($this->form->getHTML());
 
  527                 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
  533                         $op1 = 
new ilRadioOption($lng->txt(
"cont_current_page"), 
"page");
 
  534                         $radg->addOption($op1);
 
  536                                 .
" (".$lng->txt(
"wiki_pages").
": ".count($pages).
")", 
"wiki");
 
  537                         $radg->addOption($op2);
 
  538                         $op3= 
new ilRadioOption($lng->txt(
"wiki_selected_pages"), 
"selection");
 
  539                         $radg->addOption($op3);
 
  541                         include_once(
"./Services/Form/classes/class.ilNestedListInputGUI.php");
 
  543                         $op3->addSubItem($nl);
 
  545                         foreach ($pages as $p)
 
  547                                 $nl->addListNode($p[
"id"], $p[
"title"], 0, 
false, 
false,
 
  551                 $this->form->addItem($radg);
 
  553                 $this->form->addCommandButton(
"printView", $lng->txt(
"cont_show_print_view"));
 
  555                 $this->form->setCloseTag(
false);
 
  557                 $this->form->setTitle($lng->txt(
"cont_print_selection"));