ILIAS  trunk Revision v12.0_alpha-1329-g1094ddb0c33
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 84 of file class.ilObjMapsGUI.php.

85 {
87 $ilCtrl = $this->ctrl;
88 $std_latitude = (float) ilMapUtil::getStdLatitude();
89 $std_longitude = (float) ilMapUtil::getStdLongitude();
90 $std_zoom = ilMapUtil::getStdZoom();
92 $form = new ilPropertyFormGUI();
93 $form->setFormAction($ilCtrl->getFormAction($this));
94 $form->setTitle($lng->txt('maps_settings'));
95
96 // Enable Maps
97 $enable = new ilCheckboxInputGUI($lng->txt('maps_enable_maps'), 'enable');
98 $enable->setChecked(ilMapUtil::isActivated());
99 $enable->setInfo($lng->txt('maps_enable_maps_info'));
100 $form->addItem($enable);
101
102 // Select type
103 $types = new ilSelectInputGUI($lng->txt('maps_map_type'), 'type');
104 $types->setOptions(ilMapUtil::getAvailableMapTypes());
105 $types->setValue($type);
106 $form->addItem($types);
107
108 // map data server property
109 if ($type === 'openlayers') {
110 $tile = new ilTextInputGUI($lng->txt('maps_tile_server'), 'tile');
111 $tile->setValue(ilMapUtil::getStdTileServers());
112 $tile->setInfo(sprintf($lng->txt('maps_custom_tile_server_info'), ilMapUtil::DEFAULT_TILE));
113 $geolocation = new ilTextInputGUI($lng->txt('maps_geolocation_server'), 'geolocation');
114 $geolocation->setValue(ilMapUtil::getStdGeolocationServer());
115 $geolocation->setInfo($lng->txt('maps_custom_geolocation_server_info'));
116
117 $form->addItem($tile);
118 $form->addItem($geolocation);
119 } else {
120 // api key for google
121 $key = new ilTextInputGUI('Google API Key', 'api_key');
122 $key->setMaxLength(200);
123 $key->setValue(ilMapUtil::getApiKey());
124 $form->addItem($key);
125 }
126
127 // location property
128 $loc_prop = new ilLocationInputGUI(
129 $lng->txt('maps_std_location'),
130 'std_location'
131 );
132
133 $loc_prop->setLatitude($std_latitude);
134 $loc_prop->setLongitude($std_longitude);
135 $loc_prop->setZoom((int) $std_zoom);
136 $form->addItem($loc_prop);
137
138 if ($this->access->checkAccess('write', '', $this->object->getRefId())) {
139 $form->addCommandButton('save', $lng->txt('save'));
140 $form->addCommandButton('view', $lng->txt('cancel'));
141 }
142
143 return $form;
144 }
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->tpl->setTitleIcon(ilObject::_getIcon($this->object->getId()));
48 $this->initTabs();
49 switch ($this->ctrl->getNextClass()) {
50 case strtolower(ilPermissionGUI::class):
51 $this->ctrl->forwardCommand(new ilPermissionGUI($this));
52 $this->tabs_gui->activateTab('permissions');
53 break;
54 default:
55 $cmd = $this->ctrl->getCmd('view');
56 if (in_array($cmd, ['view', 'save'], true)) {
57 $this->tabs_gui->activateTab('view');
58 $this->$cmd();
59 }
60 break;
61 }
62 }
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
Class ilObjForumAdministration.

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

+ Here is the call graph for this function:

◆ initTabs()

ilObjMapsGUI::initTabs ( )
private

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

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

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 146 of file class.ilObjMapsGUI.php.

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

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

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: