ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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...
 
 deleteSelected ()
 Confirm. More...
 
 cancelDeleteSelected ()
 Cancel deletion. More...
 
 confirmedDeleteSelected ()
 Delete selected items. More...
 
 copySelected ()
 Copy selected items. More...
 
 cutSelected ()
 Cut selected items. More...
 
 paste ($a_hier_id)
 paste from clipboard (redirects to clipboard) More...
 
 activateSelected ()
 (de-)activate selected items More...
 
 assignCharacteristicForm ()
 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
 

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 73 of file class.ilPageEditorGUI.php.

References $DIC, $ilCtrl, $lng, $objDefinition, $tpl, array, ilLoggerFactory\getLogger(), and user().

74  {
75  global $DIC;
76 
77  $this->help = $DIC["ilHelp"];
78  $this->user = $DIC->user();
79  $this->access = $DIC->access();
80  $tpl = $DIC["tpl"];
81  $lng = $DIC->language();
82  $objDefinition = $DIC["objDefinition"];
83  $ilCtrl = $DIC->ctrl();
84  $ilTabs = $DIC->tabs();
85 
86  $this->log = ilLoggerFactory::getLogger('copg');
87 
88  // initiate variables
89  $this->ctrl = $ilCtrl;
90  $this->tpl = $tpl;
91  $this->lng = $lng;
92  $this->objDefinition = $objDefinition;
93  $this->tabs_gui = $ilTabs;
94  $this->page = $a_page_object;
95  $this->page_gui = $a_page_object_gui;
96 
97  $this->ctrl->saveParameter($this, array("hier_id", "pc_id"));
98  }
global $DIC
Definition: saml.php:7
user()
Definition: user.php:4
global $ilCtrl
Definition: ilias.php:18
Create styles array
The data for the language used.
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 475 of file class.ilPageEditorGUI.php.

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

Referenced by ilPCDataTableGUI\editData(), ilPCPlaceHolderGUI\insertPCText(), and ilPageObjectGUI\showPage().

476  {
477  global $DIC;
478 
479  $ilUser = $DIC->user();
480 
481  if ($ilUser->getPref("ilPageEditor_JavaScript") != "disable"
483  return true;
484  }
485  return false;
486  }
static _isBrowserJSEditCapable()
checks wether browser is javascript editing capable
global $DIC
Definition: saml.php:7
$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 491 of file class.ilPageEditorGUI.php.

Referenced by _doJSEditing().

492  {
493  return true;
494  }
+ Here is the caller graph for this function:

◆ activatePage()

ilPageEditorGUI::activatePage ( )

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

497  {
498  $this->page_gui->activatePage();
499  }

◆ activateSelected()

ilPageEditorGUI::activateSelected ( )

(de-)activate selected items

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

References $_POST, and $_SESSION.

687  {
688  if (is_int(strpos($_POST["target"][0], ";"))) {
689  $_POST["target"] = explode(";", $_POST["target"][0]);
690  }
691  if (is_array($_POST["target"])) {
692  $updated = $this->page->switchEnableMultiple(
693  $_POST["target"],
694  true,
695  $this->page_gui->getPageConfig()->getEnableSelfAssessment()
696  );
697  if ($updated !== true) {
698  $_SESSION["il_pg_error"] = $updated;
699  } else {
700  unset($_SESSION["il_pg_error"]);
701  }
702  }
703  $this->ctrl->returnToParent($this);
704  }
$_SESSION["AccountId"]
$_POST["username"]

◆ addChangeComment()

ilPageEditorGUI::addChangeComment ( )

add change comment to history

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

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

558  {
559  include_once("./Services/History/classes/class.ilHistory.php");
561  $this->page->getId(),
562  "update",
563  "",
564  $this->page->getParentType() . ":pg",
565  ilUtil::stripSlashes($_POST["change_comment"]),
566  true
567  );
568  ilUtil::sendSuccess($this->lng->txt("cont_added_comment"), true);
569  $this->ctrl->returnToParent($this);
570  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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 793 of file class.ilPageEditorGUI.php.

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

794  {
795  $char_par = ilUtil::stripSlashes($_POST["char_par"]);
796  $char_sec = ilUtil::stripSlashes($_POST["char_sec"]);
797  if (is_array($_POST["target"])) {
798  foreach ($_POST["target"] as $t) {
799  $tarr = explode(":", $t);
800  $cont_obj = $this->page->getContentObject($tarr[0], $tarr[1]);
801  if (is_object($cont_obj) && $cont_obj->getType() == "par") {
802  $cont_obj->setCharacteristic($char_par);
803  }
804  if (is_object($cont_obj) && $cont_obj->getType() == "sec") {
805  $cont_obj->setCharacteristic($char_sec);
806  }
807  }
808  $updated = $this->page->update();
809  if ($updated !== true) {
810  $_SESSION["il_pg_error"] = $updated;
811  } else {
812  unset($_SESSION["il_pg_error"]);
813  }
814  }
815  $this->ctrl->returnToParent($this);
816  }
$_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:

◆ assignCharacteristicForm()

ilPageEditorGUI::assignCharacteristicForm ( )

Assign characeristic to text blocks/sections.

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

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

710  {
711  $tpl = $this->tpl;
712  $lng = $this->lng;
713 
714  if (is_int(strpos($_POST["target"][0], ";"))) {
715  $_POST["target"] = explode(";", $_POST["target"][0]);
716  }
717  if (is_array($_POST["target"])) {
718  $types = array();
719 
720  // check what content element types have been selected
721  foreach ($_POST["target"] as $t) {
722  $tarr = explode(":", $t);
723  $cont_obj = $this->page->getContentObject($tarr[0], $tarr[1]);
724  if (is_object($cont_obj) && $cont_obj->getType() == "par") {
725  $types["par"] = "par";
726  }
727  if (is_object($cont_obj) && $cont_obj->getType() == "sec") {
728  $types["sec"] = "sec";
729  }
730  }
731 
732  if (count($types) == 0) {
733  ilUtil::sendFailure($lng->txt("cont_select_par_or_section"), true);
734  $this->ctrl->returnToParent($this);
735  } else {
736  $this->initCharacteristicForm($_POST["target"], $types);
737  $tpl->setContent($this->form->getHTML());
738  }
739  } else {
740  $this->ctrl->returnToParent($this);
741  }
742  }
initCharacteristicForm($a_target, $a_types)
Init map creation/update form.
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ cancelDeleteSelected()

ilPageEditorGUI::cancelDeleteSelected ( )

Cancel deletion.

Parameters

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

606  {
607  $this->ctrl->returnToParent($this);
608  }

◆ confirmedDeleteSelected()

ilPageEditorGUI::confirmedDeleteSelected ( )

Delete selected items.

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

References $_POST, and $_SESSION.

615  {
616  $targets = explode(";", $_POST["target"]);
617  if (count($targets) > 0) {
618  $updated = $this->page->deleteContents(
619  $targets,
620  true,
621  $this->page_gui->getPageConfig()->getEnableSelfAssessment()
622  );
623  if ($updated !== true) {
624  $_SESSION["il_pg_error"] = $updated;
625  } else {
626  unset($_SESSION["il_pg_error"]);
627  }
628  }
629  $this->ctrl->returnToParent($this);
630  }
$_SESSION["AccountId"]
$_POST["username"]

◆ copyLinkedMediaToClipboard()

ilPageEditorGUI::copyLinkedMediaToClipboard ( )

copy linked media object to clipboard

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

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

535  {
537 
538  ilUtil::sendSuccess($this->lng->txt("copied_to_clipboard"), true);
539  $ilUser->addObjectToClipboard($_POST["mob_id"], "mob", ilObject::_lookupTitle($_POST["mob_id"]));
540  $this->ctrl->returnToParent($this);
541  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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 546 of file class.ilPageEditorGUI.php.

References $_POST, $ilUser, and $user.

547  {
549 
550  $this->ctrl->setParameterByClass("ilmediapooltargetselector", "mob_id", $_POST["mob_id"]);
551  $this->ctrl->redirectByClass("ilmediapooltargetselector", "listPools");
552  }
$ilUser
Definition: imgupload.php:18
$_POST["username"]

◆ copySelected()

ilPageEditorGUI::copySelected ( )

Copy selected items.

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

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

636  {
637  $lng = $this->lng;
638 
639  if (is_int(strpos($_POST["target"][0], ";"))) {
640  $_POST["target"] = explode(";", $_POST["target"][0]);
641  }
642  if (is_array($_POST["target"])) {
643  $this->page->copyContents($_POST["target"]);
644  ilUtil::sendSuccess($lng->txt("cont_sel_el_copied_use_paste"), true);
645  }
646  $this->ctrl->returnToParent($this);
647  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ cutSelected()

ilPageEditorGUI::cutSelected ( )

Cut selected items.

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

References $_POST, $_SESSION, $lng, and ilUtil\sendSuccess().

653  {
654  $lng = $this->lng;
655 
656  if (is_int(strpos($_POST["target"][0], ";"))) {
657  $_POST["target"] = explode(";", $_POST["target"][0]);
658  }
659  if (is_array($_POST["target"])) {
660  $updated = $this->page->cutContents($_POST["target"]);
661  if ($updated !== true) {
662  $_SESSION["il_pg_error"] = $updated;
663  } else {
664  unset($_SESSION["il_pg_error"]);
665  }
666  ilUtil::sendSuccess($lng->txt("cont_sel_el_cut_use_paste"), true);
667  }
668  $this->ctrl->returnToParent($this);
669  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_SESSION["AccountId"]
$_POST["username"]
+ Here is the call graph for this function:

◆ deactivatePage()

ilPageEditorGUI::deactivatePage ( )

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

502  {
503  $this->page_gui->deactivatePage();
504  }

◆ deleteSelected()

ilPageEditorGUI::deleteSelected ( )

Confirm.

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

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

576  {
578  $tpl = $this->tpl;
579  $lng = $this->lng;
580 
581  $targets = explode(";", $_POST["target"][0]);
582 
583  if (count($targets) == 0) {
584  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
585  $this->ctrl->returnToParent($this);
586  } else {
587  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
588  $cgui = new ilConfirmationGUI();
589  $cgui->setFormAction($ilCtrl->getFormAction($this));
590  $cgui->setHeaderText($lng->txt("copg_confirm_el_deletion"));
591  $cgui->setCancel($lng->txt("cancel"), "cancelDeleteSelected");
592  $cgui->setConfirm($lng->txt("confirm"), "confirmedDeleteSelected");
593  $cgui->addHiddenItem("target", $_POST["target"][0]);
594 
595  $tpl->setContent($cgui->getHTML());
596  }
597  }
global $ilCtrl
Definition: ilias.php:18
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 884 of file class.ilPageEditorGUI.php.

Referenced by executeCommand().

885  {
886  /*if(is_object($this->locator))
887  {
888  $this->locator->display();
889  }*/
890  }
+ Here is the caller graph for this function:

◆ displayPage()

ilPageEditorGUI::displayPage ( )

Default for POST reloads and missing.

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

877  {
878  $this->ctrl->returnToParent($this);
879  }

◆ executeCommand()

ilPageEditorGUI::executeCommand ( )

execute command

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

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

154  {
156  $ilHelp = $this->help;
157 
158  $this->log->debug("ilPageEditorGUI: executeCommand begin");
159 
160  $cmd = $this->ctrl->getCmd("displayPage");
161  //echo "-$cmd-"; exit;
162  $cmdClass = strtolower($this->ctrl->getCmdClass());
163 
164  $hier_id = $_GET["hier_id"];
165  $pc_id = $_GET["pc_id"];
166  if (isset($_POST["new_hier_id"])) {
167  $hier_id = $_POST["new_hier_id"];
168  }
169  //echo "GEThier_id:".$_GET["hier_id"]."<br>";
170  //$this->ctrl->debug("hier_id:".$hier_id);
171 
172  $new_type = (isset($_GET["new_type"]))
173  ? $_GET["new_type"]
174  : $_POST["new_type"];
175 
176  //echo "-$cmd-";
177  //var_dump($_GET); var_dump($_POST); exit;
178  /*array
179  'target' =>
180  array
181  0 => string '' (length=0)
182  'commandpg' => string 'insertJS' (length=8)
183  'cmd' =>
184  array
185  'exec_pg:' => string 'Ok' (length=2)
186  'ajaxform_content' => string '<div class=\"ilc_text_block_Standard\">sdfsdfsd sd</div>' (length=56)
187  'ajaxform_char' => string '' (length=0)*/
188  /*array
189  'usedwsiwygeditor' => string '0' (length=1)
190  'par_characteristic' => string 'Standard' (length=8)
191  'par_content' => string 'adasdaasda a
192 
193  ' (length=14)
194  'par_language' => string 'en' (length=2)
195  'cmd' =>
196  array
197  'create_par' => string 'Save' (length=4)*/
198 
199  if (substr($cmd, 0, 5) == "exec_") {
200  //echo ":".key($_POST["cmd"]).":";
201  // check whether pc id is given
202  $pca = explode(":", key($_POST["cmd"]));
203  $pc_id = $pca[1];
204  //echo "<br />exec_pc_id:-$pc_id-";
205  $cmd = explode("_", $pca[0]);
206  unset($cmd[0]);
207  $hier_id = implode($cmd, "_");
208  $cmd = $_POST["command" . $hier_id];
209  }
210  //echo "<br>cmd:$cmd:";exit;
211  // strip "c" "r" of table ids from hierarchical id
212  $first_hier_character = substr($hier_id, 0, 1);
213  if ($first_hier_character == "c" ||
214  $first_hier_character == "r" ||
215  $first_hier_character == "g" ||
216  $first_hier_character == "i") {
217  $hier_id = substr($hier_id, 1);
218  }
219  $this->page->buildDom();
220  $this->page->addHierIDs();
221 
222 
223  // determine command and content object
224  if ($cmdClass != "ilfilesystemgui") {
225  $com = explode("_", $cmd);
226  $cmd = $com[0];
227  }
228 
229 
230  $next_class = $this->ctrl->getNextClass($this);
231  $this->log->debug("next class: " . $next_class);
232 
233  // special case: placeholders from preview mode come without hier_id
234  if ($next_class == "ilpcplaceholdergui" && $hier_id == "" && $_GET["pl_pc_id"] != "") {
235  $hid = $this->page->getHierIdsForPCIds(array($_GET["pl_pc_id"]));
236  $hier_id = $hid[$_GET["pl_pc_id"]];
237  }
238 
239  // determine content type
240  if ($com[0] == "insert" || $com[0] == "create") {
241  $cmd = $com[0];
242  $ctype = $com[1];
243  $add_type = $com[2];
244  if ($ctype == "mob") {
245  $ctype = "media";
246  }
247  } else {
248  // setting cmd and cmdclass for editing of linked media
249  if ($cmd == "editLinkedMedia") {
250  $this->ctrl->setCmd("edit");
251  $cmd = "edit";
252  $_GET["pgEdMediaMode"] = "editLinkedMedia";
253  $_GET["mob_id"] = $_POST["mob_id"];
254  }
255  if ($_GET["pgEdMediaMode"] == "editLinkedMedia") {
256  $this->ctrl->setParameter($this, "pgEdMediaMode", "editLinkedMedia");
257  $this->ctrl->setParameter($this, "mob_id", $_GET["mob_id"]);
258  if ($cmdClass != "ilinternallinkgui" && $cmdClass != "ilmdeditorgui"
259  && $cmdClass != "ilimagemapeditorgui" && $cmdClass != "ilfilesystemgui") {
260  $this->ctrl->setCmdClass("ilobjmediaobjectgui");
261  $cmdClass = "ilobjmediaobjectgui";
262  }
263  }
264  if (false) {
265  var_dump($_POST);
266  var_dump($_GET);
267  echo ";$cmd;" . $next_class . ";";
268  echo "-$pc_id-";
269  echo "-$cmd-" . $this->ctrl->getCmd() . "-";
270  exit;
271  }
272 
273  //var_dump($_POST);
274  // note: ilinternallinkgui for page: no cont_obj is received
275  // ilinternallinkgui for mob: cont_obj is received
276  if ($cmd != "insertFromClipboard" && $cmd != "pasteFromClipboard" &&
277  $cmd != "setMediaMode" && $cmd != "copyLinkedMediaToClipboard" &&
278  $cmd != "activatePage" && $cmd != "deactivatePage" &&
279  $cmd != "copyLinkedMediaToMediaPool" && $cmd != "showSnippetInfo" &&
280  $cmd != "deleteSelected" && $cmd != "paste" &&
281  $cmd != "cancelDeleteSelected" && $cmd != "confirmedDeleteSelected" &&
282  $cmd != "copySelected" && $cmd != "cutSelected" &&
283  ($cmd != "displayPage" || $_POST["editImagemapForward_x"] != "" || $_POST["imagemap_x"] != "") &&
284  ($cmd != "displayPage" || $_POST["editImagemapForward_x"] != "") &&
285  $cmd != "activateSelected" && $cmd != "assignCharacteristicForm" &&
286  $cmd != "assignCharacteristic" &&
287  $cmdClass != "ilrepositoryselector2inputgui" &&
288  $cmd != "cancelCreate" && $cmd != "popup" &&
289  $cmdClass != "ileditclipboardgui" && $cmd != "addChangeComment" &&
290  ($cmdClass != "ilinternallinkgui" || ($next_class == "ilpcmediaobjectgui"))) {
291  if ($_GET["pgEdMediaMode"] != "editLinkedMedia") {
292  //$this->ctrl->debug("gettingContentObject (no linked media)");
293  //echo $hier_id."-".$pc_id;
294  $cont_obj = $this->page->getContentObject($hier_id, $pc_id);
295  if (!is_object($cont_obj)) {
296  $this->log->debug("ilPageEditorGUI: ...returnToParent (cmdClass: $cmdClass, nextClass: $next_class" .
297  ", hier_id: " . $hier_id . ", pc_id: " . $pc_id . ")");
298  $ilCtrl->returnToParent($this);
299  }
300  $ctype = $cont_obj->getType();
301  }
302  }
303  }
304 
305  //$this->ctrl->debug("+ctype:".$ctype."+");
306  // $this->tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
307  // $this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
308 
309  if ($ctype != "media" || !is_object($cont_obj)) {
310  if ($this->getHeader() != "") {
311  $this->tpl->setTitle($this->getHeader());
312  }
313  $this->displayLocator();
314  }
315 
316  $this->cont_obj = $cont_obj;
317 
318 
319  // special command / command class handling
320  $this->ctrl->setParameter($this, "hier_id", $hier_id);
321  $this->ctrl->setParameter($this, "pc_id", $pc_id);
322  $this->ctrl->setCmd($cmd);
323  //$next_class = $this->ctrl->getNextClass($this);
324  //$this->ctrl->debug("+next_class:".$next_class."+");
325  //echo("+next_class:".$next_class."+".$ctype."+"); exit;
326 
327  $this->log->debug("(2) next class: " . $next_class . ", ctype: " . $ctype);
328 
329  if ($next_class == "") {
330  include_once("./Services/COPage/classes/class.ilCOPagePCDef.php");
331  $pc_def = ilCOPagePCDef::getPCDefinitionByType($ctype);
332  if (is_array($pc_def)) {
333  $this->ctrl->setCmdClass($pc_def["pc_gui_class"]);
334  }
335  $next_class = $this->ctrl->getNextClass($this);
336  }
337 
338  // do not do this while imagemap editing is ongoing
339  if ($cmd == "displayPage" && $_POST["editImagemapForward_x"] == "" && $_POST["imagemap_x"] == "") {
340  $next_class = "";
341  }
342 
343  //echo "hier_id:$hier_id:type:$type:cmd:$cmd:ctype:$ctype:next_class:$next_class:<br>"; exit;
344  $this->log->debug("ilPageEditorGUI: ... next_class:" . $next_class . ", pc_id:" . $pc_id .
345  ", hier_id:" . $hier_id . ", ctype:" . $ctype . ", cmd:" . $cmd);
346  switch ($next_class) {
347  case "ilinternallinkgui":
348  $link_gui = new ilInternalLinkGUI(
349  $this->page_gui->getPageConfig()->getIntLinkHelpDefaultType(),
350  $this->page_gui->getPageConfig()->getIntLinkHelpDefaultId(),
351  $this->page_gui->getPageConfig()->getIntLinkHelpDefaultIdIsRef()
352  );
353  $link_gui->setFilterWhiteList(
354  $this->page_gui->getPageConfig()->getIntLinkFilterWhiteList()
355  );
356  foreach ($this->page_gui->getPageConfig()->getIntLinkFilters() as $filter) {
357  $link_gui->filterLinkType($filter);
358  }
359  $link_gui->setReturn($this->int_link_return);
360 
361  $ret = $this->ctrl->forwardCommand($link_gui);
362  break;
363 
364  // PC Media Object
365  case "ilpcmediaobjectgui":
366  include_once("./Services/COPage/classes/class.ilPCMediaObjectGUI.php");
367 
368  $this->tabs_gui->clearTargets();
369  $this->tabs_gui->setBackTarget(
370  $this->page_gui->page_back_title,
371  $ilCtrl->getLinkTarget($this->page_gui, "edit")
372  );
373  $pcmob_gui = new ilPCMediaObjectGUI($this->page, $cont_obj, $hier_id, $pc_id);
374  $pcmob_gui->setStyleId($this->page_gui->getStyleId());
375  $pcmob_gui->setEnabledMapAreas($this->page_gui->getPageConfig()->getEnableInternalLinks());
376  $ret = $this->ctrl->forwardCommand($pcmob_gui);
377  $ilHelp->setScreenIdComponent("copg_media");
378  break;
379 
380  // only for "linked" media
381  case "ilobjmediaobjectgui":
382  $this->tabs_gui->clearTargets();
383  $this->tabs_gui->setBackTarget(
384  $this->lng->txt("back"),
385  $ilCtrl->getParentReturn($this)
386  );
387  $mob_gui = new ilObjMediaObjectGUI("", $_GET["mob_id"], false, false);
388  $mob_gui->getTabs();
389  $mob_gui->setEnabledMapAreas($this->page_gui->getPageConfig()->getEnableInternalLinks());
390  $this->tpl->setTitle($this->lng->txt("mob") . ": " .
391  ilObject::_lookupTitle($_GET["mob_id"]));
392  $ret = $this->ctrl->forwardCommand($mob_gui);
393  break;
394 
395  // Question
396  case "ilpcquestiongui":
397  include_once("./Services/COPage/classes/class.ilPCQuestionGUI.php");
398  $pc_question_gui = new ilPCQuestionGUI($this->page, $cont_obj, $hier_id, $pc_id);
399  $pc_question_gui->setSelfAssessmentMode($this->page_gui->getPageConfig()->getEnableSelfAssessment());
400  $pc_question_gui->setPageConfig($this->page_gui->getPageConfig());
401 
402  if ($this->page_gui->getPageConfig()->getEnableSelfAssessment()) {
403  $this->tabs_gui->clearTargets();
404  $ilHelp->setScreenIdComponent("copg_pcqst");
405  $this->tabs_gui->setBackTarget(
406  $this->lng->txt("back"),
407  $ilCtrl->getParentReturn($this)
408  );
409  $ret = $this->ctrl->forwardCommand($pc_question_gui);
410  } else {
411  $cmd = $this->ctrl->getCmd();
412  $pc_question_gui->$cmd();
413  $this->ctrl->redirectByClass(array("ilobjquestionpoolgui", get_class($cont_obj)), "editQuestion");
414  }
415  break;
416 
417  // Plugged Component
418  case "ilpcpluggedgui":
419  $this->tabs_gui->clearTargets();
420  include_once("./Services/COPage/classes/class.ilPCPluggedGUI.php");
421  $plugged_gui = new ilPCPluggedGUI(
422  $this->page,
423  $cont_obj,
424  $hier_id,
425  $add_type,
426  $pc_id
427  );
428  $ret = $this->ctrl->forwardCommand($plugged_gui);
429  break;
430 
431  default:
432 
433  // generic calls to gui classes
434  include_once("./Services/COPage/classes/class.ilCOPagePCDef.php");
435  if (ilCOPagePCDef::isPCGUIClassName($next_class, true)) {
436  $pc_def = ilCOPagePCDef::getPCDefinitionByGUIClassName($next_class);
437  $this->tabs_gui->clearTargets();
438  $this->tabs_gui->setBackTarget(
439  $this->page_gui->page_back_title,
440  $ilCtrl->getLinkTarget($this->page_gui, "edit")
441  );
442  $ilHelp->setScreenIdComponent("copg_" . $pc_def["pc_type"]);
444  $gui_class_name = $pc_def["pc_gui_class"];
445  $pc_gui = new $gui_class_name($this->page, $cont_obj, $hier_id, $pc_id);
446  if ($pc_def["style_classes"]) {
447  $pc_gui->setStyleId($this->page_gui->getStyleId());
448  }
449  $pc_gui->setPageConfig($this->page_gui->getPageConfig());
450  $ret = $this->ctrl->forwardCommand($pc_gui);
451  } else {
452  // cmd belongs to ilPageEditorGUI
453 
454  if ($cmd == "pasteFromClipboard") {
455  $ret = $this->pasteFromClipboard($hier_id);
456  } elseif ($cmd == "paste") {
457  $ret = $this->paste($hier_id);
458  } else {
459  $ret = $this->$cmd();
460  }
461  }
462  break;
463 
464  }
465 
466  $this->log->debug("ilPageEditorGUI: executeCommand end");
467 
468  return $ret;
469  }
static isPCGUIClassName($a_class_name, $a_lower_case=false)
Is given class name a pc gui class?
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.
global $ilCtrl
Definition: ilias.php:18
Class ilPCQuestionGUI.
Create styles array
The data for the language used.
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 116 of file class.ilPageEditorGUI.php.

References $header.

Referenced by executeCommand().

117  {
118  return $this->header;
119  }
+ Here is the caller graph for this function:

◆ initCharacteristicForm()

ilPageEditorGUI::initCharacteristicForm (   $a_target,
  $a_types 
)

Init map creation/update form.

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

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

Referenced by assignCharacteristicForm().

748  {
750  $lng = $this->lng;
751 
752 
753  // edit form
754  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
755  $this->form = new ilPropertyFormGUI();
756  $this->form->setTitle($this->lng->txt("cont_choose_characteristic"));
757 
758  if ($a_types["par"] == "par") {
759  $select_prop = new ilSelectInputGUI(
760  $this->lng->txt("cont_choose_characteristic_text"),
761  "char_par"
762  );
763  include_once("./Services/COPage/classes/class.ilPCParagraphGUI.php");
764  $options = ilPCParagraphGUI::_getCharacteristics($this->page_gui->getStyleId());
765  $select_prop->setOptions($options);
766  $this->form->addItem($select_prop);
767  }
768  if ($a_types["sec"] == "sec") {
769  $select_prop = new ilSelectInputGUI(
770  $this->lng->txt("cont_choose_characteristic_section"),
771  "char_sec"
772  );
773  include_once("./Services/COPage/classes/class.ilPCSectionGUI.php");
774  $options = ilPCSectionGUI::_getCharacteristics($this->page_gui->getStyleId());
775  $select_prop->setOptions($options);
776  $this->form->addItem($select_prop);
777  }
778 
779  foreach ($a_target as $t) {
780  $hidden = new ilHiddenInputGUI("target[]");
781  $hidden->setValue($t);
782  $this->form->addItem($hidden);
783  }
784 
785  $this->form->setFormAction($ilCtrl->getFormAction($this));
786  $this->form->addCommandButton("assignCharacteristic", $lng->txt("save"));
787  $this->form->addCommandButton("showPage", $lng->txt("cancel"));
788  }
This class represents a selection list property in a property form.
This class represents a property form user interface.
static _getCharacteristics($a_style_id)
Get characteristics.
global $ilCtrl
Definition: ilias.php:18
This class represents a hidden form property in a property form.
static _getCharacteristics($a_style_id)
Get characteristics.
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
+ 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 844 of file class.ilPageEditorGUI.php.

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

845  {
846  include_once("./Services/Clipboard/classes/class.ilEditClipboardGUI.php");
848  include_once("./Services/COPage/classes/class.ilPCMediaObject.php");
849  if ($ids != "") {
850  foreach ($ids as $id2) {
851  $id = explode(":", $id2);
852  $type = $id[0];
853  $id = $id[1];
854  if ($type == "mob") {
855  $this->content_obj = new ilPCMediaObject($this->page);
856  $this->content_obj->readMediaObject($id);
857  $this->content_obj->createAlias($this->page, $_GET["hier_id"]);
858  $this->updated = $this->page->update();
859  }
860  if ($type == "incl") {
861  include_once("./Services/COPage/classes/class.ilPCContentInclude.php");
862  $this->content_obj = new ilPCContentInclude($this->page);
863  $this->content_obj->create($this->page, $_GET["hier_id"]);
864  $this->content_obj->setContentType("mep");
865  $this->content_obj->setContentId($id);
866  $this->updated = $this->page->update();
867  }
868  }
869  }
870  $this->ctrl->returnToParent($this);
871  }
$type
$_GET["client_id"]
if(!array_key_exists('StateId', $_REQUEST)) $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 674 of file class.ilPageEditorGUI.php.

References $ctrl, and $ilCtrl.

Referenced by executeCommand().

675  {
677  $this->page->pasteContents($a_hier_id, $this->page_gui->getPageConfig()->getEnableSelfAssessment());
678  include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
679  //ilEditClipboard::setAction("");
680  $this->ctrl->returnToParent($this);
681  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ pasteFromClipboard()

ilPageEditorGUI::pasteFromClipboard (   $a_hier_id)

paste from clipboard (redirects to clipboard)

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

References $ctrl, and $ilCtrl.

Referenced by executeCommand().

822  {
824  //var_dump($a_hier_id);
825  $ilCtrl->setParameter($this, "hier_id", $a_hier_id);
826  $ilCtrl->setParameterByClass(
827  "ilEditClipboardGUI",
828  "returnCommand",
829  rawurlencode($ilCtrl->getLinkTarget(
830  $this,
831  "insertFromClipboard",
832  "",
833  false,
834  false
835  ))
836  );
837  //echo ":".$ilCtrl->getLinkTarget($this, "insertFromClipboard").":";
838  $ilCtrl->redirectByClass("ilEditClipboardGUI", "getObject");
839  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ returnToContext()

ilPageEditorGUI::returnToContext ( )

redirect to parent context

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

135  {
136  $this->ctrl->returnToParent($this);
137  }

◆ setHeader()

ilPageEditorGUI::setHeader (   $a_header)

set header title

Parameters
string$a_headerheader title

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

References header.

107  {
108  $this->header = $a_header;
109  }
Add a drawing to the header
Definition: 04printing.php:69

◆ setIntLinkReturn()

ilPageEditorGUI::setIntLinkReturn (   $a_return)

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

140  {
141  $this->int_link_return = $a_return;
142  }

◆ setLocator()

ilPageEditorGUI::setLocator ( $a_locator)

set locator object

Parameters
object$a_locatorlocator object

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

127  {
128  $this->locator = $a_locator;
129  }

◆ setMediaMode()

ilPageEditorGUI::setMediaMode ( )

set media and editing mode

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

References $_POST, $ilUser, and $user.

510  {
512 
513  $ilUser->writePref("ilPageEditor_MediaMode", $_POST["media_mode"]);
514  $ilUser->writePref("ilPageEditor_HTMLMode", $_POST["html_mode"]);
515  if ($ilUser->getPref("ilPageEditor_JavaScript") != $_POST["js_mode"]) {
516  // not nice, should be solved differently in the future
517  if ($this->page->getParentType() == "lm") {
518  $this->ctrl->setParameterByClass("illmpageobjectgui", "reloadTree", "y");
519  }
520  }
521  $ilUser->writePref("ilPageEditor_JavaScript", $_POST["js_mode"]);
522 
523  // again not so nice...
524  if ($this->page->getParentType() == "lm") {
525  $this->ctrl->redirectByClass("illmpageobjectgui", "edit");
526  } else {
527  $this->ctrl->returnToParent($this);
528  }
529  }
$ilUser
Definition: imgupload.php:18
$_POST["username"]

◆ setPageBackTitle()

ilPageEditorGUI::setPageBackTitle (   $a_title)

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

146  {
147  $this->page_back_title = $a_title;
148  }

◆ showSnippetInfo()

ilPageEditorGUI::showSnippetInfo ( )

Show snippet info.

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

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

896  {
897  $tpl = $this->tpl;
898  $lng = $this->lng;
899  $ilAccess = $this->access;
901 
902  $stpl = new ilTemplate("tpl.snippet_info.html", true, true, "Services/COPage");
903 
904  include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
905  $mep_pools = ilMediaPoolItem::getPoolForItemId($_POST["ci_id"]);
906  foreach ($mep_pools as $mep_id) {
907  $ref_ids = ilObject::_getAllReferences($mep_id);
908  $edit_link = false;
909  foreach ($ref_ids as $rid) {
910  if (!$edit_link && $ilAccess->checkAccess("write", "", $rid)) {
911  $stpl->setCurrentBlock("edit_link");
912  $stpl->setVariable("TXT_EDIT", $lng->txt("edit"));
913  $stpl->setVariable(
914  "HREF_EDIT",
915  "./goto.php?target=mep_" . $rid
916  );
917  $stpl->parseCurrentBlock();
918  }
919  }
920  $stpl->setCurrentBlock("pool");
921  $stpl->setVariable("TXT_MEDIA_POOL", $lng->txt("obj_mep"));
922  $stpl->setVariable("VAL_MEDIA_POOL", ilObject::_lookupTitle($mep_id));
923  $stpl->parseCurrentBlock();
924  }
925 
926  include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
927  $stpl->setVariable("TXT_TITLE", $lng->txt("title"));
928  $stpl->setVariable("VAL_TITLE", ilMediaPoolPage::lookupTitle($_POST["ci_id"]));
929  $stpl->setVariable("TXT_BACK", $lng->txt("back"));
930  $stpl->setVariable(
931  "HREF_BACK",
932  $ilCtrl->getLinkTarget($this->page_gui, "edit")
933  );
934  $tpl->setContent($stpl->get());
935  }
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
global $ilCtrl
Definition: ilias.php:18
special template class to simplify handling of ITX/PEAR
$_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

◆ $ctrl

◆ $enable_anchors

ilPageEditorGUI::$enable_anchors

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

◆ $enable_keywords

ilPageEditorGUI::$enable_keywords

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

◆ $header

ilPageEditorGUI::$header

Definition at line 56 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

◆ $log

ilPageEditorGUI::$log
protected

Definition at line 65 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 53 of file class.ilPageEditorGUI.php.

◆ $return_location

ilPageEditorGUI::$return_location

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

◆ $tabs

ilPageEditorGUI::$tabs

Definition at line 57 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 54 of file class.ilPageEditorGUI.php.

◆ $tpl

ilPageEditorGUI::$tpl

◆ $user

ilPageEditorGUI::$user
protected

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