ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilWikiPageGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. 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)
 
 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 ()
 
- 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 ()
 
 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...
 

Static Public Member Functions

static getGUIForTitle (int $a_wiki_id, string $a_title, int $a_old_nr=0, int $a_wiki_ref_id=0)
 Get wiki page gui for id and title. More...
 
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 ()
 
 getPrintView ()
 
 increaseViewCount ()
 
 printViewOrderList ()
 
 initRenameForm ()
 
 initAdvancedMetaDataForm ()
 
 finalizeAssignment ()
 Finalize and submit blog to exercise. More...
 
 downloadExcSubFile ()
 
- 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 ()
 
 isPageContainerToBeRendered ()
 
 addResourcesToTemplate (ilGlobalTemplateInterface $tpl)
 Add resources to template. More...
 

Protected Attributes

ILIAS Notes Service $notes
 
ILIAS HTTP Services $http
 
ILIAS Wiki Editing EditingGUIRequest $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
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
 

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

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilWikiPage GUI class

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

ilWikiPageGUI: ilPageEditorGUI, ilEditClipboardGUI, ilMediaPoolTargetSelector ilWikiPageGUI: ilPublicUserProfileGUI, ilPageObjectGUI, ilNoteGUI ilWikiPageGUI: ilCommonActionDispatcherGUI, ilRatingGUI, ilWikiStatGUI ilWikiPageGUI: ilObjectMetaDataGUI, ilPropertyFormGUI

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

Constructor & Destructor Documentation

◆ __construct()

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

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

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

44  {
45  global $DIC;
46 
47  $this->settings = $DIC->settings();
48  $this->http = $DIC->http();
49 
50  // needed for notifications
51  $this->setWikiRefId($a_wiki_ref_id);
52 
53  parent::__construct("wpg", $a_id, $a_old_nr);
54  $this->getPageObject()->setWikiRefId($this->getWikiRefId());
55 
56  // content style
57  $this->tpl->addCss(ilObjStyleSheet::getSyntaxStylePath());
58  $this->wiki_request = $DIC
59  ->wiki()
60  ->internal()
61  ->gui()
62  ->editing()
63  ->request();
64  $this->notes = $DIC->notes();
65  }
setWikiRefId(int $a_ref_id)
global $DIC
Definition: feed.php:28
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ activateWikiPageRating()

ilWikiPageGUI::activateWikiPageRating ( )

Rating /.

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

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

905  : void
906  {
907  $lng = $this->lng;
908  $ilCtrl = $this->ctrl;
909 
910  $this->getPageObject()->setRating(true);
911  $this->getPageObject()->update();
912 
913  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
914  $ilCtrl->redirect($this, "preview");
915  }
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 251 of file class.ilWikiPageGUI.php.

References ilPageObjectGUI\$access, $ilUser, 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().

253  : string {
255  $ilAccess = $this->access;
256 
257  $wiki_id = $this->getPageObject()->getParentId();
258  $page_id = $this->getPageObject()->getId();
259 
260  $dispatcher = new ilCommonActionDispatcherGUI(
262  $ilAccess,
263  "wiki",
264  $this->requested_ref_id,
265  $wiki_id
266  );
267 
268  // see #33422
269  $dispatcher->setSubObject("wpg", $page_id);
270 
272  $this->ctrl->getLinkTarget($this, "redrawHeaderAction", "", true),
273  "",
274  $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "iltagginggui"), "", "", true, false)
275  );
276 
277  $lg = $dispatcher->initHeaderAction();
278  $lg->enableNotes(true);
279  $lg->enableComments(ilObjWiki::_lookupPublicNotes($wiki_id), false);
280 
281  // rating
282  if (ilObjWiki::_lookupRatingOverall($wiki_id)) {
283  $lg->enableRating(
284  true,
285  $this->lng->txt("wiki_rate_overall"),
286  false,
287  // so ilCtrl does not use the shortcut via ilWikiGUI
288  array("ilcommonactiondispatchergui", "ilratinggui"),
289  true
290  );
291  }
292 
293  // notification
294  if ($ilUser->getId() !== ANONYMOUS_USER_ID) {
296  $this->ctrl->setParameter($this, "ntf", 1);
297  if (ilNotification::hasOptOut($wiki_id)) {
298  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_deactivate_wiki");
299  }
300 
301  $lg->addHeaderIcon(
302  "not_icon",
303  ilUtil::getImagePath("notification_on.svg"),
304  $this->lng->txt("wiki_notification_activated")
305  );
306  } else {
307  $this->ctrl->setParameter($this, "ntf", 2);
308  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_activate_wiki");
309 
311  $this->ctrl->setParameter($this, "ntf", 3);
312  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_deactivate_page");
313 
314  $lg->addHeaderIcon(
315  "not_icon",
316  ilUtil::getImagePath("notification_on.svg"),
317  $this->lng->txt("wiki_page_notification_activated")
318  );
319  } else {
320  $this->ctrl->setParameter($this, "ntf", 4);
321  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_activate_page");
322 
323  $lg->addHeaderIcon(
324  "not_icon",
325  ilUtil::getImagePath("notification_off.svg"),
326  $this->lng->txt("wiki_notification_deactivated")
327  );
328  }
329  }
330  $this->ctrl->setParameter($this, "ntf", "");
331  }
332 
333  if (!$a_redraw) {
334  $this->tpl->setHeaderActionMenu($lg->getHeaderAction());
335  } else {
336  // we need to add onload code manually (rating, comments, etc.)
337  return $lg->getHeaderAction() .
338  $this->tpl->getOnLoadCodeForAsynch();
339  }
340  return "";
341  }
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
$ilUser
Definition: imgupload.php:34
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:

◆ blockWikiPage()

ilWikiPageGUI::blockWikiPage ( )

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

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

794  : void
795  {
796  $ilCtrl = $this->ctrl;
797  $lng = $this->lng;
798 
799  if (ilWikiPerm::check("activate_wiki_protection", $this->requested_ref_id)) {
800  $this->getPageObject()->setBlocked(true);
801  $this->getPageObject()->update();
802 
803  $this->tpl->setOnScreenMessage('success', $lng->txt("wiki_page_blocked"), true);
804  }
805 
806  $ilCtrl->redirect($this, "preview");
807  }
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 683 of file class.ilWikiPageGUI.php.

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

683  : void
684  {
685  $ilCtrl = $this->ctrl;
686 
687  $ilCtrl->redirect($this, "preview");
688  }
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:

◆ confirmWikiPageDeletion()

ilWikiPageGUI::confirmWikiPageDeletion ( )

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

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

690  : void
691  {
692  $ilCtrl = $this->ctrl;
693  $lng = $this->lng;
694 
695  if (ilWikiPerm::check("delete_wiki_pages", $this->requested_ref_id)) {
696  $this->getPageObject()->delete();
697 
698  $this->tpl->setOnScreenMessage('success', $lng->txt("wiki_page_deleted"), true);
699  }
700 
701  $ilCtrl->redirectByClass("ilobjwikigui", "allPages");
702  }
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:

◆ deactivateWikiPageRating()

ilWikiPageGUI::deactivateWikiPageRating ( )

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

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

917  : void
918  {
919  $lng = $this->lng;
920  $ilCtrl = $this->ctrl;
921 
922  $this->getPageObject()->setRating(false);
923  $this->getPageObject()->update();
924 
925  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
926  $ilCtrl->redirect($this, "preview");
927  }
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 613 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().

613  : void
614  {
615  $tpl = $this->tpl;
616  $ilCtrl = $this->ctrl;
617  $lng = $this->lng;
618 
619  if (ilWikiPerm::check("delete_wiki_pages", $this->requested_ref_id)) {
620  $confirmation_gui = new ilConfirmationGUI();
621  $confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
622  $confirmation_gui->setHeaderText($lng->txt("wiki_page_deletion_confirmation"));
623  $confirmation_gui->setCancel($lng->txt("cancel"), "cancelWikiPageDeletion");
624  $confirmation_gui->setConfirm($lng->txt("delete"), "confirmWikiPageDeletion");
625 
626  $dtpl = new ilTemplate(
627  "tpl.wiki_page_deletion_confirmation.html",
628  true,
629  true,
630  "Modules/Wiki"
631  );
632 
633  $dtpl->setVariable("PAGE_TITLE", $this->getWikiPage()->getTitle());
634 
635  // other pages that link to this page
636  $dtpl->setVariable("TXT_OTHER_PAGES", $lng->txt("wiki_other_pages_linking"));
638  $this->getWikiPage()->getWikiId(),
639  $this->getWikiPage()->getId()
640  );
641  if (count($pages) > 0) {
642  foreach ($pages as $page) {
643  $dtpl->setCurrentBlock("lpage");
644  $dtpl->setVariable("TXT_LINKING_PAGE", $page["title"]);
645  $dtpl->parseCurrentBlock();
646  }
647  } else {
648  $dtpl->setCurrentBlock("lpage");
649  $dtpl->setVariable("TXT_LINKING_PAGE", "-");
650  $dtpl->parseCurrentBlock();
651  }
652 
653  // contributors
654  $dtpl->setVariable("TXT_CONTRIBUTORS", $lng->txt("wiki_contributors"));
655  $contributors = ilWikiPage::getWikiPageContributors($this->getWikiPage()->getId());
656  foreach ($contributors as $contributor) {
657  $dtpl->setCurrentBlock("contributor");
658  $dtpl->setVariable(
659  "TXT_CONTRIBUTOR",
660  $contributor["lastname"] . ", " . $contributor["firstname"]
661  );
662  $dtpl->parseCurrentBlock();
663  }
664 
665  // notes/comments
666  $cnt_note_users = $this->notes->domain()->getUserCount(
667  $this->getPageObject()->getParentId(),
668  $this->getPageObject()->getId(),
669  "wpg"
670  );
671  $dtpl->setVariable(
672  "TXT_NUMBER_USERS_NOTES_OR_COMMENTS",
673  $lng->txt("wiki_number_users_notes_or_comments")
674  );
675  $dtpl->setVariable("TXT_NR_NOTES_COMMENTS", $cnt_note_users);
676 
677  $confirmation_gui->addItem("", "", $dtpl->get());
678 
679  $tpl->setContent($confirmation_gui->getHTML());
680  }
681  }
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 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="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getLinksToPage(int $a_wiki_id, int $a_page_id)
+ Here is the call graph for this function:

◆ downloadExcSubFile()

ilWikiPageGUI::downloadExcSubFile ( )
protected

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

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

1232  : void
1233  {
1234  $ilUser = $this->user;
1235 
1236  $ass_id = $this->wiki_request->getAssignmentId();
1237  $ass = new ilExAssignment($ass_id);
1238  $submission = new ilExSubmission($ass, $ilUser->getId());
1239  $submitted = $submission->getFiles();
1240  if (count($submitted) > 0) {
1241  $submitted = array_pop($submitted);
1242 
1243  $user_data = ilObjUser::_lookupName($submitted["user_id"]);
1244  $title = ilObject::_lookupTitle($submitted["obj_id"]) . " - " .
1245  $ass->getTitle() . " (Team " . $submission->getTeam()->getId() . ").zip";
1246 
1247  ilFileDelivery::deliverFileLegacy($submitted["filename"], $title);
1248  }
1249  }
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)
$ilUser
Definition: imgupload.php:34
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 1078 of file class.ilWikiPageGUI.php.

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

1078  : string
1079  {
1080  $tpl = $this->tpl;
1081  $lng = $this->lng;
1082 
1083  self::initEditingJS($tpl);
1084 
1085  return parent::edit();
1086  }
ilGlobalTemplateInterface $tpl

◆ editAdvancedMetaData()

ilWikiPageGUI::editAdvancedMetaData ( ilPropertyFormGUI  $a_form = null)

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

990  : void {
991  $ilTabs = $this->tabs_gui;
992  $lng = $this->lng;
993  $ilCtrl = $this->ctrl;
994  $tpl = $this->tpl;
995  $ilAccess = $this->access;
996 
997  if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id) &&
998  !$ilAccess->checkAccess("edit_page_meta", "", $this->wiki_ref_id)) {
999  return;
1000  }
1001 
1002 
1003  $ilTabs->clearTargets();
1004  $ilTabs->setBackTarget(
1005  $lng->txt("back"),
1006  $ilCtrl->getLinkTarget($this, "preview")
1007  );
1008 
1009  if (!$a_form) {
1010  $a_form = $this->initAdvancedMetaDataForm();
1011  }
1012 
1013  $tpl->setContent($a_form->getHTML());
1014  }
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 96 of file class.ilWikiPageGUI.php.

References ilPageObjectGUI\$access, ilPageObjectGUI\$ctrl, ilPageObjectGUI\$form, $ilUser, 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(), ilGlobalTemplateInterface\setPermanentLink(), ilPageObjectGUI\setPresentationTitle(), ilLanguage\txt(), ilNotification\TYPE_WIKI, and ilNotification\TYPE_WIKI_PAGE.

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

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

1218  : void
1219  {
1220  $ilCtrl = $this->ctrl;
1221  $lng = $this->lng;
1222 
1224 
1225  $ass_id = $this->wiki_request->getAssignmentId();
1226  $wiki_ass->submitWiki($ass_id, $this->user->getId(), $this->getWikiRefId());
1227 
1228  $this->tpl->setOnScreenMessage('success', $lng->txt("wiki_finalized"), true);
1229  $ilCtrl->redirectByClass("ilObjWikiGUI", "gotoStartPage");
1230  }
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 1251 of file class.ilWikiPageGUI.php.

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

1251  : string
1252  {
1253  return $this->getNotesHTML(
1254  $this->getPageObject(),
1255  false,
1256  ilObjWiki::_lookupPublicNotes($this->getPageObject()->getParentId()),
1257  false,
1258  null,
1259  true
1260  );
1261  }
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:

◆ getGUIForTitle()

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

Get wiki page gui for id and title.

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

References ilPageObjectGUI\$id, and ilWikiPage\getPageIdForTitle().

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

237  : ilWikiPageGUI {
238  $id = ilWikiPage::getPageIdForTitle($a_wiki_id, $a_title);
239  return new ilWikiPageGUI($id, $a_old_nr, $a_wiki_ref_id);
240  }
static getPageIdForTitle(int $a_wiki_id, string $a_title)
Get wiki page object for id and title.
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:

◆ getPrintView()

ilWikiPageGUI::getPrintView ( )
protected

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

481  {
482  $provider = new \ILIAS\Wiki\WikiPrintViewProviderGUI(
483  $this->lng,
484  $this->ctrl,
485  $this->getWikiPage()->getWikiRefId(),
486  []
487  );
488 
489  return new \ILIAS\Export\PrintProcessGUI(
490  $provider,
491  $this->http,
492  $this->ui,
493  $this->lng
494  );
495  }
$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 568 of file class.ilWikiPageGUI.php.

References ilPageObjectGUI\$access, ilPageObjectGUI\$ctrl, ilPageObjectGUI\$tabs_gui, ILIAS\Repository\ctrl(), ilWikiPage\getPageIdForTitle(), ilPageObjectGUI\getPageObject(), ilWikiUtil\makeDbTitle(), and ilWikiUtil\makeUrlTitle().

Referenced by executeCommand().

570  : void {
571  $ilTabs = $this->tabs_gui;
572  $ilCtrl = $this->ctrl;
573  $ilAccess = $this->access;
574 
575  parent::getTabs($a_activate);
576 
577  if ($ilAccess->checkAccess("statistics_read", "", $this->requested_ref_id)) {
578  $ilTabs->addTarget(
579  "statistics",
580  $this->ctrl->getLinkTargetByClass(
581  array("ilwikipagegui", "ilwikistatgui"),
582  "initial"
583  ),
584  "",
585  "ilwikistatgui"
586  );
587  }
588 
589  $ilCtrl->setParameterByClass(
590  "ilobjwikigui",
591  "wpg_id",
593  $this->getPageObject()->getParentId(),
594  ilWikiUtil::makeDbTitle($this->wiki_request->getPage())
595  )
596  );
597  $ilCtrl->setParameterByClass(
598  "ilobjwikigui",
599  "page",
600  ilWikiUtil::makeUrlTitle($this->wiki_request->getPage())
601  );
602 
603  $ilTabs->addTarget(
604  "wiki_what_links_here",
605  $this->ctrl->getLinkTargetByClass(
606  "ilwikipagegui",
607  "whatLinksHere"
608  ),
609  "whatLinksHere"
610  );
611  }
static getPageIdForTitle(int $a_wiki_id, string $a_title)
Get wiki page object for id and title.
ilAccessHandler $access
static makeUrlTitle(string $a_par)
static makeDbTitle(string $a_par)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getWiki()

ilWikiPageGUI::getWiki ( )

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

References $wiki.

88  : ilObjWiki
89  {
90  return $this->wiki;
91  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ getWikiRefId()

ilWikiPageGUI::getWikiRefId ( )

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

References $wiki_ref_id.

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

78  : int
79  {
80  return $this->wiki_ref_id;
81  }
+ Here is the caller graph for this function:

◆ hideAdvancedMetaData()

ilWikiPageGUI::hideAdvancedMetaData ( )

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

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

1042  : void
1043  {
1044  $ilCtrl = $this->ctrl;
1045  $lng = $this->lng;
1046  $ilAccess = $this->access;
1047 
1048  if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id) &&
1049  !$ilAccess->checkAccess("edit_page_meta", "", $this->wiki_ref_id)) {
1050  return;
1051  }
1052 
1053  $this->getPageObject()->hideAdvancedMetadata(true);
1054  $this->getPageObject()->update();
1055 
1056  $this->tpl->setOnScreenMessage('success', $lng->txt("settings_saved"), true);
1057  $ilCtrl->redirect($this, "preview");
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...
ilAccessHandler $access
+ Here is the call graph for this function:

◆ increaseViewCount()

ilWikiPageGUI::increaseViewCount ( )
protected

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

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

Referenced by preview().

497  : void
498  {
500 
501  $this->getWikiPage()->increaseViewCnt();
502 
503  // enable object statistics
505  "wiki",
506  $this->getWikiPage()->getWikiRefId(),
507  $this->getWikiPage()->getWikiId(),
508  $ilUser->getId()
509  );
510 
512  }
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.
$ilUser
Definition: imgupload.php:34
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initAdvancedMetaDataForm()

ilWikiPageGUI::initAdvancedMetaDataForm ( )
protected

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

960  {
961  $ilCtrl = $this->ctrl;
962  $lng = $this->lng;
963 
964  $page = $this->getWikiPage();
965 
966  $form = new ilPropertyFormGUI();
967  $form->setFormAction($ilCtrl->getFormAction($this, "updateAdvancedMetaData"));
968 
969  // :TODO:
970  $form->setTitle($lng->txt("wiki_advmd_block_title") . ": " . $page->getTitle());
971 
972  $this->record_gui = new ilAdvancedMDRecordGUI(
974  'wiki',
975  $page->getWikiId(),
976  'wpg',
977  $page->getId()
978  );
979  $this->record_gui->setPropertyForm($form);
980  $this->record_gui->parse();
981 
982  $form->addCommandButton("updateAdvancedMetaData", $lng->txt("save"));
983  $form->addCommandButton("preview", $lng->txt("cancel"));
984 
985  return $form;
986  }
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 1088 of file class.ilWikiPageGUI.php.

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

1088  : void
1089  {
1090  global $DIC;
1091 
1092  $lng = $DIC->language();
1093 
1094  $a_tpl->addJavaScript("./Modules/Wiki/js/WikiEdit.js");
1095  $a_tpl->addOnLoadCode("il.Wiki.Edit.txt.page_exists = '" . $lng->txt("wiki_page_exists") . "';");
1096  $a_tpl->addOnLoadCode("il.Wiki.Edit.txt.new_page = '" . $lng->txt("wiki_new_page") . "';");
1097  }
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 845 of file class.ilWikiPageGUI.php.

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

Referenced by renamePage(), and renameWikiPage().

845  : void
846  {
847  $lng = $this->lng;
848  $ilCtrl = $this->ctrl;
849 
850  $this->form = new ilPropertyFormGUI();
851 
852  // new name
853  $ti = new ilTextInputGUI($lng->txt("wiki_new_page_name"), "new_page_name");
854  $ti->setMaxLength(200);
855  $ti->setSize(50);
856  $ti->setValue($this->getPageObject()->getTitle());
857  $ti->setRequired(true);
858  $this->form->addItem($ti);
859 
860  $this->form->addCommandButton("renamePage", $lng->txt("wiki_rename"));
861  $this->form->addCommandButton("preview", $lng->txt("cancel"));
862 
863  $this->form->setTitle($lng->txt("wiki_rename_page"));
864  $this->form->setFormAction($ilCtrl->getFormAction($this));
865  }
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)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initToolbar()

ilWikiPageGUI::initToolbar ( )
protected

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

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

Referenced by showPage().

467  : void
468  {
470 
471  $print_view = $this->getPrintView();
472  $modal_elements = $print_view->getModalElements($this->ctrl->getLinkTarget(
473  $this,
474  "printViewSelection"
475  ));
476  $toolbar->addComponent($modal_elements->button);
477  $toolbar->addComponent($modal_elements->modal);
478  }
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 1103 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().

1103  : void
1104  {
1105  $lng = $this->lng;
1106  $ilCtrl = $this->ctrl;
1107 
1108  $form = new ilPropertyFormGUI();
1109  $form->addCommandButton("addWikiLink", $lng->txt("wiki_add_link"));
1110  $form->addCommandButton("searchWikiLink", $lng->txt("search"));
1111 
1112  // Target page
1113  $tp = new ilTextInputGUI($this->lng->txt("wiki_target_page"), "target_page");
1114  $tp->setSize(18);
1115  $tp->setRequired(true);
1116  $tp->setInfo("...");
1117  $tp->setDataSource($ilCtrl->getLinkTarget($this, "insertWikiLinkAC", "", true));
1118  $form->addItem($tp);
1119 
1120  // Link text
1121  $lt = new ilTextInputGUI($this->lng->txt("wiki_link_text"), "link_text");
1122  $lt->setSize(18);
1123  $form->addItem($lt);
1124 
1125  //$form->setTitle($lng->txt("wiki_link"));
1126 
1127  echo $form->getHTML();
1128  exit;
1129  }
exit
Definition: login.php:28
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 1134 of file class.ilWikiPageGUI.php.

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

1134  : void
1135  {
1136  $result = array();
1137 
1138  $term = $this->wiki_request->getTerm();
1139 
1140  // if page exists, make it first entry
1141  if (ilWikiPage::_wikiPageExists($this->getPageObject()->getParentId(), $term)) {
1142  $entry = new stdClass();
1143  $entry->value = $term;
1144  $entry->label = $term;
1145  $result[] = $entry;
1146  }
1147 
1148  $res = ilWikiPage::getPagesForSearch($this->getPageObject()->getParentId(), $term);
1149 
1150  $cnt = 0;
1151  foreach ($res as $r) {
1152  if ($result[0]->value == $r) {
1153  continue;
1154  }
1155  if ($cnt++ > 19) {
1156  continue;
1157  }
1158  $entry = new stdClass();
1159  $entry->value = $r;
1160  $entry->label = $r;
1161  $result[] = $entry;
1162  }
1163 
1164  echo json_encode($result, JSON_THROW_ON_ERROR);
1165  exit;
1166  }
$res
Definition: ltiservices.php:69
exit
Definition: login.php:28
static getPagesForSearch(int $a_wiki_id, string $a_term)
static _wikiPageExists(int $a_wiki_id, string $a_title)
+ 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 930 of file class.ilWikiPageGUI.php.

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

936  : void {
937 
938  // #10040 - get note text
939  $note = $this->notes->domain()->getById($a_note_id);
940  $text = $note->getText();
941 
942  ilWikiUtil::sendNotification("comment", ilNotification::TYPE_WIKI_PAGE, $this->getWikiRefId(), $a_page_id, $text);
943  }
static sendNotification(string $a_action, int $a_type, int $a_wiki_ref_id, int $a_page_id, ?string $a_comment=null)
+ Here is the call graph for this function:

◆ postOutputProcessing()

ilWikiPageGUI::postOutputProcessing ( string  $a_output)

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

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

514  : string
515  {
516  $ilCtrl = $this->ctrl;
517 
518  $ilCtrl->setParameterByClass(
519  "ilobjwikigui",
520  "from_page",
521  ilWikiUtil::makeUrlTitle($this->wiki_request->getPage())
522  );
523  if ($this->getEnabledHref() && $this->getOutputMode() !== self::EDIT) {
525  $a_output,
526  $this->getWikiPage()->getWikiId(),
527  ($this->getOutputMode() === "offline")
528  );
529  } else {
530  $output = $a_output;
531  }
532  $ilCtrl->setParameterByClass(
533  "ilobjwikigui",
534  "from_page",
535  $this->wiki_request->getFromPage()
536  );
537 
538 
539  // metadata in print view
540  if ($this->getOutputMode() === "print" && $this->wiki instanceof ilObjWiki) {
541  $mdgui = new ilObjectMetaDataGUI($this->wiki, "wpg", $this->getId());
542  $md = $mdgui->getKeyValueList();
543  if ($md !== "") {
544  $output = str_replace("<!--COPage-PageTop-->", "<p>" . $md . "</p>", $output);
545  }
546  }
547 
548 
549  return $output;
550  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setParameterByClass(string $a_class, string $a_parameter, $a_value)
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)
This one is based on Mediawiki Parser->replaceInternalLinks since we display images in another way...
static makeUrlTitle(string $a_par)
+ Here is the call graph for this function:

◆ preview()

ilWikiPageGUI::preview ( )

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

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

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

References printViewOrderList().

714  : void
715  {
716  $this->printViewOrderList();
717  }
+ Here is the call graph for this function:

◆ printViewOrderList()

ilWikiPageGUI::printViewOrderList ( )
protected

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

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

Referenced by printViewOrder().

720  : void {
721  $ilTabs = $this->tabs_gui;
722 
723  $pg_ids = $all_pages = array();
724 
725  // coming from type selection
726  $ordering = $this->wiki_request->getPrintOrdering();
727  if (count($ordering) === 0) {
728  switch ($this->wiki_request->getSelectedPrintType()) {
729  case "wiki":
730  $all_pages = ilWikiPage::getAllWikiPages($this->getPageObject()->getWikiId());
731  foreach ($all_pages as $p) {
732  $pg_ids[] = $p["id"];
733  }
734  break;
735 
736  case "selection":
737  $pg_ids = $this->wiki_request->getWikiPageIds();
738  if (count($pg_ids) === 0) {
739  $pg_ids = [$this->wiki_request->getWikiPageId()];
740  }
741  if (count($pg_ids) > 1) {
742  break;
743  } else {
744  $wiki_page_id = array_pop($pg_ids);
745  }
746  $this->ctrl->setParameterByClass(
747  "ilObjWikiGUI",
748  "wpg_id",
749  $wiki_page_id
750  );
751  $this->ctrl->redirectByClass("ilObjWikiGUI", "printView");
752  break;
753 
754  default:
755  $this->ctrl->setParameterByClass(
756  "ilObjWikiGUI",
757  "wpg_id",
758  $this->wiki_request->getWikiPageId()
759  );
760  $this->ctrl->redirectByClass("ilObjWikiGUI", "printView");
761  break;
762  }
763  }
764  // refresh sorting
765  else {
766  asort($ordering);
767  $pg_ids = array_keys($ordering);
768  }
769 
770  $ilTabs->clearTargets();
771  $ilTabs->setBackTarget(
772  $this->lng->txt("back"),
773  $this->ctrl->getLinkTarget($this, "preview")
774  );
775 
776  if (!count($all_pages)) {
777  $all_pages = ilWikiPage::getAllWikiPages($this->getPageObject()->getWikiId());
778  }
779 
780  $tbl = new ilWikiExportOrderTableGUI(
781  $this,
782  "printViewOrderList",
783  $all_pages,
784  $pg_ids
785  );
786  $this->tpl->setContent($tbl->getHTML());
787  }
static getAllWikiPages(int $a_wiki_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:
+ Here is the caller graph for this function:

◆ printViewSelection()

ilWikiPageGUI::printViewSelection ( )

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

References getPrintView().

708  : void
709  {
710  $view = $this->getPrintView();
711  $view->sendForm();
712  }
+ Here is the call graph for this function:

◆ redrawHeaderAction()

ilWikiPageGUI::redrawHeaderAction ( )

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

References addHeaderAction(), and exit.

343  : void
344  {
345  echo $this->addHeaderAction(true);
346  exit;
347  }
exit
Definition: login.php:28
addHeaderAction(bool $a_redraw=false)
+ Here is the call graph for this function:

◆ renamePage()

ilWikiPageGUI::renamePage ( )

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

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

867  : void
868  {
869  $tpl = $this->tpl;
870  $lng = $this->lng;
871  $ilCtrl = $this->ctrl;
872  $ilAccess = $this->access;
873 
874  $this->initRenameForm();
875  if ($this->form->checkInput()) {
876  if (($ilAccess->checkAccess("edit_content", "", $this->requested_ref_id) && !$this->getPageObject()->getBlocked())
877  || $ilAccess->checkAccess("write", "", $this->requested_ref_id)) {
878  $new_name = $this->form->getInput("new_page_name");
879 
880  $page_title = ilWikiUtil::makeDbTitle($new_name);
881  $pg_id = ilWikiPage::_getPageIdForWikiTitle($this->getPageObject()->getWikiId(), $page_title);
882 
883  // we might get the same page id back here, if the page
884  // name only differs in diacritics
885  // see bug http://www.ilias.de/mantis/view.php?id=11226
886  if ($pg_id > 0 && $pg_id != $this->getPageObject()->getId()) {
887  $this->tpl->setOnScreenMessage('failure', $lng->txt("wiki_page_already_exists"));
888  } else {
889  $new_name = $this->getPageObject()->rename($new_name);
890  $ilCtrl->setParameterByClass("ilobjwikigui", "page", ilWikiUtil::makeUrlTitle($new_name));
891  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
892  $ilCtrl->redirect($this, "preview");
893  }
894  }
895  }
896 
897  $this->form->setValuesByPost();
898  $tpl->setContent($this->form->getHTML());
899  }
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 _getPageIdForWikiTitle(int $a_wiki_id, string $a_title)
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
ilAccessHandler $access
form( $class_path, string $cmd)
static makeUrlTitle(string $a_par)
static makeDbTitle(string $a_par)
+ Here is the call graph for this function:

◆ renameWikiPage()

ilWikiPageGUI::renameWikiPage ( )

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

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

829  : void
830  {
831  $ilAccess = $this->access;
832  $tpl = $this->tpl;
833 
834  if (($ilAccess->checkAccess(
835  "edit_content",
836  "",
837  $this->requested_ref_id
838  ) && !$this->getPageObject()->getBlocked())
839  || $ilAccess->checkAccess("write", "", $this->requested_ref_id)) {
840  $this->initRenameForm();
841  $tpl->setContent($this->form->getHTML());
842  }
843  }
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
ilAccessHandler $access
form( $class_path, string $cmd)
+ Here is the call graph for this function:

◆ searchWikiLinkAC()

ilWikiPageGUI::searchWikiLinkAC ( )

Search wiki link list.

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

1171  : void
1172  {
1173  $lng = $this->lng;
1174 
1175  $lng->loadLanguageModule("wiki");
1176 
1177  $tpl = new ilTemplate("tpl.wiki_ac_search_result.html", true, true, "Modules/Wiki");
1178  $term = $this->wiki_request->getTerm();
1179 
1180  $pages = ilObjWiki::_performSearch($this->getPageObject()->getParentId(), $term);
1181 
1182  $found = array();
1183  foreach ($pages as $page) {
1184  $found[] = array("page_id" => $page["page_id"], "title" => ilWikiPage::lookupTitle($page["page_id"]));
1185  }
1186 
1187  // sort if all pages are listed
1188  if ($term === "") {
1189  $found = ilArrayUtil::sortArray($found, "title", "asc");
1190  }
1191 
1192  foreach ($found as $f) {
1193  $tpl->setCurrentBlock("item");
1194  $tpl->setVariable("WIKI_TITLE", $f["title"]);
1196  }
1197 
1198  if (count($pages) === 0) {
1199  $tpl->setVariable("INFOTEXT", str_replace("$1", $term, $lng->txt("wiki_no_page_found")));
1200  } elseif ($term === '') {
1201  $tpl->setVariable("INFOTEXT", $lng->txt("wiki_no_search_term"));
1202  } else {
1203  $tpl->setVariable("INFOTEXT", str_replace("$1", $term, $lng->txt("wiki_pages_found")));
1204  }
1205 
1206  $tpl->setVariable("TXT_BACK", $lng->txt("back"));
1207  echo $tpl->get();
1208  exit;
1209  }
exit
Definition: login.php:28
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...
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.
static lookupTitle(int $a_page_id)
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 67 of file class.ilWikiPageGUI.php.

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

67  : void
68  {
69  $ilHelp = $this->help;
70  $ilHelp->setScreenIdComponent("copgwpg");
71  }
setScreenIdComponent(string $a_comp)
+ Here is the call graph for this function:

◆ setSideBlock()

ilWikiPageGUI::setSideBlock ( )

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

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

Referenced by preview(), and whatLinksHere().

242  : void
243  {
245  $this->getWikiPage()->getId(),
246  $this->wiki_ref_id,
247  $this->getWikiPage()
248  );
249  }
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 83 of file class.ilWikiPageGUI.php.

83  : void
84  {
85  $this->wiki = $a_val;
86  }

◆ setWikiPage()

ilWikiPageGUI::setWikiPage ( ilWikiPage  $a_wikipage)

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

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

217  : void
218  {
219  $this->setPageObject($a_wikipage);
220  }
setPageObject(ilPageObject $a_pg_obj)
+ Here is the call graph for this function:

◆ setWikiRefId()

ilWikiPageGUI::setWikiRefId ( int  $a_ref_id)

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

Referenced by __construct().

73  : void
74  {
75  $this->wiki_ref_id = $a_ref_id;
76  }
+ Here is the caller graph for this function:

◆ showPage()

ilWikiPageGUI::showPage ( )

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

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

Referenced by preview().

450  : string
451  {
452  if ($this->getOutputMode() === ilPageObjectGUI::PRESENTATION) {
453  $this->initToolbar();
454  }
455  $this->setTemplateOutput(false);
456 
457  if (!$this->getAbstractOnly()) {
458  $this->setPresentationTitle($this->getWikiPage()->getTitle());
459 
460  // wiki stats clean up
461  // $this->increaseViewCount();
462  }
463 
464  return parent::showPage();
465  }
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 809 of file class.ilWikiPageGUI.php.

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

809  : void
810  {
811  $ilCtrl = $this->ctrl;
812  $lng = $this->lng;
813 
814  if (ilWikiPerm::check("activate_wiki_protection", $this->requested_ref_id)) {
815  $this->getPageObject()->setBlocked(false);
816  $this->getPageObject()->update();
817 
818  $this->tpl->setOnScreenMessage('success', $lng->txt("wiki_page_unblocked"), true);
819  }
820 
821  $ilCtrl->redirect($this, "preview");
822  }
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 1060 of file class.ilWikiPageGUI.php.

References ilPageObjectGUI\$access, ilPageObjectGUI\$ctrl, ilPageObjectGUI\$lng, ilPageObjectGUI\getPageObject(), 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  $this->getPageObject()->hideAdvancedMetadata(false);
1072  $this->getPageObject()->update();
1073 
1074  $this->tpl->setOnScreenMessage('success', $lng->txt("settings_saved"), true);
1075  $ilCtrl->redirect($this, "preview");
1076  }
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 1016 of file class.ilWikiPageGUI.php.

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

1016  : void
1017  {
1018  $ilCtrl = $this->ctrl;
1019  $lng = $this->lng;
1020  $ilAccess = $this->access;
1021 
1022  if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id) &&
1023  !$ilAccess->checkAccess("edit_page_meta", "", $this->wiki_ref_id)) {
1024  return;
1025  }
1026 
1027  $form = $this->initAdvancedMetaDataForm();
1028 
1029  // needed for proper advanced MD validation
1030  $form->checkInput();
1031  if (!$this->record_gui->importEditFormPostValues()) {
1032  $this->editAdvancedMetaData($form); // #16470
1033  return;
1034  }
1035 
1036  if ($this->record_gui->writeEditForm()) {
1037  $this->tpl->setOnScreenMessage('success', $lng->txt("settings_saved"), true);
1038  }
1039  $ilCtrl->redirect($this, "preview");
1040  }
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 945 of file class.ilWikiPageGUI.php.

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

950  : void {
952  }
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 552 of file class.ilWikiPageGUI.php.

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

552  : void
553  {
554  $tpl = $this->tpl;
555 
556  $this->setSideBlock();
557  $table_gui = new ilWikiPagesTableGUI(
558  $this,
559  "whatLinksHere",
560  $this->getWikiPage()->getWikiId(),
562  $this->wiki_request->getWikiPageId()
563  );
564 
565  $tpl->setContent($table_gui->getHTML());
566  }
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

◆ $fill_on_load_code

bool ilWikiPageGUI::$fill_on_load_code = false
protected

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

◆ $http

ILIAS HTTP Services ilWikiPageGUI::$http
protected

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

◆ $notes

ILIAS Notes Service ilWikiPageGUI::$notes
protected

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

◆ $record_gui

ilAdvancedMDRecordGUI ilWikiPageGUI::$record_gui = null
protected

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

◆ $settings

ilSetting ilWikiPageGUI::$settings
protected

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

Referenced by preview().

◆ $wiki

ilObjWiki ilWikiPageGUI::$wiki
protected

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

Referenced by getWiki().

◆ $wiki_ref_id

int ilWikiPageGUI::$wiki_ref_id = 0
protected

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

Referenced by getWikiRefId().

◆ $wiki_request

ILIAS Wiki Editing EditingGUIRequest ilWikiPageGUI::$wiki_request
protected

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


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