ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 ()
 administration tabs show only permissions and trash folder More...
 
 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 ()
 @abstract overwrite in derived GUI class of your object type More...
 
- 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 ()
 @abstract 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
 
GlobalHttpState $http
 
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
 
CustomIconFactory $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.

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
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

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

+ Here is the call graph for this function:

Member Function Documentation

◆ editMapsObject()

ilObjExternalToolsSettingsGUI::editMapsObject ( )

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

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

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

+ Here is the call graph for this function:

◆ executeCommand()

ilObjExternalToolsSettingsGUI::executeCommand ( )

Reimplemented from ilObjectGUI.

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

216 : void
217 {
218 $next_class = $this->ctrl->getNextClass($this);
219 $cmd = $this->ctrl->getCmd();
220 $this->prepareOutput();
221
222 if (!$this->rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
223 $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
224 }
225
226 switch ($next_class) {
227 case 'ilecssettingsgui':
228 $this->tabs_gui->setTabActive('ecs_server_settings');
229 $this->ctrl->forwardCommand(new ilECSSettingsGUI());
230 break;
231
232 case strtolower(ilWOPIAdministrationGUI::class):
233 $this->initSubTabs(self::EDIT_WOPI);
234 $this->ctrl->forwardCommand(new ilWOPIAdministrationGUI());
235 break;
236
237 case 'ilpermissiongui':
238 $perm_gui = new ilPermissionGUI($this);
239 $this->ctrl->forwardCommand($perm_gui);
240 $this->tabs_gui->setTabActive('perm_settings');
241 break;
242
243 default:
244 $this->tabs_gui->setTabActive('settings');
245 if (!$cmd || $cmd === 'view') {
246 $cmd = "editMaps";
247 }
248 $cmd .= "Object";
249 $this->$cmd();
250
251 break;
252 }
253 }
prepareOutput(bool $show_sub_objects=true)
Class ilObjForumAdministration.

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

+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjExternalToolsSettingsGUI::getAdminTabs ( )

administration tabs show only permissions and trash folder

Reimplemented from ilObjectGUI.

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

58 : void
59 {
60 $this->getTabs();
61 }
getTabs()
@abstract overwrite in derived GUI class of your object type

References getTabs().

+ Here is the call graph for this function:

◆ getMapsForm()

ilObjExternalToolsSettingsGUI::getMapsForm ( )

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

101 {
102 $ilAccess = $this->access;
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");
121 $types->setOptions(ilMapUtil::getAvailableMapTypes());
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 }
This class represents a checkbox 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...
This class represents a location property in a property form.
static getApiKey()
static getStdGeolocationServer()
Returns the reverse geolocation server to be used in the installation.
static getStdLatitude()
static getStdTileServers()
Returns the tile server to be used in the installation.
static getStdLongitude()
static getStdZoom()
const DEFAULT_TILE
static isActivated()
Checks whether Map feature is activated.
static getAvailableMapTypes()
Get a dict { $id => $name } for available maps services.
static getType()
ilAccessHandler $access
This class represents a property form user interface.
This class represents a selection list property in a property form.
This class represents a text property in a property form.

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(), and ilLanguage\txt().

Referenced by editMapsObject(), and saveMapsObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTabs()

ilObjExternalToolsSettingsGUI::getTabs ( )
protected

@abstract overwrite in derived GUI class of your object type

Reimplemented from ilObjectGUI.

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

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 ...

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

Referenced by getAdminTabs().

+ 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.

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 "wopi_settings",
208 $this->ctrl->getLinkTargetByClass(ilWOPIAdministrationGUI::class),
209 "",
210 "",
211 "",
212 $wopi
213 );
214 }

References ILIAS\Repository\ctrl(), and EDIT_WOPI.

Referenced by editMapsObject(), and executeCommand().

+ 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.

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 }
$location
Definition: buildRTE.php:22
static setActivated(bool $activated)
static setStdLongitude(string $lon)
static setStdTileServers(string $tile)
static setStdLatitude(string $lat)
static setStdGeolocationServer($geolocation)
static setStdZoom(string $zoom)
static setType(string $type)
static setApiKey(string $api_key)

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

+ 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.

Referenced by initSubTabs().


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