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

27  {
28  parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
29  }

Member Function Documentation

◆ create()

ilPCContentTemplateGUI::create ( )

Insert the template.

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

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

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

◆ executeCommand()

ilPCContentTemplateGUI::executeCommand ( )

Execute command.

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

References $cmd, and $ret.

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

◆ initForm()

ilPCContentTemplateGUI::initForm ( )

Init creation from.

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

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

Referenced by create(), and insert().

68  {
69  global $ilCtrl, $lng;
70 
71  // edit form
72  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
73  $form = new ilPropertyFormGUI();
74  $form->setFormAction($ilCtrl->getFormAction($this));
75  $form->setTitle($this->lng->txt("cont_ed_insert_templ"));
76 
77  $radg = new ilRadioGroupInputGUI($lng->txt("cont_template"), "page_templ");
78  $radg->setRequired(true);
79 
80  $ts = $this->getPage()->getContentTemplates();
81  foreach ($ts as $t)
82  {
83  $op = new ilRadioOption($t["title"], $t["id"].":".$t["parent_type"]);
84  $radg->addOption($op);
85  }
86 
87  $form->addItem($radg);
88 
89 
90  $form->addCommandButton("create_templ", $lng->txt("insert"));
91  $form->addCommandButton("cancelCreate", $lng->txt("cancel"));
92 
93  return $form;
94  }
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.
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 55 of file class.ilPCContentTemplateGUI.php.

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

56  {
57  global $tpl;
58 
59  $this->displayValidationError();
60  $form = $this->initForm();
61  $tpl->setContent($form->getHTML());
62  }
displayValidationError()
display validation errors
+ Here is the call graph for this function:

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