ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilPCMapGUI Class Reference

Class ilPCMapGUI. More...

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

Public Member Functions

 ilPCMapGUI (&$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
 ilPageContentGUI ($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
 
 $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 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.

Member Function Documentation

◆ create()

ilPCMapGUI::create ( )

Create new Map.

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

194 {
195 global $tpl;
196
197 $this->initForm("create");
198 if ($this->form->checkInput())
199 {
200 $this->content_obj = new ilPCMap($this->getPage());
201 $location = $this->form->getInput("location");
202 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
203 $this->content_obj->setLatitude($location["latitude"]);
204 $this->content_obj->setLongitude($location["longitude"]);
205 $this->content_obj->setZoom($location["zoom"]);
206 $this->content_obj->setLayout($this->form->getInput("width"),
207 $this->form->getInput("height"),
208 $this->form->getInput("horizontal_align"));
209 $this->content_obj->setCaption(
210 $this->content_obj->handleCaptionInput($this->form->getInput("caption")));
211 $this->updated = $this->pg_obj->update();
212 if ($this->updated === true)
213 {
214 $this->ctrl->returnToParent($this, "jump".$this->hier_id);
215 return;
216 }
217 }
218 $this->displayValidationError();
219 $this->form->setValuesByPost();
220 $tpl->setContent($this->form->getHTML());
221 }
$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 85 of file class.ilPCMapGUI.php.

86 {
87 global $ilCtrl, $tpl, $lng;
88
90 $this->initForm("update");
91 $this->getValues();
92 $tpl->setContent($this->form->getHTML());
93
94 return $ret;
95 }
getValues()
Get values from object into form.
global $ilCtrl
Definition: ilias.php:18

References $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 52 of file class.ilPCMapGUI.php.

53 {
54 // get next class that processes or forwards current command
55 $next_class = $this->ctrl->getNextClass($this);
56
57 // get current command
58 $cmd = $this->ctrl->getCmd();
59
60 switch($next_class)
61 {
62 default:
63 $ret =& $this->$cmd();
64 break;
65 }
66
67 return $ret;
68 }
$cmd
Definition: sahs_server.php:35

References $cmd, and $ret.

◆ getValues()

ilPCMapGUI::getValues ( )

Get values from object into form.

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

101 {
102 $values = array();
103
104 $values["location"]["latitude"] = $this->content_obj->getLatitude();
105 $values["location"]["longitude"] = $this->content_obj->getLongitude();
106 $values["location"]["zoom"] = $this->content_obj->getZoom();
107 $values["width"] = $this->content_obj->getWidth();
108 $values["height"] = $this->content_obj->getHeight();
109 $values["caption"] = $this->content_obj->handleCaptionFormOutput($this->content_obj->getCaption());
110 $values["horizontal_align"] = $this->content_obj->getHorizontalAlign();
111
112 $this->form->setValuesByArray($values);
113 }

Referenced by edit().

+ Here is the caller graph for this function:

◆ ilPCMapGUI()

ilPCMapGUI::ilPCMapGUI ( $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 parent::ilPageContentGUI($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
47 }

◆ initForm()

ilPCMapGUI::initForm (   $a_mode)

Init map creation/update form.

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

119 {
120 global $ilCtrl, $lng;
121
122 // edit form
123 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
124 $this->form = new ilPropertyFormGUI();
125 $this->form->setFormAction($ilCtrl->getFormAction($this));
126 if ($a_mode == "create")
127 {
128 $this->form->setTitle($this->lng->txt("cont_insert_map"));
129 }
130 else
131 {
132 $this->form->setTitle($this->lng->txt("cont_update_map"));
133 }
134
135 // location
136 $loc_prop = new ilLocationInputGUI($this->lng->txt("cont_location"),
137 "location");
138 $loc_prop->setRequired(true);
139 $this->form->addItem($loc_prop);
140
141 // width
142 $width_prop = new ilNumberInputGUI($this->lng->txt("cont_width"),
143 "width");
144 $width_prop->setSize(4);
145 $width_prop->setMaxLength(4);
146 $width_prop->setRequired(true);
147 $width_prop->setMinValue(250);
148 $this->form->addItem($width_prop);
149
150 // height
151 $height_prop = new ilNumberInputGUI($this->lng->txt("cont_height"),
152 "height");
153 $height_prop->setSize(4);
154 $height_prop->setMaxLength(4);
155 $height_prop->setRequired(true);
156 $height_prop->setMinValue(200);
157 $this->form->addItem($height_prop);
158
159 // horizonal align
160 $align_prop = new ilSelectInputGUI($this->lng->txt("cont_align"),
161 "horizontal_align");
162 $options = array(
163 "Left" => $lng->txt("cont_left"),
164 "Center" => $lng->txt("cont_center"),
165 "Right" => $lng->txt("cont_right"),
166 "LeftFloat" => $lng->txt("cont_left_float"),
167 "RightFloat" => $lng->txt("cont_right_float"));
168 $align_prop->setOptions($options);
169 $this->form->addItem($align_prop);
170
171 // caption
172 $caption_prop = new ilTextAreaInputGUI($this->lng->txt("cont_caption"),
173 "caption");
174 $this->form->addItem($caption_prop);
175
176 // save/cancel buttons
177 if ($a_mode == "create")
178 {
179 $this->form->addCommandButton("create_map", $lng->txt("save"));
180 $this->form->addCommandButton("cancelCreate", $lng->txt("cancel"));
181 }
182 else
183 {
184 $this->form->addCommandButton("update_map", $lng->txt("save"));
185 $this->form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
186 }
187 //$html = $form->getHTML();
188 }
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.
if(!is_array($argv)) $options

References $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 73 of file class.ilPCMapGUI.php.

74 {
75 global $tpl;
76
78 $this->initForm("create");
79 $tpl->setContent($this->form->getHTML());
80 }

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

+ Here is the call graph for this function:

◆ update()

ilPCMapGUI::update ( )

Update Map.

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

227 {
228 global $tpl;
229
230 $this->initForm("update");
231 if ($this->form->checkInput())
232 {
233 $location = $this->form->getInput("location");
234 $this->content_obj->setLatitude($location["latitude"]);
235 $this->content_obj->setLongitude($location["longitude"]);
236 $this->content_obj->setZoom($location["zoom"]);
237 $this->content_obj->setLayout($this->form->getInput("width"),
238 $this->form->getInput("height"),
239 $this->form->getInput("horizontal_align"));
240 $this->content_obj->setCaption(
241 $this->content_obj->handleCaptionInput($this->form->getInput("caption")));
242 $this->updated = $this->pg_obj->update();
243 if ($this->updated === true)
244 {
245 $this->ctrl->returnToParent($this, "jump".$this->hier_id);
246 return;
247 }
248 }
249 $this->displayValidationError();
250 $this->form->setValuesByPost();
251 $tpl->setContent($this->form->getHTML());
252 }

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: