ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilPCMapGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

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

Public Member Functions

 __construct (ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id, string $a_pc_id="")
 
 executeCommand ()
 
 insert ()
 
 edit ()
 
 getValues ()
 
 initForm (string $a_mode)
 
 create ()
 
 update ()
 
- Public Member Functions inherited from ilPageContentGUI
 __construct (ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id="", string $a_pc_id="0")
 
 setContentObject (ilPageContent $a_val)
 
 getContentObject ()
 
 setPage (ilPageObject $a_val)
 
 getPage ()
 
 setPageConfig (ilPageConfig $a_val)
 
 getPageConfig ()
 
 setStyleId (int $a_styleid)
 
 getStyleId ()
 
 getStyle ()
 
 getCharacteristicsOfCurrentStyle (array $a_type)
 Get characteristics of current style and call setCharacteristics, if style is given. More...
 
 setCharacteristics (array $a_chars)
 
 getCharacteristics ()
 
 getHierId ()
 
 setHierId (string $a_hier_id)
 set hierarchical id in dom object More...
 
 delete ()
 
 displayValidationError ()
 
 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 (string $a_type="")
 Get table templates. More...
 

Protected Attributes

ilPropertyFormGUI $form
 
- Protected Attributes inherited from ilPageContentGUI
ILIAS COPage Editor GUIService $editor_gui
 
ILIAS COPage InternalGUIService $gui
 
EditSessionRepository $edit_repo
 
string $pc_id = ""
 
array $chars
 
ilObjStyleSheet $style = null
 
LOMServices $lom_services
 
ilLogger $log
 
int $styleid = 0
 
EditGUIRequest $request
 
string $sub_command = ""
 
int $requested_ref_id = 0
 
ILIAS GlobalScreen ScreenContext ContextServices $tool_context
 
Style Content CharacteristicManager $char_manager
 

Additional Inherited Members

- Static Public Member Functions inherited from ilPageContentGUI
static _getCommonBBButtons ()
 
- Data Fields inherited from ilPageContentGUI
ilPageContent $content_obj
 
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilPageObject $pg_obj
 
string $hier_id = ""
 
DOMDocument $dom
 
 $updated
 
string $target_script = ""
 
string $return_location = ""
 
ilPageConfig $page_config = null
 
- Static Public Attributes inherited from ilPageContentGUI
static string $style_selector_reset = "margin-top:2px; margin-bottom:2px; text-indent:0px; position:static; float:none; width: auto;"
 
- Protected Member Functions inherited from ilPageContentGUI
 redirectToParent (string $hier_id="")
 
 getParentReturn (string $hier_id="")
 
 updateAndReturn ()
 
 setCurrentTextLang (string $lang_key)
 
 getCurrentTextLang ()
 
 setEditorToolContext ()
 
 initEditor ()
 
 getEditorScriptTag (string $form_pc_id="", string $form_cname="")
 
- Static Protected Attributes inherited from ilPageContentGUI
static array $common_bb_buttons
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilPCMapGUI User Interface for Map Editing

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Constructor & Destructor Documentation

◆ __construct()

ilPCMapGUI::__construct ( ilPageObject  $a_pg_obj,
?ilPageContent  $a_content_obj,
string  $a_hier_id,
string  $a_pc_id = "" 
)

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

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

33  {
34  global $DIC;
35 
36  $this->tpl = $DIC["tpl"];
37  $this->ctrl = $DIC->ctrl();
38  $this->lng = $DIC->language();
39  parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
40  }
global $DIC
Definition: shib_login.php:22
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ create()

ilPCMapGUI::create ( )

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

References $location, ilPageContentGUI\$tpl, ILIAS\Repository\ctrl(), ilPageContentGUI\displayValidationError(), ILIAS\Repository\form(), ilPageContentGUI\getPage(), initForm(), and ILIAS\UICore\GlobalTemplate\setContent().

165  : void
166  {
167  $tpl = $this->tpl;
168 
169  $this->initForm("create");
170  if ($this->form->checkInput()) {
171  $this->content_obj = new ilPCMap($this->getPage());
172  $location = $this->form->getInput("location");
173  $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
174  $this->content_obj->setLatitude($location["latitude"]);
175  $this->content_obj->setLongitude($location["longitude"]);
176  $this->content_obj->setZoom((int) $location["zoom"]);
177  $this->content_obj->setLayout(
178  $this->form->getInput("width"),
179  $this->form->getInput("height"),
180  $this->form->getInput("horizontal_align")
181  );
182  $this->content_obj->setCaption(
183  $this->content_obj->handleCaptionInput($this->form->getInput("caption"))
184  );
185  $this->updated = $this->pg_obj->update();
186  if ($this->updated === true) {
187  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
188  return;
189  }
190  }
191  $this->displayValidationError();
192  $this->form->setValuesByPost();
193  $tpl->setContent($this->form->getHTML());
194  }
$location
Definition: buildRTE.php:22
setContent(string $a_html)
Sets content for standard template.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilGlobalTemplateInterface $tpl
form( $class_path, string $cmd, string $submit_caption="")
initForm(string $a_mode)
+ Here is the call graph for this function:

◆ edit()

ilPCMapGUI::edit ( )

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

References ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), ILIAS\Repository\form(), getValues(), initForm(), and ILIAS\UICore\GlobalTemplate\setContent().

66  : void
67  {
68  $tpl = $this->tpl;
69  $this->displayValidationError();
70  $this->initForm("update");
71  $this->getValues();
72  $tpl->setContent($this->form->getHTML());
73  }
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
form( $class_path, string $cmd, string $submit_caption="")
initForm(string $a_mode)
+ Here is the call graph for this function:

◆ executeCommand()

ilPCMapGUI::executeCommand ( )

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

References ILIAS\Repository\ctrl().

42  : void
43  {
44  // get next class that processes or forwards current command
45  $next_class = $this->ctrl->getNextClass($this);
46 
47  // get current command
48  $cmd = $this->ctrl->getCmd();
49 
50  switch ($next_class) {
51  default:
52  $this->$cmd();
53  break;
54  }
55  }
+ Here is the call graph for this function:

◆ getValues()

ilPCMapGUI::getValues ( )

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

References ILIAS\Repository\form(), and ilPCMap\handleCaptionFormOutput().

Referenced by edit().

75  : void
76  {
77  $values = array();
78 
79  $values["location"]["latitude"] = $this->content_obj->getLatitude();
80  $values["location"]["longitude"] = $this->content_obj->getLongitude();
81  $values["location"]["zoom"] = $this->content_obj->getZoom();
82  $values["width"] = $this->content_obj->getWidth();
83  $values["height"] = $this->content_obj->getHeight();
84  $values["caption"] = ilPCMap::handleCaptionFormOutput($this->content_obj->getCaption());
85  $values["horizontal_align"] = $this->content_obj->getHorizontalAlign();
86 
87  $this->form->setValuesByArray($values);
88  }
static handleCaptionFormOutput(string $a_text)
form( $class_path, string $cmd, string $submit_caption="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initForm()

ilPCMapGUI::initForm ( string  $a_mode)

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

References ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, ILIAS\Repository\form(), ILIAS\Repository\lng(), ilSelectInputGUI\setOptions(), ilFormPropertyGUI\setRequired(), ilNumberInputGUI\setSize(), and ilLanguage\txt().

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

90  : void
91  {
92  $ilCtrl = $this->ctrl;
93  $lng = $this->lng;
94 
95  // edit form
96  $this->form = new ilPropertyFormGUI();
97  $this->form->setFormAction($ilCtrl->getFormAction($this));
98  if ($a_mode == "create") {
99  $this->form->setTitle($this->lng->txt("cont_insert_map"));
100  } else {
101  $this->form->setTitle($this->lng->txt("cont_update_map"));
102  }
103 
104  // location
105  $loc_prop = new ilLocationInputGUI(
106  $this->lng->txt("cont_location"),
107  "location"
108  );
109  $loc_prop->setRequired(true);
110  $this->form->addItem($loc_prop);
111 
112  // width
113  $width_prop = new ilNumberInputGUI(
114  $this->lng->txt("cont_width"),
115  "width"
116  );
117  $width_prop->setSize(4);
118  $width_prop->setMaxLength(4);
119  $width_prop->setRequired(true);
120  $width_prop->setMinValue(250);
121  $this->form->addItem($width_prop);
122 
123  // height
124  $height_prop = new ilNumberInputGUI(
125  $this->lng->txt("cont_height"),
126  "height"
127  );
128  $height_prop->setSize(4);
129  $height_prop->setMaxLength(4);
130  $height_prop->setRequired(true);
131  $height_prop->setMinValue(200);
132  $this->form->addItem($height_prop);
133 
134  // horizonal align
135  $align_prop = new ilSelectInputGUI(
136  $this->lng->txt("cont_align"),
137  "horizontal_align"
138  );
139  $options = array(
140  "Left" => $lng->txt("cont_left"),
141  "Center" => $lng->txt("cont_center"),
142  "Right" => $lng->txt("cont_right"),
143  "LeftFloat" => $lng->txt("cont_left_float"),
144  "RightFloat" => $lng->txt("cont_right_float"));
145  $align_prop->setOptions($options);
146  $this->form->addItem($align_prop);
147 
148  // caption
149  $caption_prop = new ilTextAreaInputGUI(
150  $this->lng->txt("cont_caption"),
151  "caption"
152  );
153  $this->form->addItem($caption_prop);
154 
155  // save/cancel buttons
156  if ($a_mode == "create") {
157  $this->form->addCommandButton("create", $lng->txt("save"));
158  $this->form->addCommandButton("cancelCreate", $lng->txt("cancel"));
159  } else {
160  $this->form->addCommandButton("update", $lng->txt("save"));
161  $this->form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
162  }
163  }
This class represents a selection list property in a property form.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setOptions(array $a_options)
This class represents a number property in a property form.
This class represents a location property in a property form.
setRequired(bool $a_required)
form( $class_path, string $cmd, string $submit_caption="")
This class represents a text area property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insert()

ilPCMapGUI::insert ( )

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

References ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), ILIAS\Repository\form(), initForm(), and ILIAS\UICore\GlobalTemplate\setContent().

57  : void
58  {
59  $tpl = $this->tpl;
60 
61  $this->displayValidationError();
62  $this->initForm("create");
63  $tpl->setContent($this->form->getHTML());
64  }
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
form( $class_path, string $cmd, string $submit_caption="")
initForm(string $a_mode)
+ Here is the call graph for this function:

◆ update()

ilPCMapGUI::update ( )

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

References $location, ilPageContentGUI\$tpl, ILIAS\Repository\ctrl(), ilPageContentGUI\displayValidationError(), ILIAS\Repository\form(), initForm(), and ILIAS\UICore\GlobalTemplate\setContent().

196  : void
197  {
198  $tpl = $this->tpl;
199 
200  $this->initForm("update");
201  if ($this->form->checkInput()) {
202  $location = $this->form->getInput("location");
203  $this->content_obj->setLatitude($location["latitude"]);
204  $this->content_obj->setLongitude($location["longitude"]);
205  $this->content_obj->setZoom((int) $location["zoom"]);
206  $this->content_obj->setLayout(
207  $this->form->getInput("width"),
208  $this->form->getInput("height"),
209  $this->form->getInput("horizontal_align")
210  );
211  $this->content_obj->setCaption(
212  $this->content_obj->handleCaptionInput($this->form->getInput("caption"))
213  );
214  $this->updated = $this->pg_obj->update();
215  if ($this->updated === true) {
216  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
217  return;
218  }
219  }
220  $this->displayValidationError();
221  $this->form->setValuesByPost();
222  $tpl->setContent($this->form->getHTML());
223  }
$location
Definition: buildRTE.php:22
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
form( $class_path, string $cmd, string $submit_caption="")
initForm(string $a_mode)
+ Here is the call graph for this function:

Field Documentation

◆ $form

ilPropertyFormGUI ilPCMapGUI::$form
protected

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


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