ILIAS  trunk Revision v12.0_alpha-16-g3e876e53c80
ilObjMapsGUI Class Reference

@ilCtrl_isCalledBy ilObjMapsGUI: ilAdministrationGUI @ilCtrl_Calls ilObjMapsGUI: ilPermissionGUI More...

+ Inheritance diagram for ilObjMapsGUI:
+ Collaboration diagram for ilObjMapsGUI:

Public Member Functions

 __construct ($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
 
 executeCommand ()
 
 view ()
 
- 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)
 

Private Member Functions

 initTabs ()
 
 buildForm ()
 
 save ()
 

Private Attributes

readonly ilRbacSystem $rbacsystem
 

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

@ilCtrl_isCalledBy ilObjMapsGUI: ilAdministrationGUI @ilCtrl_Calls ilObjMapsGUI: ilPermissionGUI

Definition at line 25 of file class.ilObjMapsGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjMapsGUI::__construct (   $data,
int  $id = 0,
bool  $call_by_reference = true,
bool  $prepare_output = true 
)

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

30 {
32 global $DIC;
33 $this->rbacsystem = $DIC->rbac()->system();
34 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References ilObjectGUI\$call_by_reference, ilObjectGUI\$data, $DIC, ilObjectGUI\$id, ilObjectGUI\$prepare_output, and ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ buildForm()

ilObjMapsGUI::buildForm ( )
private

Definition at line 83 of file class.ilObjMapsGUI.php.

84 {
86 $ilCtrl = $this->ctrl;
87 $std_latitude = (float) ilMapUtil::getStdLatitude();
88 $std_longitude = (float) ilMapUtil::getStdLongitude();
89 $std_zoom = ilMapUtil::getStdZoom();
91 $form = new ilPropertyFormGUI();
92 $form->setFormAction($ilCtrl->getFormAction($this));
93 $form->setTitle($lng->txt('maps_settings'));
94
95 // Enable Maps
96 $enable = new ilCheckboxInputGUI($lng->txt('maps_enable_maps'), 'enable');
97 $enable->setChecked(ilMapUtil::isActivated());
98 $enable->setInfo($lng->txt('maps_enable_maps_info'));
99 $form->addItem($enable);
100
101 // Select type
102 $types = new ilSelectInputGUI($lng->txt('maps_map_type'), 'type');
103 $types->setOptions(ilMapUtil::getAvailableMapTypes());
104 $types->setValue($type);
105 $form->addItem($types);
106
107 // map data server property
108 if ($type === 'openlayers') {
109 $tile = new ilTextInputGUI($lng->txt('maps_tile_server'), 'tile');
110 $tile->setValue(ilMapUtil::getStdTileServers());
111 $tile->setInfo(sprintf($lng->txt('maps_custom_tile_server_info'), ilMapUtil::DEFAULT_TILE));
112 $geolocation = new ilTextInputGUI($lng->txt('maps_geolocation_server'), 'geolocation');
113 $geolocation->setValue(ilMapUtil::getStdGeolocationServer());
114 $geolocation->setInfo($lng->txt('maps_custom_geolocation_server_info'));
115
116 $form->addItem($tile);
117 $form->addItem($geolocation);
118 } else {
119 // api key for google
120 $key = new ilTextInputGUI('Google API Key', 'api_key');
121 $key->setMaxLength(200);
122 $key->setValue(ilMapUtil::getApiKey());
123 $form->addItem($key);
124 }
125
126 // location property
127 $loc_prop = new ilLocationInputGUI(
128 $lng->txt('maps_std_location'),
129 'std_location'
130 );
131
132 $loc_prop->setLatitude($std_latitude);
133 $loc_prop->setLongitude($std_longitude);
134 $loc_prop->setZoom((int) $std_zoom);
135 $form->addItem($loc_prop);
136
137 if ($this->access->checkAccess('write', '', $this->object->getRefId())) {
138 $form->addCommandButton('save', $lng->txt('save'));
139 $form->addCommandButton('view', $lng->txt('cancel'));
140 }
141
142 return $form;
143 }
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()
ilLanguage $lng
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\$ctrl, ilObjectGUI\$lng, ilObjectGUI\$type, ILIAS\Repository\access(), 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 save(), and view().

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

◆ executeCommand()

ilObjMapsGUI::executeCommand ( )

Reimplemented from ilObjectGUI.

Definition at line 36 of file class.ilObjMapsGUI.php.

36 : void
37 {
38 if (!$this->rbacsystem->checkAccess('read', $this->object->getRefId())) {
39 $this->ilias->raiseError(
40 $this->lng->txt('permission_denied'),
41 $this->ilias->error_obj->MESSAGE
42 );
43 }
44
45 $this->lng->loadLanguageModule('maps');
46 $this->tpl->setTitle($this->lng->txt('obj_maps'));
47 $this->initTabs();
48 switch ($this->ctrl->getNextClass()) {
49 case strtolower(ilPermissionGUI::class):
50 $this->ctrl->forwardCommand(new ilPermissionGUI($this));
51 $this->tabs_gui->activateTab('permissions');
52 break;
53 default:
54 $cmd = $this->ctrl->getCmd('view');
55 if (in_array($cmd, ['view', 'save'], true)) {
56 $this->tabs_gui->activateTab('view');
57 $this->$cmd();
58 }
59 break;
60 }
61 }
Class ilObjForumAdministration.

References ILIAS\Repository\ctrl(), initTabs(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ initTabs()

ilObjMapsGUI::initTabs ( )
private

Definition at line 68 of file class.ilObjMapsGUI.php.

68 : void
69 {
70 $this->tabs_gui->addTab(
71 'view',
72 $this->lng->txt('view'),
73 $this->ctrl->getLinkTarget($this, 'view'),
74 );
75
76 $this->tabs_gui->addTab(
77 'permissions',
78 $this->lng->txt('perm_settings'),
79 $this->ctrl->getLinkTargetByClass([self::class, ilPermissionGUI::class], 'perm')
80 );
81 }

References ILIAS\Repository\lng().

Referenced by executeCommand().

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

◆ save()

ilObjMapsGUI::save ( )
private

Definition at line 145 of file class.ilObjMapsGUI.php.

145 : void
146 {
147 $form = $this->buildForm();
148 if ($form->checkInput()) {
149 if ($form->getInput('type') === 'openlayers' && 'openlayers' === ilMapUtil::getType()) {
150 ilMapUtil::setStdTileServers($form->getInput('tile'));
152 $form->getInput('geolocation')
153 );
154 } else {
155 ilMapUtil::setApiKey($form->getInput('api_key'));
156 }
157
158 ilMapUtil::setActivated($form->getInput('enable') === '1');
159 ilMapUtil::setType($form->getInput('type'));
160 $location = $form->getInput('std_location');
161 ilMapUtil::setStdLatitude((string) $location['latitude']);
162 ilMapUtil::setStdLongitude((string) $location['longitude']);
163 ilMapUtil::setStdZoom((string) $location['zoom']);
164 }
165 $this->ctrl->redirect($this, 'view');
166 }
$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 $location, buildForm(), ILIAS\Repository\ctrl(), 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:

◆ view()

ilObjMapsGUI::view ( )

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

63 : void
64 {
65 $this->tpl->setContent($this->buildForm()->getHTML());
66 }

References buildForm(), and ilObjectGUI\getHTML().

+ Here is the call graph for this function:

Field Documentation

◆ $rbacsystem

readonly ilRbacSystem ilObjMapsGUI::$rbacsystem
private

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


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