ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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

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

Protected Attributes

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

59 {
60 global $ilias, $tpl, $lng, $objDefinition, $ilCtrl,$ilTabs;
61
62 $this->log = ilLoggerFactory::getLogger('copg');
63
64 // initiate variables
65 $this->ilias = $ilias;
66 $this->ctrl = $ilCtrl;
67 $this->tpl = $tpl;
68 $this->lng = $lng;
69 $this->objDefinition = $objDefinition;
70 $this->tabs_gui = $ilTabs;
71 $this->page = $a_page_object;
72 $this->page_gui = $a_page_object_gui;
73
74 $this->ctrl->saveParameter($this, array("hier_id", "pc_id"));
75 }
static getLogger($a_component_id)
Get component logger.
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file)

References $ilCtrl, $ilias, $lng, $objDefinition, $tpl, and ilLoggerFactory\getLogger().

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

464 {
465 global $ilUser;
466
467 if ($ilUser->getPref("ilPageEditor_JavaScript") != "disable"
469 {
470 return true;
471 }
472 return false;
473 }
static _isBrowserJSEditCapable()
checks wether browser is javascript editing capable
$ilUser
Definition: imgupload.php:18

References $ilUser, and _isBrowserJSEditCapable().

Referenced by ilInternalLinkGUI\_doJSEditing(), 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 478 of file class.ilPageEditorGUI.php.

479 {
480 return true;
481 }

Referenced by _doJSEditing().

+ Here is the caller graph for this function:

◆ activatePage()

ilPageEditorGUI::activatePage ( )

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

484 {
485 $this->page_gui->activatePage();
486 }

◆ activateSelected()

ilPageEditorGUI::activateSelected ( )

(de-)activate selected items

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

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

References $_POST, and $_SESSION.

◆ addChangeComment()

ilPageEditorGUI::addChangeComment ( )

add change comment to history

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

550 {
551 include_once("./Services/History/classes/class.ilHistory.php");
552 ilHistory::_createEntry($this->page->getId(), "update",
553 "", $this->page->getParentType().":pg",
554 ilUtil::stripSlashes($_POST["change_comment"]), true);
555 ilUtil::sendSuccess($this->lng->txt("cont_added_comment"), true);
556 $this->ctrl->returnToParent($this);
557 }
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 sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

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

+ Here is the call graph for this function:

◆ assignCharacteristic()

ilPageEditorGUI::assignCharacteristic ( )

Assign characteristic.

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

800 {
801 $char_par = ilUtil::stripSlashes($_POST["char_par"]);
802 $char_sec = ilUtil::stripSlashes($_POST["char_sec"]);
803 if (is_array($_POST["target"]))
804 {
805 foreach ($_POST["target"] as $t)
806 {
807 $tarr = explode(":", $t);
808 $cont_obj = $this->page->getContentObject($tarr[0], $tarr[1]);
809 if (is_object($cont_obj) && $cont_obj->getType() == "par")
810 {
811 $cont_obj->setCharacteristic($char_par);
812 }
813 if (is_object($cont_obj) && $cont_obj->getType() == "sec")
814 {
815 $cont_obj->setCharacteristic($char_sec);
816 }
817 }
818 $updated = $this->page->update();
819 if($updated !== true)
820 {
821 $_SESSION["il_pg_error"] = $updated;
822 }
823 else
824 {
825 unset($_SESSION["il_pg_error"]);
826 }
827 }
828 $this->ctrl->returnToParent($this);
829 }

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

+ Here is the call graph for this function:

◆ assignCharacteristicForm()

ilPageEditorGUI::assignCharacteristicForm ( )

Assign characeristic to text blocks/sections.

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

708 {
709 global $tpl, $lng;
710
711 if (is_int(strpos($_POST["target"][0], ";")))
712 {
713 $_POST["target"] = explode(";", $_POST["target"][0]);
714 }
715 if (is_array($_POST["target"]))
716 {
717 $types = array();
718
719 // check what content element types have been selected
720 foreach ($_POST["target"] as $t)
721 {
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 {
726 $types["par"] = "par";
727 }
728 if (is_object($cont_obj) && $cont_obj->getType() == "sec")
729 {
730 $types["sec"] = "sec";
731 }
732 }
733
734 if (count($types) == 0)
735 {
736 ilUtil::sendFailure($lng->txt("cont_select_par_or_section"), true);
737 $this->ctrl->returnToParent($this);
738 }
739 else
740 {
741 $this->initCharacteristicForm($_POST["target"], $types);
742 $tpl->setContent($this->form->getHTML());
743 }
744 }
745 else
746 {
747 $this->ctrl->returnToParent($this);
748 }
749 }
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, $t, $tpl, initCharacteristicForm(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ cancelDeleteSelected()

ilPageEditorGUI::cancelDeleteSelected ( )

Cancel deletion.

Parameters

return

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

594 {
595 $this->ctrl->returnToParent($this);
596 }

◆ confirmedDeleteSelected()

ilPageEditorGUI::confirmedDeleteSelected ( )

Delete selected items.

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

603 {
604 $targets = explode(";", $_POST["target"]);
605 if (count($targets) > 0)
606 {
607 $updated = $this->page->deleteContents($targets, true,
608 $this->page_gui->getPageConfig()->getEnableSelfAssessment());
609 if($updated !== true)
610 {
611 $_SESSION["il_pg_error"] = $updated;
612 }
613 else
614 {
615 unset($_SESSION["il_pg_error"]);
616 }
617 }
618 $this->ctrl->returnToParent($this);
619 }

References $_POST, and $_SESSION.

◆ copyLinkedMediaToClipboard()

ilPageEditorGUI::copyLinkedMediaToClipboard ( )

copy linked media object to clipboard

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

527 {
528 global $ilUser;
529
530 ilUtil::sendSuccess($this->lng->txt("copied_to_clipboard"), true);
531 $ilUser->addObjectToClipboard($_POST["mob_id"], "mob", ilObject::_lookupTitle($_POST["mob_id"]));
532 $this->ctrl->returnToParent($this);
533 }
static _lookupTitle($a_id)
lookup object title

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

+ Here is the call graph for this function:

◆ copyLinkedMediaToMediaPool()

ilPageEditorGUI::copyLinkedMediaToMediaPool ( )

copy linked media object to media pool

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

539 {
540 global $ilUser;
541
542 $this->ctrl->setParameterByClass("ilmediapooltargetselector", "mob_id", $_POST["mob_id"]);
543 $this->ctrl->redirectByClass("ilmediapooltargetselector", "listPools");
544 }

References $_POST, and $ilUser.

◆ copySelected()

ilPageEditorGUI::copySelected ( )

Copy selected items.

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

625 {
626 global $lng;
627
628 if (is_int(strpos($_POST["target"][0], ";")))
629 {
630 $_POST["target"] = explode(";", $_POST["target"][0]);
631 }
632 if (is_array($_POST["target"]))
633 {
634 $this->page->copyContents($_POST["target"]);
635 ilUtil::sendSuccess($lng->txt("cont_sel_el_copied_use_paste"), true);
636 }
637 $this->ctrl->returnToParent($this);
638 }

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

+ Here is the call graph for this function:

◆ cutSelected()

ilPageEditorGUI::cutSelected ( )

Cut selected items.

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

644 {
645 global $lng;
646
647 if (is_int(strpos($_POST["target"][0], ";")))
648 {
649 $_POST["target"] = explode(";", $_POST["target"][0]);
650 }
651 if (is_array($_POST["target"]))
652 {
653 $updated = $this->page->cutContents($_POST["target"]);
654 if($updated !== true)
655 {
656 $_SESSION["il_pg_error"] = $updated;
657 }
658 else
659 {
660 unset($_SESSION["il_pg_error"]);
661 }
662 ilUtil::sendSuccess($lng->txt("cont_sel_el_cut_use_paste"), true);
663 }
664 $this->ctrl->returnToParent($this);
665 }

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

+ Here is the call graph for this function:

◆ deactivatePage()

ilPageEditorGUI::deactivatePage ( )

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

489 {
490 $this->page_gui->deactivatePage();
491 }

◆ deleteSelected()

ilPageEditorGUI::deleteSelected ( )

Confirm.

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

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

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

+ Here is the call graph for this function:

◆ displayLocator()

ilPageEditorGUI::displayLocator ( )

display locator

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

894 {
895 if(is_object($this->locator))
896 {
897 $this->locator->display();
898 }
899 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ displayPage()

ilPageEditorGUI::displayPage ( )

Default for POST reloads and missing.

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

886 {
887 $this->ctrl->returnToParent($this);
888 }

◆ executeCommand()

ilPageEditorGUI::executeCommand ( )

execute command

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

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

References $_GET, $_POST, $cmd, $cont_obj, $ilCtrl, $ret, ilObject\_lookupTitle(), displayLocator(), exit, 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 93 of file class.ilPageEditorGUI.php.

94 {
95 return $this->header;
96 }

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

755 {
756 global $ilCtrl, $lng;
757
758
759 // edit form
760 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
761 $this->form = new ilPropertyFormGUI();
762 $this->form->setTitle($this->lng->txt("cont_choose_characteristic"));
763
764 if ($a_types["par"] == "par")
765 {
766 $select_prop = new ilSelectInputGUI($this->lng->txt("cont_choose_characteristic_text"),
767 "char_par");
768 include_once("./Services/COPage/classes/class.ilPCParagraphGUI.php");
769 $options = ilPCParagraphGUI::_getCharacteristics($this->page_gui->getStyleId());
770 $select_prop->setOptions($options);
771 $this->form->addItem($select_prop);
772 }
773 if ($a_types["sec"] == "sec")
774 {
775 $select_prop = new ilSelectInputGUI($this->lng->txt("cont_choose_characteristic_section"),
776 "char_sec");
777 include_once("./Services/COPage/classes/class.ilPCSectionGUI.php");
778 $options = ilPCSectionGUI::_getCharacteristics($this->page_gui->getStyleId());
779 $select_prop->setOptions($options);
780 $this->form->addItem($select_prop);
781 }
782
783 foreach ($a_target as $t)
784 {
785 $hidden = new ilHiddenInputGUI("target[]");
786 $hidden->setValue($t);
787 $this->form->addItem($hidden);
788 }
789
790 $this->form->setFormAction($ilCtrl->getFormAction($this));
791 $this->form->addCommandButton("assignCharacteristic", $lng->txt("save"));
792 $this->form->addCommandButton("showPage", $lng->txt("cancel"));
793
794 }
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.
if(!is_array($argv)) $options

References $ilCtrl, $lng, $options, $t, 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 849 of file class.ilPageEditorGUI.php.

850 {
851 include_once("./Services/Clipboard/classes/class.ilEditClipboardGUI.php");
853 include_once ("./Services/COPage/classes/class.ilPCMediaObject.php");
854 if ($ids != "")
855 {
856 foreach ($ids as $id2)
857 {
858 $id = explode(":", $id2);
859 $type = $id[0];
860 $id = $id[1];
861 if ($type == "mob")
862 {
863 $this->content_obj = new ilPCMediaObject($this->page);
864 $this->content_obj->readMediaObject($id);
865 $this->content_obj->createAlias($this->page, $_GET["hier_id"]);
866 $this->updated = $this->page->update();
867 }
868 if ($type == "incl")
869 {
870 include_once("./Services/COPage/classes/class.ilPCContentInclude.php");
871 $this->content_obj = new ilPCContentInclude($this->page);
872 $this->content_obj->create($this->page, $_GET["hier_id"]);
873 $this->content_obj->setContentType("mep");
874 $this->content_obj->setContentId($id);
875 $this->updated = $this->page->update();
876 }
877 }
878 }
879 $this->ctrl->returnToParent($this);
880 }
Class ilPCContentInclude.
Class ilPCMediaObject.

References $_GET, 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 670 of file class.ilPageEditorGUI.php.

671 {
672 global $ilCtrl;
673 $this->page->pasteContents($a_hier_id, $this->page_gui->getPageConfig()->getEnableSelfAssessment());
674 include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
676 $this->ctrl->returnToParent($this);
677 }
static setAction($a_action)

References $ilCtrl, and ilEditClipboard\setAction().

Referenced by executeCommand().

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

◆ pasteFromClipboard()

ilPageEditorGUI::pasteFromClipboard (   $a_hier_id)

paste from clipboard (redirects to clipboard)

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

835 {
836 global $ilCtrl;
837//var_dump($a_hier_id);
838 $ilCtrl->setParameter($this, "hier_id", $a_hier_id);
839 $ilCtrl->setParameterByClass("ilEditClipboardGUI", "returnCommand",
840 rawurlencode($ilCtrl->getLinkTarget($this,
841 "insertFromClipboard", "", false, false)));
842//echo ":".$ilCtrl->getLinkTarget($this, "insertFromClipboard").":";
843 $ilCtrl->redirectByClass("ilEditClipboardGUI", "getObject");
844 }

References $ilCtrl.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ returnToContext()

ilPageEditorGUI::returnToContext ( )

redirect to parent context

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

112 {
113 $this->ctrl->returnToParent($this);
114 }

◆ setHeader()

ilPageEditorGUI::setHeader (   $a_header)

set header title

Parameters
string$a_headerheader title

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

84 {
85 $this->header = $a_header;
86 }

◆ setIntLinkReturn()

ilPageEditorGUI::setIntLinkReturn (   $a_return)

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

117 {
118 $this->int_link_return = $a_return;
119 }

◆ setLocator()

ilPageEditorGUI::setLocator ( $a_locator)

set locator object

Parameters
object$a_locatorlocator object

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

104 {
105 $this->locator = $a_locator;
106 }

◆ setMediaMode()

ilPageEditorGUI::setMediaMode ( )

set media and editing mode

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

497 {
498 global $ilUser, $ilias;
499
500 $ilUser->writePref("ilPageEditor_MediaMode", $_POST["media_mode"]);
501 $ilUser->writePref("ilPageEditor_HTMLMode", $_POST["html_mode"]);
502 if ($ilUser->getPref("ilPageEditor_JavaScript") != $_POST["js_mode"])
503 {
504 // not nice, should be solved differently in the future
505 if ($this->page->getParentType() == "lm")
506 {
507 $this->ctrl->setParameterByClass("illmpageobjectgui", "reloadTree", "y");
508 }
509 }
510 $ilUser->writePref("ilPageEditor_JavaScript", $_POST["js_mode"]);
511
512 // again not so nice...
513 if ($this->page->getParentType() == "lm")
514 {
515 $this->ctrl->redirectByClass("illmpageobjectgui", "edit");
516 }
517 else
518 {
519 $this->ctrl->returnToParent($this);
520 }
521 }

References $_POST, $ilias, and $ilUser.

◆ setPageBackTitle()

ilPageEditorGUI::setPageBackTitle (   $a_title)

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

123 {
124 $this->page_back_title = $a_title;
125 }

◆ showSnippetInfo()

ilPageEditorGUI::showSnippetInfo ( )

Show snippet info.

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

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

+ Here is the call graph for this function:

Field Documentation

◆ $cont_obj

ilPageEditorGUI::$cont_obj

◆ $ctrl

ilPageEditorGUI::$ctrl

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

◆ $enable_anchors

ilPageEditorGUI::$enable_anchors

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

◆ $enable_keywords

ilPageEditorGUI::$enable_keywords

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

◆ $header

ilPageEditorGUI::$header

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

Referenced by getHeader().

◆ $ilias

ilPageEditorGUI::$ilias

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

Referenced by __construct(), and setMediaMode().

◆ $lng

◆ $log

ilPageEditorGUI::$log
protected

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

◆ $objDefinition

ilPageEditorGUI::$objDefinition

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

Referenced by __construct().

◆ $page

ilPageEditorGUI::$page

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

◆ $return_location

ilPageEditorGUI::$return_location

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

◆ $tabs

ilPageEditorGUI::$tabs

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

◆ $target_script

ilPageEditorGUI::$target_script

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

◆ $tpl

ilPageEditorGUI::$tpl

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