ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
ilPageEditorGUI Class Reference

Page Editor GUI class. More...

+ Collaboration diagram for ilPageEditorGUI:

Public Member Functions

 ilPageEditorGUI (&$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...
 
 _doJSEditing ()
 checks if current user has activated js editing and if browser is js capable More...
 
 _isBrowserJSEditCapable ()
 checks wether browser is javascript editing capable 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 ()
 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...
 

Data Fields

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

Detailed Description

Member Function Documentation

◆ _doJSEditing()

ilPageEditorGUI::_doJSEditing ( )

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

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

447 {
448 global $ilUser, $ilias, $ilSetting;
449
450 if ($ilUser->getPref("ilPageEditor_JavaScript") != "disable"
452 {
453 return true;
454 }
455 return false;
456 }
_isBrowserJSEditCapable()
checks wether browser is javascript editing capable
global $ilSetting
Definition: privfeed.php:40
global $ilUser
Definition: imgupload.php:15

References $ilias, $ilSetting, $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()

ilPageEditorGUI::_isBrowserJSEditCapable ( )

checks wether browser is javascript editing capable

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

462 {
463 global $ilBrowser;
464return true;
465 $version = $ilBrowser->getVersion();
466
467 if ($ilBrowser->isFirefox() ||
468 ($ilBrowser->isIE() && !$ilBrowser->isMac()) ||
469 ($ilBrowser->isMozilla() && $version[0] >= 5))
470 {
471 return true;
472 }
473 return false;
474 }

Referenced by _doJSEditing().

+ Here is the caller graph for this function:

◆ activatePage()

ilPageEditorGUI::activatePage ( )

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

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

◆ activateSelected()

ilPageEditorGUI::activateSelected ( )

(de-)activate selected items

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

641 {
642 if (is_int(strpos($_POST["target"][0], ";")))
643 {
644 $_POST["target"] = explode(";", $_POST["target"][0]);
645 }
646 if (is_array($_POST["target"]))
647 {
648 $updated = $this->page->switchEnableMultiple($_POST["target"], true,
649 $this->page_gui->getPageConfig()->getEnableSelfAssessment());
650 if($updated !== true)
651 {
652 $_SESSION["il_pg_error"] = $updated;
653 }
654 else
655 {
656 unset($_SESSION["il_pg_error"]);
657 }
658 }
659 $this->ctrl->returnToParent($this);
660 }
$_POST['username']
Definition: cron.php:12
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']

References $_POST, and $_SESSION.

◆ addChangeComment()

ilPageEditorGUI::addChangeComment ( )

add change comment to history

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

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

758 {
759 $char_par = ilUtil::stripSlashes($_POST["char_par"]);
760 $char_sec = ilUtil::stripSlashes($_POST["char_sec"]);
761 if (is_array($_POST["target"]))
762 {
763 foreach ($_POST["target"] as $t)
764 {
765 $tarr = explode(":", $t);
766 $cont_obj =& $this->page->getContentObject($tarr[0], $tarr[1]);
767 if (is_object($cont_obj) && $cont_obj->getType() == "par")
768 {
769 $cont_obj->setCharacteristic($char_par);
770 }
771 if (is_object($cont_obj) && $cont_obj->getType() == "sec")
772 {
773 $cont_obj->setCharacteristic($char_sec);
774 }
775 }
776 $updated = $this->page->update();
777 if($updated !== true)
778 {
779 $_SESSION["il_pg_error"] = $updated;
780 }
781 else
782 {
783 unset($_SESSION["il_pg_error"]);
784 }
785 }
786 $this->ctrl->returnToParent($this);
787 }

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

666 {
667 global $tpl, $lng;
668
669 if (is_int(strpos($_POST["target"][0], ";")))
670 {
671 $_POST["target"] = explode(";", $_POST["target"][0]);
672 }
673 if (is_array($_POST["target"]))
674 {
675 $types = array();
676
677 // check what content element types have been selected
678 foreach ($_POST["target"] as $t)
679 {
680 $tarr = explode(":", $t);
681 $cont_obj =& $this->page->getContentObject($tarr[0], $tarr[1]);
682 if (is_object($cont_obj) && $cont_obj->getType() == "par")
683 {
684 $types["par"] = "par";
685 }
686 if (is_object($cont_obj) && $cont_obj->getType() == "sec")
687 {
688 $types["sec"] = "sec";
689 }
690 }
691
692 if (count($types) == 0)
693 {
694 ilUtil::sendFailure($lng->txt("cont_select_par_or_section"), true);
695 $this->ctrl->returnToParent($this);
696 }
697 else
698 {
699 $this->initCharacteristicForm($_POST["target"], $types);
700 $tpl->setContent($this->form->getHTML());
701 }
702 }
703 else
704 {
705 $this->ctrl->returnToParent($this);
706 }
707 }
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:

◆ copyLinkedMediaToClipboard()

ilPageEditorGUI::copyLinkedMediaToClipboard ( )

copy linked media object to clipboard

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

522 {
523 global $ilUser;
524
525 ilUtil::sendSuccess($this->lng->txt("copied_to_clipboard"), true);
526 $ilUser->addObjectToClipboard($_POST["mob_id"], "mob", ilObject::_lookupTitle($_POST["mob_id"]));
527 $this->ctrl->returnToParent($this);
528 }
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 533 of file class.ilPageEditorGUI.php.

534 {
535 global $ilUser;
536
537 $this->ctrl->setParameterByClass("ilmediapooltargetselector", "mob_id", $_POST["mob_id"]);
538 $this->ctrl->redirectByClass("ilmediapooltargetselector", "listPools");
539 }

References $_POST, and $ilUser.

◆ copySelected()

ilPageEditorGUI::copySelected ( )

Copy selected items.

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

583 {
584 global $lng;
585
586 if (is_int(strpos($_POST["target"][0], ";")))
587 {
588 $_POST["target"] = explode(";", $_POST["target"][0]);
589 }
590 if (is_array($_POST["target"]))
591 {
592 $this->page->copyContents($_POST["target"]);
593 ilUtil::sendSuccess($lng->txt("cont_sel_el_copied_use_paste"), true);
594 }
595 $this->ctrl->returnToParent($this);
596 }

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

+ Here is the call graph for this function:

◆ cutSelected()

ilPageEditorGUI::cutSelected ( )

Cut selected items.

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

602 {
603 global $lng;
604
605 if (is_int(strpos($_POST["target"][0], ";")))
606 {
607 $_POST["target"] = explode(";", $_POST["target"][0]);
608 }
609 if (is_array($_POST["target"]))
610 {
611 $updated = $this->page->cutContents($_POST["target"]);
612 if($updated !== true)
613 {
614 $_SESSION["il_pg_error"] = $updated;
615 }
616 else
617 {
618 unset($_SESSION["il_pg_error"]);
619 }
620 ilUtil::sendSuccess($lng->txt("cont_sel_el_cut_use_paste"), true);
621 }
622 $this->ctrl->returnToParent($this);
623 }

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

+ Here is the call graph for this function:

◆ deactivatePage()

ilPageEditorGUI::deactivatePage ( )

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

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

◆ deleteSelected()

ilPageEditorGUI::deleteSelected ( )

Delete selected items.

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

558 {
559 if (is_int(strpos($_POST["target"][0], ";")))
560 {
561 $_POST["target"] = explode(";", $_POST["target"][0]);
562 }
563 if (is_array($_POST["target"]))
564 {
565 $updated = $this->page->deleteContents($_POST["target"], true,
566 $this->page_gui->getPageConfig()->getEnableSelfAssessment());
567 if($updated !== true)
568 {
569 $_SESSION["il_pg_error"] = $updated;
570 }
571 else
572 {
573 unset($_SESSION["il_pg_error"]);
574 }
575 }
576 $this->ctrl->returnToParent($this);
577 }

References $_POST, and $_SESSION.

◆ displayLocator()

ilPageEditorGUI::displayLocator ( )

display locator

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

852 {
853 if(is_object($this->locator))
854 {
855 $this->locator->display();
856 }
857 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ displayPage()

ilPageEditorGUI::displayPage ( )

Default for POST reloads and missing.

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

844 {
845 $this->ctrl->returnToParent($this);
846 }

◆ executeCommand()

& ilPageEditorGUI::executeCommand ( )

execute command

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

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

87 {
88 return $this->header;
89 }

References $header.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ ilPageEditorGUI()

ilPageEditorGUI::ilPageEditorGUI ( $a_page_object,
$a_page_object_gui 
)

Constructor.

Parameters
object$a_page_objectpage object @access public

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

54 {
55 global $ilias, $tpl, $lng, $objDefinition, $ilCtrl,$ilTabs;
56
57 // initiate variables
58 $this->ilias =& $ilias;
59 $this->ctrl =& $ilCtrl;
60 $this->tpl =& $tpl;
61 $this->lng =& $lng;
62 $this->objDefinition = $objDefinition;
63 $this->tabs_gui =& $ilTabs;
64 $this->page =& $a_page_object;
65 $this->page_gui =& $a_page_object_gui;
66
67 $this->ctrl->saveParameter($this, array("hier_id", "pc_id"));
68 }
redirection script todo: (a better solution should control the processing via a xml file)

References $ilCtrl, $ilias, $lng, $objDefinition, and $tpl.

◆ initCharacteristicForm()

ilPageEditorGUI::initCharacteristicForm (   $a_target,
  $a_types 
)

Init map creation/update form.

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

713 {
714 global $ilCtrl, $lng;
715
716
717 // edit form
718 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
719 $this->form = new ilPropertyFormGUI();
720 $this->form->setTitle($this->lng->txt("cont_choose_characteristic"));
721
722 if ($a_types["par"] == "par")
723 {
724 $select_prop = new ilSelectInputGUI($this->lng->txt("cont_choose_characteristic_text"),
725 "char_par");
726 include_once("./Services/COPage/classes/class.ilPCParagraphGUI.php");
727 $options = ilPCParagraphGUI::_getCharacteristics($this->page_gui->getStyleId());
728 $select_prop->setOptions($options);
729 $this->form->addItem($select_prop);
730 }
731 if ($a_types["sec"] == "sec")
732 {
733 $select_prop = new ilSelectInputGUI($this->lng->txt("cont_choose_characteristic_section"),
734 "char_sec");
735 include_once("./Services/COPage/classes/class.ilPCSectionGUI.php");
736 $options = ilPCSectionGUI::_getCharacteristics($this->page_gui->getStyleId());
737 $select_prop->setOptions($options);
738 $this->form->addItem($select_prop);
739 }
740
741 foreach ($a_target as $t)
742 {
743 $hidden = new ilHiddenInputGUI("target[]");
744 $hidden->setValue($t);
745 $this->form->addItem($hidden);
746 }
747
748 $this->form->setFormAction($ilCtrl->getFormAction($this));
749 $this->form->addCommandButton("assignCharacteristic", $lng->txt("save"));
750 $this->form->addCommandButton("showPage", $lng->txt("cancel"));
751
752 }
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 807 of file class.ilPageEditorGUI.php.

808 {
809 include_once("./Services/Clipboard/classes/class.ilEditClipboardGUI.php");
811 include_once ("./Services/COPage/classes/class.ilPCMediaObject.php");
812 if ($ids != "")
813 {
814 foreach ($ids as $id2)
815 {
816 $id = explode(":", $id2);
817 $type = $id[0];
818 $id = $id[1];
819 if ($type == "mob")
820 {
821 $this->content_obj = new ilPCMediaObject($this->page);
822 $this->content_obj->readMediaObject($id);
823 $this->content_obj->createAlias($this->page, $_GET["hier_id"]);
824 $this->updated = $this->page->update();
825 }
826 if ($type == "incl")
827 {
828 include_once("./Services/COPage/classes/class.ilPCContentInclude.php");
829 $this->content_obj = new ilPCContentInclude($this->page);
830 $this->content_obj->create($this->page, $_GET["hier_id"]);
831 $this->content_obj->setContentType("mep");
832 $this->content_obj->setContentId($id);
833 $this->updated = $this->page->update();
834 }
835 }
836 }
837 $this->ctrl->returnToParent($this);
838 }
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 628 of file class.ilPageEditorGUI.php.

629 {
630 global $ilCtrl;
631 $this->page->pasteContents($a_hier_id, $this->page_gui->getPageConfig()->getEnableSelfAssessment());
632 include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
634 $this->ctrl->returnToParent($this);
635 }

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

793 {
794 global $ilCtrl;
795//var_dump($a_hier_id);
796 $ilCtrl->setParameter($this, "hier_id", $a_hier_id);
797 $ilCtrl->setParameterByClass("ilEditClipboardGUI", "returnCommand",
798 rawurlencode($ilCtrl->getLinkTarget($this,
799 "insertFromClipboard", "", false, false)));
800//echo ":".$ilCtrl->getLinkTarget($this, "insertFromClipboard").":";
801 $ilCtrl->redirectByClass("ilEditClipboardGUI", "getObject");
802 }

References $ilCtrl.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ returnToContext()

ilPageEditorGUI::returnToContext ( )

redirect to parent context

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

105 {
106 $this->ctrl->returnToParent($this);
107 }

◆ setHeader()

ilPageEditorGUI::setHeader (   $a_header)

set header title

Parameters
string$a_headerheader title

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

77 {
78 $this->header = $a_header;
79 }

◆ setIntLinkReturn()

ilPageEditorGUI::setIntLinkReturn (   $a_return)

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

110 {
111 $this->int_link_return = $a_return;
112 }

◆ setLocator()

ilPageEditorGUI::setLocator ( $a_locator)

set locator object

Parameters
object$a_locatorlocator object

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

97 {
98 $this->locator =& $a_locator;
99 }

◆ setMediaMode()

ilPageEditorGUI::setMediaMode ( )

set media and editing mode

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

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

References $_POST, $ilias, and $ilUser.

◆ setPageBackTitle()

ilPageEditorGUI::setPageBackTitle (   $a_title)

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

116 {
117 $this->page_back_title = $a_title;
118 }

◆ showSnippetInfo()

ilPageEditorGUI::showSnippetInfo ( )

Show snippet info.

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

863 {
864 global $tpl, $lng, $ilAccess, $ilCtrl;
865
866 $stpl = new ilTemplate("tpl.snippet_info.html", true, true, "Services/COPage");
867
868 include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
869 $mep_pools = ilMediaPoolItem::getPoolForItemId($_POST["ci_id"]);
870 foreach ($mep_pools as $mep_id)
871 {
872 $ref_ids = ilObject::_getAllReferences($mep_id);
873 $edit_link = false;
874 foreach ($ref_ids as $rid)
875 {
876 if (!$edit_link && $ilAccess->checkAccess("write", "", $rid))
877 {
878 $stpl->setCurrentBlock("edit_link");
879 $stpl->setVariable("TXT_EDIT", $lng->txt("edit"));
880 $stpl->setVariable("HREF_EDIT",
881 "./goto.php?target=mep_".$rid);
882 $stpl->parseCurrentBlock();
883 }
884 }
885 $stpl->setCurrentBlock("pool");
886 $stpl->setVariable("TXT_MEDIA_POOL", $lng->txt("obj_mep"));
887 $stpl->setVariable("VAL_MEDIA_POOL", ilObject::_lookupTitle($mep_id));
888 $stpl->parseCurrentBlock();
889 }
890
891 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
892 $stpl->setVariable("TXT_TITLE", $lng->txt("title"));
893 $stpl->setVariable("VAL_TITLE", ilMediaPoolPage::lookupTitle($_POST["ci_id"]));
894 $stpl->setVariable("TXT_BACK", $lng->txt("back"));
895 $stpl->setVariable("HREF_BACK",
896 $ilCtrl->getLinkTarget($this->page_gui, "edit"));
897 $tpl->setContent($stpl->get());
898 }
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 _doJSEditing(), ilPageEditorGUI(), and setMediaMode().

◆ $lng

◆ $objDefinition

ilPageEditorGUI::$objDefinition

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

Referenced by ilPageEditorGUI().

◆ $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: