ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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)
 
 enableChangeComments (bool $a_enabled)
 
 isEnabledChangeComments ()
 
 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 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 QuestionInfoService $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 $change_comments = false
 
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 46 of file class.ilWikiPageGUI.php.

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

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

Member Function Documentation

◆ activateWikiPageRating()

ilWikiPageGUI::activateWikiPageRating ( )

Rating /.

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

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

949  : void
950  {
951  $lng = $this->lng;
952  $ilCtrl = $this->ctrl;
953 
954  $this->getPageObject()->setRating(true);
955  $this->getPageObject()->update();
956 
957  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
958  $ilCtrl->redirect($this, "preview");
959  }
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 246 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().

248  : string {
249  $ilUser = $this->user;
250  $ilAccess = $this->access;
251 
252  $wiki_id = $this->getPageObject()->getParentId();
253  $page_id = $this->getPageObject()->getId();
254 
255  $dispatcher = new ilCommonActionDispatcherGUI(
257  $ilAccess,
258  "wiki",
259  $this->requested_ref_id,
260  $wiki_id
261  );
262 
263  // see #33422
264  $dispatcher->setSubObject("wpg", $page_id);
265 
267  $this->ctrl->getLinkTarget($this, "redrawHeaderAction", "", true),
268  "",
269  $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "iltagginggui"), "", "", true, false)
270  );
271 
272  $lg = $dispatcher->initHeaderAction();
273  $lg->enableNotes(true);
274  $lg->enableComments(ilObjWiki::_lookupPublicNotes($wiki_id), false);
275 
276  // rating
277  if (ilObjWiki::_lookupRatingOverall($wiki_id)) {
278  $lg->enableRating(
279  true,
280  $this->lng->txt("wiki_rate_overall"),
281  false,
282  // so ilCtrl does not use the shortcut via ilWikiGUI
283  array("ilcommonactiondispatchergui", "ilratinggui"),
284  true
285  );
286  }
287 
288  // notification
289  if ($ilUser->getId() !== ANONYMOUS_USER_ID) {
290  if (ilNotification::hasNotification(ilNotification::TYPE_WIKI, $ilUser->getId(), $wiki_id)) {
291  $this->ctrl->setParameter($this, "ntf", 1);
292  if (ilNotification::hasOptOut($wiki_id)) {
293  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_deactivate_wiki");
294  }
295 
296  $lg->addHeaderIcon(
297  "not_icon",
298  ilUtil::getImagePath("object/notification_on.svg"),
299  $this->lng->txt("wiki_notification_activated")
300  );
301  } else {
302  $this->ctrl->setParameter($this, "ntf", 2);
303  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_activate_wiki");
304 
305  if (ilNotification::hasNotification(ilNotification::TYPE_WIKI_PAGE, $ilUser->getId(), $page_id)) {
306  $this->ctrl->setParameter($this, "ntf", 3);
307  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_deactivate_page");
308 
309  $lg->addHeaderIcon(
310  "not_icon",
311  ilUtil::getImagePath("object/notification_on.svg"),
312  $this->lng->txt("wiki_page_notification_activated")
313  );
314  } else {
315  $this->ctrl->setParameter($this, "ntf", 4);
316  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_activate_page");
317 
318  $lg->addHeaderIcon(
319  "not_icon",
320  ilUtil::getImagePath("object/notification_off.svg"),
321  $this->lng->txt("wiki_notification_deactivated")
322  );
323  }
324  }
325  $this->ctrl->setParameter($this, "ntf", "");
326  }
327 
328  if (!$a_redraw) {
329  $this->tpl->setHeaderActionMenu($lg->getHeaderAction());
330  } else {
331  // we need to add onload code manually (rating, comments, etc.)
332  return $lg->getHeaderAction() .
333  $this->tpl->getOnLoadCodeForAsynch();
334  }
335  return "";
336  }
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.
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
ilAccessHandler $access
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.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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 481 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().

481  : void
482  {
484  $f = $this->wiki_gui->ui()->factory();
485 
486  $this->ctrl->setParameterByClass(self::class, "wpg_id", $this->getId());
487  $this->ctrl->setParameterByClass(self::class, "page", null);
488  if ($this->ot->getContentActivated()) {
489  $actions = [];
490  foreach ($this->ot->getLanguages() as $language) {
491  $lang_code = ($language->getLanguageCode() === $this->ot->getMasterLanguage())
492  ? "-"
493  : $language->getLanguageCode();
494  $exists = $this->wiki_pm->exists($this->getId(), $lang_code);
495  $this->ctrl->setParameterByClass(self::class, "transl", $lang_code);
496  $action = ($lang_code !== "-" && !$exists)
497  ? "switchToLanguage"
498  : "preview";
499  if ($action === "switchToLanguage") {
500  $this->ctrl->setParameterByClass(self::class, "transl", null);
501  $this->ctrl->setParameterByClass(self::class, "totransl", $lang_code);
502  }
503  $append = $exists
504  ? ""
505  : " (" . $this->lng->txt("wiki_not_existing") . ")";
506  if ($lang_code === $this->getCurrentLanguage()) {
507  continue;
508  }
509  $actions[] = $f->link()->standard(
510  $this->getLanguageLabelForCode($language->getLanguageCode()) . $append,
511  $this->ctrl->getLinkTargetByClass(self::class, $action)
512  );
513  }
514  $this->ctrl->setParameterByClass(self::class, "transl", $this->requested_transl);
515  $this->ctrl->setParameterByClass(self::class, "totransl", null);
516  if (count($actions) > 0) {
517  $dd = $f->dropdown()->standard($actions)
518  ->withLabel($this->getLanguageLabelForCode($this->getCurrentLanguage()));
519  $toolbar->addComponent($dd);
520  }
521  }
522  }
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 833 of file class.ilWikiPageGUI.php.

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

833  : void
834  {
835  $ilCtrl = $this->ctrl;
836  $lng = $this->lng;
837 
838  if (ilWikiPerm::check("activate_wiki_protection", $this->requested_ref_id)) {
839  $this->getPageObject()->setBlocked(true);
840  $this->getPageObject()->update();
841 
842  $this->tpl->setOnScreenMessage('success', $lng->txt("wiki_page_blocked"), true);
843  }
844 
845  $ilCtrl->redirect($this, "preview");
846  }
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 724 of file class.ilWikiPageGUI.php.

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

724  : void
725  {
726  $ilCtrl = $this->ctrl;
727 
728  $ilCtrl->redirect($this, "preview");
729  }
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 1381 of file class.ilWikiPageGUI.php.

1381  : bool
1382  {
1383  return $this->wiki_pm->exists($id, $lang);
1384  }
$lang
Definition: xapiexit.php:26

◆ confirmPageTranslationCreation()

ilWikiPageGUI::confirmPageTranslationCreation ( )

Confirm page translation creation.

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

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

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

◆ confirmWikiPageDeletion()

ilWikiPageGUI::confirmWikiPageDeletion ( )

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

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

731  : void
732  {
733  $ilCtrl = $this->ctrl;
734  $lng = $this->lng;
735  if (ilWikiPerm::check("delete_wiki_pages", $this->requested_ref_id)) {
736  $this->getPageObject()->delete();
737 
738  $this->tpl->setOnScreenMessage('success', $lng->txt("wiki_page_deleted"), true);
739  }
740 
741  $ilCtrl->redirectByClass("ilobjwikigui", "allPages");
742  }
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 1350 of file class.ilWikiPageGUI.php.

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

1350  : void
1351  {
1352  $l = $this->request->getString("totransl");
1353 
1355  //if ($form->isValid()) {
1356 
1357  $p = $this->domain->page()->getWikiPage(
1358  $this->getWikiRefId(),
1359  $this->getPageObject()->getId(),
1360  0,
1361  "-"
1362  );
1363 
1364  $p->copyPageToTranslation($l);
1365 
1367  $this->getPageObject()->getParentType(),
1368  $this->getPageObject()->getId(),
1369  0,
1370  $l
1371  );
1372  $p2->setWikiRefId($this->getWikiRefId());
1373  $p2->setTitle($form->getData("title"));
1374  $p2->update();
1375  $this->ctrl->setParameter($this, "transl", $l);
1376  //}
1377 
1378  $this->ctrl->redirect($this, "edit");
1379  }
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 961 of file class.ilWikiPageGUI.php.

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

961  : void
962  {
963  $lng = $this->lng;
964  $ilCtrl = $this->ctrl;
965 
966  $this->getPageObject()->setRating(false);
967  $this->getPageObject()->update();
968 
969  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
970  $ilCtrl->redirect($this, "preview");
971  }
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 654 of file class.ilWikiPageGUI.php.

References ilPageObjectGUI\$ctrl, ilPageObjectGUI\$lng, ilPageObjectGUI\$tpl, ilWikiPerm\check(), ilPageObjectGUI\getId(), ilWikiPage\getLinksToPage(), ilPageObjectGUI\getPageObject(), ilWikiPage\getWikiPageContributors(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

654  : void
655  {
656  $tpl = $this->tpl;
657  $ilCtrl = $this->ctrl;
658  $lng = $this->lng;
659 
660  if (ilWikiPerm::check("delete_wiki_pages", $this->requested_ref_id)) {
661  $confirmation_gui = new ilConfirmationGUI();
662  $confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
663  $confirmation_gui->setHeaderText($lng->txt("wiki_page_deletion_confirmation"));
664  $confirmation_gui->setCancel($lng->txt("cancel"), "cancelWikiPageDeletion");
665  $confirmation_gui->setConfirm($lng->txt("delete"), "confirmWikiPageDeletion");
666 
667  $dtpl = new ilTemplate(
668  "tpl.wiki_page_deletion_confirmation.html",
669  true,
670  true,
671  "Modules/Wiki"
672  );
673 
674  $dtpl->setVariable("PAGE_TITLE", $this->getWikiPage()->getTitle());
675 
676  // other pages that link to this page
677  $dtpl->setVariable("TXT_OTHER_PAGES", $lng->txt("wiki_other_pages_linking"));
679  $this->getWikiPage()->getWikiId(),
680  $this->getWikiPage()->getId()
681  );
682  if (count($pages) > 0) {
683  foreach ($pages as $page) {
684  $dtpl->setCurrentBlock("lpage");
685  $dtpl->setVariable("TXT_LINKING_PAGE", $page["title"]);
686  $dtpl->parseCurrentBlock();
687  }
688  } else {
689  $dtpl->setCurrentBlock("lpage");
690  $dtpl->setVariable("TXT_LINKING_PAGE", "-");
691  $dtpl->parseCurrentBlock();
692  }
693 
694  // contributors
695  $dtpl->setVariable("TXT_CONTRIBUTORS", $lng->txt("wiki_contributors"));
696  $contributors = ilWikiPage::getWikiPageContributors($this->getWikiPage()->getId());
697  foreach ($contributors as $contributor) {
698  $dtpl->setCurrentBlock("contributor");
699  $dtpl->setVariable(
700  "TXT_CONTRIBUTOR",
701  $contributor["lastname"] . ", " . $contributor["firstname"]
702  );
703  $dtpl->parseCurrentBlock();
704  }
705 
706  // notes/comments
707  $cnt_note_users = $this->notes->domain()->getUserCount(
708  $this->getPageObject()->getParentId(),
709  $this->getPageObject()->getId(),
710  "wpg"
711  );
712  $dtpl->setVariable(
713  "TXT_NUMBER_USERS_NOTES_OR_COMMENTS",
714  $lng->txt("wiki_number_users_notes_or_comments")
715  );
716  $dtpl->setVariable("TXT_NR_NOTES_COMMENTS", $cnt_note_users);
717 
718  $confirmation_gui->addItem("", "", $dtpl->get());
719 
720  $tpl->setContent($confirmation_gui->getHTML());
721  }
722  }
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 1276 of file class.ilWikiPageGUI.php.

References ilPageObjectGUI\$user, ilObjUser\_lookupName(), ilObject\_lookupTitle(), ilFileDelivery\deliverFileLegacy(), and ilExSubmission\getFiles().

1276  : void
1277  {
1278  $ilUser = $this->user;
1279 
1280  $ass_id = $this->wiki_request->getAssignmentId();
1281  $ass = new ilExAssignment($ass_id);
1282  $submission = new ilExSubmission($ass, $ilUser->getId());
1283  $submitted = $submission->getFiles();
1284  if (count($submitted) > 0) {
1285  $submitted = array_pop($submitted);
1286 
1287  $user_data = ilObjUser::_lookupName($submitted["user_id"]);
1288  $title = ilObject::_lookupTitle($submitted["obj_id"]) . " - " .
1289  $ass->getTitle() . " (Team " . $submission->getTeam()->getId() . ").zip";
1290 
1291  ilFileDelivery::deliverFileLegacy($submitted["filename"], $title);
1292  }
1293  }
getFiles(array $a_file_ids=null, bool $a_only_valid=false, string $a_min_timestamp=null, bool $print_versions=false)
Get submission items (not only files)
Exercise assignment.
static _lookupName(int $a_user_id)
lookup user name
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
static _lookupTitle(int $obj_id)
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:

◆ edit()

ilWikiPageGUI::edit ( )

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

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

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

◆ editAdvancedMetaData()

ilWikiPageGUI::editAdvancedMetaData ( ilPropertyFormGUI  $a_form = null)

Definition at line 1032 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().

1034  : void {
1035  $ilTabs = $this->tabs_gui;
1036  $lng = $this->lng;
1037  $ilCtrl = $this->ctrl;
1038  $tpl = $this->tpl;
1039  $ilAccess = $this->access;
1040 
1041  if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id) &&
1042  !$ilAccess->checkAccess("edit_page_meta", "", $this->wiki_ref_id)) {
1043  return;
1044  }
1045 
1046 
1047  $ilTabs->clearTargets();
1048  $ilTabs->setBackTarget(
1049  $lng->txt("back"),
1050  $ilCtrl->getLinkTarget($this, "preview")
1051  );
1052 
1053  if (!$a_form) {
1054  $a_form = $this->initAdvancedMetaDataForm();
1055  }
1056 
1057  $tpl->setContent($a_form->getHTML());
1058  }
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 106 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(), initAdvancedMetaDataForm(), preview(), ilGlobalTemplateInterface\setHeaderPageTitle(), ilNotification\setNotification(), ilPageObjectGUI\setPresentationTitle(), ilLanguage\txt(), ilNotification\TYPE_WIKI, and ilNotification\TYPE_WIKI_PAGE.

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

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

1262  : void
1263  {
1264  $ilCtrl = $this->ctrl;
1265  $lng = $this->lng;
1266 
1268 
1269  $ass_id = $this->wiki_request->getAssignmentId();
1270  $wiki_ass->submitWiki($ass_id, $this->user->getId(), $this->getWikiRefId());
1271 
1272  $this->tpl->setOnScreenMessage('success', $lng->txt("wiki_finalized"), true);
1273  $ilCtrl->redirectByClass("ilObjWikiGUI", "gotoStartPage");
1274  }
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 1295 of file class.ilWikiPageGUI.php.

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

1295  : string
1296  {
1297  return $this->getNotesHTML(
1298  $this->getPageObject(),
1299  false,
1300  ilObjWiki::_lookupPublicNotes($this->getPageObject()->getParentId()),
1301  false,
1302  null,
1303  true
1304  );
1305  }
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 476 of file class.ilWikiPageGUI.php.

References ilPageObjectGUI\getPageObject().

Referenced by addLanguageSelectionToToolbar(), and postOutputProcessing().

476  : string
477  {
478  return $this->getPageObject()->getLanguage();
479  }
+ 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 524 of file class.ilWikiPageGUI.php.

References ILIAS\Repository\lng().

Referenced by addLanguageSelectionToToolbar().

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

◆ getPrintView()

ilWikiPageGUI::getPrintView ( )
protected

Definition at line 532 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().

533  {
534  $provider = new \ILIAS\Wiki\WikiPrintViewProviderGUI(
535  $this->lng,
536  $this->ctrl,
537  $this->getWikiPage()->getWikiRefId(),
538  []
539  );
540 
541  return new \ILIAS\Export\PrintProcessGUI(
542  $provider,
543  $this->http,
544  $this->ui,
545  $this->lng
546  );
547  }
$provider
Definition: ltitoken.php:83
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 623 of file class.ilWikiPageGUI.php.

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

Referenced by executeCommand().

625  : void {
626  $ilTabs = $this->tabs_gui;
627  $ilCtrl = $this->ctrl;
628  $ilAccess = $this->access;
629 
630  parent::getTabs($a_activate);
631 
632  if ($ilAccess->checkAccess("statistics_read", "", $this->requested_ref_id)) {
633  $ilTabs->addTarget(
634  "statistics",
635  $this->ctrl->getLinkTargetByClass(
636  array("ilwikipagegui", "ilwikistatgui"),
637  "initial"
638  ),
639  "",
640  "ilwikistatgui"
641  );
642  }
643 
644  $ilTabs->addTarget(
645  "wiki_what_links_here",
646  $this->ctrl->getLinkTargetByClass(
647  "ilwikipagegui",
648  "whatLinksHere"
649  ),
650  "whatLinksHere"
651  );
652  }
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 1342 of file class.ilWikiPageGUI.php.

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

Referenced by confirmPageTranslationCreation(), and createPageTranslation().

1343  {
1344  $f = $this->wiki_gui->form(self::class, "createPageTranslation")
1345  ->text("title", $this->lng->txt("title"));
1346  //->required();
1347  return $f;
1348  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getWiki()

ilWikiPageGUI::getWiki ( )

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

References $wiki.

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

◆ getWikiRefId()

ilWikiPageGUI::getWikiRefId ( )

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

References $wiki_ref_id.

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

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

◆ hideAdvancedMetaData()

ilWikiPageGUI::hideAdvancedMetaData ( )

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

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

1086  : void
1087  {
1088  $ilCtrl = $this->ctrl;
1089  $lng = $this->lng;
1090  $ilAccess = $this->access;
1091 
1092  if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id) &&
1093  !$ilAccess->checkAccess("edit_page_meta", "", $this->wiki_ref_id)) {
1094  return;
1095  }
1096 
1097  $this->getPageObject()->hideAdvancedMetadata(true);
1098  $this->getPageObject()->update();
1099 
1100  $this->tpl->setOnScreenMessage('success', $lng->txt("settings_saved"), true);
1101  $ilCtrl->redirect($this, "preview");
1102  }
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 549 of file class.ilWikiPageGUI.php.

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

Referenced by preview().

549  : void
550  {
551  $ilUser = $this->user;
552 
553  $this->getWikiPage()->increaseViewCnt();
554 
555  // enable object statistics
557  "wiki",
558  $this->getWikiPage()->getWikiRefId(),
559  $this->getWikiPage()->getWikiId(),
560  $ilUser->getId()
561  );
562 
564  }
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 1003 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().

1004  {
1005  $ilCtrl = $this->ctrl;
1006  $lng = $this->lng;
1007 
1008  $page = $this->getWikiPage();
1009 
1010  $form = new ilPropertyFormGUI();
1011  $form->setFormAction($ilCtrl->getFormAction($this, "updateAdvancedMetaData"));
1012 
1013  // :TODO:
1014  $form->setTitle($lng->txt("wiki_advmd_block_title") . ": " . $page->getTitle());
1015 
1016  $this->record_gui = new ilAdvancedMDRecordGUI(
1018  'wiki',
1019  $page->getWikiId(),
1020  'wpg',
1021  $page->getId()
1022  );
1023  $this->record_gui->setPropertyForm($form);
1024  $this->record_gui->parse();
1025 
1026  $form->addCommandButton("updateAdvancedMetaData", $lng->txt("save"));
1027  $form->addCommandButton("preview", $lng->txt("cancel"));
1028 
1029  return $form;
1030  }
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 1132 of file class.ilWikiPageGUI.php.

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

1132  : void
1133  {
1134  global $DIC;
1135 
1136  $lng = $DIC->language();
1137 
1138  $a_tpl->addJavaScript("./Modules/Wiki/js/WikiEdit.js");
1139  $a_tpl->addOnLoadCode("il.Wiki.Edit.txt.page_exists = '" . $lng->txt("wiki_page_exists") . "';");
1140  $a_tpl->addOnLoadCode("il.Wiki.Edit.txt.new_page = '" . $lng->txt("wiki_new_page") . "';");
1141  }
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: feed.php:28
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 885 of file class.ilWikiPageGUI.php.

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

Referenced by renamePage(), and renameWikiPage().

885  : void
886  {
887  $lng = $this->lng;
888  $ilCtrl = $this->ctrl;
889 
890  $this->form = new ilPropertyFormGUI();
891 
892  // new name
893  $ti = new ilTextInputGUI($lng->txt("wiki_new_page_name"), "new_page_name");
894  $ti->setMaxLength(200);
895  $ti->setSize(50);
896  $ti->setValue($this->getPageObject()->getTitle());
897  $ti->setRequired(true);
898  $this->form->addItem($ti);
899 
900  $this->form->addCommandButton("renamePage", $lng->txt("wiki_rename"));
901  $this->form->addCommandButton("preview", $lng->txt("cancel"));
902 
903  $this->form->setTitle($lng->txt("wiki_rename_page"));
904  $this->form->setFormAction($ilCtrl->getFormAction($this));
905  }
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 461 of file class.ilWikiPageGUI.php.

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

Referenced by showPage().

461  : void
462  {
464 
466 
467  $print_view = $this->getPrintView();
468  $modal_elements = $print_view->getModalElements($this->ctrl->getLinkTarget(
469  $this,
470  "printViewSelection"
471  ));
472  $toolbar->addComponent($modal_elements->button);
473  $toolbar->addComponent($modal_elements->modal);
474  }
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 1147 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().

1147  : void
1148  {
1149  $lng = $this->lng;
1150  $ilCtrl = $this->ctrl;
1151 
1152  $form = new ilPropertyFormGUI();
1153  $form->addCommandButton("addWikiLink", $lng->txt("wiki_add_link"));
1154  $form->addCommandButton("searchWikiLink", $lng->txt("search"));
1155 
1156  // Target page
1157  $tp = new ilTextInputGUI($this->lng->txt("wiki_target_page"), "target_page");
1158  $tp->setSize(18);
1159  $tp->setRequired(true);
1160  $tp->setInfo("...");
1161  $tp->setDataSource($ilCtrl->getLinkTarget($this, "insertWikiLinkAC", "", true));
1162  $form->addItem($tp);
1163 
1164  // Link text
1165  $lt = new ilTextInputGUI($this->lng->txt("wiki_link_text"), "link_text");
1166  $lt->setSize(18);
1167  $form->addItem($lt);
1168 
1169  //$form->setTitle($lng->txt("wiki_link"));
1170 
1171  echo $form->getHTML();
1172  exit;
1173  }
exit
Definition: login.php:29
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 1178 of file class.ilWikiPageGUI.php.

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

1178  : void
1179  {
1180  $result = array();
1181 
1182  $term = $this->wiki_request->getTerm();
1183 
1184  // if page exists, make it first entry
1185  if (ilWikiPage::_wikiPageExists($this->getPageObject()->getParentId(), $term)) {
1186  $entry = new stdClass();
1187  $entry->value = $term;
1188  $entry->label = $term;
1189  $result[] = $entry;
1190  }
1191 
1192  $res = ilWikiPage::getPagesForSearch($this->getPageObject()->getParentId(), $term);
1193 
1194  $cnt = 0;
1195  foreach ($res as $r) {
1196  if ($result[0]->value == $r) {
1197  continue;
1198  }
1199  if ($cnt++ > 19) {
1200  continue;
1201  }
1202  $entry = new stdClass();
1203  $entry->value = $r;
1204  $entry->label = $r;
1205  $result[] = $entry;
1206  }
1207 
1208  echo json_encode($result, JSON_THROW_ON_ERROR);
1209  exit;
1210  }
$res
Definition: ltiservices.php:69
exit
Definition: login.php:29
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 974 of file class.ilWikiPageGUI.php.

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

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

◆ postOutputProcessing()

ilWikiPageGUI::postOutputProcessing ( string  $a_output)

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

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

566  : string
567  {
568  $ilCtrl = $this->ctrl;
569 
570  $title = $this->getPageObject()->getTitle();
571  $ilCtrl->setParameterByClass(
572  "ilobjwikigui",
573  "from_page",
575  );
576  if ($this->getEnabledHref() && $this->getOutputMode() !== self::EDIT) {
578  $a_output,
579  $this->getWikiPage()->getWikiId(),
580  ($this->getOutputMode() === "offline"),
581  $this->getCurrentLanguage()
582  );
583  } else {
584  $output = $a_output;
585  }
586  $ilCtrl->setParameterByClass(
587  "ilobjwikigui",
588  "from_page",
589  $this->wiki_request->getFromPage()
590  );
591 
592 
593  // metadata in print view
594  if ($this->getOutputMode() === "print" && $this->wiki instanceof ilObjWiki) {
595  $mdgui = new ilObjectMetaDataGUI($this->wiki, "wpg", $this->getId());
596  $md = $mdgui->getKeyValueList();
597  if ($md !== "") {
598  $output = str_replace("<!--COPage-PageTop-->", "<p>" . $md . "</p>", $output);
599  }
600  }
601 
602 
603  return $output;
604  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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 344 of file class.ilWikiPageGUI.php.

References ilPageObjectGUI\$access, ilPageObjectGUI\$ctrl, $ilSetting, ilPageObjectGUI\$lng, $message, $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().

344  : string
345  {
346  $ilCtrl = $this->ctrl;
347  $ilAccess = $this->access;
348  $lng = $this->lng;
349  $tpl = $this->tpl;
350  $ilUser = $this->user;
352  $append = "";
353  $message = "";
354 
355 
356  // block/unblock
357  if ($this->getPageObject()->getBlocked()) {
358  $this->tpl->setOnScreenMessage('info', $lng->txt("wiki_page_status_blocked"));
359  }
360 
361  $this->increaseViewCount();
362 
363  $this->addHeaderAction();
364 
365  // content
366  if (!in_array($ilCtrl->getNextClass(), ["ilnotegui", "ilcommentgui"])) {
367  $this->setSideBlock();
368  }
369 
370  $wtpl = new ilTemplate(
371  "tpl.wiki_page_view_main_column.html",
372  true,
373  true,
374  "Modules/Wiki"
375  );
376 
377  $callback = array($this, "observeNoteAction");
378  // notes
379  if (!$ilSetting->get("disable_comments") &&
380  ilObjWiki::_lookupPublicNotes($this->getPageObject()->getParentId())) {
381  $may_delete = ($ilSetting->get("comments_del_tutor", '1') &&
382  $ilAccess->checkAccess("write", "", $this->requested_ref_id));
383  $wtpl->setVariable("NOTES", $this->getNotesHTML(
384  $this->getPageObject(),
385  true,
386  ilObjWiki::_lookupPublicNotes($this->getPageObject()->getParentId()),
387  $may_delete,
388  $callback
389  ));
390  }
391 
392 
393  // page content
395  $this->showEditToolbar();
396  $this->setRenderPageContainer(true);
397  $wtpl->setVariable("PAGE", $this->showPage());
398 
399  $tpl->setLoginTargetPar("wiki_" . $this->requested_ref_id . $append);
400 
401  // last edited info
402  $wtpl->setVariable(
403  "LAST_EDITED_INFO",
404  $lng->txt("wiki_last_edited") . ": " .
406  new ilDateTime($this->getPageObject()->getLastChange(), IL_CAL_DATETIME)
407  ) . ", " .
409  $this->getPageObject()->getLastChangeUser(),
410  false,
411  true,
412  $ilCtrl->getLinkTarget($this, "preview")
413  )
414  );
415 
416  $tpl->setLoginTargetPar("wiki_" . $this->requested_ref_id . $append);
417 
418  //highlighting
419  if ($this->wiki_request->getSearchString()) {
420  $cache = ilUserSearchCache::_getInstance($ilUser->getId());
421  $cache->switchSearchType(ilUserSearchCache::LAST_QUERY);
422  $search_string = $cache->getQuery();
423 
424  // advanced search?
425  if (is_array($search_string)) {
426  $search_string = $search_string["lom_content"];
427  }
428 
429  $p = new ilQueryParser($search_string);
430  $p->parse();
431 
432  $words = $p->getQuotedWords();
433  if (is_array($words)) {
434  foreach ($words as $w) {
435  ilTextHighlighterGUI::highlight("ilCOPageContent", $w, $tpl);
436  }
437  }
438  $this->fill_on_load_code = true;
439  }
440 
441  return $message . $wtpl->get();
442  }
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)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
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:18
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.
$message
Definition: xapiexit.php:32
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 754 of file class.ilWikiPageGUI.php.

References printViewOrderList().

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

◆ printViewOrderList()

ilWikiPageGUI::printViewOrderList ( )
protected

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

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

Referenced by printViewOrder().

760  : void {
761  $ilTabs = $this->tabs_gui;
762 
763  $pg_ids = $all_pages = array();
764 
765  // coming from type selection
766  $ordering = $this->wiki_request->getPrintOrdering();
767  if (count($ordering) === 0) {
768  switch ($this->wiki_request->getSelectedPrintType()) {
769  case "wiki":
770  foreach ($this->wiki_pm->getWikiPages($this->getLanguage()) as $p) {
771  $pg_ids[] = $p->getId();
772  }
773  break;
774 
775  case "selection":
776  $pg_ids = $this->wiki_request->getWikiPageIds();
777  if (count($pg_ids) === 0) {
778  $pg_ids = [$this->wiki_request->getWikiPageId()];
779  }
780  if (count($pg_ids) > 1) {
781  break;
782  } else {
783  $wiki_page_id = array_pop($pg_ids);
784  }
785  $this->ctrl->setParameterByClass(
786  "ilObjWikiGUI",
787  "wpg_id",
788  $wiki_page_id
789  );
790  $this->ctrl->redirectByClass("ilObjWikiGUI", "printView");
791  break;
792 
793  default:
794  $this->ctrl->setParameterByClass(
795  "ilObjWikiGUI",
796  "wpg_id",
797  $this->wiki_request->getWikiPageId()
798  );
799  $this->ctrl->redirectByClass("ilObjWikiGUI", "printView");
800  break;
801  }
802  }
803  // refresh sorting
804  else {
805  asort($ordering);
806  $pg_ids = array_keys($ordering);
807  }
808 
809  $ilTabs->clearTargets();
810  $ilTabs->setBackTarget(
811  $this->lng->txt("back"),
812  $this->ctrl->getLinkTarget($this, "preview")
813  );
814 
815  if (!count($all_pages)) {
816  $all_pages = ilWikiPage::getAllWikiPages($this->getPageObject()->getWikiId());
817  }
818 
819  $tbl = new ilWikiExportOrderTableGUI(
820  $this,
821  "printViewOrderList",
822  $all_pages,
823  $pg_ids
824  );
825  $this->tpl->setContent($tbl->getHTML());
826  }
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 748 of file class.ilWikiPageGUI.php.

References getPrintView().

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

◆ redrawHeaderAction()

ilWikiPageGUI::redrawHeaderAction ( )

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

References addHeaderAction(), and exit.

338  : void
339  {
340  echo $this->addHeaderAction(true);
341  exit;
342  }
exit
Definition: login.php:29
addHeaderAction(bool $a_redraw=false)
+ Here is the call graph for this function:

◆ renamePage()

ilWikiPageGUI::renamePage ( )

Definition at line 907 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().

907  : void
908  {
909  $tpl = $this->tpl;
910  $lng = $this->lng;
911  $ilCtrl = $this->ctrl;
912  $ilAccess = $this->access;
913 
914  $this->initRenameForm();
915  if ($this->form->checkInput()) {
916  if (($ilAccess->checkAccess("edit_content", "", $this->requested_ref_id) && !$this->getPageObject()->getBlocked())
917  || $ilAccess->checkAccess("write", "", $this->requested_ref_id)) {
918  $new_name = $this->form->getInput("new_page_name");
919 
920  $page_title = ilWikiUtil::makeDbTitle($new_name);
922  $this->getPageObject()->getWikiId(),
923  $page_title,
924  $this->getPageObject()->getLanguage()
925  );
926 
927  // we might get the same page id back here, if the page
928  // name only differs in diacritics
929  // see bug http://www.ilias.de/mantis/view.php?id=11226
930  if ($pg_id > 0 && $pg_id != $this->getPageObject()->getId()) {
931  $this->tpl->setOnScreenMessage('failure', $lng->txt("wiki_page_already_exists"));
932  } else {
933  $new_name = $this->getPageObject()->rename($new_name);
934  $ilCtrl->setParameterByClass("ilobjwikigui", "page", ilWikiUtil::makeUrlTitle($new_name));
935  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
936  $ilCtrl->redirect($this, "preview");
937  }
938  }
939  }
940 
941  $this->form->setValuesByPost();
942  $tpl->setContent($this->form->getHTML());
943  }
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 868 of file class.ilWikiPageGUI.php.

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

868  : void
869  {
870  $ilAccess = $this->access;
871  $tpl = $this->tpl;
872 
873  if (($ilAccess->checkAccess(
874  "edit_content",
875  "",
876  $this->requested_ref_id
877  ) && !$this->getPageObject()->getBlocked())
878  || $ilAccess->checkAccess("write", "", $this->requested_ref_id)) {
879  $this->ctrl->setParameterByClass(ilWikiPageGUI::class, "wpg_id", $this->wiki_request->getWikiPageId());
880  $this->initRenameForm();
881  $tpl->setContent($this->form->getHTML());
882  }
883  }
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 1215 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().

1215  : void
1216  {
1217  $lng = $this->lng;
1218 
1219  $lng->loadLanguageModule("wiki");
1220 
1221  $tpl = new ilTemplate("tpl.wiki_ac_search_result.html", true, true, "Modules/Wiki");
1222  $term = $this->wiki_request->getTerm();
1223 
1224  $pages = ilObjWiki::_performSearch($this->getPageObject()->getParentId(), $term);
1225 
1226  $found = array();
1227  foreach ($pages as $page) {
1228  $found[] = array("page_id" => $page["page_id"], "title" => ilWikiPage::lookupTitle($page["page_id"]));
1229  }
1230 
1231  // sort if all pages are listed
1232  if ($term === "") {
1233  $found = ilArrayUtil::sortArray($found, "title", "asc");
1234  }
1235 
1236  foreach ($found as $f) {
1237  $tpl->setCurrentBlock("item");
1238  $tpl->setVariable("WIKI_TITLE", $f["title"]);
1240  }
1241 
1242  if (count($pages) === 0) {
1243  $tpl->setVariable("INFOTEXT", str_replace("$1", $term, $lng->txt("wiki_no_page_found")));
1244  } elseif ($term === '') {
1245  $tpl->setVariable("INFOTEXT", $lng->txt("wiki_no_search_term"));
1246  } else {
1247  $tpl->setVariable("INFOTEXT", str_replace("$1", $term, $lng->txt("wiki_pages_found")));
1248  }
1249 
1250  $tpl->setVariable("TXT_BACK", $lng->txt("back"));
1251  echo $tpl->get();
1252  exit;
1253  }
exit
Definition: login.php:29
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 77 of file class.ilWikiPageGUI.php.

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

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

◆ setSideBlock()

ilWikiPageGUI::setSideBlock ( )

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

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

Referenced by preview().

237  : void
238  {
240  $this->getWikiPage()->getId(),
241  $this->wiki_ref_id,
242  $this->getWikiPage()
243  );
244  }
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 93 of file class.ilWikiPageGUI.php.

93  : void
94  {
95  $this->wiki = $a_val;
96  }

◆ setWikiPage()

ilWikiPageGUI::setWikiPage ( ilWikiPage  $a_wikipage)

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

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

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

◆ setWikiRefId()

ilWikiPageGUI::setWikiRefId ( int  $a_ref_id)

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

Referenced by __construct().

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

◆ showPage()

ilWikiPageGUI::showPage ( )

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

References ilPageObjectGUI\getAbstractOnly(), ilPageObjectGUI\getOutputMode(), initToolbar(), ilPageObjectGUI\PRESENTATION, ilPageObjectGUI\setPresentationTitle(), and ilPageObjectGUI\setTemplateOutput().

Referenced by preview().

444  : string
445  {
446  if ($this->getOutputMode() === ilPageObjectGUI::PRESENTATION && !$this->getAbstractOnly()) {
447  $this->initToolbar();
448  }
449  $this->setTemplateOutput(false);
450 
451  if (!$this->getAbstractOnly()) {
452  $this->setPresentationTitle($this->getWikiPage()->getTitle());
453 
454  // wiki stats clean up
455  // $this->increaseViewCount();
456  }
457 
458  return parent::showPage();
459  }
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 848 of file class.ilWikiPageGUI.php.

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

848  : void
849  {
850  $ilCtrl = $this->ctrl;
851  $lng = $this->lng;
852 
853  if (ilWikiPerm::check("activate_wiki_protection", $this->requested_ref_id)) {
854  $this->getPageObject()->setBlocked(false);
855  $this->getPageObject()->update();
856 
857  $this->tpl->setOnScreenMessage('success', $lng->txt("wiki_page_unblocked"), true);
858  }
859 
860  $ilCtrl->redirect($this, "preview");
861  }
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 1104 of file class.ilWikiPageGUI.php.

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

1104  : void
1105  {
1106  $ilCtrl = $this->ctrl;
1107  $lng = $this->lng;
1108  $ilAccess = $this->access;
1109 
1110  if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id) &&
1111  !$ilAccess->checkAccess("edit_page_meta", "", $this->wiki_ref_id)) {
1112  return;
1113  }
1114 
1115  $this->getPageObject()->hideAdvancedMetadata(false);
1116  $this->getPageObject()->update();
1117 
1118  $this->tpl->setOnScreenMessage('success', $lng->txt("settings_saved"), true);
1119  $ilCtrl->redirect($this, "preview");
1120  }
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 1060 of file class.ilWikiPageGUI.php.

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

1060  : void
1061  {
1062  $ilCtrl = $this->ctrl;
1063  $lng = $this->lng;
1064  $ilAccess = $this->access;
1065 
1066  if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id) &&
1067  !$ilAccess->checkAccess("edit_page_meta", "", $this->wiki_ref_id)) {
1068  return;
1069  }
1070 
1071  $form = $this->initAdvancedMetaDataForm();
1072 
1073  // needed for proper advanced MD validation
1074  $form->checkInput();
1075  if (!$this->record_gui->importEditFormPostValues()) {
1076  $this->editAdvancedMetaData($form); // #16470
1077  return;
1078  }
1079 
1080  if ($this->record_gui->writeEditForm()) {
1081  $this->tpl->setOnScreenMessage('success', $lng->txt("settings_saved"), true);
1082  }
1083  $ilCtrl->redirect($this, "preview");
1084  }
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 989 of file class.ilWikiPageGUI.php.

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

994  : void {
996  }
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 606 of file class.ilWikiPageGUI.php.

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

606  : void
607  {
608  $tpl = $this->tpl;
609 
610  //$this->setSideBlock();
611  $table_gui = new ilWikiPagesTableGUI(
612  $this,
613  "whatLinksHere",
614  $this->getWikiPage()->getWikiId(),
616  $this->getId(),
617  $this->wiki_request->getTranslation()
618  );
619 
620  $tpl->setContent($table_gui->getHTML());
621  }
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 33 of file class.ilWikiPageGUI.php.

Referenced by __construct().

◆ $fill_on_load_code

bool ilWikiPageGUI::$fill_on_load_code = false
protected

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

◆ $http

ILIAS HTTP Services ilWikiPageGUI::$http
protected

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

◆ $notes

ILIAS Notes Service ilWikiPageGUI::$notes
protected

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

◆ $ot

ilObjectTranslation ilWikiPageGUI::$ot
protected

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

◆ $record_gui

ilAdvancedMDRecordGUI ilWikiPageGUI::$record_gui = null
protected

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

◆ $settings

ilSetting ilWikiPageGUI::$settings
protected

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

Referenced by preview().

◆ $wiki

ilObjWiki ilWikiPageGUI::$wiki
protected

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

Referenced by getWiki().

◆ $wiki_gui

ILIAS Wiki InternalGUIService ilWikiPageGUI::$wiki_gui
protected

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

◆ $wiki_pm

ILIAS Wiki Page PageManager ilWikiPageGUI::$wiki_pm
protected

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

◆ $wiki_ref_id

int ilWikiPageGUI::$wiki_ref_id = 0
protected

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

Referenced by getWikiRefId().

◆ $wiki_request

ILIAS Wiki WikiGUIRequest ilWikiPageGUI::$wiki_request
protected

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


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