ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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 ()
 
- Public Member Functions inherited from ilObjectGUI
 __construct ($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
 
 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] don't belong to the current 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...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 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)
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html Should be overwritten and redirect to settings screen. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Protected Member Functions

 initSettingsForm ()
 
 getTabs ()
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 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...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 getCreationFormsHTML (array $forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm (string $new_type)
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 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...
 
 initImportForm (string $new_type)
 
 importFileObject (int $parent_id=null)
 
 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...
 
 fillCloneTemplate (?string $tpl_name, string $type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. 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...
 
 showCustomIconsEditing ( $input_colspan=1, ilPropertyFormGUI $form=null, $as_section=true)
 show edit section of custom icons for container More...
 

Protected Attributes

ilTabsGUI $tabs
 
- 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
 
Factory $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
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 ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
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
 

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

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

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.
global $DIC
Definition: feed.php:28
ilLanguage $lng
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilObjSurveyAdministrationGUI::executeCommand ( )

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

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

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)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjSurveyAdministrationGUI::getAdminTabs ( )

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

References getTabs().

184  : void
185  {
186  $this->getTabs();
187  }
+ Here is the call graph for this function:

◆ getTabs()

ilObjSurveyAdministrationGUI::getTabs ( )
protected

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

References ilObjectGUI\$lng, ilObjectGUI\checkPermissionBool(), ILIAS\Repository\ctrl(), and ilLanguage\txt().

Referenced by getAdminTabs().

189  : void
190  {
191  $lng = $this->lng;
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...
ilLanguage $lng
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSettingsForm()

ilObjSurveyAdministrationGUI::initSettingsForm ( )
protected

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

References ilObjectGUI\$access, ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilCheckboxInputGUI\setChecked(), ilRadioOption\setInfo(), ilFormPropertyGUI\setInfo(), ilFormPropertyGUI\setRequired(), and ilLanguage\txt().

Referenced by saveSettingsObject(), and settingsObject().

90  {
91  $ilAccess = $this->access;
92  $lng = $this->lng;
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 file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
setInfo(string $a_info)
This class represents a checkbox property in a property form.
ilLanguage $lng
This class represents a property in a property form.
This class represents a number property in a property form.
setRequired(bool $a_required)
ilAccessHandler $access
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveSettingsObject()

ilObjSurveyAdministrationGUI::saveSettingsObject ( )

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

References ilObjectGUI\$access, ilObjectGUI\$ctrl, initSettingsForm(), ILIAS\Repository\lng(), and settingsObject().

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  }
ilAccessHandler $access
settingsObject(ilPropertyFormGUI $a_form=null)
Display survey settings form.
+ 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.

References $tabs, ilObjectGUI\$tpl, ilTabsGUI\activateTab(), initSettingsForm(), and ilGlobalTemplateInterface\setContent().

Referenced by saveSettingsObject().

76  : void {
77  $tpl = $this->tpl;
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
setContent(string $a_html)
Sets content for standard template.
activateTab(string $a_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $tabs

ilTabsGUI ilObjSurveyAdministrationGUI::$tabs
protected

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

Referenced by executeCommand(), and settingsObject().


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