ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 @access public

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

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 }
user()
Definition: user.php:4
static getLogger($a_component_id)
Get component logger.
help()
Definition: help.php:2
global $ilCtrl
Definition: ilias.php:18
$DIC
Definition: xapitoken.php:46

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

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

457 {
458 global $DIC;
459
460 $ilUser = $DIC->user();
461
462 if ($ilUser->getPref("ilPageEditor_JavaScript") != "disable"
464 return true;
465 }
466 return false;
467 }
static _isBrowserJSEditCapable()
checks wether browser is javascript editing capable
$ilUser
Definition: imgupload.php:18

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

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

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

473 {
474 return true;
475 }

Referenced by _doJSEditing().

+ Here is the caller graph for this function:

◆ activatePage()

ilPageEditorGUI::activatePage ( )

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

478 {
479 $this->page_gui->activatePage();
480 }

◆ activateSelected()

ilPageEditorGUI::activateSelected ( )

(de-)activate selected items

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

668 {
669 if (is_int(strpos($_POST["target"][0], ";"))) {
670 $_POST["target"] = explode(";", $_POST["target"][0]);
671 }
672 if (is_array($_POST["target"])) {
673 $updated = $this->page->switchEnableMultiple(
674 $_POST["target"],
675 true,
676 $this->page_gui->getPageConfig()->getEnableSelfAssessment()
677 );
678 if ($updated !== true) {
679 $_SESSION["il_pg_error"] = $updated;
680 } else {
681 unset($_SESSION["il_pg_error"]);
682 }
683 }
684 $this->ctrl->returnToParent($this);
685 }
$_POST["username"]
$_SESSION["AccountId"]

References $_POST, and $_SESSION.

◆ addChangeComment()

ilPageEditorGUI::addChangeComment ( )

add change comment to history

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

539 {
540 include_once("./Services/History/classes/class.ilHistory.php");
542 $this->page->getId(),
543 "update",
544 "",
545 $this->page->getParentType() . ":pg",
546 ilUtil::stripSlashes($_POST["change_comment"]),
547 true
548 );
549 ilUtil::sendSuccess($this->lng->txt("cont_added_comment"), true);
550 $this->ctrl->returnToParent($this);
551 }
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

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

+ Here is the call graph for this function:

◆ assignCharacteristic()

ilPageEditorGUI::assignCharacteristic ( )

Assign characteristic.

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

775 {
776 $char_par = ilUtil::stripSlashes($_POST["char_par"]);
777 $char_sec = ilUtil::stripSlashes($_POST["char_sec"]);
778 if (is_array($_POST["target"])) {
779 foreach ($_POST["target"] as $t) {
780 $tarr = explode(":", $t);
781 $cont_obj = $this->page->getContentObject($tarr[0], $tarr[1]);
782 if (is_object($cont_obj) && $cont_obj->getType() == "par") {
783 $cont_obj->setCharacteristic($char_par);
784 }
785 if (is_object($cont_obj) && $cont_obj->getType() == "sec") {
786 $cont_obj->setCharacteristic($char_sec);
787 }
788 }
789 $updated = $this->page->update();
790 if ($updated !== true) {
791 $_SESSION["il_pg_error"] = $updated;
792 } else {
793 unset($_SESSION["il_pg_error"]);
794 }
795 }
796 $this->ctrl->returnToParent($this);
797 }

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

+ Here is the call graph for this function:

◆ assignCharacteristicForm()

ilPageEditorGUI::assignCharacteristicForm ( )

Assign characeristic to text blocks/sections.

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

691 {
694
695 if (is_int(strpos($_POST["target"][0], ";"))) {
696 $_POST["target"] = explode(";", $_POST["target"][0]);
697 }
698 if (is_array($_POST["target"])) {
699 $types = array();
700
701 // check what content element types have been selected
702 foreach ($_POST["target"] as $t) {
703 $tarr = explode(":", $t);
704 $cont_obj = $this->page->getContentObject($tarr[0], $tarr[1]);
705 if (is_object($cont_obj) && $cont_obj->getType() == "par") {
706 $types["par"] = "par";
707 }
708 if (is_object($cont_obj) && $cont_obj->getType() == "sec") {
709 $types["sec"] = "sec";
710 }
711 }
712
713 if (count($types) == 0) {
714 ilUtil::sendFailure($lng->txt("cont_select_par_or_section"), true);
715 $this->ctrl->returnToParent($this);
716 } else {
717 $this->initCharacteristicForm($_POST["target"], $types);
718 $tpl->setContent($this->form->getHTML());
719 }
720 } else {
721 $this->ctrl->returnToParent($this);
722 }
723 }
initCharacteristicForm($a_target, $a_types)
Init map creation/update form.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

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

+ Here is the call graph for this function:

◆ cancelDeleteSelected()

ilPageEditorGUI::cancelDeleteSelected ( )

Cancel deletion.

Parameters

return

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

587 {
588 $this->ctrl->returnToParent($this);
589 }

◆ confirmedDeleteSelected()

ilPageEditorGUI::confirmedDeleteSelected ( )

Delete selected items.

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

596 {
597 $targets = explode(";", $_POST["target"]);
598 if (count($targets) > 0) {
599 $updated = $this->page->deleteContents(
600 $targets,
601 true,
602 $this->page_gui->getPageConfig()->getEnableSelfAssessment()
603 );
604 if ($updated !== true) {
605 $_SESSION["il_pg_error"] = $updated;
606 } else {
607 unset($_SESSION["il_pg_error"]);
608 }
609 }
610 $this->ctrl->returnToParent($this);
611 }

References $_POST, and $_SESSION.

◆ copyLinkedMediaToClipboard()

ilPageEditorGUI::copyLinkedMediaToClipboard ( )

copy linked media object to clipboard

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

516 {
518
519 ilUtil::sendSuccess($this->lng->txt("copied_to_clipboard"), true);
520 $ilUser->addObjectToClipboard($_POST["mob_id"], "mob", ilObject::_lookupTitle($_POST["mob_id"]));
521 $this->ctrl->returnToParent($this);
522 }
static _lookupTitle($a_id)
lookup object title

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

+ Here is the call graph for this function:

◆ copyLinkedMediaToMediaPool()

ilPageEditorGUI::copyLinkedMediaToMediaPool ( )

copy linked media object to media pool

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

528 {
530
531 $this->ctrl->setParameterByClass("ilmediapooltargetselector", "mob_id", $_POST["mob_id"]);
532 $this->ctrl->redirectByClass("ilmediapooltargetselector", "listPools");
533 }

References $_POST, $ilUser, and $user.

◆ copySelected()

ilPageEditorGUI::copySelected ( )

Copy selected items.

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

617 {
619
620 if (is_int(strpos($_POST["target"][0], ";"))) {
621 $_POST["target"] = explode(";", $_POST["target"][0]);
622 }
623 if (is_array($_POST["target"])) {
624 $this->page->copyContents($_POST["target"]);
625 ilUtil::sendSuccess($lng->txt("cont_sel_el_copied_use_paste"), true);
626 }
627 $this->ctrl->returnToParent($this);
628 }

References $_POST, and $lng.

◆ cutSelected()

ilPageEditorGUI::cutSelected ( )

Cut selected items.

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

634 {
636
637 if (is_int(strpos($_POST["target"][0], ";"))) {
638 $_POST["target"] = explode(";", $_POST["target"][0]);
639 }
640 if (is_array($_POST["target"])) {
641 $updated = $this->page->cutContents($_POST["target"]);
642 if ($updated !== true) {
643 $_SESSION["il_pg_error"] = $updated;
644 } else {
645 unset($_SESSION["il_pg_error"]);
646 }
647 ilUtil::sendSuccess($lng->txt("cont_sel_el_cut_use_paste"), true);
648 }
649 $this->ctrl->returnToParent($this);
650 }

References $_POST, $_SESSION, and $lng.

◆ deactivatePage()

ilPageEditorGUI::deactivatePage ( )

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

483 {
484 $this->page_gui->deactivatePage();
485 }

◆ deleteSelected()

ilPageEditorGUI::deleteSelected ( )

Confirm.

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

557 {
561
562 $targets = explode(";", $_POST["target"][0]);
563
564 if (count($targets) == 0) {
565 ilUtil::sendInfo($lng->txt("no_checkbox"), true);
566 $this->ctrl->returnToParent($this);
567 } else {
568 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
569 $cgui = new ilConfirmationGUI();
570 $cgui->setFormAction($ilCtrl->getFormAction($this));
571 $cgui->setHeaderText($lng->txt("copg_confirm_el_deletion"));
572 $cgui->setCancel($lng->txt("cancel"), "cancelDeleteSelected");
573 $cgui->setConfirm($lng->txt("confirm"), "confirmedDeleteSelected");
574 $cgui->addHiddenItem("target", $_POST["target"][0]);
575
576 $tpl->setContent($cgui->getHTML());
577 }
578 }
Confirmation screen class.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

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

+ Here is the call graph for this function:

◆ displayLocator()

ilPageEditorGUI::displayLocator ( )

display locator

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

866 {
867 /*if(is_object($this->locator))
868 {
869 $this->locator->display();
870 }*/
871 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ displayPage()

ilPageEditorGUI::displayPage ( )

Default for POST reloads and missing.

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

858 {
859 $this->ctrl->returnToParent($this);
860 }

◆ executeCommand()

ilPageEditorGUI::executeCommand ( )

execute command

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

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

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

+ 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.

117 {
118 return $this->header;
119 }

References $header.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ initCharacteristicForm()

ilPageEditorGUI::initCharacteristicForm (   $a_target,
  $a_types 
)

Init map creation/update form.

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

729 {
732
733
734 // edit form
735 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
736 $this->form = new ilPropertyFormGUI();
737 $this->form->setTitle($this->lng->txt("cont_choose_characteristic"));
738
739 if ($a_types["par"] == "par") {
740 $select_prop = new ilSelectInputGUI(
741 $this->lng->txt("cont_choose_characteristic_text"),
742 "char_par"
743 );
744 include_once("./Services/COPage/classes/class.ilPCParagraphGUI.php");
745 $options = ilPCParagraphGUI::_getCharacteristics($this->page_gui->getStyleId());
746 $select_prop->setOptions($options);
747 $this->form->addItem($select_prop);
748 }
749 if ($a_types["sec"] == "sec") {
750 $select_prop = new ilSelectInputGUI(
751 $this->lng->txt("cont_choose_characteristic_section"),
752 "char_sec"
753 );
754 include_once("./Services/COPage/classes/class.ilPCSectionGUI.php");
755 $options = ilPCSectionGUI::_getCharacteristics($this->page_gui->getStyleId());
756 $select_prop->setOptions($options);
757 $this->form->addItem($select_prop);
758 }
759
760 foreach ($a_target as $t) {
761 $hidden = new ilHiddenInputGUI("target[]");
762 $hidden->setValue($t);
763 $this->form->addItem($hidden);
764 }
765
766 $this->form->setFormAction($ilCtrl->getFormAction($this));
767 $this->form->addCommandButton("assignCharacteristic", $lng->txt("save"));
768 $this->form->addCommandButton("showPage", $lng->txt("cancel"));
769 }
This class represents a hidden form property in a property form.
static _getCharacteristics($a_style_id)
Get characteristics.
static _getCharacteristics($a_style_id)
Get characteristics.
This class represents a property form user interface.
This class represents a selection list property in a property form.

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

Referenced by assignCharacteristicForm().

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

826 {
827 include_once("./Services/Clipboard/classes/class.ilEditClipboardGUI.php");
829 include_once("./Services/COPage/classes/class.ilPCMediaObject.php");
830 if ($ids != "") {
831 foreach ($ids as $id2) {
832 $id = explode(":", $id2);
833 $type = $id[0];
834 $id = $id[1];
835 if ($type == "mob") {
836 $this->content_obj = new ilPCMediaObject($this->page);
837 $this->content_obj->readMediaObject($id);
838 $this->content_obj->createAlias($this->page, $_GET["hier_id"]);
839 $this->updated = $this->page->update();
840 }
841 if ($type == "incl") {
842 include_once("./Services/COPage/classes/class.ilPCContentInclude.php");
843 $this->content_obj = new ilPCContentInclude($this->page);
844 $this->content_obj->create($this->page, $_GET["hier_id"]);
845 $this->content_obj->setContentType("mep");
846 $this->content_obj->setContentId($id);
847 $this->updated = $this->page->update();
848 }
849 }
850 }
851 $this->ctrl->returnToParent($this);
852 }
Class ilPCContentInclude.
Class ilPCMediaObject.
$type

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

+ Here is the call graph for this function:

◆ paste()

ilPageEditorGUI::paste (   $a_hier_id)

paste from clipboard (redirects to clipboard)

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

656 {
658 $this->page->pasteContents($a_hier_id, $this->page_gui->getPageConfig()->getEnableSelfAssessment());
659 include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
660 //ilEditClipboard::setAction("");
661 $this->ctrl->returnToParent($this);
662 }

References $ctrl, and $ilCtrl.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ pasteFromClipboard()

ilPageEditorGUI::pasteFromClipboard (   $a_hier_id)

paste from clipboard (redirects to clipboard)

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

803 {
805 //var_dump($a_hier_id);
806 $ilCtrl->setParameter($this, "hier_id", $a_hier_id);
807 $ilCtrl->setParameterByClass(
808 "ilEditClipboardGUI",
809 "returnCommand",
810 rawurlencode($ilCtrl->getLinkTarget(
811 $this,
812 "insertFromClipboard",
813 "",
814 false,
815 false
816 ))
817 );
818 //echo ":".$ilCtrl->getLinkTarget($this, "insertFromClipboard").":";
819 $ilCtrl->redirectByClass("ilEditClipboardGUI", "getObject");
820 }

References $ctrl, and $ilCtrl.

Referenced by executeCommand().

+ 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.

107 {
108 $this->header = $a_header;
109 }

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

491 {
493
494 $ilUser->writePref("ilPageEditor_MediaMode", $_POST["media_mode"]);
495 $ilUser->writePref("ilPageEditor_HTMLMode", $_POST["html_mode"]);
496 if ($ilUser->getPref("ilPageEditor_JavaScript") != $_POST["js_mode"]) {
497 // not nice, should be solved differently in the future
498 if ($this->page->getParentType() == "lm") {
499 $this->ctrl->setParameterByClass("illmpageobjectgui", "reloadTree", "y");
500 }
501 }
502 $ilUser->writePref("ilPageEditor_JavaScript", $_POST["js_mode"]);
503
504 // again not so nice...
505 if ($this->page->getParentType() == "lm") {
506 $this->ctrl->redirectByClass("illmpageobjectgui", "edit");
507 } else {
508 $this->ctrl->returnToParent($this);
509 }
510 }

References $_POST, $ilUser, and $user.

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

877 {
880 $ilAccess = $this->access;
882
883 $stpl = new ilTemplate("tpl.snippet_info.html", true, true, "Services/COPage");
884
885 include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
886 $mep_pools = ilMediaPoolItem::getPoolForItemId($_POST["ci_id"]);
887 foreach ($mep_pools as $mep_id) {
888 $ref_ids = ilObject::_getAllReferences($mep_id);
889 $edit_link = false;
890 foreach ($ref_ids as $rid) {
891 if (!$edit_link && $ilAccess->checkAccess("write", "", $rid)) {
892 $stpl->setCurrentBlock("edit_link");
893 $stpl->setVariable("TXT_EDIT", $lng->txt("edit"));
894 $stpl->setVariable(
895 "HREF_EDIT",
896 "./goto.php?target=mep_" . $rid
897 );
898 $stpl->parseCurrentBlock();
899 }
900 }
901 $stpl->setCurrentBlock("pool");
902 $stpl->setVariable("TXT_MEDIA_POOL", $lng->txt("obj_mep"));
903 $stpl->setVariable("VAL_MEDIA_POOL", ilObject::_lookupTitle($mep_id));
904 $stpl->parseCurrentBlock();
905 }
906
907 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
908 $stpl->setVariable("TXT_TITLE", $lng->txt("title"));
909 $stpl->setVariable("VAL_TITLE", ilMediaPoolPage::lookupTitle($_POST["ci_id"]));
910 $stpl->setVariable("TXT_BACK", $lng->txt("back"));
911 $stpl->setVariable(
912 "HREF_BACK",
913 $ilCtrl->getLinkTarget($this->page_gui, "edit")
914 );
915 $tpl->setContent($stpl->get());
916 }
static getPoolForItemId($a_id)
Get media pools for item id.
static lookupTitle($a_page_id)
Lookup title.
static _getAllReferences($a_id)
get all reference ids of object
special template class to simplify handling of ITX/PEAR

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

+ 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: