ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilPCContentTemplateGUI Class Reference

Class ilPCContentTemplateGUI. More...

+ Inheritance diagram for ilPCContentTemplateGUI:
+ Collaboration diagram for ilPCContentTemplateGUI:

Public Member Functions

 __construct ($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id="")
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 insert ()
 Insert content template. More...
 
 initForm ()
 Init creation from. More...
 
 create ()
 Insert the template. More...
 
- Public Member Functions inherited from ilPageContentGUI
 __construct ($a_pg_obj, $a_content_obj, $a_hier_id=0, $a_pc_id="")
 Constructor public. More...
 
 setContentObject ($a_val)
 Set content object. More...
 
 getContentObject ()
 Get content object. More...
 
 setPage ($a_val)
 Set page. More...
 
 getPage ()
 Get page. More...
 
 setPageConfig ($a_val)
 Set Page Config. More...
 
 getPageConfig ()
 Get Page Config. More...
 
 setStyleId ($a_styleid)
 Set Style Id. More...
 
 getStyleId ()
 Get Style Id. More...
 
 getStyle ()
 Get style object. More...
 
 setCharacteristics ($a_chars)
 Set Characteristics. More...
 
 getCharacteristics ()
 Get characteristics. More...
 
 getHierId ()
 get hierarchical id in dom object More...
 
 setHierId ($a_hier_id)
 get hierarchical id in dom object More...
 
 getBBMenu ($a_ta_name="par_content")
 Get the bb menu incl. More...
 
 delete ()
 delete content element More...
 
 moveAfter ()
 move content element after another element More...
 
 moveBefore ()
 move content element before another element More...
 
 splitPage ()
 split page to new page at specified position More...
 
 splitPageNext ()
 split page to next page at specified position More...
 
 displayValidationError ()
 display validation errors More...
 
 cancelCreate ()
 cancel creating page content More...
 
 cancelUpdate ()
 cancel update More...
 
 cancel ()
 Cancel. More...
 
 deactivate ()
 gui function set enabled if is not enabled and vice versa More...
 
 cut ()
 Cut single element. More...
 
 copy ()
 Copy single element. More...
 
 getTemplateOptions ($a_type)
 Get table templates. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilPageContentGUI
static _getCommonBBButtons ()
 Get common bb buttons. More...
 
- Data Fields inherited from ilPageContentGUI
 $content_obj
 
 $tpl
 
 $lng
 
 $ctrl
 
 $pg_obj
 
 $hier_id
 
 $dom
 
 $updated
 
 $target_script
 
 $return_location
 
 $page_config = null
 
- Static Public Attributes inherited from ilPageContentGUI
static $style_selector_reset = "margin-top:2px; margin-bottom:2px; text-indent:0px; position:static; float:none; width: auto;"
 
- Protected Member Functions inherited from ilPageContentGUI
 getCharacteristicsOfCurrentStyle ($a_type)
 Get characteristics of current style. More...
 
- Protected Attributes inherited from ilPageContentGUI
 $error
 
 $log
 
- Static Protected Attributes inherited from ilPageContentGUI
static $common_bb_buttons
 

Detailed Description

Class ilPCContentTemplateGUI.

User Interface for inserting content templates

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

ilPCContentTemplateGUI: ilPageEditorGUI

Definition at line 20 of file class.ilPCContentTemplateGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilPCContentTemplateGUI::__construct (   $a_pg_obj,
  $a_content_obj,
  $a_hier_id,
  $a_pc_id = "" 
)

Constructor.

Definition at line 26 of file class.ilPCContentTemplateGUI.php.

References $DIC.

27  {
28  global $DIC;
29 
30  $this->tpl = $DIC["tpl"];
31  $this->ctrl = $DIC->ctrl();
32  $this->lng = $DIC->language();
33  parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
34  }
global $DIC
Definition: saml.php:7

Member Function Documentation

◆ create()

ilPCContentTemplateGUI::create ( )

Insert the template.

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

References $form, ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), ilPageContentGUI\getPage(), and initForm().

104  {
105  $tpl = $this->tpl;
106 
107  $form = $this->initForm();
108  if ($form->checkInput()) {
109  $this->content_obj = new ilPCContentTemplate($this->getPage());
110  $this->content_obj->create(
111  $this->pg_obj,
112  $this->hier_id,
113  $this->pc_id,
114  $form->getInput("page_templ")
115  );
116  $this->updated = $this->pg_obj->update();
117  if ($this->updated === true) {
118  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
119  return;
120  }
121  }
122  $this->displayValidationError();
123  $form->setValuesByPost();
124  $tpl->setContent($form->getHTML());
125  }
Content templates are not existing in the page.
if(isset($_POST['submit'])) $form
displayValidationError()
display validation errors
+ Here is the call graph for this function:

◆ executeCommand()

ilPCContentTemplateGUI::executeCommand ( )

Execute command.

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

References $ret.

40  {
41  // get next class that processes or forwards current command
42  $next_class = $this->ctrl->getNextClass($this);
43 
44  // get current command
45  $cmd = $this->ctrl->getCmd();
46 
47  switch ($next_class) {
48  default:
49  $ret = $this->$cmd();
50  break;
51  }
52 
53  return $ret;
54  }
$ret
Definition: parser.php:6

◆ initForm()

ilPCContentTemplateGUI::initForm ( )

Init creation from.

Definition at line 71 of file class.ilPCContentTemplateGUI.php.

References ilPageContentGUI\$ctrl, $form, $ilCtrl, ilPageContentGUI\$lng, $t, ilPageContentGUI\getPage(), and ilFormPropertyGUI\setRequired().

Referenced by create(), and insert().

72  {
74  $lng = $this->lng;
75 
76  // edit form
77  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
78  $form = new ilPropertyFormGUI();
79  $form->setFormAction($ilCtrl->getFormAction($this));
80  $form->setTitle($this->lng->txt("cont_ed_insert_templ"));
81 
82  $radg = new ilRadioGroupInputGUI($lng->txt("cont_template"), "page_templ");
83  $radg->setRequired(true);
84 
85  $ts = $this->getPage()->getContentTemplates();
86  foreach ($ts as $t) {
87  $op = new ilRadioOption($t["title"], $t["id"] . ":" . $t["parent_type"]);
88  $radg->addOption($op);
89  }
90 
91  $form->addItem($radg);
92 
93 
94  $form->addCommandButton("create_templ", $lng->txt("insert"));
95  $form->addCommandButton("cancelCreate", $lng->txt("cancel"));
96 
97  return $form;
98  }
This class represents an option in a radio group.
This class represents a property form user interface.
global $ilCtrl
Definition: ilias.php:18
This class represents a property in a property form.
if(isset($_POST['submit'])) $form
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insert()

ilPCContentTemplateGUI::insert ( )

Insert content template.

Definition at line 59 of file class.ilPCContentTemplateGUI.php.

References $form, ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), and initForm().

60  {
61  $tpl = $this->tpl;
62 
63  $this->displayValidationError();
64  $form = $this->initForm();
65  $tpl->setContent($form->getHTML());
66  }
if(isset($_POST['submit'])) $form
displayValidationError()
display validation errors
+ Here is the call graph for this function:

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