ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ilWikiPageGUI Class Reference

Class ilWikiPage GUI class. More...

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

Public Member Functions

 __construct (int $a_id=0, int $a_old_nr=0, int $a_wiki_ref_id=0, string $lang="-")
 
 setScreenIdComponent ()
 
 setWikiRefId (int $a_ref_id)
 
 getWikiRefId ()
 
 setWiki (ilObjWiki $a_val)
 
 getWiki ()
 
 executeCommand ()
 
 setWikiPage (ilWikiPage $a_wikipage)
 
 setSideBlock ()
 
 addHeaderAction (bool $a_redraw=false)
 
 redrawHeaderAction ()
 
 preview ()
 
 showPage ()
 
 postOutputProcessing (string $a_output)
 
 whatLinksHere ()
 
 getTabs (string $a_activate="")
 
 deleteWikiPageConfirmationScreen ()
 
 cancelWikiPageDeletion ()
 
 confirmWikiPageDeletion ()
 
 printViewSelection ()
 
 printViewOrder ()
 
 blockWikiPage ()
 
 unblockWikiPage ()
 
 renameWikiPage ()
 
 renamePage ()
 
 activateWikiPageRating ()
 Rating /. More...
 
 deactivateWikiPageRating ()
 
 observeNoteAction (int $a_wiki_id, int $a_page_id, string $a_type, string $a_action, int $a_note_id)
 
 updateStatsRating (int $a_wiki_id, string $a_wiki_type, int $a_page_id, string $a_page_type)
 
 editAdvancedMetaData (ilPropertyFormGUI $a_form=null)
 
 updateAdvancedMetaData ()
 
 hideAdvancedMetaData ()
 
 unhideAdvancedMetaData ()
 
 edit ()
 
 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...
 
 getCommentsHTMLExport ()
 
 confirmPageTranslationCreation ()
 Confirm page translation creation. More...
 
 createPageTranslation ()
 
- Public Member Functions inherited from ilPageObjectGUI
 __construct (string $a_parent_type, int $a_id, int $a_old_nr=0, bool $a_prevent_get_id=false, string $a_lang="", string $concrete_lang="")
 
 setTemplate (ilGlobalTemplateInterface $main_tpl)
 
 afterConstructor ()
 
 setAdvMdRecordObject (int $a_adv_ref_id, string $a_adv_type, string $a_adv_subtype="-")
 Set object, that defines the adv md records being used. More...
 
 getAdvMdRecordObject ()
 Get adv md record type. More...
 
 setParentType (string $a_val)
 
 getParentType ()
 
 setId (int $a_val)
 
 getId ()
 
 setOldNr (int $a_val)
 Set old nr (historic page) More...
 
 getOldNr ()
 
 setLanguage (string $a_val)
 
 getLanguage ()
 
 setEnablePCType (string $a_pc_type, bool $a_val)
 
 getEnablePCType (string $a_pc_type)
 
 setPageConfig (ilPageConfig $a_val)
 
 getPageConfig ()
 
 setPageObject (ilPageObject $a_pg_obj)
 
 getPageObject ()
 
 setOutputMode (string $a_mode=self::PRESENTATION)
 
 getOutputMode ()
 
 setTemplateOutput (bool $a_output=true)
 
 outputToTemplate ()
 
 setPresentationTitle (string $a_title="")
 
 getPresentationTitle ()
 
 setHeader (string $a_title="")
 
 getHeader ()
 
 setLinkParams (string $l_params="")
 
 getLinkParams ()
 
 setLinkFrame (string $l_frame="")
 
 getLinkFrame ()
 
 setPageLinker (\ILIAS\COPage\PageLinker $page_linker)
 
 getLinkXML ()
 
 setQuestionHTML (array $question_html)
 
 getQuestionHTML ()
 
 setTemplateTargetVar (string $a_variable)
 
 getTemplateTargetVar ()
 
 getTemplateOutputVar ()
 
 setSourcecodeDownloadScript (string $script_name)
 
 getSourcecodeDownloadScript ()
 
 setTabs (ilTabsGUI $a_tabs)
 
 setPageBackTitle (string $a_title)
 
 setFileDownloadLink (string $a_download_link)
 
 getFileDownloadLink ()
 
 setFullscreenLink (string $a_fullscreen_link)
 
 getFullscreenLink ()
 
 setIntLinkReturn (string $a_return)
 
 enableNotes (bool $a_enabled, int $a_parent_id)
 
 isEnabledNotes ()
 
 setOfflineDirectory (string $offdir)
 
 getOfflineDirectory ()
 
 setViewPageLink (string $a_link, string $a_target="")
 set link for "view page" button More...
 
 getViewPageLink ()
 
 getViewPageTarget ()
 
 getViewPageText ()
 
 setActivationListener (object $a_obj, string $a_meth)
 
 setEnabledNews (bool $a_enabled, int $a_news_obj_id=0, string $a_news_obj_type="")
 
 getEnabledNews ()
 
 setTabHook (object $a_object, string $a_function)
 
 setEditPreview (bool $a_editpreview)
 Set Display first Edit tab, then Preview tab, instead of Page and Edit. More...
 
 getEditPreview ()
 
 setEnabledTabs (bool $a_enabledtabs)
 
 getEnabledTabs ()
 
 setEnabledPageFocus (bool $a_enabledpagefocus)
 
 setOpenPlaceHolder (string $a_val)
 
 getOpenPlaceHolder ()
 
 getEnabledPageFocus ()
 
 setPrependingHtml (string $a_prependinghtml)
 
 getPrependingHtml ()
 
 setEnableEditing (bool $a_enableediting)
 
 getEnableEditing ()
 
 setRawPageContent (bool $a_rawpagecontent)
 Set Get raw page content only. More...
 
 getRawPageContent ()
 
 setStyleId (int $a_styleid)
 
 getStyleId ()
 
 setCompareMode (bool $a_val)
 
 getCompareMode ()
 
 setAbstractOnly (bool $a_val, string $pcid="")
 Get only abstract (first text paragraph) More...
 
 getAbstractOnly ()
 
 setRenderPageContainer (bool $a_val)
 
 getRenderPageContainer ()
 
 getDisabledText ()
 
 getEnabledHref ()
 
 setEnabledHref (bool $enable)
 
 activateMetaDataEditor (ilObject $a_rep_obj, string $a_type, int $a_sub_obj_id, object $a_observer_obj=null, string $a_observer_func="")
 Activate meda data editor. More...
 
 determineFileDownloadLink ()
 
 determineFullscreenLink ()
 
 determineSourcecodeDownloadScript ()
 
 getComponentPluginsXML ()
 Put information about activated plugins into XML. More...
 
 executeCommand ()
 execute command More...
 
 setQEditTabs (string $a_active)
 Set question editing tabs. More...
 
 onFeedbackEditingForwarding ()
 
 deactivatePage ()
 
 activatePage ()
 
 showPage ()
 display content of page More...
 
 replaceCurlyBrackets (string $output)
 
 getActivationCaptions ()
 Get captions for activation action menu entries. More...
 
 setEditMode ()
 Set edit mode. More...
 
 setDefaultLinkXml ()
 
 setLinkXml (string $xml)
 
 getProfileBackUrl ()
 
 setProfileBackUrl (string $url)
 
 downloadFile ()
 
 displayMediaFullscreen ()
 
 displayMedia (bool $a_fullscreen=false)
 
 download_paragraph ()
 download source code paragraph More...
 
 insertPageToc (string $a_output)
 
 insertResources (string $a_output)
 
 insertAdvTrigger (string $a_output)
 Insert adv content trigger. More...
 
 postOutputProcessing (string $a_output)
 Finalizing output processing. More...
 
 previewHistory ()
 Preview history. More...
 
 preview ()
 
 edit ()
 
 getBlockingInfoMessage ()
 
 insertJSAtPlaceholder ()
 
 presentation (string $a_mode=self::PRESENTATION)
 
 getHTML ()
 
 showMediaFullscreen (int $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 ()
 
 getMetaDataLink ()
 
 getTabs (string $a_activate="")
 
 compareVersion ()
 Compares two revisions of the page. More...
 
 replaceDiffTags (string $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 (object $a_content_object=null, bool $a_enable_private_notes=true, bool $a_enable_public_notes=false, bool $a_enable_notes_deletion=false, callable $a_callback=null, bool $export=false)
 Get html for public and/or private notes. More...
 
 processAnswer ()
 Process answer. More...
 
 initialOpenedContent ()
 Initially opened content. More...
 
 initOpenedContentForm ()
 
 saveInitialOpenedContent ()
 
 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...
 
 finishEditing ()
 
 getPagePermaLink ()
 
 getAdditionalPageActions ()
 Get additional page actions. More...
 
 afterDeleteContents ()
 

Static Public Member Functions

static initEditingJS (ilGlobalTemplateInterface $a_tpl)
 
- Static Public Member Functions inherited from ilPageObjectGUI
static getTinyMenu (string $a_par_type, bool $a_int_links=false, bool $a_wiki_links=false, bool $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, \ILIAS\COPage\Editor\Server\UIWrapper $ui_wrapper=null)
 Get Tiny Menu. More...
 

Protected Member Functions

 initToolbar ()
 
 getCurrentLanguage ()
 
 addLanguageSelectionToToolbar ()
 
 getLanguageLabelForCode (string $code)
 
 getPrintView ()
 
 increaseViewCount ()
 
 printViewOrderList ()
 
 initRenameForm ()
 
 initAdvancedMetaDataForm ()
 
 finalizeAssignment ()
 Finalize and submit blog to exercise. More...
 
 downloadExcSubFile ()
 
 getTranslatePageFormAdapter ()
 
 checkLangPageAvailable (int $id, string $lang)
 
- Protected Member Functions inherited from ilPageObjectGUI
 initPageObject ()
 Init page object. More...
 
 showEditToolbar ()
 Show edit toolbar. More...
 
 setEditorToolContext ()
 Set editor tool context. More...
 
 initEditing ()
 
 showEditLockInfo ()
 
 setBackToEditTabs ()
 
 setBackToHistoryTabs ()
 
 checkLangPageAvailable (int $id, string $lang)
 
 isPageContainerToBeRendered ()
 
 addResourcesToTemplate (ilGlobalTemplateInterface $tpl)
 Add resources to template. More...
 

Protected Attributes

ILIAS Exercise InternalDomainService $exc_domain
 
ILIAS Wiki InternalDomainService $domain
 
ILIAS Wiki Page PageManager $wiki_pm
 
ilObjectTranslation $ot
 
ILIAS Wiki InternalGUIService $wiki_gui
 
ILIAS Notes Service $notes
 
ILIAS HTTP Services $http
 
ILIAS Wiki WikiGUIRequest $wiki_request
 
ilAdvancedMDRecordGUI $record_gui = null
 
bool $fill_on_load_code = false
 
int $wiki_ref_id = 0
 
ilSetting $settings
 
ilObjWiki $wiki
 
- Protected Attributes inherited from ilPageObjectGUI
ILIAS TestQuestionPool Questions PublicInterface $questioninfo
 
ILIAS COPage Page PageManager $pm
 
ILIAS COPage Link LinkManager $link
 
ILIAS COPage InternalGUIService $gui
 
ILIAS COPage PC PCDefinition $pc_definition
 
ILIAS COPage Xsl XslManager $xsl
 
ILIAS COPage Editor GUIService $editor_gui
 
ILIAS Notes Service $notes
 
int $requested_ref_id
 
int $requested_pg_id
 
string $requested_file_id
 
string $requested_transl
 
int $requested_old_nr
 
EditGUIRequest $request
 
EditSessionRepository $edit_repo
 
string $exp_target_script = ""
 
string $exp_id = ""
 
string $exp_frame = ""
 
string $act_meth = ""
 
object $act_obj
 
int $notes_parent_id = 0
 
ilPropertyFormGUI $form
 
int $styleid = 0
 
bool $enabledpagefocus
 
string $link_xml
 
int $old_nr = 0
 
int $id
 
string $language
 
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilTabsGUI $tabs_gui
 
ilAccessHandler $access
 
ilLogger $log
 
ilObjUser $user
 
ilHelpGUI $help
 
string $output_mode = ""
 
string $parent_type = ""
 
string $file_download_link = ''
 
string $fullscreen_link = ''
 
string $link_frame = ''
 
ILIAS GlobalScreen ScreenContext ContextServices $tool_context
 
ILIAS DI UIServices $ui
 
ILIAS COPage PageLinker $page_linker
 
string $abstract_pcid = ""
 
ilToolbarGUI $toolbar
 
string $open_place_holder = ""
 
int $requested_user_id = 0
 
int $requested_q_id = 0
 
int $requested_history_mode = 0
 
bool $enabled_news = false
 
int $news_obj_id = 0
 
string $news_obj_type = ""
 
array $tab_hook = null
 
string $view_page_link = ""
 
string $view_page_target = ""
 
string $offline_directory = ""
 
bool $notes_enabled = false
 
string $prependinghtml = ""
 
string $header = ""
 
string $int_link_return = ""
 
bool $enabled_href = true
 
int $adv_ref_id = null
 
string $adv_type = null
 
string $adv_subtype = null
 
string $concrete_lang = ""
 
string $profile_back_url = ""
 
ilComponentFactory $component_factory
 
ILIAS COPage Compare PageCompare $compare
 

Additional Inherited Members

- Data Fields inherited from ilPageObjectGUI
const PRESENTATION = "presentation"
 
const EDIT = "edit"
 
const PREVIEW = "preview"
 
const OFFLINE = "offline"
 
const PRINTING = "print"
 
string $page_back_title = ""
 
ilPageObject $obj
 
string $presentation_title = ""
 
string $target_script = ""
 
string $return_location = ""
 
string $target_var = ""
 
string $template_output_var = ""
 
bool $output2template = false
 
string $link_params = ""
 
string $sourcecode_download_script = ""
 
bool $activation = false
 
bool $activated = true
 
bool $editpreview = false
 
bool $use_meta_data = false
 
ilObject $meta_data_rep_obj = null
 
int $meta_data_sub_obj_id = 0
 
string $meta_data_type = ""
 
object $meta_data_observer_obj = null
 
string $meta_data_observer_func = ""
 
bool $link_xml_set = false
 
bool $enableediting = true
 
bool $rawpagecontent = false
 
bool $enabledcontentincludes = false
 
bool $compare_mode = false
 
ilPageConfig $page_config = null
 
bool $tabs_enabled = true
 
bool $render_page_container = false
 
string $pl_start = "{{{{{"
 
string $pl_end = "}}}}}"
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilWikiPageGUI::__construct ( int  $a_id = 0,
int  $a_old_nr = 0,
int  $a_wiki_ref_id = 0,
string  $lang = "-" 
)

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

References $DIC, $domain, ilPageObjectGUI\$gui, $service, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), ilPageObjectGUI\getPageObject(), ilObjStyleSheet\getSyntaxStylePath(), getWikiRefId(), ILIAS\FileDelivery\http(), ILIAS\Repository\settings(), and setWikiRefId().

52  {
53  global $DIC;
54 
55  $service = $DIC->wiki()->internal();
56  $domain = $service->domain();
57  $gui = $service->gui();
58 
59  $this->domain = $domain;
60  $this->settings = $domain->settings();
61  $this->http = $gui->http();
62 
63  // needed for notifications
64  $this->setWikiRefId($a_wiki_ref_id);
65  parent::__construct("wpg", $a_id, $a_old_nr, false, $lang);
66  $this->getPageObject()->setWikiRefId($this->getWikiRefId());
67  $this->ctrl->saveParameterByClass(self::class, "wpg_id");
68 
69  // content style
70  $this->tpl->addCss(ilObjStyleSheet::getSyntaxStylePath());
71  $this->wiki_request = $gui->request();
72  $this->notes = $DIC->notes();
73  $this->wiki_gui = $gui;
74  $this->ot = $gui->wiki()->translation($a_wiki_ref_id);
75  $this->wiki_pm = $this->domain->page()->page($this->getWikiRefId());
76  $this->exc_domain = $DIC->exercise()->internal()->domain();
77  }
ILIAS COPage InternalGUIService $gui
setWikiRefId(int $a_ref_id)
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:25
ILIAS Wiki InternalDomainService $domain
$service
Definition: ltiresult.php:36
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ activateWikiPageRating()

ilWikiPageGUI::activateWikiPageRating ( )

Rating /.

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

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

950  : void
951  {
952  $lng = $this->lng;
953  $ilCtrl = $this->ctrl;
954 
955  $this->getPageObject()->setRating(true);
956  $this->getPageObject()->update();
957 
958  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
959  $ilCtrl->redirect($this, "preview");
960  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
+ Here is the call graph for this function:

◆ addHeaderAction()

ilWikiPageGUI::addHeaderAction ( bool  $a_redraw = false)

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

References ilPageObjectGUI\$access, ilPageObjectGUI\$user, ilObjWiki\_lookupPublicNotes(), ilObjWiki\_lookupRatingOverall(), ANONYMOUS_USER_ID, ILIAS\Repository\ctrl(), ilUtil\getImagePath(), ilPageObjectGUI\getPageObject(), ilNotification\hasNotification(), ilNotification\hasOptOut(), ILIAS\Repository\lng(), ilObjectListGUI\prepareJsLinks(), ilCommonActionDispatcherGUI\TYPE_REPOSITORY, ilNotification\TYPE_WIKI, and ilNotification\TYPE_WIKI_PAGE.

Referenced by preview(), and redrawHeaderAction().

250  : string {
251  $ilUser = $this->user;
252  $ilAccess = $this->access;
253 
254  $wiki_id = $this->getPageObject()->getParentId();
255  $page_id = $this->getPageObject()->getId();
256 
257  $dispatcher = new ilCommonActionDispatcherGUI(
259  $ilAccess,
260  "wiki",
261  $this->requested_ref_id,
262  $wiki_id
263  );
264 
265  // see #33422
266  $dispatcher->setSubObject("wpg", $page_id);
267 
269  $this->ctrl->getLinkTarget($this, "redrawHeaderAction", "", true),
270  "",
271  $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "iltagginggui"), "", "", true, false)
272  );
273 
274  $lg = $dispatcher->initHeaderAction();
275  $lg->enableNotes(true);
276  $lg->enableComments(ilObjWiki::_lookupPublicNotes($wiki_id), false);
277 
278  // rating
279  if (ilObjWiki::_lookupRatingOverall($wiki_id)) {
280  $lg->enableRating(
281  true,
282  $this->lng->txt("wiki_rate_overall"),
283  false,
284  // so ilCtrl does not use the shortcut via ilWikiGUI
285  array("ilcommonactiondispatchergui", "ilratinggui"),
286  true
287  );
288  }
289 
290  // notification
291  if ($ilUser->getId() !== ANONYMOUS_USER_ID) {
292  if (ilNotification::hasNotification(ilNotification::TYPE_WIKI, $ilUser->getId(), $wiki_id)) {
293  $this->ctrl->setParameter($this, "ntf", 1);
294  if (ilNotification::hasOptOut($wiki_id)) {
295  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_deactivate_wiki");
296  }
297 
298  $lg->addHeaderIcon(
299  "not_icon",
300  ilUtil::getImagePath("object/notification_on.svg"),
301  $this->lng->txt("wiki_notification_activated")
302  );
303  } else {
304  $this->ctrl->setParameter($this, "ntf", 2);
305  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_activate_wiki");
306 
307  if (ilNotification::hasNotification(ilNotification::TYPE_WIKI_PAGE, $ilUser->getId(), $page_id)) {
308  $this->ctrl->setParameter($this, "ntf", 3);
309  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_deactivate_page");
310 
311  $lg->addHeaderIcon(
312  "not_icon",
313  ilUtil::getImagePath("object/notification_on.svg"),
314  $this->lng->txt("wiki_page_notification_activated")
315  );
316  } else {
317  $this->ctrl->setParameter($this, "ntf", 4);
318  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_activate_page");
319 
320  $lg->addHeaderIcon(
321  "not_icon",
322  ilUtil::getImagePath("object/notification_off.svg"),
323  $this->lng->txt("wiki_notification_deactivated")
324  );
325  }
326  }
327  $this->ctrl->setParameter($this, "ntf", "");
328  }
329 
330  if (!$a_redraw) {
331  $this->tpl->setHeaderActionMenu($lg->getHeaderAction());
332  } else {
333  // we need to add onload code manually (rating, comments, etc.)
334  return $lg->getHeaderAction() .
335  $this->tpl->getOnLoadCodeForAsynch();
336  }
337  return "";
338  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
static prepareJsLinks(string $redraw_url, string $notes_url, string $tags_url, ilGlobalTemplateInterface $tpl=null)
Insert js/ajax links into template.
ilAccessHandler $access
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static hasNotification(int $type, int $user_id, int $id)
Check notification status for object and user.
static _lookupRatingOverall(int $a_wiki_id)
Lookup whether rating is activated for whole object.
static _lookupPublicNotes(int $a_wiki_id)
Lookup whether public notes are activated.
Class ilCommonActionDispatcherGUI.
static hasOptOut(int $obj_id)
Is opt out (disable notification) allowed?
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addLanguageSelectionToToolbar()

ilWikiPageGUI::addLanguageSelectionToToolbar ( )
protected

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

References Vendor\Package\$f, ilPageObjectGUI\$language, ilPageObjectGUI\$toolbar, ilToolbarGUI\addComponent(), ILIAS\Repository\ctrl(), getCurrentLanguage(), ilPageObjectGUI\getId(), getLanguageLabelForCode(), and ILIAS\Repository\lng().

Referenced by initToolbar().

482  : void
483  {
485  $f = $this->wiki_gui->ui()->factory();
486 
487  $this->ctrl->setParameterByClass(self::class, "wpg_id", $this->getId());
488  $this->ctrl->setParameterByClass(self::class, "page", null);
489  if ($this->ot->getContentActivated()) {
490  $actions = [];
491  foreach ($this->ot->getLanguages() as $language) {
492  $lang_code = ($language->getLanguageCode() === $this->ot->getMasterLanguage())
493  ? "-"
494  : $language->getLanguageCode();
495  $exists = $this->wiki_pm->exists($this->getId(), $lang_code);
496  $this->ctrl->setParameterByClass(self::class, "transl", $lang_code);
497  $action = ($lang_code !== "-" && !$exists)
498  ? "switchToLanguage"
499  : "preview";
500  if ($action === "switchToLanguage") {
501  $this->ctrl->setParameterByClass(self::class, "transl", null);
502  $this->ctrl->setParameterByClass(self::class, "totransl", $lang_code);
503  }
504  $append = $exists
505  ? ""
506  : " (" . $this->lng->txt("wiki_not_existing") . ")";
507  if ($lang_code === $this->getCurrentLanguage()) {
508  continue;
509  }
510  $actions[] = $f->link()->standard(
511  $this->getLanguageLabelForCode($language->getLanguageCode()) . $append,
512  $this->ctrl->getLinkTargetByClass(self::class, $action)
513  );
514  }
515  $this->ctrl->setParameterByClass(self::class, "transl", $this->requested_transl);
516  $this->ctrl->setParameterByClass(self::class, "totransl", null);
517  if (count($actions) > 0) {
518  $dd = $f->dropdown()->standard($actions)
519  ->withLabel($this->getLanguageLabelForCode($this->getCurrentLanguage()));
520  $toolbar->addComponent($dd);
521  }
522  }
523  }
getLanguageLabelForCode(string $code)
addComponent(\ILIAS\UI\Component\Component $a_comp)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ blockWikiPage()

ilWikiPageGUI::blockWikiPage ( )

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

References ilPageObjectGUI\$ctrl, ilPageObjectGUI\$lng, ilWikiPerm\check(), ilPageObjectGUI\getPageObject(), and ilLanguage\txt().

834  : void
835  {
836  $ilCtrl = $this->ctrl;
837  $lng = $this->lng;
838 
839  if (ilWikiPerm::check("activate_wiki_protection", $this->requested_ref_id)) {
840  $this->getPageObject()->setBlocked(true);
841  $this->getPageObject()->update();
842 
843  $this->tpl->setOnScreenMessage('success', $lng->txt("wiki_page_blocked"), true);
844  }
845 
846  $ilCtrl->redirect($this, "preview");
847  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static check(string $a_perm, int $a_ref_id, string $a_cmd="")
+ Here is the call graph for this function:

◆ cancelWikiPageDeletion()

ilWikiPageGUI::cancelWikiPageDeletion ( )

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

References ilPageObjectGUI\$ctrl, and ilCtrl\redirect().

725  : void
726  {
727  $ilCtrl = $this->ctrl;
728 
729  $ilCtrl->redirect($this, "preview");
730  }
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
+ Here is the call graph for this function:

◆ checkLangPageAvailable()

ilWikiPageGUI::checkLangPageAvailable ( int  $id,
string  $lang 
)
protected

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

1390  : bool
1391  {
1392  return $this->wiki_pm->exists($id, $lang);
1393  }

◆ confirmPageTranslationCreation()

ilWikiPageGUI::confirmPageTranslationCreation ( )

Confirm page translation creation.

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

References ilPageObjectGUI\$form, $r, ILIAS\Repository\ctrl(), getTranslatePageFormAdapter(), and ILIAS\Repository\lng().

1319  : void
1320  {
1321  $this->tabs_gui->clearTargets();
1322  $this->tabs_gui->setBackTarget(
1323  $this->lng->txt("back"),
1324  $this->ctrl->getLinkTarget($this, "edit")
1325  );
1326 
1327  $l = $this->request->getString("totransl");
1328  $this->ctrl->setParameter($this, "totransl", $l);
1329  $this->lng->loadLanguageModule("meta");
1330 
1331  $r = $this->wiki_gui->ui()->renderer();
1332  $box = $this->wiki_gui->ui()->factory()->messageBox()->confirmation(
1333  $this->lng->txt("cont_page_translation_does_not_exist") . ": " .
1334  $this->lng->txt("meta_l_" . $l)
1335  );
1336 
1338 
1339  $content = $r->render($box) . $form->render();
1340 
1341  /*
1342  $cgui = new ilConfirmationGUI();
1343  $cgui->setFormAction($this->ctrl->getFormAction($this));
1344  $cgui->setHeaderText($this->lng->txt("cont_page_translation_does_not_exist") . ": " .
1345  $this->lng->txt("meta_l_" . $l));
1346  $cgui->setCancel($this->lng->txt("cancel"), "editMasterLanguage");
1347  $cgui->setConfirm($this->lng->txt("confirm"), "createPageTranslation");*/
1348  $this->tpl->setContent($content);
1349  }
ilPropertyFormGUI $form
$r
+ Here is the call graph for this function:

◆ confirmWikiPageDeletion()

ilWikiPageGUI::confirmWikiPageDeletion ( )

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

References ilPageObjectGUI\$ctrl, ilPageObjectGUI\$lng, ilWikiPerm\check(), ilPageObjectGUI\getPageObject(), and ilLanguage\txt().

732  : void
733  {
734  $ilCtrl = $this->ctrl;
735  $lng = $this->lng;
736  if (ilWikiPerm::check("delete_wiki_pages", $this->requested_ref_id)) {
737  $this->getPageObject()->delete();
738 
739  $this->tpl->setOnScreenMessage('success', $lng->txt("wiki_page_deleted"), true);
740  }
741 
742  $ilCtrl->redirectByClass("ilobjwikigui", "allPages");
743  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static check(string $a_perm, int $a_ref_id, string $a_cmd="")
+ Here is the call graph for this function:

◆ createPageTranslation()

ilWikiPageGUI::createPageTranslation ( )

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

References ilPageObjectGUI\$form, ILIAS\Repository\ctrl(), ilPageObjectGUI\getId(), ilPageObjectFactory\getInstance(), ilPageObjectGUI\getPageObject(), ilPageObjectGUI\getParentType(), getTranslatePageFormAdapter(), and getWikiRefId().

1359  : void
1360  {
1361  $l = $this->request->getString("totransl");
1362 
1364  //if ($form->isValid()) {
1365 
1366  $p = $this->domain->page()->getWikiPage(
1367  $this->getWikiRefId(),
1368  $this->getPageObject()->getId(),
1369  0,
1370  "-"
1371  );
1372 
1373  $p->copyPageToTranslation($l);
1374 
1376  $this->getPageObject()->getParentType(),
1377  $this->getPageObject()->getId(),
1378  0,
1379  $l
1380  );
1381  $p2->setWikiRefId($this->getWikiRefId());
1382  $p2->setTitle($form->getData("title"));
1383  $p2->update();
1384  $this->ctrl->setParameter($this, "transl", $l);
1385  //}
1386 
1387  $this->ctrl->redirect($this, "edit");
1388  }
ilPropertyFormGUI $form
static getInstance(string $a_parent_type, int $a_id=0, int $a_old_nr=0, string $a_lang="-")
Get page object instance.
+ Here is the call graph for this function:

◆ deactivateWikiPageRating()

ilWikiPageGUI::deactivateWikiPageRating ( )

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

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

962  : void
963  {
964  $lng = $this->lng;
965  $ilCtrl = $this->ctrl;
966 
967  $this->getPageObject()->setRating(false);
968  $this->getPageObject()->update();
969 
970  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
971  $ilCtrl->redirect($this, "preview");
972  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
+ Here is the call graph for this function:

◆ deleteWikiPageConfirmationScreen()

ilWikiPageGUI::deleteWikiPageConfirmationScreen ( )

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

References ilPageObjectGUI\$ctrl, ilPageObjectGUI\$lng, ilPageObjectGUI\$tpl, ilWikiPerm\check(), ilPageObjectGUI\getId(), ilWikiPage\getLinksToPage(), ilPageObjectGUI\getPageObject(), ILIAS\GlobalScreen\Scope\Footer\Factory\getTitle(), ilWikiPage\getWikiPageContributors(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

655  : void
656  {
657  $tpl = $this->tpl;
658  $ilCtrl = $this->ctrl;
659  $lng = $this->lng;
660 
661  if (ilWikiPerm::check("delete_wiki_pages", $this->requested_ref_id)) {
662  $confirmation_gui = new ilConfirmationGUI();
663  $confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
664  $confirmation_gui->setHeaderText($lng->txt("wiki_page_deletion_confirmation"));
665  $confirmation_gui->setCancel($lng->txt("cancel"), "cancelWikiPageDeletion");
666  $confirmation_gui->setConfirm($lng->txt("delete"), "confirmWikiPageDeletion");
667 
668  $dtpl = new ilTemplate(
669  "tpl.wiki_page_deletion_confirmation.html",
670  true,
671  true,
672  "components/ILIAS/Wiki"
673  );
674 
675  $dtpl->setVariable("PAGE_TITLE", $this->getWikiPage()->getTitle());
676 
677  // other pages that link to this page
678  $dtpl->setVariable("TXT_OTHER_PAGES", $lng->txt("wiki_other_pages_linking"));
680  $this->getWikiPage()->getWikiId(),
681  $this->getWikiPage()->getId()
682  );
683  if (count($pages) > 0) {
684  foreach ($pages as $page) {
685  $dtpl->setCurrentBlock("lpage");
686  $dtpl->setVariable("TXT_LINKING_PAGE", $page["title"]);
687  $dtpl->parseCurrentBlock();
688  }
689  } else {
690  $dtpl->setCurrentBlock("lpage");
691  $dtpl->setVariable("TXT_LINKING_PAGE", "-");
692  $dtpl->parseCurrentBlock();
693  }
694 
695  // contributors
696  $dtpl->setVariable("TXT_CONTRIBUTORS", $lng->txt("wiki_contributors"));
697  $contributors = ilWikiPage::getWikiPageContributors($this->getWikiPage()->getId());
698  foreach ($contributors as $contributor) {
699  $dtpl->setCurrentBlock("contributor");
700  $dtpl->setVariable(
701  "TXT_CONTRIBUTOR",
702  $contributor["lastname"] . ", " . $contributor["firstname"]
703  );
704  $dtpl->parseCurrentBlock();
705  }
706 
707  // notes/comments
708  $cnt_note_users = $this->notes->domain()->getUserCount(
709  $this->getPageObject()->getParentId(),
710  $this->getPageObject()->getId(),
711  "wpg"
712  );
713  $dtpl->setVariable(
714  "TXT_NUMBER_USERS_NOTES_OR_COMMENTS",
715  $lng->txt("wiki_number_users_notes_or_comments")
716  );
717  $dtpl->setVariable("TXT_NR_NOTES_COMMENTS", $cnt_note_users);
718 
719  $confirmation_gui->addItem("", "", $dtpl->get());
720 
721  $tpl->setContent($confirmation_gui->getHTML());
722  }
723  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static getLinksToPage(int $a_wiki_id, int $a_page_id, string $lang="-")
static getWikiPageContributors(int $a_page_id)
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
static check(string $a_perm, int $a_ref_id, string $a_cmd="")
+ Here is the call graph for this function:

◆ downloadExcSubFile()

ilWikiPageGUI::downloadExcSubFile ( )
protected

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

References $ass_id, ilPageObjectGUI\$user, ilObjUser\_lookupName(), and ilObject\_lookupTitle().

1277  : void
1278  {
1279  $ilUser = $this->user;
1280 
1281  $ass_id = $this->wiki_request->getAssignmentId();
1282  $ass = new ilExAssignment($ass_id);
1283 
1284  $sub_manager = $this->exc_domain->submission($ass_id);
1285  $sub = $sub_manager->getSubmissionsOfUser($ilUser->getId())->current();
1286  $team_id = $this->exc_domain->team()->getTeamForMember(
1287  $ass->getId(),
1288  $ilUser->getId()
1289  );
1290 
1291  if ($sub) {
1292  $user_data = ilObjUser::_lookupName($sub->getUserId());
1293  $title = ilObject::_lookupTitle($ass->getExerciseId()) . " - " .
1294  $ass->getTitle() . " (Team " . $team_id . ").zip";
1295 
1296  $sub_manager->deliverFile(
1297  $ilUser->getId(),
1298  $sub->getRid(),
1299  $title
1300  );
1301  }
1302  }
Exercise assignment.
static _lookupName(int $a_user_id)
lookup user name
static _lookupTitle(int $obj_id)
+ Here is the call graph for this function:

◆ edit()

ilWikiPageGUI::edit ( )

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

References ilPageObjectGUI\$lng, ilPageObjectGUI\$tpl, ILIAS\Repository\ctrl(), and ilPageObjectGUI\getId().

1123  : string
1124  {
1125  $tpl = $this->tpl;
1126  $lng = $this->lng;
1127  $this->ctrl->setParameterByClass(self::class, "wpg_id", $this->getId());
1128  self::initEditingJS($tpl);
1129 
1130  return parent::edit();
1131  }
ilGlobalTemplateInterface $tpl
+ Here is the call graph for this function:

◆ editAdvancedMetaData()

ilWikiPageGUI::editAdvancedMetaData ( ilPropertyFormGUI  $a_form = null)

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

References ilPageObjectGUI\$access, ilPageObjectGUI\$ctrl, ilPageObjectGUI\$lng, ilPageObjectGUI\$tabs_gui, ilPageObjectGUI\$tpl, initAdvancedMetaDataForm(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

Referenced by updateAdvancedMetaData().

1035  : void {
1036  $ilTabs = $this->tabs_gui;
1037  $lng = $this->lng;
1038  $ilCtrl = $this->ctrl;
1039  $tpl = $this->tpl;
1040  $ilAccess = $this->access;
1041 
1042  if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id) &&
1043  !$ilAccess->checkAccess("edit_page_meta", "", $this->wiki_ref_id)) {
1044  return;
1045  }
1046 
1047 
1048  $ilTabs->clearTargets();
1049  $ilTabs->setBackTarget(
1050  $lng->txt("back"),
1051  $ilCtrl->getLinkTarget($this, "preview")
1052  );
1053 
1054  if (!$a_form) {
1055  $a_form = $this->initAdvancedMetaDataForm();
1056  }
1057 
1058  $tpl->setContent($a_form->getHTML());
1059  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
ilAccessHandler $access
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilWikiPageGUI::executeCommand ( )
Exceptions
ilCtrlException

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

References ilPageObjectGUI\$access, ilPageObjectGUI\$ctrl, ilPageObjectGUI\$form, ilPageObjectGUI\$gui, ilPageObjectGUI\$lng, ilPageObjectGUI\$tabs_gui, ilPageObjectGUI\$tpl, ilPageObjectGUI\$user, ilObject\_lookupObjId(), ilObject\_lookupTitle(), ANONYMOUS_USER_ID, ILIAS\Repository\ctrl(), ilPageObjectGUI\getId(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), ilPageObjectGUI\getPageObject(), getTabs(), ILIAS\GlobalScreen\Scope\Footer\Factory\getTitle(), initAdvancedMetaDataForm(), preview(), ilGlobalTemplateInterface\setHeaderPageTitle(), ilNotification\setNotification(), ilPageObjectGUI\setPresentationTitle(), ilLanguage\txt(), ilNotification\TYPE_WIKI, and ilNotification\TYPE_WIKI_PAGE.

108  : string
109  {
110  $ilCtrl = $this->ctrl;
111  $ilTabs = $this->tabs_gui;
112  $ilUser = $this->user;
113  $ilAccess = $this->access;
114  $lng = $this->lng;
115  $tpl = $this->tpl;
116 
117  $next_class = $this->ctrl->getNextClass($this);
118 
119  $head_title = ilObject::_lookupTitle(ilObject::_lookupObjId($this->requested_ref_id)) .
120  ": " . $this->getWikiPage()->getTitle();
121  $tpl->setHeaderPageTitle($head_title);
122  // see #13804
123  //if ($this->wiki_request->getWikiPageId() > 0) {
124  PageContentProvider::setPermaLink($this->wiki_pm->getPermaLink(
125  $this->getPageObject()->getId(),
126  $this->getPageObject()->getLanguage()
127  ));
128  //} else {
129  // $tpl->setPermanentLink("wiki", $this->requested_ref_id);
130  //}
131 
132 
133  switch ($next_class) {
134  case "ilnotegui":
135  case "ilcommentgui":
136  $this->getTabs();
137  $ilTabs->setTabActive("pg");
138  return $this->preview();
139 
140  case "ilratinggui":
141  // for rating side block
142  $rating_gui = new ilRatingGUI();
143  $rating_gui->setObject(
144  $this->getPageObject()->getParentId(),
145  "wiki",
146  $this->getPageObject()->getId(),
147  "wpg"
148  );
149  $rating_gui->setUpdateCallback(array($this, "updateStatsRating"));
150  $this->ctrl->forwardCommand($rating_gui);
151  $ilCtrl->redirect($this, "preview");
152  break;
153 
154  case "ilcommonactiondispatchergui":
156  if (!is_null($gui)) {
157  $gui->enableCommentsSettings(false);
158  $gui->setRatingCallback(
159  $this,
160  "preview"
161  );
162  $this->ctrl->forwardCommand($gui);
163  }
164  break;
165 
166  case "ilwikistatgui":
167  if ($ilAccess->checkAccess("statistics_read", "", $this->wiki_ref_id)) {
168  $this->tabs_gui->clearTargets(); // see ilObjWikiGUI::getTabs()
169  $this->getTabs("statistics");
170 
171  $gui = new ilWikiStatGUI(
172  $this->getPageObject()->getParentId(),
173  $this->getPageObject()->getId()
174  );
175  $this->ctrl->forwardCommand($gui);
176  }
177  break;
178  case 'ilobjectmetadatagui':
179 
180  if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id)) {
181  $this->tpl->setOnScreenMessage('failure', $lng->txt("permission_denied"), true);
182  $ilCtrl->redirect($this, "preview");
183  }
184  return parent::executeCommand();
185 
186  case "ilpropertyformgui":
187  // only case is currently adv metadata internal link in info settings, see #24497
188  $form = $this->initAdvancedMetaDataForm();
189  $ilCtrl->forwardCommand($form);
190  break;
191 
192  default:
193 
194  if (strtolower($ilCtrl->getNextClass()) === "ilpageeditorgui") {
195  self::initEditingJS($this->tpl);
196  }
197 
198  if ($this->wiki_request->getNotification() > 0
199  && $ilUser->getId() !== ANONYMOUS_USER_ID) {
200  switch ($this->wiki_request->getNotification()) {
201  case 1:
202  ilNotification::setNotification(ilNotification::TYPE_WIKI, $ilUser->getId(), $this->getPageObject()->getParentId(), false);
203  break;
204 
205  case 2:
206  // remove all page notifications here?
207  ilNotification::setNotification(ilNotification::TYPE_WIKI, $ilUser->getId(), $this->getPageObject()->getParentId(), true);
208  break;
209 
210  case 3:
211  ilNotification::setNotification(ilNotification::TYPE_WIKI_PAGE, $ilUser->getId(), $this->getPageObject()->getId(), false);
212  break;
213 
214  case 4:
215  ilNotification::setNotification(ilNotification::TYPE_WIKI_PAGE, $ilUser->getId(), $this->getPageObject()->getId(), true);
216  break;
217  }
218  $ilCtrl->redirect($this, "preview");
219  }
220 
221  $this->setPresentationTitle($this->getWikiPage()->getTitle());
222  return parent::executeCommand();
223  }
224  return "";
225  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setHeaderPageTitle(string $a_title)
Sets the title of the page (for browser window).
Wiki statistics GUI class.
ILIAS COPage InternalGUIService $gui
static _lookupObjId(int $ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupTitle(int $obj_id)
static setNotification(int $type, int $user_id, int $id, bool $status=true)
Set notification status for object and user.
ilGlobalTemplateInterface $tpl
ilAccessHandler $access
setPresentationTitle(string $a_title="")
getTabs(string $a_activate="")
ilPropertyFormGUI $form
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 1263 of file class.ilWikiPageGUI.php.

References $ass_id, ilPageObjectGUI\$ctrl, ilPageObjectGUI\$lng, ilExAssignmentTypes\getInstance(), getWikiRefId(), ilLanguage\txt(), ilExAssignment\TYPE_WIKI_TEAM, and ILIAS\Repository\user().

1263  : void
1264  {
1265  $ilCtrl = $this->ctrl;
1266  $lng = $this->lng;
1267 
1269 
1270  $ass_id = $this->wiki_request->getAssignmentId();
1271  $wiki_ass->submitWiki($ass_id, $this->user->getId(), $this->getWikiRefId());
1272 
1273  $this->tpl->setOnScreenMessage('success', $lng->txt("wiki_finalized"), true);
1274  $ilCtrl->redirectByClass("ilObjWikiGUI", "gotoStartPage");
1275  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
+ Here is the call graph for this function:

◆ getCommentsHTMLExport()

ilWikiPageGUI::getCommentsHTMLExport ( )

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

References ilObjWiki\_lookupPublicNotes(), ilPageObjectGUI\getNotesHTML(), and ilPageObjectGUI\getPageObject().

1304  : string
1305  {
1306  return $this->getNotesHTML(
1307  $this->getPageObject(),
1308  false,
1309  ilObjWiki::_lookupPublicNotes($this->getPageObject()->getParentId()),
1310  false,
1311  null,
1312  true
1313  );
1314  }
getNotesHTML(object $a_content_object=null, bool $a_enable_private_notes=true, bool $a_enable_public_notes=false, bool $a_enable_notes_deletion=false, callable $a_callback=null, bool $export=false)
Get html for public and/or private notes.
static _lookupPublicNotes(int $a_wiki_id)
Lookup whether public notes are activated.
+ Here is the call graph for this function:

◆ getCurrentLanguage()

ilWikiPageGUI::getCurrentLanguage ( )
protected

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

References ilPageObjectGUI\getPageObject().

Referenced by addLanguageSelectionToToolbar(), and postOutputProcessing().

477  : string
478  {
479  return $this->getPageObject()->getLanguage();
480  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLanguageLabelForCode()

ilWikiPageGUI::getLanguageLabelForCode ( string  $code)
protected

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

References ILIAS\Repository\lng().

Referenced by addLanguageSelectionToToolbar().

525  : string
526  {
527  if ($code === "-") {
528  $code = $this->ot->getMasterLanguage();
529  }
530  return $this->lng->txt("language") . ": " . $this->lng->txt("meta_l_" . $code);
531  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPrintView()

ilWikiPageGUI::getPrintView ( )
protected

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

References $provider, ILIAS\Repository\ctrl(), getWikiRefId(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), and ILIAS\Repository\ui().

Referenced by initToolbar(), and printViewSelection().

534  {
535  $provider = new \ILIAS\Wiki\WikiPrintViewProviderGUI(
536  $this->lng,
537  $this->ctrl,
538  $this->getWikiPage()->getWikiRefId(),
539  []
540  );
541 
542  return new \ILIAS\Export\PrintProcessGUI(
543  $provider,
544  $this->http,
545  $this->ui,
546  $this->lng
547  );
548  }
$provider
Definition: ltitoken.php:80
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTabs()

ilWikiPageGUI::getTabs ( string  $a_activate = "")

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

References ilPageObjectGUI\$access, ilPageObjectGUI\$ctrl, ilPageObjectGUI\$tabs_gui, and ILIAS\Repository\ctrl().

Referenced by executeCommand().

626  : void {
627  $ilTabs = $this->tabs_gui;
628  $ilCtrl = $this->ctrl;
629  $ilAccess = $this->access;
630 
631  parent::getTabs($a_activate);
632 
633  if ($ilAccess->checkAccess("statistics_read", "", $this->requested_ref_id)) {
634  $ilTabs->addTarget(
635  "statistics",
636  $this->ctrl->getLinkTargetByClass(
637  array("ilwikipagegui", "ilwikistatgui"),
638  "initial"
639  ),
640  "",
641  "ilwikistatgui"
642  );
643  }
644 
645  $ilTabs->addTarget(
646  "wiki_what_links_here",
647  $this->ctrl->getLinkTargetByClass(
648  "ilwikipagegui",
649  "whatLinksHere"
650  ),
651  "whatLinksHere"
652  );
653  }
ilAccessHandler $access
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTranslatePageFormAdapter()

ilWikiPageGUI::getTranslatePageFormAdapter ( )
protected

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

References Vendor\Package\$f, and ILIAS\Repository\lng().

Referenced by confirmPageTranslationCreation(), and createPageTranslation().

1351  : \ILIAS\Repository\Form\FormAdapterGUI
1352  {
1353  $f = $this->wiki_gui->form(self::class, "createPageTranslation")
1354  ->text("title", $this->lng->txt("title"));
1355  //->required();
1356  return $f;
1357  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getWiki()

ilWikiPageGUI::getWiki ( )

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

References $wiki.

100  : ilObjWiki
101  {
102  return $this->wiki;
103  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ getWikiRefId()

ilWikiPageGUI::getWikiRefId ( )

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

References $wiki_ref_id.

Referenced by __construct(), createPageTranslation(), finalizeAssignment(), getPrintView(), increaseViewCount(), and observeNoteAction().

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

◆ hideAdvancedMetaData()

ilWikiPageGUI::hideAdvancedMetaData ( )

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

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

1087  : void
1088  {
1089  $ilCtrl = $this->ctrl;
1090  $lng = $this->lng;
1091  $ilAccess = $this->access;
1092 
1093  if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id) &&
1094  !$ilAccess->checkAccess("edit_page_meta", "", $this->wiki_ref_id)) {
1095  return;
1096  }
1097 
1098  $this->getPageObject()->hideAdvancedMetadata(true);
1099  $this->getPageObject()->update();
1100 
1101  $this->tpl->setOnScreenMessage('success', $lng->txt("settings_saved"), true);
1102  $ilCtrl->redirect($this, "preview");
1103  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilAccessHandler $access
+ Here is the call graph for this function:

◆ increaseViewCount()

ilWikiPageGUI::increaseViewCount ( )
protected

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

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

Referenced by preview().

550  : void
551  {
552  $ilUser = $this->user;
553 
554  $this->getWikiPage()->increaseViewCnt();
555 
556  // enable object statistics
558  "wiki",
559  $this->getWikiPage()->getWikiRefId(),
560  $this->getWikiPage()->getWikiId(),
561  $ilUser->getId()
562  );
563 
565  }
const EVENT_PAGE_READ
static _recordReadEvent(string $a_type, int $a_ref_id, int $obj_id, int $usr_id, bool $isCatchupWriteEvents=true, $a_ext_rc=null, $a_ext_time=null)
static handleEvent(int $a_event, ilWikiPage $a_page_obj, ?int $a_user_id=null, array $a_additional_data=null)
Handle wiki page event.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initAdvancedMetaDataForm()

ilWikiPageGUI::initAdvancedMetaDataForm ( )
protected

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

References ilPageObjectGUI\$ctrl, ilPageObjectGUI\$form, ilPageObjectGUI\$lng, ilPropertyFormGUI\addCommandButton(), ilAdvancedMDRecordGUI\MODE_EDITOR, ilFormGUI\setFormAction(), ilAdvancedMDRecordGUI\setPropertyForm(), ilPropertyFormGUI\setTitle(), and ilLanguage\txt().

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

1005  {
1006  $ilCtrl = $this->ctrl;
1007  $lng = $this->lng;
1008 
1009  $page = $this->getWikiPage();
1010 
1011  $form = new ilPropertyFormGUI();
1012  $form->setFormAction($ilCtrl->getFormAction($this, "updateAdvancedMetaData"));
1013 
1014  // :TODO:
1015  $form->setTitle($lng->txt("wiki_advmd_block_title") . ": " . $page->getTitle());
1016 
1017  $this->record_gui = new ilAdvancedMDRecordGUI(
1019  'wiki',
1020  $page->getWikiId(),
1021  'wpg',
1022  $page->getId()
1023  );
1024  $this->record_gui->setPropertyForm($form);
1025  $this->record_gui->parse();
1026 
1027  $form->addCommandButton("updateAdvancedMetaData", $lng->txt("save"));
1028  $form->addCommandButton("preview", $lng->txt("cancel"));
1029 
1030  return $form;
1031  }
setPropertyForm(ilPropertyFormGUI $form)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setFormAction(string $a_formaction)
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
ilPropertyFormGUI $form
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initEditingJS()

static ilWikiPageGUI::initEditingJS ( ilGlobalTemplateInterface  $a_tpl)
static

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

References $DIC, ilPageObjectGUI\$lng, ilGlobalTemplateInterface\addJavaScript(), ilGlobalTemplateInterface\addOnLoadCode(), and ilLanguage\txt().

1133  : void
1134  {
1135  global $DIC;
1136 
1137  $lng = $DIC->language();
1138 
1139  $a_tpl->addJavaScript("assets/js/WikiEdit.js");
1140  $a_tpl->addOnLoadCode("il.Wiki.Edit.txt.page_exists = '" . $lng->txt("wiki_page_exists") . "';");
1141  $a_tpl->addOnLoadCode("il.Wiki.Edit.txt.new_page = '" . $lng->txt("wiki_new_page") . "';");
1142  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
global $DIC
Definition: shib_login.php:25
addJavaScript(string $a_js_file, bool $a_add_version_parameter=true, int $a_batch=2)
Add a javascript file that should be included in the header.
addOnLoadCode(string $a_code, int $a_batch=2)
Add on load code.
+ Here is the call graph for this function:

◆ initRenameForm()

ilWikiPageGUI::initRenameForm ( )
protected

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

References ilPageObjectGUI\$ctrl, ilPageObjectGUI\$lng, ILIAS\Repository\form(), ilPageObjectGUI\getPageObject(), ILIAS\GlobalScreen\Scope\Footer\Factory\getTitle(), and ilLanguage\txt().

Referenced by renamePage(), and renameWikiPage().

886  : void
887  {
888  $lng = $this->lng;
889  $ilCtrl = $this->ctrl;
890 
891  $this->form = new ilPropertyFormGUI();
892 
893  // new name
894  $ti = new ilTextInputGUI($lng->txt("wiki_new_page_name"), "new_page_name");
895  $ti->setMaxLength(200);
896  $ti->setSize(50);
897  $ti->setValue($this->getPageObject()->getTitle());
898  $ti->setRequired(true);
899  $this->form->addItem($ti);
900 
901  $this->form->addCommandButton("renamePage", $lng->txt("wiki_rename"));
902  $this->form->addCommandButton("preview", $lng->txt("cancel"));
903 
904  $this->form->setTitle($lng->txt("wiki_rename_page"));
905  $this->form->setFormAction($ilCtrl->getFormAction($this));
906  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
form( $class_path, string $cmd, string $submit_caption="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initToolbar()

ilWikiPageGUI::initToolbar ( )
protected

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

References ilPageObjectGUI\$toolbar, ilToolbarGUI\addComponent(), addLanguageSelectionToToolbar(), ILIAS\Repository\ctrl(), and getPrintView().

Referenced by showPage().

462  : void
463  {
465 
467 
468  $print_view = $this->getPrintView();
469  $modal_elements = $print_view->getModalElements($this->ctrl->getLinkTarget(
470  $this,
471  "printViewSelection"
472  ));
473  $toolbar->addComponent($modal_elements->button);
474  $toolbar->addComponent($modal_elements->modal);
475  }
addComponent(\ILIAS\UI\Component\Component $a_comp)
+ 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 1148 of file class.ilWikiPageGUI.php.

References ilPageObjectGUI\$ctrl, ilPageObjectGUI\$form, ilPageObjectGUI\$lng, ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), exit, ilPropertyFormGUI\getHTML(), ILIAS\Repository\lng(), and ilLanguage\txt().

1148  : void
1149  {
1150  $lng = $this->lng;
1151  $ilCtrl = $this->ctrl;
1152 
1153  $form = new ilPropertyFormGUI();
1154  $form->addCommandButton("addWikiLink", $lng->txt("wiki_add_link"));
1155  $form->addCommandButton("searchWikiLink", $lng->txt("search"));
1156 
1157  // Target page
1158  $tp = new ilTextInputGUI($this->lng->txt("wiki_target_page"), "target_page");
1159  $tp->setSize(18);
1160  $tp->setRequired(true);
1161  $tp->setInfo("...");
1162  $tp->setDataSource($ilCtrl->getLinkTarget($this, "insertWikiLinkAC", "", true));
1163  $form->addItem($tp);
1164 
1165  // Link text
1166  $lt = new ilTextInputGUI($this->lng->txt("wiki_link_text"), "link_text");
1167  $lt->setSize(18);
1168  $form->addItem($lt);
1169 
1170  //$form->setTitle($lng->txt("wiki_link"));
1171 
1172  echo $form->getHTML();
1173  exit;
1174  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
ilPropertyFormGUI $form
+ Here is the call graph for this function:

◆ insertWikiLinkAC()

ilWikiPageGUI::insertWikiLinkAC ( )

Auto complete for insert wiki link.

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

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

1179  : void
1180  {
1181  $result = array();
1182 
1183  $term = $this->wiki_request->getTerm();
1184 
1185  // if page exists, make it first entry
1186  if (ilWikiPage::_wikiPageExists($this->getPageObject()->getParentId(), $term)) {
1187  $entry = new stdClass();
1188  $entry->value = $term;
1189  $entry->label = $term;
1190  $result[] = $entry;
1191  }
1192 
1193  $res = ilWikiPage::getPagesForSearch($this->getPageObject()->getParentId(), $term);
1194 
1195  $cnt = 0;
1196  foreach ($res as $r) {
1197  if ($result[0]->value == $r) {
1198  continue;
1199  }
1200  if ($cnt++ > 19) {
1201  continue;
1202  }
1203  $entry = new stdClass();
1204  $entry->value = $r;
1205  $entry->label = $r;
1206  $result[] = $entry;
1207  }
1208 
1209  echo json_encode($result, JSON_THROW_ON_ERROR);
1210  exit;
1211  }
$res
Definition: ltiservices.php:69
static getPagesForSearch(int $a_wiki_id, string $a_term)
static _wikiPageExists(int $a_wiki_id, string $a_title, string $lang="-")
$r
+ Here is the call graph for this function:

◆ observeNoteAction()

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

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

References $text, ilPageObjectGUI\getLanguage(), getWikiRefId(), and ilNotification\TYPE_WIKI_PAGE.

981  : void {
982  // #10040 - get note text
983  $note = $this->notes->domain()->getById($a_note_id);
984  $text = $note->getText();
985 
986  $noti = $this->wiki_gui->notification();
987  $noti->send("comment", ilNotification::TYPE_WIKI_PAGE, $this->getWikiRefId(), $a_page_id, $text, $this->getLanguage());
988  }
$text
Definition: xapiexit.php:21
+ Here is the call graph for this function:

◆ postOutputProcessing()

ilWikiPageGUI::postOutputProcessing ( string  $a_output)

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

References ilPageObjectGUI\$ctrl, getCurrentLanguage(), ilPageObjectGUI\getEnabledHref(), ilPageObjectGUI\getId(), ilPageObjectGUI\getOutputMode(), ilPageObjectGUI\getPageObject(), ilWikiUtil\makeUrlTitle(), and ilWikiUtil\replaceInternalLinks().

567  : string
568  {
569  $ilCtrl = $this->ctrl;
570 
571  $title = $this->getPageObject()->getTitle();
572  $ilCtrl->setParameterByClass(
573  "ilobjwikigui",
574  "from_page",
576  );
577  if ($this->getEnabledHref() && $this->getOutputMode() !== self::EDIT) {
579  $a_output,
580  $this->getWikiPage()->getWikiId(),
581  ($this->getOutputMode() === "offline"),
582  $this->getCurrentLanguage()
583  );
584  } else {
585  $output = $a_output;
586  }
587  $ilCtrl->setParameterByClass(
588  "ilobjwikigui",
589  "from_page",
590  $this->wiki_request->getFromPage()
591  );
592 
593 
594  // metadata in print view
595  if ($this->getOutputMode() === "print" && $this->wiki instanceof ilObjWiki) {
596  $mdgui = new ilObjectMetaDataGUI($this->wiki, "wpg", $this->getId());
597  $md = $mdgui->getKeyValueList();
598  if ($md !== "") {
599  $output = str_replace("<!--COPage-PageTop-->", "<p>" . $md . "</p>", $output);
600  }
601  }
602 
603 
604  return $output;
605  }
Class ilObjectMetaDataGUI.
static replaceInternalLinks(string $s, int $a_wiki_id, bool $a_offline=false, string $lang="-")
This one is based on Mediawiki Parser->replaceInternalLinks since we display images in another way...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static makeUrlTitle(string $a_par)
+ Here is the call graph for this function:

◆ preview()

ilWikiPageGUI::preview ( )

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

References ilPageObjectGUI\$access, ilPageObjectGUI\$ctrl, $ilSetting, ilPageObjectGUI\$lng, $settings, ilPageObjectGUI\$tpl, ilPageObjectGUI\$user, ilUserSearchCache\_getInstance(), ilObjWiki\_lookupPublicNotes(), addHeaderAction(), ilDatePresentation\formatDate(), ilUserUtil\getNamePresentation(), ilPageObjectGUI\getNotesHTML(), ilPageObjectGUI\getPageObject(), IL_CAL_DATETIME, increaseViewCount(), ilUserSearchCache\LAST_QUERY, ilPageObjectGUI\PRESENTATION, ilGlobalTemplateInterface\setLoginTargetPar(), ilPageObjectGUI\setOutputMode(), ilPageObjectGUI\setRenderPageContainer(), setSideBlock(), ilPageObjectGUI\showEditToolbar(), showPage(), and ilLanguage\txt().

Referenced by executeCommand().

346  : string
347  {
348  $ilCtrl = $this->ctrl;
349  $ilAccess = $this->access;
350  $lng = $this->lng;
351  $tpl = $this->tpl;
352  $ilUser = $this->user;
354  $append = "";
355  $message = "";
356 
357 
358  // block/unblock
359  if ($this->getPageObject()->getBlocked()) {
360  $this->tpl->setOnScreenMessage('info', $lng->txt("wiki_page_status_blocked"));
361  }
362 
363  $this->increaseViewCount();
364 
365  $this->addHeaderAction();
366 
367  // content
368  if (!in_array($ilCtrl->getNextClass(), ["ilnotegui", "ilcommentgui"])) {
369  $this->setSideBlock();
370  }
371 
372  $wtpl = new ilTemplate(
373  "tpl.wiki_page_view_main_column.html",
374  true,
375  true,
376  "components/ILIAS/Wiki"
377  );
378  $callback = array($this, "observeNoteAction");
379  // notes
380  if (!$ilSetting->get("disable_comments") &&
381  ilObjWiki::_lookupPublicNotes($this->getPageObject()->getParentId())) {
382  $may_delete = ($ilSetting->get("comments_del_tutor", '1') &&
383  $ilAccess->checkAccess("write", "", $this->requested_ref_id));
384  $wtpl->setVariable("NOTES", $this->getNotesHTML(
385  $this->getPageObject(),
386  true,
387  ilObjWiki::_lookupPublicNotes($this->getPageObject()->getParentId()),
388  $may_delete,
389  $callback
390  ));
391  }
392 
393 
394  // page content
396  $this->showEditToolbar();
397  $this->setRenderPageContainer(true);
398  $wtpl->setVariable("PAGE", $this->showPage());
399 
400  $tpl->setLoginTargetPar("wiki_" . $this->requested_ref_id . $append);
401 
402  // last edited info
403  $wtpl->setVariable(
404  "LAST_EDITED_INFO",
405  $lng->txt("wiki_last_edited") . ": " .
407  new ilDateTime($this->getPageObject()->getLastChange(), IL_CAL_DATETIME)
408  ) . ", " .
410  $this->getPageObject()->getLastChangeUser(),
411  false,
412  true,
413  $ilCtrl->getLinkTarget($this, "preview")
414  )
415  );
416 
417  $tpl->setLoginTargetPar("wiki_" . $this->requested_ref_id . $append);
418 
419  //highlighting
420  if ($this->wiki_request->getSearchString()) {
421  $cache = ilUserSearchCache::_getInstance($ilUser->getId());
422  $cache->switchSearchType(ilUserSearchCache::LAST_QUERY);
423  $search_string = $cache->getQuery();
424 
425  // advanced search?
426  if (is_array($search_string)) {
427  $search_string = $search_string["lom_content"];
428  }
429 
430  $p = new ilQueryParser($search_string);
431  $p->parse();
432 
433  $words = $p->getQuotedWords();
434  if (is_array($words)) {
435  foreach ($words as $w) {
436  ilTextHighlighterGUI::highlight("ilCOPageContent", $w, $tpl);
437  }
438  }
439  $this->fill_on_load_code = true;
440  }
441 
442  return $message . $wtpl->get();
443  }
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ilObjUser $user=null,)
const IL_CAL_DATETIME
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setOutputMode(string $a_mode=self::PRESENTATION)
static _getInstance(int $a_usr_id)
showEditToolbar()
Show edit toolbar.
setLoginTargetPar(string $a_val)
Set target parameter for login (public sector).
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link='', bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path='ilpublicuserprofilegui')
Default behaviour is:
setRenderPageContainer(bool $a_val)
ilGlobalTemplateInterface $tpl
ilAccessHandler $access
global $ilSetting
Definition: privfeed.php:32
getNotesHTML(object $a_content_object=null, bool $a_enable_private_notes=true, bool $a_enable_public_notes=false, bool $a_enable_notes_deletion=false, callable $a_callback=null, bool $export=false)
Get html for public and/or private notes.
static _lookupPublicNotes(int $a_wiki_id)
Lookup whether public notes are activated.
addHeaderAction(bool $a_redraw=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ printViewOrder()

ilWikiPageGUI::printViewOrder ( )

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

References printViewOrderList().

755  : void
756  {
757  $this->printViewOrderList();
758  }
+ Here is the call graph for this function:

◆ printViewOrderList()

ilWikiPageGUI::printViewOrderList ( )
protected

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

References ilPageObjectGUI\$tabs_gui, ILIAS\Repository\ctrl(), ilWikiPage\getAllWikiPages(), ilPageObjectGUI\getPageObject(), and ILIAS\Repository\lng().

Referenced by printViewOrder().

761  : void {
762  $ilTabs = $this->tabs_gui;
763 
764  $pg_ids = $all_pages = array();
765 
766  // coming from type selection
767  $ordering = $this->wiki_request->getPrintOrdering();
768  if (count($ordering) === 0) {
769  switch ($this->wiki_request->getSelectedPrintType()) {
770  case "wiki":
771  foreach ($this->wiki_pm->getWikiPages($this->getLanguage()) as $p) {
772  $pg_ids[] = $p->getId();
773  }
774  break;
775 
776  case "selection":
777  $pg_ids = $this->wiki_request->getWikiPageIds();
778  if (count($pg_ids) === 0) {
779  $pg_ids = [$this->wiki_request->getWikiPageId()];
780  }
781  if (count($pg_ids) > 1) {
782  break;
783  } else {
784  $wiki_page_id = array_pop($pg_ids);
785  }
786  $this->ctrl->setParameterByClass(
787  "ilObjWikiGUI",
788  "wpg_id",
789  $wiki_page_id
790  );
791  $this->ctrl->redirectByClass("ilObjWikiGUI", "printView");
792  break;
793 
794  default:
795  $this->ctrl->setParameterByClass(
796  "ilObjWikiGUI",
797  "wpg_id",
798  $this->wiki_request->getWikiPageId()
799  );
800  $this->ctrl->redirectByClass("ilObjWikiGUI", "printView");
801  break;
802  }
803  }
804  // refresh sorting
805  else {
806  asort($ordering);
807  $pg_ids = array_keys($ordering);
808  }
809 
810  $ilTabs->clearTargets();
811  $ilTabs->setBackTarget(
812  $this->lng->txt("back"),
813  $this->ctrl->getLinkTarget($this, "preview")
814  );
815 
816  if (!count($all_pages)) {
817  $all_pages = ilWikiPage::getAllWikiPages($this->getPageObject()->getWikiId());
818  }
819 
820  $tbl = new ilWikiExportOrderTableGUI(
821  $this,
822  "printViewOrderList",
823  $all_pages,
824  $pg_ids
825  );
826  $this->tpl->setContent($tbl->getHTML());
827  }
static getAllWikiPages(int $a_wiki_id, string $lang="-")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ printViewSelection()

ilWikiPageGUI::printViewSelection ( )

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

References getPrintView().

749  : void
750  {
751  $view = $this->getPrintView();
752  $view->sendForm();
753  }
+ Here is the call graph for this function:

◆ redrawHeaderAction()

ilWikiPageGUI::redrawHeaderAction ( )

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

References addHeaderAction(), and exit.

340  : void
341  {
342  echo $this->addHeaderAction(true);
343  exit;
344  }
addHeaderAction(bool $a_redraw=false)
+ Here is the call graph for this function:

◆ renamePage()

ilWikiPageGUI::renamePage ( )

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

References ilPageObjectGUI\$access, ilPageObjectGUI\$ctrl, ilPageObjectGUI\$lng, ilPageObjectGUI\$tpl, ILIAS\Repository\form(), ilPageObjectGUI\getId(), ilPageObjectGUI\getLanguage(), ilWikiPage\getPageIdForTitle(), ilPageObjectGUI\getPageObject(), initRenameForm(), ilWikiUtil\makeDbTitle(), ilWikiUtil\makeUrlTitle(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

908  : void
909  {
910  $tpl = $this->tpl;
911  $lng = $this->lng;
912  $ilCtrl = $this->ctrl;
913  $ilAccess = $this->access;
914 
915  $this->initRenameForm();
916  if ($this->form->checkInput()) {
917  if (($ilAccess->checkAccess("edit_content", "", $this->requested_ref_id) && !$this->getPageObject()->getBlocked())
918  || $ilAccess->checkAccess("write", "", $this->requested_ref_id)) {
919  $new_name = $this->form->getInput("new_page_name");
920 
921  $page_title = ilWikiUtil::makeDbTitle($new_name);
923  $this->getPageObject()->getWikiId(),
924  $page_title,
925  $this->getPageObject()->getLanguage()
926  );
927 
928  // we might get the same page id back here, if the page
929  // name only differs in diacritics
930  // see bug http://www.ilias.de/mantis/view.php?id=11226
931  if ($pg_id > 0 && $pg_id != $this->getPageObject()->getId()) {
932  $this->tpl->setOnScreenMessage('failure', $lng->txt("wiki_page_already_exists"));
933  } else {
934  $new_name = $this->getPageObject()->rename($new_name);
935  $ilCtrl->setParameterByClass("ilobjwikigui", "page", ilWikiUtil::makeUrlTitle($new_name));
936  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
937  $ilCtrl->redirect($this, "preview");
938  }
939  }
940  }
941 
942  $this->form->setValuesByPost();
943  $tpl->setContent($this->form->getHTML());
944  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
ilAccessHandler $access
static makeUrlTitle(string $a_par)
form( $class_path, string $cmd, string $submit_caption="")
static makeDbTitle(string $a_par)
static getPageIdForTitle(int $a_wiki_id, string $a_title, string $lang="-")
Get wiki page object for id and title.
+ Here is the call graph for this function:

◆ renameWikiPage()

ilWikiPageGUI::renameWikiPage ( )

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

References ilPageObjectGUI\$access, ilPageObjectGUI\$tpl, ILIAS\Repository\ctrl(), ILIAS\Repository\form(), ilPageObjectGUI\getPageObject(), initRenameForm(), and ilGlobalTemplateInterface\setContent().

869  : void
870  {
871  $ilAccess = $this->access;
872  $tpl = $this->tpl;
873 
874  if (($ilAccess->checkAccess(
875  "edit_content",
876  "",
877  $this->requested_ref_id
878  ) && !$this->getPageObject()->getBlocked())
879  || $ilAccess->checkAccess("write", "", $this->requested_ref_id)) {
880  $this->ctrl->setParameterByClass(ilWikiPageGUI::class, "wpg_id", $this->wiki_request->getWikiPageId());
881  $this->initRenameForm();
882  $tpl->setContent($this->form->getHTML());
883  }
884  }
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
ilAccessHandler $access
form( $class_path, string $cmd, string $submit_caption="")
+ Here is the call graph for this function:

◆ searchWikiLinkAC()

ilWikiPageGUI::searchWikiLinkAC ( )

Search wiki link list.

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

References Vendor\Package\$f, ilPageObjectGUI\$lng, ilPageObjectGUI\$tpl, ilObjWiki\_performSearch(), exit, ilGlobalTemplateInterface\get(), ilPageObjectGUI\getPageObject(), ilLanguage\loadLanguageModule(), ilWikiPage\lookupTitle(), ilGlobalTemplateInterface\parseCurrentBlock(), ilGlobalTemplateInterface\setCurrentBlock(), ilGlobalTemplateInterface\setVariable(), ilArrayUtil\sortArray(), and ilLanguage\txt().

1216  : void
1217  {
1218  $lng = $this->lng;
1219 
1220  $lng->loadLanguageModule("wiki");
1221 
1222  $tpl = new ilTemplate("tpl.wiki_ac_search_result.html", true, true, "components/ILIAS/Wiki");
1223  $term = $this->wiki_request->getTerm();
1224 
1225  $pages = ilObjWiki::_performSearch($this->getPageObject()->getParentId(), $term);
1226 
1227  $found = array();
1228  foreach ($pages as $page) {
1229  $found[] = array("page_id" => $page["page_id"], "title" => ilWikiPage::lookupTitle($page["page_id"]));
1230  }
1231 
1232  // sort if all pages are listed
1233  if ($term === "") {
1234  $found = ilArrayUtil::sortArray($found, "title", "asc");
1235  }
1236 
1237  foreach ($found as $f) {
1238  $tpl->setCurrentBlock("item");
1239  $tpl->setVariable("WIKI_TITLE", $f["title"]);
1241  }
1242 
1243  if (count($pages) === 0) {
1244  $tpl->setVariable("INFOTEXT", str_replace("$1", $term, $lng->txt("wiki_no_page_found")));
1245  } elseif ($term === '') {
1246  $tpl->setVariable("INFOTEXT", $lng->txt("wiki_no_search_term"));
1247  } else {
1248  $tpl->setVariable("INFOTEXT", str_replace("$1", $term, $lng->txt("wiki_pages_found")));
1249  }
1250 
1251  $tpl->setVariable("TXT_BACK", $lng->txt("back"));
1252  echo $tpl->get();
1253  exit;
1254  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static lookupTitle(int $a_page_id, string $lang="-")
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
static _performSearch(int $a_wiki_id, string $a_searchterm)
Search in Wiki.
loadLanguageModule(string $a_module)
Load language module.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
ilGlobalTemplateInterface $tpl
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
+ Here is the call graph for this function:

◆ setScreenIdComponent()

ilWikiPageGUI::setScreenIdComponent ( )

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

References ilPageObjectGUI\$help, and ilHelpGUI\setScreenIdComponent().

79  : void
80  {
81  $ilHelp = $this->help;
82  $ilHelp->setScreenIdComponent("copgwpg");
83  }
setScreenIdComponent(string $a_comp)
+ Here is the call graph for this function:

◆ setSideBlock()

ilWikiPageGUI::setSideBlock ( )

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

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

Referenced by preview().

239  : void
240  {
242  $this->getWikiPage()->getId(),
243  $this->wiki_ref_id,
244  $this->getWikiPage()
245  );
246  }
static renderSideBlock(int $a_wpg_id, int $a_wiki_ref_id, ?ilWikiPage $a_wp=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setWiki()

ilWikiPageGUI::setWiki ( ilObjWiki  $a_val)

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

95  : void
96  {
97  $this->wiki = $a_val;
98  }

◆ setWikiPage()

ilWikiPageGUI::setWikiPage ( ilWikiPage  $a_wikipage)

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

References ilPageObjectGUI\getPageObject(), and ilPageObjectGUI\setPageObject().

227  : void
228  {
229  $this->setPageObject($a_wikipage);
230  }
setPageObject(ilPageObject $a_pg_obj)
+ Here is the call graph for this function:

◆ setWikiRefId()

ilWikiPageGUI::setWikiRefId ( int  $a_ref_id)

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

Referenced by __construct().

85  : void
86  {
87  $this->wiki_ref_id = $a_ref_id;
88  }
+ Here is the caller graph for this function:

◆ showPage()

ilWikiPageGUI::showPage ( )

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

References ilPageObjectGUI\getAbstractOnly(), ilPageObjectGUI\getOutputMode(), ILIAS\GlobalScreen\Scope\Footer\Factory\getTitle(), initToolbar(), ilPageObjectGUI\PRESENTATION, ilPageObjectGUI\setPresentationTitle(), and ilPageObjectGUI\setTemplateOutput().

Referenced by preview().

445  : string
446  {
447  if ($this->getOutputMode() === ilPageObjectGUI::PRESENTATION && !$this->getAbstractOnly()) {
448  $this->initToolbar();
449  }
450  $this->setTemplateOutput(false);
451 
452  if (!$this->getAbstractOnly()) {
453  $this->setPresentationTitle($this->getWikiPage()->getTitle());
454 
455  // wiki stats clean up
456  // $this->increaseViewCount();
457  }
458 
459  return parent::showPage();
460  }
setTemplateOutput(bool $a_output=true)
setPresentationTitle(string $a_title="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unblockWikiPage()

ilWikiPageGUI::unblockWikiPage ( )

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

References ilPageObjectGUI\$ctrl, ilPageObjectGUI\$lng, ilWikiPerm\check(), ilPageObjectGUI\getPageObject(), and ilLanguage\txt().

849  : void
850  {
851  $ilCtrl = $this->ctrl;
852  $lng = $this->lng;
853 
854  if (ilWikiPerm::check("activate_wiki_protection", $this->requested_ref_id)) {
855  $this->getPageObject()->setBlocked(false);
856  $this->getPageObject()->update();
857 
858  $this->tpl->setOnScreenMessage('success', $lng->txt("wiki_page_unblocked"), true);
859  }
860 
861  $ilCtrl->redirect($this, "preview");
862  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static check(string $a_perm, int $a_ref_id, string $a_cmd="")
+ Here is the call graph for this function:

◆ unhideAdvancedMetaData()

ilWikiPageGUI::unhideAdvancedMetaData ( )

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

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

1105  : void
1106  {
1107  $ilCtrl = $this->ctrl;
1108  $lng = $this->lng;
1109  $ilAccess = $this->access;
1110 
1111  if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id) &&
1112  !$ilAccess->checkAccess("edit_page_meta", "", $this->wiki_ref_id)) {
1113  return;
1114  }
1115 
1116  $this->getPageObject()->hideAdvancedMetadata(false);
1117  $this->getPageObject()->update();
1118 
1119  $this->tpl->setOnScreenMessage('success', $lng->txt("settings_saved"), true);
1120  $ilCtrl->redirect($this, "preview");
1121  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilAccessHandler $access
+ Here is the call graph for this function:

◆ updateAdvancedMetaData()

ilWikiPageGUI::updateAdvancedMetaData ( )

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

References ilPageObjectGUI\$access, ilPageObjectGUI\$ctrl, ilPageObjectGUI\$form, ilPageObjectGUI\$lng, ilPropertyFormGUI\checkInput(), editAdvancedMetaData(), initAdvancedMetaDataForm(), and ilLanguage\txt().

1061  : void
1062  {
1063  $ilCtrl = $this->ctrl;
1064  $lng = $this->lng;
1065  $ilAccess = $this->access;
1066 
1067  if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id) &&
1068  !$ilAccess->checkAccess("edit_page_meta", "", $this->wiki_ref_id)) {
1069  return;
1070  }
1071 
1072  $form = $this->initAdvancedMetaDataForm();
1073 
1074  // needed for proper advanced MD validation
1075  $form->checkInput();
1076  if (!$this->record_gui->importEditFormPostValues()) {
1077  $this->editAdvancedMetaData($form); // #16470
1078  return;
1079  }
1080 
1081  if ($this->record_gui->writeEditForm()) {
1082  $this->tpl->setOnScreenMessage('success', $lng->txt("settings_saved"), true);
1083  }
1084  $ilCtrl->redirect($this, "preview");
1085  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilAccessHandler $access
editAdvancedMetaData(ilPropertyFormGUI $a_form=null)
ilPropertyFormGUI $form
+ Here is the call graph for this function:

◆ updateStatsRating()

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

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

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

995  : void {
997  }
const EVENT_PAGE_RATING
static handleEvent(int $a_event, ilWikiPage $a_page_obj, ?int $a_user_id=null, array $a_additional_data=null)
Handle wiki page event.
+ Here is the call graph for this function:

◆ whatLinksHere()

ilWikiPageGUI::whatLinksHere ( )

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

References ilPageObjectGUI\$tpl, ilPageObjectGUI\getId(), IL_WIKI_WHAT_LINKS_HERE, and ilGlobalTemplateInterface\setContent().

607  : void
608  {
609  $tpl = $this->tpl;
610 
611  //$this->setSideBlock();
612  $table_gui = new ilWikiPagesTableGUI(
613  $this,
614  "whatLinksHere",
615  $this->getWikiPage()->getWikiId(),
617  $this->getId(),
618  $this->wiki_request->getTranslation()
619  );
620 
621  $tpl->setContent($table_gui->getHTML());
622  }
TableGUI class for wiki pages table.
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
const IL_WIKI_WHAT_LINKS_HERE
+ Here is the call graph for this function:

Field Documentation

◆ $domain

ILIAS Wiki InternalDomainService ilWikiPageGUI::$domain
protected

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

Referenced by __construct().

◆ $exc_domain

ILIAS Exercise InternalDomainService ilWikiPageGUI::$exc_domain
protected

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

◆ $fill_on_load_code

bool ilWikiPageGUI::$fill_on_load_code = false
protected

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

◆ $http

ILIAS HTTP Services ilWikiPageGUI::$http
protected

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

◆ $notes

ILIAS Notes Service ilWikiPageGUI::$notes
protected

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

◆ $ot

ilObjectTranslation ilWikiPageGUI::$ot
protected

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

◆ $record_gui

ilAdvancedMDRecordGUI ilWikiPageGUI::$record_gui = null
protected

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

◆ $settings

ilSetting ilWikiPageGUI::$settings
protected

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

Referenced by preview().

◆ $wiki

ilObjWiki ilWikiPageGUI::$wiki
protected

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

Referenced by getWiki().

◆ $wiki_gui

ILIAS Wiki InternalGUIService ilWikiPageGUI::$wiki_gui
protected

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

◆ $wiki_pm

ILIAS Wiki Page PageManager ilWikiPageGUI::$wiki_pm
protected

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

◆ $wiki_ref_id

int ilWikiPageGUI::$wiki_ref_id = 0
protected

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

Referenced by getWikiRefId().

◆ $wiki_request

ILIAS Wiki WikiGUIRequest ilWikiPageGUI::$wiki_request
protected

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


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