ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjExternalToolsSettingsGUI 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 ilObjExternalToolsSettingsGUI:
+ Collaboration diagram for ilObjExternalToolsSettingsGUI:

Public Member Functions

 __construct ( $a_data, int $a_id, bool $a_call_by_reference, bool $a_prepare_output=true)
 
 getAdminTabs ()
 
 editMapsObject ()
 
 getMapsForm ()
 
 saveMapsObject ()
 Save Maps Settings. More...
 
 initSubTabs (string $a_cmd)
 
 executeCommand ()
 
- Public Member Functions inherited from ilObjectGUI
 __construct ($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
 
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 if true, a creation screen is displayed the current [ref_id] don't belong to the current class! The mode is determined in ilRepositoryGUI More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html Should be overwritten and redirect to settings screen. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Data Fields

ilRbacSystem $rbacsystem
 
ilRbacReview $rbacreview
 
- Data Fields inherited from ilObjectGUI
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
const ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Protected Member Functions

 getTabs ()
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 getCreationFormsHTML (array $forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm (string $new_type)
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm (string $new_type)
 
 importFileObject (int $parent_id=null)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current ["ref_id"] value of the request More...
 
 fillCloneTemplate (?string $tpl_name, string $type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 showCustomIconsEditing ( $input_colspan=1, ilPropertyFormGUI $form=null, $as_section=true)
 show edit section of custom icons for container More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Factory $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

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 ilObjExternalToolsSettingsGUI

Author
Sascha Hofmann sasch.nosp@m.ahof.nosp@m.mann@.nosp@m.gmx..nosp@m.de ilObjExternalToolsSettingsGUI: ilPermissionGUI, ilMathJaxSettingsGUI

Definition at line 27 of file class.ilObjExternalToolsSettingsGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjExternalToolsSettingsGUI::__construct (   $a_data,
int  $a_id,
bool  $a_call_by_reference,
bool  $a_prepare_output = true 
)

Definition at line 32 of file class.ilObjExternalToolsSettingsGUI.php.

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

37  {
38  global $DIC;
39 
40  $this->lng = $DIC->language();
41  $this->rbacsystem = $DIC->rbac()->system();
42  $this->access = $DIC->access();
43  $this->rbacreview = $DIC->rbac()->review();
44  $this->ctrl = $DIC->ctrl();
45  $this->tpl = $DIC["tpl"];
46  $lng = $DIC->language();
47 
48  $this->type = "extt";
49  parent::__construct($a_data, $a_id, $a_call_by_reference, false);
50 
51  $lng->loadLanguageModule("delic");
52  $lng->loadLanguageModule("maps");
53  $lng->loadLanguageModule("mathjax");
54  }
loadLanguageModule(string $a_module)
Load language module.
global $DIC
Definition: feed.php:28
ilLanguage $lng
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ editMapsObject()

ilObjExternalToolsSettingsGUI::editMapsObject ( )

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

References ilObjectGUI\$tpl, getMapsForm(), initSubTabs(), and ilGlobalTemplateInterface\setContent().

89  : void
90  {
91  $tpl = $this->tpl;
92 
93  $this->initSubTabs("editMaps");
94  $form = $this->getMapsForm();
95  $tpl->setContent($form->getHTML());
96  }
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:

◆ executeCommand()

ilObjExternalToolsSettingsGUI::executeCommand ( )

Definition at line 213 of file class.ilObjExternalToolsSettingsGUI.php.

References ILIAS\Repository\ctrl(), initSubTabs(), ILIAS\Repository\lng(), and ilObjectGUI\prepareOutput().

213  : void
214  {
215  $next_class = $this->ctrl->getNextClass($this);
216  $cmd = $this->ctrl->getCmd();
217  $this->prepareOutput();
218 
219  if (!$this->rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
220  $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
221  }
222 
223  switch ($next_class) {
224 
225  case 'ilmathjaxsettingsgui':
226  $this->tabs_gui->setTabActive('settings');
227  $this->initSubTabs("editMathJax");
228  $this->ctrl->forwardCommand(new ilMathJaxSettingsGUI());
229  break;
230 
231  case 'ilecssettingsgui':
232  $this->tabs_gui->setTabActive('ecs_server_settings');
233  $this->ctrl->forwardCommand(new ilECSSettingsGUI());
234  break;
235 
236  case 'ilpermissiongui':
237  $perm_gui = new ilPermissionGUI($this);
238  $this->ctrl->forwardCommand($perm_gui);
239  $this->tabs_gui->setTabActive('perm_settings');
240  break;
241 
242  default:
243  $this->tabs_gui->setTabActive('settings');
244  if (!$cmd || $cmd === 'view') {
245  $cmd = "editMaps";
246  }
247  $cmd .= "Object";
248  $this->$cmd();
249 
250  break;
251  }
252  }
prepareOutput(bool $show_sub_objects=true)
GUI for MathJax Settings This GUI maintains the MathJax config stored in the ILIAS settings Since ILI...
header include for all ilias files.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjExternalToolsSettingsGUI::getAdminTabs ( )

Definition at line 56 of file class.ilObjExternalToolsSettingsGUI.php.

References getTabs().

56  : void
57  {
58  $this->getTabs();
59  }
+ Here is the call graph for this function:

◆ getMapsForm()

ilObjExternalToolsSettingsGUI::getMapsForm ( )

Definition at line 98 of file class.ilObjExternalToolsSettingsGUI.php.

References ilObjectGUI\$access, ilObjectGUI\$ctrl, ILIAS\LTI\ToolProvider\$key, ilObjectGUI\$lng, ilObjectGUI\$type, ilMapUtil\DEFAULT_TILE, ilMapUtil\getApiKey(), ilMapUtil\getAvailableMapTypes(), ilMapUtil\getStdGeolocationServer(), ilMapUtil\getStdLatitude(), ilMapUtil\getStdLongitude(), ilMapUtil\getStdTileServers(), ilMapUtil\getStdZoom(), ilMapUtil\getType(), ilMapUtil\isActivated(), ilCheckboxInputGUI\setChecked(), ilLocationInputGUI\setLatitude(), and ilLanguage\txt().

Referenced by editMapsObject(), and saveMapsObject().

99  {
100  $ilAccess = $this->access;
101  $lng = $this->lng;
102  $ilCtrl = $this->ctrl;
103  $std_latitude = (float) ilMapUtil::getStdLatitude();
104  $std_longitude = (float) ilMapUtil::getStdLongitude();
105  $std_zoom = ilMapUtil::getStdZoom();
107  $form = new ilPropertyFormGUI();
108  $form->setFormAction($ilCtrl->getFormAction($this));
109  $form->setTitle($lng->txt("maps_settings"));
110 
111  // Enable Maps
112  $enable = new ilCheckboxInputGUI($lng->txt("maps_enable_maps"), "enable");
114  $enable->setInfo($lng->txt("maps_enable_maps_info"));
115  $form->addItem($enable);
116 
117  // Select type
118  $types = new ilSelectInputGUI($lng->txt("maps_map_type"), "type");
119  $types->setOptions(ilMapUtil::getAvailableMapTypes());
120  $types->setValue($type);
121  $form->addItem($types);
122 
123  // map data server property
124  if ($type === "openlayers") {
125  $tile = new ilTextInputGUI($lng->txt("maps_tile_server"), "tile");
126  $tile->setValue(ilMapUtil::getStdTileServers());
127  $tile->setInfo(sprintf($lng->txt("maps_custom_tile_server_info"), ilMapUtil::DEFAULT_TILE));
128  $geolocation = new ilTextInputGUI($lng->txt("maps_geolocation_server"), "geolocation");
129  $geolocation->setValue(ilMapUtil::getStdGeolocationServer());
130  $geolocation->setInfo($lng->txt("maps_custom_geolocation_server_info"));
131 
132  $form->addItem($tile);
133  $form->addItem($geolocation);
134  } else {
135  // api key for google
136  $key = new ilTextInputGUI("Google API Key", "api_key");
137  $key->setMaxLength(200);
138  $key->setValue(ilMapUtil::getApiKey());
139  $form->addItem($key);
140  }
141 
142  // location property
143  $loc_prop = new ilLocationInputGUI(
144  $lng->txt("maps_std_location"),
145  "std_location"
146  );
147 
148  $loc_prop->setLatitude($std_latitude);
149  $loc_prop->setLongitude($std_longitude);
150  $loc_prop->setZoom((int) $std_zoom);
151  $form->addItem($loc_prop);
152 
153  if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
154  $form->addCommandButton("saveMaps", $lng->txt("save"));
155  $form->addCommandButton("view", $lng->txt("cancel"));
156  }
157 
158  return $form;
159  }
static getType()
const DEFAULT_TILE
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...
This class represents a checkbox property in a property form.
static getStdLongitude()
static getStdZoom()
static getApiKey()
ilLanguage $lng
static getStdLatitude()
This class represents a location property in a property form.
string $key
Consumer key/client ID value.
Definition: System.php:193
static getAvailableMapTypes()
Get a dict { $id => $name } for available maps services.
static isActivated()
Checks whether Map feature is activated.
static getStdGeolocationServer()
Returns the reverse geolocation server to be used in the installation.
setLatitude(?float $a_latitude)
ilAccessHandler $access
static getStdTileServers()
Returns the tile server to be used in the installation.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTabs()

ilObjExternalToolsSettingsGUI::getTabs ( )
protected

Definition at line 61 of file class.ilObjExternalToolsSettingsGUI.php.

References $rbacsystem, ilRbacSystem\checkAccess(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

Referenced by getAdminTabs().

61  : void
62  {
64 
65  $this->ctrl->setParameter($this, "ref_id", $this->object->getRefId());
66 
67  if ($rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
68  $this->tabs_gui->addTarget(
69  "settings",
70  $this->ctrl->getLinkTarget($this, "view"),
71  array("editMaps", "editMathJax", ""),
72  "",
73  ""
74  );
75  $this->lng->loadLanguageModule('ecs');
76  }
77 
78  if ($rbacsystem->checkAccess('edit_permission', $this->object->getRefId())) {
79  $this->tabs_gui->addTarget(
80  "perm_settings",
81  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"),
82  array("perm","info","owner"),
83  'ilpermissiongui'
84  );
85  }
86  }
checkAccess(string $a_operations, int $a_ref_id, string $a_type="")
checkAccess represents the main method of the RBAC-system in ILIAS3 developers want to use With this ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSubTabs()

ilObjExternalToolsSettingsGUI::initSubTabs ( string  $a_cmd)

Definition at line 190 of file class.ilObjExternalToolsSettingsGUI.php.

References ILIAS\Repository\ctrl().

Referenced by editMapsObject(), and executeCommand().

190  : void
191  {
192  $maps = $a_cmd === 'editMaps';
193  $mathjax = $a_cmd === 'editMathJax';
194 
195  $this->tabs_gui->addSubTabTarget(
196  "maps_extt_maps",
197  $this->ctrl->getLinkTarget($this, "editMaps"),
198  "",
199  "",
200  "",
201  $maps
202  );
203  $this->tabs_gui->addSubTabTarget(
204  "mathjax_mathjax",
205  $this->ctrl->getLinkTargetByClass('ilMathJaxSettingsGUI'),
206  "",
207  "",
208  "",
209  $mathjax
210  );
211  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveMapsObject()

ilObjExternalToolsSettingsGUI::saveMapsObject ( )

Save Maps Settings.

Definition at line 164 of file class.ilObjExternalToolsSettingsGUI.php.

References ilObjectGUI\$ctrl, $location, getMapsForm(), ilMapUtil\getType(), ilMapUtil\setActivated(), ilMapUtil\setApiKey(), ilMapUtil\setStdGeolocationServer(), ilMapUtil\setStdLatitude(), ilMapUtil\setStdLongitude(), ilMapUtil\setStdTileServers(), ilMapUtil\setStdZoom(), and ilMapUtil\setType().

164  : void
165  {
166  $ilCtrl = $this->ctrl;
167 
168  $form = $this->getMapsForm();
169  if ($form->checkInput()) {
170  if ($form->getInput("type") === 'openlayers' && 'openlayers' === ilMapUtil::getType()) {
171  ilMapUtil::setStdTileServers($form->getInput("title"));
173  $form->getInput("geolocation")
174  );
175  } else {
176  ilMapUtil::setApiKey($form->getInput("api_key"));
177  }
178 
179  ilMapUtil::setActivated($form->getInput("enable") === "1");
180  ilMapUtil::setType($form->getInput("type"));
181  $location = $form->getInput("std_location");
182  ilMapUtil::setStdLatitude((string) $location["latitude"]);
183  ilMapUtil::setStdLongitude((string) $location["longitude"]);
184  ilMapUtil::setStdZoom((string) $location["zoom"]);
185  }
186  $ilCtrl->redirect($this, "editMaps");
187  }
static getType()
static setType(string $type)
static setActivated(bool $activated)
$location
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: buildRTE.php:22
static setStdTileServers(string $tile)
static setApiKey(string $api_key)
static setStdLongitude(string $lon)
static setStdLatitude(string $lat)
static setStdGeolocationServer($geolocation)
static setStdZoom(string $zoom)
+ Here is the call graph for this function:

Field Documentation

◆ $rbacreview

ilRbacReview ilObjExternalToolsSettingsGUI::$rbacreview

Definition at line 30 of file class.ilObjExternalToolsSettingsGUI.php.

◆ $rbacsystem

ilRbacSystem ilObjExternalToolsSettingsGUI::$rbacsystem

Definition at line 29 of file class.ilObjExternalToolsSettingsGUI.php.

Referenced by getTabs().


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