ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilObjExternalToolsSettingsGUI Class Reference

Class ilObjExternalToolsSettingsGUI. 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
 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] does belong to the parent 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...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 editAvailabilityPeriodObject ()
 
 saveAvailabilityPeriodObject ()
 
 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)
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Data Fields

const EDIT_WOPI = "editWopi"
 
ilRbacSystem $rbacsystem
 
ilRbacReview $rbacreview
 
- Data Fields inherited from ilObjectGUI
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
 
const SUPPORTED_IMPORT_MIME_TYPES = [MimeType::APPLICATION__ZIP, MimeType::APPLICATION__X_ZIP_COMPRESSED]
 

Protected Member Functions

 getTabs ()
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 createActionDispatcherGUI ()
 
 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...
 
 getCreationFormsHTML (StandardForm|ilPropertyFormGUI|array $form)
 
 getTitleForCreationFormPage ()
 
 getCreationFormTitle ()
 
 initCreateForm (string $new_type)
 
 didacticTemplatesToForm ()
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 retrieveAdditionalDidacticTemplateOptions ()
 
 addAdoptContentLinkToToolbar ()
 
 addImportButtonToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 parseDidacticTemplateVar (string $var, string $type)
 
 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...
 
 routeImportCmdObject ()
 
 importFile (string $file_to_import, string $path_to_uploaded_file_in_temp_dir)
 
 deleteUploadedImportFile (string $path_to_uploaded_file_in_temp_dir)
 
 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...
 
 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...
 
 getCreatableObjectTypes ()
 
 buildAddNewItemElements (array $subtypes, string $create_target_class=ilRepositoryGUI::class, ?int $redirect_target_ref_id=null,)
 
 buildGroup (string $create_target_class, array $obj_types_in_group, string $title, array $subtypes)
 

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
 
Refinery $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
Filesystem $temp_file_system
 
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

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 33 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().

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

Member Function Documentation

◆ editMapsObject()

ilObjExternalToolsSettingsGUI::editMapsObject ( )

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

References ilObjectGUI\$tpl, getMapsForm(), initSubTabs(), and ILIAS\UICore\GlobalTemplate\setContent().

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

◆ executeCommand()

ilObjExternalToolsSettingsGUI::executeCommand ( )

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

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

224  : void
225  {
226  $next_class = $this->ctrl->getNextClass($this);
227  $cmd = $this->ctrl->getCmd();
228  $this->prepareOutput();
229 
230  if (!$this->rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
231  $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
232  }
233 
234  switch ($next_class) {
235  case 'ilmathjaxsettingsgui':
236  $this->tabs_gui->setTabActive('settings');
237  $this->initSubTabs("editMathJax");
238  $this->ctrl->forwardCommand(new ilMathJaxSettingsGUI());
239  break;
240 
241  case 'ilecssettingsgui':
242  $this->tabs_gui->setTabActive('ecs_server_settings');
243  $this->ctrl->forwardCommand(new ilECSSettingsGUI());
244  break;
245 
246  case strtolower(ilWOPIAdministrationGUI::class):
247  $this->initSubTabs(self::EDIT_WOPI);
248  $this->ctrl->forwardCommand(new ilWOPIAdministrationGUI());
249  break;
250 
251  case 'ilpermissiongui':
252  $perm_gui = new ilPermissionGUI($this);
253  $this->ctrl->forwardCommand($perm_gui);
254  $this->tabs_gui->setTabActive('perm_settings');
255  break;
256 
257  default:
258  $this->tabs_gui->setTabActive('settings');
259  if (!$cmd || $cmd === 'view') {
260  $cmd = "editMaps";
261  }
262  $cmd .= "Object";
263  $this->$cmd();
264 
265  break;
266  }
267  }
prepareOutput(bool $show_sub_objects=true)
GUI for MathJax Settings This GUI maintains the MathJax config stored in the ILIAS settings Since ILI...
Class ilObjForumAdministration.
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjExternalToolsSettingsGUI::getAdminTabs ( )

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

References getTabs().

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

◆ getMapsForm()

ilObjExternalToolsSettingsGUI::getMapsForm ( )

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

References ilObjectGUI\$access, ilObjectGUI\$ctrl, 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(), ilLocationInputGUI\setLatitude(), ilSelectInputGUI\setOptions(), and ilLanguage\txt().

Referenced by editMapsObject(), and saveMapsObject().

101  {
102  $ilAccess = $this->access;
103  $lng = $this->lng;
104  $ilCtrl = $this->ctrl;
105  $std_latitude = (float) ilMapUtil::getStdLatitude();
106  $std_longitude = (float) ilMapUtil::getStdLongitude();
107  $std_zoom = ilMapUtil::getStdZoom();
109  $form = new ilPropertyFormGUI();
110  $form->setFormAction($ilCtrl->getFormAction($this));
111  $form->setTitle($lng->txt("maps_settings"));
112 
113  // Enable Maps
114  $enable = new ilCheckboxInputGUI($lng->txt("maps_enable_maps"), "enable");
115  $enable->setChecked(ilMapUtil::isActivated());
116  $enable->setInfo($lng->txt("maps_enable_maps_info"));
117  $form->addItem($enable);
118 
119  // Select type
120  $types = new ilSelectInputGUI($lng->txt("maps_map_type"), "type");
122  $types->setValue($type);
123  $form->addItem($types);
124 
125  // map data server property
126  if ($type === "openlayers") {
127  $tile = new ilTextInputGUI($lng->txt("maps_tile_server"), "tile");
128  $tile->setValue(ilMapUtil::getStdTileServers());
129  $tile->setInfo(sprintf($lng->txt("maps_custom_tile_server_info"), ilMapUtil::DEFAULT_TILE));
130  $geolocation = new ilTextInputGUI($lng->txt("maps_geolocation_server"), "geolocation");
131  $geolocation->setValue(ilMapUtil::getStdGeolocationServer());
132  $geolocation->setInfo($lng->txt("maps_custom_geolocation_server_info"));
133 
134  $form->addItem($tile);
135  $form->addItem($geolocation);
136  } else {
137  // api key for google
138  $key = new ilTextInputGUI("Google API Key", "api_key");
139  $key->setMaxLength(200);
140  $key->setValue(ilMapUtil::getApiKey());
141  $form->addItem($key);
142  }
143 
144  // location property
145  $loc_prop = new ilLocationInputGUI(
146  $lng->txt("maps_std_location"),
147  "std_location"
148  );
149 
150  $loc_prop->setLatitude($std_latitude);
151  $loc_prop->setLongitude($std_longitude);
152  $loc_prop->setZoom((int) $std_zoom);
153  $form->addItem($loc_prop);
154 
155  if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
156  $form->addCommandButton("saveMaps", $lng->txt("save"));
157  $form->addCommandButton("view", $lng->txt("cancel"));
158  }
159 
160  return $form;
161  }
static getType()
const DEFAULT_TILE
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)
static getStdLongitude()
static getStdZoom()
static getApiKey()
ilLanguage $lng
static getStdLatitude()
This class represents a location property in a property form.
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 63 of file class.ilObjExternalToolsSettingsGUI.php.

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

Referenced by getAdminTabs().

63  : void
64  {
66 
67  $this->ctrl->setParameter($this, "ref_id", $this->object->getRefId());
68 
69  if ($rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
70  $this->tabs_gui->addTarget(
71  "settings",
72  $this->ctrl->getLinkTarget($this, "view"),
73  array("editMaps", "editMathJax", ""),
74  "",
75  ""
76  );
77  $this->lng->loadLanguageModule('ecs');
78  }
79 
80  if ($rbacsystem->checkAccess('edit_permission', $this->object->getRefId())) {
81  $this->tabs_gui->addTarget(
82  "perm_settings",
83  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"),
84  array("perm","info","owner"),
85  'ilpermissiongui'
86  );
87  }
88  }
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 192 of file class.ilObjExternalToolsSettingsGUI.php.

References ILIAS\Repository\ctrl().

Referenced by editMapsObject(), and executeCommand().

192  : void
193  {
194  $maps = $a_cmd === 'editMaps';
195  $mathjax = $a_cmd === 'editMathJax';
196  $wopi = $a_cmd === self::EDIT_WOPI;
197 
198  $this->tabs_gui->addSubTabTarget(
199  "maps_extt_maps",
200  $this->ctrl->getLinkTarget($this, "editMaps"),
201  "",
202  "",
203  "",
204  $maps
205  );
206  $this->tabs_gui->addSubTabTarget(
207  "mathjax_mathjax",
208  $this->ctrl->getLinkTargetByClass('ilMathJaxSettingsGUI'),
209  "",
210  "",
211  "",
212  $mathjax
213  );
214  $this->tabs_gui->addSubTabTarget(
215  "wopi_settings",
216  $this->ctrl->getLinkTargetByClass(ilWOPIAdministrationGUI::class),
217  "",
218  "",
219  "",
220  $wopi
221  );
222  }
+ 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 166 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().

166  : void
167  {
168  $ilCtrl = $this->ctrl;
169 
170  $form = $this->getMapsForm();
171  if ($form->checkInput()) {
172  if ($form->getInput("type") === 'openlayers' && 'openlayers' === ilMapUtil::getType()) {
173  ilMapUtil::setStdTileServers($form->getInput("tile"));
175  $form->getInput("geolocation")
176  );
177  } else {
178  ilMapUtil::setApiKey($form->getInput("api_key"));
179  }
180 
181  ilMapUtil::setActivated($form->getInput("enable") === "1");
182  ilMapUtil::setType($form->getInput("type"));
183  $location = $form->getInput("std_location");
184  ilMapUtil::setStdLatitude((string) $location["latitude"]);
185  ilMapUtil::setStdLongitude((string) $location["longitude"]);
186  ilMapUtil::setStdZoom((string) $location["zoom"]);
187  }
188  $ilCtrl->redirect($this, "editMaps");
189  }
static getType()
static setType(string $type)
static setActivated(bool $activated)
$location
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 31 of file class.ilObjExternalToolsSettingsGUI.php.

◆ $rbacsystem

ilRbacSystem ilObjExternalToolsSettingsGUI::$rbacsystem

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

Referenced by getTabs().

◆ EDIT_WOPI

const ilObjExternalToolsSettingsGUI::EDIT_WOPI = "editWopi"

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


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