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

Class ilPCMapGUI. More...

+ Inheritance diagram for ilPCMapGUI:
+ Collaboration diagram for ilPCMapGUI:

Public Member Functions

 __construct (&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id="")
 Constructor @access public. More...
 
 executeCommand ()
 execute command More...
 
 insert ()
 Insert new map form. More...
 
 edit ($a_insert=false)
 Edit map form. More...
 
 getValues ()
 Get values from object into form. More...
 
 initForm ($a_mode)
 Init map creation/update form. More...
 
 create ()
 Create new Map. More...
 
 update ()
 Update Map. More...
 
- Public Member Functions inherited from ilPageContentGUI
 __construct ($a_pg_obj, $a_content_obj, $a_hier_id=0, $a_pc_id="")
 Constructor @access 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 ilPCMapGUI.

User Interface for Map Editing

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

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

Constructor & Destructor Documentation

◆ __construct()

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

Constructor @access public.

Definition at line 44 of file class.ilPCMapGUI.php.

45 {
46 global $DIC;
47
48 $this->tpl = $DIC["tpl"];
49 $this->ctrl = $DIC->ctrl();
50 $this->lng = $DIC->language();
51 parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
52 }
global $DIC
Definition: saml.php:7

References $DIC.

Member Function Documentation

◆ create()

ilPCMapGUI::create ( )

Create new Map.

Definition at line 204 of file class.ilPCMapGUI.php.

205 {
207
208 $this->initForm("create");
209 if ($this->form->checkInput()) {
210 $this->content_obj = new ilPCMap($this->getPage());
211 $location = $this->form->getInput("location");
212 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
213 $this->content_obj->setLatitude($location["latitude"]);
214 $this->content_obj->setLongitude($location["longitude"]);
215 $this->content_obj->setZoom($location["zoom"]);
216 $this->content_obj->setLayout(
217 $this->form->getInput("width"),
218 $this->form->getInput("height"),
219 $this->form->getInput("horizontal_align")
220 );
221 $this->content_obj->setCaption(
222 $this->content_obj->handleCaptionInput($this->form->getInput("caption"))
223 );
224 $this->updated = $this->pg_obj->update();
225 if ($this->updated === true) {
226 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
227 return;
228 }
229 }
230 $this->displayValidationError();
231 $this->form->setValuesByPost();
232 $tpl->setContent($this->form->getHTML());
233 }
$location
Definition: buildRTE.php:44
initForm($a_mode)
Init map creation/update form.
Class ilPCMap.
displayValidationError()
display validation errors

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

+ Here is the call graph for this function:

◆ edit()

ilPCMapGUI::edit (   $a_insert = false)

Edit map form.

Definition at line 89 of file class.ilPCMapGUI.php.

90 {
94
96 $this->initForm("update");
97 $this->getValues();
98 $tpl->setContent($this->form->getHTML());
99
100 return $ret;
101 }
getValues()
Get values from object into form.
global $ilCtrl
Definition: ilias.php:18
$ret
Definition: parser.php:6

References ilPageContentGUI\$ctrl, $ilCtrl, ilPageContentGUI\$lng, $ret, ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), getValues(), and initForm().

+ Here is the call graph for this function:

◆ executeCommand()

ilPCMapGUI::executeCommand ( )

execute command

Definition at line 57 of file class.ilPCMapGUI.php.

58 {
59 // get next class that processes or forwards current command
60 $next_class = $this->ctrl->getNextClass($this);
61
62 // get current command
63 $cmd = $this->ctrl->getCmd();
64
65 switch ($next_class) {
66 default:
67 $ret = $this->$cmd();
68 break;
69 }
70
71 return $ret;
72 }

References $ret.

◆ getValues()

ilPCMapGUI::getValues ( )

Get values from object into form.

Definition at line 106 of file class.ilPCMapGUI.php.

107 {
108 $values = array();
109
110 $values["location"]["latitude"] = $this->content_obj->getLatitude();
111 $values["location"]["longitude"] = $this->content_obj->getLongitude();
112 $values["location"]["zoom"] = $this->content_obj->getZoom();
113 $values["width"] = $this->content_obj->getWidth();
114 $values["height"] = $this->content_obj->getHeight();
115 $values["caption"] = $this->content_obj->handleCaptionFormOutput($this->content_obj->getCaption());
116 $values["horizontal_align"] = $this->content_obj->getHorizontalAlign();
117
118 $this->form->setValuesByArray($values);
119 }

Referenced by edit().

+ Here is the caller graph for this function:

◆ initForm()

ilPCMapGUI::initForm (   $a_mode)

Init map creation/update form.

Definition at line 124 of file class.ilPCMapGUI.php.

125 {
128
129 // edit form
130 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
131 $this->form = new ilPropertyFormGUI();
132 $this->form->setFormAction($ilCtrl->getFormAction($this));
133 if ($a_mode == "create") {
134 $this->form->setTitle($this->lng->txt("cont_insert_map"));
135 } else {
136 $this->form->setTitle($this->lng->txt("cont_update_map"));
137 }
138
139 // location
140 $loc_prop = new ilLocationInputGUI(
141 $this->lng->txt("cont_location"),
142 "location"
143 );
144 $loc_prop->setRequired(true);
145 $this->form->addItem($loc_prop);
146
147 // width
148 $width_prop = new ilNumberInputGUI(
149 $this->lng->txt("cont_width"),
150 "width"
151 );
152 $width_prop->setSize(4);
153 $width_prop->setMaxLength(4);
154 $width_prop->setRequired(true);
155 $width_prop->setMinValue(250);
156 $this->form->addItem($width_prop);
157
158 // height
159 $height_prop = new ilNumberInputGUI(
160 $this->lng->txt("cont_height"),
161 "height"
162 );
163 $height_prop->setSize(4);
164 $height_prop->setMaxLength(4);
165 $height_prop->setRequired(true);
166 $height_prop->setMinValue(200);
167 $this->form->addItem($height_prop);
168
169 // horizonal align
170 $align_prop = new ilSelectInputGUI(
171 $this->lng->txt("cont_align"),
172 "horizontal_align"
173 );
174 $options = array(
175 "Left" => $lng->txt("cont_left"),
176 "Center" => $lng->txt("cont_center"),
177 "Right" => $lng->txt("cont_right"),
178 "LeftFloat" => $lng->txt("cont_left_float"),
179 "RightFloat" => $lng->txt("cont_right_float"));
180 $align_prop->setOptions($options);
181 $this->form->addItem($align_prop);
182
183 // caption
184 $caption_prop = new ilTextAreaInputGUI(
185 $this->lng->txt("cont_caption"),
186 "caption"
187 );
188 $this->form->addItem($caption_prop);
189
190 // save/cancel buttons
191 if ($a_mode == "create") {
192 $this->form->addCommandButton("create_map", $lng->txt("save"));
193 $this->form->addCommandButton("cancelCreate", $lng->txt("cancel"));
194 } else {
195 $this->form->addCommandButton("update_map", $lng->txt("save"));
196 $this->form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
197 }
198 //$html = $form->getHTML();
199 }
if(!isset( $_REQUEST[ 'ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
This class represents a location property in a property form.
This class represents a number property in a property form.
This class represents a property form user interface.
This class represents a selection list property in a property form.
This class represents a text area property in a property form.

References ilPageContentGUI\$ctrl, $ilCtrl, ilPageContentGUI\$lng, and $options.

Referenced by create(), edit(), insert(), and update().

+ Here is the caller graph for this function:

◆ insert()

ilPCMapGUI::insert ( )

Insert new map form.

Definition at line 77 of file class.ilPCMapGUI.php.

78 {
80
82 $this->initForm("create");
83 $tpl->setContent($this->form->getHTML());
84 }

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

+ Here is the call graph for this function:

◆ update()

ilPCMapGUI::update ( )

Update Map.

Definition at line 238 of file class.ilPCMapGUI.php.

239 {
241
242 $this->initForm("update");
243 if ($this->form->checkInput()) {
244 $location = $this->form->getInput("location");
245 $this->content_obj->setLatitude($location["latitude"]);
246 $this->content_obj->setLongitude($location["longitude"]);
247 $this->content_obj->setZoom($location["zoom"]);
248 $this->content_obj->setLayout(
249 $this->form->getInput("width"),
250 $this->form->getInput("height"),
251 $this->form->getInput("horizontal_align")
252 );
253 $this->content_obj->setCaption(
254 $this->content_obj->handleCaptionInput($this->form->getInput("caption"))
255 );
256 $this->updated = $this->pg_obj->update();
257 if ($this->updated === true) {
258 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
259 return;
260 }
261 }
262 $this->displayValidationError();
263 $this->form->setValuesByPost();
264 $tpl->setContent($this->form->getHTML());
265 }

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

+ Here is the call graph for this function:

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