ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilPageEditorGUI Class Reference

Page Editor GUI class. More...

+ Collaboration diagram for ilPageEditorGUI:

Public Member Functions

 __construct (&$a_page_object, &$a_page_object_gui)
 Constructor. More...
 
 setHeader ($a_header)
 set header title More...
 
 getHeader ()
 get header title More...
 
 setLocator (&$a_locator)
 set locator object More...
 
 returnToContext ()
 redirect to parent context More...
 
 setIntLinkReturn ($a_return)
 
 setPageBackTitle ($a_title)
 
 executeCommand ()
 execute command More...
 
 activatePage ()
 
 deactivatePage ()
 
 setMediaMode ()
 set media and editing mode More...
 
 copyLinkedMediaToClipboard ()
 copy linked media object to clipboard More...
 
 copyLinkedMediaToMediaPool ()
 copy linked media object to media pool More...
 
 addChangeComment ()
 add change comment to history More...
 
 delete ()
 Confirm. More...
 
 cancelDeleteSelected ()
 Cancel deletion. More...
 
 confirmedDeleteSelected ()
 Delete selected items. More...
 
 copy ()
 Copy selected items. More...
 
 cut ()
 Cut selected items. More...
 
 paste ($a_hier_id)
 paste from clipboard (redirects to clipboard) More...
 
 activate ()
 (de-)activate selected items More...
 
 characteristic ()
 Assign characeristic to text blocks/sections. More...
 
 initCharacteristicForm ($a_target, $a_types)
 Init map creation/update form. More...
 
 assignCharacteristic ()
 Assign characteristic. More...
 
 pasteFromClipboard ($a_hier_id)
 paste from clipboard (redirects to clipboard) More...
 
 insertFromClipboard ()
 insert object from clipboard More...
 
 displayPage ()
 Default for POST reloads and missing. More...
 
 displayLocator ()
 display locator More...
 
 showSnippetInfo ()
 Show snippet info. More...
 

Static Public Member Functions

static _doJSEditing ()
 checks if current user has activated js editing and if browser is js capable More...
 
static _isBrowserJSEditCapable ()
 checks wether browser is javascript editing capable More...
 

Data Fields

 $tpl
 
 $lng
 
 $ctrl
 
 $objDefinition
 
 $page
 
 $target_script
 
 $return_location
 
 $header
 
 $tabs
 
 $cont_obj
 
 $enable_keywords
 
 $enable_anchors
 

Protected Attributes

 $tabs_gui
 
 $help
 
 $user
 
 $access
 
 $log
 
 $ui
 
 $request
 
 $tool_context
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilPageEditorGUI::__construct ( $a_page_object,
$a_page_object_gui 
)

Constructor.

Parameters
object$a_page_objectpage object public

Definition at line 91 of file class.ilPageEditorGUI.php.

References $DIC, $lng, $objDefinition, $tpl, ilLoggerFactory\getLogger(), help(), ui(), and user().

92  {
93  global $DIC;
94 
95  $this->help = $DIC["ilHelp"];
96  $this->user = $DIC->user();
97  $this->access = $DIC->access();
98  $tpl = $DIC["tpl"];
99  $lng = $DIC->language();
100  $objDefinition = $DIC["objDefinition"];
101  $ilCtrl = $DIC->ctrl();
102  $ilTabs = $DIC->tabs();
103 
104  $this->ui = $DIC->ui();
105  $this->request = $DIC->http()->request();
106 
107  $this->log = ilLoggerFactory::getLogger('copg');
108 
109  $this->tool_context = $DIC->globalScreen()->tool()->context();
110 
111  // initiate variables
112  $this->ctrl = $ilCtrl;
113  $this->tpl = $tpl;
114  $this->lng = $lng;
115  $this->objDefinition = $objDefinition;
116  $this->tabs_gui = $ilTabs;
117  $this->page = $a_page_object;
118  $this->page_gui = $a_page_object_gui;
119 
120  $this->ctrl->saveParameter($this, array("hier_id", "pc_id"));
121  }
user()
Definition: user.php:4
help()
Definition: help.php:2
global $DIC
Definition: goto.php:24
ui()
Definition: ui.php:5
static getLogger($a_component_id)
Get component logger.
+ Here is the call graph for this function:

Member Function Documentation

◆ _doJSEditing()

static ilPageEditorGUI::_doJSEditing ( )
static

checks if current user has activated js editing and if browser is js capable

Definition at line 512 of file class.ilPageEditorGUI.php.

References $DIC, $ilUser, and _isBrowserJSEditCapable().

Referenced by ILIAS\COPage\Editor\Components\Page\PageQueryActionHandler\getActionsDropDown(), ilPCPlaceHolderGUI\insertPCText(), and ilPageObjectGUI\showPage().

513  {
514  global $DIC;
515 
516  $ilUser = $DIC->user();
517 
518  if ($ilUser->getPref("ilPageEditor_JavaScript") != "disable"
520  return true;
521  }
522  return false;
523  }
static _isBrowserJSEditCapable()
checks wether browser is javascript editing capable
global $DIC
Definition: goto.php:24
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _isBrowserJSEditCapable()

static ilPageEditorGUI::_isBrowserJSEditCapable ( )
static

checks wether browser is javascript editing capable

Definition at line 528 of file class.ilPageEditorGUI.php.

Referenced by _doJSEditing().

529  {
530  return true;
531  }
+ Here is the caller graph for this function:

◆ activate()

ilPageEditorGUI::activate ( )

(de-)activate selected items

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

References $_POST, and $_SESSION.

720  {
721  if (is_array($_POST["ids"])) {
722  $updated = $this->page->switchEnableMultiple(
723  $_POST["ids"],
724  true,
725  $this->page_gui->getPageConfig()->getEnableSelfAssessment()
726  );
727  if ($updated !== true) {
728  $_SESSION["il_pg_error"] = $updated;
729  } else {
730  unset($_SESSION["il_pg_error"]);
731  }
732  }
733  $this->ctrl->returnToParent($this);
734  }
$_SESSION["AccountId"]
$_POST["username"]

◆ activatePage()

ilPageEditorGUI::activatePage ( )

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

534  {
535  $this->page_gui->activatePage();
536  }

◆ addChangeComment()

ilPageEditorGUI::addChangeComment ( )

add change comment to history

Definition at line 594 of file class.ilPageEditorGUI.php.

References $_POST, ilHistory\_createEntry(), and ilUtil\stripSlashes().

595  {
596  include_once("./Services/History/classes/class.ilHistory.php");
598  $this->page->getId(),
599  "update",
600  "",
601  $this->page->getParentType() . ":pg",
602  ilUtil::stripSlashes($_POST["change_comment"]),
603  true
604  );
605  ilUtil::sendSuccess($this->lng->txt("cont_added_comment"), true);
606  $this->ctrl->returnToParent($this);
607  }
static _createEntry( $a_obj_id, $a_action, $a_info_params="", $a_obj_type="", $a_user_comment="", $a_update_last=false)
Creates a new history entry for an object.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
+ Here is the call graph for this function:

◆ assignCharacteristic()

ilPageEditorGUI::assignCharacteristic ( )

Assign characteristic.

Definition at line 820 of file class.ilPageEditorGUI.php.

References $_POST, $_SESSION, and ilUtil\stripSlashes().

821  {
822  $char_par = ilUtil::stripSlashes($_POST["char_par"]);
823  $char_sec = ilUtil::stripSlashes($_POST["char_sec"]);
824 
825  $updated = $this->page->assignCharacteristic($_POST["target"], $char_par, $char_sec);
826  if ($updated !== true) {
827  $_SESSION["il_pg_error"] = $updated;
828  } else {
829  unset($_SESSION["il_pg_error"]);
830  }
831  $this->ctrl->returnToParent($this);
832  }
$_SESSION["AccountId"]
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
+ Here is the call graph for this function:

◆ cancelDeleteSelected()

ilPageEditorGUI::cancelDeleteSelected ( )

Cancel deletion.

Parameters

Definition at line 644 of file class.ilPageEditorGUI.php.

645  {
646  $this->ctrl->returnToParent($this);
647  }

◆ characteristic()

ilPageEditorGUI::characteristic ( )

Assign characeristic to text blocks/sections.

Definition at line 739 of file class.ilPageEditorGUI.php.

References $_POST, $cont_obj, $lng, $tpl, initCharacteristicForm(), and ilUtil\sendFailure().

740  {
741  $tpl = $this->tpl;
742  $lng = $this->lng;
743 
744  if (is_array($_POST["ids"])) {
745  $types = array();
746 
747  // check what content element types have been selected
748  foreach ($_POST["ids"] as $t) {
749  $tarr = explode(":", $t);
750  $cont_obj = $this->page->getContentObject($tarr[0], $tarr[1]);
751  if (is_object($cont_obj) && $cont_obj->getType() == "par") {
752  $types["par"] = "par";
753  }
754  if (is_object($cont_obj) && $cont_obj->getType() == "sec") {
755  $types["sec"] = "sec";
756  }
757  }
758 
759  if (count($types) == 0) {
760  ilUtil::sendFailure($lng->txt("cont_select_par_or_section"), true);
761  $this->ctrl->returnToParent($this);
762  } else {
763  $this->initCharacteristicForm($_POST["ids"], $types);
764  $tpl->setContent($this->form->getHTML());
765  }
766  } else {
767  $this->ctrl->returnToParent($this);
768  }
769  }
initCharacteristicForm($a_target, $a_types)
Init map creation/update form.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ confirmedDeleteSelected()

ilPageEditorGUI::confirmedDeleteSelected ( )

Delete selected items.

Definition at line 653 of file class.ilPageEditorGUI.php.

References $_POST, and $_SESSION.

654  {
655  $targets = $_POST["ids"];
656  if (count($targets) > 0) {
657  $updated = $this->page->deleteContents(
658  $targets,
659  true,
660  $this->page_gui->getPageConfig()->getEnableSelfAssessment()
661  );
662  if ($updated !== true) {
663  $_SESSION["il_pg_error"] = $updated;
664  } else {
665  unset($_SESSION["il_pg_error"]);
666  }
667  }
668  $this->ctrl->returnToParent($this);
669  }
$_SESSION["AccountId"]
$_POST["username"]

◆ copy()

ilPageEditorGUI::copy ( )

Copy selected items.

Definition at line 674 of file class.ilPageEditorGUI.php.

References $_POST, and $lng.

675  {
676  $lng = $this->lng;
677 
678  if (is_array($_POST["ids"])) {
679  $this->page->copyContents($_POST["ids"]);
680  ilUtil::sendSuccess($lng->txt("cont_sel_el_copied_use_paste"), true);
681  }
682  $this->ctrl->returnToParent($this);
683  }
$_POST["username"]

◆ copyLinkedMediaToClipboard()

ilPageEditorGUI::copyLinkedMediaToClipboard ( )

copy linked media object to clipboard

Definition at line 571 of file class.ilPageEditorGUI.php.

References $_POST, $ilUser, $user, and ilObject\_lookupTitle().

572  {
574 
575  ilUtil::sendSuccess($this->lng->txt("copied_to_clipboard"), true);
576  $ilUser->addObjectToClipboard($_POST["mob_id"], "mob", ilObject::_lookupTitle($_POST["mob_id"]));
577  $this->ctrl->returnToParent($this);
578  }
static _lookupTitle($a_id)
lookup object title
$ilUser
Definition: imgupload.php:18
$_POST["username"]
+ Here is the call graph for this function:

◆ copyLinkedMediaToMediaPool()

ilPageEditorGUI::copyLinkedMediaToMediaPool ( )

copy linked media object to media pool

Definition at line 583 of file class.ilPageEditorGUI.php.

References $_POST, $ilUser, and $user.

584  {
586 
587  $this->ctrl->setParameterByClass("ilmediapooltargetselector", "mob_id", $_POST["mob_id"]);
588  $this->ctrl->redirectByClass("ilmediapooltargetselector", "listPools");
589  }
$ilUser
Definition: imgupload.php:18
$_POST["username"]

◆ cut()

ilPageEditorGUI::cut ( )

Cut selected items.

Definition at line 688 of file class.ilPageEditorGUI.php.

References $_POST, $_SESSION, and $lng.

689  {
690  $lng = $this->lng;
691 
692  if (is_array($_POST["ids"])) {
693  $updated = $this->page->cutContents($_POST["ids"]);
694  if ($updated !== true) {
695  $_SESSION["il_pg_error"] = $updated;
696  } else {
697  unset($_SESSION["il_pg_error"]);
698  }
699  ilUtil::sendSuccess($lng->txt("cont_sel_el_cut_use_paste"), true);
700  }
701  $this->ctrl->returnToParent($this);
702  }
$_SESSION["AccountId"]
$_POST["username"]

◆ deactivatePage()

ilPageEditorGUI::deactivatePage ( )

Definition at line 538 of file class.ilPageEditorGUI.php.

539  {
540  $this->page_gui->deactivatePage();
541  }

◆ delete()

ilPageEditorGUI::delete ( )

Confirm.

Definition at line 612 of file class.ilPageEditorGUI.php.

References $_POST, $ctrl, $lng, $tpl, and ilUtil\sendInfo().

613  {
614  $ilCtrl = $this->ctrl;
615  $tpl = $this->tpl;
616  $lng = $this->lng;
617 
618  $targets = $_POST["ids"];
619 
620  if (count($targets) == 0) {
621  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
622  $this->ctrl->returnToParent($this);
623  } else {
624  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
625  $cgui = new ilConfirmationGUI();
626  $cgui->setFormAction($ilCtrl->getFormAction($this));
627  $cgui->setHeaderText($lng->txt("copg_confirm_el_deletion"));
628  $cgui->setCancel($lng->txt("cancel"), "cancelDeleteSelected");
629  $cgui->setConfirm($lng->txt("confirm"), "confirmedDeleteSelected");
630  foreach ($targets as $t) {
631  $cgui->addHiddenItem("ids[]", $t);
632  }
633 
634  $tpl->setContent($cgui->getHTML());
635  }
636  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ displayLocator()

ilPageEditorGUI::displayLocator ( )

display locator

Definition at line 906 of file class.ilPageEditorGUI.php.

Referenced by executeCommand().

907  {
908  /*if(is_object($this->locator))
909  {
910  $this->locator->display();
911  }*/
912  }
+ Here is the caller graph for this function:

◆ displayPage()

ilPageEditorGUI::displayPage ( )

Default for POST reloads and missing.

Definition at line 898 of file class.ilPageEditorGUI.php.

899  {
900  $this->ctrl->returnToParent($this);
901  }

◆ executeCommand()

ilPageEditorGUI::executeCommand ( )

execute command

Definition at line 176 of file class.ilPageEditorGUI.php.

References $_GET, $_POST, $cont_obj, $ctrl, $help, $ret, ilObject\_lookupTitle(), displayLocator(), exit, getHeader(), ilCOPagePCDef\getPCDefinitionByGUIClassName(), ilCOPagePCDef\getPCDefinitionByName(), ilCOPagePCDef\getPCDefinitionByType(), ilCOPagePCDef\isPCGUIClassName(), paste(), pasteFromClipboard(), ilCOPagePCDef\requirePCGUIClassByName(), ilInternalLinkGUI\setFilterWhiteList(), and ui().

177  {
178  $ilCtrl = $this->ctrl;
179  $ilHelp = $this->help;
180  $this->log->debug("begin =========================");
181 
182  if (!true) {
183  var_dump($_GET);
184  echo "<br><br>";
185  var_dump($_POST);
186  exit;
187  }
188 
189  // Step BC (basic command determination)
190  // determine cmd, cmdClass, hier_id and pc_id
191  $cmd = $this->ctrl->getCmd("displayPage");
192  $cmdClass = strtolower($this->ctrl->getCmdClass());
193 
194  $hier_id = $_GET["hier_id"];
195  $pc_id = $_GET["pc_id"];
196  if (isset($_POST["new_hier_id"])) {
197  $hier_id = $_POST["new_hier_id"];
198  }
199 
200  $new_type = (isset($_GET["new_type"]))
201  ? $_GET["new_type"]
202  : $_POST["new_type"];
203 
204  $this->log->debug("step BC: cmd:$cmd, cmdClass:$cmdClass, hier_id: $hier_id, pc_id: $pc_id");
205 
206  // Step EC (exec_ command handling)
207  // handle special exec_ commands, modify pc, hier_id
208  if (substr($cmd, 0, 5) == "exec_") {
209  // check whether pc id is given
210  $pca = explode(":", key($_POST["cmd"]));
211  $pc_id = $pca[1];
212  $cmd = explode("_", $pca[0]);
213  unset($cmd[0]);
214  $hier_id = implode("_", $cmd);
215  $cmd = $_POST["command" . $hier_id];
216  }
217  $this->log->debug("step EC: cmd:$cmd, hier_id: $hier_id, pc_id: $pc_id");
218 
219  // Step CC (handle table container (and similar) commands
220  // ... strip "c" "r" of table ids from hierarchical id
221  $first_hier_character = substr($hier_id, 0, 1);
222  if ($first_hier_character == "c" ||
223  $first_hier_character == "r" ||
224  $first_hier_character == "g" ||
225  $first_hier_character == "i") {
226  $hier_id = substr($hier_id, 1);
227  }
228  $this->log->debug("step CC: cmd:$cmd, hier_id: $hier_id, pc_id: $pc_id");
229 
230  // Step B (build dom, and ids in XML)
231  $this->page->buildDom();
232  $this->page->addHierIDs();
233 
234 
235  // Step CS (strip base command)
236  if ($cmdClass != "ilfilesystemgui") {
237  $com = explode("_", $cmd);
238  $cmd = $com[0];
239  }
240  $this->log->debug("step CS: cmd:$cmd");
241 
242 
243  // Step NC (determine next class)
244  $next_class = $this->ctrl->getNextClass($this);
245  $this->log->debug("step NC: next class: " . $next_class);
246 
247 
248  // Step PH (placeholder handling, placeholders from preview mode come without hier_id)
249  if ($next_class == "ilpcplaceholdergui" && $hier_id == "" && $_GET["pl_pc_id"] != "") {
250  $hid = $this->page->getHierIdsForPCIds(array($_GET["pl_pc_id"]));
251  $hier_id = $hid[$_GET["pl_pc_id"]];
252  }
253  $this->log->debug("step PH: next class: " . $next_class);
254 
255  if ($com[0] == "insert" || $com[0] == "create") {
256  // Step CM (creation mode handling)
257  $cmd = $com[0];
258  $ctype = $com[1]; // note ctype holds type if cmdclass is empty, but also subcommands if not (e.g. applyFilter in ilpcmediaobjectgui)
259  $add_type = $_POST["pluginName"];
260  if ($ctype == "mob") {
261  $ctype = "media";
262  }
263 
264  $this->log->debug("step CM: cmd: " . $cmd . ", ctype: " . $ctype . ", add_type: " . $add_type);
265  } else {
266  // Step LM (setting cmd and cmdclass for editing of linked media)
267  if ($cmd == "editLinkedMedia") {
268  $this->ctrl->setCmd("edit");
269  $cmd = "edit";
270  $_GET["pgEdMediaMode"] = "editLinkedMedia";
271  $_GET["mob_id"] = $_POST["mob_id"];
272  }
273  if ($_GET["pgEdMediaMode"] == "editLinkedMedia") {
274  $this->ctrl->setParameter($this, "pgEdMediaMode", "editLinkedMedia");
275  $this->ctrl->setParameter($this, "mob_id", $_GET["mob_id"]);
276  if ($cmdClass != "ilinternallinkgui" && $cmdClass != "ilmdeditorgui"
277  && $cmdClass != "ilimagemapeditorgui" && $cmdClass != "ilfilesystemgui") {
278  $this->ctrl->setCmdClass("ilobjmediaobjectgui");
279  $cmdClass = "ilobjmediaobjectgui";
280  }
281  }
282  $this->log->debug("step LM: cmd: " . $cmd . ", cmdClass: " . $cmdClass);
283 
284 
285  // Step PR (get content object and return to parent)
286  $this->log->debug("before PR: cmdClass: $cmdClass, nextClass: $next_class" .
287  ", hier_id: " . $hier_id . ", pc_id: " . $pc_id . ")");
288  // note: ilinternallinkgui for page: no cont_obj is received
289  // ilinternallinkgui for mob: cont_obj is received
290  if ($_REQUEST["ctype"] == "" && $_REQUEST["cname"] == "" &&
291  $cmd != "insertFromClipboard" && $cmd != "pasteFromClipboard" &&
292  $cmd != "setMediaMode" && $cmd != "copyLinkedMediaToClipboard" &&
293  $cmd != "activatePage" && $cmd != "deactivatePage" &&
294  $cmd != "copyLinkedMediaToMediaPool" && $cmd != "showSnippetInfo" &&
295  $cmd != "delete" && $cmd != "paste" &&
296  $cmd != "cancelDeleteSelected" && $cmd != "confirmedDeleteSelected" &&
297  $cmd != "copy" && $cmd != "cut" &&
298  ($cmd != "displayPage" || $_POST["editImagemapForward_x"] != "" || $_POST["imagemap_x"] != "") &&
299  ($cmd != "displayPage" || $_POST["editImagemapForward_x"] != "") &&
300  $cmd != "activate" && $cmd != "characteristic" &&
301  $cmd != "assignCharacteristic" &&
302  $cmdClass != "ilrepositoryselector2inputgui" &&
303  $cmdClass != "ilpageeditorserveradaptergui" &&
304  $cmd != "cancelCreate" && $cmd != "popup" &&
305  $cmdClass != "ileditclipboardgui" && $cmd != "addChangeComment" &&
306  ($cmdClass != "ilinternallinkgui" || ($next_class == "ilpcmediaobjectgui"))) {
307  if ($_GET["pgEdMediaMode"] != "editLinkedMedia") {
308  $cont_obj = $this->page->getContentObject($hier_id, $pc_id);
309  if (!is_object($cont_obj)) {
310  $this->log->debug("returnToParent");
311  $ilCtrl->returnToParent($this);
312  }
313  $ctype = $cont_obj->getType();
314  }
315  }
316  $this->log->debug("step PR: ctype: $ctype");
317  }
318 
319  // Step NC (handle empty next class)
320  if ($_REQUEST["ctype"] != "" || $_REQUEST["cname"] != "") {
321  $ctype = $_REQUEST["ctype"];
322  if ($_REQUEST["cname"] != "") {
323  $pc_def = ilCOPagePCDef::getPCDefinitionByName($_REQUEST["cname"]);
324  $ctype = $pc_def["pc_type"];
325  }
326  $pc_id = $_REQUEST["pcid"];
327  $hier_id = $_REQUEST["hier_id"];
328  if (!in_array($cmd, ["insert", "create"])) {
329  $cont_obj = $this->page->getContentObject($hier_id, $pc_id);
330  }
331  }
332  // this fixes e.g. #31214
333  if ($pc_id != "" && $hier_id == "") {
334  $hier_id = $this->page->getHierIdForPcId($pc_id);
335  }
336  if ($ctype != "media" || !is_object($cont_obj)) {
337  if ($this->getHeader() != "") {
338  $this->tpl->setTitle($this->getHeader());
339  }
340  $this->displayLocator();
341  }
342 
343  $this->cont_obj = $cont_obj;
344 
345 
346  $this->ctrl->setParameter($this, "hier_id", $hier_id);
347  $this->ctrl->setParameter($this, "pc_id", $pc_id);
348  $this->ctrl->setCmd($cmd);
349  if ($next_class == "") {
350  include_once("./Services/COPage/classes/class.ilCOPagePCDef.php");
351  $pc_def = ilCOPagePCDef::getPCDefinitionByType($ctype);
352  if (is_array($pc_def)) {
353  $this->ctrl->setCmdClass($pc_def["pc_gui_class"]);
354  }
355  $next_class = $this->ctrl->getNextClass($this);
356  }
357  $this->log->debug("step NC2: next_class: $next_class");
358 
359  // ... do not do this while imagemap editing is ongoing
360  // Step IM (handle image map editing)
361  if ($cmd == "displayPage" && $_POST["editImagemapForward_x"] == "" && $_POST["imagemap_x"] == "") {
362  $next_class = "";
363  }
364  $this->log->debug("step IM: next_class: $next_class");
365  // Step FC (forward command)
366  $this->log->debug("before FC: next_class:" . $next_class . ", pc_id:" . $pc_id .
367  ", hier_id:" . $hier_id . ", ctype:" . $ctype . ", cmd:" . $cmd . ", _GET[cmd]: " . $_GET["cmd"]);
368 
369 
370  switch ($next_class) {
371  case "ilinternallinkgui":
372  $link_gui = new ilInternalLinkGUI(
373  $this->page_gui->getPageConfig()->getIntLinkHelpDefaultType(),
374  $this->page_gui->getPageConfig()->getIntLinkHelpDefaultId(),
375  $this->page_gui->getPageConfig()->getIntLinkHelpDefaultIdIsRef()
376  );
377  $link_gui->setFilterWhiteList(
378  $this->page_gui->getPageConfig()->getIntLinkFilterWhiteList()
379  );
380  foreach ($this->page_gui->getPageConfig()->getIntLinkFilters() as $filter) {
381  $link_gui->filterLinkType($filter);
382  }
383  $link_gui->setReturn($this->int_link_return);
384 
385  $ret = $this->ctrl->forwardCommand($link_gui);
386  break;
387 
388  // PC Media Object
389  case "ilpcmediaobjectgui":
390  include_once("./Services/COPage/classes/class.ilPCMediaObjectGUI.php");
391 
392  $this->tabs_gui->clearTargets();
393  $this->tabs_gui->setBackTarget(
394  $this->page_gui->page_back_title,
395  $ilCtrl->getLinkTarget($this->page_gui, "edit")
396  );
397  $pcmob_gui = new ilPCMediaObjectGUI($this->page, $cont_obj, $hier_id, $pc_id);
398  $pcmob_gui->setStyleId($this->page_gui->getStyleId());
399  $pcmob_gui->setSubCmd($ctype);
400  $pcmob_gui->setEnabledMapAreas($this->page_gui->getPageConfig()->getEnableInternalLinks());
401  $ret = $this->ctrl->forwardCommand($pcmob_gui);
402  $ilHelp->setScreenIdComponent("copg_media");
403  break;
404 
405  // only for "linked" media
406  case "ilobjmediaobjectgui":
407  $this->tabs_gui->clearTargets();
408  $this->tabs_gui->setBackTarget(
409  $this->lng->txt("back"),
410  $ilCtrl->getParentReturn($this)
411  );
412  $mob_gui = new ilObjMediaObjectGUI("", $_GET["mob_id"], false, false);
413  $mob_gui->getTabs();
414  $mob_gui->setEnabledMapAreas($this->page_gui->getPageConfig()->getEnableInternalLinks());
415  $this->tpl->setTitle($this->lng->txt("mob") . ": " .
416  ilObject::_lookupTitle($_GET["mob_id"]));
417  $ret = $this->ctrl->forwardCommand($mob_gui);
418  break;
419 
420  // Question
421  case "ilpcquestiongui":
422  include_once("./Services/COPage/classes/class.ilPCQuestionGUI.php");
423  $pc_question_gui = new ilPCQuestionGUI($this->page, $cont_obj, $hier_id, $pc_id);
424  $pc_question_gui->setSelfAssessmentMode($this->page_gui->getPageConfig()->getEnableSelfAssessment());
425  $pc_question_gui->setPageConfig($this->page_gui->getPageConfig());
426 
427  if ($this->page_gui->getPageConfig()->getEnableSelfAssessment()) {
428  $this->tabs_gui->clearTargets();
429  $ilHelp->setScreenIdComponent("copg_pcqst");
430  $this->tabs_gui->setBackTarget(
431  $this->lng->txt("back"),
432  $ilCtrl->getParentReturn($this)
433  );
434  $ret = $this->ctrl->forwardCommand($pc_question_gui);
435  } else {
436  $cmd = $this->ctrl->getCmd();
437  $pc_question_gui->$cmd();
438  $this->ctrl->redirectByClass(array("ilobjquestionpoolgui", get_class($cont_obj)), "editQuestion");
439  }
440  break;
441 
442  // Plugged Component
443  case "ilpcpluggedgui":
444  $this->tabs_gui->clearTargets();
445  include_once("./Services/COPage/classes/class.ilPCPluggedGUI.php");
446  $plugged_gui = new ilPCPluggedGUI(
447  $this->page,
448  $cont_obj,
449  $hier_id,
450  $add_type,
451  $pc_id
452  );
453  $ret = $this->ctrl->forwardCommand($plugged_gui);
454  break;
455 
456  case "ilpageeditorserveradaptergui":
457  $adapter = new ilPageEditorServerAdapterGUI(
458  $this->page_gui,
459  $this->ctrl,
460  $this->ui,
461  $this->request
462  );
463  $this->ctrl->forwardCommand($adapter);
464  break;
465 
466  default:
467 
468  // generic calls to gui classes
469  include_once("./Services/COPage/classes/class.ilCOPagePCDef.php");
470  if (ilCOPagePCDef::isPCGUIClassName($next_class, true)) {
471  $this->log->debug("Generic Call");
472  $pc_def = ilCOPagePCDef::getPCDefinitionByGUIClassName($next_class);
473  $this->tabs_gui->clearTargets();
474  $this->tabs_gui->setBackTarget(
475  $this->page_gui->page_back_title,
476  $ilCtrl->getLinkTarget($this->page_gui, "edit")
477  );
478  $ilHelp->setScreenIdComponent("copg_" . $pc_def["pc_type"]);
480  $gui_class_name = $pc_def["pc_gui_class"];
481  $pc_gui = new $gui_class_name($this->page, $cont_obj, $hier_id, $pc_id);
482  if ($pc_def["style_classes"]) {
483  $pc_gui->setStyleId($this->page_gui->getStyleId());
484  }
485  $pc_gui->setPageConfig($this->page_gui->getPageConfig());
486  $ret = $this->ctrl->forwardCommand($pc_gui);
487  } else {
488  $this->log->debug("Call ilPageEditorGUI command.");
489  // cmd belongs to ilPageEditorGUI
490 
491  if ($cmd == "pasteFromClipboard") {
492  $ret = $this->pasteFromClipboard($hier_id);
493  } elseif ($cmd == "paste") {
494  $ret = $this->paste($hier_id);
495  } else {
496  $ret = $this->$cmd();
497  }
498  }
499  break;
500 
501  }
502 
503  $this->log->debug("end --------------------");
504 
505  return $ret;
506  }
static isPCGUIClassName($a_class_name, $a_lower_case=false)
Is given class name a pc gui class?
static getPCDefinitionByName($a_pc_name)
Get PC definition by name.
exit
Definition: login.php:29
displayLocator()
display locator
$_GET["client_id"]
Class ilPCPluggedGUI.
static getPCDefinitionByGUIClassName($a_gui_class_name)
Get PC definition by name.
setFilterWhiteList($a_white_list)
Set filter list as white list (per detault it is a black list)
static _lookupTitle($a_id)
lookup object title
Class ilInternalLinkGUI.
paste($a_hier_id)
paste from clipboard (redirects to clipboard)
Class ilPCMediaObjectGUI.
Class ilPCQuestionGUI.
ui()
Definition: ui.php:5
Class ilObjMediaObjectGUI.
static requirePCGUIClassByName($a_name)
Get instance.
$ret
Definition: parser.php:6
static getPCDefinitionByType($a_pc_type)
Get PC definition by type.
$_POST["username"]
pasteFromClipboard($a_hier_id)
paste from clipboard (redirects to clipboard)
getHeader()
get header title
+ Here is the call graph for this function:

◆ getHeader()

ilPageEditorGUI::getHeader ( )

get header title

Returns
string header title

Definition at line 139 of file class.ilPageEditorGUI.php.

References $header.

Referenced by executeCommand().

140  {
141  return $this->header;
142  }
+ Here is the caller graph for this function:

◆ initCharacteristicForm()

ilPageEditorGUI::initCharacteristicForm (   $a_target,
  $a_types 
)

Init map creation/update form.

Definition at line 774 of file class.ilPageEditorGUI.php.

References $ctrl, $lng, ilPCParagraphGUI\_getCharacteristics(), and ilPCSectionGUI\_getCharacteristics().

Referenced by characteristic().

775  {
776  $ilCtrl = $this->ctrl;
777  $lng = $this->lng;
778 
779 
780  // edit form
781  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
782  $this->form = new ilPropertyFormGUI();
783  $this->form->setTitle($this->lng->txt("cont_choose_characteristic"));
784 
785  if ($a_types["par"] == "par") {
786  $select_prop = new ilSelectInputGUI(
787  $this->lng->txt("cont_choose_characteristic_text"),
788  "char_par"
789  );
790  include_once("./Services/COPage/classes/class.ilPCParagraphGUI.php");
791  $options = ilPCParagraphGUI::_getCharacteristics($this->page_gui->getStyleId());
792  $select_prop->setOptions($options);
793  $this->form->addItem($select_prop);
794  }
795  if ($a_types["sec"] == "sec") {
796  $select_prop = new ilSelectInputGUI(
797  $this->lng->txt("cont_choose_characteristic_section"),
798  "char_sec"
799  );
800  include_once("./Services/COPage/classes/class.ilPCSectionGUI.php");
801  $options = ilPCSectionGUI::_getCharacteristics($this->page_gui->getStyleId());
802  $select_prop->setOptions($options);
803  $this->form->addItem($select_prop);
804  }
805 
806  foreach ($a_target as $t) {
807  $hidden = new ilHiddenInputGUI("target[]");
808  $hidden->setValue($t);
809  $this->form->addItem($hidden);
810  }
811 
812  $this->form->setFormAction($ilCtrl->getFormAction($this));
813  $this->form->addCommandButton("assignCharacteristic", $lng->txt("save"));
814  $this->form->addCommandButton("showPage", $lng->txt("cancel"));
815  }
This class represents a property form user interface.
static _getCharacteristics($a_style_id)
Get characteristics.
This class represents a hidden form property in a property form.
static _getCharacteristics($a_style_id)
Get characteristics.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertFromClipboard()

ilPageEditorGUI::insertFromClipboard ( )

insert object from clipboard

Definition at line 860 of file class.ilPageEditorGUI.php.

References $_GET, $type, and ilEditClipboardGUI\_getSelectedIDs().

861  {
862  include_once("./Services/Clipboard/classes/class.ilEditClipboardGUI.php");
864  include_once("./Services/COPage/classes/class.ilPCMediaObject.php");
865 
866  $hier_id = $this->page->getHierIDForPCId($_GET["pc_id"]);
867  if ($hier_id == "") {
868  $hier_id = "pg";
869  }
870 
871  if ($ids != "") {
872  foreach ($ids as $id2) {
873  $id = explode(":", $id2);
874  $type = $id[0];
875  $id = $id[1];
876  if ($type == "mob") {
877  $this->content_obj = new ilPCMediaObject($this->page);
878  $this->content_obj->readMediaObject($id);
879  $this->content_obj->createAlias($this->page, $hier_id);
880  $this->updated = $this->page->update();
881  }
882  if ($type == "incl") {
883  include_once("./Services/COPage/classes/class.ilPCContentInclude.php");
884  $this->content_obj = new ilPCContentInclude($this->page);
885  $this->content_obj->create($this->page, $hier_id);
886  $this->content_obj->setContentType("mep");
887  $this->content_obj->setContentId($id);
888  $this->updated = $this->page->update();
889  }
890  }
891  }
892  $this->ctrl->returnToParent($this);
893  }
$type
$_GET["client_id"]
Class ilPCContentInclude.
Class ilPCMediaObject.
+ Here is the call graph for this function:

◆ paste()

ilPageEditorGUI::paste (   $a_hier_id)

paste from clipboard (redirects to clipboard)

Definition at line 707 of file class.ilPageEditorGUI.php.

References $ctrl.

Referenced by executeCommand().

708  {
709  $ilCtrl = $this->ctrl;
710  $this->page->pasteContents($a_hier_id, $this->page_gui->getPageConfig()->getEnableSelfAssessment());
711  include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
712  //ilEditClipboard::setAction("");
713  $this->ctrl->returnToParent($this);
714  }
+ Here is the caller graph for this function:

◆ pasteFromClipboard()

ilPageEditorGUI::pasteFromClipboard (   $a_hier_id)

paste from clipboard (redirects to clipboard)

Definition at line 837 of file class.ilPageEditorGUI.php.

References $ctrl.

Referenced by executeCommand().

838  {
839  $ilCtrl = $this->ctrl;
840  //var_dump($a_hier_id);
841  $ilCtrl->setParameter($this, "hier_id", $a_hier_id);
842  $ilCtrl->setParameterByClass(
843  "ilEditClipboardGUI",
844  "returnCommand",
845  rawurlencode($ilCtrl->getLinkTarget(
846  $this,
847  "insertFromClipboard",
848  "",
849  false,
850  false
851  ))
852  );
853  //echo ":".$ilCtrl->getLinkTarget($this, "insertFromClipboard").":";
854  $ilCtrl->redirectByClass("ilEditClipboardGUI", "getObject");
855  }
+ Here is the caller graph for this function:

◆ returnToContext()

ilPageEditorGUI::returnToContext ( )

redirect to parent context

Definition at line 157 of file class.ilPageEditorGUI.php.

158  {
159  $this->ctrl->returnToParent($this);
160  }

◆ setHeader()

ilPageEditorGUI::setHeader (   $a_header)

set header title

Parameters
string$a_headerheader title

Definition at line 129 of file class.ilPageEditorGUI.php.

130  {
131  $this->header = $a_header;
132  }

◆ setIntLinkReturn()

ilPageEditorGUI::setIntLinkReturn (   $a_return)

Definition at line 162 of file class.ilPageEditorGUI.php.

163  {
164  $this->int_link_return = $a_return;
165  }

◆ setLocator()

ilPageEditorGUI::setLocator ( $a_locator)

set locator object

Parameters
object$a_locatorlocator object

Definition at line 149 of file class.ilPageEditorGUI.php.

150  {
151  $this->locator = $a_locator;
152  }

◆ setMediaMode()

ilPageEditorGUI::setMediaMode ( )

set media and editing mode

Definition at line 546 of file class.ilPageEditorGUI.php.

References $_POST, $ilUser, and $user.

547  {
549 
550  $ilUser->writePref("ilPageEditor_MediaMode", $_POST["media_mode"]);
551  $ilUser->writePref("ilPageEditor_HTMLMode", $_POST["html_mode"]);
552  if ($ilUser->getPref("ilPageEditor_JavaScript") != $_POST["js_mode"]) {
553  // not nice, should be solved differently in the future
554  if ($this->page->getParentType() == "lm") {
555  $this->ctrl->setParameterByClass("illmpageobjectgui", "reloadTree", "y");
556  }
557  }
558  $ilUser->writePref("ilPageEditor_JavaScript", $_POST["js_mode"]);
559 
560  // again not so nice...
561  if ($this->page->getParentType() == "lm") {
562  $this->ctrl->redirectByClass("illmpageobjectgui", "edit");
563  } else {
564  $this->ctrl->returnToParent($this);
565  }
566  }
$ilUser
Definition: imgupload.php:18
$_POST["username"]

◆ setPageBackTitle()

ilPageEditorGUI::setPageBackTitle (   $a_title)

Definition at line 168 of file class.ilPageEditorGUI.php.

169  {
170  $this->page_back_title = $a_title;
171  }

◆ showSnippetInfo()

ilPageEditorGUI::showSnippetInfo ( )

Show snippet info.

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

References $_POST, $access, $ctrl, $lng, $tpl, ilObject\_getAllReferences(), ilObject\_lookupTitle(), ilMediaPoolItem\getPoolForItemId(), and ilMediaPoolPage\lookupTitle().

918  {
919  $tpl = $this->tpl;
920  $lng = $this->lng;
921  $ilAccess = $this->access;
922  $ilCtrl = $this->ctrl;
923 
924  $stpl = new ilTemplate("tpl.snippet_info.html", true, true, "Services/COPage");
925 
926  include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
927  $mep_pools = ilMediaPoolItem::getPoolForItemId($_POST["ci_id"]);
928  foreach ($mep_pools as $mep_id) {
929  $ref_ids = ilObject::_getAllReferences($mep_id);
930  $edit_link = false;
931  foreach ($ref_ids as $rid) {
932  if (!$edit_link && $ilAccess->checkAccess("write", "", $rid)) {
933  $stpl->setCurrentBlock("edit_link");
934  $stpl->setVariable("TXT_EDIT", $lng->txt("edit"));
935  $stpl->setVariable(
936  "HREF_EDIT",
937  "./goto.php?target=mep_" . $rid
938  );
939  $stpl->parseCurrentBlock();
940  }
941  }
942  $stpl->setCurrentBlock("pool");
943  $stpl->setVariable("TXT_MEDIA_POOL", $lng->txt("obj_mep"));
944  $stpl->setVariable("VAL_MEDIA_POOL", ilObject::_lookupTitle($mep_id));
945  $stpl->parseCurrentBlock();
946  }
947 
948  include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
949  $stpl->setVariable("TXT_TITLE", $lng->txt("title"));
950  $stpl->setVariable("VAL_TITLE", ilMediaPoolPage::lookupTitle($_POST["ci_id"]));
951  $stpl->setVariable("TXT_BACK", $lng->txt("back"));
952  $stpl->setVariable(
953  "HREF_BACK",
954  $ilCtrl->getLinkTarget($this->page_gui, "edit")
955  );
956  $tpl->setContent($stpl->get());
957  }
static getPoolForItemId($a_id)
Get media pools for item id.
static _lookupTitle($a_id)
lookup object title
static lookupTitle($a_page_id)
Lookup title.
static _getAllReferences($a_id)
get all reference ids of object
$_POST["username"]
+ Here is the call graph for this function:

Field Documentation

◆ $access

ilPageEditorGUI::$access
protected

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

Referenced by showSnippetInfo().

◆ $cont_obj

ilPageEditorGUI::$cont_obj

Definition at line 61 of file class.ilPageEditorGUI.php.

Referenced by characteristic(), and executeCommand().

◆ $ctrl

ilPageEditorGUI::$ctrl

◆ $enable_anchors

ilPageEditorGUI::$enable_anchors

Definition at line 63 of file class.ilPageEditorGUI.php.

◆ $enable_keywords

ilPageEditorGUI::$enable_keywords

Definition at line 62 of file class.ilPageEditorGUI.php.

◆ $header

ilPageEditorGUI::$header

Definition at line 59 of file class.ilPageEditorGUI.php.

Referenced by getHeader().

◆ $help

ilPageEditorGUI::$help
protected

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

Referenced by executeCommand().

◆ $lng

ilPageEditorGUI::$lng

◆ $log

ilPageEditorGUI::$log
protected

Definition at line 68 of file class.ilPageEditorGUI.php.

◆ $objDefinition

ilPageEditorGUI::$objDefinition

Definition at line 52 of file class.ilPageEditorGUI.php.

Referenced by __construct().

◆ $page

ilPageEditorGUI::$page

Definition at line 56 of file class.ilPageEditorGUI.php.

◆ $request

ilPageEditorGUI::$request
protected

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

◆ $return_location

ilPageEditorGUI::$return_location

Definition at line 58 of file class.ilPageEditorGUI.php.

◆ $tabs

ilPageEditorGUI::$tabs

Definition at line 60 of file class.ilPageEditorGUI.php.

◆ $tabs_gui

ilPageEditorGUI::$tabs_gui
protected

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

◆ $target_script

ilPageEditorGUI::$target_script

Definition at line 57 of file class.ilPageEditorGUI.php.

◆ $tool_context

ilPageEditorGUI::$tool_context
protected

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

◆ $tpl

ilPageEditorGUI::$tpl

Definition at line 49 of file class.ilPageEditorGUI.php.

Referenced by __construct(), characteristic(), delete(), and showSnippetInfo().

◆ $ui

ilPageEditorGUI::$ui
protected

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

◆ $user

ilPageEditorGUI::$user
protected

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