ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
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 public. More...
 
 executeCommand ()
 
 isOnlineHelpWiki ()
 Is wiki an online help wiki? More...
 
 viewObject ()
 Start page. More...
 
 saveObject ()
 save object public More...
 
 afterSave ($newObj)
 save object 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 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 ()
 
 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...
 
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor 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 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...
 
 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)
 
 getPrintPageIds ()
 
- 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 public More...
 
 setAdminTabs ()
 set admin tabs 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)
 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...
 

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 932 of file class.ilObjWikiGUI.php.

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().

933  {
934  global $ilAccess, $ilErr, $lng, $ilNavigationHistory;
935 
936  $i = strpos($a_target, "_");
937  if ($i > 0)
938  {
939  $a_page = substr($a_target, $i+1);
940  $a_target = substr($a_target, 0, $i);
941  }
942 
943  if ($a_target == "wpage")
944  {
945  $a_page_arr = explode("_", $a_page);
946  $wpg_id = (int) $a_page_arr[0];
947  $ref_id = (int) $a_page_arr[1];
948  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
949  $w_id = ilWikiPage::lookupWikiId($wpg_id);
950  if ($ref_id > 0)
951  {
952  $refs = array($ref_id);
953  }
954  else
955  {
956  $refs = ilObject::_getAllReferences($w_id);
957  }
958  foreach ($refs as $r)
959  {
960  if ($ilAccess->checkAccess("read", "", $r))
961  {
962  $a_target = $r;
963  $a_page = ilWikiPage::lookupTitle($wpg_id);
964  }
965  }
966  }
967 
968  if ($ilAccess->checkAccess("read", "", $a_target))
969  {
970  $_GET["cmd"] = "viewPage";
971  $_GET["ref_id"] = $a_target;
972  $_GET["page"] = $a_page;
973  $_GET["baseClass"] = "ilwikihandlergui";
974  $_GET["cmdClass"] = "ilobjwikigui";
975 /* if ($a_page != "")
976  {
977  $add = "&page=".rawurlencode($_GET["page"]);
978  $ilNavigationHistory->addItem($_GET["ref_id"],
979  "./goto.php?target=wiki_".$_GET["ref_id"].$add, "wiki");
980  }*/
981  include("ilias.php");
982  exit;
983  }
984  else if ($ilAccess->checkAccess("visible", "", $a_target))
985  {
986  ilObjectGUI::_gotoRepositoryNode($tarr[0], "infoScreen");
987  }
988  else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
989  {
990  ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
993  }
994 
995  $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
996  }
static lookupTitle($a_page_id)
Checks whether a page with given title exists.
exit
Definition: login.php:54
$_GET["client_id"]
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupTitle($a_id)
lookup object title
static _getAllReferences($a_id)
get all reference ids of object
static lookupWikiId($a_page_id)
Lookup wiki id.
static _gotoRepositoryNode($a_ref_id, $a_cmd="frameset")
Goto repository root.
static _lookupObjId($a_id)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$r
+ Here is the call graph for this function:

◆ addImportantPageObject()

ilObjWikiGUI::addImportantPageObject ( )

Add important pages.

Parameters

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

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

1674  {
1675  global $ilCtrl, $lng;
1676 
1677  $this->checkPermission("write");
1678 
1679  if ($_POST["imp_page_id"] > 0)
1680  {
1681  $this->object->addImportantPage((int) $_POST["imp_page_id"]);
1682  ilUtil::sendSuccess($lng->txt("wiki_imp_page_added"), true);
1683  }
1684  $ilCtrl->redirect($this, "editImportantPages");
1685  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjWikiGUI::addLocatorItems ( )

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

References $_GET, and getGotoLink().

922  {
923  global $ilLocator;
924 
925  if (is_object($this->object))
926  {
927  $ilLocator->addItem($this->object->getTitle(),
928  $this->getGotoLink($this->object->getRefId()), "", $_GET["ref_id"]);
929  }
930  }
static getGotoLink($a_ref_id, $a_page="")
Get goto link.
$_GET["client_id"]
+ Here is the call graph for this function:

◆ addPagesSubTabs()

ilObjWikiGUI::addPagesSubTabs ( )

Add Pages SubTabs.

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

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

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

442  {
443  global $ilTabs, $ilCtrl;
444 
445  $ilTabs->activateTab("wiki_pages");
446 
447  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
448  $ilCtrl->setParameter($this, "wpg_id",
449  ilWikiPage::getPageIdForTitle($this->object->getId(),
450  ilWikiUtil::makeDbTitle($_GET["page"])));
451  $ilCtrl->setParameter($this, "page", ilWikiUtil::makeUrlTitle($_GET["page"]));
452  $ilTabs->addSubTabTarget("wiki_all_pages",
453  $this->ctrl->getLinkTarget($this, "allPages"), "allPages");
454  $ilTabs->addSubTabTarget("wiki_recent_changes",
455  $this->ctrl->getLinkTarget($this, "recentChanges"), "recentChanges");
456  $ilTabs->addSubTabTarget("wiki_new_pages",
457  $this->ctrl->getLinkTarget($this, "newPages"), "newPages");
458  $ilTabs->addSubTabTarget("wiki_popular_pages",
459  $this->ctrl->getLinkTarget($this, "popularPages"), "popularPages");
460  $ilTabs->addSubTabTarget("wiki_orphaned_pages",
461  $this->ctrl->getLinkTarget($this, "orphanedPages"), "orphanedPages");
462  }
$_GET["client_id"]
static getPageIdForTitle($a_wiki_id, $a_title)
Get wiki page object for id and title.
global $ilCtrl
Definition: ilias.php:18
static makeUrlTitle($a_par)
Set page parameter for Url Embedding.
static makeDbTitle($a_par)
Handle page GET parameter.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addPageTabs()

ilObjWikiGUI::addPageTabs ( )

Add Page Tabs.

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

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

423  {
424  global $ilTabs, $ilCtrl;
425 
426  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
427  $ilCtrl->setParameter($this, "wpg_id",
428  ilWikiPage::getPageIdForTitle($this->object->getId(), ilWikiUtil::makeDbTitle($_GET["page"])));
429  $ilCtrl->setParameter($this, "page", ilWikiUtil::makeUrlTitle($_GET["page"]));
430  $ilTabs->addTarget("wiki_what_links_here",
431  $this->ctrl->getLinkTargetByClass("ilwikipagegui",
432  "whatLinksHere"), "whatLinksHere");
433  $ilTabs->addTarget("wiki_print_view",
434  $this->ctrl->getLinkTargetByClass("ilwikipagegui",
435  "printViewSelection"), "printViewSelection");
436  }
$_GET["client_id"]
static getPageIdForTitle($a_wiki_id, $a_title)
Get wiki page object for id and title.
global $ilCtrl
Definition: ilias.php:18
static makeUrlTitle($a_par)
Set page parameter for Url Embedding.
static makeDbTitle($a_par)
Handle page GET parameter.
+ Here is the call graph for this function:

◆ afterSave()

ilObjWikiGUI::afterSave (   $newObj)

save object public

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

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

281  {
282  global $ilSetting;
283 
284  $newObj->setTitle($this->form_gui->getInput("title"));
285  $newObj->setDescription($this->form_gui->getInput("description"));
286  $newObj->setIntroduction($this->form_gui->getInput("intro"));
287  $newObj->setStartPage($this->form_gui->getInput("startpage"));
288  $newObj->setShortTitle($this->form_gui->getInput("shorttitle"));
289  $newObj->setRating($this->form_gui->getInput("rating"));
290  // $newObj->setRatingAsBlock($this->form_gui->getInput("rating_side"));
291  $newObj->setRatingForNewPages($this->form_gui->getInput("rating_new"));
292  $newObj->setRatingCategories($this->form_gui->getInput("rating_ext"));
293 
294  $newObj->setRatingOverall($this->form_gui->getInput("rating_overall"));
295  $newObj->setPageToc($this->form_gui->getInput("page_toc"));
296 
297 
298 
299  if (!$ilSetting->get("disable_comments"))
300  {
301  $newObj->setPublicNotes($this->form_gui->getInput("public_notes"));
302  }
303  $newObj->setOnline($this->form_gui->getInput("online"));
304  $newObj->update();
305 
306  // always send a message
307  ilUtil::sendSuccess($this->lng->txt("object_added"),true);
308  ilUtil::redirect(ilObjWikiGUI::getGotoLink($newObj->getRefId()));
309  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static getGotoLink($a_ref_id, $a_page="")
Get goto link.
global $ilSetting
Definition: privfeed.php:40
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

◆ allPagesObject()

ilObjWikiGUI::allPagesObject ( )

All pages of wiki.

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

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

1083  {
1084  global $tpl;
1085 
1086  $this->checkPermission("read");
1087 
1088  include_once("./Modules/Wiki/classes/class.ilWikiPagesTableGUI.php");
1089 
1090  $this->addPagesSubTabs();
1091 
1092  $table_gui = new ilWikiPagesTableGUI($this, "allPages",
1093  $this->object->getId(), IL_WIKI_ALL_PAGES);
1094 
1095  $this->setSideBlock();
1096  $tpl->setContent($table_gui->getHTML());
1097  }
setSideBlock($a_wpg_id=0)
Side column.
TableGUI class for wiki pages table.
addPagesSubTabs()
Add Pages SubTabs.
const IL_WIKI_ALL_PAGES
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
+ Here is the call graph for this function:

◆ cancelCreationPageUsingTemplateObject()

ilObjWikiGUI::cancelCreationPageUsingTemplateObject ( )

Cancel page creation using a template.

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

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

1911  {
1912  global $ilCtrl;
1913 
1914  // redirect to newly created page
1915  $ilCtrl->setParameterByClass("ilwikipagegui", "page", ilWikiUtil::makeUrlTitle(($_GET["from_page"])));
1916  $ilCtrl->redirectByClass("ilwikipagegui", "preview");
1917  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static makeUrlTitle($a_par)
Set page parameter for Url Embedding.
+ Here is the call graph for this function:

◆ confirmRemoveImportantPagesObject()

ilObjWikiGUI::confirmRemoveImportantPagesObject ( )

Confirm important pages deletion.

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

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

1691  {
1692  global $ilCtrl, $tpl, $lng;
1693 
1694  if (!is_array($_POST["imp_page_id"]) || count($_POST["imp_page_id"]) == 0)
1695  {
1696  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
1697  $ilCtrl->redirect($this, "editImportantPages");
1698  }
1699  else
1700  {
1701  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1702  $cgui = new ilConfirmationGUI();
1703  $cgui->setFormAction($ilCtrl->getFormAction($this));
1704  $cgui->setHeaderText($lng->txt("wiki_sure_remove_imp_pages"));
1705  $cgui->setCancel($lng->txt("cancel"), "editImportantPages");
1706  $cgui->setConfirm($lng->txt("remove"), "removeImportantPages");
1707 
1708  foreach ($_POST["imp_page_id"] as $i)
1709  {
1710  $cgui->addItem("imp_page_id[]", $i, ilWikiPage::lookupTitle((int) $i));
1711  }
1712 
1713  $tpl->setContent($cgui->getHTML());
1714  }
1715  }
static lookupTitle($a_page_id)
Checks whether a page with given title exists.
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Confirmation screen class.
+ Here is the call graph for this function:

◆ createPageUsingTemplateObject()

ilObjWikiGUI::createPageUsingTemplateObject ( )

Save creation with template form.

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

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

1884  {
1885  global $tpl, $lng, $ilCtrl;
1886 
1887  $form = $this->initTemplateSelectionForm();
1888  if ($form->checkInput())
1889  {
1890  $a_page = $_POST["page"];
1891  $this->object->createWikiPage($a_page, (int) $_POST["page_templ"]);
1892 
1893  // redirect to newly created page
1894  $ilCtrl->setParameterByClass("ilwikipagegui", "page", ilWikiUtil::makeUrlTitle(($a_page)));
1895  $ilCtrl->redirectByClass("ilwikipagegui", "edit");
1896 
1897  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1898  $ilCtrl->redirect($this, "");
1899  }
1900  else
1901  {
1902  $form->setValuesByPost();
1903  $tpl->setContent($form->getHtml());
1904  }
1905  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
static makeUrlTitle($a_par)
Set page parameter for Url Embedding.
initTemplateSelectionForm()
Init template selection form.
+ Here is the call graph for this function:

◆ createStyleObject()

ilObjWikiGUI::createStyleObject ( )

Create Style.

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

References $ilCtrl.

1568  {
1569  global $ilCtrl;
1570 
1571  $ilCtrl->redirectByClass("ilobjstylesheetgui", "create");
1572  }
global $ilCtrl
Definition: ilias.php:18

◆ deleteStyleObject()

ilObjWikiGUI::deleteStyleObject ( )

Delete Style.

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

References $ilCtrl.

1588  {
1589  global $ilCtrl;
1590 
1591  $ilCtrl->redirectByClass("ilobjstylesheetgui", "delete");
1592  }
global $ilCtrl
Definition: ilias.php:18

◆ editImportantPagesObject()

ilObjWikiGUI::editImportantPagesObject ( )

List important pages.

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

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

1621  {
1622  global $tpl, $ilToolbar, $ilTabs, $lng, $ilCtrl;
1623 
1624  $this->checkPermission("write");
1625 
1626  ilUtil::sendInfo($lng->txt("wiki_navigation_info"));
1627 
1628  $ipages = ilObjWiki::_lookupImportantPagesList($this->object->getId());
1629  $ipages_ids = array();
1630  foreach ($ipages as $i)
1631  {
1632  $ipages_ids[] = $i["page_id"];
1633  }
1634 
1635  // list pages
1636  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
1637  $pages = ilWikiPage::getAllPages($this->object->getId());
1638  $options = array("" => $lng->txt("please_select"));
1639  foreach ($pages as $p)
1640  {
1641  if (!in_array($p["id"], $ipages_ids))
1642  {
1643  $options[$p["id"]] = ilUtil::shortenText($p["title"], 60, true);
1644  }
1645  }
1646  if (count($options) > 0)
1647  {
1648  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
1649  $si = new ilSelectInputGUI($lng->txt("wiki_pages"), "imp_page_id");
1650  $si->setOptions($options);
1651  $si->setInfo($lng->txt(""));
1652  $ilToolbar->addInputItem($si);
1653  $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1654  $ilToolbar->addFormButton($lng->txt("add"), "addImportantPage");
1655  }
1656 
1657 
1658  $ilTabs->activateTab("settings");
1659  $this->setSettingsSubTabs("imp_pages");
1660 
1661  include_once("./Modules/Wiki/classes/class.ilImportantPagesTableGUI.php");
1662  $imp_table = new ilImportantPagesTableGUI($this, "editImportantPages");
1663 
1664  $tpl->setContent($imp_table->getHTML());
1665  }
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.
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
setSettingsSubTabs($a_active)
Set sub tabs.
if(!is_array($argv)) $options
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
static getAllPages($a_wiki_id)
Get all pages of wiki.
+ Here is the call graph for this function:

◆ editSettingsObject()

ilObjWikiGUI::editSettingsObject ( )

Edit settings.

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

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

594  {
595  global $tpl;
596 
597  $this->checkPermission("write");
598 
599  $this->setSettingsSubTabs("general_settings");
600 
601  $this->initSettingsForm();
602  $this->getSettingsFormValues();
603 
604  // Edit ecs export settings
605  include_once 'Modules/Wiki/classes/class.ilECSWikiSettings.php';
606  $ecs = new ilECSWikiSettings($this->object);
607  $ecs->addSettingsToForm($this->form_gui, 'wiki');
608 
609  $tpl->setContent($this->form_gui->getHtml());
610  $this->setSideBlock();
611  }
setSideBlock($a_wpg_id=0)
Side column.
setSettingsSubTabs($a_active)
Set sub tabs.
Class ilECSWikiSettings.
getSettingsFormValues($a_mode="edit")
initSettingsForm($a_mode="edit")
Init Settings Form.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
+ Here is the call graph for this function:

◆ editStyleObject()

ilObjWikiGUI::editStyleObject ( )

Edit Style.

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

References $ilCtrl.

1578  {
1579  global $ilCtrl;
1580 
1581  $ilCtrl->redirectByClass("ilobjstylesheetgui", "edit");
1582  }
global $ilCtrl
Definition: ilias.php:18

◆ editStylePropertiesObject()

ilObjWikiGUI::editStylePropertiesObject ( )

Edit style properties.

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

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

1480  {
1481  global $ilTabs, $tpl;
1482 
1483  $this->checkPermission("write");
1484 
1485  $this->initStylePropertiesForm();
1486  $tpl->setContent($this->form->getHTML());
1487 
1488  $ilTabs->activateTab("settings");
1489  $this->setSettingsSubTabs("style");
1490 
1491  $this->setSideBlock();
1492  }
setSideBlock($a_wpg_id=0)
Side column.
initStylePropertiesForm()
Init style properties form.
setSettingsSubTabs($a_active)
Set sub tabs.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
+ Here is the call graph for this function:

◆ executeCommand()

ilObjWikiGUI::executeCommand ( )

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

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

42  {
43  global $ilUser, $ilCtrl, $tpl, $ilTabs, $ilAccess;
44 
45  $next_class = $this->ctrl->getNextClass($this);
46  $cmd = $this->ctrl->getCmd();
47 
48  $this->prepareOutput();
49 
50  // see ilWikiPageGUI::printViewOrderList()
51  // printView() and pdfExport() cannot be in ilWikiPageGUI because of stylesheet confusion
52  if($cmd == "printView" || $cmd == "pdfExport")
53  {
54  $next_class = null;
55  }
56 
57  switch($next_class)
58  {
59  case "ilinfoscreengui":
60  $this->checkPermission("visible");
61  $this->addHeaderAction();
62  $this->infoScreen(); // forwards command
63  break;
64 
65  case 'ilpermissiongui':
66  $this->addHeaderAction();
67  $ilTabs->activateTab("perm_settings");
68  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
69  $perm_gui =& new ilPermissionGUI($this);
70  $ret =& $this->ctrl->forwardCommand($perm_gui);
71  break;
72 
73  case 'ilwikipagegui':
74  $this->checkPermission("read");
75  include_once("./Modules/Wiki/classes/class.ilWikiPageGUI.php");
76  $wpage_gui = ilWikiPageGUI::getGUIForTitle($this->object->getId(),
77  ilWikiUtil::makeDbTitle($_GET["page"]), $_GET["old_nr"], $this->object->getRefId());
78  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
79  $wpage_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(
80  $this->object->getStyleSheetId(), "wiki"));
81  $this->setContentStyleSheet();
82  if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()) &&
83  (!$ilAccess->checkAccess("edit_content", "", $this->object->getRefId()) ||
84  $wpage_gui->getPageObject()->getBlocked()
85  ))
86  {
87  $wpage_gui->setEnableEditing(false);
88  }
89 
90  // alter title and description
91 // $tpl->setTitle($wpage_gui->getPageObject()->getTitle());
92 // $tpl->setDescription($this->object->getTitle());
93 
94  $ret = $this->ctrl->forwardCommand($wpage_gui);
95  if ($ret != "")
96  {
97  $tpl->setContent($ret);
98  }
99  break;
100 
101  case 'ilpublicuserprofilegui':
102  require_once './Services/User/classes/class.ilPublicUserProfileGUI.php';
103  $profile_gui = new ilPublicUserProfileGUI($_GET["user"]);
104  $ret = $this->ctrl->forwardCommand($profile_gui);
105  $tpl->setContent($ret);
106  break;
107 
108  case "ilobjstylesheetgui":
109  include_once ("./Services/Style/classes/class.ilObjStyleSheetGUI.php");
110  $this->ctrl->setReturn($this, "editStyleProperties");
111  $style_gui = new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
112  $style_gui->omitLocator();
113  if ($cmd == "create" || $_GET["new_type"]=="sty")
114  {
115  $style_gui->setCreationMode(true);
116  }
117 
118  if ($cmd == "confirmedDelete")
119  {
120  $this->object->setStyleSheetId(0);
121  $this->object->update();
122  }
123 
124  $ret = $this->ctrl->forwardCommand($style_gui);
125 
126  if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle")
127  {
128  $style_id = $ret;
129  $this->object->setStyleSheetId($style_id);
130  $this->object->update();
131  $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
132  }
133  break;
134 
135  case "ilexportgui":
136 // $this->prepareOutput();
137  $this->addHeaderAction();
138  $ilTabs->activateTab("export");
139  include_once("./Services/Export/classes/class.ilExportGUI.php");
140  $exp_gui = new ilExportGUI($this);
141  $exp_gui->addFormat("xml");
142  $exp_gui->addFormat("html", "", $this, "exportHTML");
143  $ret = $this->ctrl->forwardCommand($exp_gui);
144 // $this->tpl->show();
145  break;
146 
147  case "ilcommonactiondispatchergui":
148  include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
150  $this->ctrl->forwardCommand($gui);
151  break;
152 
153  case "ilratinggui":
154  // for rating category editing
155  $this->checkPermission("write");
156  $this->addHeaderAction();
157  $ilTabs->activateTab("settings");
158  $this->setSettingsSubTabs("rating_categories");
159  include_once("Services/Rating/classes/class.ilRatingGUI.php");
160  $gui = new ilRatingGUI();
161  $gui->setObject($this->object->getId(), $this->object->getType());
162  $gui->setExportCallback(array($this, "getSubObjectTitle"), $this->lng->txt("page"));
163  $this->ctrl->forwardCommand($gui);
164  break;
165 
166  case "ilwikistatgui":
167  $this->checkPermission("statistics_read");
168 
169  $this->addHeaderAction();
170  $ilTabs->activateTab("statistics");
171 
172  include_once "Modules/Wiki/classes/class.ilWikiStatGUI.php";
173  $gui = new ilWikiStatGUI($this->object->getId());
174  $this->ctrl->forwardCommand($gui);
175  break;
176 
177  case "ilwikipagetemplategui":
178  $this->addHeaderAction();
179  $ilTabs->activateTab("settings");
180  $this->setSettingsSubTabs("page_templates");
181  include_once("./Modules/Wiki/classes/class.ilWikiPageTemplateGUI.php");
182  $wptgui = new ilWikiPageTemplateGUI($this);
183  $this->ctrl->forwardCommand($wptgui);
184  break;
185 
186  default:
187  $this->addHeaderAction();
188  if(!$cmd)
189  {
190  $cmd = "infoScreen";
191  }
192  $cmd .= "Object";
193  if ($cmd != "infoScreenObject")
194  {
195  $this->checkPermission("read");
196  }
197  else
198  {
199  $this->checkPermission("visible");
200  }
201  $this->$cmd();
202  break;
203  }
204 
205  return $ret;
206  }
infoScreen()
show information screen
Wiki page template gui class.
$_GET["client_id"]
Wiki statistics GUI class.
$cmd
Definition: sahs_server.php:35
static getGUIForTitle($a_wiki_id, $a_title, $a_old_nr=0, $a_wiki_ref_id=0)
Get wiki page gui for id and title.
global $ilCtrl
Definition: ilias.php:18
Export User Interface Class.
setSettingsSubTabs($a_active)
Set sub tabs.
GUI class for public user profile presentation.
Class ilRatingGUI.
omitLocator($a_omit=true)
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
prepareOutput()
prepare output
static makeDbTitle($a_par)
Handle page GET parameter.
global $ilUser
Definition: imgupload.php:15
setContentStyleSheet($a_tpl=null)
Set content style sheet.
Class ilObjStyleSheetGUI.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
addHeaderAction()
Add header action menu.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
+ Here is the call graph for this function:

◆ exportHTML()

ilObjWikiGUI::exportHTML ( )

Create html package.

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

1782  {
1783  require_once("./Modules/Wiki/classes/class.ilWikiHTMLExport.php");
1784  $cont_exp = new ilWikiHTMLExport($this);
1785  $cont_exp->buildExportFile();
1786  }
Wiki HTML exporter class.

◆ getGotoLink()

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

Get goto link.

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

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

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

1002  {
1003  if ($a_page == "")
1004  {
1006  }
1007 
1008  $goto = "goto.php?target=wiki_".$a_ref_id."_".
1009  ilWikiUtil::makeUrlTitle($a_page);
1010 
1011  return $goto;
1012  }
static _lookupStartPage($a_wiki_id)
Lookup start page.
static makeUrlTitle($a_par)
Set page parameter for Url Embedding.
static _lookupObjId($a_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPrintPageIds()

ilObjWikiGUI::getPrintPageIds ( )
protected

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

References $_GET, and $_POST.

Referenced by printViewObject().

1317  {
1318  // multiple ordered page ids
1319  if(is_array($_POST["wordr"]))
1320  {
1321  asort($_POST["wordr"]);
1322  $page_ids = array_keys($_POST["wordr"]);
1323  }
1324  // single page
1325  else if((int)$_GET["wpg_id"])
1326  {
1327  $page_ids = array((int)$_GET["wpg_id"]);
1328  }
1329 
1330  return $page_ids;
1331  }
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ getSettingsFormValues()

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

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

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

Referenced by editSettingsObject(), and initCreationForms().

757  {
758  global $lng, $ilUser;
759 
760  // set values
761  if ($a_mode == "create")
762  {
763  //$values["startpage"] = $lng->txt("wiki_main_page");
764  $values["rating_new"] = true;
765 
766  $values["rating_overall"] = ilObject::hasAutoRating("wiki", $_GET["ref_id"]);
767 
768  $this->form_gui->setValuesByArray($values);
769  }
770  else
771  {
772  $values["online"] = $this->object->getOnline();
773  $values["title"] = $this->object->getTitle();
774  //$values["startpage"] = $this->object->getStartPage();
775  $values["startpage_id"] = ilWikiPage::_getPageIdForWikiTitle($this->object->getId(), $this->object->getStartPage());
776  $values["shorttitle"] = $this->object->getShortTitle();
777  $values["description"] = $this->object->getLongDescription();
778  $values["rating_overall"] = $this->object->getRatingOverall();
779  $values["rating"] = $this->object->getRating();
780  // $values["rating_side"] = $this->object->getRatingAsBlock();
781  $values["rating_new"] = $this->object->getRatingForNewPages();
782  $values["rating_ext"] = $this->object->getRatingCategories();
783  $values["public_notes"] = $this->object->getPublicNotes();
784  $values["intro"] = $this->object->getIntroduction();
785 // $values["imp_pages"] = $this->object->getImportantPages();
786  $values["page_toc"] = $this->object->getPageToc();
787 
788  // only set given values (because of adv. metadata)
789  $this->form_gui->setValuesByArray($values, true);
790  }
791  }
$_GET["client_id"]
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.
global $ilUser
Definition: imgupload.php:15
+ 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 1812 of file class.ilObjWikiGUI.php.

References ilWikiPage\lookupTitle().

1813  {
1814  include_once "Modules/Wiki/classes/class.ilWikiPage.php";
1815  return ilWikiPage::lookupTitle($a_id);
1816  }
static lookupTitle($a_page_id)
Checks whether a page with given title exists.
+ Here is the call graph for this function:

◆ getTabs()

ilObjWikiGUI::getTabs (   $tabs_gui)

get tabs public

Parameters
objecttabs gui object

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

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

470  {
471  global $ilCtrl, $ilAccess, $ilTabs, $lng, $ilHelp;
472 
473  $ilHelp->setScreenIdComponent("wiki");
474 
475 
476  // wiki tabs
477  if (in_array($ilCtrl->getCmdClass(), array("", "ilobjwikigui",
478  "ilinfoscreengui", "ilpermissiongui", "ilexportgui", "ilratingcategorygui",
479  "ilwikistatgui", "ilwikipagetemplategui"
480  )))
481  {
482  if ($_GET["page"] != "")
483  {
484  $tabs_gui->setBackTarget($lng->txt("wiki_last_visited_page"),
485  $this->getGotoLink($_GET["ref_id"],
486  ilWikiUtil::makeDbTitle($_GET["page"])));
487  }
488 
489  // pages
490  if ($ilAccess->checkAccess('read', "", $this->object->getRefId()))
491  {
492  $ilTabs->addTab("wiki_pages",
493  $lng->txt("wiki_pages"),
494  $this->ctrl->getLinkTarget($this, "allPages"));
495  }
496 
497  // info screen
498  if ($ilAccess->checkAccess('visible', "", $this->object->getRefId()))
499  {
500  $ilTabs->addTab("info_short",
501  $lng->txt("info_short"),
502  $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"));
503  }
504 
505  // settings
506  if ($ilAccess->checkAccess('write', "", $this->object->getRefId()))
507  {
508  $ilTabs->addTab("settings",
509  $lng->txt("settings"),
510  $this->ctrl->getLinkTarget($this, "editSettings"));
511  }
512 
513  // contributors
514  if ($ilAccess->checkAccess('write', "", $this->object->getRefId()))
515  {
516  $ilTabs->addTab("wiki_contributors",
517  $lng->txt("wiki_contributors"),
518  $this->ctrl->getLinkTarget($this, "listContributors"));
519  }
520 
521  // statistics
522  if ($ilAccess->checkAccess('statistics_read', "", $this->object->getRefId()))
523  {
524  $ilTabs->addTab("statistics",
525  $lng->txt("statistics"),
526  $this->ctrl->getLinkTargetByClass("ilWikiStatGUI", "initial"));
527  }
528 
529  if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
530  {
531  $ilTabs->addTab("export",
532  $lng->txt("export"),
533  $this->ctrl->getLinkTargetByClass("ilexportgui", ""));
534  }
535 
536  // edit permissions
537  if ($ilAccess->checkAccess('edit_permission', "", $this->object->getRefId()))
538  {
539  $ilTabs->addTab("perm_settings",
540  $lng->txt("perm_settings"),
541  $this->ctrl->getLinkTargetByClass("ilpermissiongui", "perm"));
542  }
543  }
544  }
static getGotoLink($a_ref_id, $a_page="")
Get goto link.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static makeDbTitle($a_par)
Handle page GET parameter.
+ 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 1144 of file class.ilObjWikiGUI.php.

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

Referenced by randomPageObject().

1145  {
1146  global $ilCtrl;
1147 
1148  if ($a_page == "")
1149  {
1150  $a_page = $_GET["page"];
1151  }
1152 
1153  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
1154  if (ilWikiPage::_wikiPageExists($this->object->getId(),
1155  ilWikiUtil::makeDbTitle($a_page)))
1156  {
1157  // to do: get rid of this redirect
1158  ilUtil::redirect(ilObjWikiGUI::getGotoLink($this->object->getRefId(), $a_page));
1159  }
1160  else
1161  {
1162  if (!$this->object->getTemplateSelectionOnCreation())
1163  {
1164  $this->object->createWikiPage($a_page);
1165 
1166  // redirect to newly created page
1167  $ilCtrl->setParameterByClass("ilwikipagegui", "page", ilWikiUtil::makeUrlTitle(($a_page)));
1168  $ilCtrl->redirectByClass("ilwikipagegui", "edit");
1169  }
1170  else
1171  {
1172  $ilCtrl->setParameter($this, "page", ilWikiUtil::makeUrlTitle($_GET["page"]));
1173  $ilCtrl->setParameter($this, "from_page", ilWikiUtil::makeUrlTitle($_GET["from_page"]));
1174  $ilCtrl->redirect($this, "showTemplateSelection");
1175  }
1176  }
1177  }
static getGotoLink($a_ref_id, $a_page="")
Get goto link.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static makeUrlTitle($a_par)
Set page parameter for Url Embedding.
static makeDbTitle($a_par)
Handle page GET parameter.
static _wikiPageExists($a_wiki_id, $a_title)
Check whether page exists for wiki or not.
static redirect($a_script)
http redirect to other script
+ 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 412 of file class.ilObjWikiGUI.php.

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

Referenced by viewObject().

413  {
414  global $ilCtrl;
415 
416  ilUtil::redirect(ilObjWikiGUI::getGotoLink($this->object->getRefId()));
417  }
static getGotoLink($a_ref_id, $a_page="")
Get goto link.
global $ilCtrl
Definition: ilias.php:18
static redirect($a_script)
http redirect to other script
+ 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 public.

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

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

27  {
28  global $ilCtrl, $lng;
29 
30  $this->type = "wiki";
31 
32  $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference,$a_prepare_output);
33  $lng->loadLanguageModule("wiki");
34 
35  if ($_GET["page"] != "")
36  {
37  $ilCtrl->setParameter($this, "page", ilWikiUtil::makeUrlTitle($_GET["page"]));
38  }
39  }
$_GET["client_id"]
ilObjectGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor public.
global $ilCtrl
Definition: ilias.php:18
static makeUrlTitle($a_par)
Set page parameter for Url Embedding.
+ Here is the call graph for this function:

◆ infoScreen()

ilObjWikiGUI::infoScreen ( )

show information screen

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

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

328  {
329  global $ilAccess, $ilUser, $ilTabs, $lng;
330 
331  $ilTabs->activateTab("info_short");
332 
333  if (!$ilAccess->checkAccess("visible", "", $this->object->getRefId()))
334  {
335  $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
336  }
337 
338  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
339  $info = new ilInfoScreenGUI($this);
340  $info->enablePrivateNotes();
341  if (trim($this->object->getIntroduction()) != "")
342  {
343  $info->addSection($lng->txt("wiki_introduction"));
344  $info->addProperty("", nl2br($this->object->getIntroduction()));
345  }
346 
347  // feedback from tutor; mark, status, comment
348  include_once("./Modules/Wiki/classes/class.ilWikiContributor.php");
349  include_once("./Services/Tracking/classes/class.ilLPMarks.php");
350  $lpcomment = ilLPMarks::_lookupComment($ilUser->getId(), $this->object->getId());
351  $mark = ilLPMarks::_lookupMark($ilUser->getId(), $this->object->getId());
352  $status = ilWikiContributor::_lookupStatus($this->object->getId(), $ilUser->getId());
353  if ($lpcomment != "" || $mark != "" || $status != ilWikiContributor::STATUS_NOT_GRADED)
354  {
355  $info->addSection($this->lng->txt("wiki_feedback_from_tutor"));
356  if ($lpcomment != "")
357  {
358  $info->addProperty($this->lng->txt("wiki_comment"),
359  $lpcomment);
360  }
361  if ($mark != "")
362  {
363  $info->addProperty($this->lng->txt("wiki_mark"),
364  $mark);
365  }
366 
367  if ($status == ilWikiContributor::STATUS_PASSED)
368  {
369  $info->addProperty($this->lng->txt("status"),
370  $this->lng->txt("wiki_passed"));
371  }
372  if ($status == ilWikiContributor::STATUS_FAILED)
373  {
374  $info->addProperty($this->lng->txt("status"),
375  $this->lng->txt("wiki_failed"));
376  }
377  }
378 
379  /*
380  $info->enableNews();
381  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
382  {
383  //$info->enableNewsEditing();
384  $info->setBlockProperty("news", "settings", true);
385  }*/
386 
387  if ($ilAccess->checkAccess("read", "", $this->object->getRefId()))
388  {
389  $info->addButton($lng->txt("wiki_start_page"), ilObjWikiGUI::getGotoLink($this->object->getRefId()));
390  }
391 
392  // general information
393  $this->lng->loadLanguageModule("meta");
394  $this->lng->loadLanguageModule("wiki");
395 
396  //$info->addSection($this->lng->txt("meta_general"));
397  //$info->addProperty($this->lng->txt("mcst_nr_items"),
398  // (int) count($med_items));
399 
400  // forward the command
401  $this->ctrl->forwardCommand($info);
402 
403  if ($ilAccess->checkAccess("read", "", $this->object->getRefId()))
404  {
405 // $this->setSideBlock();
406  }
407  }
static getGotoLink($a_ref_id, $a_page="")
Get goto link.
Class ilInfoScreenGUI.
_lookupMark($a_usr_id, $a_obj_id)
redirection script todo: (a better solution should control the processing via a xml file) ...
_lookupStatus($a_obj_id, $a_user_id)
Lookup current success status (STATUS_NOT_GRADED|STATUS_PASSED|STATUS_FAILED)
_lookupComment($a_usr_id, $a_obj_id)
global $ilUser
Definition: imgupload.php:15
+ 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 316 of file class.ilObjWikiGUI.php.

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

317  {
318  $this->checkPermission("visible");
319  $this->ctrl->setCmd("showSummary");
320  $this->ctrl->setCmdClass("ilinfoscreengui");
321  $this->infoScreen();
322  }
infoScreen()
show information screen
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
+ Here is the call graph for this function:

◆ initCreationForms()

ilObjWikiGUI::initCreationForms (   $a_new_type)
protected

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

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

232  {
233  $this->initSettingsForm("create");
234  $this->getSettingsFormValues("create");
235 
236  $forms = array(self::CFORM_NEW => $this->form_gui,
237  self::CFORM_IMPORT => $this->initImportForm($a_new_type));
238 
239  return $forms;
240  }
initImportForm($a_new_type)
Init object import form.
getSettingsFormValues($a_mode="edit")
initSettingsForm($a_mode="edit")
Init Settings Form.
+ Here is the call graph for this function:

◆ initSettingsForm()

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

Init Settings Form.

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

References $ilCtrl, $ilSetting, ilObjectGUI\$lng, $options, $si, ilSubEnabledFormPropertyGUI\addSubItem(), ilWikiPage\getAllPages(), ilUtil\getImagePath(), ilAdvancedMDRecordGUI\MODE_REC_SELECTION, ilTextAreaInputGUI\setCols(), ilFormPropertyGUI\setInfo(), ilAdvancedMDRecordGUI\setPropertyForm(), ilFormPropertyGUI\setRequired(), and ilUtil\shortenText().

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

617  {
618  global $lng, $ilCtrl, $ilTabs, $ilSetting;
619 
620  $lng->loadLanguageModule("wiki");
621  $ilTabs->activateTab("settings");
622 
623  include("Services/Form/classes/class.ilPropertyFormGUI.php");
624  $this->form_gui = new ilPropertyFormGUI();
625 
626  // Title
627  $tit = new ilTextInputGUI($lng->txt("title"), "title");
628  $tit->setRequired(true);
629  $this->form_gui->addItem($tit);
630 
631  // Short Title
632  // The problem with the short title is, that it is per object
633  // and can't be a substitute for a ref id in the permanent link
634 /*
635  $stit = new ilRegExpInputGUI($lng->txt("wiki_short_title"), "shorttitle");
636  $stit->setPattern("/^[^0-9][^ _\&]+$/");
637  $stit->setRequired(false);
638  $stit->setNoMatchMessage($lng->txt("wiki_msg_short_name_regexp")." & _");
639  $stit->setSize(20);
640  $stit->setMaxLength(20);
641  $stit->setInfo($lng->txt("wiki_short_title_desc2"));
642  $this->form_gui->addItem($stit);
643 */
644 
645  // Description
646  $des = new ilTextAreaInputGUI($lng->txt("description"), "description");
647  $this->form_gui->addItem($des);
648 
649  // Introduction
650  $intro = new ilTextAreaInputGUI($lng->txt("wiki_introduction"), "intro");
651  $intro->setCols(40);
652  $intro->setRows(4);
653  $this->form_gui->addItem($intro);
654 
655  // Start Page
656  if ($a_mode == "edit")
657  {
658  $pages = ilWikiPage::getAllPages($this->object->getId());
659  foreach ($pages as $p)
660  {
661  $options[$p["id"]] = ilUtil::shortenText($p["title"], 60, true);
662  }
663  $si = new ilSelectInputGUI($lng->txt("wiki_start_page"), "startpage_id");
664  $si->setOptions($options);
665  $this->form_gui->addItem($si);
666  }
667  else
668  {
669  $sp = new ilTextInputGUI($lng->txt("wiki_start_page"), "startpage");
670  if ($a_mode == "edit")
671  {
672  $sp->setInfo($lng->txt("wiki_start_page_info"));
673  }
674  $sp->setMaxLength(200);
675  $sp->setRequired(true);
676  $this->form_gui->addItem($sp);
677  }
678 
679  // Online
680  $online = new ilCheckboxInputGUI($lng->txt("online"), "online");
681  $this->form_gui->addItem($online);
682 
683 
684  // rating
685 
686  $lng->loadLanguageModule('rating');
687  $rate = new ilCheckboxInputGUI($lng->txt('rating_activate_rating'), 'rating_overall');
688  $rate->setInfo($lng->txt('rating_activate_rating_info'));
689  $this->form_gui->addItem($rate);
690 
691  $rating = new ilCheckboxInputGUI($lng->txt("wiki_activate_rating"), "rating");
692  $this->form_gui->addItem($rating);
693 
694  /* always active
695  $side = new ilCheckboxInputGUI($lng->txt("wiki_activate_sideblock_rating"), "rating_side");
696  $rating->addSubItem($side);
697  */
698 
699  $new = new ilCheckboxInputGUI($lng->txt("wiki_activate_new_page_rating"), "rating_new");
700  $rating->addSubItem($new);
701 
702  $extended = new ilCheckboxInputGUI($lng->txt("wiki_activate_extended_rating"), "rating_ext");
703  $rating->addSubItem($extended);
704 
705 
706  // public comments
707  if (!$ilSetting->get("disable_comments"))
708  {
709  $comments = new ilCheckboxInputGUI($lng->txt("wiki_public_comments"), "public_notes");
710  $this->form_gui->addItem($comments);
711  }
712 
713  // important pages
714 // $imp_pages = new ilCheckboxInputGUI($lng->txt("wiki_important_pages"), "imp_pages");
715 // $this->form_gui->addItem($imp_pages);
716 
717  // page toc
718  $page_toc = new ilCheckboxInputGUI($lng->txt("wiki_page_toc"), "page_toc");
719  $page_toc->setInfo($lng->txt("wiki_page_toc_info"));
720  $this->form_gui->addItem($page_toc);
721 
722  if($a_mode == "edit")
723  {
724  // advanced metadata
725  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
726  $record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_REC_SELECTION,'wiki',$this->object->getId(), "wpg");
727  $record_gui->setPropertyForm($this->form_gui);
728  $record_gui->parseRecordSelection($this->lng->txt("wiki_add_page_properties"));
729  }
730 
731  // :TODO: sorting
732 
733  // Form action and save button
734  $this->form_gui->setTitleIcon(ilUtil::getImagePath("icon_wiki.svg"));
735  if ($a_mode != "create")
736  {
737  $this->form_gui->setTitle($lng->txt("wiki_settings"));
738  $this->form_gui->addCommandButton("saveSettings", $lng->txt("save"));
739  }
740  else
741  {
742  $this->form_gui->setTitle($lng->txt("wiki_new"));
743  $this->form_gui->addCommandButton("save", $lng->txt("wiki_add"));
744  $this->form_gui->addCommandButton("cancel", $lng->txt("cancel"));
745  }
746 
747  // set values
748  if ($a_mode == "create")
749  {
750  $ilCtrl->setParameter($this, "new_type", "wiki");
751  }
752 
753  $this->form_gui->setFormAction($ilCtrl->getFormAction($this, "saveSettings"));
754  }
This class represents a selection list property in a property form.
This class represents a property form user interface.
setPropertyForm($form)
set property form object
static shortenText($a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
This class represents a checkbox property in a property form.
global $ilCtrl
Definition: ilias.php:18
setInfo($a_info)
Set Information Text.
if(!is_array($argv)) $options
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
This class represents a text property in a property form.
global $ilSetting
Definition: privfeed.php:40
This class represents a text area property in a property form.
static getAllPages($a_wiki_id)
Get all pages of wiki.
setRequired($a_required)
Set Required.
+ 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 1497 of file class.ilObjWikiGUI.php.

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

Referenced by editStylePropertiesObject().

1498  {
1499  global $ilCtrl, $lng, $ilTabs, $ilSetting;
1500 
1501  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
1502  $lng->loadLanguageModule("style");
1503 
1504  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
1505  $this->form = new ilPropertyFormGUI();
1506 
1507  $fixed_style = $ilSetting->get("fixed_content_style_id");
1508  $style_id = $this->object->getStyleSheetId();
1509 
1510  if ($fixed_style > 0)
1511  {
1512  $st = new ilNonEditableValueGUI($lng->txt("style_current_style"));
1513  $st->setValue(ilObject::_lookupTitle($fixed_style)." (".
1514  $this->lng->txt("global_fixed").")");
1515  $this->form->addItem($st);
1516  }
1517  else
1518  {
1519  $st_styles = ilObjStyleSheet::_getStandardStyles(true, false,
1520  $_GET["ref_id"]);
1521 
1522  $st_styles[0] = $this->lng->txt("default");
1523  ksort($st_styles);
1524 
1525  if ($style_id > 0)
1526  {
1527  // individual style
1528  if (!ilObjStyleSheet::_lookupStandard($style_id))
1529  {
1530  $st = new ilNonEditableValueGUI($lng->txt("style_current_style"));
1531  $st->setValue(ilObject::_lookupTitle($style_id));
1532  $this->form->addItem($st);
1533 
1534 //$this->ctrl->getLinkTargetByClass("ilObjStyleSheetGUI", "edit"));
1535 
1536  // delete command
1537  $this->form->addCommandButton("editStyle",
1538  $lng->txt("style_edit_style"));
1539  $this->form->addCommandButton("deleteStyle",
1540  $lng->txt("style_delete_style"));
1541 //$this->ctrl->getLinkTargetByClass("ilObjStyleSheetGUI", "delete"));
1542  }
1543  }
1544 
1545  if ($style_id <= 0 || ilObjStyleSheet::_lookupStandard($style_id))
1546  {
1547  $style_sel = ilUtil::formSelect ($style_id, "style_id",
1548  $st_styles, false, true);
1549  $style_sel = new ilSelectInputGUI($lng->txt("style_current_style"), "style_id");
1550  $style_sel->setOptions($st_styles);
1551  $style_sel->setValue($style_id);
1552  $this->form->addItem($style_sel);
1553 //$this->ctrl->getLinkTargetByClass("ilObjStyleSheetGUI", "create"));
1554  $this->form->addCommandButton("saveStyleSettings",
1555  $lng->txt("save"));
1556  $this->form->addCommandButton("createStyle",
1557  $lng->txt("sty_create_ind_style"));
1558  }
1559  }
1560  $this->form->setTitle($lng->txt("wiki_style"));
1561  $this->form->setFormAction($ilCtrl->getFormAction($this));
1562  }
This class represents a selection list property in a property form.
This class represents a property form user interface.
$_GET["client_id"]
static _lookupTitle($a_id)
lookup object title
global $ilCtrl
Definition: ilias.php:18
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.
_getStandardStyles($a_exclude_default_style=false, $a_include_deactivated=false, $a_scope=0)
Get standard styles.
setOptions($a_options)
Set Options.
_lookupStandard($a_id)
Lookup standard flag.
This class represents a non editable value in a property form.
global $ilSetting
Definition: privfeed.php:40
+ 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 1837 of file class.ilObjWikiGUI.php.

References $_GET, $ilCtrl, ilObjectGUI\$lng, $t, ilWikiPageTemplate\getAllInfo(), ilFormPropertyGUI\setRequired(), and ilWikiPageTemplate\TYPE_NEW_PAGES.

Referenced by createPageUsingTemplateObject(), and showTemplateSelectionObject().

1838  {
1839  global $lng, $ilCtrl;
1840 
1841  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1842  $form = new ilPropertyFormGUI();
1843 
1844  // page name
1845  $hi = new ilHiddenInputGUI("page");
1846  $hi->setValue($_GET["page"]);
1847  $form->addItem($hi);
1848 
1849  // page template
1850  $radg = new ilRadioGroupInputGUI($lng->txt("wiki_page_template"), "page_templ");
1851  $radg->setRequired(true);
1852 
1853  if ($this->object->getEmptyPageTemplate())
1854  {
1855  $op1 = new ilRadioOption($lng->txt("wiki_empty_page"), 0);
1856  $radg->addOption($op1);
1857  }
1858 
1859  include_once("./Modules/Wiki/classes/class.ilWikiPageTemplate.php");
1860  $wt = new ilWikiPageTemplate($this->object->getId());
1862  foreach ($ts as $t)
1863  {
1864  $op = new ilRadioOption($t["title"], $t["wpage_id"]);
1865  $radg->addOption($op);
1866  }
1867 
1868  $form->addItem($radg);
1869 
1870  // save and cancel commands
1871  $form->addCommandButton("createPageUsingTemplate", $lng->txt("wiki_create_page"));
1872  $form->addCommandButton("cancelCreationPageUsingTemplate", $lng->txt("cancel"));
1873 
1874  $form->setTitle($lng->txt("wiki_new_page").": ".$_GET["page"]);
1875  $form->setFormAction($ilCtrl->getFormAction($this));
1876 
1877  return $form;
1878  }
This class represents an option in a radio group.
getAllInfo($a_type=self::TYPE_ALL)
Get all info.
This class represents a property form user interface.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
This class represents a hidden form property in a property form.
This class represents a property in a property form.
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller 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 213 of file class.ilObjWikiGUI.php.

References ilObjWiki\isOnlineHelpWiki().

214  {
215  if (is_object($this->object))
216  {
217  return ilObjWiki::isOnlineHelpWiki($this->object->getRefId());
218  }
219  return false;
220  }
static isOnlineHelpWiki($a_ref_id)
Is wiki an online help wiki?
+ Here is the call graph for this function:

◆ listContributorsObject()

ilObjWikiGUI::listContributorsObject ( )

List all contributors.

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

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

859  {
860  global $tpl, $ilTabs;
861 
862  $this->checkPermission("write");
863  $ilTabs->activateTab("wiki_contributors");
864 
865  include_once("./Modules/Wiki/classes/class.ilWikiContributorsTableGUI.php");
866 
867  $table_gui = new ilWikiContributorsTableGUI($this, "listContributors",
868  $this->object->getId());
869 
870  $tpl->setContent($table_gui->getHTML());
871 
872  $this->setSideBlock();
873  }
setSideBlock($a_wpg_id=0)
Side column.
TableGUI class for listing users that contributed to the wiki.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
+ 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 1795 of file class.ilObjWikiGUI.php.

1796  {
1797  include_once "Modules/Wiki/classes/class.ilWikiPage.php";
1798  $page = new ilWikiPage($a_page_id);
1799  if($page->getWikiId() == $a_wiki_id)
1800  {
1801  return $page->getTitle();
1802  }
1803  }
Class ilWikiPage.

◆ newPagesObject()

ilObjWikiGUI::newPagesObject ( )

Latest pages.

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

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

1300  {
1301  global $tpl;
1302 
1303  $this->checkPermission("read");
1304 
1305  include_once("./Modules/Wiki/classes/class.ilWikiPagesTableGUI.php");
1306 
1307  $this->addPagesSubTabs();
1308 
1309  $table_gui = new ilWikiPagesTableGUI($this, "newPages",
1310  $this->object->getId(), IL_WIKI_NEW_PAGES);
1311 
1312  $this->setSideBlock();
1313  $tpl->setContent($table_gui->getHTML());
1314  }
setSideBlock($a_wpg_id=0)
Side column.
TableGUI class for wiki pages table.
addPagesSubTabs()
Add Pages SubTabs.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
const IL_WIKI_NEW_PAGES
+ Here is the call graph for this function:

◆ orphanedPagesObject()

ilObjWikiGUI::orphanedPagesObject ( )

Orphaned pages.

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

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

1123  {
1124  global $tpl;
1125 
1126  $this->checkPermission("read");
1127 
1128  include_once("./Modules/Wiki/classes/class.ilWikiPagesTableGUI.php");
1129 
1130  $this->addPagesSubTabs();
1131 
1132  $table_gui = new ilWikiPagesTableGUI($this, "orphanedPages",
1133  $this->object->getId(), IL_WIKI_ORPHANED_PAGES);
1134 
1135  $this->setSideBlock();
1136  $tpl->setContent($table_gui->getHTML());
1137  }
setSideBlock($a_wpg_id=0)
Side column.
TableGUI class for wiki pages table.
addPagesSubTabs()
Add Pages SubTabs.
const IL_WIKI_ORPHANED_PAGES
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
+ Here is the call graph for this function:

◆ pdfExportObject()

ilObjWikiGUI::pdfExportObject ( )

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

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

1399  {
1400  $html = $this->printViewObject(true);
1401 
1402  // :TODO: fixing css dummy parameters
1403  $html = preg_replace("/\?dummy\=[0-9]+/", "", $html);
1404  $html = preg_replace("/\?vers\=[0-9A-Za-z\-]+/", "", $html);
1405 
1406  include_once "Services/PDFGeneration/classes/class.ilPDFGeneration.php";
1407  include_once "Services/PDFGeneration/classes/class.ilPDFGenerationJob.php";
1408 
1409  $job = new ilPDFGenerationJob();
1410  $job->setAutoPageBreak(true)
1411  ->setMarginLeft("10")
1412  ->setMarginRight("10")
1413  ->setMarginTop("10")
1414  ->setMarginBottom("10")
1415  ->setOutputMode("D") // download
1416  ->setFilename("wiki.pdf") // :TODO:
1417  ->setCreator("ILIAS Wiki") // :TODO:
1418  ->setImageScale(1.25) // complete content scaling ?!
1419  ->addPage($html);
1420 
1421  ilPDFGeneration::doJob($job);
1422  }
printViewObject($a_pdf_export=false)
Class ilPDFGenerationJob.
static doJob(ilPDFGenerationJob $job)
+ Here is the call graph for this function:

◆ performSearchObject()

ilObjWikiGUI::performSearchObject ( )

Search.

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

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

1428  {
1429  global $tpl, $ilTabs, $ilCtrl, $lng;
1430 
1431  $this->checkPermission("read");
1432 
1433  include_once("./Modules/Wiki/classes/class.ilWikiSearchResultsTableGUI.php");
1434 
1435  $ilTabs->setTabActive("wiki_search_results");
1436 
1437  if (trim($_POST["search_term"]) == "")
1438  {
1439  ilUtil::sendFailure($lng->txt("wiki_please_enter_search_term"), true);
1440  $ilCtrl->redirectByClass("ilwikipagegui", "preview");
1441  }
1442 
1443  $search_results = ilObjWiki::_performSearch($this->object->getId(),
1444  ilUtil::stripSlashes($_POST["search_term"]));
1445  $table_gui = new ilWikiSearchResultsTableGUI($this, "performSearch",
1446  $this->object->getId(), $search_results, $_POST["search_term"]);
1447 
1448  $this->setSideBlock();
1449  $tpl->setContent($table_gui->getHTML());
1450  }
setSideBlock($a_wpg_id=0)
Side column.
$_POST['username']
Definition: cron.php:12
TableGUI class for recent changes in wiki.
global $ilCtrl
Definition: ilias.php:18
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
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
+ Here is the call graph for this function:

◆ popularPagesObject()

ilObjWikiGUI::popularPagesObject ( )

Popular pages.

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

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

1103  {
1104  global $tpl;
1105 
1106  $this->checkPermission("read");
1107 
1108  include_once("./Modules/Wiki/classes/class.ilWikiPagesTableGUI.php");
1109 
1110  $this->addPagesSubTabs();
1111 
1112  $table_gui = new ilWikiPagesTableGUI($this, "popularPages",
1113  $this->object->getId(), IL_WIKI_POPULAR_PAGES);
1114 
1115  $this->setSideBlock();
1116  $tpl->setContent($table_gui->getHTML());
1117  }
setSideBlock($a_wpg_id=0)
Side column.
const IL_WIKI_POPULAR_PAGES
TableGUI class for wiki pages table.
addPagesSubTabs()
Add Pages SubTabs.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
+ Here is the call graph for this function:

◆ printViewObject()

ilObjWikiGUI::printViewObject (   $a_pdf_export = false)

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

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

Referenced by pdfExportObject().

1334  {
1335  global $tpl;
1336 
1337  $page_ids = $this->getPrintPageIds();
1338  if(!$page_ids)
1339  {
1340  $this->ctrl->redirect($this, "");
1341  }
1342 
1343  $tpl = new ilTemplate("tpl.main.html", true, true);
1344  $tpl->setVariable("LOCATION_STYLESHEET", ilObjStyleSheet::getContentPrintStyle());
1345  $this->setContentStyleSheet($tpl);
1346 
1347  // syntax style
1348  $tpl->setCurrentBlock("SyntaxStyle");
1349  $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
1351  $tpl->parseCurrentBlock();
1352 
1353 
1354  // determine target frames for internal links
1355 
1356  include_once("./Modules/Wiki/classes/class.ilWikiPageGUI.php");
1357 
1358  $page_content = "";
1359 
1360  foreach ($page_ids as $p_id)
1361  {
1362  $page_gui = new ilWikiPageGUI($p_id);
1363  $page_gui->setOutputMode("print");
1364  $page_content.= $page_gui->showPage();
1365 
1366  if($a_pdf_export)
1367  {
1368  $page_content .= '<p style="page-break-after:always;"></p>';
1369  }
1370  }
1371 
1372  $page_content = '<div class="ilInvisibleBorder">'.$page_content.'</div>';
1373 
1374  if(!$a_pdf_export)
1375  {
1376  $page_content .= '<script type="text/javascript" language="javascript1.2">
1377  <!--
1378  il.Util.addOnLoad(function () {
1379  il.Util.print();
1380  });
1381  //-->
1382  </script>';
1383  }
1384 
1385  $tpl->setVariable("CONTENT", $page_content);
1386 
1387  if(!$a_pdf_export)
1388  {
1389  $tpl->show(false);
1390  exit;
1391  }
1392  else
1393  {
1394  return $tpl->get("DEFAULT", false, false, false, true, false, false);
1395  }
1396  }
exit
Definition: login.php:54
getSyntaxStylePath()
get syntax style path
special template class to simplify handling of ITX/PEAR
Class ilWikiPage GUI class.
getContentPrintStyle()
get content print style
setContentStyleSheet($a_tpl=null)
Set content style sheet.
+ 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 1184 of file class.ilObjWikiGUI.php.

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

1185  {
1186  $this->checkPermission("read");
1187 
1188  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
1189  $page = ilWikiPage::getRandomPage($this->object->getId());
1190  $this->gotoPageObject($page);
1191  }
static getRandomPage($a_wiki_id)
Get a random page.
gotoPageObject($a_page="")
Go to specific page.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
+ Here is the call graph for this function:

◆ recentChangesObject()

ilObjWikiGUI::recentChangesObject ( )

Recent Changes.

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

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

1197  {
1198  global $tpl;
1199 
1200  $this->checkPermission("read");
1201 
1202  include_once("./Modules/Wiki/classes/class.ilWikiRecentChangesTableGUI.php");
1203 
1204  $this->addPagesSubTabs();
1205 
1206  $table_gui = new ilWikiRecentChangesTableGUI($this, "recentChanges",
1207  $this->object->getId());
1208 
1209  $this->setSideBlock();
1210  $tpl->setContent($table_gui->getHTML());
1211  }
setSideBlock($a_wpg_id=0)
Side column.
addPagesSubTabs()
Add Pages SubTabs.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
TableGUI class for recent changes in wiki.
+ Here is the call graph for this function:

◆ removeImportantPagesObject()

ilObjWikiGUI::removeImportantPagesObject ( )

Remove important pages.

Parameters

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

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

1724  {
1725  global $ilCtrl, $lng;
1726 
1727  $this->checkPermission("write");
1728 
1729  if (is_array($_POST["imp_page_id"]))
1730  {
1731  foreach ($_POST["imp_page_id"] as $i)
1732  {
1733  $this->object->removeImportantPage((int) $i);
1734  }
1735  }
1736  ilUtil::sendSuccess($lng->txt("wiki_removed_imp_pages"), true);
1737  $ilCtrl->redirect($this, "editImportantPages");
1738  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
+ 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 1225 of file class.ilObjWikiGUI.php.

References ilObjectGUI\$lng, ilObjectGUI\$tpl, ilObject\_lookupObjId(), ilObjWiki\_lookupRating(), ilObjWiki\_lookupRatingCategories(), ilWikiAdvMetaDataBlockGUI\getRecords(), and ilWikiAdvMetaDataBlockGUI\isActive().

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

1226  {
1227  global $tpl, $lng;
1228 
1229  if ($a_wpg_id > 0 && !$a_wp)
1230  {
1231  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
1232  $a_wp = ilWikiPage($a_wpg_id);
1233  }
1234 
1235  // search block
1236  include_once("./Modules/Wiki/classes/class.ilWikiSearchBlockGUI.php");
1237  $wiki_search_block = new ilWikiSearchBlockGUI();
1238  $rcontent = $wiki_search_block->getHTML();
1239 
1240  // quick navigation
1241  if ($a_wpg_id > 0)
1242  {
1243 // include_once("./Modules/Wiki/classes/class.ilWikiSideBlockGUI.php");
1244 // $wiki_side_block = new ilWikiSideBlockGUI();
1245 // $wiki_side_block->setPageObject($a_wp);
1246 // $rcontent.= $wiki_side_block->getHTML();
1247 
1248  // rating
1249  $wiki_id =ilObject::_lookupObjId($a_wiki_ref_id);
1250  if(ilObjWiki::_lookupRating($wiki_id) &&
1251  // ilObjWiki::_lookupRatingAsBlock($wiki_id) &&
1252  $a_wp->getRating())
1253  {
1254  include_once("./Services/Rating/classes/class.ilRatingGUI.php");
1255  $rgui = new ilRatingGUI();
1256  $rgui->setObject($wiki_id, "wiki", $a_wpg_id, "wpg");
1257  $rgui->enableCategories(ilObjWiki::_lookupRatingCategories($wiki_id));
1258  $rgui->setYourRatingText("#");
1259  $rcontent .= $rgui->getBlockHTML($lng->txt("wiki_rate_page"));
1260  }
1261 
1262  // advanced metadata
1263  include_once("./Modules/Wiki/classes/class.ilWikiAdvMetaDataBlockGUI.php");
1265  {
1266  $rec_ids = ilWikiAdvMetaDataBlockGUI::getRecords($wiki_id);
1267  foreach($rec_ids as $record)
1268  {
1269  $advmd_pages_block = new ilWikiAdvMetaDataBlockGUI($record);
1270  $advmd_pages_block->setObject($a_wiki_ref_id, $wiki_id, $a_wpg_id);
1271  $rcontent.= $advmd_pages_block->getHTML();
1272  }
1273  }
1274  }
1275 
1276  // important pages
1277 // if (ilObjWiki::_lookupImportantPages(ilObject::_lookupObjId($a_wiki_ref_id)))
1278 // {
1279  include_once("./Modules/Wiki/classes/class.ilWikiImportantPagesBlockGUI.php");
1280  $imp_pages_block = new ilWikiImportantPagesBlockGUI();
1281  $rcontent.= $imp_pages_block->getHTML();
1282 // }
1283 
1284  // wiki functions block
1285  if ($a_wpg_id > 0)
1286  {
1287  include_once("./Modules/Wiki/classes/class.ilWikiFunctionsBlockGUI.php");
1288  $wiki_functions_block = new ilWikiFunctionsBlockGUI();
1289  $wiki_functions_block->setPageObject($a_wp);
1290  $rcontent .= $wiki_functions_block->getHTML();
1291  }
1292 
1293  $tpl->setRightContent($rcontent);
1294  }
BlockGUI class for wiki searchblock.
Advanced metadata wiki block.
static _lookupRatingCategories($a_wiki_id)
Lookup whether rating categories are activated.
BlockGUI class for wiki functions block.
static _lookupRating($a_wiki_id)
Lookup whether rating is activated.
Class ilRatingGUI.
static _lookupObjId($a_id)
Class ilWikiPage.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveGradingObject()

ilObjWikiGUI::saveGradingObject ( )

Save grading.

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

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

879  {
880  global $ilCtrl, $lng;
881 
882  $this->checkPermission("write");
883 
884  $users = (is_array($_POST["user_id"])
885  ? $_POST["user_id"]
886  : array());
887 
888  include_once("./Modules/Wiki/classes/class.ilWikiContributor.php");
889  include_once("./Services/Tracking/classes/class.ilLPMarks.php");
890  $saved = false;
891  foreach($users as $user_id)
892  {
893  if ($user_id != "")
894  {
895  $marks_obj = new ilLPMarks($this->object->getId(),$user_id);
896  $new_mark = ilUtil::stripSlashes($_POST['mark'][$user_id]);
897  $new_comment = ilUtil::stripSlashes($_POST['lcomment'][$user_id]);
898  $new_status = ilUtil::stripSlashes($_POST["status"][$user_id]);
899 
900  if ($marks_obj->getMark() != $new_mark ||
901  $marks_obj->getComment() != $new_comment ||
902  ilWikiContributor::_lookupStatus($this->object->getId(), $user_id) != $new_status)
903  {
904  ilWikiContributor::_writeStatus($this->object->getId(), $user_id, $new_status);
905  $marks_obj->setMark($new_mark);
906  $marks_obj->setComment($new_comment);
907  $marks_obj->update();
908  $saved = true;
909  }
910  }
911  }
912  if ($saved)
913  {
914  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
915  }
916 
917  $ilCtrl->redirect($this, "listContributors");
918  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
_writeStatus($a_obj_id, $a_user_id, $a_status)
Write success status.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
_lookupStatus($a_obj_id, $a_user_id)
Lookup current success status (STATUS_NOT_GRADED|STATUS_PASSED|STATUS_FAILED)
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
+ Here is the call graph for this function:

◆ saveObject()

ilObjWikiGUI::saveObject ( )

save object public

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

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

247  {
248  global $tpl, $lng, $rbacsystem;
249 
250  if (!$this->checkPermissionBool("create", "", "wiki", $_GET["ref_id"]))
251  {
252  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
253  }
254 
255  $this->initSettingsForm("create");
256  if ($this->form_gui->checkInput())
257  {
258  if (!ilObjWiki::checkShortTitleAvailability($this->form_gui->getInput("shorttitle")))
259  {
260  $short_item = $this->form_gui->getItemByPostVar("shorttitle");
261  $short_item->setAlert($lng->txt("wiki_short_title_already_in_use"));
262  }
263  else
264  {
265  // create and insert forum in objecttree
266  $_POST["title"] = $this->form_gui->getInput("title");
267  $_POST["desc"] = $this->form_gui->getInput("description");
268  return parent::saveObject();
269  }
270  }
271 
272  $this->form_gui->setValuesByPost();
273  $tpl->setContent($this->form_gui->getHtml());
274  }
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
static checkShortTitleAvailability($a_short_title)
Check availability of short title.
redirection script todo: (a better solution should control the processing via a xml file) ...
initSettingsForm($a_mode="edit")
Init Settings Form.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
+ Here is the call graph for this function:

◆ saveOrderingAndIndentObject()

ilObjWikiGUI::saveOrderingAndIndentObject ( )

Save important pages ordering and indentation.

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

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

1744  {
1745  global $ilCtrl, $lng;
1746 
1747  $this->checkPermission("write");
1748 
1749  $this->object->saveOrderingAndIndentation($_POST["ord"], $_POST["indent"]);
1750  ilUtil::sendSuccess($lng->txt("wiki_ordering_and_indent_saved"), true);
1751  $ilCtrl->redirect($this, "editImportantPages");
1752  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
+ Here is the call graph for this function:

◆ saveSettingsObject()

ilObjWikiGUI::saveSettingsObject ( )

Save Settings.

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

References $ilCtrl, $ilSetting, $ilUser, ilObjectGUI\$lng, ilObjectGUI\checkPermission(), ilObjWiki\checkShortTitleAvailability(), initSettingsForm(), ilWikiPage\lookupTitle(), ilAdvancedMDRecordGUI\MODE_REC_SELECTION, ilAdvancedMDRecordGUI\saveSelection(), and ilUtil\sendSuccess().

798  {
799  global $ilCtrl, $lng, $ilUser, $ilSetting;
800 
801  $this->checkPermission("write");
802 
803  $this->initSettingsForm();
804 
805  if ($this->form_gui->checkInput())
806  {
807  if (!ilObjWiki::checkShortTitleAvailability($this->form_gui->getInput("shorttitle")) &&
808  $this->form_gui->getInput("shorttitle") != $this->object->getShortTitle())
809  {
810  $short_item = $this->form_gui->getItemByPostVar("shorttitle");
811  $short_item->setAlert($lng->txt("wiki_short_title_already_in_use"));
812  }
813  else
814  {
815  $this->object->setTitle($this->form_gui->getInput("title"));
816  $this->object->setDescription($this->form_gui->getInput("description"));
817  $this->object->setOnline($this->form_gui->getInput("online"));
818  $this->object->setStartPage(ilWikiPage::lookupTitle($this->form_gui->getInput("startpage_id")));
819  $this->object->setShortTitle($this->form_gui->getInput("shorttitle"));
820  $this->object->setRatingOverall($this->form_gui->getInput("rating_overall"));
821  $this->object->setRating($this->form_gui->getInput("rating"));
822  // $this->object->setRatingAsBlock($this->form_gui->getInput("rating_side"));
823  $this->object->setRatingForNewPages($this->form_gui->getInput("rating_new"));
824  $this->object->setRatingCategories($this->form_gui->getInput("rating_ext"));
825 
826  if (!$ilSetting->get("disable_comments"))
827  {
828  $this->object->setPublicNotes($this->form_gui->getInput("public_notes"));
829  }
830  $this->object->setIntroduction($this->form_gui->getInput("intro"));
831 // $this->object->setImportantPages($this->form_gui->getInput("imp_pages"));
832  $this->object->setPageToc($this->form_gui->getInput("page_toc"));
833  $this->object->update();
834 
835  // update metadata record selection
836  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
837  $record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_REC_SELECTION,'wiki',$this->object->getId(), "wpg");
838  $record_gui->saveSelection();
839 
840  // Update ecs export settings
841  include_once 'Modules/Wiki/classes/class.ilECSWikiSettings.php';
842  $ecs = new ilECSWikiSettings($this->object);
843  if($ecs->handleSettingsUpdate())
844  {
845  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"),true);
846  $ilCtrl->redirect($this, "editSettings");
847  }
848  }
849  }
850 
851  $this->form_gui->setValuesByPost();
852  $this->tpl->setContent($this->form_gui->getHTML());
853  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static lookupTitle($a_page_id)
Checks whether a page with given title exists.
static checkShortTitleAvailability($a_short_title)
Check availability of short title.
global $ilCtrl
Definition: ilias.php:18
Class ilECSWikiSettings.
initSettingsForm($a_mode="edit")
Init Settings Form.
global $ilUser
Definition: imgupload.php:15
global $ilSetting
Definition: privfeed.php:40
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
saveSelection()
Save selection per object.
+ Here is the call graph for this function:

◆ saveStyleSettingsObject()

ilObjWikiGUI::saveStyleSettingsObject ( )

Save style settings.

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

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

1598  {
1599  global $ilSetting;
1600 
1601  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
1602  if ($ilSetting->get("fixed_content_style_id") <= 0 &&
1603  (ilObjStyleSheet::_lookupStandard($this->object->getStyleSheetId())
1604  || $this->object->getStyleSheetId() == 0))
1605  {
1606  $this->object->setStyleSheetId(ilUtil::stripSlashes($_POST["style_id"]));
1607  $this->object->update();
1608  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1609  }
1610  $this->ctrl->redirect($this, "editStyleProperties");
1611  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
_lookupStandard($a_id)
Lookup standard flag.
global $ilSetting
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ setAsStartPageObject()

ilObjWikiGUI::setAsStartPageObject ( )

Confirm important pages deletion.

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

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

1758  {
1759  global $ilCtrl, $lng;
1760 
1761  $this->checkPermission("write");
1762 
1763  if (!is_array($_POST["imp_page_id"]) || count($_POST["imp_page_id"]) != 1)
1764  {
1765  ilUtil::sendInfo($lng->txt("wiki_select_one_item"), true);
1766  }
1767  else
1768  {
1769  $this->object->removeImportantPage((int) $_POST["imp_page_id"][0]);
1770  $this->object->setStartPage(ilWikiPage::lookupTitle((int) $_POST["imp_page_id"][0]));
1771  $this->object->update();
1772  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"),true);
1773  }
1774  $ilCtrl->redirect($this, "editImportantPages");
1775  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static lookupTitle($a_page_id)
Checks whether a page with given title exists.
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
+ Here is the call graph for this function:

◆ setContentStyleSheet()

ilObjWikiGUI::setContentStyleSheet (   $a_tpl = null)

Set content style sheet.

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

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

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

1456  {
1457  global $tpl;
1458 
1459  if ($a_tpl != null)
1460  {
1461  $ctpl = $a_tpl;
1462  }
1463  else
1464  {
1465  $ctpl = $tpl;
1466  }
1467 
1468  $ctpl->setCurrentBlock("ContentStyle");
1469  $ctpl->setVariable("LOCATION_CONTENT_STYLESHEET",
1470  ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId()));
1471  $ctpl->parseCurrentBlock();
1472 
1473  }
getContentStylePath($a_style_id)
get content style path
+ 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 549 of file class.ilObjWikiGUI.php.

References $ilCtrl, and ilObjectGUI\$lng.

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

550  {
551  global $ilTabs, $ilCtrl, $lng;
552 
553  if (in_array($a_active,
554  array("general_settings", "style", "imp_pages", "rating_categories",
555  "page_templates")))
556  {
557  // general properties
558  $ilTabs->addSubTab("general_settings",
559  $lng->txt("wiki_general_settings"),
560  $ilCtrl->getLinkTarget($this, 'editSettings'));
561 
562  // style properties
563  $ilTabs->addSubTab("style",
564  $lng->txt("wiki_style"),
565  $ilCtrl->getLinkTarget($this, 'editStyleProperties'));
566 
567  // important pages
568  $ilTabs->addSubTab("imp_pages",
569  $lng->txt("wiki_navigation"),
570  $ilCtrl->getLinkTarget($this, 'editImportantPages'));
571 
572  // page templates
573  $ilTabs->addSubTab("page_templates",
574  $lng->txt("wiki_page_templates"),
575  $ilCtrl->getLinkTargetByClass("ilwikipagetemplategui", ""));
576 
577  // rating categories
578  if($this->object->getRating() && $this->object->getRatingCategories())
579  {
580  $lng->loadLanguageModule("rating");
581  $ilTabs->addSubTab("rating_categories",
582  $lng->txt("rating_categories"),
583  $ilCtrl->getLinkTargetByClass(array('ilratinggui', 'ilratingcategorygui'), ''));
584  }
585 
586  $ilTabs->activateSubTab($a_active);
587  }
588  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ setSideBlock()

ilObjWikiGUI::setSideBlock (   $a_wpg_id = 0)

Side column.

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

References renderSideBlock().

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

1217  {
1218  ilObjWikiGUI::renderSideBlock($a_wpg_id, $this->object->getRefId());
1219  }
static renderSideBlock($a_wpg_id, $a_wiki_ref_id, $a_wp=null)
Side column.
+ 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 1821 of file class.ilObjWikiGUI.php.

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

1822  {
1823  global $lng, $tpl, $ilTabs, $ilCtrl;
1824 
1825 
1826  $ilCtrl->setParameterByClass("ilobjwikigui", "from_page", ilWikiUtil::makeUrlTitle($_GET["from_page"]));
1827  $ilTabs->clearTargets();
1828  ilUtil::sendInfo($lng->txt("wiki_page_not_exist_select_templ"));
1829 
1830  $form = $this->initTemplateSelectionForm();
1831  $tpl->setContent($form->getHTML());
1832  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static makeUrlTitle($a_par)
Set page parameter for Url Embedding.
initTemplateSelectionForm()
Init template selection form.
+ Here is the call graph for this function:

◆ viewObject()

ilObjWikiGUI::viewObject ( )

Start page.

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

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

226  {
227  $this->checkPermission("read");
228  $this->gotoStartPageObject();
229  }
gotoStartPageObject()
Go to start page.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
+ Here is the call graph for this function:

◆ viewPageObject()

ilObjWikiGUI::viewPageObject ( )

view wiki page

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

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

1018  {
1019  global $lng, $ilCtrl, $tpl, $ilTabs, $ilAccess;
1020 
1021  $this->checkPermission("read");
1022 
1023  $ilTabs->clearTargets();
1024  $tpl->setHeaderActionMenu(null);
1025 
1026  $page = ($_GET["page"] != "")
1027  ? $_GET["page"]
1028  : $this->object->getStartPage();
1029  $_GET["page"] = $page;
1030 
1031  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
1032  if (!ilWikiPage::exists($this->object->getId(), $page))
1033  {
1034  $page = $this->object->getStartPage();
1035  }
1036 
1037  if (!ilWikiPage::exists($this->object->getId(), $page))
1038  {
1039  ilUtil::sendInfo($lng->txt("wiki_no_start_page"), true);
1040  $ilCtrl->redirect($this, "infoScreen");
1041  return;
1042  }
1043 
1044  // page exists, show it !
1045  $ilCtrl->setParameter($this, "page", ilWikiUtil::makeUrlTitle($page));
1046 
1047  include_once("./Modules/Wiki/classes/class.ilWikiPageGUI.php");
1048  $wpage_gui = ilWikiPageGUI::getGUIForTitle($this->object->getId(),
1049  ilWikiUtil::makeDbTitle($page), 0, $this->object->getRefId());
1050  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
1051  $wpage_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(
1052  $this->object->getStyleSheetId(), "wiki"));
1053 
1054  $this->setContentStyleSheet();
1055  //$wpage_gui->setOutputMode(IL_PAGE_PREVIEW);
1056 
1057  //$wpage_gui->setSideBlock();
1058  $ilCtrl->setCmdClass("ilwikipagegui");
1059  $ilCtrl->setCmd("preview");
1060  if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()) &&
1061  (!$ilAccess->checkAccess("edit_content", "", $this->object->getRefId()) ||
1062  $wpage_gui->getPageObject()->getBlocked()
1063  ))
1064  {
1065  $wpage_gui->setEnableEditing(false);
1066  }
1067 
1068  // alter title and description
1069  //$tpl->setTitle($wpage_gui->getPageObject()->getTitle());
1070  //$tpl->setDescription($this->object->getTitle());
1071 
1072 
1073  $html = $ilCtrl->forwardCommand($wpage_gui);
1074  //$this->addPageTabs();
1075 
1076  $tpl->setContent($html);
1077  }
$_GET["client_id"]
static getGUIForTitle($a_wiki_id, $a_title, $a_old_nr=0, $a_wiki_ref_id=0)
Get wiki page gui for id and title.
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static makeUrlTitle($a_par)
Set page parameter for Url Embedding.
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
static makeDbTitle($a_par)
Handle page GET parameter.
static exists($a_wiki_id, $a_title)
Checks whether a page with given title exists.
setContentStyleSheet($a_tpl=null)
Set content style sheet.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
+ Here is the call graph for this function:

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