24require_once(
"./Services/COPage/classes/class.ilPCMap.php");
 
   25require_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
 
   44    public function __construct(&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id = 
"")
 
   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);
 
   60        $next_class = $this->ctrl->getNextClass($this);
 
   63        $cmd = $this->ctrl->getCmd();
 
   65        switch ($next_class) {
 
   83        $tpl->setContent($this->form->getHTML());
 
   89    public function edit($a_insert = 
false)
 
   98        $tpl->setContent($this->form->getHTML());
 
  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();
 
  118        $this->form->setValuesByArray(
$values);
 
  130        include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
 
  132        $this->form->setFormAction(
$ilCtrl->getFormAction($this));
 
  133        if ($a_mode == 
"create") {
 
  134            $this->form->setTitle($this->lng->txt(
"cont_insert_map"));
 
  136            $this->form->setTitle($this->lng->txt(
"cont_update_map"));
 
  141            $this->lng->txt(
"cont_location"),
 
  144        $loc_prop->setRequired(
true);
 
  145        $this->form->addItem($loc_prop);
 
  149            $this->lng->txt(
"cont_width"),
 
  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);
 
  160            $this->lng->txt(
"cont_height"),
 
  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);
 
  171            $this->lng->txt(
"cont_align"),
 
  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"));
 
  181        $this->form->addItem($align_prop);
 
  185            $this->lng->txt(
"cont_caption"),
 
  188        $this->form->addItem($caption_prop);
 
  191        if ($a_mode == 
"create") {
 
  192            $this->form->addCommandButton(
"create_map", 
$lng->txt(
"save"));
 
  193            $this->form->addCommandButton(
"cancelCreate", 
$lng->txt(
"cancel"));
 
  195            $this->form->addCommandButton(
"update_map", 
$lng->txt(
"save"));
 
  196            $this->form->addCommandButton(
"cancelUpdate", 
$lng->txt(
"cancel"));
 
  209        if ($this->form->checkInput()) {
 
  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")
 
  221            $this->content_obj->setCaption(
 
  222                $this->content_obj->handleCaptionInput($this->form->getInput(
"caption"))
 
  224            $this->updated = $this->pg_obj->update();
 
  225            if ($this->updated === 
true) {
 
  226                $this->ctrl->returnToParent($this, 
"jump" . $this->hier_id);
 
  231        $this->form->setValuesByPost();
 
  232        $tpl->setContent($this->form->getHTML());
 
  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")
 
  253            $this->content_obj->setCaption(
 
  254                $this->content_obj->handleCaptionInput($this->form->getInput(
"caption"))
 
  256            $this->updated = $this->pg_obj->update();
 
  257            if ($this->updated === 
true) {
 
  258                $this->ctrl->returnToParent($this, 
"jump" . $this->hier_id);
 
  263        $this->form->setValuesByPost();
 
  264        $tpl->setContent($this->form->getHTML());
 
An exception for terminatinating execution or to throw for unit testing.
getValues()
Get values from object into form.
executeCommand()
execute command
edit($a_insert=false)
Edit map form.
__construct(&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id="")
Constructor @access public.
initForm($a_mode)
Init map creation/update form.
insert()
Insert new map form.
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
displayValidationError()
display validation errors
This class represents a text area property in a property form.