ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 ()
 
 finalizeAssignment ()
 Finalize and submit blog to exercise. More...
 
 downloadExcSubFile ()
 
- Protected Member Functions inherited from ilPageObjectGUI
 initPageObject ()
 Init page object. More...
 
 getActivationCaptions ()
 Get captions for activation action menu entries. More...
 
 getBlockingInfoMessage ()
 Get block info message. More...
 
 isPageContainerToBeRendered ()
 

Protected Attributes

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

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 50 of file class.ilWikiPageGUI.php.

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

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

Member Function Documentation

◆ activateWikiPageRating()

ilWikiPageGUI::activateWikiPageRating ( )

Rating /.

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

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

1110  {
1111  $lng = $this->lng;
1112  $ilCtrl = $this->ctrl;
1113 
1114  $this->getPageObject()->setRating(true);
1115  $this->getPageObject()->update();
1116 
1117  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1118  $ilCtrl->redirect($this, "preview");
1119  }
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 288 of file class.ilWikiPageGUI.php.

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

Referenced by preview(), and redrawHeaderAction().

289  {
291  $ilAccess = $this->access;
292 
293  $wiki_id = $this->getPageObject()->getParentId();
294  $page_id = $this->getPageObject()->getId();
295 
296  include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
297  $dispatcher = new ilCommonActionDispatcherGUI(
299  $ilAccess,
300  "wiki",
301  $_GET["ref_id"],
302  $wiki_id
303  );
304  $dispatcher->setSubObject("wpg", $page_id);
305 
306  include_once "Services/Object/classes/class.ilObjectListGUI.php";
307  ilObjectListGUI::prepareJSLinks(
308  $this->ctrl->getLinkTarget($this, "redrawHeaderAction", "", true),
309  $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "ilnotegui"), "", "", true, false),
310  $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "iltagginggui"), "", "", true, false)
311  );
312 
313  $lg = $dispatcher->initHeaderAction();
314  $lg->enableNotes(true);
315  $lg->enableComments(ilObjWiki::_lookupPublicNotes($wiki_id), false);
316 
317  // rating
318  if (ilObjWiki::_lookupRatingOverall($wiki_id)) {
319  $lg->enableRating(
320  true,
321  $this->lng->txt("wiki_rate_overall"),
322  false,
323  // so ilCtrl does not use the shortcut via ilWikiGUI
324  array("ilcommonactiondispatchergui", "ilratinggui")
325  );
326  }
327 
328  // notification
329  if ($ilUser->getId() != ANONYMOUS_USER_ID) {
330  include_once "./Services/Notification/classes/class.ilNotification.php";
332  $this->ctrl->setParameter($this, "ntf", 1);
333  if (ilNotification::hasOptOut($wiki_id)) {
334  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_deactivate_wiki");
335  }
336 
337  $lg->addHeaderIcon(
338  "not_icon",
339  ilUtil::getImagePath("notification_on.svg"),
340  $this->lng->txt("wiki_notification_activated")
341  );
342  } else {
343  $this->ctrl->setParameter($this, "ntf", 2);
344  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_activate_wiki");
345 
347  $this->ctrl->setParameter($this, "ntf", 3);
348  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_deactivate_page");
349 
350  $lg->addHeaderIcon(
351  "not_icon",
352  ilUtil::getImagePath("notification_on.svg"),
353  $this->lng->txt("wiki_page_notification_activated")
354  );
355  } else {
356  $this->ctrl->setParameter($this, "ntf", 4);
357  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_activate_page");
358 
359  $lg->addHeaderIcon(
360  "not_icon",
361  ilUtil::getImagePath("notification_off.svg"),
362  $this->lng->txt("wiki_notification_deactivated")
363  );
364  }
365  }
366  $this->ctrl->setParameter($this, "ntf", "");
367  }
368 
369  if (!$a_redraw) {
370  $this->tpl->setHeaderActionMenu($lg->getHeaderAction());
371  } else {
372  // we need to add onload code manually (rating, comments, etc.)
373  return $lg->getHeaderAction() .
374  $this->tpl->getOnLoadCodeForAsynch();
375  }
376  }
$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
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 979 of file class.ilWikiPageGUI.php.

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

980  {
981  $ilAccess = $this->access;
982  $tpl = $this->tpl;
984  $lng = $this->lng;
985 
986  include_once("./Modules/Wiki/classes/class.ilWikiPerm.php");
987  if (ilWikiPerm::check("activate_wiki_protection", $_GET["ref_id"])) {
988  $this->getPageObject()->setBlocked(true);
989  $this->getPageObject()->update();
990 
991  ilUtil::sendSuccess($lng->txt("wiki_page_blocked"), true);
992  }
993 
994  $ilCtrl->redirect($this, "preview");
995  }
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 779 of file class.ilWikiPageGUI.php.

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

780  {
781  $lng = $this->lng;
783 
784  $ilCtrl->redirect($this, "preview");
785  }
global $ilCtrl
Definition: ilias.php:18

◆ confirmWikiPageDeletion()

ilWikiPageGUI::confirmWikiPageDeletion ( )

Delete the wiki page.

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

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

791  {
792  $ilAccess = $this->access;
793  $tpl = $this->tpl;
795  $lng = $this->lng;
796 
797  include_once("./Modules/Wiki/classes/class.ilWikiPerm.php");
798  if (ilWikiPerm::check("delete_wiki_pages", $_GET["ref_id"])) {
799  $this->getPageObject()->delete();
800 
801  ilUtil::sendSuccess($lng->txt("wiki_page_deleted"), true);
802  }
803 
804  $ilCtrl->redirectByClass("ilobjwikigui", "allPages");
805  }
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 1121 of file class.ilWikiPageGUI.php.

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

1122  {
1123  $lng = $this->lng;
1124  $ilCtrl = $this->ctrl;
1125 
1126  $this->getPageObject()->setRating(false);
1127  $this->getPageObject()->update();
1128 
1129  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1130  $ilCtrl->redirect($this, "preview");
1131  }
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 702 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().

703  {
704  $ilAccess = $this->access;
705  $tpl = $this->tpl;
707  $lng = $this->lng;
708 
709  include_once("./Modules/Wiki/classes/class.ilWikiPerm.php");
710  if (ilWikiPerm::check("delete_wiki_pages", $_GET["ref_id"])) {
711  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
712  $confirmation_gui = new ilConfirmationGUI();
713  $confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
714  $confirmation_gui->setHeaderText($lng->txt("wiki_page_deletion_confirmation"));
715  $confirmation_gui->setCancel($lng->txt("cancel"), "cancelWikiPageDeletion");
716  $confirmation_gui->setConfirm($lng->txt("delete"), "confirmWikiPageDeletion");
717 
718  $dtpl = new ilTemplate(
719  "tpl.wiki_page_deletion_confirmation.html",
720  true,
721  true,
722  "Modules/Wiki"
723  );
724 
725  $dtpl->setVariable("PAGE_TITLE", $this->getWikiPage()->getTitle());
726 
727  // other pages that link to this page
728  $dtpl->setVariable("TXT_OTHER_PAGES", $lng->txt("wiki_other_pages_linking"));
730  $this->getWikiPage()->getWikiId(),
731  $this->getWikiPage()->getId()
732  );
733  if (count($pages) > 0) {
734  foreach ($pages as $page) {
735  $dtpl->setCurrentBlock("lpage");
736  $dtpl->setVariable("TXT_LINKING_PAGE", $page["title"]);
737  $dtpl->parseCurrentBlock();
738  }
739  } else {
740  $dtpl->setCurrentBlock("lpage");
741  $dtpl->setVariable("TXT_LINKING_PAGE", "-");
742  $dtpl->parseCurrentBlock();
743  }
744 
745  // contributors
746  $dtpl->setVariable("TXT_CONTRIBUTORS", $lng->txt("wiki_contributors"));
747  $contributors = ilWikiPage::getWikiPageContributors($this->getWikiPage()->getId());
748  foreach ($contributors as $contributor) {
749  $dtpl->setCurrentBlock("contributor");
750  $dtpl->setVariable(
751  "TXT_CONTRIBUTOR",
752  $contributor["lastname"] . ", " . $contributor["firstname"]
753  );
754  $dtpl->parseCurrentBlock();
755  }
756 
757  // notes/comments
758  include_once("./Services/Notes/classes/class.ilNote.php");
759  $cnt_note_users = ilNote::getUserCount(
760  $this->getPageObject()->getParentId(),
761  $this->getPageObject()->getId(),
762  "wpg"
763  );
764  $dtpl->setVariable(
765  "TXT_NUMBER_USERS_NOTES_OR_COMMENTS",
766  $lng->txt("wiki_number_users_notes_or_comments")
767  );
768  $dtpl->setVariable("TXT_NR_NOTES_COMMENTS", $cnt_note_users);
769 
770  $confirmation_gui->addItem("", "", $dtpl->get());
771 
772  $tpl->setContent($confirmation_gui->getHTML());
773  }
774  }
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:

◆ downloadExcSubFile()

ilWikiPageGUI::downloadExcSubFile ( )
protected

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

References $_GET, $ilUser, $title, ilPageObjectGUI\$user, ilObjUser\_lookupName(), ilObject\_lookupTitle(), ilUtil\deliverFile(), and ilExSubmission\getFiles().

1446  {
1447  $ilUser = $this->user;
1448 
1449  $ass_id = (int) $_GET["ass"];
1450  $ass = new ilExAssignment($ass_id);
1451  $submission = new ilExSubmission($ass, $ilUser->getId());
1452  $submitted = $submission->getFiles();
1453  if (count($submitted) > 0) {
1454  $submitted = array_pop($submitted);
1455 
1456  $user_data = ilObjUser::_lookupName($submitted["user_id"]);
1457  $title = ilObject::_lookupTitle($submitted["obj_id"]) . " - " .
1458  $ass->getTitle() . " (Team " . $submission->getTeam()->getId() . ").zip";
1459 
1460  ilUtil::deliverFile($submitted["filename"], $title);
1461  }
1462  }
static _lookupName($a_user_id)
lookup user name
Exercise assignment.
$_GET["client_id"]
static _lookupTitle($a_id)
lookup object title
$ilUser
Definition: imgupload.php:18
Exercise submission //TODO: This class has to much static methods related to delivered "files"...
getFiles(array $a_file_ids=null, $a_only_valid=false, $a_min_timestamp=null)
Get submission items (not only files)
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
+ Here is the call graph for this function:

◆ edit()

ilWikiPageGUI::edit ( )

Edit.

Parameters

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

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

1277  {
1278  $tpl = $this->tpl;
1279  $lng = $this->lng;
1280 
1281  self::initEditingJS($tpl);
1282 
1283  return parent::edit();
1284  }

◆ editAdvancedMetaData()

ilWikiPageGUI::editAdvancedMetaData ( ilPropertyFormGUI  $a_form = null)

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

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

Referenced by updateAdvancedMetaData().

1182  {
1183  $ilTabs = $this->tabs;
1184  $lng = $this->lng;
1185  $ilCtrl = $this->ctrl;
1186  $tpl = $this->tpl;
1187  $ilAccess = $this->access;
1188 
1189  if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id) &&
1190  !$ilAccess->checkAccess("edit_page_meta", "", $this->wiki_ref_id)) {
1191  return;
1192  }
1193 
1194 
1195  $ilTabs->clearTargets();
1196  $ilTabs->setBackTarget(
1197  $lng->txt("back"),
1198  $ilCtrl->getLinkTarget($this, "preview")
1199  );
1200 
1201  if (!$a_form) {
1202  $a_form = $this->initAdvancedMetaDataForm();
1203  }
1204 
1205  $tpl->setContent($a_form->getHTML());
1206  }
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 129 of file class.ilWikiPageGUI.php.

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

130  {
132  $ilTabs = $this->tabs;
134  $ilAccess = $this->access;
135  $lng = $this->lng;
136  $tpl = $this->tpl;
137 
138  $next_class = $this->ctrl->getNextClass($this);
139  $cmd = $this->ctrl->getCmd();
140 
141  $head_title = ilObject::_lookupTitle(ilObject::_lookupObjId((int) $_GET["ref_id"])) . ": " . $this->getWikiPage()->getTitle();
142  $tpl->setHeaderPageTitle($head_title);
143  // see #13804
144  if ($_GET["page"] != "") {
145  $tpl->setPermanentLink("wiki", "", "wpage_" . $this->getPageObject()->getId() . "_" . $_GET["ref_id"], "", $head_title);
146  } else {
147  $tpl->setPermanentLink("wiki", $_GET["ref_id"]);
148  }
149 
150 
151  switch ($next_class) {
152  case "ilnotegui":
153  $this->getTabs();
154  $ilTabs->setTabActive("pg");
155  return $this->preview();
156  break;
157 
158  case "ilratinggui":
159  // for rating side block
160  include_once("./Services/Rating/classes/class.ilRatingGUI.php");
161  $rating_gui = new ilRatingGUI();
162  $rating_gui->setObject(
163  $this->getPageObject()->getParentId(),
164  "wiki",
165  $this->getPageObject()->getId(),
166  "wpg"
167  );
168  $rating_gui->setUpdateCallback(array($this, "updateStatsRating"));
169  $this->ctrl->forwardCommand($rating_gui);
170  $ilCtrl->redirect($this, "preview");
171  break;
172 
173  case "ilcommonactiondispatchergui":
174  include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
176  $gui->enableCommentsSettings(false);
177  $gui->setRatingCallback($this, "preview");
178  $this->ctrl->forwardCommand($gui);
179  break;
180 
181  case "ilwikistatgui":
182  if ($ilAccess->checkAccess("statistics_read", "", $this->wiki_ref_id)) {
183  $this->tabs_gui->clearTargets(); // see ilObjWikiGUI::getTabs()
184  $this->getTabs("statistics");
185 
186  include_once "Modules/Wiki/classes/class.ilWikiStatGUI.php";
187  $gui = new ilWikiStatGUI(
188  $this->getPageObject()->getParentId(),
189  $this->getPageObject()->getId()
190  );
191  $this->ctrl->forwardCommand($gui);
192  }
193  break;
194  case 'ilobjectmetadatagui':
195 
196  if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id)) {
197  ilUtil::sendFailure($lng->txt("permission_denied"), true);
198  $ilCtrl->redirect($this, "preview");
199  }
200  return parent::executeCommand();
201  break;
202 
203  case "ilpropertyformgui":
204  // only case is currently adv metadata internal link in info settings, see #24497
205  $form = $this->initAdvancedMetaDataForm();
206  $ilCtrl->forwardCommand($form);
207  break;
208 
209  default:
210 
211  if (strtolower($ilCtrl->getNextClass()) == "ilpageeditorgui") {
212  self::initEditingJS($this->tpl);
213  }
214 
215  if ($_GET["ntf"]) {
216  include_once "./Services/Notification/classes/class.ilNotification.php";
217  switch ($_GET["ntf"]) {
218  case 1:
219  ilNotification::setNotification(ilNotification::TYPE_WIKI, $ilUser->getId(), $this->getPageObject()->getParentId(), false);
220  break;
221 
222  case 2:
223  // remove all page notifications here?
224  ilNotification::setNotification(ilNotification::TYPE_WIKI, $ilUser->getId(), $this->getPageObject()->getParentId(), true);
225  break;
226 
227  case 3:
229  break;
230 
231  case 4:
233  break;
234  }
235  $ilCtrl->redirect($this, "preview");
236  }
237 
238  $this->setPresentationTitle($this->getWikiPage()->getTitle());
239  return parent::executeCommand();
240  }
241  }
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.
if(isset($_POST['submit'])) $form
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
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:

◆ finalizeAssignment()

ilWikiPageGUI::finalizeAssignment ( )
protected

Finalize and submit blog to exercise.

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

References $_GET, ilPageObjectGUI\$ctrl, $ilCtrl, ilPageObjectGUI\$lng, ilExAssignmentTypes\getInstance(), getWikiRefId(), ilExAssignment\TYPE_WIKI_TEAM, and user().

1424  {
1425  $ilCtrl = $this->ctrl;
1426  $lng = $this->lng;
1427 
1428  include_once("./Modules/Exercise/AssignmentTypes/classes/class.ilExAssignmentTypes.php");
1429  include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
1431 
1432  $ass_id = (int) $_GET["ass"];
1433  $wiki_ass->submitWiki($ass_id, $this->user->getId(), $this->getWikiRefId());
1434 
1435  /*
1436  include_once "Modules/Exercise/classes/class.ilExSubmissionBaseGUI.php";
1437  include_once "Modules/Exercise/classes/class.ilExSubmissionObjectGUI.php";
1438  $exc_gui = ilExSubmissionObjectGUI::initGUIForSubmit($this->ass_id);
1439  $exc_gui->submitBlog($this->node_id);*/
1440 
1441  ilUtil::sendSuccess($lng->txt("wiki_finalized"), true);
1442  $ilCtrl->redirect($this, "preview");
1443  }
$_GET["client_id"]
user()
Definition: user.php:4
global $ilCtrl
Definition: ilias.php:18
static getInstance()
Get instance.
+ 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 266 of file class.ilWikiPageGUI.php.

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

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

267  {
268  global $DIC;
269 
270  $ilDB = $DIC->database();
271 
272  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
273  $id = ilWikiPage::getPageIdForTitle($a_wiki_id, $a_title);
274  $page_gui = new ilWikiPageGUI($id, $a_old_nr, $a_wiki_ref_id);
275 
276  return $page_gui;
277  }
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 648 of file class.ilWikiPageGUI.php.

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

Referenced by executeCommand().

649  {
650  $ilTabs = $this->tabs;
652  $ilAccess = $this->access;
653 
654  parent::getTabs($a_activate);
655 
656  if ($ilAccess->checkAccess("statistics_read", "", $_GET["ref_id"])) {
657  $ilTabs->addTarget(
658  "statistics",
659  $this->ctrl->getLinkTargetByClass(
660  array("ilwikipagegui", "ilwikistatgui"),
661  "initial"
662  ),
663  "",
664  "ilwikistatgui"
665  );
666  }
667 
668  $ilCtrl->setParameterByClass(
669  "ilobjwikigui",
670  "wpg_id",
672  $this->getPageObject()->getParentId(),
674  )
675  );
676  $ilCtrl->setParameterByClass("ilobjwikigui", "page", ilWikiUtil::makeUrlTitle($_GET["page"]));
677 
678  $ilTabs->addTarget(
679  "wiki_what_links_here",
680  $this->ctrl->getLinkTargetByClass(
681  "ilwikipagegui",
682  "whatLinksHere"
683  ),
684  "whatLinksHere"
685  );
686  //$ilTabs->addTarget("wiki_print_view",
687  // $this->ctrl->getLinkTargetByClass("ilobjwikigui",
688  // "printViewSelection"), "printViewSelection");
689  $ilTabs->addTarget(
690  "wiki_print_view",
691  $this->ctrl->getLinkTargetByClass(
692  "ilwikipagegui",
693  "printViewSelection"
694  ),
695  "printViewSelection"
696  );
697  }
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.
+ 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 121 of file class.ilWikiPageGUI.php.

References $wiki.

122  {
123  return $this->wiki;
124  }

◆ getWikiPage()

ilWikiPageGUI::getWikiPage ( )

Get Wiki Page Object.

Returns
object Wiki Page Object

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

References ilPageObjectGUI\getPageObject().

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

259  {
260  return $this->getPageObject();
261  }
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 101 of file class.ilWikiPageGUI.php.

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

102  {
103  return $this->wiki_ref_id;
104  }
+ Here is the caller graph for this function:

◆ hideAdvancedMetaData()

ilWikiPageGUI::hideAdvancedMetaData ( )

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

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

1235  {
1236  $ilCtrl = $this->ctrl;
1237  $lng = $this->lng;
1238  $ilAccess = $this->access;
1239 
1240  if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id) &&
1241  !$ilAccess->checkAccess("edit_page_meta", "", $this->wiki_ref_id)) {
1242  return;
1243  }
1244 
1245  $this->getPageObject()->hideAdvancedMetadata(true);
1246  $this->getPageObject()->update();
1247 
1248  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
1249  $ilCtrl->redirect($this, "preview");
1250  }
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 575 of file class.ilWikiPageGUI.php.

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

Referenced by preview().

576  {
578 
579  $this->getWikiPage()->increaseViewCnt();
580 
581  // enable object statistics
582  require_once('Services/Tracking/classes/class.ilChangeEvent.php');
584  "wiki",
585  $this->getWikiPage()->getWikiRefId(),
586  $this->getWikiPage()->getWikiId(),
587  $ilUser->getId()
588  );
589 
590  include_once "./Modules/Wiki/classes/class.ilWikiStat.php";
592  }
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 1156 of file class.ilWikiPageGUI.php.

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

Referenced by editAdvancedMetaData(), executeCommand(), and updateAdvancedMetaData().

1157  {
1158  $ilCtrl = $this->ctrl;
1159  $lng = $this->lng;
1160 
1161  $page = $this->getWikiPage();
1162 
1163  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
1164  $form = new ilPropertyFormGUI();
1165  $form->setFormAction($ilCtrl->getFormAction($this, "updateAdvancedMetaData"));
1166 
1167  // :TODO:
1168  $form->setTitle($lng->txt("wiki_advmd_block_title") . ": " . $page->getTitle());
1169 
1170  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
1171  $this->record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_EDITOR, 'wiki', $page->getWikiId(), 'wpg', $page->getId());
1172  $this->record_gui->setPropertyForm($form);
1173  $this->record_gui->parse();
1174 
1175  $form->addCommandButton("updateAdvancedMetaData", $lng->txt("save"));
1176  $form->addCommandButton("preview", $lng->txt("cancel"));
1177 
1178  return $form;
1179  }
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 1291 of file class.ilWikiPageGUI.php.

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

1292  {
1293  global $DIC;
1294 
1295  $lng = $DIC->language();
1296 
1297  $a_tpl->addJavascript("./Modules/Wiki/js/WikiEdit.js");
1298  $a_tpl->addOnLoadCode("il.Wiki.Edit.txt.page_exists = '" . $lng->txt("wiki_page_exists") . "';");
1299  $a_tpl->addOnLoadCode("il.Wiki.Edit.txt.new_page = '" . $lng->txt("wiki_new_page") . "';");
1300  }
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 838 of file class.ilWikiPageGUI.php.

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

Referenced by printViewSelection().

839  {
840  $lng = $this->lng;
842 
844 
845  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
846  $this->form = new ilPropertyFormGUI();
847 
848  // because of PDF export
849  $this->form->setPreventDoubleSubmission(false);
850 
851  //var_dump($pages);
852  // selection type
853  $radg = new ilRadioGroupInputGUI($lng->txt("cont_selection"), "sel_type");
854  $radg->setValue("page");
855  $op1 = new ilRadioOption($lng->txt("cont_current_page"), "page");
856  $radg->addOption($op1);
857  $op2 = new ilRadioOption($lng->txt("wiki_whole_wiki")
858  . " (" . $lng->txt("wiki_pages") . ": " . count($pages) . ")", "wiki");
859  $radg->addOption($op2);
860  $op3 = new ilRadioOption($lng->txt("wiki_selected_pages"), "selection");
861  $radg->addOption($op3);
862 
863  include_once("./Services/Form/classes/class.ilNestedListInputGUI.php");
864  $nl = new ilNestedListInputGUI("", "obj_id");
865  $op3->addSubItem($nl);
866 
867  foreach ($pages as $p) {
868  $nl->addListNode(
869  $p["id"],
870  $p["title"],
871  0,
872  false,
873  false,
874  ilUtil::getImagePath("icon_pg.svg"),
875  $lng->txt("wiki_page")
876  );
877  }
878 
879  $this->form->addItem($radg);
880 
881  $this->form->addCommandButton("printViewOrder", $lng->txt("wiki_show_print_view"));
882  $this->form->addCommandButton("pdfExportOrder", $lng->txt("wiki_show_pdf_export"));
883  //$this->form->setOpenTag(false);
884  //$this->form->setCloseTag(false);
885 
886  $this->form->setTitle($lng->txt("cont_print_selection"));
887  $this->form->setFormAction($ilCtrl->getFormAction($this, "printViewOrder"));
888  }
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 1045 of file class.ilWikiPageGUI.php.

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

Referenced by renamePage(), and renameWikiPage().

1046  {
1047  $lng = $this->lng;
1048  $ilCtrl = $this->ctrl;
1049 
1050  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1051  $this->form = new ilPropertyFormGUI();
1052 
1053  // new name
1054  $ti = new ilTextInputGUI($lng->txt("wiki_new_page_name"), "new_page_name");
1055  $ti->setMaxLength(200);
1056  $ti->setSize(50);
1057  $ti->setValue($this->getPageObject()->getTitle());
1058  $ti->setRequired(true);
1059  $this->form->addItem($ti);
1060 
1061  $this->form->addCommandButton("renamePage", $lng->txt("wiki_rename"));
1062  $this->form->addCommandButton("preview", $lng->txt("cancel"));
1063 
1064  $this->form->setTitle($lng->txt("wiki_rename_page"));
1065  $this->form->setFormAction($ilCtrl->getFormAction($this));
1066  }
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 1306 of file class.ilWikiPageGUI.php.

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

1307  {
1308  $lng = $this->lng;
1309  $ilCtrl = $this->ctrl;
1310 
1311  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1312  $form = new ilPropertyFormGUI();
1313  $form->addCommandButton("addWikiLink", $lng->txt("wiki_add_link"));
1314  $form->addCommandButton("searchWikiLink", $lng->txt("search"));
1315 
1316  // Target page
1317  $tp = new ilTextInputGUI($this->lng->txt("wiki_target_page"), "target_page");
1318  $tp->setSize(18);
1319  $tp->setRequired(true);
1320  $tp->setInfo("...");
1321  $tp->setDataSource($ilCtrl->getLinkTarget($this, "insertWikiLinkAC", "", true));
1322  $form->addItem($tp);
1323 
1324  // Link text
1325  $lt = new ilTextInputGUI($this->lng->txt("wiki_link_text"), "link_text");
1326  $lt->setSize(18);
1327  $form->addItem($lt);
1328 
1329  //$form->setTitle($lng->txt("wiki_link"));
1330 
1331  echo $form->getHTML();
1332  exit;
1333  }
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.
exit
Definition: backend.php:16
+ Here is the call graph for this function:

◆ insertWikiLinkAC()

ilWikiPageGUI::insertWikiLinkAC ( )

Auto complete for insert wiki link.

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

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

1339  {
1340  $result = array();
1341 
1342  $term = $_GET["term"];
1343 
1344  // if page exists, make it first entry
1345  if (ilWikiPage::_wikiPageExists($this->getPageObject()->getParentId(), $term)) {
1346  $entry = new stdClass();
1347  $entry->value = $term;
1348  $entry->label = $term;
1349  $result[] = $entry;
1350  }
1351 
1352  $res = ilWikiPage::getPagesForSearch($this->getPageObject()->getParentId(), $term);
1353 
1354  $cnt = 0;
1355  foreach ($res as $r) {
1356  if ($result[0]->value == $r) {
1357  continue;
1358  }
1359  if ($cnt++ > 19) {
1360  continue;
1361  }
1362  $entry = new stdClass();
1363  $entry->value = $r;
1364  $entry->label = $r;
1365  $result[] = $entry;
1366  }
1367 
1368  include_once './Services/JSON/classes/class.ilJsonUtil.php';
1370  exit;
1371  }
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
static _wikiPageExists($a_wiki_id, $a_title)
Check whether page exists for wiki or not.
exit
Definition: backend.php:16
+ 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 1134 of file class.ilWikiPageGUI.php.

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

1135  {
1136  // #10040 - get note text
1137  include_once "Services/Notes/classes/class.ilNote.php";
1138  $note = new ilNote($a_note_id);
1139  $note = $note->getText();
1140 
1141  include_once "./Services/Notification/classes/class.ilNotification.php";
1142  ilWikiUtil::sendNotification("comment", ilNotification::TYPE_WIKI_PAGE, $this->getWikiRefId(), $a_page_id, $note);
1143  }
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 895 of file class.ilWikiPageGUI.php.

References printViewOrderList().

896  {
897  $this->printViewOrderList(true);
898  }
printViewOrderList($a_pdf_export=false)
+ Here is the call graph for this function:

◆ postOutputProcessing()

ilWikiPageGUI::postOutputProcessing (   $a_output)

Finalizing output processing.

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

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

598  {
600 
601  //echo htmlentities($a_output);
602  include_once("./Modules/Wiki/classes/class.ilWikiUtil.php");
603 
604  $ilCtrl->setParameterByClass("ilobjwikigui", "from_page", ilWikiUtil::makeUrlTitle($_GET["page"]));
606  $a_output,
607  $this->getWikiPage()->getWikiId(),
608  ($this->getOutputMode() == "offline")
609  );
610  $ilCtrl->setParameterByClass("ilobjwikigui", "from_page", $_GET["from_page"]);
611 
612 
613  // metadata in print view
614  if ($this->getOutputMode() == "print" && $this->wiki instanceof ilObjWiki) {
615  include_once("./Services/Object/classes/class.ilObjectMetaDataGUI.php");
616  $mdgui = new ilObjectMetaDataGUI($this->wiki, "wpg", $this->getId());
617  $md = $mdgui->getKeyValueList();
618  if ($md != "") {
619  $output = str_replace("<!--COPage-PageTop-->", "<p>" . $md . "</p>", $output);
620  }
621  }
622 
623 
624  return $output;
625  }
Class ilObjectMetaDataGUI.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
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 387 of file class.ilWikiPageGUI.php.

References $_GET, ilPageObjectGUI\$access, ilPageObjectGUI\$ctrl, $i, $ilCtrl, $ilSetting, $ilUser, $info, $l, $links, ilPageObjectGUI\$lng, $message, $settings, ilPageObjectGUI\$tpl, $ui, ilPageObjectGUI\$user, $w, ilUserSearchCache\_getInstance(), ilObjWiki\_lookupPublicNotes(), addHeaderAction(), ilExAssignment\afterDeadlineStrict(), ilDatePresentation\formatDate(), ilExcRepoObjAssignment\getInstance(), ilUserUtil\getNamePresentation(), ilPageObjectGUI\getNotesHTML(), ilPageObjectGUI\getPageObject(), ilExSubmission\getSelectedObject(), getWikiRefId(), ilTextHighlighterGUI\highlight(), IL_CAL_DATETIME, IL_PAGE_PRESENTATION, increaseViewCount(), ilUserSearchCache\LAST_QUERY, ilUtil\sendInfo(), ilPageObjectGUI\setOutputMode(), ilPageObjectGUI\setRenderPageContainer(), setSideBlock(), ilDatePresentation\setUseRelativeDates(), showPage(), and ilDatePresentation\useRelativeDates().

Referenced by executeCommand().

388  {
390  $ilAccess = $this->access;
391  $lng = $this->lng;
392  $tpl = $this->tpl;
395  $ui = $this->ui;
396 
397 
398  // block/unblock
399  if ($this->getPageObject()->getBlocked()) {
400  ilUtil::sendInfo($lng->txt("wiki_page_status_blocked"));
401  }
402 
403  // exercise information
404  include_once("./Modules/Exercise/RepoObjectAssignment/classes/class.ilExcRepoObjAssignment.php");
405  $ass_info = ilExcRepoObjAssignment::getInstance()->getAssignmentInfoOfObj($this->getWikiRefId(), $ilUser->getId());
406  $message = "";
407  foreach ($ass_info as $i) { // should be only one
408  $links = $buttons = [];
409  $ass = new ilExAssignment($i->getId());
410  $times_up = $ass->afterDeadlineStrict();
411 
412  // info text and link
413  $exc_title = $i->getExerciseTitle();
414  $info = sprintf(
415  $lng->txt("wiki_exercise_info"),
416  $i->getTitle(),
417  $exc_title
418  );
419  foreach ($i->getLinks() as $l) {
420  $links[] = $ui->factory()->link()->standard($exc_title, $l);
421  }
422 
423  // submit button
424  if (!$times_up) {
425  $ilCtrl->setParameterByClass("ilwikipagegui", "ass", $ass->getId());
426  $submit_link = $ilCtrl->getLinkTargetByClass("ilwikipagegui", "finalizeAssignment");
427  $ilCtrl->setParameterByClass("ilwikipagegui", "ass", "");
428 
429  $buttons[] = $ui->factory()->button()->primary($lng->txt("wiki_finalize_wiki"), $submit_link);
430  }
431 
432  // submitted files
433  include_once "Modules/Exercise/classes/class.ilExSubmission.php";
434  $submission = new ilExSubmission($ass, $ilUser->getId());
435  if ($submission->hasSubmitted()) {
436  $submitted = $submission->getSelectedObject();
437 
438  $ilCtrl->setParameterByClass("ilwikipagegui", "ass", $ass->getId());
439  $dl_link = $ilCtrl->getLinkTargetByClass("ilwikipagegui", "downloadExcSubFile");
440  $ilCtrl->setParameterByClass("ilwikipagegui", "ass", "");
441 
444 
445 
446  $info .= "<br />" . sprintf(
447  $lng->txt("wiki_exercise_submitted_info"),
449  );
450 
452  $buttons[] = $ui->factory()->button()->standard($lng->txt("wiki_download_submission"), $dl_link);
453  }
454 
455 
456  $mbox = $ui->factory()->messageBox()->info($info)
457  ->withLinks($links)
458  ->withButtons($buttons);
459 
460  $message = $ui->renderer()->render($mbox);
461 
462  //ilUtil::sendInfo($info);
463  }
464 
465 
466  $this->increaseViewCount();
467 
468  $this->addHeaderAction();
469 
470  // content
471  $this->setSideBlock();
472 
473  $wtpl = new ilTemplate(
474  "tpl.wiki_page_view_main_column.html",
475  true,
476  true,
477  "Modules/Wiki"
478  );
479 
480  $callback = array($this, "observeNoteAction");
481 
482  // notes
483  if (!$ilSetting->get("disable_comments") &&
484  ilObjWiki::_lookupPublicNotes($this->getPageObject()->getParentId())) {
485  $may_delete = ($ilSetting->get("comments_del_tutor", 1) &&
486  $ilAccess->checkAccess("write", "", $_GET["ref_id"]));
487  $wtpl->setVariable("NOTES", $this->getNotesHTML(
488  $this->getPageObject(),
489  true,
490  ilObjWiki::_lookupPublicNotes($this->getPageObject()->getParentId()),
491  $may_delete,
492  $callback
493  ));
494  }
495 
496 
497  // page content
499  $this->setRenderPageContainer(true);
500  $wtpl->setVariable("PAGE", $this->showPage());
501 
502  $tpl->setLoginTargetPar("wiki_" . $_GET["ref_id"] . $append);
503 
504  // last edited info
505  include_once("./Services/User/classes/class.ilUserUtil.php");
506  $wtpl->setVariable(
507  "LAST_EDITED_INFO",
508  $lng->txt("wiki_last_edited") . ": " .
510  new ilDateTime($this->getPageObject()->getLastChange(), IL_CAL_DATETIME)
511  ) . ", " .
513  $this->getPageObject()->getLastChangeUser(),
514  false,
515  true,
516  $ilCtrl->getLinkTarget($this, "preview")
517  )
518  );
519 
520  $tpl->setLoginTargetPar("wiki_" . $_GET["ref_id"] . $append);
521 
522  //highlighting
523  if ($_GET["srcstring"] != "") {
524  include_once './Services/Search/classes/class.ilUserSearchCache.php';
525  $cache = ilUserSearchCache::_getInstance($ilUser->getId());
526  $cache->switchSearchType(ilUserSearchCache::LAST_QUERY);
527  $search_string = $cache->getQuery();
528 
529  // advanced search?
530  if (is_array($search_string)) {
531  $search_string = $search_string["lom_content"];
532  }
533 
534  include_once("./Services/UIComponent/TextHighlighter/classes/class.ilTextHighlighterGUI.php");
535  include_once("./Services/Search/classes/class.ilQueryParser.php");
536  $p = new ilQueryParser($search_string);
537  $p->parse();
538 
539  $words = $p->getQuotedWords();
540  if (is_array($words)) {
541  foreach ($words as $w) {
542  ilTextHighlighterGUI::highlight("ilCOPageContent", $w, $tpl);
543  }
544  }
545  $this->fill_on_load_code = true;
546  }
547 
548  return $message . $wtpl->get();
549  }
Exercise assignment.
getPageObject()
Get Page Object.
addHeaderAction($a_redraw=false)
const IL_CAL_DATETIME
static getInstance()
Get instance.
$_GET["client_id"]
static setUseRelativeDates($a_status)
set use relative dates
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
$w
static useRelativeDates()
check if relative dates are used
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.
catch(Exception $e) $message
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:
afterDeadlineStrict($a_include_personal=true)
const IL_PAGE_PRESENTATION
global $l
Definition: afr.php:30
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.
$i
Definition: disco.tpl.php:19
Exercise submission //TODO: This class has to much static methods related to delivered "files"...
$links
$info
Definition: index.php:5
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 890 of file class.ilWikiPageGUI.php.

References printViewOrderList().

891  {
892  $this->printViewOrderList();
893  }
printViewOrderList($a_pdf_export=false)
+ Here is the call graph for this function:

◆ printViewOrderList()

ilWikiPageGUI::printViewOrderList (   $a_pdf_export = false)
protected

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

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

Referenced by pdfExportOrder(), and printViewOrder().

901  {
902  $ilTabs = $this->tabs;
903 
904  $pg_ids = $all_pages = array();
905 
906  // coming from type selection
907  if (!is_array($_POST["wordr"])) {
908  switch (trim($_POST["sel_type"])) {
909  case "wiki":
910  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
911  $all_pages = ilWikiPage::getAllWikiPages($this->getPageObject()->getWikiId());
912  foreach ($all_pages as $p) {
913  $pg_ids[] = $p["id"];
914  }
915  break;
916 
917  case "selection":
918  if (is_array($_POST["obj_id"])) {
919  $pg_ids = $_POST["obj_id"];
920  } else {
921  $pg_ids[] = $_GET["wpg_id"];
922  }
923  if (sizeof($pg_ids) > 1) {
924  break;
925  } else {
926  $_GET["wpg_id"] = array_pop($pg_ids);
927  }
928  // fallthrough
929 
930  // no order needed for single page
931  // no break
932  default:
933  //case "page":
934  $this->ctrl->setParameterByClass("ilObjWikiGUI", "wpg_id", $_GET["wpg_id"]);
935  if ($a_pdf_export) {
936  $this->ctrl->redirectByClass("ilObjWikiGUI", "pdfExport");
937  } else {
938  $this->ctrl->redirectByClass("ilObjWikiGUI", "printView");
939  }
940  break;
941  }
942 
943  if ($a_pdf_export) {
944  $this->ctrl->setParameter($this, "pexp", 1);
945  }
946  }
947  // refresh sorting
948  else {
949  $a_pdf_export = (bool) $_GET["pexp"];
950 
951  asort($_POST["wordr"]);
952  $pg_ids = array_keys($_POST["wordr"]);
953  }
954 
955  $ilTabs->clearTargets();
956  $ilTabs->setBackTarget(
957  $this->lng->txt("back"),
958  $this->ctrl->getLinkTarget($this, "preview")
959  );
960 
961  if (!sizeof($all_pages)) {
962  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
963  $all_pages = ilWikiPage::getAllWikiPages($this->getPageObject()->getWikiId());
964  }
965 
966  include_once "Modules/Wiki/classes/class.ilWikiExportOrderTableGUI.php";
967  $tbl = new ilWikiExportOrderTableGUI($this, "printViewOrderList", $a_pdf_export, $all_pages, $pg_ids);
968  $this->tpl->setContent($tbl->getHTML());
969  }
getPageObject()
Get Page Object.
$_GET["client_id"]
$tbl
Definition: example_048.php:81
static getAllWikiPages($a_wiki_id)
Get all pages of wiki.
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 817 of file class.ilWikiPageGUI.php.

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

818  {
820  $lng = $this->lng;
821  $ilToolbar = $this->toolbar;
823  $tpl = $this->tpl;
824 
825  /*$ilToolbar->setFormAction($ilCtrl->getFormActionByClass("ilobjwikigui", "printView"),
826  false, "print_view");
827  $ilToolbar->addFormButton($lng->txt("cont_show_print_view"), "printView");
828  $ilToolbar->setCloseFormTag(false);*/
829 
831 
832  $tpl->setContent($this->form->getHTML());
833  }
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 378 of file class.ilWikiPageGUI.php.

References addHeaderAction(), and exit.

379  {
380  echo $this->addHeaderAction(true);
381  exit;
382  }
addHeaderAction($a_redraw=false)
exit
Definition: backend.php:16
+ Here is the call graph for this function:

◆ renamePage()

ilWikiPageGUI::renamePage ( )

Rename page.

Definition at line 1071 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(), and ilUtil\sendFailure().

1072  {
1073  $tpl = $this->tpl;
1074  $lng = $this->lng;
1075  $ilCtrl = $this->ctrl;
1076  $ilAccess = $this->access;
1077 
1078  $this->initRenameForm();
1079  if ($this->form->checkInput()) {
1080  if (($ilAccess->checkAccess("edit_content", "", $_GET["ref_id"]) && !$this->getPageObject()->getBlocked())
1081  || $ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
1082  $new_name = $this->form->getInput("new_page_name");
1083 
1084  $page_title = ilWikiUtil::makeDbTitle($new_name);
1085  $pg_id = ilWikiPage::_getPageIdForWikiTitle($this->getPageObject()->getWikiId(), $page_title);
1086 
1087  // we might get the same page id back here, if the page
1088  // name only differs in diacritics
1089  // see bug http://www.ilias.de/mantis/view.php?id=11226
1090  if ($pg_id > 0 && $pg_id != $this->getPageObject()->getId()) {
1091  ilUtil::sendFailure($lng->txt("wiki_page_already_exists"));
1092  } else {
1093  $new_name = $this->getPageObject()->rename($new_name);
1094  $ilCtrl->setParameterByClass("ilobjwikigui", "page", ilWikiUtil::makeUrlTitle($new_name));
1095  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1096  $ilCtrl->redirect($this, "preview");
1097  }
1098  }
1099  }
1100 
1101  $this->form->setValuesByPost();
1102  $tpl->setContent($this->form->getHtml());
1103  }
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 1026 of file class.ilWikiPageGUI.php.

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

1027  {
1028  $ilAccess = $this->access;
1029  $tpl = $this->tpl;
1030  $ilCtrl = $this->ctrl;
1031  $lng = $this->lng;
1032 
1033  if (($ilAccess->checkAccess("edit_content", "", $_GET["ref_id"]) && !$this->getPageObject()->getBlocked())
1034  || $ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
1035  $this->initRenameForm();
1036  $tpl->setContent($this->form->getHTML());
1037  }
1038  }
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 1376 of file class.ilWikiPageGUI.php.

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

1377  {
1378  $lng = $this->lng;
1379 
1380  $lng->loadLanguageModule("wiki");
1381 
1382  $tpl = new ilTemplate("tpl.wiki_ac_search_result.html", true, true, "Modules/Wiki");
1383  $term = trim($_GET["term"]);
1384 
1385  $pages = ilObjWiki::_performSearch($this->getPageObject()->getParentId(), $term);
1386 
1387  $found = array();
1388  foreach ($pages as $page) {
1389  $found[] = array("page_id" => $page["page_id"], "title" => ilWikiPage::lookupTitle($page["page_id"]));
1390  }
1391 
1392  // sort if all pages are listed
1393  if ($term == "") {
1394  $found = ilUtil::sortArray($found, "title", "asc");
1395  }
1396 
1397  foreach ($found as $f) {
1398  $tpl->setCurrentBlock("item");
1399  $tpl->setVariable("WIKI_TITLE", $f["title"]);
1400  $tpl->parseCurrentBlock();
1401  }
1402 
1403  if (count($pages) == 0) {
1404  $tpl->setVariable("INFOTEXT", str_replace("$1", $term, $lng->txt("wiki_no_page_found")));
1405  } elseif ($term == '') {
1406  $tpl->setVariable("INFOTEXT", $lng->txt("wiki_no_search_term"), $term);
1407  } else {
1408  $tpl->setVariable("INFOTEXT", str_replace("$1", $term, $lng->txt("wiki_pages_found")));
1409  }
1410 
1411  $tpl->setVariable("TXT_BACK", $lng->txt("back"));
1412  echo $tpl->get();
1413  exit;
1414  }
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
exit
Definition: backend.php:16
+ Here is the call graph for this function:

◆ setScreenIdComponent()

ilWikiPageGUI::setScreenIdComponent ( )

Set screen id component.

Parameters

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

References ilPageObjectGUI\$help.

90  {
91  $ilHelp = $this->help;
92 
93  $ilHelp->setScreenIdComponent("copgwpg");
94  }

◆ setSideBlock()

ilWikiPageGUI::setSideBlock ( )

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

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

Referenced by preview(), and whatLinksHere().

280  {
282  $this->getWikiPage()->getId(),
283  $this->wiki_ref_id,
284  $this->getWikiPage()
285  );
286  }
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 111 of file class.ilWikiPageGUI.php.

112  {
113  $this->wiki = $a_val;
114  }

◆ setWikiPage()

ilWikiPageGUI::setWikiPage (   $a_wikipage)

Set Wiki Page Object.

Parameters
object$a_wikipageWiki Page Object

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

References ilPageObjectGUI\setPageObject().

249  {
250  $this->setPageObject($a_wikipage);
251  }
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 96 of file class.ilWikiPageGUI.php.

Referenced by __construct().

97  {
98  $this->wiki_ref_id = $a_ref_id;
99  }
+ Here is the caller graph for this function:

◆ showPage()

ilWikiPageGUI::showPage ( )

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

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

Referenced by preview().

552  {
553  $tpl = $this->tpl;
555 
556  // content style
557  /* include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
558  $tpl->setCurrentBlock("ContentStyle");
559  $tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
560  ilObjStyleSheet::getContentStylePath(0));
561  $tpl->parseCurrentBlock();
562  */
563  $this->setTemplateOutput(false);
564 
565  if (!$this->getAbstractOnly()) {
566  $this->setPresentationTitle($this->getWikiPage()->getTitle());
567 
568  // wiki stats clean up
569  // $this->increaseViewCount();
570  }
571 
572  return parent::showPage();
573  }
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 1000 of file class.ilWikiPageGUI.php.

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

1001  {
1002  $ilAccess = $this->access;
1003  $tpl = $this->tpl;
1004  $ilCtrl = $this->ctrl;
1005  $lng = $this->lng;
1006 
1007  include_once("./Modules/Wiki/classes/class.ilWikiPerm.php");
1008  if (ilWikiPerm::check("activate_wiki_protection", $_GET["ref_id"])) {
1009  $this->getPageObject()->setBlocked(false);
1010  $this->getPageObject()->update();
1011 
1012  ilUtil::sendSuccess($lng->txt("wiki_page_unblocked"), true);
1013  }
1014 
1015  $ilCtrl->redirect($this, "preview");
1016  }
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 1252 of file class.ilWikiPageGUI.php.

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

1253  {
1254  $ilCtrl = $this->ctrl;
1255  $lng = $this->lng;
1256  $ilAccess = $this->access;
1257 
1258  if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id) &&
1259  !$ilAccess->checkAccess("edit_page_meta", "", $this->wiki_ref_id)) {
1260  return;
1261  }
1262 
1263  $this->getPageObject()->hideAdvancedMetadata(false);
1264  $this->getPageObject()->update();
1265 
1266  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
1267  $ilCtrl->redirect($this, "preview");
1268  }
getPageObject()
Get Page Object.
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ updateAdvancedMetaData()

ilWikiPageGUI::updateAdvancedMetaData ( )

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

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

1209  {
1210  $ilCtrl = $this->ctrl;
1211  $lng = $this->lng;
1212  $ilAccess = $this->access;
1213 
1214  if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id) &&
1215  !$ilAccess->checkAccess("edit_page_meta", "", $this->wiki_ref_id)) {
1216  return;
1217  }
1218 
1219  $form = $this->initAdvancedMetaDataForm();
1220 
1221  // needed for proper advanced MD validation
1222  $form->checkInput();
1223  if (!$this->record_gui->importEditFormPostValues()) {
1224  $this->editAdvancedMetaData($form); // #16470
1225  return false;
1226  }
1227 
1228  if ($this->record_gui->writeEditForm()) {
1229  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
1230  }
1231  $ilCtrl->redirect($this, "preview");
1232  }
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 1145 of file class.ilWikiPageGUI.php.

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

1146  {
1147  include_once "./Modules/Wiki/classes/class.ilWikiStat.php";
1149  }
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 630 of file class.ilWikiPageGUI.php.

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

631  {
632  $tpl = $this->tpl;
633 
634  include_once("./Modules/Wiki/classes/class.ilWikiPagesTableGUI.php");
635 
636  $this->setSideBlock($_GET["wpg_id"]);
637  $table_gui = new ilWikiPagesTableGUI(
638  $this,
639  "whatLinksHere",
640  $this->getWikiPage()->getWikiId(),
642  $_GET["wpg_id"]
643  );
644 
645  $tpl->setContent($table_gui->getHTML());
646  }
$_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 printViewSelection().

◆ $ui

ilWikiPageGUI::$ui
protected

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

Referenced by preview().

◆ $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: