ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
 

Protected Attributes

 $log
 

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

References $ilias, $ilSetting, $ilUser, and _isBrowserJSEditCapable().

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

461  {
462  global $ilUser, $ilias, $ilSetting;
463 
464  if ($ilUser->getPref("ilPageEditor_JavaScript") != "disable"
466  {
467  return true;
468  }
469  return false;
470  }
_isBrowserJSEditCapable()
checks wether browser is javascript editing capable
global $ilUser
Definition: imgupload.php:15
global $ilSetting
Definition: privfeed.php:40
+ 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 475 of file class.ilPageEditorGUI.php.

Referenced by _doJSEditing().

476  {
477  global $ilBrowser;
478 return true;
479  $version = $ilBrowser->getVersion();
480 
481  if ($ilBrowser->isFirefox() ||
482  ($ilBrowser->isIE() && !$ilBrowser->isMac()) ||
483  ($ilBrowser->isMozilla() && $version[0] >= 5))
484  {
485  return true;
486  }
487  return false;
488  }
+ Here is the caller graph for this function:

◆ activatePage()

ilPageEditorGUI::activatePage ( )

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

491  {
492  $this->page_gui->activatePage();
493  }

◆ activateSelected()

ilPageEditorGUI::activateSelected ( )

(de-)activate selected items

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

References $_POST, and $_SESSION.

655  {
656  if (is_int(strpos($_POST["target"][0], ";")))
657  {
658  $_POST["target"] = explode(";", $_POST["target"][0]);
659  }
660  if (is_array($_POST["target"]))
661  {
662  $updated = $this->page->switchEnableMultiple($_POST["target"], true,
663  $this->page_gui->getPageConfig()->getEnableSelfAssessment());
664  if($updated !== true)
665  {
666  $_SESSION["il_pg_error"] = $updated;
667  }
668  else
669  {
670  unset($_SESSION["il_pg_error"]);
671  }
672  }
673  $this->ctrl->returnToParent($this);
674  }
$_POST['username']
Definition: cron.php:12
$_SESSION["AccountId"]

◆ addChangeComment()

ilPageEditorGUI::addChangeComment ( )

add change comment to history

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

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

559  {
560  include_once("./Services/History/classes/class.ilHistory.php");
561  ilHistory::_createEntry($this->page->getId(), "update",
562  "", $this->page->getParentType().":pg",
563  ilUtil::stripSlashes($_POST["change_comment"]), true);
564  ilUtil::sendSuccess($this->lng->txt("cont_added_comment"), true);
565  $this->ctrl->returnToParent($this);
566  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
_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
+ Here is the call graph for this function:

◆ assignCharacteristic()

ilPageEditorGUI::assignCharacteristic ( )

Assign characteristic.

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

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

772  {
773  $char_par = ilUtil::stripSlashes($_POST["char_par"]);
774  $char_sec = ilUtil::stripSlashes($_POST["char_sec"]);
775  if (is_array($_POST["target"]))
776  {
777  foreach ($_POST["target"] as $t)
778  {
779  $tarr = explode(":", $t);
780  $cont_obj =& $this->page->getContentObject($tarr[0], $tarr[1]);
781  if (is_object($cont_obj) && $cont_obj->getType() == "par")
782  {
783  $cont_obj->setCharacteristic($char_par);
784  }
785  if (is_object($cont_obj) && $cont_obj->getType() == "sec")
786  {
787  $cont_obj->setCharacteristic($char_sec);
788  }
789  }
790  $updated = $this->page->update();
791  if($updated !== true)
792  {
793  $_SESSION["il_pg_error"] = $updated;
794  }
795  else
796  {
797  unset($_SESSION["il_pg_error"]);
798  }
799  }
800  $this->ctrl->returnToParent($this);
801  }
$_POST['username']
Definition: cron.php:12
$_SESSION["AccountId"]
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
+ Here is the call graph for this function:

◆ assignCharacteristicForm()

ilPageEditorGUI::assignCharacteristicForm ( )

Assign characeristic to text blocks/sections.

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

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

680  {
681  global $tpl, $lng;
682 
683  if (is_int(strpos($_POST["target"][0], ";")))
684  {
685  $_POST["target"] = explode(";", $_POST["target"][0]);
686  }
687  if (is_array($_POST["target"]))
688  {
689  $types = array();
690 
691  // check what content element types have been selected
692  foreach ($_POST["target"] as $t)
693  {
694  $tarr = explode(":", $t);
695  $cont_obj =& $this->page->getContentObject($tarr[0], $tarr[1]);
696  if (is_object($cont_obj) && $cont_obj->getType() == "par")
697  {
698  $types["par"] = "par";
699  }
700  if (is_object($cont_obj) && $cont_obj->getType() == "sec")
701  {
702  $types["sec"] = "sec";
703  }
704  }
705 
706  if (count($types) == 0)
707  {
708  ilUtil::sendFailure($lng->txt("cont_select_par_or_section"), true);
709  $this->ctrl->returnToParent($this);
710  }
711  else
712  {
713  $this->initCharacteristicForm($_POST["target"], $types);
714  $tpl->setContent($this->form->getHTML());
715  }
716  }
717  else
718  {
719  $this->ctrl->returnToParent($this);
720  }
721  }
$_POST['username']
Definition: cron.php:12
initCharacteristicForm($a_target, $a_types)
Init map creation/update form.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ copyLinkedMediaToClipboard()

ilPageEditorGUI::copyLinkedMediaToClipboard ( )

copy linked media object to clipboard

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

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

536  {
537  global $ilUser;
538 
539  ilUtil::sendSuccess($this->lng->txt("copied_to_clipboard"), true);
540  $ilUser->addObjectToClipboard($_POST["mob_id"], "mob", ilObject::_lookupTitle($_POST["mob_id"]));
541  $this->ctrl->returnToParent($this);
542  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
static _lookupTitle($a_id)
lookup object title
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ copyLinkedMediaToMediaPool()

ilPageEditorGUI::copyLinkedMediaToMediaPool ( )

copy linked media object to media pool

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

References $_POST, and $ilUser.

548  {
549  global $ilUser;
550 
551  $this->ctrl->setParameterByClass("ilmediapooltargetselector", "mob_id", $_POST["mob_id"]);
552  $this->ctrl->redirectByClass("ilmediapooltargetselector", "listPools");
553  }
$_POST['username']
Definition: cron.php:12
global $ilUser
Definition: imgupload.php:15

◆ copySelected()

ilPageEditorGUI::copySelected ( )

Copy selected items.

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

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

597  {
598  global $lng;
599 
600  if (is_int(strpos($_POST["target"][0], ";")))
601  {
602  $_POST["target"] = explode(";", $_POST["target"][0]);
603  }
604  if (is_array($_POST["target"]))
605  {
606  $this->page->copyContents($_POST["target"]);
607  ilUtil::sendSuccess($lng->txt("cont_sel_el_copied_use_paste"), true);
608  }
609  $this->ctrl->returnToParent($this);
610  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
+ Here is the call graph for this function:

◆ cutSelected()

ilPageEditorGUI::cutSelected ( )

Cut selected items.

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

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

616  {
617  global $lng;
618 
619  if (is_int(strpos($_POST["target"][0], ";")))
620  {
621  $_POST["target"] = explode(";", $_POST["target"][0]);
622  }
623  if (is_array($_POST["target"]))
624  {
625  $updated = $this->page->cutContents($_POST["target"]);
626  if($updated !== true)
627  {
628  $_SESSION["il_pg_error"] = $updated;
629  }
630  else
631  {
632  unset($_SESSION["il_pg_error"]);
633  }
634  ilUtil::sendSuccess($lng->txt("cont_sel_el_cut_use_paste"), true);
635  }
636  $this->ctrl->returnToParent($this);
637  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
$_SESSION["AccountId"]
+ Here is the call graph for this function:

◆ deactivatePage()

ilPageEditorGUI::deactivatePage ( )

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

496  {
497  $this->page_gui->deactivatePage();
498  }

◆ deleteSelected()

ilPageEditorGUI::deleteSelected ( )

Delete selected items.

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

References $_POST, and $_SESSION.

572  {
573  if (is_int(strpos($_POST["target"][0], ";")))
574  {
575  $_POST["target"] = explode(";", $_POST["target"][0]);
576  }
577  if (is_array($_POST["target"]))
578  {
579  $updated = $this->page->deleteContents($_POST["target"], true,
580  $this->page_gui->getPageConfig()->getEnableSelfAssessment());
581  if($updated !== true)
582  {
583  $_SESSION["il_pg_error"] = $updated;
584  }
585  else
586  {
587  unset($_SESSION["il_pg_error"]);
588  }
589  }
590  $this->ctrl->returnToParent($this);
591  }
$_POST['username']
Definition: cron.php:12
$_SESSION["AccountId"]

◆ displayLocator()

ilPageEditorGUI::displayLocator ( )

display locator

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

Referenced by executeCommand().

866  {
867  if(is_object($this->locator))
868  {
869  $this->locator->display();
870  }
871  }
+ 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 130 of file class.ilPageEditorGUI.php.

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

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  }
240 if (false)
241 {
242 var_dump($_POST);
243 var_dump($_GET);
244 echo ";$cmd;".$next_class.";";
245 echo "-$pc_id-";
246 echo "-$cmd-".$this->ctrl->getCmd()."-";
247 exit;
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 != "copySelected" && $cmd != "cutSelected" &&
259  ($cmd != "displayPage" || $_POST["editImagemapForward_x"] != "" || $_POST["imagemap_x"] != "") &&
260  ($cmd != "displayPage" || $_POST["editImagemapForward_x"] != "") &&
261  $cmd != "activateSelected" && $cmd != "assignCharacteristicForm" &&
262  $cmd != "assignCharacteristic" &&
263  $cmd != "cancelCreate" && $cmd != "popup" &&
264  $cmdClass != "ileditclipboardgui" && $cmd != "addChangeComment" &&
265  ($cmdClass != "ilinternallinkgui" || ($next_class == "ilpcmediaobjectgui")))
266  {
267  if ($_GET["pgEdMediaMode"] != "editLinkedMedia")
268  {
269 //$this->ctrl->debug("gettingContentObject (no linked media)");
270 //echo $hier_id."-".$pc_id;
271  $cont_obj =& $this->page->getContentObject($hier_id, $pc_id);
272  if (!is_object($cont_obj))
273  {
274  $this->log->debug("ilPageEditorGUI: ...returnToParent");
275  $ilCtrl->returnToParent($this);
276  }
277  $ctype = $cont_obj->getType();
278  }
279  }
280  }
281 
282 //$this->ctrl->debug("+ctype:".$ctype."+");
283 // $this->tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
284 // $this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
285 
286  if ($ctype != "media" || !is_object ($cont_obj))
287  {
288  if ($this->getHeader() != "")
289  {
290  $this->tpl->setTitle($this->getHeader());
291  }
292  $this->displayLocator();
293  }
294 
295  $this->cont_obj =& $cont_obj;
296 
297 
298  // special command / command class handling
299  $this->ctrl->setParameter($this, "hier_id", $hier_id);
300  $this->ctrl->setParameter($this, "pc_id", $pc_id);
301  $this->ctrl->setCmd($cmd);
302  //$next_class = $this->ctrl->getNextClass($this);
303 //$this->ctrl->debug("+next_class:".$next_class."+");
304 //echo("+next_class:".$next_class."+".$ctype."+"); exit;
305 
306  if ($next_class == "")
307  {
308  include_once("./Services/COPage/classes/class.ilCOPagePCDef.php");
309  $pc_def = ilCOPagePCDef::getPCDefinitionByType($ctype);
310  if (is_array($pc_def))
311  {
312  $this->ctrl->setCmdClass($pc_def["pc_gui_class"]);
313  }
314  $next_class = $this->ctrl->getNextClass($this);
315  }
316 
317  // do not do this while imagemap editing is ongoing
318  if ($cmd == "displayPage" && $_POST["editImagemapForward_x"] == "" && $_POST["imagemap_x"] == "")
319  {
320  $next_class = "";
321  }
322 
323 //echo "hier_id:$hier_id:type:$type:cmd:$cmd:ctype:$ctype:next_class:$next_class:<br>"; exit;
324  $this->log->debug("ilPageEditorGUI: ... next_class:".$next_class.", pc_id:".$pc_id.
325  ", hier_id:".$hier_id.", ctype:".$ctype.", cmd:".$cmd);
326  switch($next_class)
327  {
328  case "ilinternallinkgui":
329  $link_gui = new ilInternalLinkGUI(
330  $this->page_gui->getPageConfig()->getIntLinkHelpDefaultType(),
331  $this->page_gui->getPageConfig()->getIntLinkHelpDefaultId());
332  $link_gui->setMode("normal");
333  $link_gui->setFilterWhiteList(
334  $this->page_gui->getPageConfig()->getIntLinkFilterWhiteList());
335  foreach ($this->page_gui->getPageConfig()->getIntLinkFilters() as $filter)
336  {
337  $link_gui->filterLinkType($filter);
338  }
339 // $link_gui->setSetLinkTargetScript(
340 // $this->ctrl->getLinkTarget($this, "setInternalLink"));
341  $link_gui->setReturn($this->int_link_return);
342  if ($ilCtrl->isAsynch())
343  {
344  $link_gui->setMode("asynch");
345  }
346 
347  $ret =& $this->ctrl->forwardCommand($link_gui);
348  break;
349 
350  // PC Media Object
351  case "ilpcmediaobjectgui":
352  include_once ("./Services/COPage/classes/class.ilPCMediaObjectGUI.php");
353 
354  $this->tabs_gui->clearTargets();
355  $this->tabs_gui->setBackTarget($this->page_gui->page_back_title,
356  $ilCtrl->getLinkTarget($this->page_gui, "edit"));
357  $pcmob_gui =& new ilPCMediaObjectGUI($this->page, $cont_obj, $hier_id, $pc_id);
358  $pcmob_gui->setStyleId($this->page_gui->getStyleId());
359  $pcmob_gui->setEnabledMapAreas($this->page_gui->getPageConfig()->getEnableInternalLinks());
360  $ret =& $this->ctrl->forwardCommand($pcmob_gui);
361  $ilHelp->setScreenIdComponent("copg_media");
362  break;
363 
364  // only for "linked" media
365  case "ilobjmediaobjectgui":
366  $this->tabs_gui->clearTargets();
367  $this->tabs_gui->setBackTarget($this->lng->txt("back"),
368  $ilCtrl->getParentReturn($this));
369  $mob_gui =& new ilObjMediaObjectGUI("", $_GET["mob_id"],false, false);
370  $mob_gui->getTabs($this->tabs_gui);
371  $mob_gui->setEnabledMapAreas($this->page_gui->getPageConfig()->getEnableInternalLinks());
372  $this->tpl->setTitle($this->lng->txt("mob").": ".
373  ilObject::_lookupTitle($_GET["mob_id"]));
374  $ret =& $this->ctrl->forwardCommand($mob_gui);
375  break;
376 
377  // Question
378  case "ilpcquestiongui":
379  include_once("./Services/COPage/classes/class.ilPCQuestionGUI.php");
380  $pc_question_gui =& new ilPCQuestionGUI($this->page, $cont_obj, $hier_id, $pc_id);
381  $pc_question_gui->setSelfAssessmentMode($this->page_gui->getPageConfig()->getEnableSelfAssessment());
382  $pc_question_gui->setPageConfig($this->page_gui->getPageConfig());
383 
384  if ($this->page_gui->getPageConfig()->getEnableSelfAssessment())
385  {
386  $this->tabs_gui->clearTargets();
387  $ilHelp->setScreenIdComponent("copg_pcqst");
388  $this->tabs_gui->setBackTarget($this->lng->txt("back"),
389  $ilCtrl->getParentReturn($this));
390  $ret = $this->ctrl->forwardCommand($pc_question_gui);
391  }
392  else
393  {
394  $cmd = $this->ctrl->getCmd();
395  $pc_question_gui->$cmd();
396  $this->ctrl->redirectByClass(array("ilobjquestionpoolgui", get_class($cont_obj)), "editQuestion");
397  }
398  break;
399 
400  // Plugged Component
401  case "ilpcpluggedgui":
402  $this->tabs_gui->clearTargets();
403  include_once ("./Services/COPage/classes/class.ilPCPluggedGUI.php");
404  $plugged_gui = new ilPCPluggedGUI($this->page, $cont_obj, $hier_id,
405  $add_type, $pc_id);
406  $ret = $this->ctrl->forwardCommand($plugged_gui);
407  break;
408 
409  default:
410 
411  // generic calls to gui classes
412  include_once("./Services/COPage/classes/class.ilCOPagePCDef.php");
413  if (ilCOPagePCDef::isPCGUIClassName($next_class, true))
414  {
415  $pc_def = ilCOPagePCDef::getPCDefinitionByGUIClassName($next_class);
416  $this->tabs_gui->clearTargets();
417  $this->tabs_gui->setBackTarget($this->page_gui->page_back_title,
418  $ilCtrl->getLinkTarget($this->page_gui, "edit"));
419  $ilHelp->setScreenIdComponent("copg_".$pc_def["pc_type"]);
421  $gui_class_name = $pc_def["pc_gui_class"];
422  $pc_gui = new $gui_class_name($this->page, $cont_obj, $hier_id, $pc_id);
423  if ($pc_def["style_classes"])
424  {
425  $pc_gui->setStyleId($this->page_gui->getStyleId());
426  }
427  $pc_gui->setPageConfig($this->page_gui->getPageConfig());
428  $ret = $this->ctrl->forwardCommand($pc_gui);
429  }
430  else
431  {
432  // cmd belongs to ilPageEditorGUI
433 
434  if ($cmd == "pasteFromClipboard")
435  {
436  $ret = $this->pasteFromClipboard($hier_id);
437  }
438  else if ($cmd == "paste")
439  {
440  $ret = $this->paste($hier_id);
441  }
442  else
443  {
444  $ret = $this->$cmd();
445  }
446  }
447  break;
448 
449  }
450 
451  $this->log->debug("ilPageEditorGUI: executeCommand end");
452 
453  return $ret;
454  }
exit
Definition: login.php:54
$_POST['username']
Definition: cron.php:12
displayLocator()
display locator
$_GET["client_id"]
Class ilPCPluggedGUI.
$cmd
Definition: sahs_server.php:35
static _lookupTitle($a_id)
lookup object title
Class ilInternalLinkGUI.
paste($a_hier_id)
paste from clipboard (redirects to clipboard)
Class ilPCMediaObjectGUI.
setMode($a_mode="text")
Set mode.
global $ilCtrl
Definition: ilias.php:18
Class ilPCQuestionGUI.
getPCDefinitionByGUIClassName($a_gui_class_name)
Get PC definition by name.
getPCDefinitionByType($a_pc_type)
Get PC definition by type.
Class ilObjMediaObjectGUI.
static requirePCGUIClassByName($a_name)
Get instance.
isPCGUIClassName($a_class_name, $a_lower_case=false)
Is given class name a pc gui class?
pasteFromClipboard($a_hier_id)
paste from clipboard (redirects to clipboard)
getHeader()
get header title
+ Here is the call graph for this function:

◆ getHeader()

ilPageEditorGUI::getHeader ( )

get header title

Returns
string header title

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

References $header.

Referenced by executeCommand().

94  {
95  return $this->header;
96  }
+ 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 public

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

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

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  }
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...
static getLogger($a_component_id)
Get component logger.
+ Here is the call graph for this function:

◆ initCharacteristicForm()

ilPageEditorGUI::initCharacteristicForm (   $a_target,
  $a_types 
)

Init map creation/update form.

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

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

Referenced by assignCharacteristicForm().

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

References $_GET, and ilEditClipboardGUI\_getSelectedIDs().

822  {
823  include_once("./Services/Clipboard/classes/class.ilEditClipboardGUI.php");
825  include_once ("./Services/COPage/classes/class.ilPCMediaObject.php");
826  if ($ids != "")
827  {
828  foreach ($ids as $id2)
829  {
830  $id = explode(":", $id2);
831  $type = $id[0];
832  $id = $id[1];
833  if ($type == "mob")
834  {
835  $this->content_obj = new ilPCMediaObject($this->page);
836  $this->content_obj->readMediaObject($id);
837  $this->content_obj->createAlias($this->page, $_GET["hier_id"]);
838  $this->updated = $this->page->update();
839  }
840  if ($type == "incl")
841  {
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  }
$_GET["client_id"]
Class ilPCContentInclude.
Class ilPCMediaObject.
+ Here is the call graph for this function:

◆ paste()

ilPageEditorGUI::paste (   $a_hier_id)

paste from clipboard (redirects to clipboard)

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

References $ilCtrl, and ilEditClipboard\setAction().

Referenced by executeCommand().

643  {
644  global $ilCtrl;
645  $this->page->pasteContents($a_hier_id, $this->page_gui->getPageConfig()->getEnableSelfAssessment());
646  include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
648  $this->ctrl->returnToParent($this);
649  }
global $ilCtrl
Definition: ilias.php:18
+ 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 806 of file class.ilPageEditorGUI.php.

References $ilCtrl.

Referenced by executeCommand().

807  {
808  global $ilCtrl;
809 //var_dump($a_hier_id);
810  $ilCtrl->setParameter($this, "hier_id", $a_hier_id);
811  $ilCtrl->setParameterByClass("ilEditClipboardGUI", "returnCommand",
812  rawurlencode($ilCtrl->getLinkTarget($this,
813  "insertFromClipboard", "", false, false)));
814 //echo ":".$ilCtrl->getLinkTarget($this, "insertFromClipboard").":";
815  $ilCtrl->redirectByClass("ilEditClipboardGUI", "getObject");
816  }
global $ilCtrl
Definition: ilias.php:18
+ 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 503 of file class.ilPageEditorGUI.php.

References $_POST, $ilias, and $ilUser.

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

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

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

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

Field Documentation

◆ $cont_obj

ilPageEditorGUI::$cont_obj

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

Referenced by executeCommand().

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

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