ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilObjWikiGUI Class Reference

Class ilObjWikiGUI. More...

+ Inheritance diagram for ilObjWikiGUI:
+ Collaboration diagram for ilObjWikiGUI:

Public Member Functions

 ilObjWikiGUI ($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
 Constructor @access public. More...
 
 executeCommand ()
 execute command More...
 
 isOnlineHelpWiki ()
 Is wiki an online help wiki? More...
 
 viewObject ()
 Start page. More...
 
 saveObject ()
 save object @access public More...
 
 afterSave ($newObj)
 save object @access public More...
 
 infoScreenObject ()
 this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed More...
 
 infoScreen ()
 show information screen More...
 
 gotoStartPageObject ()
 Go to start page. More...
 
 addPageTabs ()
 Add Page Tabs. More...
 
 addPagesSubTabs ()
 Add Pages SubTabs. More...
 
 getTabs ($tabs_gui)
 get tabs @access public More...
 
 setSettingsSubTabs ($a_active)
 Set sub tabs. More...
 
 editSettingsObject ()
 Edit settings. More...
 
 initSettingsForm ($a_mode="edit")
 Init Settings Form. More...
 
 getSettingsFormValues ($a_mode="edit")
 
 saveSettingsObject ()
 Save Settings. More...
 
 listContributorsObject ()
 List all contributors. More...
 
 saveGradingObject ()
 Save grading. More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 viewPageObject ()
 view wiki page More...
 
 allPagesObject ()
 All pages of wiki. More...
 
 popularPagesObject ()
 Popular pages. More...
 
 orphanedPagesObject ()
 Orphaned pages. More...
 
 gotoPageObject ($a_page="")
 Go to specific page. More...
 
 randomPageObject ()
 Go to random page. More...
 
 recentChangesObject ()
 Recent Changes. More...
 
 setSideBlock ($a_wpg_id=0)
 Side column. More...
 
 newPagesObject ()
 Latest pages. More...
 
 printViewObject ($a_pdf_export=false)
 
 pdfExportObject ()
 
 performSearchObject ()
 Search. More...
 
 setContentStyleSheet ($a_tpl=null)
 Set content style sheet. More...
 
 editStylePropertiesObject ()
 Edit style properties. More...
 
 initStylePropertiesForm ()
 Init style properties form. More...
 
 createStyleObject ()
 Create Style. More...
 
 editStyleObject ()
 Edit Style. More...
 
 deleteStyleObject ()
 Delete Style. More...
 
 saveStyleSettingsObject ()
 Save style settings. More...
 
 editImportantPagesObject ()
 List important pages. More...
 
 addImportantPageObject ()
 Add important pages. More...
 
 confirmRemoveImportantPagesObject ()
 Confirm important pages deletion. More...
 
 removeImportantPagesObject ()
 Remove important pages. More...
 
 saveOrderingAndIndentObject ()
 Save important pages ordering and indentation. More...
 
 setAsStartPageObject ()
 Confirm important pages deletion. More...
 
 exportHTML ()
 Create html package. More...
 
 getSubObjectTitle ($a_id, $a_type)
 Used for rating export. More...
 
 showTemplateSelectionObject ()
 Show template selection. More...
 
 initTemplateSelectionForm ()
 Init template selection form. More...
 
 createPageUsingTemplateObject ()
 Save creation with template form. More...
 
 cancelCreationPageUsingTemplateObject ()
 Cancel page creation using a template. More...
 
 initUserHTMLExportObject ()
 Export html (as user) More...
 
 startUserHTMLExportObject ()
 Export html (as user) More...
 
 getUserHTMLExportProgressObject ()
 Get user html export progress. More...
 
 downloadUserHTMLExportObject ()
 Download user html export file. More...
 
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor @access public. More...
 
executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ($in_rep=false)
 cancel action and go back to previous page @access public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 

Static Public Member Functions

static _goto ($a_target)
 
static getGotoLink ($a_ref_id, $a_page="")
 Get goto link. More...
 
static renderSideBlock ($a_wpg_id, $a_wiki_ref_id, $a_wp=null)
 Side column. More...
 
static lookupSubObjectTitle ($a_wiki_id, $a_page_id)
 Get title for wiki page (used in ilNotesGUI) More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 

Protected Member Functions

 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getPrintPageIds ()
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 prepareOutput ()
 prepare output More...
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs @access public More...
 
 setAdminTabs ()
 set admin tabs @access public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste More...
 
 getTabs (&$tabs_gui)
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings ($column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Protected Attributes

 $log
 
- Protected Attributes inherited from ilObjectGUI
 $tmp_import_dir
 

Additional Inherited Members

- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $ilias
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Detailed Description

Member Function Documentation

◆ _goto()

static ilObjWikiGUI::_goto (   $a_target)
static

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

1046 {
1047 global $ilAccess, $ilErr, $lng, $ilNavigationHistory;
1048
1049 $i = strpos($a_target, "_");
1050 if ($i > 0)
1051 {
1052 $a_page = substr($a_target, $i+1);
1053 $a_target = substr($a_target, 0, $i);
1054 }
1055
1056 if ($a_target == "wpage")
1057 {
1058 $a_page_arr = explode("_", $a_page);
1059 $wpg_id = (int) $a_page_arr[0];
1060 $ref_id = (int) $a_page_arr[1];
1061 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
1062 $w_id = ilWikiPage::lookupWikiId($wpg_id);
1063 if ($ref_id > 0)
1064 {
1065 $refs = array($ref_id);
1066 }
1067 else
1068 {
1069 $refs = ilObject::_getAllReferences($w_id);
1070 }
1071 foreach ($refs as $r)
1072 {
1073 if ($ilAccess->checkAccess("read", "", $r))
1074 {
1075 $a_target = $r;
1076 $a_page = ilWikiPage::lookupTitle($wpg_id);
1077 }
1078 }
1079 }
1080
1081 if ($ilAccess->checkAccess("read", "", $a_target))
1082 {
1083 $_GET["cmd"] = "viewPage";
1084 $_GET["ref_id"] = $a_target;
1085 $_GET["page"] = $a_page;
1086 $_GET["baseClass"] = "ilwikihandlergui";
1087 $_GET["cmdClass"] = "ilobjwikigui";
1088/* if ($a_page != "")
1089 {
1090 $add = "&page=".rawurlencode($_GET["page"]);
1091 $ilNavigationHistory->addItem($_GET["ref_id"],
1092 "./goto.php?target=wiki_".$_GET["ref_id"].$add, "wiki");
1093 }*/
1094 include("ilias.php");
1095 exit;
1096 }
1097 else if ($ilAccess->checkAccess("visible", "", $a_target))
1098 {
1099 ilObjectGUI::_gotoRepositoryNode($tarr[0], "infoScreen");
1100 }
1101 else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
1102 {
1103 ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
1106 }
1107
1108 $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
1109 }
$_GET["client_id"]
static _gotoRepositoryNode($a_ref_id, $a_cmd="frameset")
Goto repository root.
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static _getAllReferences($a_id)
get all reference ids of object
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static lookupTitle($a_page_id)
Checks whether a page with given title exists.
static lookupWikiId($a_page_id)
Lookup wiki id.
$r
Definition: example_031.php:79
exit
Definition: login.php:54

References $_GET, $ilErr, ilObjectGUI\$lng, $r, ilObjectGUI\$ref_id, ilObject\_getAllReferences(), ilObjectGUI\_gotoRepositoryNode(), ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), exit, ilWikiPage\lookupTitle(), ilWikiPage\lookupWikiId(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ addImportantPageObject()

ilObjWikiGUI::addImportantPageObject ( )

Add important pages.

Parameters

return

Definition at line 1814 of file class.ilObjWikiGUI.php.

1815 {
1816 global $ilCtrl, $lng;
1817
1818 $this->checkPermission("edit_wiki_navigation");
1819
1820 if ($_POST["imp_page_id"] > 0)
1821 {
1822 $this->object->addImportantPage((int) $_POST["imp_page_id"]);
1823 ilUtil::sendSuccess($lng->txt("wiki_imp_page_added"), true);
1824 }
1825 $ilCtrl->redirect($this, "editImportantPages");
1826 }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18

References $_POST, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\checkPermission(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjWikiGUI::addLocatorItems ( )

should be overwritten to add object specific items (repository items are preloaded)

Reimplemented from ilObjectGUI.

Definition at line 1034 of file class.ilObjWikiGUI.php.

1035 {
1036 global $ilLocator;
1037
1038 if (is_object($this->object))
1039 {
1040 $ilLocator->addItem($this->object->getTitle(),
1041 $this->getGotoLink($this->object->getRefId()), "", $_GET["ref_id"]);
1042 }
1043 }

References $_GET.

◆ addPagesSubTabs()

ilObjWikiGUI::addPagesSubTabs ( )

Add Pages SubTabs.

Definition at line 506 of file class.ilObjWikiGUI.php.

507 {
508 global $ilTabs, $ilCtrl;
509
510 $ilTabs->activateTab("wiki_pages");
511
512 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
513 $ilCtrl->setParameter($this, "wpg_id",
514 ilWikiPage::getPageIdForTitle($this->object->getId(),
516 $ilCtrl->setParameter($this, "page", ilWikiUtil::makeUrlTitle($_GET["page"]));
517 $ilTabs->addSubTabTarget("wiki_all_pages",
518 $this->ctrl->getLinkTarget($this, "allPages"), "allPages");
519 $ilTabs->addSubTabTarget("wiki_recent_changes",
520 $this->ctrl->getLinkTarget($this, "recentChanges"), "recentChanges");
521 $ilTabs->addSubTabTarget("wiki_new_pages",
522 $this->ctrl->getLinkTarget($this, "newPages"), "newPages");
523 $ilTabs->addSubTabTarget("wiki_popular_pages",
524 $this->ctrl->getLinkTarget($this, "popularPages"), "popularPages");
525 $ilTabs->addSubTabTarget("wiki_orphaned_pages",
526 $this->ctrl->getLinkTarget($this, "orphanedPages"), "orphanedPages");
527 }
static getPageIdForTitle($a_wiki_id, $a_title)
Get wiki page object for id and title.
static makeUrlTitle($a_par)
Set page parameter for Url Embedding.
static makeDbTitle($a_par)
Handle page GET parameter.

References $_GET, $ilCtrl, ilWikiPage\getPageIdForTitle(), ilWikiUtil\makeDbTitle(), and ilWikiUtil\makeUrlTitle().

Referenced by allPagesObject(), newPagesObject(), orphanedPagesObject(), popularPagesObject(), and recentChangesObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addPageTabs()

ilObjWikiGUI::addPageTabs ( )

Add Page Tabs.

Definition at line 487 of file class.ilObjWikiGUI.php.

488 {
489 global $ilTabs, $ilCtrl;
490
491 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
492 $ilCtrl->setParameter($this, "wpg_id",
493 ilWikiPage::getPageIdForTitle($this->object->getId(), ilWikiUtil::makeDbTitle($_GET["page"])));
494 $ilCtrl->setParameter($this, "page", ilWikiUtil::makeUrlTitle($_GET["page"]));
495 $ilTabs->addTarget("wiki_what_links_here",
496 $this->ctrl->getLinkTargetByClass("ilwikipagegui",
497 "whatLinksHere"), "whatLinksHere");
498 $ilTabs->addTarget("wiki_print_view",
499 $this->ctrl->getLinkTargetByClass("ilwikipagegui",
500 "printViewSelection"), "printViewSelection");
501 }

References $_GET, $ilCtrl, ilWikiPage\getPageIdForTitle(), ilWikiUtil\makeDbTitle(), and ilWikiUtil\makeUrlTitle().

+ Here is the call graph for this function:

◆ afterSave()

ilObjWikiGUI::afterSave (   $newObj)

save object @access public

Definition at line 345 of file class.ilObjWikiGUI.php.

346 {
347 global $ilSetting;
348
349 $newObj->setTitle($this->form_gui->getInput("title"));
350 $newObj->setDescription($this->form_gui->getInput("description"));
351 $newObj->setIntroduction($this->form_gui->getInput("intro"));
352 $newObj->setStartPage($this->form_gui->getInput("startpage"));
353 $newObj->setShortTitle($this->form_gui->getInput("shorttitle"));
354 $newObj->setRating($this->form_gui->getInput("rating"));
355 // $newObj->setRatingAsBlock($this->form_gui->getInput("rating_side"));
356 $newObj->setRatingForNewPages($this->form_gui->getInput("rating_new"));
357 $newObj->setRatingCategories($this->form_gui->getInput("rating_ext"));
358
359 $newObj->setRatingOverall($this->form_gui->getInput("rating_overall"));
360 $newObj->setPageToc($this->form_gui->getInput("page_toc"));
361
362
363
364 if (!$ilSetting->get("disable_comments"))
365 {
366 $newObj->setPublicNotes($this->form_gui->getInput("public_notes"));
367 }
368 $newObj->setOnline($this->form_gui->getInput("online"));
369 $newObj->update();
370
371 // always send a message
372 ilUtil::sendSuccess($this->lng->txt("object_added"),true);
373 ilUtil::redirect(ilObjWikiGUI::getGotoLink($newObj->getRefId()));
374 }
static getGotoLink($a_ref_id, $a_page="")
Get goto link.
static redirect($a_script)
http redirect to other script
global $ilSetting
Definition: privfeed.php:40

References $ilSetting, getGotoLink(), ilUtil\redirect(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ allPagesObject()

ilObjWikiGUI::allPagesObject ( )

All pages of wiki.

Definition at line 1199 of file class.ilObjWikiGUI.php.

1200 {
1201 global $tpl;
1202
1203 $this->checkPermission("read");
1204
1205 include_once("./Modules/Wiki/classes/class.ilWikiPagesTableGUI.php");
1206
1207 $this->addPagesSubTabs();
1208
1209 $table_gui = new ilWikiPagesTableGUI($this, "allPages",
1210 $this->object->getId(), IL_WIKI_ALL_PAGES);
1211
1212 $this->setSideBlock();
1213 $tpl->setContent($table_gui->getHTML());
1214 }
const IL_WIKI_ALL_PAGES
addPagesSubTabs()
Add Pages SubTabs.
setSideBlock($a_wpg_id=0)
Side column.
TableGUI class for wiki pages table.

References ilObjectGUI\$tpl, addPagesSubTabs(), ilObjectGUI\checkPermission(), IL_WIKI_ALL_PAGES, and setSideBlock().

+ Here is the call graph for this function:

◆ cancelCreationPageUsingTemplateObject()

ilObjWikiGUI::cancelCreationPageUsingTemplateObject ( )

Cancel page creation using a template.

Definition at line 2051 of file class.ilObjWikiGUI.php.

2052 {
2053 global $ilCtrl;
2054
2055 // redirect to newly created page
2056 $ilCtrl->setParameterByClass("ilwikipagegui", "page", ilWikiUtil::makeUrlTitle(($_GET["from_page"])));
2057 $ilCtrl->redirectByClass("ilwikipagegui", "preview");
2058 }

References $_GET, $ilCtrl, and ilWikiUtil\makeUrlTitle().

+ Here is the call graph for this function:

◆ checkPermissionBool()

ilObjWikiGUI::checkPermissionBool (   $a_perm,
  $a_cmd = "",
  $a_type = "",
  $a_ref_id = null 
)
protected

Check permission.

Parameters
string$a_perm
string$a_cmd
string$a_type
int$a_ref_id
Returns
bool

Reimplemented from ilObjectGUI.

Definition at line 2069 of file class.ilObjWikiGUI.php.

2070 {
2071 if($a_perm == "create")
2072 {
2073 return parent::checkPermissionBool($a_perm, $a_cmd, $a_type, $a_ref_id);
2074 }
2075 else
2076 {
2077 if (!$a_ref_id)
2078 {
2079 $a_ref_id = $this->object->getRefId();
2080 }
2081 include_once("./Modules/Wiki/classes/class.ilWikiPerm.php");
2082 return ilWikiPerm::check($a_perm, $a_ref_id, $a_cmd);
2083 }
2084 }
static check($a_perm, $a_ref_id, $a_cmd="")
Check permission.

References ilWikiPerm\check().

Referenced by saveObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirmRemoveImportantPagesObject()

ilObjWikiGUI::confirmRemoveImportantPagesObject ( )

Confirm important pages deletion.

Definition at line 1831 of file class.ilObjWikiGUI.php.

1832 {
1833 global $ilCtrl, $tpl, $lng;
1834
1835 if (!is_array($_POST["imp_page_id"]) || count($_POST["imp_page_id"]) == 0)
1836 {
1837 ilUtil::sendInfo($lng->txt("no_checkbox"), true);
1838 $ilCtrl->redirect($this, "editImportantPages");
1839 }
1840 else
1841 {
1842 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1843 $cgui = new ilConfirmationGUI();
1844 $cgui->setFormAction($ilCtrl->getFormAction($this));
1845 $cgui->setHeaderText($lng->txt("wiki_sure_remove_imp_pages"));
1846 $cgui->setCancel($lng->txt("cancel"), "editImportantPages");
1847 $cgui->setConfirm($lng->txt("remove"), "removeImportantPages");
1848
1849 foreach ($_POST["imp_page_id"] as $i)
1850 {
1851 $cgui->addItem("imp_page_id[]", $i, ilWikiPage::lookupTitle((int) $i));
1852 }
1853
1854 $tpl->setContent($cgui->getHTML());
1855 }
1856 }
Confirmation screen class.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References $_POST, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilWikiPage\lookupTitle(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ createPageUsingTemplateObject()

ilObjWikiGUI::createPageUsingTemplateObject ( )

Save creation with template form.

Definition at line 2024 of file class.ilObjWikiGUI.php.

2025 {
2026 global $tpl, $lng, $ilCtrl;
2027
2028 $form = $this->initTemplateSelectionForm();
2029 if ($form->checkInput())
2030 {
2031 $a_page = $_POST["page"];
2032 $this->object->createWikiPage($a_page, (int) $_POST["page_templ"]);
2033
2034 // redirect to newly created page
2035 $ilCtrl->setParameterByClass("ilwikipagegui", "page", ilWikiUtil::makeUrlTitle(($a_page)));
2036 $ilCtrl->redirectByClass("ilwikipagegui", "edit");
2037
2038 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
2039 $ilCtrl->redirect($this, "");
2040 }
2041 else
2042 {
2043 $form->setValuesByPost();
2044 $tpl->setContent($form->getHtml());
2045 }
2046 }
initTemplateSelectionForm()
Init template selection form.

References $_POST, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, initTemplateSelectionForm(), ilWikiUtil\makeUrlTitle(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ createStyleObject()

ilObjWikiGUI::createStyleObject ( )

Create Style.

Definition at line 1708 of file class.ilObjWikiGUI.php.

1709 {
1710 global $ilCtrl;
1711
1712 $ilCtrl->redirectByClass("ilobjstylesheetgui", "create");
1713 }

References $ilCtrl.

◆ deleteStyleObject()

ilObjWikiGUI::deleteStyleObject ( )

Delete Style.

Definition at line 1728 of file class.ilObjWikiGUI.php.

1729 {
1730 global $ilCtrl;
1731
1732 $ilCtrl->redirectByClass("ilobjstylesheetgui", "delete");
1733 }

References $ilCtrl.

◆ downloadUserHTMLExportObject()

ilObjWikiGUI::downloadUserHTMLExportObject ( )

Download user html export file.

Definition at line 2136 of file class.ilObjWikiGUI.php.

2137 {
2138 $this->log->debug("download");
2139 $this->checkPermission("wiki_html_export");
2140 $this->object->deliverUserHTMLExport();
2141 }

References ilObjectGUI\checkPermission().

+ Here is the call graph for this function:

◆ editImportantPagesObject()

ilObjWikiGUI::editImportantPagesObject ( )

List important pages.

Definition at line 1761 of file class.ilObjWikiGUI.php.

1762 {
1763 global $tpl, $ilToolbar, $ilTabs, $lng, $ilCtrl;
1764
1765 $this->checkPermission("edit_wiki_navigation");
1766
1767 ilUtil::sendInfo($lng->txt("wiki_navigation_info"));
1768
1769 $ipages = ilObjWiki::_lookupImportantPagesList($this->object->getId());
1770 $ipages_ids = array();
1771 foreach ($ipages as $i)
1772 {
1773 $ipages_ids[] = $i["page_id"];
1774 }
1775
1776 // list pages
1777 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
1778 $pages = ilWikiPage::getAllPages($this->object->getId());
1779 $options = array("" => $lng->txt("please_select"));
1780 foreach ($pages as $p)
1781 {
1782 if (!in_array($p["id"], $ipages_ids))
1783 {
1784 $options[$p["id"]] = ilUtil::shortenText($p["title"], 60, true);
1785 }
1786 }
1787 if (count($options) > 0)
1788 {
1789 include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
1790 $si = new ilSelectInputGUI($lng->txt("wiki_pages"), "imp_page_id");
1791 $si->setOptions($options);
1792 $si->setInfo($lng->txt(""));
1793 $ilToolbar->addInputItem($si);
1794 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1795 $ilToolbar->addFormButton($lng->txt("add"), "addImportantPage");
1796 }
1797
1798
1799 $ilTabs->activateTab("settings");
1800 $this->setSettingsSubTabs("imp_pages");
1801
1802 include_once("./Modules/Wiki/classes/class.ilImportantPagesTableGUI.php");
1803 $imp_table = new ilImportantPagesTableGUI($this, "editImportantPages");
1804
1805 $tpl->setContent($imp_table->getHTML());
1806 }
setSettingsSubTabs($a_active)
Set sub tabs.
static _lookupImportantPagesList($a_wiki_id)
Get important pages list.
This class represents a selection list property in a property form.
static shortenText($a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
static getAllPages($a_wiki_id)
Get all pages of wiki
if(!is_array($argv)) $options

References $ilCtrl, ilObjectGUI\$lng, $options, $si, ilObjectGUI\$tpl, ilObjWiki\_lookupImportantPagesList(), ilObjectGUI\checkPermission(), ilWikiPage\getAllPages(), ilUtil\sendInfo(), setSettingsSubTabs(), and ilUtil\shortenText().

+ Here is the call graph for this function:

◆ editSettingsObject()

ilObjWikiGUI::editSettingsObject ( )

Edit settings.

Definition at line 682 of file class.ilObjWikiGUI.php.

683 {
684 global $tpl;
685
686 $this->checkPermission("write");
687
688 $this->setSettingsSubTabs("general_settings");
689
690 $this->initSettingsForm();
691 $this->getSettingsFormValues();
692
693 // Edit ecs export settings
694 include_once 'Modules/Wiki/classes/class.ilECSWikiSettings.php';
695 $ecs = new ilECSWikiSettings($this->object);
696 $ecs->addSettingsToForm($this->form_gui, 'wiki');
697
698 $tpl->setContent($this->form_gui->getHtml());
699 $this->setSideBlock();
700 }
Class ilECSWikiSettings.
initSettingsForm($a_mode="edit")
Init Settings Form.
getSettingsFormValues($a_mode="edit")

References ilObjectGUI\$tpl, ilObjectGUI\checkPermission(), getSettingsFormValues(), initSettingsForm(), setSettingsSubTabs(), and setSideBlock().

+ Here is the call graph for this function:

◆ editStyleObject()

ilObjWikiGUI::editStyleObject ( )

Edit Style.

Definition at line 1718 of file class.ilObjWikiGUI.php.

1719 {
1720 global $ilCtrl;
1721
1722 $ilCtrl->redirectByClass("ilobjstylesheetgui", "edit");
1723 }

References $ilCtrl.

◆ editStylePropertiesObject()

ilObjWikiGUI::editStylePropertiesObject ( )

Edit style properties.

Definition at line 1620 of file class.ilObjWikiGUI.php.

1621 {
1622 global $ilTabs, $tpl;
1623
1624 $this->checkPermission("write");
1625
1626 $this->initStylePropertiesForm();
1627 $tpl->setContent($this->form->getHTML());
1628
1629 $ilTabs->activateTab("settings");
1630 $this->setSettingsSubTabs("style");
1631
1632 $this->setSideBlock();
1633 }
initStylePropertiesForm()
Init style properties form.

References ilObjectGUI\$tpl, ilObjectGUI\checkPermission(), initStylePropertiesForm(), setSettingsSubTabs(), and setSideBlock().

+ Here is the call graph for this function:

◆ executeCommand()

ilObjWikiGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

Definition at line 53 of file class.ilObjWikiGUI.php.

54 {
55 global $ilUser, $ilCtrl, $tpl, $ilTabs, $ilAccess;
56
57 $next_class = $this->ctrl->getNextClass($this);
58 $cmd = $this->ctrl->getCmd();
59
60 $this->prepareOutput();
61
62 // see ilWikiPageGUI::printViewOrderList()
63 // printView() and pdfExport() cannot be in ilWikiPageGUI because of stylesheet confusion
64 if($cmd == "printView" || $cmd == "pdfExport")
65 {
66 $next_class = null;
67 }
68
69 switch($next_class)
70 {
71 case "ilinfoscreengui":
72 $this->checkPermission("visible");
73 $this->addHeaderAction();
74 $this->infoScreen(); // forwards command
75 break;
76
77 case 'ilpermissiongui':
78 $this->addHeaderAction();
79 $ilTabs->activateTab("perm_settings");
80 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
81 $perm_gui =& new ilPermissionGUI($this);
82 $ret =& $this->ctrl->forwardCommand($perm_gui);
83 break;
84
85 case 'ilsettingspermissiongui':
86 $this->checkPermission("write");
87 $this->addHeaderAction();
88 $ilTabs->activateTab("settings");
89 $this->setSettingsSubTabs("permission_settings");
90 include_once("Services/AccessControl/classes/class.ilSettingsPermissionGUI.php");
91 $perm_gui = new ilSettingsPermissionGUI($this);
92 $perm_gui->setPermissions(array("edit_wiki_navigation", "delete_wiki_pages", "activate_wiki_protection",
93 "wiki_html_export"));
94 $perm_gui->setRoleRequiredPermissions(array("edit_content"));
95 $perm_gui->setRoleProhibitedPermissions(array("write"));
96 $ret = $this->ctrl->forwardCommand($perm_gui);
97 break;
98
99 case 'ilwikipagegui':
100 $this->checkPermission("read");
101 include_once("./Modules/Wiki/classes/class.ilWikiPageGUI.php");
102 $wpage_gui = ilWikiPageGUI::getGUIForTitle($this->object->getId(),
103 ilWikiUtil::makeDbTitle($_GET["page"]), $_GET["old_nr"], $this->object->getRefId());
104 include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
105 $wpage_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(
106 $this->object->getStyleSheetId(), "wiki"));
107 $this->setContentStyleSheet();
108 if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()) &&
109 (!$ilAccess->checkAccess("edit_content", "", $this->object->getRefId()) ||
110 $wpage_gui->getPageObject()->getBlocked()
111 ))
112 {
113 $wpage_gui->setEnableEditing(false);
114 }
115
116 // alter title and description
117// $tpl->setTitle($wpage_gui->getPageObject()->getTitle());
118// $tpl->setDescription($this->object->getTitle());
119 if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
120 {
121 $wpage_gui->activateMetaDataEditor($this->object, "wpg", $wpage_gui->getId());
122 }
123
124 $ret = $this->ctrl->forwardCommand($wpage_gui);
125 if ($ret != "")
126 {
127 $tpl->setContent($ret);
128 }
129 break;
130
131 case 'ilobjectcopygui':
132 include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
133 $cp = new ilObjectCopyGUI($this);
134 $cp->setType('wiki');
135 $this->ctrl->forwardCommand($cp);
136 break;
137
138 case 'ilpublicuserprofilegui':
139 require_once './Services/User/classes/class.ilPublicUserProfileGUI.php';
140 $profile_gui = new ilPublicUserProfileGUI($_GET["user"]);
141 $ret = $this->ctrl->forwardCommand($profile_gui);
142 $tpl->setContent($ret);
143 break;
144
145 case "ilobjstylesheetgui":
146 include_once ("./Services/Style/classes/class.ilObjStyleSheetGUI.php");
147 $this->ctrl->setReturn($this, "editStyleProperties");
148 $style_gui = new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
149 $style_gui->omitLocator();
150 if ($cmd == "create" || $_GET["new_type"]=="sty")
151 {
152 $style_gui->setCreationMode(true);
153 }
154
155 if ($cmd == "confirmedDelete")
156 {
157 $this->object->setStyleSheetId(0);
158 $this->object->update();
159 }
160
161 $ret = $this->ctrl->forwardCommand($style_gui);
162
163 if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle")
164 {
165 $style_id = $ret;
166 $this->object->setStyleSheetId($style_id);
167 $this->object->update();
168 $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
169 }
170 break;
171
172 case "ilexportgui":
173// $this->prepareOutput();
174 $this->addHeaderAction();
175 $ilTabs->activateTab("export");
176 include_once("./Services/Export/classes/class.ilExportGUI.php");
177 $exp_gui = new ilExportGUI($this);
178 $exp_gui->addFormat("xml");
179 $exp_gui->addFormat("html", "", $this, "exportHTML");
180 $ret = $this->ctrl->forwardCommand($exp_gui);
181// $this->tpl->show();
182 break;
183
184 case "ilcommonactiondispatchergui":
185 include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
187 $this->ctrl->forwardCommand($gui);
188 break;
189
190 case "ilratinggui":
191 // for rating category editing
192 $this->checkPermission("write");
193 $this->addHeaderAction();
194 $ilTabs->activateTab("settings");
195 $this->setSettingsSubTabs("rating_categories");
196 include_once("Services/Rating/classes/class.ilRatingGUI.php");
197 $gui = new ilRatingGUI();
198 $gui->setObject($this->object->getId(), $this->object->getType());
199 $gui->setExportCallback(array($this, "getSubObjectTitle"), $this->lng->txt("page"));
200 $this->ctrl->forwardCommand($gui);
201 break;
202
203 case "ilwikistatgui":
204 $this->checkPermission("statistics_read");
205
206 $this->addHeaderAction();
207 $ilTabs->activateTab("statistics");
208
209 include_once "Modules/Wiki/classes/class.ilWikiStatGUI.php";
210 $gui = new ilWikiStatGUI($this->object->getId());
211 $this->ctrl->forwardCommand($gui);
212 break;
213
214 case "ilwikipagetemplategui":
215 $this->checkPermission("write");
216 $this->addHeaderAction();
217 $ilTabs->activateTab("settings");
218 $this->setSettingsSubTabs("page_templates");
219 include_once("./Modules/Wiki/classes/class.ilWikiPageTemplateGUI.php");
220 $wptgui = new ilWikiPageTemplateGUI($this);
221 $this->ctrl->forwardCommand($wptgui);
222 break;
223
224 case 'ilobjectmetadatagui';
225 $this->checkPermission("write");
226 $this->addHeaderAction();
227 $ilTabs->activateTab("advmd");
228 include_once 'Services/Object/classes/class.ilObjectMetaDataGUI.php';
229 $md_gui = new ilObjectMetaDataGUI($this->object, "wpg");
230 $this->ctrl->forwardCommand($md_gui);
231 break;
232
233 case 'ilrepositoryobjectsearchgui':
234 $this->addHeaderAction();
235 $this->setSideBlock();
236 $ilTabs->setTabActive("wiki_search_results");
237 $ilCtrl->setReturn($this,'view');
238 include_once './Services/Search/classes/class.ilRepositoryObjectSearchGUI.php';
239 $search_gui = new ilRepositoryObjectSearchGUI(
240 $this->object->getRefId(),
241 $this,
242 'view'
243 );
244 $ilCtrl->forwardCommand($search_gui);
245 break;
246
247 default:
248 $this->addHeaderAction();
249 if(!$cmd)
250 {
251 $cmd = "infoScreen";
252 }
253 $cmd .= "Object";
254 if ($cmd != "infoScreenObject")
255 {
256 if (!in_array($cmd, array("createObject", "saveObject", "importFileObject")))
257 {
258 $this->checkPermission("read");
259 }
260 }
261 else
262 {
263 $this->checkPermission("visible");
264 }
265 $this->$cmd();
266 break;
267 }
268
269 return $ret;
270 }
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Export User Interface Class.
Class ilObjStyleSheetGUI.
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
infoScreen()
show information screen
setContentStyleSheet($a_tpl=null)
Set content style sheet.
GUI class for the workflow of copying objects.
prepareOutput()
prepare output
addHeaderAction()
Add header action menu.
Class ilObjectMetaDataGUI.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
GUI class for public user profile presentation.
Class ilRatingGUI.
UI class for handling permissions that can be configured having the write permission for an object.
static getGUIForTitle($a_wiki_id, $a_title, $a_old_nr=0, $a_wiki_ref_id=0)
Get wiki page gui for id and title.
Wiki page template gui class.
Wiki statistics GUI class.
$cmd
Definition: sahs_server.php:35
global $ilUser
Definition: imgupload.php:15

References $_GET, $cmd, $ilCtrl, $ilUser, $ret, ilObjectGUI\$tpl, ilObjectGUI\addHeaderAction(), ilObjectGUI\checkPermission(), ilObjStyleSheet\getEffectiveContentStyleId(), ilWikiPageGUI\getGUIForTitle(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), infoScreen(), ilWikiUtil\makeDbTitle(), ilObjectGUI\prepareOutput(), setContentStyleSheet(), setSettingsSubTabs(), and setSideBlock().

+ Here is the call graph for this function:

◆ exportHTML()

ilObjWikiGUI::exportHTML ( )

Create html package.

Definition at line 1922 of file class.ilObjWikiGUI.php.

1923 {
1924 require_once("./Modules/Wiki/classes/class.ilWikiHTMLExport.php");
1925 $cont_exp = new ilWikiHTMLExport($this->object);
1926 $cont_exp->buildExportFile();
1927 }
Wiki HTML exporter class.

◆ getGotoLink()

static ilObjWikiGUI::getGotoLink (   $a_ref_id,
  $a_page = "" 
)
static

Get goto link.

Definition at line 1114 of file class.ilObjWikiGUI.php.

1115 {
1116 if ($a_page == "")
1117 {
1119 }
1120
1121 $goto = "goto.php?target=wiki_".$a_ref_id."_".
1122 ilWikiUtil::makeUrlTitle($a_page);
1123
1124 return $goto;
1125 }
static _lookupStartPage($a_wiki_id)
Lookup start page.

References ilObject\_lookupObjId(), ilObjWiki\_lookupStartPage(), and ilWikiUtil\makeUrlTitle().

Referenced by afterSave(), ilObjWiki\decorateAdvMDValue(), ilWikiImportantPagesBlockGUI\fillDataSection(), ilWikiPagesTableGUI\fillRow(), ilObjWikiSubItemListGUI\getHTML(), gotoPageObject(), gotoStartPageObject(), and infoScreen().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPrintPageIds()

ilObjWikiGUI::getPrintPageIds ( )
protected

Definition at line 1457 of file class.ilObjWikiGUI.php.

1458 {
1459 // multiple ordered page ids
1460 if(is_array($_POST["wordr"]))
1461 {
1462 asort($_POST["wordr"]);
1463 $page_ids = array_keys($_POST["wordr"]);
1464 }
1465 // single page
1466 else if((int)$_GET["wpg_id"])
1467 {
1468 $page_ids = array((int)$_GET["wpg_id"]);
1469 }
1470
1471 return $page_ids;
1472 }

References $_GET, and $_POST.

Referenced by printViewObject().

+ Here is the caller graph for this function:

◆ getSettingsFormValues()

ilObjWikiGUI::getSettingsFormValues (   $a_mode = "edit")

Definition at line 863 of file class.ilObjWikiGUI.php.

864 {
865 global $lng, $ilUser;
866
867 // set values
868 if ($a_mode == "create")
869 {
870 //$values["startpage"] = $lng->txt("wiki_main_page");
871 $values["rating_new"] = true;
872
873 $values["rating_overall"] = ilObject::hasAutoRating("wiki", $_GET["ref_id"]);
874
875 $this->form_gui->setValuesByArray($values);
876 }
877 else
878 {
879 $values["online"] = $this->object->getOnline();
880 $values["title"] = $this->object->getTitle();
881 //$values["startpage"] = $this->object->getStartPage();
882 $values["startpage_id"] = ilWikiPage::_getPageIdForWikiTitle($this->object->getId(), $this->object->getStartPage());
883 $values["shorttitle"] = $this->object->getShortTitle();
884 $values["description"] = $this->object->getLongDescription();
885 $values["rating_overall"] = $this->object->getRatingOverall();
886 $values["rating"] = $this->object->getRating();
887 // $values["rating_side"] = $this->object->getRatingAsBlock();
888 $values["rating_new"] = $this->object->getRatingForNewPages();
889 $values["rating_ext"] = $this->object->getRatingCategories();
890 $values["public_notes"] = $this->object->getPublicNotes();
891 $values["intro"] = $this->object->getIntroduction();
892// $values["imp_pages"] = $this->object->getImportantPages();
893 $values["page_toc"] = $this->object->getPageToc();
894 $values["link_md_values"] = $this->object->getLinkMetadataValues();
895
896 // only set given values (because of adv. metadata)
897 $this->form_gui->setValuesByArray($values, true);
898 }
899 }
static hasAutoRating($a_type, $a_ref_id)
Check if auto rating is active for parent group/course.
static _getPageIdForWikiTitle($a_wiki_id, $a_title)
Checks whether a page with given title exists.

References $_GET, $ilUser, ilObjectGUI\$lng, ilWikiPage\_getPageIdForWikiTitle(), and ilObject\hasAutoRating().

Referenced by editSettingsObject(), and initCreationForms().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSubObjectTitle()

ilObjWikiGUI::getSubObjectTitle (   $a_id,
  $a_type 
)

Used for rating export.

Parameters
int$a_id
string$a_type
Returns
string

Definition at line 1953 of file class.ilObjWikiGUI.php.

1954 {
1955 include_once "Modules/Wiki/classes/class.ilWikiPage.php";
1956 return ilWikiPage::lookupTitle($a_id);
1957 }

References ilWikiPage\lookupTitle().

+ Here is the call graph for this function:

◆ getTabs()

ilObjWikiGUI::getTabs (   $tabs_gui)

get tabs @access public

Parameters
objecttabs gui object

Definition at line 534 of file class.ilObjWikiGUI.php.

535 {
536 global $ilCtrl, $ilAccess, $ilTabs, $lng, $ilHelp;
537
538 $ilHelp->setScreenIdComponent("wiki");
539
540 // wiki tabs
541 if (in_array($ilCtrl->getCmdClass(), array("", "ilobjwikigui",
542 "ilinfoscreengui", "ilpermissiongui", "ilexportgui", "ilratingcategorygui",
543 "ilwikistatgui", "ilwikipagetemplategui", "iladvancedmdsettingsgui", "ilsettingspermissiongui", 'ilrepositoryobjectsearchgui'
544 )) || (in_array($ilCtrl->getNextClass(), array("ilpermissiongui"))))
545 {
546 if ($_GET["page"] != "")
547 {
548 $tabs_gui->setBackTarget($lng->txt("wiki_last_visited_page"),
549 $this->getGotoLink($_GET["ref_id"],
551 }
552
553 // pages
554 if ($ilAccess->checkAccess('read', "", $this->object->getRefId()))
555 {
556 $ilTabs->addTab("wiki_pages",
557 $lng->txt("wiki_pages"),
558 $this->ctrl->getLinkTarget($this, "allPages"));
559 }
560
561 // info screen
562 if ($ilAccess->checkAccess('visible', "", $this->object->getRefId()))
563 {
564 $ilTabs->addTab("info_short",
565 $lng->txt("info_short"),
566 $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"));
567 }
568
569 // settings
570 if ($ilAccess->checkAccess('write', "", $this->object->getRefId()))
571 {
572 $ilTabs->addTab("settings",
573 $lng->txt("settings"),
574 $this->ctrl->getLinkTarget($this, "editSettings"));
575
576 // metadata
577 include_once "Services/Object/classes/class.ilObjectMetaDataGUI.php";
578 $mdgui = new ilObjectMetaDataGUI($this->object, "wpg");
579 $mdtab = $mdgui->getTab();
580 if($mdtab)
581 {
582 $ilTabs->addTab("advmd",
583 $this->lng->txt("meta_data"),
584 $mdtab);
585 }
586 }
587
588 // contributors
589 if ($ilAccess->checkAccess('write', "", $this->object->getRefId()))
590 {
591 $ilTabs->addTab("wiki_contributors",
592 $lng->txt("wiki_contributors"),
593 $this->ctrl->getLinkTarget($this, "listContributors"));
594 }
595
596 // statistics
597 if ($ilAccess->checkAccess('statistics_read', "", $this->object->getRefId()))
598 {
599 $ilTabs->addTab("statistics",
600 $lng->txt("statistics"),
601 $this->ctrl->getLinkTargetByClass("ilWikiStatGUI", "initial"));
602 }
603
604 if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
605 {
606 $ilTabs->addTab("export",
607 $lng->txt("export"),
608 $this->ctrl->getLinkTargetByClass("ilexportgui", ""));
609 }
610
611 // edit permissions
612 if ($ilAccess->checkAccess('edit_permission', "", $this->object->getRefId()))
613 {
614 $ilTabs->addTab("perm_settings",
615 $lng->txt("perm_settings"),
616 $this->ctrl->getLinkTargetByClass("ilpermissiongui", "perm"));
617 }
618 }
619 }

References $_GET, $ilCtrl, ilObjectGUI\$lng, and ilWikiUtil\makeDbTitle().

+ Here is the call graph for this function:

◆ getUserHTMLExportProgressObject()

ilObjWikiGUI::getUserHTMLExportProgressObject ( )

Get user html export progress.

Definition at line 2114 of file class.ilObjWikiGUI.php.

2115 {
2116 $this->log->debug("get progress");
2117 $this->checkPermission("wiki_html_export");
2118 $p = $this->object->getUserHTMLExportProgress();
2119
2120 include_once("./Services/UIComponent/ProgressBar/classes/class.ilProgressBar.php");
2122 $pb->setCurrent($p["progress"]);
2123
2124 $r = new stdClass();
2125 $r->progressBar = $pb->render();
2126 $r->status = $p["status"];
2127 include_once("./Services/JSON/classes/class.ilJsonUtil.php");
2128 $this->log->debug("status: ".$r->status);
2129 echo (ilJsonUtil::encode($r));
2130 exit;
2131 }
static encode($mixed, $suppress_native=false)
static getInstance()
Factory.

References $r, ilObjectGUI\checkPermission(), ilJsonUtil\encode(), exit, and ilProgressBar\getInstance().

+ Here is the call graph for this function:

◆ gotoPageObject()

ilObjWikiGUI::gotoPageObject (   $a_page = "")

Go to specific page.

Parameters
string$a_pagepage title

Definition at line 1261 of file class.ilObjWikiGUI.php.

1262 {
1263 global $ilCtrl;
1264
1265 if ($a_page == "")
1266 {
1267 $a_page = $_GET["page"];
1268 }
1269
1270 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
1271 if (ilWikiPage::_wikiPageExists($this->object->getId(),
1272 ilWikiUtil::makeDbTitle($a_page)))
1273 {
1274 // to do: get rid of this redirect
1275 ilUtil::redirect(ilObjWikiGUI::getGotoLink($this->object->getRefId(), $a_page));
1276 }
1277 else
1278 {
1279 if (!$this->object->getTemplateSelectionOnCreation())
1280 {
1281 // check length
1282 include_once("./Services/Utilities/classes/class.ilStr.php");
1283 if (ilStr::strLen(ilWikiUtil::makeDbTitle($a_page)) > 200)
1284 {
1285 ilUtil::sendFailure($this->lng->txt("wiki_page_title_too_long")." (".$a_page.")", true);
1286 $ilCtrl->setParameterByClass("ilwikipagegui", "page", ilWikiUtil::makeUrlTitle($_GET["from_page"]));
1287 $ilCtrl->redirectByClass("ilwikipagegui", "preview");
1288 }
1289 $this->object->createWikiPage($a_page);
1290
1291 // redirect to newly created page
1292 $ilCtrl->setParameterByClass("ilwikipagegui", "page", ilWikiUtil::makeUrlTitle(($a_page)));
1293 $ilCtrl->redirectByClass("ilwikipagegui", "edit");
1294 }
1295 else
1296 {
1297 $ilCtrl->setParameter($this, "page", ilWikiUtil::makeUrlTitle($_GET["page"]));
1298 $ilCtrl->setParameter($this, "from_page", ilWikiUtil::makeUrlTitle($_GET["from_page"]));
1299 $ilCtrl->redirect($this, "showTemplateSelection");
1300 }
1301 }
1302 }
static strLen($a_string)
Definition: class.ilStr.php:79
static _wikiPageExists($a_wiki_id, $a_title)
Check whether page exists for wiki or not

References $_GET, $ilCtrl, ilWikiPage\_wikiPageExists(), getGotoLink(), ilWikiUtil\makeDbTitle(), ilWikiUtil\makeUrlTitle(), ilUtil\redirect(), ilUtil\sendFailure(), and ilStr\strLen().

Referenced by randomPageObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gotoStartPageObject()

ilObjWikiGUI::gotoStartPageObject ( )

Go to start page.

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

478 {
479 global $ilCtrl;
480
481 ilUtil::redirect(ilObjWikiGUI::getGotoLink($this->object->getRefId()));
482 }

References $ilCtrl, getGotoLink(), and ilUtil\redirect().

Referenced by viewObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ilObjWikiGUI()

ilObjWikiGUI::ilObjWikiGUI (   $a_data,
  $a_id,
  $a_call_by_reference,
  $a_prepare_output = true 
)

Constructor @access public.

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

36 {
37 global $ilCtrl, $lng;
38
39 $this->type = "wiki";
40
41 $this->log = ilLoggerFactory::getLogger('wiki');
42
43 $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference,$a_prepare_output);
44 $lng->loadLanguageModule("obj");
45 $lng->loadLanguageModule("wiki");
46
47 if ($_GET["page"] != "")
48 {
49 $ilCtrl->setParameter($this, "page", ilWikiUtil::makeUrlTitle($_GET["page"]));
50 }
51 }
static getLogger($a_component_id)
Get component logger.
ilObjectGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor @access public.

References $_GET, $ilCtrl, ilObjectGUI\$lng, ilLoggerFactory\getLogger(), ilObjectGUI\ilObjectGUI(), and ilWikiUtil\makeUrlTitle().

+ Here is the call graph for this function:

◆ infoScreen()

ilObjWikiGUI::infoScreen ( )

show information screen

Definition at line 392 of file class.ilObjWikiGUI.php.

393 {
394 global $ilAccess, $ilUser, $ilTabs, $lng;
395
396 $ilTabs->activateTab("info_short");
397
398 if (!$ilAccess->checkAccess("visible", "", $this->object->getRefId()))
399 {
400 $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
401 }
402
403 include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
404 $info = new ilInfoScreenGUI($this);
405 $info->enablePrivateNotes();
406 if (trim($this->object->getIntroduction()) != "")
407 {
408 $info->addSection($lng->txt("wiki_introduction"));
409 $info->addProperty("", nl2br($this->object->getIntroduction()));
410 }
411
412 // feedback from tutor; mark, status, comment
413 include_once("./Modules/Wiki/classes/class.ilWikiContributor.php");
414 include_once("./Services/Tracking/classes/class.ilLPMarks.php");
415 $lpcomment = ilLPMarks::_lookupComment($ilUser->getId(), $this->object->getId());
416 $mark = ilLPMarks::_lookupMark($ilUser->getId(), $this->object->getId());
417 $status = ilWikiContributor::_lookupStatus($this->object->getId(), $ilUser->getId());
418 if ($lpcomment != "" || $mark != "" || $status != ilWikiContributor::STATUS_NOT_GRADED)
419 {
420 $info->addSection($this->lng->txt("wiki_feedback_from_tutor"));
421 if ($lpcomment != "")
422 {
423 $info->addProperty($this->lng->txt("wiki_comment"),
424 $lpcomment);
425 }
426 if ($mark != "")
427 {
428 $info->addProperty($this->lng->txt("wiki_mark"),
429 $mark);
430 }
431
432 if ($status == ilWikiContributor::STATUS_PASSED)
433 {
434 $info->addProperty($this->lng->txt("status"),
435 $this->lng->txt("wiki_passed"));
436 }
437 if ($status == ilWikiContributor::STATUS_FAILED)
438 {
439 $info->addProperty($this->lng->txt("status"),
440 $this->lng->txt("wiki_failed"));
441 }
442 }
443
444 /*
445 $info->enableNews();
446 if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
447 {
448 //$info->enableNewsEditing();
449 $info->setBlockProperty("news", "settings", true);
450 }*/
451
452 if ($ilAccess->checkAccess("read", "", $this->object->getRefId()))
453 {
454 $info->addButton($lng->txt("wiki_start_page"), ilObjWikiGUI::getGotoLink($this->object->getRefId()));
455 }
456
457 // general information
458 $this->lng->loadLanguageModule("meta");
459 $this->lng->loadLanguageModule("wiki");
460
461 //$info->addSection($this->lng->txt("meta_general"));
462 //$info->addProperty($this->lng->txt("mcst_nr_items"),
463 // (int) count($med_items));
464
465 // forward the command
466 $this->ctrl->forwardCommand($info);
467
468 if ($ilAccess->checkAccess("read", "", $this->object->getRefId()))
469 {
470// $this->setSideBlock();
471 }
472 }
Class ilInfoScreenGUI.
_lookupComment($a_usr_id, $a_obj_id)
_lookupMark($a_usr_id, $a_obj_id)
_lookupStatus($a_obj_id, $a_user_id)
Lookup current success status (STATUS_NOT_GRADED|STATUS_PASSED|STATUS_FAILED)
$info
Definition: example_052.php:80
redirection script todo: (a better solution should control the processing via a xml file)

References $ilUser, $info, ilObjectGUI\$lng, ilLPMarks\_lookupComment(), ilLPMarks\_lookupMark(), ilWikiContributor\_lookupStatus(), getGotoLink(), ilWikiContributor\STATUS_FAILED, ilWikiContributor\STATUS_NOT_GRADED, and ilWikiContributor\STATUS_PASSED.

Referenced by executeCommand(), and infoScreenObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ infoScreenObject()

ilObjWikiGUI::infoScreenObject ( )

this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed

Definition at line 381 of file class.ilObjWikiGUI.php.

382 {
383 $this->checkPermission("visible");
384 $this->ctrl->setCmd("showSummary");
385 $this->ctrl->setCmdClass("ilinfoscreengui");
386 $this->infoScreen();
387 }

References ilObjectGUI\checkPermission(), and infoScreen().

+ Here is the call graph for this function:

◆ initCreationForms()

ilObjWikiGUI::initCreationForms (   $a_new_type)
protected

Init creation froms.

this will create the default creation forms: new, import, clone

Parameters
string$a_new_type
Returns
array

Reimplemented from ilObjectGUI.

Definition at line 295 of file class.ilObjWikiGUI.php.

296 {
297 $this->initSettingsForm("create");
298 $this->getSettingsFormValues("create");
299
300 $forms = array(self::CFORM_NEW => $this->form_gui,
301 self::CFORM_IMPORT => $this->initImportForm($a_new_type),
302 self::CFORM_CLONE => $this->fillCloneTemplate(null, $a_new_type));
303
304 return $forms;
305 }
initImportForm($a_new_type)
Init object import form.
fillCloneTemplate($a_tpl_varname, $a_type)
Fill object clone template This method can be called from any object GUI class that wants to offer ob...

References ilObjectGUI\fillCloneTemplate(), getSettingsFormValues(), ilObjectGUI\initImportForm(), and initSettingsForm().

+ Here is the call graph for this function:

◆ initSettingsForm()

ilObjWikiGUI::initSettingsForm (   $a_mode = "edit")

Init Settings Form.

Definition at line 705 of file class.ilObjWikiGUI.php.

706 {
707 global $lng, $ilCtrl, $ilTabs, $ilSetting;
708
709 $lng->loadLanguageModule("wiki");
710 $ilTabs->activateTab("settings");
711
712 require_once("Services/Form/classes/class.ilPropertyFormGUI.php");
713 $this->form_gui = new ilPropertyFormGUI();
714
715 // Title
716 $tit = new ilTextInputGUI($lng->txt("title"), "title");
717 $tit->setRequired(true);
718 $this->form_gui->addItem($tit);
719
720 // Short Title
721 // The problem with the short title is, that it is per object
722 // and can't be a substitute for a ref id in the permanent link
723/*
724 $stit = new ilRegExpInputGUI($lng->txt("wiki_short_title"), "shorttitle");
725 $stit->setPattern("/^[^0-9][^ _\&]+$/");
726 $stit->setRequired(false);
727 $stit->setNoMatchMessage($lng->txt("wiki_msg_short_name_regexp")." & _");
728 $stit->setSize(20);
729 $stit->setMaxLength(20);
730 $stit->setInfo($lng->txt("wiki_short_title_desc2"));
731 $this->form_gui->addItem($stit);
732*/
733
734 // Description
735 $des = new ilTextAreaInputGUI($lng->txt("description"), "description");
736 $this->form_gui->addItem($des);
737
738 // Introduction
739 $intro = new ilTextAreaInputGUI($lng->txt("wiki_introduction"), "intro");
740 $intro->setCols(40);
741 $intro->setRows(4);
742 $this->form_gui->addItem($intro);
743
744 // Start Page
745 if ($a_mode == "edit")
746 {
747 $pages = ilWikiPage::getAllPages($this->object->getId());
748 foreach ($pages as $p)
749 {
750 $options[$p["id"]] = ilUtil::shortenText($p["title"], 60, true);
751 }
752 $si = new ilSelectInputGUI($lng->txt("wiki_start_page"), "startpage_id");
753 $si->setOptions($options);
754 $this->form_gui->addItem($si);
755 }
756 else
757 {
758 $sp = new ilTextInputGUI($lng->txt("wiki_start_page"), "startpage");
759 if ($a_mode == "edit")
760 {
761 $sp->setInfo($lng->txt("wiki_start_page_info"));
762 }
763 $sp->setMaxLength(200);
764 $sp->setRequired(true);
765 $this->form_gui->addItem($sp);
766 }
767
768 // Online
769 $online = new ilCheckboxInputGUI($lng->txt("online"), "online");
770 $this->form_gui->addItem($online);
771
772
773 // rating
774
775 $lng->loadLanguageModule('rating');
776 $rate = new ilCheckboxInputGUI($lng->txt('rating_activate_rating'), 'rating_overall');
777 $rate->setInfo($lng->txt('rating_activate_rating_info'));
778 $this->form_gui->addItem($rate);
779
780 $rating = new ilCheckboxInputGUI($lng->txt("wiki_activate_rating"), "rating");
781 $this->form_gui->addItem($rating);
782
783 /* always active
784 $side = new ilCheckboxInputGUI($lng->txt("wiki_activate_sideblock_rating"), "rating_side");
785 $rating->addSubItem($side);
786 */
787
788 $new = new ilCheckboxInputGUI($lng->txt("wiki_activate_new_page_rating"), "rating_new");
789 $rating->addSubItem($new);
790
791 $extended = new ilCheckboxInputGUI($lng->txt("wiki_activate_extended_rating"), "rating_ext");
792 $rating->addSubItem($extended);
793
794
795 // public comments
796 if (!$ilSetting->get("disable_comments"))
797 {
798 $comments = new ilCheckboxInputGUI($lng->txt("wiki_public_comments"), "public_notes");
799 $this->form_gui->addItem($comments);
800 }
801
802 // important pages
803// $imp_pages = new ilCheckboxInputGUI($lng->txt("wiki_important_pages"), "imp_pages");
804// $this->form_gui->addItem($imp_pages);
805
806 // page toc
807 $page_toc = new ilCheckboxInputGUI($lng->txt("wiki_page_toc"), "page_toc");
808 $page_toc->setInfo($lng->txt("wiki_page_toc_info"));
809 $this->form_gui->addItem($page_toc);
810
811 if($a_mode == "edit")
812 {
813 // advanced metadata auto-linking
814 include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
815 if(count(ilAdvancedMDRecord::_getSelectedRecordsByObject("wiki", $this->object->getId(), "wpg")) > 0)
816 {
817 $link_md = new ilCheckboxInputGUI($lng->txt("wiki_link_md_values"), "link_md_values");
818 $link_md->setInfo($lng->txt("wiki_link_md_values_info"));
819 $this->form_gui->addItem($link_md);
820 }
821
822 // additional features
823 $feat = new ilFormSectionHeaderGUI();
824 $feat->setTitle($this->lng->txt('obj_features'));
825 $this->form_gui->addItem($feat);
826
827 include_once './Services/Container/classes/class.ilContainer.php';
828 include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
830 $this->object->getId(),
831 $this->form_gui,
832 array(
834 )
835 );
836 }
837
838 // :TODO: sorting
839
840 // Form action and save button
841 $this->form_gui->setTitleIcon(ilUtil::getImagePath("icon_wiki.svg"));
842 if ($a_mode != "create")
843 {
844 $this->form_gui->setTitle($lng->txt("wiki_settings"));
845 $this->form_gui->addCommandButton("saveSettings", $lng->txt("save"));
846 }
847 else
848 {
849 $this->form_gui->setTitle($lng->txt("wiki_new"));
850 $this->form_gui->addCommandButton("save", $lng->txt("wiki_add"));
851 $this->form_gui->addCommandButton("cancel", $lng->txt("cancel"));
852 }
853
854 // set values
855 if ($a_mode == "create")
856 {
857 $ilCtrl->setParameter($this, "new_type", "wiki");
858 }
859
860 $this->form_gui->setFormAction($ilCtrl->getFormAction($this, "saveSettings"));
861 }
static _getSelectedRecordsByObject($a_obj_type, $a_obj_id, $a_sub_type="")
Get selected records by object.
This class represents a checkbox property in a property form.
This class represents a section header in a property form.
static initServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Init service settings form.
This class represents a property form user interface.
This class represents a text area property in a property form.
This class represents a text property in a property form.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)

References $ilCtrl, $ilSetting, ilObjectGUI\$lng, $options, $si, ilAdvancedMDRecord\_getSelectedRecordsByObject(), ilObjectServiceSettingsGUI\CUSTOM_METADATA, ilWikiPage\getAllPages(), ilUtil\getImagePath(), ilObjectServiceSettingsGUI\initServiceSettingsForm(), and ilUtil\shortenText().

Referenced by editSettingsObject(), initCreationForms(), saveObject(), and saveSettingsObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initStylePropertiesForm()

ilObjWikiGUI::initStylePropertiesForm ( )

Init style properties form.

Definition at line 1638 of file class.ilObjWikiGUI.php.

1639 {
1640 global $ilCtrl, $lng, $ilTabs, $ilSetting;
1641
1642 include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
1643 $lng->loadLanguageModule("style");
1644
1645 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
1646 $this->form = new ilPropertyFormGUI();
1647
1648 $fixed_style = $ilSetting->get("fixed_content_style_id");
1649 $style_id = $this->object->getStyleSheetId();
1650
1651 if ($fixed_style > 0)
1652 {
1653 $st = new ilNonEditableValueGUI($lng->txt("style_current_style"));
1654 $st->setValue(ilObject::_lookupTitle($fixed_style)." (".
1655 $this->lng->txt("global_fixed").")");
1656 $this->form->addItem($st);
1657 }
1658 else
1659 {
1660 $st_styles = ilObjStyleSheet::_getStandardStyles(true, false,
1661 $_GET["ref_id"]);
1662
1663 $st_styles[0] = $this->lng->txt("default");
1664 ksort($st_styles);
1665
1666 if ($style_id > 0)
1667 {
1668 // individual style
1669 if (!ilObjStyleSheet::_lookupStandard($style_id))
1670 {
1671 $st = new ilNonEditableValueGUI($lng->txt("style_current_style"));
1672 $st->setValue(ilObject::_lookupTitle($style_id));
1673 $this->form->addItem($st);
1674
1675//$this->ctrl->getLinkTargetByClass("ilObjStyleSheetGUI", "edit"));
1676
1677 // delete command
1678 $this->form->addCommandButton("editStyle",
1679 $lng->txt("style_edit_style"));
1680 $this->form->addCommandButton("deleteStyle",
1681 $lng->txt("style_delete_style"));
1682//$this->ctrl->getLinkTargetByClass("ilObjStyleSheetGUI", "delete"));
1683 }
1684 }
1685
1686 if ($style_id <= 0 || ilObjStyleSheet::_lookupStandard($style_id))
1687 {
1688 $style_sel = ilUtil::formSelect ($style_id, "style_id",
1689 $st_styles, false, true);
1690 $style_sel = new ilSelectInputGUI($lng->txt("style_current_style"), "style_id");
1691 $style_sel->setOptions($st_styles);
1692 $style_sel->setValue($style_id);
1693 $this->form->addItem($style_sel);
1694//$this->ctrl->getLinkTargetByClass("ilObjStyleSheetGUI", "create"));
1695 $this->form->addCommandButton("saveStyleSettings",
1696 $lng->txt("save"));
1697 $this->form->addCommandButton("createStyle",
1698 $lng->txt("sty_create_ind_style"));
1699 }
1700 }
1701 $this->form->setTitle($lng->txt("wiki_style"));
1702 $this->form->setFormAction($ilCtrl->getFormAction($this));
1703 }
This class represents a non editable value in a property form.
_getStandardStyles($a_exclude_default_style=false, $a_include_deactivated=false, $a_scope=0)
Get standard styles.
_lookupStandard($a_id)
Lookup standard flag.
static formSelect($selected, $varname, $options, $multiple=false, $direct_text=false, $size="0", $style_class="", $attribs="", $disabled=false)
Builds a select form field with options and shows the selected option first.

References $_GET, $ilCtrl, $ilSetting, ilObjectGUI\$lng, ilObjStyleSheet\_getStandardStyles(), ilObjStyleSheet\_lookupStandard(), ilObject\_lookupTitle(), and ilUtil\formSelect().

Referenced by editStylePropertiesObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initTemplateSelectionForm()

ilObjWikiGUI::initTemplateSelectionForm ( )

Init template selection form.

Definition at line 1978 of file class.ilObjWikiGUI.php.

1979 {
1980 global $lng, $ilCtrl;
1981
1982 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1983 $form = new ilPropertyFormGUI();
1984
1985 // page name
1986 $hi = new ilHiddenInputGUI("page");
1987 $hi->setValue($_GET["page"]);
1988 $form->addItem($hi);
1989
1990 // page template
1991 $radg = new ilRadioGroupInputGUI($lng->txt("wiki_page_template"), "page_templ");
1992 $radg->setRequired(true);
1993
1994 if ($this->object->getEmptyPageTemplate())
1995 {
1996 $op1 = new ilRadioOption($lng->txt("wiki_empty_page"), 0);
1997 $radg->addOption($op1);
1998 }
1999
2000 include_once("./Modules/Wiki/classes/class.ilWikiPageTemplate.php");
2001 $wt = new ilWikiPageTemplate($this->object->getId());
2002 $ts = $wt->getAllInfo(ilWikiPageTemplate::TYPE_NEW_PAGES);
2003 foreach ($ts as $t)
2004 {
2005 $op = new ilRadioOption($t["title"], $t["wpage_id"]);
2006 $radg->addOption($op);
2007 }
2008
2009 $form->addItem($radg);
2010
2011 // save and cancel commands
2012 $form->addCommandButton("createPageUsingTemplate", $lng->txt("wiki_create_page"));
2013 $form->addCommandButton("cancelCreationPageUsingTemplate", $lng->txt("cancel"));
2014
2015 $form->setTitle($lng->txt("wiki_new_page").": ".$_GET["page"]);
2016 $form->setFormAction($ilCtrl->getFormAction($this));
2017
2018 return $form;
2019 }
This class represents a hidden form property in a property form.
This class represents a property in a property form.
This class represents an option in a radio group.

References $_GET, $ilCtrl, ilObjectGUI\$lng, $t, and ilWikiPageTemplate\TYPE_NEW_PAGES.

Referenced by createPageUsingTemplateObject(), and showTemplateSelectionObject().

+ Here is the caller graph for this function:

◆ initUserHTMLExportObject()

ilObjWikiGUI::initUserHTMLExportObject ( )

Export html (as user)

Definition at line 2094 of file class.ilObjWikiGUI.php.

2095 {
2096 $this->log->debug("init");
2097 $this->checkPermission("wiki_html_export");
2098 $this->object->initUserHTMLExport();
2099 }

References ilObjectGUI\checkPermission().

+ Here is the call graph for this function:

◆ isOnlineHelpWiki()

ilObjWikiGUI::isOnlineHelpWiki ( )

Is wiki an online help wiki?

Returns
boolean true, if current wiki is an online help wiki

Definition at line 277 of file class.ilObjWikiGUI.php.

278 {
279 if (is_object($this->object))
280 {
281 return ilObjWiki::isOnlineHelpWiki($this->object->getRefId());
282 }
283 return false;
284 }
static isOnlineHelpWiki($a_ref_id)
Is wiki an online help wiki?

References ilObjWiki\isOnlineHelpWiki().

+ Here is the call graph for this function:

◆ listContributorsObject()

ilObjWikiGUI::listContributorsObject ( )

List all contributors.

Definition at line 971 of file class.ilObjWikiGUI.php.

972 {
973 global $tpl, $ilTabs;
974
975 $this->checkPermission("write");
976 $ilTabs->activateTab("wiki_contributors");
977
978 include_once("./Modules/Wiki/classes/class.ilWikiContributorsTableGUI.php");
979
980 $table_gui = new ilWikiContributorsTableGUI($this, "listContributors",
981 $this->object->getId());
982
983 $tpl->setContent($table_gui->getHTML());
984
985 $this->setSideBlock();
986 }
TableGUI class for listing users that contributed to the wiki.

References ilObjectGUI\$tpl, ilObjectGUI\checkPermission(), and setSideBlock().

+ Here is the call graph for this function:

◆ lookupSubObjectTitle()

static ilObjWikiGUI::lookupSubObjectTitle (   $a_wiki_id,
  $a_page_id 
)
static

Get title for wiki page (used in ilNotesGUI)

Parameters
int$a_wiki_id
int$a_page_id
Returns
string

Definition at line 1936 of file class.ilObjWikiGUI.php.

1937 {
1938 include_once "Modules/Wiki/classes/class.ilWikiPage.php";
1939 $page = new ilWikiPage($a_page_id);
1940 if($page->getWikiId() == $a_wiki_id)
1941 {
1942 return $page->getTitle();
1943 }
1944 }
Class ilWikiPage.

◆ newPagesObject()

ilObjWikiGUI::newPagesObject ( )

Latest pages.

Definition at line 1440 of file class.ilObjWikiGUI.php.

1441 {
1442 global $tpl;
1443
1444 $this->checkPermission("read");
1445
1446 include_once("./Modules/Wiki/classes/class.ilWikiPagesTableGUI.php");
1447
1448 $this->addPagesSubTabs();
1449
1450 $table_gui = new ilWikiPagesTableGUI($this, "newPages",
1451 $this->object->getId(), IL_WIKI_NEW_PAGES);
1452
1453 $this->setSideBlock();
1454 $tpl->setContent($table_gui->getHTML());
1455 }
const IL_WIKI_NEW_PAGES

References ilObjectGUI\$tpl, addPagesSubTabs(), ilObjectGUI\checkPermission(), IL_WIKI_NEW_PAGES, and setSideBlock().

+ Here is the call graph for this function:

◆ orphanedPagesObject()

ilObjWikiGUI::orphanedPagesObject ( )

Orphaned pages.

Definition at line 1239 of file class.ilObjWikiGUI.php.

1240 {
1241 global $tpl;
1242
1243 $this->checkPermission("read");
1244
1245 include_once("./Modules/Wiki/classes/class.ilWikiPagesTableGUI.php");
1246
1247 $this->addPagesSubTabs();
1248
1249 $table_gui = new ilWikiPagesTableGUI($this, "orphanedPages",
1250 $this->object->getId(), IL_WIKI_ORPHANED_PAGES);
1251
1252 $this->setSideBlock();
1253 $tpl->setContent($table_gui->getHTML());
1254 }
const IL_WIKI_ORPHANED_PAGES

References ilObjectGUI\$tpl, addPagesSubTabs(), ilObjectGUI\checkPermission(), IL_WIKI_ORPHANED_PAGES, and setSideBlock().

+ Here is the call graph for this function:

◆ pdfExportObject()

ilObjWikiGUI::pdfExportObject ( )

Definition at line 1539 of file class.ilObjWikiGUI.php.

1540 {
1541 $html = $this->printViewObject(true);
1542
1543 // :TODO: fixing css dummy parameters
1544 $html = preg_replace("/\?dummy\=[0-9]+/", "", $html);
1545 $html = preg_replace("/\?vers\=[0-9A-Za-z\-]+/", "", $html);
1546
1547 include_once "Services/PDFGeneration/classes/class.ilPDFGeneration.php";
1548 include_once "Services/PDFGeneration/classes/class.ilPDFGenerationJob.php";
1549
1550 $job = new ilPDFGenerationJob();
1551 $job->setAutoPageBreak(true)
1552 ->setMarginLeft("10")
1553 ->setMarginRight("10")
1554 ->setMarginTop("10")
1555 ->setMarginBottom("10")
1556 ->setOutputMode("D") // download
1557 ->setFilename("wiki.pdf") // :TODO:
1558 ->setCreator("ILIAS Wiki") // :TODO:
1559 ->setImageScale(1.25) // complete content scaling ?!
1560 ->addPage($html);
1561
1563 }
printViewObject($a_pdf_export=false)
Class ilPDFGenerationJob.
static doJob(ilPDFGenerationJob $job)
$html
Definition: example_001.php:87

References $html, ilPDFGeneration\doJob(), and printViewObject().

+ Here is the call graph for this function:

◆ performSearchObject()

ilObjWikiGUI::performSearchObject ( )

Search.

Definition at line 1568 of file class.ilObjWikiGUI.php.

1569 {
1570 global $tpl, $ilTabs, $ilCtrl, $lng;
1571
1572 $this->checkPermission("read");
1573
1574 include_once("./Modules/Wiki/classes/class.ilWikiSearchResultsTableGUI.php");
1575
1576 $ilTabs->setTabActive("wiki_search_results");
1577
1578 if (trim($_POST["search_term"]) == "")
1579 {
1580 ilUtil::sendFailure($lng->txt("wiki_please_enter_search_term"), true);
1581 $ilCtrl->redirectByClass("ilwikipagegui", "preview");
1582 }
1583
1584 $search_results = ilObjWiki::_performSearch($this->object->getId(),
1585 ilUtil::stripSlashes($_POST["search_term"]));
1586 $table_gui = new ilWikiSearchResultsTableGUI($this, "performSearch",
1587 $this->object->getId(), $search_results, $_POST["search_term"]);
1588
1589 $this->setSideBlock();
1590 $tpl->setContent($table_gui->getHTML());
1591 }
static _performSearch($a_wiki_id, $a_searchterm)
Search in Wiki.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
TableGUI class for recent changes in wiki.

References $_POST, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilObjWiki\_performSearch(), ilObjectGUI\checkPermission(), ilUtil\sendFailure(), setSideBlock(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ popularPagesObject()

ilObjWikiGUI::popularPagesObject ( )

Popular pages.

Definition at line 1219 of file class.ilObjWikiGUI.php.

1220 {
1221 global $tpl;
1222
1223 $this->checkPermission("read");
1224
1225 include_once("./Modules/Wiki/classes/class.ilWikiPagesTableGUI.php");
1226
1227 $this->addPagesSubTabs();
1228
1229 $table_gui = new ilWikiPagesTableGUI($this, "popularPages",
1230 $this->object->getId(), IL_WIKI_POPULAR_PAGES);
1231
1232 $this->setSideBlock();
1233 $tpl->setContent($table_gui->getHTML());
1234 }
const IL_WIKI_POPULAR_PAGES

References ilObjectGUI\$tpl, addPagesSubTabs(), ilObjectGUI\checkPermission(), IL_WIKI_POPULAR_PAGES, and setSideBlock().

+ Here is the call graph for this function:

◆ printViewObject()

ilObjWikiGUI::printViewObject (   $a_pdf_export = false)

Definition at line 1474 of file class.ilObjWikiGUI.php.

1475 {
1476 global $tpl;
1477
1478 $page_ids = $this->getPrintPageIds();
1479 if(!$page_ids)
1480 {
1481 $this->ctrl->redirect($this, "");
1482 }
1483
1484 $tpl = new ilTemplate("tpl.main.html", true, true);
1485 $tpl->setVariable("LOCATION_STYLESHEET", ilObjStyleSheet::getContentPrintStyle());
1486 $this->setContentStyleSheet($tpl);
1487
1488 // syntax style
1489 $tpl->setCurrentBlock("SyntaxStyle");
1490 $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
1492 $tpl->parseCurrentBlock();
1493
1494
1495 // determine target frames for internal links
1496
1497 include_once("./Modules/Wiki/classes/class.ilWikiPageGUI.php");
1498
1499 $page_content = "";
1500
1501 foreach ($page_ids as $p_id)
1502 {
1503 $page_gui = new ilWikiPageGUI($p_id);
1504 $page_gui->setOutputMode("print");
1505 $page_content.= $page_gui->showPage();
1506
1507 if($a_pdf_export)
1508 {
1509 $page_content .= '<p style="page-break-after:always;"></p>';
1510 }
1511 }
1512
1513 $page_content = '<div class="ilInvisibleBorder">'.$page_content.'</div>';
1514
1515 if(!$a_pdf_export)
1516 {
1517 $page_content .= '<script type="text/javascript" language="javascript1.2">
1518 <!--
1519 il.Util.addOnLoad(function () {
1520 il.Util.print();
1521 });
1522 //-->
1523 </script>';
1524 }
1525
1526 $tpl->setVariable("CONTENT", $page_content);
1527
1528 if(!$a_pdf_export)
1529 {
1530 $tpl->show(false);
1531 exit;
1532 }
1533 else
1534 {
1535 return $tpl->get("DEFAULT", false, false, false, true, false, false);
1536 }
1537 }
getContentPrintStyle()
get content print style
getSyntaxStylePath()
get syntax style path
special template class to simplify handling of ITX/PEAR
Class ilWikiPage GUI class.

References ilObjectGUI\$tpl, exit, ilObjStyleSheet\getContentPrintStyle(), getPrintPageIds(), ilObjStyleSheet\getSyntaxStylePath(), and setContentStyleSheet().

Referenced by pdfExportObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ randomPageObject()

ilObjWikiGUI::randomPageObject ( )

Go to random page.

Parameters
string$a_pagepage title

Definition at line 1309 of file class.ilObjWikiGUI.php.

1310 {
1311 $this->checkPermission("read");
1312
1313 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
1314 $page = ilWikiPage::getRandomPage($this->object->getId());
1315 $this->gotoPageObject($page);
1316 }
gotoPageObject($a_page="")
Go to specific page.
static getRandomPage($a_wiki_id)
Get a random page

References ilObjectGUI\checkPermission(), ilWikiPage\getRandomPage(), and gotoPageObject().

+ Here is the call graph for this function:

◆ recentChangesObject()

ilObjWikiGUI::recentChangesObject ( )

Recent Changes.

Definition at line 1321 of file class.ilObjWikiGUI.php.

1322 {
1323 global $tpl;
1324
1325 $this->checkPermission("read");
1326
1327 include_once("./Modules/Wiki/classes/class.ilWikiRecentChangesTableGUI.php");
1328
1329 $this->addPagesSubTabs();
1330
1331 $table_gui = new ilWikiRecentChangesTableGUI($this, "recentChanges",
1332 $this->object->getId());
1333
1334 $this->setSideBlock();
1335 $tpl->setContent($table_gui->getHTML());
1336 }
TableGUI class for recent changes in wiki.

References ilObjectGUI\$tpl, addPagesSubTabs(), ilObjectGUI\checkPermission(), and setSideBlock().

+ Here is the call graph for this function:

◆ removeImportantPagesObject()

ilObjWikiGUI::removeImportantPagesObject ( )

Remove important pages.

Parameters

return

Definition at line 1864 of file class.ilObjWikiGUI.php.

1865 {
1866 global $ilCtrl, $lng;
1867
1868 $this->checkPermission("edit_wiki_navigation");
1869
1870 if (is_array($_POST["imp_page_id"]))
1871 {
1872 foreach ($_POST["imp_page_id"] as $i)
1873 {
1874 $this->object->removeImportantPage((int) $i);
1875 }
1876 }
1877 ilUtil::sendSuccess($lng->txt("wiki_removed_imp_pages"), true);
1878 $ilCtrl->redirect($this, "editImportantPages");
1879 }

References $_POST, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\checkPermission(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ renderSideBlock()

static ilObjWikiGUI::renderSideBlock (   $a_wpg_id,
  $a_wiki_ref_id,
  $a_wp = null 
)
static

Side column.

Definition at line 1350 of file class.ilObjWikiGUI.php.

1351 {
1352 global $tpl, $lng, $ilAccess, $ilCtrl;
1353
1354 $tpl->addJavaScript("./Modules/Wiki/js/WikiPres.js");
1355
1356 // setting asynch to false fixes #0019457, since otherwise ilBlockGUI would act on asynch and output html when side blocks
1357 // being processed during the export. This is a flaw in ilCtrl and/or ilBlockGUI.
1358 $tpl->addOnLoadCode("il.Wiki.Pres.init('".$ilCtrl->getLinkTargetByClass("ilobjwikigui", "", "", false, false)."');");
1359
1360 if ($a_wpg_id > 0 && !$a_wp)
1361 {
1362 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
1363 $a_wp = ilWikiPage($a_wpg_id);
1364 }
1365
1366 // search block
1367 include_once './Services/Search/classes/class.ilRepositoryObjectSearchGUI.php';
1368 $rcontent = ilRepositoryObjectSearchGUI::getSearchBlockHTML($lng->txt('wiki_search'));
1369
1370 #include_once("./Modules/Wiki/classes/class.ilWikiSearchBlockGUI.php");
1371 #$wiki_search_block = new ilWikiSearchBlockGUI();
1372 #$rcontent = $wiki_search_block->getHTML();
1373
1374 // quick navigation
1375 if ($a_wpg_id > 0)
1376 {
1377// include_once("./Modules/Wiki/classes/class.ilWikiSideBlockGUI.php");
1378// $wiki_side_block = new ilWikiSideBlockGUI();
1379// $wiki_side_block->setPageObject($a_wp);
1380// $rcontent.= $wiki_side_block->getHTML();
1381
1382 // rating
1383 $wiki_id =ilObject::_lookupObjId($a_wiki_ref_id);
1384 if(ilObjWiki::_lookupRating($wiki_id) &&
1385 // ilObjWiki::_lookupRatingAsBlock($wiki_id) &&
1386 $a_wp->getRating())
1387 {
1388 include_once("./Services/Rating/classes/class.ilRatingGUI.php");
1389 $rgui = new ilRatingGUI();
1390 $rgui->setObject($wiki_id, "wiki", $a_wpg_id, "wpg");
1391 $rgui->enableCategories(ilObjWiki::_lookupRatingCategories($wiki_id));
1392 $rgui->setYourRatingText("#");
1393 $rcontent .= $rgui->getBlockHTML($lng->txt("wiki_rate_page"));
1394 }
1395
1396 // advanced metadata
1398 {
1399 $cmd = null;
1400 if($ilAccess->checkAccess("write", "", $a_wiki_ref_id))
1401 {
1402 $cmd = array(
1403 "edit" => $ilCtrl->getLinkTargetByClass("ilwikipagegui", "editAdvancedMetaData"),
1404 "hide" => $ilCtrl->getLinkTargetByClass("ilwikipagegui", "hideAdvancedMetaData")
1405 );
1406 }
1407 include_once("./Services/Object/classes/class.ilObjectMetaDataGUI.php");
1408 $wiki = new ilObjWiki($a_wiki_ref_id);
1409 $callback = $wiki->getLinkMetadataValues()
1410 ? array($wiki, "decorateAdvMDValue")
1411 : null;
1412 $mdgui = new ilObjectMetaDataGUI($wiki, "wpg", $a_wpg_id);
1413 $rcontent .= $mdgui->getBlockHTML($cmd, $callback); // #17291
1414 }
1415 }
1416
1417 // important pages
1418// if (ilObjWiki::_lookupImportantPages(ilObject::_lookupObjId($a_wiki_ref_id)))
1419// {
1420 include_once("./Modules/Wiki/classes/class.ilWikiImportantPagesBlockGUI.php");
1421 $imp_pages_block = new ilWikiImportantPagesBlockGUI();
1422 $rcontent.= $imp_pages_block->getHTML();
1423// }
1424
1425 // wiki functions block
1426 if ($a_wpg_id > 0)
1427 {
1428 include_once("./Modules/Wiki/classes/class.ilWikiFunctionsBlockGUI.php");
1429 $wiki_functions_block = new ilWikiFunctionsBlockGUI();
1430 $wiki_functions_block->setPageObject($a_wp);
1431 $rcontent .= $wiki_functions_block->getHTML();
1432 }
1433
1434 $tpl->setRightContent($rcontent);
1435 }
Class ilObjWiki.
static _lookupRatingCategories($a_wiki_id)
Lookup whether rating categories are activated.
static _lookupRating($a_wiki_id)
Lookup whether rating is activated.
static getSearchBlockHTML($a_title)
Get standar search block html.
BlockGUI class for wiki functions block.
static lookupAdvancedMetadataHidden($a_page_id)

References $cmd, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilObject\_lookupObjId(), ilObjWiki\_lookupRating(), ilObjWiki\_lookupRatingCategories(), ilRepositoryObjectSearchGUI\getSearchBlockHTML(), and ilWikiPage\lookupAdvancedMetadataHidden().

Referenced by setSideBlock(), and ilWikiPageGUI\setSideBlock().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveGradingObject()

ilObjWikiGUI::saveGradingObject ( )

Save grading.

Definition at line 991 of file class.ilObjWikiGUI.php.

992 {
993 global $ilCtrl, $lng;
994
995 $this->checkPermission("write");
996
997 $users = (is_array($_POST["user_id"])
998 ? $_POST["user_id"]
999 : array());
1000
1001 include_once("./Modules/Wiki/classes/class.ilWikiContributor.php");
1002 include_once("./Services/Tracking/classes/class.ilLPMarks.php");
1003 $saved = false;
1004 foreach($users as $user_id)
1005 {
1006 if ($user_id != "")
1007 {
1008 $marks_obj = new ilLPMarks($this->object->getId(),$user_id);
1009 $new_mark = ilUtil::stripSlashes($_POST['mark'][$user_id]);
1010 $new_comment = ilUtil::stripSlashes($_POST['lcomment'][$user_id]);
1011 $new_status = ilUtil::stripSlashes($_POST["status"][$user_id]);
1012
1013 if ($marks_obj->getMark() != $new_mark ||
1014 $marks_obj->getComment() != $new_comment ||
1015 ilWikiContributor::_lookupStatus($this->object->getId(), $user_id) != $new_status)
1016 {
1017 ilWikiContributor::_writeStatus($this->object->getId(), $user_id, $new_status);
1018 $marks_obj->setMark($new_mark);
1019 $marks_obj->setComment($new_comment);
1020 $marks_obj->update();
1021 $saved = true;
1022 }
1023 }
1024 }
1025 if ($saved)
1026 {
1027 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1028 }
1029
1030 $ilCtrl->redirect($this, "listContributors");
1031 }
_writeStatus($a_obj_id, $a_user_id, $a_status)
Write success status.

References $_POST, $ilCtrl, ilObjectGUI\$lng, ilWikiContributor\_lookupStatus(), ilWikiContributor\_writeStatus(), ilObjectGUI\checkPermission(), ilUtil\sendSuccess(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ saveObject()

ilObjWikiGUI::saveObject ( )

save object @access public

Reimplemented from ilObjectGUI.

Definition at line 311 of file class.ilObjWikiGUI.php.

312 {
313 global $tpl, $lng, $rbacsystem;
314
315 if (!$this->checkPermissionBool("create", "", "wiki", $_GET["ref_id"]))
316 {
317 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
318 }
319
320 $this->initSettingsForm("create");
321 if ($this->form_gui->checkInput())
322 {
323 if (!ilObjWiki::checkShortTitleAvailability($this->form_gui->getInput("shorttitle")))
324 {
325 $short_item = $this->form_gui->getItemByPostVar("shorttitle");
326 $short_item->setAlert($lng->txt("wiki_short_title_already_in_use"));
327 }
328 else
329 {
330 // create and insert forum in objecttree
331 $_POST["title"] = $this->form_gui->getInput("title");
332 $_POST["desc"] = $this->form_gui->getInput("description");
333 return parent::saveObject();
334 }
335 }
336
337 $this->form_gui->setValuesByPost();
338 $tpl->setContent($this->form_gui->getHtml());
339 }
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
static checkShortTitleAvailability($a_short_title)
Check availability of short title.

References $_GET, $_POST, ilObjectGUI\$lng, ilObjectGUI\$tpl, checkPermissionBool(), ilObjWiki\checkShortTitleAvailability(), and initSettingsForm().

+ Here is the call graph for this function:

◆ saveOrderingAndIndentObject()

ilObjWikiGUI::saveOrderingAndIndentObject ( )

Save important pages ordering and indentation.

Definition at line 1884 of file class.ilObjWikiGUI.php.

1885 {
1886 global $ilCtrl, $lng;
1887
1888 $this->checkPermission("edit_wiki_navigation");
1889
1890 $this->object->saveOrderingAndIndentation($_POST["ord"], $_POST["indent"]);
1891 ilUtil::sendSuccess($lng->txt("wiki_ordering_and_indent_saved"), true);
1892 $ilCtrl->redirect($this, "editImportantPages");
1893 }

References $_POST, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\checkPermission(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ saveSettingsObject()

ilObjWikiGUI::saveSettingsObject ( )

Save Settings.

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

906 {
907 global $ilCtrl, $lng, $ilUser, $ilSetting;
908
909 $this->checkPermission("write");
910
911 $this->initSettingsForm();
912
913 if ($this->form_gui->checkInput())
914 {
915 if (!ilObjWiki::checkShortTitleAvailability($this->form_gui->getInput("shorttitle")) &&
916 $this->form_gui->getInput("shorttitle") != $this->object->getShortTitle())
917 {
918 $short_item = $this->form_gui->getItemByPostVar("shorttitle");
919 $short_item->setAlert($lng->txt("wiki_short_title_already_in_use"));
920 }
921 else
922 {
923 $this->object->setTitle($this->form_gui->getInput("title"));
924 $this->object->setDescription($this->form_gui->getInput("description"));
925 $this->object->setOnline($this->form_gui->getInput("online"));
926 $this->object->setStartPage(ilWikiPage::lookupTitle($this->form_gui->getInput("startpage_id")));
927 $this->object->setShortTitle($this->form_gui->getInput("shorttitle"));
928 $this->object->setRatingOverall($this->form_gui->getInput("rating_overall"));
929 $this->object->setRating($this->form_gui->getInput("rating"));
930 // $this->object->setRatingAsBlock($this->form_gui->getInput("rating_side"));
931 $this->object->setRatingForNewPages($this->form_gui->getInput("rating_new"));
932 $this->object->setRatingCategories($this->form_gui->getInput("rating_ext"));
933
934 if (!$ilSetting->get("disable_comments"))
935 {
936 $this->object->setPublicNotes($this->form_gui->getInput("public_notes"));
937 }
938 $this->object->setIntroduction($this->form_gui->getInput("intro"));
939// $this->object->setImportantPages($this->form_gui->getInput("imp_pages"));
940 $this->object->setPageToc($this->form_gui->getInput("page_toc"));
941 $this->object->setLinkMetadataValues($this->form_gui->getInput("link_md_values"));
942 $this->object->update();
943
944 include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
946 $this->object->getId(),
947 $this->form_gui,
948 array(
950 )
951 );
952
953 // Update ecs export settings
954 include_once 'Modules/Wiki/classes/class.ilECSWikiSettings.php';
955 $ecs = new ilECSWikiSettings($this->object);
956 if($ecs->handleSettingsUpdate())
957 {
958 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"),true);
959 $ilCtrl->redirect($this, "editSettings");
960 }
961 }
962 }
963
964 $this->form_gui->setValuesByPost();
965 $this->tpl->setContent($this->form_gui->getHTML());
966 }
static updateServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Update service settings.

References $ilCtrl, $ilSetting, $ilUser, ilObjectGUI\$lng, ilObjectGUI\checkPermission(), ilObjWiki\checkShortTitleAvailability(), ilObjectServiceSettingsGUI\CUSTOM_METADATA, initSettingsForm(), ilWikiPage\lookupTitle(), ilUtil\sendSuccess(), and ilObjectServiceSettingsGUI\updateServiceSettingsForm().

+ Here is the call graph for this function:

◆ saveStyleSettingsObject()

ilObjWikiGUI::saveStyleSettingsObject ( )

Save style settings.

Definition at line 1738 of file class.ilObjWikiGUI.php.

1739 {
1740 global $ilSetting;
1741
1742 include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
1743 if ($ilSetting->get("fixed_content_style_id") <= 0 &&
1744 (ilObjStyleSheet::_lookupStandard($this->object->getStyleSheetId())
1745 || $this->object->getStyleSheetId() == 0))
1746 {
1747 $this->object->setStyleSheetId(ilUtil::stripSlashes($_POST["style_id"]));
1748 $this->object->update();
1749 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1750 }
1751 $this->ctrl->redirect($this, "editStyleProperties");
1752 }

References $_POST, $ilSetting, ilObjStyleSheet\_lookupStandard(), ilUtil\sendSuccess(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ setAsStartPageObject()

ilObjWikiGUI::setAsStartPageObject ( )

Confirm important pages deletion.

Definition at line 1898 of file class.ilObjWikiGUI.php.

1899 {
1900 global $ilCtrl, $lng;
1901
1902 $this->checkPermission("edit_wiki_navigation");
1903
1904 if (!is_array($_POST["imp_page_id"]) || count($_POST["imp_page_id"]) != 1)
1905 {
1906 ilUtil::sendInfo($lng->txt("wiki_select_one_item"), true);
1907 }
1908 else
1909 {
1910 $this->object->removeImportantPage((int) $_POST["imp_page_id"][0]);
1911 $this->object->setStartPage(ilWikiPage::lookupTitle((int) $_POST["imp_page_id"][0]));
1912 $this->object->update();
1913 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"),true);
1914 }
1915 $ilCtrl->redirect($this, "editImportantPages");
1916 }

References $_POST, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\checkPermission(), ilWikiPage\lookupTitle(), ilUtil\sendInfo(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ setContentStyleSheet()

ilObjWikiGUI::setContentStyleSheet (   $a_tpl = null)

Set content style sheet.

Definition at line 1596 of file class.ilObjWikiGUI.php.

1597 {
1598 global $tpl;
1599
1600 if ($a_tpl != null)
1601 {
1602 $ctpl = $a_tpl;
1603 }
1604 else
1605 {
1606 $ctpl = $tpl;
1607 }
1608
1609 $ctpl->setCurrentBlock("ContentStyle");
1610 $ctpl->setVariable("LOCATION_CONTENT_STYLESHEET",
1611 ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId()));
1612 $ctpl->parseCurrentBlock();
1613
1614 }
getContentStylePath($a_style_id)
get content style path

References ilObjectGUI\$tpl, and ilObjStyleSheet\getContentStylePath().

Referenced by executeCommand(), printViewObject(), and viewPageObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSettingsSubTabs()

ilObjWikiGUI::setSettingsSubTabs (   $a_active)

Set sub tabs.

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

625 {
626 global $ilTabs, $ilCtrl, $lng, $ilAccess;
627
628 if (in_array($a_active,
629 array("general_settings", "style", "imp_pages", "rating_categories",
630 "page_templates", "advmd", "permission_settings")))
631 {
632 if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
633 {
634 // general properties
635 $ilTabs->addSubTab("general_settings",
636 $lng->txt("wiki_general_settings"),
637 $ilCtrl->getLinkTarget($this, 'editSettings'));
638
639 // permission settings
640 $ilTabs->addSubTab("permission_settings",
641 $lng->txt("obj_permission_settings"),
642 $this->ctrl->getLinkTargetByClass("ilsettingspermissiongui", ""));
643
644 // style properties
645 $ilTabs->addSubTab("style",
646 $lng->txt("wiki_style"),
647 $ilCtrl->getLinkTarget($this, 'editStyleProperties'));
648 }
649
650 if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
651 {
652 // important pages
653 $ilTabs->addSubTab("imp_pages",
654 $lng->txt("wiki_navigation"),
655 $ilCtrl->getLinkTarget($this, 'editImportantPages'));
656 }
657
658 if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
659 {
660 // page templates
661 $ilTabs->addSubTab("page_templates",
662 $lng->txt("wiki_page_templates"),
663 $ilCtrl->getLinkTargetByClass("ilwikipagetemplategui", ""));
664
665 // rating categories
666 if ($this->object->getRating() && $this->object->getRatingCategories())
667 {
668 $lng->loadLanguageModule("rating");
669 $ilTabs->addSubTab("rating_categories",
670 $lng->txt("rating_categories"),
671 $ilCtrl->getLinkTargetByClass(array('ilratinggui', 'ilratingcategorygui'), ''));
672 }
673 }
674
675 $ilTabs->activateSubTab($a_active);
676 }
677 }

References $ilCtrl, and ilObjectGUI\$lng.

Referenced by editImportantPagesObject(), editSettingsObject(), editStylePropertiesObject(), and executeCommand().

+ Here is the caller graph for this function:

◆ setSideBlock()

ilObjWikiGUI::setSideBlock (   $a_wpg_id = 0)

Side column.

Definition at line 1341 of file class.ilObjWikiGUI.php.

1342 {
1343 ilObjWikiGUI::renderSideBlock($a_wpg_id, $this->object->getRefId());
1344 }
static renderSideBlock($a_wpg_id, $a_wiki_ref_id, $a_wp=null)
Side column.

References renderSideBlock().

Referenced by allPagesObject(), editSettingsObject(), editStylePropertiesObject(), executeCommand(), listContributorsObject(), newPagesObject(), orphanedPagesObject(), performSearchObject(), popularPagesObject(), and recentChangesObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showTemplateSelectionObject()

ilObjWikiGUI::showTemplateSelectionObject ( )

Show template selection.

Definition at line 1962 of file class.ilObjWikiGUI.php.

1963 {
1964 global $lng, $tpl, $ilTabs, $ilCtrl;
1965
1966
1967 $ilCtrl->setParameterByClass("ilobjwikigui", "from_page", ilWikiUtil::makeUrlTitle($_GET["from_page"]));
1968 $ilTabs->clearTargets();
1969 ilUtil::sendInfo($lng->txt("wiki_page_not_exist_select_templ"));
1970
1971 $form = $this->initTemplateSelectionForm();
1972 $tpl->setContent($form->getHTML());
1973 }

References $_GET, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, initTemplateSelectionForm(), ilWikiUtil\makeUrlTitle(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ startUserHTMLExportObject()

ilObjWikiGUI::startUserHTMLExportObject ( )

Export html (as user)

Definition at line 2104 of file class.ilObjWikiGUI.php.

2105 {
2106 $this->log->debug("start");
2107 $this->checkPermission("wiki_html_export");
2108 $this->object->startUserHTMLExport();
2109 }

References ilObjectGUI\checkPermission().

+ Here is the call graph for this function:

◆ viewObject()

ilObjWikiGUI::viewObject ( )

Start page.

Reimplemented from ilObjectGUI.

Definition at line 289 of file class.ilObjWikiGUI.php.

290 {
291 $this->checkPermission("read");
292 $this->gotoStartPageObject();
293 }
gotoStartPageObject()
Go to start page.

References ilObjectGUI\checkPermission(), and gotoStartPageObject().

+ Here is the call graph for this function:

◆ viewPageObject()

ilObjWikiGUI::viewPageObject ( )

view wiki page

Definition at line 1130 of file class.ilObjWikiGUI.php.

1131 {
1132 global $lng, $ilCtrl, $tpl, $ilTabs, $ilAccess;
1133
1134 $this->checkPermission("read");
1135
1136 $ilTabs->clearTargets();
1137 $tpl->setHeaderActionMenu(null);
1138
1139 $page = ($_GET["page"] != "")
1140 ? $_GET["page"]
1141 : $this->object->getStartPage();
1142 $_GET["page"] = $page;
1143
1144 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
1145 if (!ilWikiPage::exists($this->object->getId(), $page))
1146 {
1147 $page = $this->object->getStartPage();
1148 }
1149
1150 if (!ilWikiPage::exists($this->object->getId(), $page))
1151 {
1152 ilUtil::sendInfo($lng->txt("wiki_no_start_page"), true);
1153 $ilCtrl->redirect($this, "infoScreen");
1154 return;
1155 }
1156
1157 // page exists, show it !
1158 $ilCtrl->setParameter($this, "page", ilWikiUtil::makeUrlTitle($page));
1159
1160 include_once("./Modules/Wiki/classes/class.ilWikiPageGUI.php");
1161 $wpage_gui = ilWikiPageGUI::getGUIForTitle($this->object->getId(),
1162 ilWikiUtil::makeDbTitle($page), 0, $this->object->getRefId());
1163 include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
1164 $wpage_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(
1165 $this->object->getStyleSheetId(), "wiki"));
1166
1167 $this->setContentStyleSheet();
1168 //$wpage_gui->setOutputMode(IL_PAGE_PREVIEW);
1169
1170 //$wpage_gui->setSideBlock();
1171 $ilCtrl->setCmdClass("ilwikipagegui");
1172 $ilCtrl->setCmd("preview");
1173 if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()) &&
1174 (!$ilAccess->checkAccess("edit_content", "", $this->object->getRefId()) ||
1175 $wpage_gui->getPageObject()->getBlocked()
1176 ))
1177 {
1178 $wpage_gui->setEnableEditing(false);
1179 }
1180
1181 // alter title and description
1182 //$tpl->setTitle($wpage_gui->getPageObject()->getTitle());
1183 //$tpl->setDescription($this->object->getTitle());
1184 if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
1185 {
1186 $wpage_gui->activateMetaDataEditor($this->object, "wpg", $wpage_gui->getId());
1187 }
1188
1189
1190 $html = $ilCtrl->forwardCommand($wpage_gui);
1191 //$this->addPageTabs();
1192
1193 $tpl->setContent($html);
1194 }
static exists($a_wiki_id, $a_title)
Checks whether a page with given title exists.

References $_GET, $html, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilObjectGUI\checkPermission(), ilWikiPage\exists(), ilObjStyleSheet\getEffectiveContentStyleId(), ilWikiPageGUI\getGUIForTitle(), ilWikiUtil\makeDbTitle(), ilWikiUtil\makeUrlTitle(), ilUtil\sendInfo(), and setContentStyleSheet().

+ Here is the call graph for this function:

Field Documentation

◆ $log

ilObjWikiGUI::$log
protected

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


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