ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
ilPCSectionGUI Class Reference

Class ilPCSectionGUI. More...

+ Inheritance diagram for ilPCSectionGUI:
+ Collaboration diagram for ilPCSectionGUI:

Public Member Functions

 ilPCSectionGUI (&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id="")
 Constructor public. More...
 
executeCommand ()
 execute command More...
 
 insert ()
 Insert new section form. More...
 
 edit ($a_insert=false)
 Edit section form. More...
 
 create ()
 Create new Section. More...
 
 update ()
 Update Section. More...
 
- Public Member Functions inherited from ilPageContentGUI
 ilPageContentGUI ($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...
 

Static Public Member Functions

static _getStandardCharacteristics ()
 Get standard characteristics. More...
 
static _getCharacteristics ($a_style_id)
 Get characteristics. More...
 
- Static Public Member Functions inherited from ilPageContentGUI
static _getCommonBBButtons ()
 Get common bb buttons. More...
 

Additional Inherited Members

- 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...
 
- Static Protected Attributes inherited from ilPageContentGUI
static $common_bb_buttons
 

Detailed Description

Class ilPCSectionGUI.

User Interface for Section Editing

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

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

Member Function Documentation

◆ _getCharacteristics()

static ilPCSectionGUI::_getCharacteristics (   $a_style_id)
static

Get characteristics.

Definition at line 51 of file class.ilPCSectionGUI.php.

References _getStandardCharacteristics(), and ilObject\_lookupType().

Referenced by ilPageEditorGUI\initCharacteristicForm().

52  {
54 
55  if ($a_style_id > 0 &&
56  ilObject::_lookupType($a_style_id) == "sty")
57  {
58  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
59  $style = new ilObjStyleSheet($a_style_id);
60  $chars = $style->getCharacteristics("section");
61  $new_chars = array();
62  foreach ($chars as $char)
63  {
64  if ($chars[$char] != "") // keep lang vars for standard chars
65  {
66  $new_chars[$char] = $chars[$char];
67  }
68  else
69  {
70  $new_chars[$char] = $char;
71  }
72  asort($new_chars);
73  }
74  $chars = $new_chars;
75  }
76  return $chars;
77  }
static _getStandardCharacteristics()
Get standard characteristics.
static _lookupType($a_id, $a_reference=false)
lookup object type
Class ilObjStyleSheet.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getStandardCharacteristics()

static ilPCSectionGUI::_getStandardCharacteristics ( )
static

Get standard characteristics.

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

References ilPageContentGUI\$lng.

Referenced by _getCharacteristics(), and ilPCSectionGUI().

35  {
36  global $lng;
37 
38  return array("Block" => $lng->txt("cont_Block"),
39  "Mnemonic" => $lng->txt("cont_Mnemonic"),
40  "Remark" => $lng->txt("cont_Remark"),
41  "Example" => $lng->txt("cont_Example"),
42  "Additional" => $lng->txt("cont_Additional"),
43  "Special" => $lng->txt("cont_Special"),
44  "Excursus" => $lng->txt("cont_Excursus"),
45  "AdvancedKnowledge" => $lng->txt("cont_AdvancedKnowledge"));
46  }
+ Here is the caller graph for this function:

◆ create()

ilPCSectionGUI::create ( )

Create new Section.

Definition at line 183 of file class.ilPCSectionGUI.php.

References $_POST, ilPageContentGUI\getPage(), and insert().

184  {
185  $this->content_obj = new ilPCSection($this->getPage());
186  $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
187  $this->content_obj->setCharacteristic($_POST["characteristic"]);
188  $this->updated = $this->pg_obj->update();
189  if ($this->updated === true)
190  {
191  $this->ctrl->returnToParent($this, "jump".$this->hier_id);
192  }
193  else
194  {
195  $this->insert();
196  }
197  }
insert()
Insert new section form.
$_POST['username']
Definition: cron.php:12
Class ilPCSection.
+ Here is the call graph for this function:

◆ edit()

ilPCSectionGUI::edit (   $a_insert = false)

Edit section form.

Definition at line 113 of file class.ilPCSectionGUI.php.

References $ilCtrl, ilPageContentGUI\$lng, $ret, ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), and ilPageContentGUI\getCharacteristics().

Referenced by insert(), and update().

114  {
115  global $ilCtrl, $tpl, $lng;
116 
117  $this->displayValidationError();
118 
119  // edit form
120  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
121  $form = new ilPropertyFormGUI();
122  $form->setFormAction($ilCtrl->getFormAction($this));
123  if ($a_insert)
124  {
125  $form->setTitle($this->lng->txt("cont_insert_section"));
126  }
127  else
128  {
129  $form->setTitle($this->lng->txt("cont_update_section"));
130  }
131 
132  // characteristic selection
133  require_once("./Services/Form/classes/class.ilAdvSelectInputGUI.php");
134  $char_prop = new ilAdvSelectInputGUI($this->lng->txt("cont_characteristic"),
135  "characteristic");
136 
137  $chars = $this->getCharacteristics();
138  if (is_object($this->content_obj))
139  {
140  if ($chars[$a_seleted_value] == "" && ($this->content_obj->getCharacteristic() != ""))
141  {
142  $chars = array_merge(
143  array($this->content_obj->getCharacteristic() => $this->content_obj->getCharacteristic()),
144  $chars);
145  }
146  }
147 
148  $selected = ($a_insert)
149  ? "Block"
150  : $this->content_obj->getCharacteristic();
151 
152  foreach($chars as $k => $char)
153  {
154  $html = '<div class="ilCOPgEditStyleSelectionItem"><div class="ilc_section_'.$k.'" style="'.self::$style_selector_reset.'">'.
155  $char.'</div></div>';
156  $char_prop->addOption($k, $char, $html);
157  }
158 
159  $char_prop->setValue($selected);
160  $form->addItem($char_prop);
161 
162  // save/cancel buttons
163  if ($a_insert)
164  {
165  $form->addCommandButton("create_section", $lng->txt("save"));
166  $form->addCommandButton("cancelCreate", $lng->txt("cancel"));
167  }
168  else
169  {
170  $form->addCommandButton("update", $lng->txt("save"));
171  $form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
172  }
173  $html = $form->getHTML();
174  $tpl->setContent($html);
175  return $ret;
176 
177  }
This class represents a property form user interface.
global $ilCtrl
Definition: ilias.php:18
displayValidationError()
display validation errors
getCharacteristics()
Get characteristics.
This class represents an advanced selection list property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

& ilPCSectionGUI::executeCommand ( )

execute command

Definition at line 82 of file class.ilPCSectionGUI.php.

References $cmd, $ret, and ilPageContentGUI\getCharacteristicsOfCurrentStyle().

83  {
84  $this->getCharacteristicsOfCurrentStyle("section"); // scorm-2004
85 
86  // get next class that processes or forwards current command
87  $next_class = $this->ctrl->getNextClass($this);
88 
89  // get current command
90  $cmd = $this->ctrl->getCmd();
91 
92  switch($next_class)
93  {
94  default:
95  $ret =& $this->$cmd();
96  break;
97  }
98 
99  return $ret;
100  }
getCharacteristicsOfCurrentStyle($a_type)
Get characteristics of current style.
$cmd
Definition: sahs_server.php:35
+ Here is the call graph for this function:

◆ ilPCSectionGUI()

ilPCSectionGUI::ilPCSectionGUI ( $a_pg_obj,
$a_content_obj,
  $a_hier_id,
  $a_pc_id = "" 
)

Constructor public.

Definition at line 24 of file class.ilPCSectionGUI.php.

References _getStandardCharacteristics(), and ilPageContentGUI\setCharacteristics().

25  {
26  parent::ilPageContentGUI($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
27 
29  }
static _getStandardCharacteristics()
Get standard characteristics.
setCharacteristics($a_chars)
Set Characteristics.
+ Here is the call graph for this function:

◆ insert()

ilPCSectionGUI::insert ( )

Insert new section form.

Definition at line 105 of file class.ilPCSectionGUI.php.

References edit().

Referenced by create().

106  {
107  $this->edit(true);
108  }
edit($a_insert=false)
Edit section form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

ilPCSectionGUI::update ( )

Update Section.

Definition at line 202 of file class.ilPCSectionGUI.php.

References $_POST, and edit().

203  {
204  $this->content_obj->setCharacteristic($_POST["characteristic"]);
205  $this->updated = $this->pg_obj->update();
206  if ($this->updated === true)
207  {
208  $this->ctrl->returnToParent($this, "jump".$this->hier_id);
209  }
210  else
211  {
212  $this->pg_obj->addHierIDs();
213  $this->edit();
214  }
215  }
$_POST['username']
Definition: cron.php:12
edit($a_insert=false)
Edit section form.
+ Here is the call graph for this function:

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