24 require_once(
"./Services/COPage/classes/class.ilPCMap.php");
25 require_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
44 function ilPCMapGUI(&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id =
"")
55 $next_class = $this->ctrl->getNextClass($this);
58 $cmd = $this->ctrl->getCmd();
79 $tpl->setContent($this->form->getHTML());
85 function edit($a_insert =
false)
92 $tpl->setContent($this->form->getHTML());
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();
112 $this->form->setValuesByArray($values);
123 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
125 $this->form->setFormAction($ilCtrl->getFormAction($this));
126 if ($a_mode ==
"create")
128 $this->form->setTitle($this->lng->txt(
"cont_insert_map"));
132 $this->form->setTitle($this->lng->txt(
"cont_update_map"));
139 $this->form->addItem($loc_prop);
145 $width_prop->setMaxLength(4);
146 $width_prop->setRequired(
true);
147 $width_prop->setMinValue(250);
148 $this->form->addItem($width_prop);
154 $height_prop->setMaxLength(4);
155 $height_prop->setRequired(
true);
156 $height_prop->setMinValue(200);
157 $this->form->addItem($height_prop);
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);
174 $this->form->addItem($caption_prop);
177 if ($a_mode ==
"create")
179 $this->form->addCommandButton(
"create_map", $lng->txt(
"save"));
180 $this->form->addCommandButton(
"cancelCreate", $lng->txt(
"cancel"));
184 $this->form->addCommandButton(
"update_map", $lng->txt(
"save"));
185 $this->form->addCommandButton(
"cancelUpdate", $lng->txt(
"cancel"));
198 if ($this->form->checkInput())
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)
214 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
219 $this->form->setValuesByPost();
220 $tpl->setContent($this->form->getHTML());
231 if ($this->form->checkInput())
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)
245 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
250 $this->form->setValuesByPost();
252 $tpl->setContent($this->form->getHTML());