ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilObjSurveyAdministrationGUI 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 ilObjSurveyAdministrationGUI:
+ Collaboration diagram for ilObjSurveyAdministrationGUI:

Public Member Functions

 __construct ( $a_data, int $a_id, bool $a_call_by_reference)
 
 executeCommand ()
 
 settingsObject (?ilPropertyFormGUI $a_form=null)
 Display survey settings form. More...
 
 saveSettingsObject ()
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
- 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)
 

Protected Member Functions

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

Protected Attributes

ilTabsGUI $tabs
 
- 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 = ""
 

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]
 

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

Author
Helmut Schottmüller helmu.nosp@m.t.sc.nosp@m.hottm.nosp@m.uell.nosp@m.er@ma.nosp@m.c.co.nosp@m.m @ilCtrl_Calls ilObjSurveyAdministrationGUI: ilPermissionGUI

Definition at line 23 of file class.ilObjSurveyAdministrationGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjSurveyAdministrationGUI::__construct (   $a_data,
int  $a_id,
bool  $a_call_by_reference 
)

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

31 {
32 global $DIC;
33
34 $this->lng = $DIC->language();
35 $this->tabs = $DIC->tabs();
36 $this->tpl = $DIC["tpl"];
37 $this->access = $DIC->access();
38 $this->ctrl = $DIC->ctrl();
39 $lng = $DIC->language();
40
41 $this->type = "svyf";
42 $lng->loadLanguageModule("survey");
43 parent::__construct($a_data, $a_id, $a_call_by_reference, false);
44 }
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(), ilLanguage\loadLanguageModule(), and ILIAS\Repository\tabs().

+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilObjSurveyAdministrationGUI::executeCommand ( )

Reimplemented from ilObjectGUI.

Definition at line 46 of file class.ilObjSurveyAdministrationGUI.php.

46 : void
47 {
48 $ilTabs = $this->tabs;
49
50 $next_class = $this->ctrl->getNextClass($this);
51 $cmd = $this->ctrl->getCmd();
52 $this->prepareOutput();
53
54 switch ($next_class) {
55 case 'ilpermissiongui':
56 $ilTabs->activateTab("perm_settings");
57 $perm_gui = new ilPermissionGUI($this);
58 $this->ctrl->forwardCommand($perm_gui);
59 break;
60
61 default:
62 if ($cmd === null || $cmd === "" || $cmd === "view") {
63 $cmd = "settings";
64 }
65 $cmd .= "Object";
66 $this->$cmd();
67 break;
68 }
69 }
prepareOutput(bool $show_sub_objects=true)

References $tabs, ILIAS\Repository\ctrl(), and ilObjectGUI\prepareOutput().

+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjSurveyAdministrationGUI::getAdminTabs ( )

administration tabs show only permissions and trash folder

Reimplemented from ilObjectGUI.

Definition at line 184 of file class.ilObjSurveyAdministrationGUI.php.

184 : void
185 {
186 $this->getTabs();
187 }
getTabs()
@abstract overwrite in derived GUI class of your object type

◆ getTabs()

ilObjSurveyAdministrationGUI::getTabs ( )
protected

@abstract overwrite in derived GUI class of your object type

Reimplemented from ilObjectGUI.

Definition at line 189 of file class.ilObjSurveyAdministrationGUI.php.

189 : void
190 {
192
193 if ($this->rbac_system->checkAccess("visible,read", $this->object->getRefId())) {
194 $this->tabs_gui->addTab(
195 "settings",
196 $lng->txt("settings"),
197 $this->ctrl->getLinkTarget($this, "settings")
198 );
199 }
200 if ($this->checkPermissionBool("edit_permission")) {
201 $this->tabs_gui->addTab(
202 "perm_settings",
203 $lng->txt("perm_settings"),
204 $this->ctrl->getLinkTargetByClass('ilpermissiongui', "perm")
205 );
206 }
207 }
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...
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)

References $lng.

◆ initSettingsForm()

ilObjSurveyAdministrationGUI::initSettingsForm ( )
protected

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

90 {
91 $ilAccess = $this->access;
93 $ilCtrl = $this->ctrl;
94
95 $surveySetting = new ilSetting("survey");
96 $use_anonymous_id = (bool) $surveySetting->get("use_anonymous_id");
97
98 $form = new ilPropertyFormGUI();
99 $form->setFormAction($ilCtrl->getFormAction($this));
100 $form->setTitle($lng->txt("survey_defaults"));
101
102 // Survey Code
103 $code = new ilCheckboxInputGUI($lng->txt("use_anonymous_id"), "use_anonymous_id");
104 $code->setChecked($use_anonymous_id);
105 $code->setInfo($lng->txt("use_anonymous_id_desc"));
106 $form->addItem($code);
107
108 // Skipped
109 $eval_skipped = new ilRadioGroupInputGUI($lng->txt("svy_eval_skipped_value"), "skcust");
110 $eval_skipped->setRequired(true);
111 $form->addItem($eval_skipped);
112
113 $eval_skipped->setValue($surveySetting->get("skipped_is_custom", false)
114 ? "cust"
115 : "lng");
116
117 $skipped_lng = new ilRadioOption($lng->txt("svy_eval_skipped_value_lng"), "lng");
118 $skipped_lng->setInfo(sprintf($lng->txt("svy_eval_skipped_value_lng_info"), $lng->txt("skipped")));
119 $eval_skipped->addOption($skipped_lng);
120 $skipped_cust = new ilRadioOption($lng->txt("svy_eval_skipped_value_custom"), "cust");
121 $skipped_cust->setInfo($lng->txt("svy_eval_skipped_value_custom_info"));
122 $eval_skipped->addOption($skipped_cust);
123
124 $skipped_cust_value = new ilTextInputGUI($lng->txt("svy_eval_skipped_value_custom_value"), "cust_value");
125 $skipped_cust_value->setSize(15);
126 $skipped_cust_value->setValue($surveySetting->get("skipped_custom_value", ""));
127 $skipped_cust->addSubItem($skipped_cust_value);
128
129 $anon_part = new ilCheckboxInputGUI($lng->txt("svy_anonymous_participants"), "anon_part");
130 $anon_part->setInfo($lng->txt("svy_anonymous_participants_info"));
131 $anon_part->setChecked((bool) $surveySetting->get("anonymous_participants", '0'));
132 $form->addItem($anon_part);
133
134 $anon_part_min = new ilNumberInputGUI($lng->txt("svy_anonymous_participants_min"), "anon_part_min");
135 $anon_part_min->setInfo($lng->txt("svy_anonymous_participants_min_info"));
136 $anon_part_min->setSize(4);
137 $anon_part_min->setMinValue(1);
138 $anon_part_min->setValue($surveySetting->get("anonymous_participants_min", null));
139 $anon_part->addSubItem($anon_part_min);
140
141 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
142 $form->addCommandButton("saveSettings", $lng->txt("save"));
143 }
144
145 return $form;
146 }
This class represents a checkbox property in a property form.
This class represents a number property in a property form.
ilAccessHandler $access
This class represents a property form user interface.
This class represents a property in a property form.
This class represents an option in a radio group.
ILIAS Setting Class.
This class represents a text property in a property form.

References $lng.

Referenced by settingsObject().

+ Here is the caller graph for this function:

◆ saveSettingsObject()

ilObjSurveyAdministrationGUI::saveSettingsObject ( )

Definition at line 148 of file class.ilObjSurveyAdministrationGUI.php.

148 : void
149 {
150 $ilCtrl = $this->ctrl;
151 $ilAccess = $this->access;
152
153 if (!$ilAccess->checkAccess("write", "", $this->object->getRefId())) {
154 $ilCtrl->redirect($this, "settings");
155 }
156
157 $form = $this->initSettingsForm();
158 if ($form->checkInput()) {
159 $surveySetting = new ilSetting("survey");
160 $surveySetting->set("use_anonymous_id", $form->getInput("use_anonymous_id") ? "1" : "0");
161 $surveySetting->set("anonymous_participants", $form->getInput("anon_part") ? "1" : "0");
162 $surveySetting->set(
163 "anonymous_participants_min",
164 (trim($form->getInput("anon_part_min") ?? ""))
165 ? (string) (int) $form->getInput("anon_part_min")
166 : ""
167 );
168
169 if ($form->getInput("skcust") === "lng") {
170 $surveySetting->set("skipped_is_custom", false);
171 } else {
172 $surveySetting->set("skipped_is_custom", true);
173 $surveySetting->set("skipped_custom_value", trim($form->getInput("cust_value")));
174 }
175
176 $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
177 $ilCtrl->redirect($this, "settings");
178 }
179
180 $form->setValuesByPost();
181 $this->settingsObject($form);
182 }
settingsObject(?ilPropertyFormGUI $a_form=null)
Display survey settings form.

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ settingsObject()

ilObjSurveyAdministrationGUI::settingsObject ( ?ilPropertyFormGUI  $a_form = null)

Display survey settings form.

Definition at line 74 of file class.ilObjSurveyAdministrationGUI.php.

76 : void {
78 $ilTabs = $this->tabs;
79
80 $ilTabs->activateTab("settings");
81
82 if (!$a_form) {
83 $a_form = $this->initSettingsForm();
84 }
85
86 $tpl->setContent($a_form->getHTML());
87 }
ilGlobalTemplateInterface $tpl
activateTab(string $a_id)
setContent(string $a_html)
Sets content for standard template.

References initSettingsForm().

+ Here is the call graph for this function:

Field Documentation

◆ $tabs

ilTabsGUI ilObjSurveyAdministrationGUI::$tabs
protected

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

Referenced by executeCommand().


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