ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilLMPageObjectGUI Class Reference

Class ilLMPageObjectGUI. More...

+ Inheritance diagram for ilLMPageObjectGUI:
+ Collaboration diagram for ilLMPageObjectGUI:

Public Member Functions

 __construct (&$a_content_obj)
 Constructor. More...
 
 setLMPageObject ($a_pg_obj)
 Set content object dependent page object (co page) More...
 
 executeCommand ()
 execute command More...
 
 edit ()
 
 preview ()
 
 cancel ()
 cancel More...
 
 getLinkXML ($a_int_links)
 get link targets More...
 
 updateHistory ()
 update history More...
 
 editLayout ()
 Edit layout of page. More...
 
 initEditLayoutForm ()
 Init edit layout form. More...
 
 saveLayout ()
 Save layout. More...
 
 addPageTabs ()
 Add page tabs. More...
 
 downloadFile ()
 download file of file lists More...
 
 create ()
 structure / page object creation form More...
 
 initNewPageForm ()
 Init insert template form. More...
 
 save ()
 Save page. More...
 
- Public Member Functions inherited from ilLMObjectGUI
 __construct (&$a_content_obj)
 constructor More...
 
 setActions ($a_actions="")
 build action array More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 create ()
 structure / page object creation form More...
 
 putInTree ()
 put this object into content object tree More...
 
 delete ()
 Confirm deletion screen (delete page or structure objects) More...
 
 cancelDelete ()
 cancel deletion of page/structure objects More...
 
 confirmedDelete ()
 page and structure object deletion More...
 
 add_cell ($val, $link="")
 output a cell in object list More...
 
 showActions ($a_actions)
 show possible action (form buttons) More...
 
 checkTree ()
 check the content object tree More...
 

Static Public Member Functions

static _goto ($a_target)
 redirect script More...
 
static getLayoutCssFix ()
 Get layout css fix (workaround for broken radio options) More...
 

Data Fields

 $obj
 
- Data Fields inherited from ilLMObjectGUI
 $tpl
 
 $lng
 
 $obj
 
 $ctrl
 
 $content_object
 
 $actions
 

Protected Attributes

 $tabs
 
 $settings
 
- Protected Attributes inherited from ilLMObjectGUI
 $ui
 

Detailed Description

Class ilLMPageObjectGUI.

User Interface for Learning Module Page Objects Editing

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

ilLMPageObjectGUI: ilLMPageGUI, ilAssGenFeedbackPageGUI

Definition at line 17 of file class.ilLMPageObjectGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilLMPageObjectGUI::__construct ( $a_content_obj)

Constructor.

Parameters
object$a_content_objcontent object (lm | dbk) public

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

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), and settings().

38  {
39  global $DIC;
40 
41  $this->tpl = $DIC["tpl"];
42  $this->ctrl = $DIC->ctrl();
43  $this->tabs = $DIC->tabs();
44  $this->settings = $DIC->settings();
45  $this->lng = $DIC->language();
46  parent::__construct($a_content_obj);
47  }
settings()
Definition: settings.php:2
__construct(Container $dic, ilPlugin $plugin)
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilLMPageObjectGUI::_goto (   $a_target)
static

redirect script

Parameters
string$a_target

Definition at line 377 of file class.ilLMPageObjectGUI.php.

References $_GET, $DIC, $ilErr, ilLMObjectGUI\$lng, ilObject\_getAllReferences(), ilObjectGUI\_gotoRepositoryRoot(), ilLMObject\_lookupContObjID(), ilObject\_lookupTitle(), exit, and ilUtil\sendFailure().

378  {
379  global $DIC;
380 
381  $rbacsystem = $DIC->rbac()->system();
382  $ilErr = $DIC["ilErr"];
383  $lng = $DIC->language();
384  $ilAccess = $DIC->access();
385 
386  $first = strpos($a_target, "_");
387  $second = strpos($a_target, "_", $first + 1);
388  $page_id = substr($a_target, 0, $first);
389  if ($first > 0) {
390  $page_id = substr($a_target, 0, $first);
391  if ($second > 0) {
392  $ref_id = substr($a_target, $first + 1, $second - ($first + 1));
393  $anchor = substr($a_target, $second + 1);
394  } else {
395  $ref_id = substr($a_target, $first + 1);
396  }
397  } else {
398  $page_id = $a_target;
399  }
400 
401  // determine learning object
402  $lm_id = ilLMObject::_lookupContObjID($page_id);
403 
404  // get all references
405  $ref_ids = ilObject::_getAllReferences($lm_id);
406 
407  // always try passed ref id first
408  if (in_array($ref_id, $ref_ids)) {
409  $ref_ids = array_merge(array($ref_id), $ref_ids);
410  }
411 
412  // check read permissions
413  foreach ($ref_ids as $ref_id) {
414  // check read permissions
415  if ($ilAccess->checkAccess("read", "", $ref_id)) {
416  // don't redirect anymore, just set parameters
417  // (goto.php includes "ilias.php")
418  $_GET["baseClass"] = "ilLMPresentationGUI";
419  $_GET["obj_id"] = $page_id;
420  $_GET["ref_id"] = $ref_id;
421  $_GET["anchor"] = $anchor;
422  include_once("ilias.php");
423  exit;
424  }
425  }
426 
427  if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
428  if ($lm_id > 0) {
429  ilUtil::sendFailure(sprintf(
430  $lng->txt("msg_no_perm_read_item"),
431  ilObject::_lookupTitle($lm_id)
432  ), true);
433  } else {
434  $lng->loadLanguageModule("content");
435  ilUtil::sendFailure($lng->txt("page_does_not_exist"), true);
436  }
438  }
439 
440  $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
441  }
exit
Definition: login.php:29
$_GET["client_id"]
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupTitle($a_id)
lookup object title
static _lookupContObjID($a_id)
get learning module / digibook id for lm object
static _getAllReferences($a_id)
get all reference ids of object
$ilErr
Definition: raiseError.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ addPageTabs()

ilLMPageObjectGUI::addPageTabs ( )

Add page tabs.

Definition at line 537 of file class.ilLMPageObjectGUI.php.

References ilLMObjectGUI\$ctrl, $ilCtrl, and $tabs.

538  {
539  $ilTabs = $this->tabs;
541 
542  $ilTabs->addTarget(
543  "cont_layout",
544  $ilCtrl->getLinkTarget($this, 'editLayout'),
545  "editLayout"
546  );
547  }
global $ilCtrl
Definition: ilias.php:18

◆ cancel()

ilLMPageObjectGUI::cancel ( )

cancel

Definition at line 197 of file class.ilLMPageObjectGUI.php.

References $_GET, and ilUtil\redirect().

Referenced by save().

198  {
199  if ($_GET["obj_id"] != 0) {
200  ilUtil::redirect($this->ctrl->getLinkTargetByClass(
201  "ilStructureObjectGUI",
202  "view",
203  "",
204  true
205  ));
206  }
207  $up_gui = "ilobjlearningmodulegui";
208  $this->ctrl->redirectByClass($up_gui, "pages");
209  }
$_GET["client_id"]
static redirect($a_script)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

ilLMPageObjectGUI::create ( )

structure / page object creation form

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

References ilLMObjectGUI\$ctrl, ilLMObjectGUI\$lng, $tabs, ilLMObjectGUI\$ui, and initNewPageForm().

572  {
573  $ui = $this->ui;
574  $lng = $this->lng;
575  $ctrl = $this->ctrl;
576 
577  $tabs = $this->tabs;
578  $tabs->setBackTarget($lng->txt("back"), $ctrl->getLinkTarget($this, "cancel"));
579 
580  $ctrl->setParameter($this, "new_type", "pg");
581  $form = $this->initNewPageForm();
582 
583  $this->tpl->setContent($ui->renderer()->render($form) . self::getLayoutCssFix());
584  }
initNewPageForm()
Init insert template form.
+ Here is the call graph for this function:

◆ downloadFile()

ilLMPageObjectGUI::downloadFile ( )

download file of file lists

Definition at line 552 of file class.ilLMPageObjectGUI.php.

References $_GET, and exit.

553  {
554  $pg_obj = $this->obj->getPageObject();
555  $pg_obj->buildDom();
556  $int_links = $pg_obj->getInternalLinks();
557  foreach ($int_links as $il) {
558  if ($il["Target"] == str_replace("_file_", "_dfile_", $_GET["file_id"])) {
559  $file = explode("_", $_GET["file_id"]);
560  $file_id = (int) $file[count($file) - 1];
561  $fileObj = new ilObjFile($file_id, false);
562  $fileObj->sendFile();
563  exit;
564  }
565  }
566  }
exit
Definition: login.php:29
$_GET["client_id"]

◆ edit()

ilLMPageObjectGUI::edit ( )

Definition at line 173 of file class.ilLMPageObjectGUI.php.

References executeCommand().

174  {
175  //echo "<br>umschuss";
176  $this->ctrl->setCmdClass("ilLMPageGUI");
177  $this->ctrl->setCmd("edit");
178  $this->executeCommand();
179  //$this->setTabs();
180  }
executeCommand()
execute command
+ Here is the call graph for this function:

◆ editLayout()

ilLMPageObjectGUI::editLayout ( )

Edit layout of page.

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

References ilLMObjectGUI\$ctrl, $ilCtrl, $lm_set, $obj, $tabs, ilLMObjectGUI\$tpl, ilUtil\getImagePath(), initEditLayoutForm(), and ilPageObjectGUI\setEditPreview().

447  {
448  $tpl = $this->tpl;
450  $ilTabs = $this->tabs;
451 
452  $page_gui = new ilLMPageGUI($this->obj->getId());
453  $page_gui->setEditPreview(true);
454  $page_gui->activateMetaDataEditor(
455  $this->content_object,
456  $this->obj->getType(),
457  $this->obj->getId(),
458  $this->obj,
459  "MDUpdateListener"
460  );
461  $page_gui->setActivationListener($this, "activatePage");
462  $page_gui->setTabHook($this, "addPageTabs");
463  $lm_set = new ilSetting("lm");
464  $tpl->setTitleIcon(ilUtil::getImagePath("icon_pg.svg"));
465  $tpl->setTitle($this->lng->txt("page") . ": " . $this->obj->getTitle());
466  $ilCtrl->getHTML($page_gui);
467  $ilTabs->setTabActive("cont_layout");
468  $this->initEditLayoutForm();
469  $tpl->setContent($this->form->getHTML());
470  }
setEditPreview($a_editpreview)
Set Display first Edit tab, then Preview tab, instead of Page and Edit.
global $ilCtrl
Definition: ilias.php:18
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Extension of ilPageObjectGUI for learning modules.
$lm_set
initEditLayoutForm()
Init edit layout form.
+ Here is the call graph for this function:

◆ executeCommand()

ilLMPageObjectGUI::executeCommand ( )

execute command

Definition at line 62 of file class.ilLMPageObjectGUI.php.

References $_GET, ilLMObjectGUI\$ctrl, $ilCtrl, $ilSetting, $lm_set, $obj, $ret, $settings, $tabs, ilLMObjectGUI\$tpl, ilPageObject\_exists(), ilFrameTargetInfo\_getFrame(), ilLMPageObject\_getPresentationTitle(), ilObjStyleSheet\getEffectiveContentStyleId(), ilUtil\getImagePath(), getLinkXML(), ILIAS_HTTP_PATH, and ilPageObjectGUI\setEditPreview().

Referenced by edit(), and preview().

63  {
64  $tpl = $this->tpl;
66  $ilTabs = $this->tabs;
68 
69  $next_class = $this->ctrl->getNextClass($this);
70  $cmd = $this->ctrl->getCmd();
71 
72  //echo "<br>:cmd:".$this->ctrl->getCmd().":cmdClass:".$this->ctrl->getCmdClass().":".
73  // ":nextClass:".$next_class.":"; flush();
74 
75  switch ($next_class) {
76  case "illmpagegui":
77 
78  // Determine whether the view of a learning resource should
79  // be shown in the frameset of ilias, or in a separate window.
80  $showViewInFrameset = true;
81  $lm_set = new ilSetting("lm");
82 
83  $this->ctrl->setReturn($this, "edit");
84  if (!ilPageObject::_exists("lm", $this->obj->getId(), $_GET["transl"]) &&
85  ilPageObject::_exists("lm", $this->obj->getId(), "-")) {
86  if ($_GET["totransl"] == "") {
87  $_GET["totransl"] = $_GET["transl"];
88  $ilCtrl->setCmd("switchToLanguage");
89  }
90  $ilCtrl->setCmdClass("illmpagegui");
91  $page_gui = new ilLMPageGUI($this->obj->getId(), 0, false, "-");
92  } else {
93  $page_gui = new ilLMPageGUI($this->obj->getId());
94  }
95  $page_gui->setEditPreview(true);
96  $page_gui->activateMetaDataEditor(
97  $this->content_object,
98  $this->obj->getType(),
99  $this->obj->getId(),
100  $this->obj,
101  "MDUpdateListener"
102  );
103  if ($ilSetting->get("block_activated_news")) {
104  $page_gui->setEnabledNews(
105  true,
106  $this->obj->content_object->getId(),
107  $this->obj->content_object->getType()
108  );
109  }
110 
111  // set page view link
112  if ($showViewInFrameset) {
113  $view_frame = ilFrameTargetInfo::_getFrame("MainContent");
114  } else {
115  $view_frame = "ilContObj" . $this->content_object->getID();
116  }
117  $page_gui->setViewPageLink(
118  ILIAS_HTTP_PATH . "/goto.php?target=pg_" . $this->obj->getId() .
119  "_" . $_GET["ref_id"],
120  $view_frame
121  );
122 
123  $page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(
124  $this->content_object->getStyleSheetId(),
125  "lm"
126  ));
127  $page_gui->setTemplateTargetVar("ADM_CONTENT");
128  $page_gui->getPageObject()->buildDom();
129  $int_links = $page_gui->getPageObject()->getInternalLinks();
130  $link_xml = $this->getLinkXML($int_links);
131  $page_gui->setLinkXML($link_xml);
132 
133  $page_gui->enableChangeComments($this->content_object->isActiveHistoryUserComments());
134  $page_gui->setFileDownloadLink("ilias.php?cmd=downloadFile&ref_id=" . $_GET["ref_id"] . "&baseClass=ilLMPresentationGUI");
135  $page_gui->setFullscreenLink("ilias.php?cmd=fullscreen&ref_id=" . $_GET["ref_id"] . "&baseClass=ilLMPresentationGUI");
136  $page_gui->setLinkParams("ref_id=" . $this->content_object->getRefId());
137  $page_gui->setSourcecodeDownloadScript("ilias.php?ref_id=" . $_GET["ref_id"] . "&baseClass=ilLMPresentationGUI");
138  $page_gui->setPresentationTitle(
140  $this->obj->getId(),
141  $this->content_object->getPageHeader(),
142  $this->content_object->isActiveNumbering()
143  )
144  );
145  $page_gui->setLocator($contObjLocator);
146  $page_gui->setHeader($this->lng->txt("page") . ": " . $this->obj->getTitle());
147  $page_gui->setActivationListener($this, "activatePage");
148 
149  $up_gui = "ilobjlearningmodulegui";
150  $ilCtrl->setParameterByClass($up_gui, "active_node", $this->obj->getId());
151 
152  $tpl->setTitleIcon(ilUtil::getImagePath("icon_pg.svg"));
153  $tpl->setTitle($this->lng->txt("page") . ": " . $this->obj->getTitle());
154  if ($this->content_object->getLayoutPerPage()) {
155  $page_gui->setTabHook($this, "addPageTabs");
156  }
157  $ret = $this->ctrl->forwardCommand($page_gui);
158  if ($ret != "") { // in 6.0 this overwrites already set content with an empty string sometimes
159  $tpl->setContent($ret);
160  }
161  break;
162 
163  default:
164  $ret = $this->$cmd();
165  break;
166  }
167  }
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
static _getPresentationTitle( $a_pg_id, $a_mode=self::CHAPTER_TITLE, $a_include_numbers=false, $a_time_scheduled_activation=false, $a_force_content=false, $a_lm_id=0, $a_lang="-", $a_include_short=false)
presentation title doesn&#39;t have to be page title, it may be chapter title + page title or chapter tit...
setEditPreview($a_editpreview)
Set Display first Edit tab, then Preview tab, instead of Page and Edit.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Extension of ilPageObjectGUI for learning modules.
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
static _getFrame($a_class, $a_type='')
Get content frame name.
$lm_set
global $ilSetting
Definition: privfeed.php:17
getLinkXML($a_int_links)
get link targets
$ret
Definition: parser.php:6
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLayoutCssFix()

static ilLMPageObjectGUI::getLayoutCssFix ( )
static

Get layout css fix (workaround for broken radio options)

Returns
string

Definition at line 650 of file class.ilLMPageObjectGUI.php.

Referenced by ilStructureObjectGUI\insertTemplate().

651  {
652  return "
653  <style>
654  .form-control.il-input-radiooption > label {
655  vertical-align: middle;
656  }
657  .form-control.il-input-radiooption > .help-block {
658  padding-left: 2rem;
659  }
660  </style>
661  ";
662  }
+ Here is the caller graph for this function:

◆ getLinkXML()

ilLMPageObjectGUI::getLinkXML (   $a_int_links)

get link targets

Definition at line 214 of file class.ilLMPageObjectGUI.php.

References $_GET, ilLMObjectGUI\$content_object, $target_arr, $target_id, $type, ilFrameTargetInfo\_getFrame(), ilLMObject\_lookupContObjID(), ilObject\_lookupObjId(), ilObject\_lookupType(), ilUserUtil\getNamePresentation(), and ilUserUtil\hasPublicProfile().

Referenced by executeCommand().

215  {
216  if ($a_layoutframes == "") {
217  $a_layoutframes = array();
218  }
219  $link_info = "<IntLinkInfos>";
220  foreach ($a_int_links as $int_link) {
221  $target = $int_link["Target"];
222  if (substr($target, 0, 4) == "il__") {
223  $target_arr = explode("_", $target);
224  $target_id = $target_arr[count($target_arr) - 1];
225  $type = $int_link["Type"];
226  $targetframe = ($int_link["TargetFrame"] != "")
227  ? $int_link["TargetFrame"]
228  : "None";
229 
230  // anchor
231  $anc = $anc_add = "";
232  if ($int_link["Anchor"] != "") {
233  $anc = $int_link["Anchor"];
234  $anc_add = "_" . rawurlencode($int_link["Anchor"]);
235  }
236 
237  switch ($type) {
238  case "PageObject":
239  case "StructureObject":
241  $cont_obj = $this->content_object;
242  if ($lm_id == $cont_obj->getId()) {
243  $ltarget = "";
244  if ($type == "PageObject") {
245  $this->ctrl->setParameter($this, "obj_id", $target_id);
246  $href = $this->ctrl->getLinkTargetByClass(
247  get_class($this),
248  "edit",
249  "",
250  false,
251  true
252  );
253  } else {
254  $this->ctrl->setParameterByClass("ilstructureobjectgui", "obj_id", $target_id);
255  $href = $this->ctrl->getLinkTargetByClass(
256  "ilstructureobjectgui",
257  "view",
258  "",
259  false,
260  true
261  );
262  }
263  $href = str_replace("&", "&amp;", $href);
264  $this->ctrl->setParameter($this, "obj_id", $_GET["obj_id"]);
265  } else {
266  if ($type == "PageObject") {
267  $href = "goto.php?target=pg_" . $target_id . $anc_add;
268  } else {
269  $href = "goto.php?target=st_" . $target_id;
270  }
271  $ltarget = "ilContObj" . $lm_id;
272  }
273  if ($lm_id == "") {
274  $href = "";
275  }
276  break;
277 
278  case "GlossaryItem":
279  $ltarget = $nframe = "_blank";
280  $href = "ilias.php?cmdClass=illmpresentationgui&amp;baseClass=ilLMPresentationGUI&amp;" .
281  "obj_type=$type&amp;cmd=glossary&amp;ref_id=" . $_GET["ref_id"] .
282  "&amp;obj_id=" . $target_id . "&amp;frame=$nframe";
283  break;
284 
285  case "MediaObject":
286  $ltarget = $nframe = "_blank";
287  $href = "ilias.php?cmdClass=illmpresentationgui&amp;baseClass=ilLMPresentationGUI&amp;obj_type=$type&amp;cmd=media&amp;ref_id=" . $_GET["ref_id"] .
288  "&amp;mob_id=" . $target_id . "&amp;frame=$nframe";
289  break;
290 
291  case "RepositoryItem":
292  $obj_type = ilObject::_lookupType($target_id, true);
294  $href = "./goto.php?target=" . $obj_type . "_" . $target_id;
295  $t_frame = ilFrameTargetInfo::_getFrame("MainContent", $obj_type);
296  $ltarget = $t_frame;
297  break;
298 
299  case "File":
300  $this->ctrl->setParameter($this, "file_id", "il__file_" . $target_id);
301  $href = $this->ctrl->getLinkTarget(
302  $this,
303  "downloadFile",
304  "",
305  false,
306  true
307  );
308  $this->ctrl->setParameter($this, "file_id", "");
309  break;
310 
311  case "User":
312  $obj_type = ilObject::_lookupType($target_id);
313  if ($obj_type == "usr") {
314  $back = $this->ctrl->getLinkTarget(
315  $this,
316  "edit",
317  "",
318  false,
319  true
320  );
321  //var_dump($back); exit;
322  $this->ctrl->setParameterByClass("ilpublicuserprofilegui", "user_id", $target_id);
323  $this->ctrl->setParameterByClass(
324  "ilpublicuserprofilegui",
325  "back_url",
326  rawurlencode($back)
327  );
328  $href = "";
330  $href = $this->ctrl->getLinkTargetByClass(
331  "ilpublicuserprofilegui",
332  "getHTML",
333  "",
334  false,
335  true
336  );
337  }
338  $this->ctrl->setParameterByClass("ilpublicuserprofilegui", "user_id", "");
339  $lcontent = ilUserUtil::getNamePresentation($target_id, false, false);
340  }
341  break;
342 
343  }
344 
345  if ($href != "") {
346  $anc_par = 'Anchor="' . $anc . '"';
347  $link_info .= "<IntLinkInfo Target=\"$target\" Type=\"$type\" " .
348  "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"$ltarget\" LinkContent=\"$lcontent\" $anc_par/>";
349  }
350  }
351  }
352  $link_info .= "</IntLinkInfos>";
353  //echo ":".htmlentities($link_info).":";
354  return $link_info;
355  }
$target_arr
Definition: goto.php:47
$type
$_GET["client_id"]
$target_id
Definition: goto.php:49
static _lookupContObjID($a_id)
get learning module / digibook id for lm object
static hasPublicProfile($a_user_id)
Has public profile.
static _lookupObjId($a_id)
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
static _lookupType($a_id, $a_reference=false)
lookup object type
static _getFrame($a_class, $a_type='')
Get content frame name.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initEditLayoutForm()

ilLMPageObjectGUI::initEditLayoutForm ( )

Init edit layout form.

Parameters
int$a_modeEdit Mode

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

References ilLMObjectGUI\$ctrl, $ilCtrl, ilLMObjectGUI\$lng, ilObjContentObject\getAvailableLayouts(), ilUtil\getImagePath(), and ilUtil\img().

Referenced by editLayout(), and saveLayout().

478  {
479  $lng = $this->lng;
481 
482  $this->form = new ilPropertyFormGUI();
483 
484  // default layout
485  $layout = new ilRadioGroupInputGUI($lng->txt("cont_layout"), "layout");
486 
487  if (is_file($im = ilUtil::getImagePath("layout_" . $this->content_object->getLayout() . ".png"))) {
488  $im_tag = ilUtil::img($im, $this->content_object->getLayout());
489  }
490  $layout->addOption(new ilRadioOption("<table><tr><td>" . $im_tag . "</td><td><b>" .
491  $lng->txt("cont_lm_default_layout") .
492  "</b>: " . $lng->txt("cont_layout_" . $this->content_object->getLayout()) .
493  "</td></tr></table>", ""));
494 
495  foreach (ilObjContentObject::getAvailableLayouts() as $l) {
496  $im_tag = "";
497  if (is_file($im = ilUtil::getImagePath("layout_" . $l . ".png"))) {
498  $im_tag = ilUtil::img($im, $l);
499  }
500  $layout->addOption(new ilRadioOption("<table><tr><td>" . $im_tag . "</td><td><b>" .
501  $lng->txt("cont_layout_" . $l) . "</b>: " . $lng->txt("cont_layout_" . $l . "_desc") .
502  "</td></tr></table>", $l));
503  }
504 
505  $layout->setValue($this->obj->getLayout());
506  $this->form->addItem($layout);
507 
508  $this->form->addCommandButton("saveLayout", $lng->txt("save"));
509 
510  $this->form->setTitle($lng->txt("cont_page_layout"));
511  $this->form->setFormAction($ilCtrl->getFormAction($this));
512  }
This class represents an option in a radio group.
This class represents a property form user interface.
static getAvailableLayouts()
get all available lm layouts
global $ilCtrl
Definition: ilias.php:18
This class represents a property in a property form.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static img($a_src, $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initNewPageForm()

ilLMPageObjectGUI::initNewPageForm ( )

Init insert template form.

Returns

Definition at line 590 of file class.ilLMPageObjectGUI.php.

References ilLMObjectGUI\$ctrl, Vendor\Package\$f, ilLMObjectGUI\$lng, ilLMObjectGUI\$ui, and ilPageLayout\MODULE_LM.

Referenced by create(), and save().

591  {
592  $ui = $this->ui;
593  $f = $ui->factory();
594  $ctrl = $this->ctrl;
595  $lng = $this->lng;
596 
597  $fields["title"] = $f->input()->field()->text($lng->txt("title"), "");
598 
599  $fields["description"] = $f->input()->field()->textarea($lng->txt("description"));
600 
601  $ts = ilPageLayoutGUI::getTemplateSelection(ilPageLayout::MODULE_LM);
602  if (!is_null($ts)) {
603  $fields["layout_id"] = $ts;
604  }
605 
606  // section
607  $section1 = $f->input()->field()->section($fields, $lng->txt("cont_insert_pagelayout"));
608 
609  $form_action = $ctrl->getLinkTarget($this, "save");
610  return $f->input()->container()->form()->standard($form_action, ["sec" => $section1]);
611  }
+ Here is the caller graph for this function:

◆ preview()

ilLMPageObjectGUI::preview ( )

Definition at line 185 of file class.ilLMPageObjectGUI.php.

References executeCommand().

186  {
187  $this->ctrl->setCmdClass("ilLMPageGUI");
188  $this->ctrl->setCmd("preview");
189  $this->executeCommand();
190  // $this->setTabs();
191  }
executeCommand()
execute command
+ Here is the call graph for this function:

◆ save()

ilLMPageObjectGUI::save ( )

Save page.

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

References $data, $DIC, ilLMObjectGUI\$lng, cancel(), initNewPageForm(), and ilUtil\stripSlashes().

617  {
618  global $DIC;
619 
620  $request = $DIC->http()->request();
621  $lng = $this->lng;
622 
623  $form = $this->initNewPageForm();
624  if ($request->getMethod() == "POST") {
625  $form = $form->withRequest($request);
626  $data = $form->getData()["sec"];
627 
628  $layout_id = (int) $data["layout_id"];
629 
630  $this->obj = new ilLMPageObject($this->content_object);
631  $this->obj->setType("pg");
632  $this->obj->setTitle(ilUtil::stripSlashes($data["title"]));
633  $this->obj->setDescription(ilUtil::stripSlashes($data["description"]));
634  $this->obj->setLMId($this->content_object->getId());
635  if ($layout_id > 0) {
636  $this->obj->create(false, false, $layout_id);
637  } else {
638  $this->obj->create();
639  }
640  ilUtil::sendSuccess($lng->txt("cont_page_created"), true);
641  }
642  $this->cancel();
643  }
$data
Definition: storeScorm.php:23
initNewPageForm()
Init insert template form.
Class ilLMPageObject.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ saveLayout()

ilLMPageObjectGUI::saveLayout ( )

Save layout.

Definition at line 518 of file class.ilLMPageObjectGUI.php.

References ilLMObjectGUI\$ctrl, $ilCtrl, ilLMObjectGUI\$lng, ilLMObjectGUI\$tpl, initEditLayoutForm(), and ilLMObject\writeLayout().

519  {
520  $tpl = $this->tpl;
521  $lng = $this->lng;
523 
524  $this->initEditLayoutForm();
525  if ($this->form->checkInput()) {
526  ilLMObject::writeLayout($this->obj->getId(), $this->form->getInput("layout"));
527  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
528  $ilCtrl->redirect($this, "editLayout");
529  }
530  $this->form->setValuesByPost();
531  $tpl->setContent($this->form->getHtml());
532  }
static writeLayout($a_obj_id, $a_layout, $a_lm=null)
Write layout setting.
global $ilCtrl
Definition: ilias.php:18
initEditLayoutForm()
Init edit layout form.
+ Here is the call graph for this function:

◆ setLMPageObject()

ilLMPageObjectGUI::setLMPageObject (   $a_pg_obj)

Set content object dependent page object (co page)

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

54  {
55  $this->obj = $a_pg_obj;
56  $this->obj->setLMId($this->content_object->getId());
57  }

◆ updateHistory()

ilLMPageObjectGUI::updateHistory ( )

update history

Definition at line 360 of file class.ilLMPageObjectGUI.php.

References ilHistory\_createEntry().

361  {
363  $this->obj->getId(),
364  "update",
365  "",
366  $this->content_object->getType() . ":pg",
367  "",
368  true
369  );
370  }
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.
+ Here is the call graph for this function:

Field Documentation

◆ $obj

ilLMPageObjectGUI::$obj

Definition at line 29 of file class.ilLMPageObjectGUI.php.

Referenced by editLayout(), and executeCommand().

◆ $settings

ilLMPageObjectGUI::$settings
protected

Definition at line 27 of file class.ilLMPageObjectGUI.php.

Referenced by executeCommand().

◆ $tabs

ilLMPageObjectGUI::$tabs
protected

Definition at line 22 of file class.ilLMPageObjectGUI.php.

Referenced by addPageTabs(), create(), editLayout(), and executeCommand().


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