ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilWikiPageGUI Class Reference

Class ilWikiPage GUI class. More...

+ Inheritance diagram for ilWikiPageGUI:
+ Collaboration diagram for ilWikiPageGUI:

Public Member Functions

 __construct ($a_id=0, $a_old_nr=0, $a_wiki_ref_id=0)
 Constructor. More...
 
 setScreenIdComponent ()
 Set screen id component. More...
 
 setWikiRefId ($a_ref_id)
 
 getWikiRefId ()
 
 setWiki ($a_val)
 Set wiki. More...
 
 getWiki ()
 Get wiki. More...
 
 executeCommand ()
 execute command More...
 
 setWikiPage ($a_wikipage)
 Set Wiki Page Object. More...
 
 getWikiPage ()
 Get Wiki Page Object. More...
 
 setSideBlock ()
 
 addHeaderAction ($a_redraw=false)
 
 redrawHeaderAction ()
 
 preview ()
 View wiki page. More...
 
 showPage ()
 
 postOutputProcessing ($a_output)
 Finalizing output processing. More...
 
 whatLinksHere ()
 All links to a specific page. More...
 
 getTabs ($a_activate="")
 
 deleteWikiPageConfirmationScreen ()
 Delete wiki page confirmation screen. More...
 
 cancelWikiPageDeletion ()
 Cancel wiki page deletion. More...
 
 confirmWikiPageDeletion ()
 Delete the wiki page. More...
 
 printViewSelection ()
 Print view selection. More...
 
 initPrintViewSelectionForm ()
 Init print view selection form. More...
 
 printViewOrder ()
 
 pdfExportOrder ()
 
 blockWikiPage ()
 Block. More...
 
 unblockWikiPage ()
 Unblock. More...
 
 renameWikiPage ()
 Rename wiki page form. More...
 
 renamePage ()
 Rename page. More...
 
 activateWikiPageRating ()
 Rating /. More...
 
 deactivateWikiPageRating ()
 
 observeNoteAction ($a_wiki_id, $a_page_id, $a_type, $a_action, $a_note_id)
 
 updateStatsRating ($a_wiki_id, $a_wiki_type, $a_page_id, $a_page_type)
 
 editAdvancedMetaData (ilPropertyFormGUI $a_form=null)
 
 updateAdvancedMetaData ()
 
 hideAdvancedMetaData ()
 
 unhideAdvancedMetaData ()
 
 edit ()
 Edit. More...
 
 insertWikiLink ()
 Returns form to insert a wiki link per ajax. More...
 
 insertWikiLinkAC ()
 Auto complete for insert wiki link. More...
 
 searchWikiLinkAC ()
 Search wiki link list. More...
 
- Public Member Functions inherited from ilPageObjectGUI
 __construct ( $a_parent_type, $a_id, $a_old_nr=0, $a_prevent_get_id=false, $a_lang="")
 Constructor. More...
 
 afterConstructor ()
 After constructor. More...
 
 setParentType ($a_val)
 Set parent type. More...
 
 getParentType ()
 Get parent type. More...
 
 setId ($a_val)
 Set ID. More...
 
 getId ()
 Get ID. More...
 
 setOldNr ($a_val)
 Set old nr (historic page) More...
 
 getOldNr ()
 Get old nr (historic page) More...
 
 setLanguage ($a_val)
 Set language. More...
 
 getLanguage ()
 Get language. More...
 
 setEnablePCType ($a_pc_type, $a_val)
 Set enable pc type. More...
 
 getEnablePCType ($a_pc_type)
 Get enable pc type. More...
 
 setPageConfig ($a_val)
 Set page config object. More...
 
 getPageConfig ()
 Get page config object. More...
 
 setPageObject (ilPageObject $a_pg_obj)
 Set Page Object. More...
 
 getPageObject ()
 Get Page Object. More...
 
 setOutputMode ($a_mode=IL_PAGE_PRESENTATION)
 Set Output Mode. More...
 
 getOutputMode ()
 
 setTemplateOutput ($a_output=true)
 
 outputToTemplate ()
 
 setPresentationTitle ($a_title="")
 
 getPresentationTitle ()
 
 setHeader ($a_title="")
 
 getHeader ()
 
 setLinkParams ($l_params="")
 
 getLinkParams ()
 
 setLinkFrame ($l_frame="")
 
 getLinkFrame ()
 
 setLinkXML ($link_xml)
 
 getLinkXML ()
 
 setQuestionXML ($question_xml)
 
 setQuestionHTML ($question_html)
 
 getQuestionXML ()
 
 getQuestionHTML ()
 
 setTemplateTargetVar ($a_variable)
 
 getTemplateTargetVar ()
 
 setTemplateOutputVar ($a_value)
 
 getTemplateOutputVar ()
 
 setSourcecodeDownloadScript ($script_name)
 Set sourcecode download script. More...
 
 getSourcecodeDownloadScript ()
 Get sourcecode download script. More...
 
 setLocator (&$a_locator)
 
 setTabs ($a_tabs)
 
 setPageBackTitle ($a_title)
 
 setFileDownloadLink ($a_download_link)
 Set file download link. More...
 
 getFileDownloadLink ()
 Get file download link. More...
 
 setFullscreenLink ($a_fullscreen_link)
 Set fullscreen link. More...
 
 getFullscreenLink ()
 Get fullscreen link. More...
 
 setIntLinkReturn ($a_return)
 
 enableChangeComments ($a_enabled)
 
 isEnabledChangeComments ()
 
 enableNotes ($a_enabled, $a_parent_id)
 
 isEnabledNotes ()
 
 setOfflineDirectory ($offdir)
 set offline directory to offdir More...
 
 getOfflineDirectory ()
 get offline directory More...
 
 setViewPageLink ($a_link, $a_target="")
 set link for "view page" button More...
 
 getViewPageLink ()
 get view page link More...
 
 getViewPageTarget ()
 get view page target frame More...
 
 getViewPageText ()
 get view page text More...
 
 setActivationListener (&$a_obj, $a_meth)
 
 setEnabledNews ($a_enabled, $a_news_obj_id=0, $a_news_obj_type=0)
 Set enabled news. More...
 
 getEnabledNews ()
 Get enabled news. More...
 
 setTabHook ($a_object, $a_function)
 Set tab hook. More...
 
 setEditPreview ($a_editpreview)
 Set Display first Edit tab, then Preview tab, instead of Page and Edit. More...
 
 getEditPreview ()
 Get Display first Edit tab, then Preview tab, instead of Page and Edit. More...
 
 setEnabledTabs ($a_enabledtabs)
 Set Output tabs. More...
 
 getEnabledTabs ()
 Get Output tabs. More...
 
 setEnabledPageFocus ($a_enabledpagefocus)
 Set Enable page focus. More...
 
 getEnabledPageFocus ()
 Get Enable page focus. More...
 
 setExplorerUpdater ($a_exp_frame, $a_exp_id, $a_exp_target_script)
 Set Explorer Updater. More...
 
 setPrependingHtml ($a_prependinghtml)
 Set Prepending HTML. More...
 
 getPrependingHtml ()
 Get Prepending HTML. More...
 
 setEnableEditing ($a_enableediting)
 Set Enable Editing. More...
 
 getEnableEditing ()
 Get Enable Editing. More...
 
 setRawPageContent ($a_rawpagecontent)
 Set Get raw page content only. More...
 
 getRawPageContent ()
 Get Get raw page content only. More...
 
 setStyleId ($a_styleid)
 Set Style Id. More...
 
 getStyleId ()
 Get Style Id. More...
 
 setCompareMode ($a_val)
 Set compare mode. More...
 
 getCompareMode ()
 Get compare mode. More...
 
 setAbstractOnly ($a_val)
 Set abstract only. More...
 
 getAbstractOnly ()
 Get abstract only. More...
 
 setRenderPageContainer ($a_val)
 Set render page container. More...
 
 getRenderPageContainer ()
 Get render page container. More...
 
 getDisabledText ()
 Get disabled text. More...
 
 activateMetaDataEditor ( $a_rep_obj, $a_type, $a_sub_obj_id, $a_observer_obj=null, $a_observer_func="")
 Activate meda data editor. More...
 
 determineFileDownloadLink ()
 Determine file download link. More...
 
 determineFullscreenLink ()
 Determine fullscreen link. More...
 
 determineSourcecodeDownloadScript ()
 Determine source code download script. More...
 
 getComponentPluginsXML ()
 Put information about activated plugins into XML. More...
 
 executeCommand ()
 execute command More...
 
 setQEditTabs ($a_active)
 Set question editing tabs. More...
 
 onFeedbackEditingForwarding ()
 On feedback editing forwarding. More...
 
 deactivatePage ()
 
 activatePage ()
 
 showPage ()
 display content of page More...
 
 replaceCurlyBrackets ($output)
 Replace curly brackets. More...
 
 addActionsMenu ($a_tpl, $sel_media_mode, $sel_html_mode, $sel_js_mode)
 Add actions menu. More...
 
 addMultiLangActionsAndInfo ($a_list, $a_tpl)
 Add multi-language actions to menu. More...
 
 setEditMode ()
 Set edit mode. More...
 
 setDefaultLinkXml ()
 Set standard link xml. More...
 
 getProfileBackUrl ()
 Get profile back url. More...
 
 downloadFile ()
 Download file of file lists. More...
 
 displayMediaFullscreen ()
 Show media in fullscreen mode. More...
 
 displayMedia ($a_fullscreen=false)
 Display media. More...
 
 download_paragraph ()
 download source code paragraph More...
 
 insertPageToc ($a_output)
 Insert page toc. More...
 
 insertResources ($a_output)
 Insert resources. More...
 
 insertAdvTrigger ($a_output)
 Insert adv content trigger. More...
 
 postOutputProcessing ($a_output)
 Finalizing output processing. More...
 
 insertHelp ($a_tpl)
 Insert help texts. More...
 
 previewHistory ()
 Preview history. More...
 
 preview ()
 preview More...
 
 edit ()
 edit ("view" before) More...
 
 insertJSAtPlaceholder ()
 InsertJS at placeholder. More...
 
 initCaptchaForm ()
 Init captcha form. More...
 
 presentation ($a_mode=IL_PAGE_PRESENTATION)
 
 getHTML ()
 
 showMediaFullscreen ($a_style_id=0)
 show fullscreen view of media object More...
 
 displayValidationError ($a_error)
 display validation error More...
 
 history ()
 Get history table as HTML. More...
 
 rollbackConfirmation ()
 Rollback confirmation. More...
 
 rollback ()
 Rollback to a previous version. More...
 
 setScreenIdComponent ()
 Set screen id component. More...
 
 getTabs ($a_activate="")
 adds tabs to tab gui object More...
 
 compareVersion ()
 Compares two revisions of the page. More...
 
 replaceDiffTags ($a_html)
 
 editActivation ()
 Edit activation (only, if scheduled page activation is activated in administration) More...
 
 initActivationForm ()
 Init activation form. More...
 
 getActivationFormValues ()
 Get values for activation form. More...
 
 saveActivation ()
 Save Activation. More...
 
 getNotesHTML ($a_content_object=null, $a_enable_private_notes=true, $a_enable_public_notes=false, $a_enable_notes_deletion=false, $a_callback=null)
 Get html for public and/or private notes. More...
 
 processAnswer ()
 Process answer. More...
 
 initialOpenedContent ()
 Initially opened content. More...
 
 initOpenedContentForm ()
 Init form for initially opened content. More...
 
 saveInitialOpenedContent ()
 Save initial opened content. More...
 
 switchToLanguage ()
 Switch to language. More...
 
 confirmPageTranslationCreation ()
 Confirm page translation creation. More...
 
 editMasterLanguage ()
 Edit master language. More...
 
 createPageTranslation ()
 Create page translation. More...
 
 releasePageLock ()
 Release page lock. More...
 
 getPagePermaLink ()
 Get page perma link. More...
 

Static Public Member Functions

static getGUIForTitle ($a_wiki_id, $a_title, $a_old_nr=0, $a_wiki_ref_id=0)
 Get wiki page gui for id and title. More...
 
static initEditingJS (ilTemplate $a_tpl)
 Init wiki editing js. More...
 
- Static Public Member Functions inherited from ilPageObjectGUI
static getTinyMenu ( $a_par_type, $a_int_links=false, $a_wiki_links=false, $a_keywords=false, $a_style_id=0, $a_paragraph_styles=true, $a_save_return=true, $a_anchors=false, $a_save_new=true, $a_user_links=false)
 Get Tiny Menu. More...
 

Protected Member Functions

 increaseViewCount ()
 
 printViewOrderList ($a_pdf_export=false)
 
 initRenameForm ()
 Init renaming form. More...
 
 initAdvancedMetaDataForm ()
 
- Protected Member Functions inherited from ilPageObjectGUI
 initPageObject ()
 Init page object. More...
 
 getActivationCaptions ()
 Get captions for activation action menu entries. More...
 
 isPageContainerToBeRendered ()
 

Protected Attributes

 $tabs
 
 $settings
 
 $toolbar
 
 $wiki
 
- Protected Attributes inherited from ilPageObjectGUI
 $tpl
 
 $lng
 
 $ctrl
 
 $tabs_gui
 
 $access
 
 $plugin_admin
 
 $log
 
 $user
 
 $help
 
 $output_mode
 
 $parent_type = ""
 

Additional Inherited Members

- Data Fields inherited from ilPageObjectGUI
 $obj
 
 $presentation_title
 
 $target_script
 
 $return_location
 
 $target_var
 
 $template_output_var
 
 $output2template
 
 $link_params
 
 $sourcecode_download_script
 
 $change_comments
 
 $question_html
 
 $activation = false
 
 $activated = true
 
 $editpreview = false
 
 $use_meta_data = false
 
 $link_xml_set = false
 
 $enableediting = true
 
 $rawpagecontent = false
 
 $enabledcontentincludes = false
 
 $compare_mode = false
 
 $page_config = null
 
 $tabs_enabled = true
 
 $render_page_container = false
 
 $pl_start = "{{{{{"
 
 $pl_end = "}}}}}"
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilWikiPageGUI::__construct (   $a_id = 0,
  $a_old_nr = 0,
  $a_wiki_ref_id = 0 
)

Constructor.

Definition at line 45 of file class.ilWikiPageGUI.php.

References $DIC, ilPageObjectGUI\$tpl, ilPageObjectGUI\getPageObject(), ilObjStyleSheet\getSyntaxStylePath(), getWikiRefId(), settings(), setWikiRefId(), and user().

46  {
47  global $DIC;
48 
49  $this->tpl = $DIC["tpl"];
50  $this->help = $DIC["ilHelp"];
51  $this->ctrl = $DIC->ctrl();
52  $this->tabs = $DIC->tabs();
53  $this->user = $DIC->user();
54  $this->access = $DIC->access();
55  $this->lng = $DIC->language();
56  $this->settings = $DIC->settings();
57  $this->toolbar = $DIC->toolbar();
58  $tpl = $DIC["tpl"];
59 
60  // needed for notifications
61  $this->setWikiRefId($a_wiki_ref_id);
62 
63  parent::__construct("wpg", $a_id, $a_old_nr);
64  $this->getPageObject()->setWikiRefId($this->getWikiRefId());
65 
66  // content style
67  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
68 
69  $tpl->setCurrentBlock("SyntaxStyle");
70  $tpl->setVariable(
71  "LOCATION_SYNTAX_STYLESHEET",
73  );
74  $tpl->parseCurrentBlock();
75  }
getPageObject()
Get Page Object.
global $DIC
Definition: saml.php:7
user()
Definition: user.php:4
static getSyntaxStylePath()
get syntax style path
settings()
Definition: settings.php:2
setWikiRefId($a_ref_id)
+ Here is the call graph for this function:

Member Function Documentation

◆ activateWikiPageRating()

ilWikiPageGUI::activateWikiPageRating ( )

Rating /.

Definition at line 1033 of file class.ilWikiPageGUI.php.

References ilPageObjectGUI\$ctrl, $ilCtrl, ilPageObjectGUI\$lng, ilPageObjectGUI\getPageObject(), and ilUtil\sendSuccess().

1034  {
1035  $lng = $this->lng;
1036  $ilCtrl = $this->ctrl;
1037 
1038  $this->getPageObject()->setRating(true);
1039  $this->getPageObject()->update();
1040 
1041  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1042  $ilCtrl->redirect($this, "preview");
1043  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getPageObject()
Get Page Object.
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ addHeaderAction()

ilWikiPageGUI::addHeaderAction (   $a_redraw = false)

Definition at line 276 of file class.ilWikiPageGUI.php.

References $_GET, ilPageObjectGUI\$access, $ilUser, $lg, ilPageObjectGUI\$user, ilObjWiki\_lookupPublicNotes(), ilObjWiki\_lookupRatingOverall(), array, ilUtil\getImagePath(), ilPageObjectGUI\getPageObject(), ilNotification\hasNotification(), ilNotification\hasOptOut(), ilCommonActionDispatcherGUI\TYPE_REPOSITORY, ilNotification\TYPE_WIKI, and ilNotification\TYPE_WIKI_PAGE.

Referenced by preview(), and redrawHeaderAction().

277  {
279  $ilAccess = $this->access;
280 
281  $wiki_id = $this->getPageObject()->getParentId();
282  $page_id = $this->getPageObject()->getId();
283 
284  include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
285  $dispatcher = new ilCommonActionDispatcherGUI(
287  $ilAccess,
288  "wiki",
289  $_GET["ref_id"],
290  $wiki_id
291  );
292  $dispatcher->setSubObject("wpg", $page_id);
293 
294  include_once "Services/Object/classes/class.ilObjectListGUI.php";
295  ilObjectListGUI::prepareJSLinks(
296  $this->ctrl->getLinkTarget($this, "redrawHeaderAction", "", true),
297  $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "ilnotegui"), "", "", true, false),
298  $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "iltagginggui"), "", "", true, false)
299  );
300 
301  $lg = $dispatcher->initHeaderAction();
302  $lg->enableNotes(true);
303  $lg->enableComments(ilObjWiki::_lookupPublicNotes($wiki_id), false);
304 
305  // rating
306  if (ilObjWiki::_lookupRatingOverall($wiki_id)) {
307  $lg->enableRating(
308  true,
309  $this->lng->txt("wiki_rate_overall"),
310  false,
311  // so ilCtrl does not use the shortcut via ilWikiGUI
312  array("ilcommonactiondispatchergui", "ilratinggui")
313  );
314  }
315 
316  // notification
317  if ($ilUser->getId() != ANONYMOUS_USER_ID) {
318  include_once "./Services/Notification/classes/class.ilNotification.php";
320  $this->ctrl->setParameter($this, "ntf", 1);
321  if (ilNotification::hasOptOut($wiki_id)) {
322  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_deactivate_wiki");
323  }
324 
325  $lg->addHeaderIcon(
326  "not_icon",
327  ilUtil::getImagePath("notification_on.svg"),
328  $this->lng->txt("wiki_notification_activated")
329  );
330  } else {
331  $this->ctrl->setParameter($this, "ntf", 2);
332  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_activate_wiki");
333 
335  $this->ctrl->setParameter($this, "ntf", 3);
336  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_deactivate_page");
337 
338  $lg->addHeaderIcon(
339  "not_icon",
340  ilUtil::getImagePath("notification_on.svg"),
341  $this->lng->txt("wiki_page_notification_activated")
342  );
343  } else {
344  $this->ctrl->setParameter($this, "ntf", 4);
345  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_activate_page");
346 
347  $lg->addHeaderIcon(
348  "not_icon",
349  ilUtil::getImagePath("notification_off.svg"),
350  $this->lng->txt("wiki_notification_deactivated")
351  );
352  }
353  }
354  $this->ctrl->setParameter($this, "ntf", "");
355  }
356 
357  if (!$a_redraw) {
358  $this->tpl->setHeaderActionMenu($lg->getHeaderAction());
359  } else {
360  // we need to add onload code manually (rating, comments, etc.)
361  return $lg->getHeaderAction() .
362  $this->tpl->getOnLoadCodeForAsynch();
363  }
364  }
$lg
Definition: example_018.php:62
static hasNotification($type, $user_id, $id)
Check notification status for object and user.
static _lookupRatingOverall($a_wiki_id)
Lookup whether rating is activated for whole object.
getPageObject()
Get Page Object.
$_GET["client_id"]
static hasOptOut($obj_id)
Is opt out (disable notification) allowed?
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
Class ilCommonActionDispatcherGUI.
static _lookupPublicNotes($a_wiki_id)
Lookup whether public notes are activated.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ blockWikiPage()

ilWikiPageGUI::blockWikiPage ( )

Block.

Definition at line 903 of file class.ilWikiPageGUI.php.

References $_GET, ilPageObjectGUI\$access, ilPageObjectGUI\$ctrl, $ilCtrl, ilPageObjectGUI\$lng, ilPageObjectGUI\$tpl, ilWikiPerm\check(), ilPageObjectGUI\getPageObject(), and ilUtil\sendSuccess().

904  {
905  $ilAccess = $this->access;
906  $tpl = $this->tpl;
908  $lng = $this->lng;
909 
910  include_once("./Modules/Wiki/classes/class.ilWikiPerm.php");
911  if (ilWikiPerm::check("activate_wiki_protection", $_GET["ref_id"])) {
912  $this->getPageObject()->setBlocked(true);
913  $this->getPageObject()->update();
914 
915  ilUtil::sendSuccess($lng->txt("wiki_page_blocked"), true);
916  }
917 
918  $ilCtrl->redirect($this, "preview");
919  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getPageObject()
Get Page Object.
static check($a_perm, $a_ref_id, $a_cmd="")
Check permission.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ cancelWikiPageDeletion()

ilWikiPageGUI::cancelWikiPageDeletion ( )

Cancel wiki page deletion.

Definition at line 703 of file class.ilWikiPageGUI.php.

References ilPageObjectGUI\$ctrl, $ilCtrl, and ilPageObjectGUI\$lng.

704  {
705  $lng = $this->lng;
707 
708  $ilCtrl->redirect($this, "preview");
709  }
global $ilCtrl
Definition: ilias.php:18

◆ confirmWikiPageDeletion()

ilWikiPageGUI::confirmWikiPageDeletion ( )

Delete the wiki page.

Definition at line 714 of file class.ilWikiPageGUI.php.

References $_GET, ilPageObjectGUI\$access, ilPageObjectGUI\$ctrl, $ilCtrl, ilPageObjectGUI\$lng, ilPageObjectGUI\$tpl, ilWikiPerm\check(), ilPageObjectGUI\getPageObject(), and ilUtil\sendSuccess().

715  {
716  $ilAccess = $this->access;
717  $tpl = $this->tpl;
719  $lng = $this->lng;
720 
721  include_once("./Modules/Wiki/classes/class.ilWikiPerm.php");
722  if (ilWikiPerm::check("delete_wiki_pages", $_GET["ref_id"])) {
723  $this->getPageObject()->delete();
724 
725  ilUtil::sendSuccess($lng->txt("wiki_page_deleted"), true);
726  }
727 
728  $ilCtrl->redirectByClass("ilobjwikigui", "allPages");
729  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getPageObject()
Get Page Object.
static check($a_perm, $a_ref_id, $a_cmd="")
Check permission.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ deactivateWikiPageRating()

ilWikiPageGUI::deactivateWikiPageRating ( )

Definition at line 1045 of file class.ilWikiPageGUI.php.

References ilPageObjectGUI\$ctrl, $ilCtrl, ilPageObjectGUI\$lng, ilPageObjectGUI\getPageObject(), and ilUtil\sendSuccess().

1046  {
1047  $lng = $this->lng;
1048  $ilCtrl = $this->ctrl;
1049 
1050  $this->getPageObject()->setRating(false);
1051  $this->getPageObject()->update();
1052 
1053  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1054  $ilCtrl->redirect($this, "preview");
1055  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getPageObject()
Get Page Object.
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ deleteWikiPageConfirmationScreen()

ilWikiPageGUI::deleteWikiPageConfirmationScreen ( )

Delete wiki page confirmation screen.

Definition at line 626 of file class.ilWikiPageGUI.php.

References $_GET, ilPageObjectGUI\$access, ilPageObjectGUI\$ctrl, $ilCtrl, ilPageObjectGUI\$lng, ilPageObjectGUI\$tpl, ilWikiPerm\check(), ilPageObjectGUI\getId(), ilWikiPage\getLinksToPage(), ilPageObjectGUI\getPageObject(), ilNote\getUserCount(), getWikiPage(), and ilWikiPage\getWikiPageContributors().

627  {
628  $ilAccess = $this->access;
629  $tpl = $this->tpl;
631  $lng = $this->lng;
632 
633  include_once("./Modules/Wiki/classes/class.ilWikiPerm.php");
634  if (ilWikiPerm::check("delete_wiki_pages", $_GET["ref_id"])) {
635  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
636  $confirmation_gui = new ilConfirmationGUI();
637  $confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
638  $confirmation_gui->setHeaderText($lng->txt("wiki_page_deletion_confirmation"));
639  $confirmation_gui->setCancel($lng->txt("cancel"), "cancelWikiPageDeletion");
640  $confirmation_gui->setConfirm($lng->txt("delete"), "confirmWikiPageDeletion");
641 
642  $dtpl = new ilTemplate(
643  "tpl.wiki_page_deletion_confirmation.html",
644  true,
645  true,
646  "Modules/Wiki"
647  );
648 
649  $dtpl->setVariable("PAGE_TITLE", $this->getWikiPage()->getTitle());
650 
651  // other pages that link to this page
652  $dtpl->setVariable("TXT_OTHER_PAGES", $lng->txt("wiki_other_pages_linking"));
654  $this->getWikiPage()->getWikiId(),
655  $this->getWikiPage()->getId()
656  );
657  if (count($pages) > 0) {
658  foreach ($pages as $page) {
659  $dtpl->setCurrentBlock("lpage");
660  $dtpl->setVariable("TXT_LINKING_PAGE", $page["title"]);
661  $dtpl->parseCurrentBlock();
662  }
663  } else {
664  $dtpl->setCurrentBlock("lpage");
665  $dtpl->setVariable("TXT_LINKING_PAGE", "-");
666  $dtpl->parseCurrentBlock();
667  }
668 
669  // contributors
670  $dtpl->setVariable("TXT_CONTRIBUTORS", $lng->txt("wiki_contributors"));
671  $contributors = ilWikiPage::getWikiPageContributors($this->getWikiPage()->getId());
672  foreach ($contributors as $contributor) {
673  $dtpl->setCurrentBlock("contributor");
674  $dtpl->setVariable(
675  "TXT_CONTRIBUTOR",
676  $contributor["lastname"] . ", " . $contributor["firstname"]
677  );
678  $dtpl->parseCurrentBlock();
679  }
680 
681  // notes/comments
682  include_once("./Services/Notes/classes/class.ilNote.php");
683  $cnt_note_users = ilNote::getUserCount(
684  $this->getPageObject()->getParentId(),
685  $this->getPageObject()->getId(),
686  "wpg"
687  );
688  $dtpl->setVariable(
689  "TXT_NUMBER_USERS_NOTES_OR_COMMENTS",
690  $lng->txt("wiki_number_users_notes_or_comments")
691  );
692  $dtpl->setVariable("TXT_NR_NOTES_COMMENTS", $cnt_note_users);
693 
694  $confirmation_gui->addItem("", "", $dtpl->get());
695 
696  $tpl->setContent($confirmation_gui->getHTML());
697  }
698  }
getPageObject()
Get Page Object.
static check($a_perm, $a_ref_id, $a_cmd="")
Check permission.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static getUserCount($a_rep_obj_id, $a_obj_id, $a_type)
How many users have attached a note/comment to a given object?
special template class to simplify handling of ITX/PEAR
getWikiPage()
Get Wiki Page Object.
static getLinksToPage($a_wiki_id, $a_page_id)
Get links to a page.
static getWikiPageContributors($a_page_id)
Get all contributors of wiki.
Confirmation screen class.
+ Here is the call graph for this function:

◆ edit()

ilWikiPageGUI::edit ( )

Edit.

Parameters

Definition at line 1200 of file class.ilWikiPageGUI.php.

References ilPageObjectGUI\$lng, and ilPageObjectGUI\$tpl.

1201  {
1202  $tpl = $this->tpl;
1203  $lng = $this->lng;
1204 
1205  self::initEditingJS($tpl);
1206 
1207  return parent::edit();
1208  }

◆ editAdvancedMetaData()

ilWikiPageGUI::editAdvancedMetaData ( ilPropertyFormGUI  $a_form = null)

Definition at line 1105 of file class.ilWikiPageGUI.php.

References ilPageObjectGUI\$access, ilPageObjectGUI\$ctrl, $ilCtrl, ilPageObjectGUI\$lng, $tabs, ilPageObjectGUI\$tpl, and initAdvancedMetaDataForm().

Referenced by updateAdvancedMetaData().

1106  {
1107  $ilTabs = $this->tabs;
1108  $lng = $this->lng;
1109  $ilCtrl = $this->ctrl;
1110  $tpl = $this->tpl;
1111  $ilAccess = $this->access;
1112 
1113  if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id) &&
1114  !$ilAccess->checkAccess("edit_page_meta", "", $this->wiki_ref_id)) {
1115  return;
1116  }
1117 
1118 
1119  $ilTabs->clearTargets();
1120  $ilTabs->setBackTarget(
1121  $lng->txt("back"),
1122  $ilCtrl->getLinkTarget($this, "preview")
1123  );
1124 
1125  if (!$a_form) {
1126  $a_form = $this->initAdvancedMetaDataForm();
1127  }
1128 
1129  $tpl->setContent($a_form->getHTML());
1130  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilWikiPageGUI::executeCommand ( )

execute command

Definition at line 123 of file class.ilWikiPageGUI.php.

References $_GET, ilPageObjectGUI\$access, ilPageObjectGUI\$ctrl, $ilCtrl, $ilUser, ilPageObjectGUI\$lng, $tabs, ilPageObjectGUI\$tpl, ilPageObjectGUI\$user, ilObject\_lookupObjId(), ilObject\_lookupTitle(), array, ilPageObjectGUI\getId(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), ilPageObjectGUI\getPageObject(), getTabs(), getWikiPage(), preview(), ilUtil\sendFailure(), ilNotification\setNotification(), ilPageObjectGUI\setPresentationTitle(), ilNotification\TYPE_WIKI, and ilNotification\TYPE_WIKI_PAGE.

124  {
126  $ilTabs = $this->tabs;
128  $ilAccess = $this->access;
129  $lng = $this->lng;
130  $tpl = $this->tpl;
131 
132  $next_class = $this->ctrl->getNextClass($this);
133  $cmd = $this->ctrl->getCmd();
134 
135  $head_title = ilObject::_lookupTitle(ilObject::_lookupObjId((int) $_GET["ref_id"])) . ": " . $this->getWikiPage()->getTitle();
136  $tpl->setHeaderPageTitle($head_title);
137  // see #13804
138  if ($_GET["page"] != "") {
139  $tpl->setPermanentLink("wiki", "", "wpage_" . $this->getPageObject()->getId() . "_" . $_GET["ref_id"], "", $head_title);
140  } else {
141  $tpl->setPermanentLink("wiki", $_GET["ref_id"]);
142  }
143 
144 
145  switch ($next_class) {
146  case "ilnotegui":
147  $this->getTabs();
148  $ilTabs->setTabActive("pg");
149  return $this->preview();
150  break;
151 
152  case "ilratinggui":
153  // for rating side block
154  include_once("./Services/Rating/classes/class.ilRatingGUI.php");
155  $rating_gui = new ilRatingGUI();
156  $rating_gui->setObject(
157  $this->getPageObject()->getParentId(),
158  "wiki",
159  $this->getPageObject()->getId(),
160  "wpg"
161  );
162  $rating_gui->setUpdateCallback(array($this, "updateStatsRating"));
163  $this->ctrl->forwardCommand($rating_gui);
164  $ilCtrl->redirect($this, "preview");
165  break;
166 
167  case "ilcommonactiondispatchergui":
168  include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
170  $gui->enableCommentsSettings(false);
171  $gui->setRatingCallback($this, "preview");
172  $this->ctrl->forwardCommand($gui);
173  break;
174 
175  case "ilwikistatgui":
176  if ($ilAccess->checkAccess("statistics_read", "", $this->wiki_ref_id)) {
177  $this->tabs_gui->clearTargets(); // see ilObjWikiGUI::getTabs()
178  $this->getTabs("statistics");
179 
180  include_once "Modules/Wiki/classes/class.ilWikiStatGUI.php";
181  $gui = new ilWikiStatGUI(
182  $this->getPageObject()->getParentId(),
183  $this->getPageObject()->getId()
184  );
185  $this->ctrl->forwardCommand($gui);
186  }
187  break;
188  case 'ilobjectmetadatagui':
189 
190  if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id)) {
191  ilUtil::sendFailure($lng->txt("permission_denied"), true);
192  $ilCtrl->redirect($this, "preview");
193  }
194  return parent::executeCommand();
195  break;
196 
197  default:
198 
199  if (strtolower($ilCtrl->getNextClass()) == "ilpageeditorgui") {
200  self::initEditingJS($this->tpl);
201  }
202 
203  if ($_GET["ntf"]) {
204  include_once "./Services/Notification/classes/class.ilNotification.php";
205  switch ($_GET["ntf"]) {
206  case 1:
207  ilNotification::setNotification(ilNotification::TYPE_WIKI, $ilUser->getId(), $this->getPageObject()->getParentId(), false);
208  break;
209 
210  case 2:
211  // remove all page notifications here?
212  ilNotification::setNotification(ilNotification::TYPE_WIKI, $ilUser->getId(), $this->getPageObject()->getParentId(), true);
213  break;
214 
215  case 3:
217  break;
218 
219  case 4:
221  break;
222  }
223  $ilCtrl->redirect($this, "preview");
224  }
225 
226  $this->setPresentationTitle($this->getWikiPage()->getTitle());
227  return parent::executeCommand();
228  }
229  }
getPageObject()
Get Page Object.
$_GET["client_id"]
Wiki statistics GUI class.
static _lookupTitle($a_id)
lookup object title
global $ilCtrl
Definition: ilias.php:18
Class ilRatingGUI.
static _lookupObjId($a_id)
static setNotification($type, $user_id, $id, $status=true)
Set notification status for object and user.
setPresentationTitle($a_title="")
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
preview()
View wiki page.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
getWikiPage()
Get Wiki Page Object.
getTabs($a_activate="")
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
+ Here is the call graph for this function:

◆ getGUIForTitle()

static ilWikiPageGUI::getGUIForTitle (   $a_wiki_id,
  $a_title,
  $a_old_nr = 0,
  $a_wiki_ref_id = 0 
)
static

Get wiki page gui for id and title.

Definition at line 254 of file class.ilWikiPageGUI.php.

References $DIC, $id, $ilDB, and ilWikiPage\getPageIdForTitle().

Referenced by ilObjWikiGUI\executeCommand(), and ilObjWikiGUI\viewPageObject().

255  {
256  global $DIC;
257 
258  $ilDB = $DIC->database();
259 
260  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
261  $id = ilWikiPage::getPageIdForTitle($a_wiki_id, $a_title);
262  $page_gui = new ilWikiPageGUI($id, $a_old_nr, $a_wiki_ref_id);
263 
264  return $page_gui;
265  }
global $DIC
Definition: saml.php:7
if(!array_key_exists('StateId', $_REQUEST)) $id
static getPageIdForTitle($a_wiki_id, $a_title)
Get wiki page object for id and title.
Class ilWikiPage GUI class.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTabs()

ilWikiPageGUI::getTabs (   $a_activate = "")

Definition at line 572 of file class.ilWikiPageGUI.php.

References $_GET, ilPageObjectGUI\$access, ilPageObjectGUI\$ctrl, $ilCtrl, $tabs, array, ilWikiPage\getPageIdForTitle(), ilPageObjectGUI\getPageObject(), ilWikiUtil\makeDbTitle(), and ilWikiUtil\makeUrlTitle().

Referenced by executeCommand().

573  {
574  $ilTabs = $this->tabs;
576  $ilAccess = $this->access;
577 
578  parent::getTabs($a_activate);
579 
580  if ($ilAccess->checkAccess("statistics_read", "", $_GET["ref_id"])) {
581  $ilTabs->addTarget(
582  "statistics",
583  $this->ctrl->getLinkTargetByClass(
584  array("ilwikipagegui", "ilwikistatgui"),
585  "initial"
586  ),
587  "",
588  "ilwikistatgui"
589  );
590  }
591 
592  $ilCtrl->setParameterByClass(
593  "ilobjwikigui",
594  "wpg_id",
596  $this->getPageObject()->getParentId(),
598  )
599  );
600  $ilCtrl->setParameterByClass("ilobjwikigui", "page", ilWikiUtil::makeUrlTitle($_GET["page"]));
601 
602  $ilTabs->addTarget(
603  "wiki_what_links_here",
604  $this->ctrl->getLinkTargetByClass(
605  "ilwikipagegui",
606  "whatLinksHere"
607  ),
608  "whatLinksHere"
609  );
610  //$ilTabs->addTarget("wiki_print_view",
611  // $this->ctrl->getLinkTargetByClass("ilobjwikigui",
612  // "printViewSelection"), "printViewSelection");
613  $ilTabs->addTarget(
614  "wiki_print_view",
615  $this->ctrl->getLinkTargetByClass(
616  "ilwikipagegui",
617  "printViewSelection"
618  ),
619  "printViewSelection"
620  );
621  }
getPageObject()
Get Page Object.
$_GET["client_id"]
static getPageIdForTitle($a_wiki_id, $a_title)
Get wiki page object for id and title.
global $ilCtrl
Definition: ilias.php:18
static makeUrlTitle($a_par)
Set page parameter for Url Embedding.
static makeDbTitle($a_par)
Handle page GET parameter.
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getWiki()

ilWikiPageGUI::getWiki ( )

Get wiki.

Returns
ilObjWiki wiki

Definition at line 115 of file class.ilWikiPageGUI.php.

References $wiki.

116  {
117  return $this->wiki;
118  }

◆ getWikiPage()

ilWikiPageGUI::getWikiPage ( )

Get Wiki Page Object.

Returns
object Wiki Page Object

Definition at line 246 of file class.ilWikiPageGUI.php.

References ilPageObjectGUI\getPageObject().

Referenced by deleteWikiPageConfirmationScreen(), executeCommand(), increaseViewCount(), initAdvancedMetaDataForm(), postOutputProcessing(), setSideBlock(), showPage(), and whatLinksHere().

247  {
248  return $this->getPageObject();
249  }
getPageObject()
Get Page Object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getWikiRefId()

ilWikiPageGUI::getWikiRefId ( )

Definition at line 95 of file class.ilWikiPageGUI.php.

Referenced by __construct(), increaseViewCount(), initPrintViewSelectionForm(), and observeNoteAction().

96  {
97  return $this->wiki_ref_id;
98  }
+ Here is the caller graph for this function:

◆ hideAdvancedMetaData()

ilWikiPageGUI::hideAdvancedMetaData ( )

Definition at line 1158 of file class.ilWikiPageGUI.php.

References ilPageObjectGUI\$access, ilPageObjectGUI\$ctrl, $ilCtrl, ilPageObjectGUI\$lng, ilPageObjectGUI\getPageObject(), and ilUtil\sendSuccess().

1159  {
1160  $ilCtrl = $this->ctrl;
1161  $lng = $this->lng;
1162  $ilAccess = $this->access;
1163 
1164  if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id) &&
1165  !$ilAccess->checkAccess("edit_page_meta", "", $this->wiki_ref_id)) {
1166  return;
1167  }
1168 
1169  $this->getPageObject()->hideAdvancedMetadata(true);
1170  $this->getPageObject()->update();
1171 
1172  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
1173  $ilCtrl->redirect($this, "preview");
1174  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getPageObject()
Get Page Object.
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ increaseViewCount()

ilWikiPageGUI::increaseViewCount ( )
protected

Definition at line 499 of file class.ilWikiPageGUI.php.

References $ilUser, ilPageObjectGUI\$user, ilChangeEvent\_recordReadEvent(), ilWikiStat\EVENT_PAGE_READ, getWikiPage(), getWikiRefId(), and ilWikiStat\handleEvent().

Referenced by preview().

500  {
502 
503  $this->getWikiPage()->increaseViewCnt();
504 
505  // enable object statistics
506  require_once('Services/Tracking/classes/class.ilChangeEvent.php');
508  "wiki",
509  $this->getWikiPage()->getWikiRefId(),
510  $this->getWikiPage()->getWikiId(),
511  $ilUser->getId()
512  );
513 
514  include_once "./Modules/Wiki/classes/class.ilWikiStat.php";
516  }
static _recordReadEvent( $a_type, $a_ref_id, $obj_id, $usr_id, $isCatchupWriteEvents=true, $a_ext_rc=false, $a_ext_time=false)
Records a read event and catches up with write events.
const EVENT_PAGE_READ
$ilUser
Definition: imgupload.php:18
static handleEvent($a_event, ilWikiPage $a_page_obj, $a_user_id=null, array $a_additional_data=null)
Handle wiki page event.
getWikiPage()
Get Wiki Page Object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initAdvancedMetaDataForm()

ilWikiPageGUI::initAdvancedMetaDataForm ( )
protected

Definition at line 1080 of file class.ilWikiPageGUI.php.

References ilPageObjectGUI\$ctrl, $form, $ilCtrl, ilPageObjectGUI\$lng, getWikiPage(), ilAdvancedMDRecordGUI\MODE_EDITOR, and ilAdvancedMDRecordGUI\setPropertyForm().

Referenced by editAdvancedMetaData(), and updateAdvancedMetaData().

1081  {
1082  $ilCtrl = $this->ctrl;
1083  $lng = $this->lng;
1084 
1085  $page = $this->getWikiPage();
1086 
1087  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
1088  $form = new ilPropertyFormGUI();
1089  $form->setFormAction($ilCtrl->getFormAction($this, "updateAdvancedMetaData"));
1090 
1091  // :TODO:
1092  $form->setTitle($lng->txt("wiki_advmd_block_title") . ": " . $page->getTitle());
1093 
1094  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
1095  $this->record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_EDITOR, 'wiki', $page->getWikiId(), 'wpg', $page->getId());
1096  $this->record_gui->setPropertyForm($form);
1097  $this->record_gui->parse();
1098 
1099  $form->addCommandButton("updateAdvancedMetaData", $lng->txt("save"));
1100  $form->addCommandButton("preview", $lng->txt("cancel"));
1101 
1102  return $form;
1103  }
This class represents a property form user interface.
setPropertyForm($form)
set property form object
global $ilCtrl
Definition: ilias.php:18
if(isset($_POST['submit'])) $form
getWikiPage()
Get Wiki Page Object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initEditingJS()

static ilWikiPageGUI::initEditingJS ( ilTemplate  $a_tpl)
static

Init wiki editing js.

Parameters
ilTemplate$a_tpltemplate

Definition at line 1215 of file class.ilWikiPageGUI.php.

References $DIC, ilPageObjectGUI\$lng, and ilTemplate\addOnLoadCode().

1216  {
1217  global $DIC;
1218 
1219  $lng = $DIC->language();
1220 
1221  $a_tpl->addJavascript("./Modules/Wiki/js/WikiEdit.js");
1222  $a_tpl->addOnLoadCode("il.Wiki.Edit.txt.page_exists = '" . $lng->txt("wiki_page_exists") . "';");
1223  $a_tpl->addOnLoadCode("il.Wiki.Edit.txt.new_page = '" . $lng->txt("wiki_new_page") . "';");
1224  }
global $DIC
Definition: saml.php:7
addOnLoadCode($a_code, $a_batch=2)
Add on load code.
+ Here is the call graph for this function:

◆ initPrintViewSelectionForm()

ilWikiPageGUI::initPrintViewSelectionForm ( )

Init print view selection form.

Definition at line 762 of file class.ilWikiPageGUI.php.

References ilPageObjectGUI\$ctrl, $ilCtrl, ilPageObjectGUI\$lng, ilObject\_lookupObjId(), ilWikiPage\getAllWikiPages(), ilUtil\getImagePath(), getWikiRefId(), and ilRadioGroupInputGUI\setValue().

Referenced by printViewSelection().

763  {
764  $lng = $this->lng;
766 
768 
769  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
770  $this->form = new ilPropertyFormGUI();
771 
772  // because of PDF export
773  $this->form->setPreventDoubleSubmission(false);
774 
775  //var_dump($pages);
776  // selection type
777  $radg = new ilRadioGroupInputGUI($lng->txt("cont_selection"), "sel_type");
778  $radg->setValue("page");
779  $op1 = new ilRadioOption($lng->txt("cont_current_page"), "page");
780  $radg->addOption($op1);
781  $op2 = new ilRadioOption($lng->txt("wiki_whole_wiki")
782  . " (" . $lng->txt("wiki_pages") . ": " . count($pages) . ")", "wiki");
783  $radg->addOption($op2);
784  $op3= new ilRadioOption($lng->txt("wiki_selected_pages"), "selection");
785  $radg->addOption($op3);
786 
787  include_once("./Services/Form/classes/class.ilNestedListInputGUI.php");
788  $nl = new ilNestedListInputGUI("", "obj_id");
789  $op3->addSubItem($nl);
790 
791  foreach ($pages as $p) {
792  $nl->addListNode(
793  $p["id"],
794  $p["title"],
795  0,
796  false,
797  false,
798  ilUtil::getImagePath("icon_pg.svg"),
799  $lng->txt("wiki_page")
800  );
801  }
802 
803  $this->form->addItem($radg);
804 
805  $this->form->addCommandButton("printViewOrder", $lng->txt("wiki_show_print_view"));
806  $this->form->addCommandButton("pdfExportOrder", $lng->txt("wiki_show_pdf_export"));
807  //$this->form->setOpenTag(false);
808  //$this->form->setCloseTag(false);
809 
810  $this->form->setTitle($lng->txt("cont_print_selection"));
811  $this->form->setFormAction($ilCtrl->getFormAction($this, "printViewOrder"));
812  }
This class represents an option in a radio group.
This class represents a property form user interface.
global $ilCtrl
Definition: ilias.php:18
This class represents a property in a property form.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _lookupObjId($a_id)
static getAllWikiPages($a_wiki_id)
Get all pages of wiki.
This class represents a (nested) list of checkboxes (could be extended for radio items, too)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initRenameForm()

ilWikiPageGUI::initRenameForm ( )
protected

Init renaming form.

Parameters
int$a_modeEdit Mode

Definition at line 969 of file class.ilWikiPageGUI.php.

References ilPageObjectGUI\$ctrl, $ilCtrl, ilPageObjectGUI\$lng, ilPageObjectGUI\getPageObject(), and ilTextInputGUI\setMaxLength().

Referenced by renamePage(), and renameWikiPage().

970  {
971  $lng = $this->lng;
973 
974  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
975  $this->form = new ilPropertyFormGUI();
976 
977  // new name
978  $ti = new ilTextInputGUI($lng->txt("wiki_new_page_name"), "new_page_name");
979  $ti->setMaxLength(200);
980  $ti->setSize(50);
981  $ti->setValue($this->getPageObject()->getTitle());
982  $ti->setRequired(true);
983  $this->form->addItem($ti);
984 
985  $this->form->addCommandButton("renamePage", $lng->txt("wiki_rename"));
986  $this->form->addCommandButton("preview", $lng->txt("cancel"));
987 
988  $this->form->setTitle($lng->txt("wiki_rename_page"));
989  $this->form->setFormAction($ilCtrl->getFormAction($this));
990  }
getPageObject()
Get Page Object.
This class represents a property form user interface.
global $ilCtrl
Definition: ilias.php:18
This class represents a text property in a property form.
setMaxLength($a_maxlength)
Set Max Length.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertWikiLink()

ilWikiPageGUI::insertWikiLink ( )

Returns form to insert a wiki link per ajax.

Definition at line 1230 of file class.ilWikiPageGUI.php.

References ilPageObjectGUI\$ctrl, $form, $ilCtrl, ilPageObjectGUI\$lng, exit, and ilTextInputGUI\setSize().

1231  {
1232  $lng = $this->lng;
1233  $ilCtrl = $this->ctrl;
1234 
1235  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1236  $form = new ilPropertyFormGUI();
1237  $form->addCommandButton("addWikiLink", $lng->txt("wiki_add_link"));
1238  $form->addCommandButton("searchWikiLink", $lng->txt("search"));
1239 
1240  // Target page
1241  $tp = new ilTextInputGUI($this->lng->txt("wiki_target_page"), "target_page");
1242  $tp->setSize(18);
1243  $tp->setRequired(true);
1244  $tp->setInfo("...");
1245  $tp->setDataSource($ilCtrl->getLinkTarget($this, "insertWikiLinkAC", "", true));
1246  $form->addItem($tp);
1247 
1248  // Link text
1249  $lt = new ilTextInputGUI($this->lng->txt("wiki_link_text"), "link_text");
1250  $lt->setSize(18);
1251  $form->addItem($lt);
1252 
1253  //$form->setTitle($lng->txt("wiki_link"));
1254 
1255  echo $form->getHTML();
1256  exit;
1257  }
This class represents a property form user interface.
global $ilCtrl
Definition: ilias.php:18
if(isset($_POST['submit'])) $form
setSize($a_size)
Set Size.
This class represents a text property in a property form.
+ Here is the call graph for this function:

◆ insertWikiLinkAC()

ilWikiPageGUI::insertWikiLinkAC ( )

Auto complete for insert wiki link.

Definition at line 1262 of file class.ilWikiPageGUI.php.

References $_GET, $r, $res, $result, ilWikiPage\_wikiPageExists(), array, ilJsonUtil\encode(), exit, ilPageObjectGUI\getPageObject(), and ilWikiPage\getPagesForSearch().

1263  {
1264  $result = array();
1265 
1266  $term = $_GET["term"];
1267 
1268  // if page exists, make it first entry
1269  if (ilWikiPage::_wikiPageExists($this->getPageObject()->getParentId(), $term)) {
1270  $entry = new stdClass();
1271  $entry->value = $term;
1272  $entry->label = $term;
1273  $result[] = $entry;
1274  }
1275 
1276  $res = ilWikiPage::getPagesForSearch($this->getPageObject()->getParentId(), $term);
1277 
1278  $cnt = 0;
1279  foreach ($res as $r) {
1280  if ($result[0]->value == $r) {
1281  continue;
1282  }
1283  if ($cnt++ > 19) {
1284  continue;
1285  }
1286  $entry = new stdClass();
1287  $entry->value = $r;
1288  $entry->label = $r;
1289  $result[] = $entry;
1290  }
1291 
1292  include_once './Services/JSON/classes/class.ilJsonUtil.php';
1294  exit;
1295  }
getPageObject()
Get Page Object.
$result
$_GET["client_id"]
static getPagesForSearch($a_wiki_id, $a_term)
Get pages for search.
$r
Definition: example_031.php:79
static encode($mixed, $suppress_native=false)
foreach($_POST as $key=> $value) $res
Create styles array
The data for the language used.
static _wikiPageExists($a_wiki_id, $a_title)
Check whether page exists for wiki or not.
+ Here is the call graph for this function:

◆ observeNoteAction()

ilWikiPageGUI::observeNoteAction (   $a_wiki_id,
  $a_page_id,
  $a_type,
  $a_action,
  $a_note_id 
)

Definition at line 1058 of file class.ilWikiPageGUI.php.

References getWikiRefId(), ilWikiUtil\sendNotification(), and ilNotification\TYPE_WIKI_PAGE.

1059  {
1060  // #10040 - get note text
1061  include_once "Services/Notes/classes/class.ilNote.php";
1062  $note = new ilNote($a_note_id);
1063  $note = $note->getText();
1064 
1065  include_once "./Services/Notification/classes/class.ilNotification.php";
1066  ilWikiUtil::sendNotification("comment", ilNotification::TYPE_WIKI_PAGE, $this->getWikiRefId(), $a_page_id, $note);
1067  }
Note class.
static sendNotification($a_action, $a_type, $a_wiki_ref_id, $a_page_id, $a_comment=null)
+ Here is the call graph for this function:

◆ pdfExportOrder()

ilWikiPageGUI::pdfExportOrder ( )

Definition at line 819 of file class.ilWikiPageGUI.php.

References printViewOrderList().

820  {
821  $this->printViewOrderList(true);
822  }
printViewOrderList($a_pdf_export=false)
+ Here is the call graph for this function:

◆ postOutputProcessing()

ilWikiPageGUI::postOutputProcessing (   $a_output)

Finalizing output processing.

Definition at line 521 of file class.ilWikiPageGUI.php.

References $_GET, ilPageObjectGUI\$ctrl, $ilCtrl, $output, ilPageObjectGUI\getId(), ilPageObjectGUI\getOutputMode(), getWikiPage(), ilWikiUtil\makeUrlTitle(), and ilWikiUtil\replaceInternalLinks().

522  {
524 
525  //echo htmlentities($a_output);
526  include_once("./Modules/Wiki/classes/class.ilWikiUtil.php");
527 
528  $ilCtrl->setParameterByClass("ilobjwikigui", "from_page", ilWikiUtil::makeUrlTitle($_GET["page"]));
530  $a_output,
531  $this->getWikiPage()->getWikiId(),
532  ($this->getOutputMode() == "offline")
533  );
534  $ilCtrl->setParameterByClass("ilobjwikigui", "from_page", $_GET["from_page"]);
535 
536 
537  // metadata in print view
538  if ($this->getOutputMode() == "print" && $this->wiki instanceof ilObjWiki) {
539  include_once("./Services/Object/classes/class.ilObjectMetaDataGUI.php");
540  $mdgui = new ilObjectMetaDataGUI($this->wiki, "wpg", $this->getId());
541  $md = $mdgui->getKeyValueList();
542  if ($md != "") {
543  $output = str_replace("<!--COPage-PageTop-->", "<p>" . $md . "</p>", $output);
544  }
545  }
546 
547 
548  return $output;
549  }
Class ilObjectMetaDataGUI.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\+" &#(? foreach( $entity_files as $file) $output
static makeUrlTitle($a_par)
Set page parameter for Url Embedding.
Class ilObjWiki.
getWikiPage()
Get Wiki Page Object.
static replaceInternalLinks($s, $a_wiki_id, $a_offline=false)
This one is based on Mediawiki Parser->replaceInternalLinks since we display images in another way...
+ Here is the call graph for this function:

◆ preview()

ilWikiPageGUI::preview ( )

View wiki page.

Definition at line 375 of file class.ilWikiPageGUI.php.

References $_GET, ilPageObjectGUI\$access, ilPageObjectGUI\$ctrl, $ilCtrl, $ilSetting, $ilUser, ilPageObjectGUI\$lng, $settings, $toolbar, ilPageObjectGUI\$tpl, ilPageObjectGUI\$user, $w, ilUserSearchCache\_getInstance(), ilObjWiki\_lookupPublicNotes(), addHeaderAction(), array, ilDatePresentation\formatDate(), ilUserUtil\getNamePresentation(), ilPageObjectGUI\getNotesHTML(), ilPageObjectGUI\getPageObject(), ilTextHighlighterGUI\highlight(), IL_CAL_DATETIME, IL_PAGE_PRESENTATION, increaseViewCount(), ilUserSearchCache\LAST_QUERY, ilUtil\sendInfo(), ilPageObjectGUI\setOutputMode(), ilPageObjectGUI\setRenderPageContainer(), setSideBlock(), and showPage().

Referenced by executeCommand().

376  {
378  $ilAccess = $this->access;
379  $lng = $this->lng;
380  $tpl = $this->tpl;
383  $ilToolbar = $this->toolbar;
384 
385  // block/unblock
386  if ($this->getPageObject()->getBlocked()) {
387  ilUtil::sendInfo($lng->txt("wiki_page_status_blocked"));
388  }
389 
390  $this->increaseViewCount();
391 
392  $this->addHeaderAction();
393 
394  // content
395  $this->setSideBlock();
396 
397  $wtpl = new ilTemplate(
398  "tpl.wiki_page_view_main_column.html",
399  true,
400  true,
401  "Modules/Wiki"
402  );
403 
404  $callback = array($this, "observeNoteAction");
405 
406  // notes
407  if (!$ilSetting->get("disable_comments") &&
408  ilObjWiki::_lookupPublicNotes($this->getPageObject()->getParentId())) {
409  $may_delete = ($ilSetting->get("comments_del_tutor", 1) &&
410  $ilAccess->checkAccess("write", "", $_GET["ref_id"]));
411  $wtpl->setVariable("NOTES", $this->getNotesHTML(
412  $this->getPageObject(),
413  true,
414  ilObjWiki::_lookupPublicNotes($this->getPageObject()->getParentId()),
415  $may_delete,
416  $callback
417  ));
418  }
419 
420 
421  // page content
423  $this->setRenderPageContainer(true);
424  $wtpl->setVariable("PAGE", $this->showPage());
425 
426  $tpl->setLoginTargetPar("wiki_" . $_GET["ref_id"] . $append);
427 
428  // last edited info
429  include_once("./Services/User/classes/class.ilUserUtil.php");
430  $wtpl->setVariable(
431  "LAST_EDITED_INFO",
432  $lng->txt("wiki_last_edited") . ": " .
434  new ilDateTime($this->getPageObject()->getLastChange(), IL_CAL_DATETIME)
435  ) . ", " .
437  $this->getPageObject()->getLastChangeUser(),
438  false,
439  true,
440  $ilCtrl->getLinkTarget($this, "preview")
441  )
442  );
443 
444  $tpl->setLoginTargetPar("wiki_" . $_GET["ref_id"] . $append);
445 
446  //highlighting
447  if ($_GET["srcstring"] != "") {
448  include_once './Services/Search/classes/class.ilUserSearchCache.php';
449  $cache = ilUserSearchCache::_getInstance($ilUser->getId());
450  $cache->switchSearchType(ilUserSearchCache::LAST_QUERY);
451  $search_string = $cache->getQuery();
452 
453  // advanced search?
454  if (is_array($search_string)) {
455  $search_string = $search_string["lom_content"];
456  }
457 
458  include_once("./Services/UIComponent/TextHighlighter/classes/class.ilTextHighlighterGUI.php");
459  include_once("./Services/Search/classes/class.ilQueryParser.php");
460  $p = new ilQueryParser($search_string);
461  $p->parse();
462 
463  $words = $p->getQuotedWords();
464  if (is_array($words)) {
465  foreach ($words as $w) {
466  ilTextHighlighterGUI::highlight("ilCOPageContent", $w, $tpl);
467  }
468  }
469  $this->fill_on_load_code = true;
470  }
471 
472  return $wtpl->get();
473  }
getPageObject()
Get Page Object.
addHeaderAction($a_redraw=false)
const IL_CAL_DATETIME
$_GET["client_id"]
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
$w
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static _getInstance($a_usr_id)
Get singleton instance.
special template class to simplify handling of ITX/PEAR
Date and time handling
$ilUser
Definition: imgupload.php:18
setRenderPageContainer($a_val)
Set render page container.
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
Create styles array
The data for the language used.
const IL_PAGE_PRESENTATION
global $ilSetting
Definition: privfeed.php:17
static highlight($a_dom_node_id, $a_text, $a_tpl=null)
Searches for all occurences of a text (case-insensitive) and highlights it.
getNotesHTML($a_content_object=null, $a_enable_private_notes=true, $a_enable_public_notes=false, $a_enable_notes_deletion=false, $a_callback=null)
Get html for public and/or private notes.
static _lookupPublicNotes($a_wiki_id)
Lookup whether public notes are activated.
setOutputMode($a_mode=IL_PAGE_PRESENTATION)
Set Output Mode.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ printViewOrder()

ilWikiPageGUI::printViewOrder ( )

Definition at line 814 of file class.ilWikiPageGUI.php.

References printViewOrderList().

815  {
816  $this->printViewOrderList();
817  }
printViewOrderList($a_pdf_export=false)
+ Here is the call graph for this function:

◆ printViewOrderList()

ilWikiPageGUI::printViewOrderList (   $a_pdf_export = false)
protected

Definition at line 824 of file class.ilWikiPageGUI.php.

References $_GET, $_POST, $tabs, $tbl, array, ilWikiPage\getAllWikiPages(), and ilPageObjectGUI\getPageObject().

Referenced by pdfExportOrder(), and printViewOrder().

825  {
826  $ilTabs = $this->tabs;
827 
828  $pg_ids = $all_pages = array();
829 
830  // coming from type selection
831  if (!is_array($_POST["wordr"])) {
832  switch (trim($_POST["sel_type"])) {
833  case "wiki":
834  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
835  $all_pages = ilWikiPage::getAllWikiPages($this->getPageObject()->getWikiId());
836  foreach ($all_pages as $p) {
837  $pg_ids[] = $p["id"];
838  }
839  break;
840 
841  case "selection":
842  if (is_array($_POST["obj_id"])) {
843  $pg_ids = $_POST["obj_id"];
844  } else {
845  $pg_ids[] = $_GET["wpg_id"];
846  }
847  if (sizeof($pg_ids) > 1) {
848  break;
849  } else {
850  $_GET["wpg_id"] = array_pop($pg_ids);
851  }
852  // fallthrough
853 
854  // no order needed for single page
855  // no break
856  default:
857  //case "page":
858  $this->ctrl->setParameterByClass("ilObjWikiGUI", "wpg_id", $_GET["wpg_id"]);
859  if ($a_pdf_export) {
860  $this->ctrl->redirectByClass("ilObjWikiGUI", "pdfExport");
861  } else {
862  $this->ctrl->redirectByClass("ilObjWikiGUI", "printView");
863  }
864  break;
865  }
866 
867  if ($a_pdf_export) {
868  $this->ctrl->setParameter($this, "pexp", 1);
869  }
870  }
871  // refresh sorting
872  else {
873  $a_pdf_export = (bool) $_GET["pexp"];
874 
875  asort($_POST["wordr"]);
876  $pg_ids = array_keys($_POST["wordr"]);
877  }
878 
879  $ilTabs->clearTargets();
880  $ilTabs->setBackTarget(
881  $this->lng->txt("back"),
882  $this->ctrl->getLinkTarget($this, "preview")
883  );
884 
885  if (!sizeof($all_pages)) {
886  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
887  $all_pages = ilWikiPage::getAllWikiPages($this->getPageObject()->getWikiId());
888  }
889 
890  include_once "Modules/Wiki/classes/class.ilWikiExportOrderTableGUI.php";
891  $tbl = new ilWikiExportOrderTableGUI($this, "printViewOrderList", $a_pdf_export, $all_pages, $pg_ids);
892  $this->tpl->setContent($tbl->getHTML());
893  }
getPageObject()
Get Page Object.
$_GET["client_id"]
$tbl
Definition: example_048.php:81
static getAllWikiPages($a_wiki_id)
Get all pages of wiki.
Create styles array
The data for the language used.
TableGUI class for ordering pages to be printed/exported.
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ printViewSelection()

ilWikiPageGUI::printViewSelection ( )

Print view selection.

Parameters

Definition at line 741 of file class.ilWikiPageGUI.php.

References ilPageObjectGUI\$ctrl, $ilCtrl, $ilUser, ilPageObjectGUI\$lng, $toolbar, ilPageObjectGUI\$tpl, ilPageObjectGUI\$user, and initPrintViewSelectionForm().

742  {
744  $lng = $this->lng;
745  $ilToolbar = $this->toolbar;
747  $tpl = $this->tpl;
748 
749  /*$ilToolbar->setFormAction($ilCtrl->getFormActionByClass("ilobjwikigui", "printView"),
750  false, "print_view");
751  $ilToolbar->addFormButton($lng->txt("cont_show_print_view"), "printView");
752  $ilToolbar->setCloseFormTag(false);*/
753 
755 
756  $tpl->setContent($this->form->getHTML());
757  }
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
initPrintViewSelectionForm()
Init print view selection form.
+ Here is the call graph for this function:

◆ redrawHeaderAction()

ilWikiPageGUI::redrawHeaderAction ( )

Definition at line 366 of file class.ilWikiPageGUI.php.

References addHeaderAction(), and exit.

367  {
368  echo $this->addHeaderAction(true);
369  exit;
370  }
addHeaderAction($a_redraw=false)
+ Here is the call graph for this function:

◆ renamePage()

ilWikiPageGUI::renamePage ( )

Rename page.

Definition at line 995 of file class.ilWikiPageGUI.php.

References $_GET, ilPageObjectGUI\$access, ilPageObjectGUI\$ctrl, $ilCtrl, ilPageObjectGUI\$lng, ilPageObjectGUI\$tpl, ilWikiPage\_getPageIdForWikiTitle(), ilPageObjectGUI\getId(), ilPageObjectGUI\getPageObject(), initRenameForm(), ilWikiUtil\makeDbTitle(), ilWikiUtil\makeUrlTitle(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

996  {
997  $tpl = $this->tpl;
998  $lng = $this->lng;
1000  $ilAccess = $this->access;
1001 
1002  $this->initRenameForm();
1003  if ($this->form->checkInput()) {
1004  if (($ilAccess->checkAccess("edit_content", "", $_GET["ref_id"]) && !$this->getPageObject()->getBlocked())
1005  || $ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
1006  $new_name = $this->form->getInput("new_page_name");
1007 
1008  $page_title = ilWikiUtil::makeDbTitle($new_name);
1009  $pg_id = ilWikiPage::_getPageIdForWikiTitle($this->getPageObject()->getWikiId(), $page_title);
1010 
1011  // we might get the same page id back here, if the page
1012  // name only differs in diacritics
1013  // see bug http://www.ilias.de/mantis/view.php?id=11226
1014  if ($pg_id > 0 && $pg_id != $this->getPageObject()->getId()) {
1015  ilUtil::sendFailure($lng->txt("wiki_page_already_exists"));
1016  } else {
1017  $new_name = $this->getPageObject()->rename($new_name);
1018  $ilCtrl->setParameterByClass("ilobjwikigui", "page", ilWikiUtil::makeUrlTitle($new_name));
1019  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1020  $ilCtrl->redirect($this, "preview");
1021  }
1022  }
1023  }
1024 
1025  $this->form->setValuesByPost();
1026  $tpl->setContent($this->form->getHtml());
1027  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getPageObject()
Get Page Object.
$_GET["client_id"]
initRenameForm()
Init renaming form.
global $ilCtrl
Definition: ilias.php:18
static _getPageIdForWikiTitle($a_wiki_id, $a_title)
Checks whether a page with given title exists.
static makeUrlTitle($a_par)
Set page parameter for Url Embedding.
static makeDbTitle($a_par)
Handle page GET parameter.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ renameWikiPage()

ilWikiPageGUI::renameWikiPage ( )

Rename wiki page form.

Definition at line 950 of file class.ilWikiPageGUI.php.

References $_GET, ilPageObjectGUI\$access, ilPageObjectGUI\$ctrl, $ilCtrl, ilPageObjectGUI\$lng, ilPageObjectGUI\$tpl, ilPageObjectGUI\getPageObject(), and initRenameForm().

951  {
952  $ilAccess = $this->access;
953  $tpl = $this->tpl;
955  $lng = $this->lng;
956 
957  if (($ilAccess->checkAccess("edit_content", "", $_GET["ref_id"]) && !$this->getPageObject()->getBlocked())
958  || $ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
959  $this->initRenameForm();
960  $tpl->setContent($this->form->getHTML());
961  }
962  }
getPageObject()
Get Page Object.
$_GET["client_id"]
initRenameForm()
Init renaming form.
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ searchWikiLinkAC()

ilWikiPageGUI::searchWikiLinkAC ( )

Search wiki link list.

Definition at line 1300 of file class.ilWikiPageGUI.php.

References $_GET, ilPageObjectGUI\$lng, ilPageObjectGUI\$tpl, ilObjWiki\_performSearch(), array, exit, ilPageObjectGUI\getPageObject(), ilWikiPage\lookupTitle(), and ilUtil\sortArray().

1301  {
1302  $lng = $this->lng;
1303 
1304  $lng->loadLanguageModule("wiki");
1305 
1306  $tpl = new ilTemplate("tpl.wiki_ac_search_result.html", true, true, "Modules/Wiki");
1307  $term = trim($_GET["term"]);
1308 
1309  $pages = ilObjWiki::_performSearch($this->getPageObject()->getParentId(), $term);
1310 
1311  $found = array();
1312  foreach ($pages as $page) {
1313  $found[] = array("page_id" => $page["page_id"], "title" => ilWikiPage::lookupTitle($page["page_id"]));
1314  }
1315 
1316  // sort if all pages are listed
1317  if ($term == "") {
1318  $found = ilUtil::sortArray($found, "title", "asc");
1319  }
1320 
1321  foreach ($found as $f) {
1322  $tpl->setCurrentBlock("item");
1323  $tpl->setVariable("WIKI_TITLE", $f["title"]);
1324  $tpl->parseCurrentBlock();
1325  }
1326 
1327  if (count($pages) == 0) {
1328  $tpl->setVariable("INFOTEXT", str_replace("$1", $term, $lng->txt("wiki_no_page_found")));
1329  } elseif ($term == '') {
1330  $tpl->setVariable("INFOTEXT", $lng->txt("wiki_no_search_term"), $term);
1331  } else {
1332  $tpl->setVariable("INFOTEXT", str_replace("$1", $term, $lng->txt("wiki_pages_found")));
1333  }
1334 
1335  $tpl->setVariable("TXT_BACK", $lng->txt("back"));
1336  echo $tpl->get();
1337  exit;
1338  }
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static lookupTitle($a_page_id)
Checks whether a page with given title exists.
getPageObject()
Get Page Object.
$_GET["client_id"]
static _performSearch($a_wiki_id, $a_searchterm)
Search in Wiki.
special template class to simplify handling of ITX/PEAR
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ setScreenIdComponent()

ilWikiPageGUI::setScreenIdComponent ( )

Set screen id component.

Parameters

Definition at line 83 of file class.ilWikiPageGUI.php.

References ilPageObjectGUI\$help.

84  {
85  $ilHelp = $this->help;
86 
87  $ilHelp->setScreenIdComponent("copgwpg");
88  }

◆ setSideBlock()

ilWikiPageGUI::setSideBlock ( )

Definition at line 267 of file class.ilWikiPageGUI.php.

References ilPageObjectGUI\getId(), getWikiPage(), and ilObjWikiGUI\renderSideBlock().

Referenced by preview(), and whatLinksHere().

268  {
270  $this->getWikiPage()->getId(),
271  $this->wiki_ref_id,
272  $this->getWikiPage()
273  );
274  }
static renderSideBlock($a_wpg_id, $a_wiki_ref_id, $a_wp=null)
Side column.
getWikiPage()
Get Wiki Page Object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setWiki()

ilWikiPageGUI::setWiki (   $a_val)

Set wiki.

Parameters
ilObjWiki$a_valwiki

Definition at line 105 of file class.ilWikiPageGUI.php.

106  {
107  $this->wiki = $a_val;
108  }

◆ setWikiPage()

ilWikiPageGUI::setWikiPage (   $a_wikipage)

Set Wiki Page Object.

Parameters
object$a_wikipageWiki Page Object

Definition at line 236 of file class.ilWikiPageGUI.php.

References ilPageObjectGUI\setPageObject().

237  {
238  $this->setPageObject($a_wikipage);
239  }
setPageObject(ilPageObject $a_pg_obj)
Set Page Object.
+ Here is the call graph for this function:

◆ setWikiRefId()

ilWikiPageGUI::setWikiRefId (   $a_ref_id)

Definition at line 90 of file class.ilWikiPageGUI.php.

Referenced by __construct().

91  {
92  $this->wiki_ref_id = $a_ref_id;
93  }
+ Here is the caller graph for this function:

◆ showPage()

ilWikiPageGUI::showPage ( )

Definition at line 475 of file class.ilWikiPageGUI.php.

References ilPageObjectGUI\$ctrl, $ilCtrl, ilPageObjectGUI\$tpl, ilPageObjectGUI\getAbstractOnly(), getWikiPage(), ilPageObjectGUI\setPresentationTitle(), and ilPageObjectGUI\setTemplateOutput().

Referenced by preview().

476  {
477  $tpl = $this->tpl;
479 
480  // content style
481  /* include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
482  $tpl->setCurrentBlock("ContentStyle");
483  $tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
484  ilObjStyleSheet::getContentStylePath(0));
485  $tpl->parseCurrentBlock();
486  */
487  $this->setTemplateOutput(false);
488 
489  if (!$this->getAbstractOnly()) {
490  $this->setPresentationTitle($this->getWikiPage()->getTitle());
491 
492  // wiki stats clean up
493  // $this->increaseViewCount();
494  }
495 
496  return parent::showPage();
497  }
setTemplateOutput($a_output=true)
global $ilCtrl
Definition: ilias.php:18
setPresentationTitle($a_title="")
getAbstractOnly()
Get abstract only.
getWikiPage()
Get Wiki Page Object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unblockWikiPage()

ilWikiPageGUI::unblockWikiPage ( )

Unblock.

Definition at line 924 of file class.ilWikiPageGUI.php.

References $_GET, ilPageObjectGUI\$access, ilPageObjectGUI\$ctrl, $ilCtrl, ilPageObjectGUI\$lng, ilPageObjectGUI\$tpl, ilWikiPerm\check(), ilPageObjectGUI\getPageObject(), and ilUtil\sendSuccess().

925  {
926  $ilAccess = $this->access;
927  $tpl = $this->tpl;
929  $lng = $this->lng;
930 
931  include_once("./Modules/Wiki/classes/class.ilWikiPerm.php");
932  if (ilWikiPerm::check("activate_wiki_protection", $_GET["ref_id"])) {
933  $this->getPageObject()->setBlocked(false);
934  $this->getPageObject()->update();
935 
936  ilUtil::sendSuccess($lng->txt("wiki_page_unblocked"), true);
937  }
938 
939  $ilCtrl->redirect($this, "preview");
940  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getPageObject()
Get Page Object.
static check($a_perm, $a_ref_id, $a_cmd="")
Check permission.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ unhideAdvancedMetaData()

ilWikiPageGUI::unhideAdvancedMetaData ( )

Definition at line 1176 of file class.ilWikiPageGUI.php.

References ilPageObjectGUI\$access, ilPageObjectGUI\$ctrl, $ilCtrl, ilPageObjectGUI\$lng, ilPageObjectGUI\getPageObject(), and ilUtil\sendSuccess().

1177  {
1178  $ilCtrl = $this->ctrl;
1179  $lng = $this->lng;
1180  $ilAccess = $this->access;
1181 
1182  if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id) &&
1183  !$ilAccess->checkAccess("edit_page_meta", "", $this->wiki_ref_id)) {
1184  return;
1185  }
1186 
1187  $this->getPageObject()->hideAdvancedMetadata(false);
1188  $this->getPageObject()->update();
1189 
1190  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
1191  $ilCtrl->redirect($this, "preview");
1192  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getPageObject()
Get Page Object.
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ updateAdvancedMetaData()

ilWikiPageGUI::updateAdvancedMetaData ( )

Definition at line 1132 of file class.ilWikiPageGUI.php.

References ilPageObjectGUI\$access, ilPageObjectGUI\$ctrl, $form, $ilCtrl, ilPageObjectGUI\$lng, editAdvancedMetaData(), initAdvancedMetaDataForm(), and ilUtil\sendSuccess().

1133  {
1134  $ilCtrl = $this->ctrl;
1135  $lng = $this->lng;
1136  $ilAccess = $this->access;
1137 
1138  if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id) &&
1139  !$ilAccess->checkAccess("edit_page_meta", "", $this->wiki_ref_id)) {
1140  return;
1141  }
1142 
1143  $form = $this->initAdvancedMetaDataForm();
1144 
1145  // needed for proper advanced MD validation
1146  $form->checkInput();
1147  if (!$this->record_gui->importEditFormPostValues()) {
1148  $this->editAdvancedMetaData($form); // #16470
1149  return false;
1150  }
1151 
1152  if ($this->record_gui->writeEditForm()) {
1153  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
1154  }
1155  $ilCtrl->redirect($this, "preview");
1156  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilCtrl
Definition: ilias.php:18
if(isset($_POST['submit'])) $form
editAdvancedMetaData(ilPropertyFormGUI $a_form=null)
+ Here is the call graph for this function:

◆ updateStatsRating()

ilWikiPageGUI::updateStatsRating (   $a_wiki_id,
  $a_wiki_type,
  $a_page_id,
  $a_page_type 
)

Definition at line 1069 of file class.ilWikiPageGUI.php.

References ilWikiStat\EVENT_PAGE_RATING, ilPageObjectGUI\getPageObject(), and ilWikiStat\handleEvent().

1070  {
1071  include_once "./Modules/Wiki/classes/class.ilWikiStat.php";
1073  }
getPageObject()
Get Page Object.
const EVENT_PAGE_RATING
static handleEvent($a_event, ilWikiPage $a_page_obj, $a_user_id=null, array $a_additional_data=null)
Handle wiki page event.
+ Here is the call graph for this function:

◆ whatLinksHere()

ilWikiPageGUI::whatLinksHere ( )

All links to a specific page.

Definition at line 554 of file class.ilWikiPageGUI.php.

References $_GET, ilPageObjectGUI\$tpl, getWikiPage(), IL_WIKI_WHAT_LINKS_HERE, and setSideBlock().

555  {
556  $tpl = $this->tpl;
557 
558  include_once("./Modules/Wiki/classes/class.ilWikiPagesTableGUI.php");
559 
560  $this->setSideBlock($_GET["wpg_id"]);
561  $table_gui = new ilWikiPagesTableGUI(
562  $this,
563  "whatLinksHere",
564  $this->getWikiPage()->getWikiId(),
566  $_GET["wpg_id"]
567  );
568 
569  $tpl->setContent($table_gui->getHTML());
570  }
$_GET["client_id"]
TableGUI class for wiki pages table.
getWikiPage()
Get Wiki Page Object.
const IL_WIKI_WHAT_LINKS_HERE
+ Here is the call graph for this function:

Field Documentation

◆ $settings

ilWikiPageGUI::$settings
protected

Definition at line 30 of file class.ilWikiPageGUI.php.

Referenced by preview().

◆ $tabs

ilWikiPageGUI::$tabs
protected

◆ $toolbar

ilWikiPageGUI::$toolbar
protected

Definition at line 35 of file class.ilWikiPageGUI.php.

Referenced by preview(), and printViewSelection().

◆ $wiki

ilWikiPageGUI::$wiki
protected

Definition at line 40 of file class.ilWikiPageGUI.php.

Referenced by getWiki().


The documentation for this class was generated from the following file: