ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ilObjSurveyQuestionPoolGUI Class Reference

Class ilObjSurveyQuestionPoolGUI. More...

+ Inheritance diagram for ilObjSurveyQuestionPoolGUI:
+ Collaboration diagram for ilObjSurveyQuestionPoolGUI:

Public Member Functions

 __construct ()
 
 executeCommand ()
 
 propertiesObject (ilPropertyFormGUI $a_form=null)
 Edit question pool properties. More...
 
 copyObject ()
 Copies checked questions in the questionpool to a clipboard. More...
 
 moveObject ()
 mark one or more question objects for moving More...
 
 exportQuestionObject ()
 export a question More...
 
 exportQuestionExportTabObject ()
 
 deleteQuestionsObject ()
 Creates a confirmation form to delete questions from the question pool. More...
 
 confirmDeleteQuestionsObject ()
 
 cancelDeleteQuestionsObject ()
 
 pasteObject ()
 paste questions from the clipboard into the question pool More...
 
 importQuestionsObject ()
 display the import form to import questions into the question pool More...
 
 getImportForm ()
 
 uploadQuestionsObject ()
 imports question(s) into the questionpool More...
 
 filterQuestionBrowserObject ()
 
 resetfilterQuestionBrowserObject ()
 
 questionsObject ()
 list questions of question pool More...
 
 updateObject ()
 
 exportObject ()
 list all export files More...
 
 downloadExportFileObject ()
 download export file More...
 
 confirmDeleteExportFileObject ()
 confirmation screen for export file deletion More...
 
 cancelDeleteExportFileObject ()
 
 deleteExportFileObject ()
 
 createQuestionObject ()
 create new question More...
 
 previewObject ()
 create preview of object More...
 
 infoScreenObject ()
 this one is called from the info button in the repository More...
 
 infoScreenForward ()
 show information screen More...
 
 saveObligatoryObject ()
 Save obligatory states. 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)
 

Static Public Member Functions

static _goto (string $a_target)
 Redirect script to call a survey question pool reference id. More...
 
- 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

string $defaultscript
 
- 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

 afterSave (ilObject $new_object)
 
 importFile (string $file_to_import, string $path_to_uploaded_file_in_temp_dir)
 
 addLocatorItems ()
 
 getTabs ()
 
- 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 ()
 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

ILIAS SurveyQuestionPool InternalGUIService $gui
 
ILIAS SurveyQuestionPool Editing EditManager $edit_manager
 
bool $update
 
EditingGUIRequest $edit_request
 
ilNavigationHistory $nav_history
 
ilHelpGUI $help
 
ilLogger $log
 
RefineryFactory $refinery
 
HTTPServices $http
 
ILIASArchives $archives
 
- 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
 
Refinery $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $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()

ilObjSurveyQuestionPoolGUI::__construct ( )

Definition at line 52 of file class.ilObjSurveyQuestionPoolGUI.php.

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), ilLoggerFactory\getLogger(), ILIAS\Repository\help(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ILIAS\Repository\toolbar().

53  {
54  global $DIC;
55 
56  $this->nav_history = $DIC["ilNavigationHistory"];
57  $this->toolbar = $DIC->toolbar();
58  $this->help = $DIC["ilHelp"];
59  $this->refinery = $DIC->refinery();
60  $this->http = $DIC->http();
61  $this->archives = $DIC->archives();
62  $this->edit_request = $DIC->surveyQuestionPool()
63  ->internal()
64  ->gui()
65  ->editing()
66  ->request();
67  $this->edit_manager = $DIC->surveyQuestionPool()
68  ->internal()
69  ->domain()
70  ->editing();
71 
72  $this->type = "spl";
73 
75  "",
76  $this->edit_request->getRefId(),
77  true,
78  false
79  );
80  $this->lng->loadLanguageModule("survey");
81  $this->ctrl->saveParameter($this, array("ref_id"));
82  $this->log = ilLoggerFactory::getLogger('svy');
83  $this->gui = $DIC->surveyQuestionPool()->internal()->gui();
84  }
static getLogger(string $a_component_id)
Get component logger.
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:25
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjSurveyQuestionPoolGUI::_goto ( string  $a_target)
static

Redirect script to call a survey question pool reference id.

Definition at line 761 of file class.ilObjSurveyQuestionPoolGUI.php.

References ilObjectGUI\$ctrl, $DIC, ilObjectGUI\$lng, ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilCtrl\redirectByClass(), ROOT_FOLDER_ID, ilCtrl\setParameterByClass(), and ilLanguage\txt().

761  : void
762  {
763  global $DIC;
764  $main_tpl = $DIC->ui()->mainTemplate();
765 
766  $ctrl = $DIC->ctrl();
767  $ilAccess = $DIC->access();
768  $lng = $DIC->language();
769 
770  if ($ilAccess->checkAccess("visible", "", $a_target) ||
771  $ilAccess->checkAccess("read", "", $a_target)) {
772  $ctrl->setParameterByClass("ilObjSurveyQuestionPoolGUI", "ref_id", $a_target);
773  $ctrl->redirectByClass("ilObjSurveyQuestionPoolGUI", "infoScreen");
774  } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
775  $main_tpl->setOnScreenMessage('failure', sprintf(
776  $lng->txt("msg_no_perm_read_item"),
778  ), true);
780  }
781  }
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
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...
const ROOT_FOLDER_ID
Definition: constants.php:32
setParameterByClass(string $a_class, string $a_parameter, $a_value)
static _lookupObjId(int $ref_id)
ilLanguage $lng
static _lookupTitle(int $obj_id)
global $DIC
Definition: shib_login.php:25
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjSurveyQuestionPoolGUI::addLocatorItems ( )
protected

Definition at line 665 of file class.ilObjSurveyQuestionPoolGUI.php.

References ilObjectGUI\$locator, SurveyQuestion\_getQuestionType(), SurveyQuestion\_getTitle(), ILIAS\Repository\ctrl(), and ILIAS\Repository\object().

665  : void
666  {
667  $ilLocator = $this->locator;
668  switch ($this->ctrl->getCmd()) {
669  case "create":
670  case "importFile":
671  case "cancel":
672  break;
673  default:
674  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $this->edit_request->getRefId());
675  break;
676  }
677  if ($this->edit_request->getQuestionId() > 0) {
678  $q_id = $this->edit_request->getQuestionId();
679  $q_type = SurveyQuestion::_getQuestionType($q_id) . "GUI";
680  $q_title = SurveyQuestion::_getTitle($q_id);
681  if ($q_title) {
682  // not on create
683  $this->ctrl->setParameterByClass($q_type, "q_id", $q_id);
684  $ilLocator->addItem(
685  $q_title,
686  $this->ctrl->getLinkTargetByClass($q_type, "editQuestion")
687  );
688  }
689  }
690  }
static _getQuestionType(int $question_id)
Returns the question type of a question with a given id.
static _getTitle(int $question_id)
Returns the question title of a question with a given id.
ilLocatorGUI $locator
+ Here is the call graph for this function:

◆ afterSave()

ilObjSurveyQuestionPoolGUI::afterSave ( ilObject  $new_object)
protected

Definition at line 462 of file class.ilObjSurveyQuestionPoolGUI.php.

References ilObject\getRefId(), ILIAS\Repository\lng(), and ilUtil\redirect().

462  : void
463  {
464  // always send a message
465  $this->tpl->setOnScreenMessage('success', $this->lng->txt("object_added"), true);
466 
467  ilUtil::redirect("ilias.php?ref_id=" . $new_object->getRefId() .
468  "&baseClass=ilObjSurveyQuestionPoolGUI");
469  }
static redirect(string $a_script)
+ Here is the call graph for this function:

◆ cancelDeleteExportFileObject()

ilObjSurveyQuestionPoolGUI::cancelDeleteExportFileObject ( )

Definition at line 544 of file class.ilObjSurveyQuestionPoolGUI.php.

References ilSession\clear(), and ILIAS\Repository\ctrl().

544  : void
545  {
546  ilSession::clear("ilExportFiles");
547  $this->ctrl->redirect($this, "export");
548  }
static clear(string $a_var)
+ Here is the call graph for this function:

◆ cancelDeleteQuestionsObject()

ilObjSurveyQuestionPoolGUI::cancelDeleteQuestionsObject ( )

Definition at line 304 of file class.ilObjSurveyQuestionPoolGUI.php.

References ILIAS\Repository\ctrl().

304  : void
305  {
306  // delete questions after confirmation
307  $this->ctrl->redirect($this, "questions");
308  }
+ Here is the call graph for this function:

◆ confirmDeleteExportFileObject()

ilObjSurveyQuestionPoolGUI::confirmDeleteExportFileObject ( )

confirmation screen for export file deletion

Definition at line 521 of file class.ilObjSurveyQuestionPoolGUI.php.

References ilObjectGUI\$data, ILIAS\Repository\ctrl(), ilDatePresentation\formatDate(), IL_CAL_UNIX, and ILIAS\Repository\lng().

521  : void
522  {
523  $files = $this->edit_request->getFiles();
524  if (count($files) === 0) {
525  $this->tpl->setOnScreenMessage('info', $this->lng->txt("no_checkbox"), true);
526  $this->ctrl->redirect($this, "export");
527  }
528 
529  $this->tpl->setOnScreenMessage('question', $this->lng->txt("info_delete_sure"));
530  $table_gui = new ilSurveyQuestionPoolExportTableGUI($this, 'export', true);
531  $export_dir = $this->object->getExportDirectory();
532  $data = array();
533  foreach ($files as $exp_file) {
534  $file_arr = explode("__", $exp_file);
535  $data[] = array('file' => $exp_file,
536  'date' => ilDatePresentation::formatDate(new ilDateTime($file_arr[0], IL_CAL_UNIX)),
537  'size' => filesize($export_dir . "/" . $exp_file)
538  );
539  }
540  $table_gui->setData($data);
541  $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
542  }
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ilObjUser $user=null,)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const IL_CAL_UNIX
+ Here is the call graph for this function:

◆ confirmDeleteQuestionsObject()

ilObjSurveyQuestionPoolGUI::confirmDeleteQuestionsObject ( )

Definition at line 293 of file class.ilObjSurveyQuestionPoolGUI.php.

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

293  : void
294  {
295  // delete questions after confirmation
296  $this->tpl->setOnScreenMessage('success', $this->lng->txt("qpl_questions_deleted"), true);
297  $qids = $this->edit_request->getQuestionIds();
298  foreach ($qids as $q_id) {
299  $this->object->removeQuestion($q_id);
300  }
301  $this->ctrl->redirect($this, "questions");
302  }
+ Here is the call graph for this function:

◆ copyObject()

ilObjSurveyQuestionPoolGUI::copyObject ( )

Copies checked questions in the questionpool to a clipboard.

Definition at line 200 of file class.ilObjSurveyQuestionPoolGUI.php.

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

200  : void
201  {
202  $qids = $this->edit_request->getQuestionIds();
203  if (count($qids) > 0) {
204  foreach ($qids as $key => $value) {
205  $this->object->copyToClipboard($value);
206  }
207  $this->tpl->setOnScreenMessage('info', $this->lng->txt("spl_copy_insert_clipboard"), true);
208  } else {
209  $this->tpl->setOnScreenMessage('info', $this->lng->txt("spl_copy_select_none"), true);
210  }
211  $this->ctrl->redirect($this, "questions");
212  }
+ Here is the call graph for this function:

◆ createQuestionObject()

ilObjSurveyQuestionPoolGUI::createQuestionObject ( )

create new question

Definition at line 572 of file class.ilObjSurveyQuestionPoolGUI.php.

References ilObjectGUI\$user, SurveyQuestionGUI\_getQuestionGUI(), ILIAS\Repository\ctrl(), ILIAS\Repository\object(), and ilObjUser\writePref().

572  : void
573  {
574  $ilUser = $this->user;
575 
576  $ilUser->writePref(
577  "svy_lastquestiontype",
578  $this->edit_request->getSelectedQuestionTypes()
579  );
580 
582  $this->edit_request->getSelectedQuestionTypes()
583  );
584  $q_gui->object->setObjId($this->object->getId());
585  $q_gui->object->createNewQuestion();
586 
587  $this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $q_gui->object->getId());
588  $this->ctrl->setParameterByClass(
589  get_class($q_gui),
590  "sel_question_types",
591  $this->edit_request->getSelectedQuestionTypes()
592  );
593  $this->ctrl->redirectByClass(get_class($q_gui), "editQuestion");
594  }
writePref(string $a_keyword, string $a_value)
static _getQuestionGUI(?string $questiontype, int $question_id=-1)
Creates a question gui representation.
+ Here is the call graph for this function:

◆ deleteExportFileObject()

ilObjSurveyQuestionPoolGUI::deleteExportFileObject ( )

Definition at line 550 of file class.ilObjSurveyQuestionPoolGUI.php.

References ILIAS\Repository\ctrl(), and ilFileUtils\delDir().

550  : void
551  {
552  $export_dir = $this->object->getExportDirectory();
553  $files = $this->edit_request->getFiles();
554  foreach ($files as $file) {
555  $file = basename($file);
556 
557  $exp_file = $export_dir . "/" . $file;
558  $exp_dir = $export_dir . "/" . substr($file, 0, -4);
559  if (is_file($exp_file)) {
560  unlink($exp_file);
561  }
562  if (is_dir($exp_dir)) {
563  ilFileUtils::delDir($exp_dir);
564  }
565  }
566  $this->ctrl->redirect($this, "export");
567  }
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
+ Here is the call graph for this function:

◆ deleteQuestionsObject()

ilObjSurveyQuestionPoolGUI::deleteQuestionsObject ( )

Creates a confirmation form to delete questions from the question pool.

Definition at line 260 of file class.ilObjSurveyQuestionPoolGUI.php.

References ilObjectGUI\$data, $txt, SurveyQuestion\_getQuestionTypeName(), ilObjectGUI\checkPermission(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and questionsObject().

260  : void
261  {
262  $this->checkPermission('write');
263 
264  // create an array of all checked checkboxes
265  $checked_questions = $this->edit_request->getQuestionIds();
266  if (count($checked_questions) === 0) {
267  $this->tpl->setOnScreenMessage('info', $this->lng->txt("qpl_delete_select_none"));
268  $this->questionsObject();
269  return;
270  }
271 
272  $cgui = new ilConfirmationGUI();
273  $cgui->setHeaderText($this->lng->txt("qpl_confirm_delete_questions"));
274 
275  $cgui->setFormAction($this->ctrl->getFormAction($this));
276  $cgui->setCancel($this->lng->txt("cancel"), "cancelDeleteQuestions");
277  $cgui->setConfirm($this->lng->txt("confirm"), "confirmDeleteQuestions");
278 
279  $infos = $this->object->getQuestionInfos($checked_questions);
280  foreach ($infos as $data) {
281  $txt = $data["title"] . " (" .
282  SurveyQuestion::_getQuestionTypeName($data["type_tag"]) . ")";
283  if ($data["description"]) {
284  $txt .= "<div class=\"small\">" . $data["description"] . "</div>";
285  }
286 
287  $cgui->addItem("q_id[]", $data["id"], $txt);
288  }
289 
290  $this->tpl->setContent($cgui->getHTML());
291  }
static _getQuestionTypeName(string $type_tag)
Return the translation for a given question type.
$txt
Definition: error.php:30
questionsObject()
list questions of question pool
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ downloadExportFileObject()

ilObjSurveyQuestionPoolGUI::downloadExportFileObject ( )

download export file

Definition at line 497 of file class.ilObjSurveyQuestionPoolGUI.php.

References ILIAS\Repository\ctrl(), ilFileDelivery\deliverFileLegacy(), and ILIAS\Repository\lng().

497  : void
498  {
499  $files = $this->edit_request->getFiles();
500  if (count($files) === 0) {
501  $this->tpl->setOnScreenMessage('info', $this->lng->txt("no_checkbox"), true);
502  $this->ctrl->redirect($this, "export");
503  }
504 
505  if (count($files) > 1) {
506  $this->tpl->setOnScreenMessage('info', $this->lng->txt("select_max_one_item"), true);
507  $this->ctrl->redirect($this, "export");
508  }
509 
510 
511  $export_dir = $this->object->getExportDirectory();
512 
513  $file = basename($files[0]);
514 
515  ilFileDelivery::deliverFileLegacy($export_dir . "/" . $file, $file);
516  }
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
+ Here is the call graph for this function:

◆ executeCommand()

ilObjSurveyQuestionPoolGUI::executeCommand ( )

Definition at line 86 of file class.ilObjSurveyQuestionPoolGUI.php.

References $nav_history, SurveyQuestionGUI\_getQuestionGUI(), ilObjectGUI\checkPermission(), ilObjectGUI\checkPermissionBool(), ILIAS\Repository\ctrl(), ilObjectGUI\getCreationMode(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), ilUtil\getStyleSheetLocation(), infoScreenForward(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ilObjectGUI\prepareOutput().

86  : void
87  {
88  $ilNavigationHistory = $this->nav_history;
89  if (!$this->checkPermissionBool("visible") &&
90  !$this->checkPermissionBool("read")) {
91  $this->checkPermission("read");
92  }
93 
94  // add entry to navigation history
95  if (!$this->getCreationMode() &&
96  $this->checkPermissionBool("read")) {
97  $ilNavigationHistory->addItem(
98  $this->ref_id,
99  "ilias.php?baseClass=ilObjSurveyQuestionPoolGUI&cmd=questions&ref_id=" . $this->ref_id,
100  "spl"
101  );
102  }
103 
104  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "survey.css"), "screen");
105  $this->prepareOutput();
106 
107  $cmd = $this->ctrl->getCmd("questions");
108  $next_class = $this->ctrl->getNextClass($this);
109  if ($cmd !== "cancel") {
110  $this->ctrl->setReturn($this, "questions");
111  }
112  $q_type = "";
113  if ($this->edit_request->getQuestionId() < 1) {
114  $q_type = $this->edit_request->getSelectedQuestionTypes();
115  }
116 
117  $this->log->debug("- cmd=" . $cmd . " next_class=" . $next_class);
118  switch ($next_class) {
119  case 'ilobjectmetadatagui':
120  $this->tabs_gui->activateTab("meta_data");
121  $this->checkPermission('write');
122  $md_gui = new ilObjectMetaDataGUI($this->object);
123  $this->ctrl->forwardCommand($md_gui);
124  break;
125 
126  case 'ilpermissiongui':
127  $perm_gui = new ilPermissionGUI($this);
128  $this->ctrl->forwardCommand($perm_gui);
129  break;
130 
131  case 'ilobjectcopygui':
132  $cp = new ilObjectCopyGUI($this);
133  $cp->setType('spl');
134  $this->ctrl->forwardCommand($cp);
135  break;
136 
137  case 'ilinfoscreengui':
138  $this->tabs_gui->activateTab("info_short");
139  $this->infoScreenForward();
140  break;
141 
142  case "ilcommonactiondispatchergui":
144  $this->ctrl->forwardCommand($gui);
145  break;
146 
147  case strtolower(\ILIAS\SurveyQuestionPool\Settings\SettingsGUI::class):
148  $this->checkPermission("write");
149  $this->tabs_gui->activateTab("settings");
150  $gui = $this->gui->settings()->settingsGUI(
151  $this->object->getId(),
152  $this->object->getRefId()
153  );
154  $this->ctrl->forwardCommand($gui);
155  break;
156 
157  case strtolower(ilExportGUI::class):
158  $export = new ilExportGUI($this, $this->object);
159  $this->ctrl->forwardCommand($export);
160  break;
161 
162  case "":
163  $cmd .= "Object";
164  $this->$cmd();
165  break;
166 
167  default:
169  $q_type,
170  $this->edit_request->getQuestionId()
171  );
172  $this->log->debug("- This is the switch/case default, going to question id =" . $this->edit_request->getQuestionId());
173  $q_gui->setQuestionTabs();
174  $this->ctrl->forwardCommand($q_gui);
175 
176  // not on create
177  if ($q_gui->object->isComplete()) {
178  $this->tpl->setTitle($this->lng->txt("question") . ": " . $q_gui->object->getTitle());
179  }
180  break;
181  }
182  if (strtolower($this->edit_request->getBaseClass()) !== "iladministrationgui" &&
183  $this->getCreationMode() !== true) {
184  $this->tpl->printToStdout();
185  }
186  }
static getStyleSheetLocation(string $mode="output", string $a_css_name="")
get full style sheet file name (path inclusive) of current user
Class ilObjectMetaDataGUI.
GUI class for the workflow of copying objects.
ILIAS SurveyQuestionPool InternalGUIService $gui
prepareOutput(bool $show_sub_objects=true)
Interface Observer Contains several chained tasks and infos about them.
static _getQuestionGUI(?string $questiontype, int $question_id=-1)
Creates a question gui representation.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
+ Here is the call graph for this function:

◆ exportObject()

ilObjSurveyQuestionPoolGUI::exportObject ( )

list all export files

Definition at line 474 of file class.ilObjSurveyQuestionPoolGUI.php.

References ilObjectGUI\$object, ilObjectGUI\checkPermission(), and ILIAS\Repository\ctrl().

474  : void
475  {
476  $export = new ilExportGUI($this, $this->object);
477  $export->listExportFiles();
478  }
+ Here is the call graph for this function:

◆ exportQuestionExportTabObject()

ilObjSurveyQuestionPoolGUI::exportQuestionExportTabObject ( )

Definition at line 245 of file class.ilObjSurveyQuestionPoolGUI.php.

References ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

245  : void
246  {
247  $qids = $this->http->wrapper()->query()->retrieve(
248  "qid",
249  $this->refinery->custom()->transformation(function (string $value) {
250  $value = urldecode($value);
251  return explode(',', $value);
252  })
253  );
254  $this->createExportFileObject($qids);
255  }
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

◆ exportQuestionObject()

ilObjSurveyQuestionPoolGUI::exportQuestionObject ( )

export a question

Definition at line 234 of file class.ilObjSurveyQuestionPoolGUI.php.

References ILIAS\Repository\lng(), and questionsObject().

234  : void
235  {
236  $qids = $this->edit_request->getQuestionIds();
237  if (count($qids) > 0) {
238  $this->createExportFileObject($qids);
239  } else {
240  $this->tpl->setOnScreenMessage('info', $this->lng->txt("qpl_export_select_none"));
241  $this->questionsObject();
242  }
243  }
questionsObject()
list questions of question pool
+ Here is the call graph for this function:

◆ filterQuestionBrowserObject()

ilObjSurveyQuestionPoolGUI::filterQuestionBrowserObject ( )

Definition at line 392 of file class.ilObjSurveyQuestionPoolGUI.php.

References ILIAS\Repository\ctrl().

392  : void
393  {
394  $table_gui = new ilSurveyQuestionsTableGUI($this, 'questions');
395  $table_gui->writeFilterToSession();
396  $this->ctrl->redirect($this, 'questions');
397  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ getImportForm()

ilObjSurveyQuestionPoolGUI::getImportForm ( )

Definition at line 334 of file class.ilObjSurveyQuestionPoolGUI.php.

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ilFileInputGUI\setSuffixes().

Referenced by importQuestionsObject(), and uploadQuestionsObject().

335  {
336  $form = new ilPropertyFormGUI();
337  $form->setFormAction($this->ctrl->getFormAction($this, "uploadQuestions"));
338  $form->setTitle($this->lng->txt("import_question"));
339 
340  $fi = new ilFileInputGUI($this->lng->txt("select_file"), "qtidoc");
341  $fi->setSuffixes(array("xml", "zip"));
342  $fi->setRequired(true);
343  $form->addItem($fi);
344 
345  $form->addCommandButton("uploadQuestions", $this->lng->txt("import"));
346  $form->addCommandButton("questions", $this->lng->txt("cancel"));
347  return $form;
348  }
This class represents a file property in a property form.
setSuffixes(array $a_suffixes)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTabs()

ilObjSurveyQuestionPoolGUI::getTabs ( )
protected

Definition at line 692 of file class.ilObjSurveyQuestionPoolGUI.php.

References $help, ilObjectGUI\checkPermissionBool(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ilHelpGUI\setScreenIdComponent().

692  : void
693  {
694  $ilHelp = $this->help;
695  $ilHelp->setScreenIdComponent("spl");
696 
697  if ($this->checkPermissionBool("read")) {
698  $this->tabs_gui->addTab(
699  "survey_questions",
700  $this->lng->txt("survey_questions"),
701  $this->ctrl->getLinkTarget($this, 'questions')
702  );
703 
704  $this->tabs_gui->addTab(
705  "info_short",
706  $this->lng->txt("info_short"),
707  $this->ctrl->getLinkTarget($this, "infoScreen")
708  );
709  }
710 
711  if ($this->checkPermissionBool('write')) {
712  $this->tabs_gui->addTab(
713  "settings",
714  $this->lng->txt("settings"),
715  $this->ctrl->getLinkTargetByClass(\ILIAS\SurveyQuestionPool\Settings\SettingsGUI::class)
716  );
717 
718  // meta data
719  $mdgui = new ilObjectMetaDataGUI($this->object);
720  $mdtab = $mdgui->getTab();
721  if ($mdtab) {
722  $this->tabs_gui->addTab(
723  "meta_data",
724  $this->lng->txt("meta_data"),
725  $mdtab
726  );
727  }
728 
729  // export
730  $this->tabs_gui->addTab(
731  "export",
732  $this->lng->txt("export"),
733  $this->ctrl->getLinkTarget($this, 'export')
734  );
735  }
736 
737  if ($this->checkPermissionBool("edit_permission")) {
738  $this->tabs_gui->addTab(
739  "perm_settings",
740  $this->lng->txt("perm_settings"),
741  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm")
742  );
743  }
744  }
Class ilObjectMetaDataGUI.
Interface Observer Contains several chained tasks and infos about them.
setScreenIdComponent(string $a_comp)
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ importFile()

ilObjSurveyQuestionPoolGUI::importFile ( string  $file_to_import,
string  $path_to_uploaded_file_in_temp_dir 
)
protected

Definition at line 636 of file class.ilObjSurveyQuestionPoolGUI.php.

References ilObjectGUI\$tpl, ilObjectGUI\deleteUploadedImportFile(), ILIAS\Repository\lng(), ilObjectGUI\putObjectInTree(), and ilUtil\redirect().

636  : void
637  {
638  $unzip = $this->archives->unzip(Streams::ofResource(fopen($file_to_import, 'r')));
639  # If export contains a manifest xml use standard import
640  if (in_array(basename($file_to_import, ".zip") . DIRECTORY_SEPARATOR . "manifest.xml", iterator_to_array($unzip->getFiles()))) {
641  parent::importFile($file_to_import, $path_to_uploaded_file_in_temp_dir);
642  return;
643  }
644  $tpl = $this->tpl;
645 
646  $newObj = new ilObjSurveyQuestionPool();
647  $newObj->setTitle("dummy");
648  $newObj->create(true);
649  $this->putObjectInTree($newObj);
650 
651  // import qti data
652  $newObj->importObject($file_to_import);
653 
654  if ($path_to_uploaded_file_in_temp_dir !== ''
655  && $this->temp_file_system->hasDir($path_to_uploaded_file_in_temp_dir)) {
656  $this->temp_file_system->deleteDir($path_to_uploaded_file_in_temp_dir);
657  }
658 
659  $this->deleteUploadedImportFile($path_to_uploaded_file_in_temp_dir);
660  $this->tpl->setOnScreenMessage('success', $this->lng->txt("object_imported"), true);
661  ilUtil::redirect("ilias.php?ref_id=" . $newObj->getRefId() .
662  "&baseClass=ilObjSurveyQuestionPoolGUI");
663  }
Class ilObjSurveyQuestionPool.
deleteUploadedImportFile(string $path_to_uploaded_file_in_temp_dir)
ilGlobalTemplateInterface $tpl
static redirect(string $a_script)
putObjectInTree(ilObject $obj, int $parent_node_id=null)
Add object to tree at given position.
+ Here is the call graph for this function:

◆ importQuestionsObject()

ilObjSurveyQuestionPoolGUI::importQuestionsObject ( )

display the import form to import questions into the question pool

Definition at line 327 of file class.ilObjSurveyQuestionPoolGUI.php.

References ilObjectGUI\$tpl, getImportForm(), and ilGlobalTemplateInterface\setContent().

327  : void
328  {
329  $tpl = $this->tpl;
330  $form = $this->getImportForm();
331  $tpl->setContent($form->getHTML());
332  }
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:

◆ infoScreenForward()

ilObjSurveyQuestionPoolGUI::infoScreenForward ( )

show information screen

Definition at line 621 of file class.ilObjSurveyQuestionPoolGUI.php.

References ilObjectGUI\checkPermission(), ilObjectGUI\checkPermissionBool(), ILIAS\Repository\ctrl(), and ILIAS\Repository\object().

Referenced by executeCommand().

621  : void
622  {
623  if (!$this->checkPermissionBool("read")) {
624  $this->checkPermission("visible");
625  }
626 
627  $info = new ilInfoScreenGUI($this);
628  $info->enablePrivateNotes();
629 
630  // standard meta data
631  $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
632 
633  $this->ctrl->forwardCommand($info);
634  }
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
checkPermission(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:

◆ infoScreenObject()

ilObjSurveyQuestionPoolGUI::infoScreenObject ( )

this one is called from the info button in the repository

Definition at line 613 of file class.ilObjSurveyQuestionPoolGUI.php.

References ILIAS\Repository\ctrl().

613  : void
614  {
615  $this->ctrl->redirectByClass(ilInfoScreenGUI::class, "showSummary");
616  }
+ Here is the call graph for this function:

◆ moveObject()

ilObjSurveyQuestionPoolGUI::moveObject ( )

mark one or more question objects for moving

Definition at line 217 of file class.ilObjSurveyQuestionPoolGUI.php.

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

217  : void
218  {
219  $qids = $this->edit_request->getQuestionIds();
220  if (count($qids) > 0) {
221  foreach ($qids as $key => $value) {
222  $this->object->moveToClipboard($value);
223  }
224  $this->tpl->setOnScreenMessage('info', $this->lng->txt("spl_move_insert_clipboard"), true);
225  } else {
226  $this->tpl->setOnScreenMessage('info', $this->lng->txt("spl_move_select_none"), true);
227  }
228  $this->ctrl->redirect($this, "questions");
229  }
+ Here is the call graph for this function:

◆ pasteObject()

ilObjSurveyQuestionPoolGUI::pasteObject ( )

paste questions from the clipboard into the question pool

Definition at line 313 of file class.ilObjSurveyQuestionPoolGUI.php.

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

313  : void
314  {
315  $clip_questions = $this->edit_manager->getQuestionsFromClipboard();
316  if (count($clip_questions) > 0) {
317  $this->object->pasteFromClipboard();
318  } else {
319  $this->tpl->setOnScreenMessage('info', $this->lng->txt("spl_paste_no_objects"), true);
320  }
321  $this->ctrl->redirect($this, "questions");
322  }
+ Here is the call graph for this function:

◆ previewObject()

ilObjSurveyQuestionPoolGUI::previewObject ( )

create preview of object

Definition at line 599 of file class.ilObjSurveyQuestionPoolGUI.php.

References SurveyQuestionGUI\_getQuestionGUI(), and ILIAS\Repository\ctrl().

599  : void
600  {
602  "",
603  $this->edit_request->getPreview()
604  );
605  $this->ctrl->setParameterByClass(get_class($q_gui), "sel_question_types", $q_gui->getQuestionType());
606  $this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $this->edit_request->getPreview());
607  $this->ctrl->redirectByClass(get_class($q_gui), "preview");
608  }
static _getQuestionGUI(?string $questiontype, int $question_id=-1)
Creates a question gui representation.
+ Here is the call graph for this function:

◆ propertiesObject()

ilObjSurveyQuestionPoolGUI::propertiesObject ( ilPropertyFormGUI  $a_form = null)

Edit question pool properties.

Definition at line 191 of file class.ilObjSurveyQuestionPoolGUI.php.

References ILIAS\Repository\ctrl().

191  : void
192  {
193  $this->ctrl->redirectByClass(\ILIAS\SurveyQuestionPool\Settings\SettingsGUI::class);
194  }
Interface Observer Contains several chained tasks and infos about them.
+ Here is the call graph for this function:

◆ questionsObject()

ilObjSurveyQuestionPoolGUI::questionsObject ( )

list questions of question pool

Definition at line 409 of file class.ilObjSurveyQuestionPoolGUI.php.

References ilObjectGUI\$data, ilObjectGUI\$toolbar, ilObjectGUI\$user, ilObjSurveyQuestionPool\_getQuestiontypes(), ilObjectGUI\checkPermissionBool(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

Referenced by deleteQuestionsObject(), and exportQuestionObject().

409  : void
410  {
411  $this->tabs_gui->activateTab("survey_questions");
412  $ilUser = $this->user;
413  $ilToolbar = $this->toolbar;
414 
415  $this->object->purgeQuestions();
416 
417  if ($this->checkPermissionBool('write')) {
418  $qtypes = new ilSelectInputGUI("", "sel_question_types");
419  $qtypes->setValue($ilUser->getPref("svy_lastquestiontype"));
420  $ilToolbar->addInputItem($qtypes);
421 
422  $options = array();
423  foreach (ilObjSurveyQuestionPool::_getQuestiontypes() as $translation => $data) {
424  $options[$data["type_tag"]] = $translation;
425  }
426  $qtypes->setOptions($options);
427 
428  $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
429 
430  $this->gui->button(
431  $this->lng->txt("svy_create_question"),
432  "createQuestion"
433  )->submit()->toToolbar();
434 
435  $ilToolbar->addSeparator();
436  /*
437  $this->gui->button(
438  $this->lng->txt("import"),
439  "importQuestions"
440  )->submit()->toToolbar();
441  */
442  }
443 
444  $table_gui = new ilSurveyQuestionsTableGUI($this, 'questions', $this->checkPermissionBool('write'));
445  $table_gui->setEditable($this->checkPermissionBool('write'));
446  $arrFilter = array();
447  foreach ($table_gui->getFilterItems() as $item) {
448  if ($item->getValue() !== false) {
449  $arrFilter[$item->getPostVar()] = $item->getValue();
450  }
451  }
452  $table_gui->setData($this->object->getQuestionsData($arrFilter));
453  $this->tpl->setContent($table_gui->getHTML());
454  }
This class represents a selection list property in a property form.
ilToolbarGUI $toolbar
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static _getQuestiontypes()
Get all available question types.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetfilterQuestionBrowserObject()

ilObjSurveyQuestionPoolGUI::resetfilterQuestionBrowserObject ( )

Definition at line 399 of file class.ilObjSurveyQuestionPoolGUI.php.

References ILIAS\Repository\ctrl().

399  : void
400  {
401  $table_gui = new ilSurveyQuestionsTableGUI($this, 'questions');
402  $table_gui->resetFilter();
403  $this->ctrl->redirect($this, 'questions');
404  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ saveObligatoryObject()

ilObjSurveyQuestionPoolGUI::saveObligatoryObject ( )

Save obligatory states.

Definition at line 749 of file class.ilObjSurveyQuestionPoolGUI.php.

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

749  : void
750  {
751  $obligatory = $this->edit_request->getObligatory();
752  $this->object->setObligatoryStates($obligatory);
753 
754  $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
755  $this->ctrl->redirect($this, "questions");
756  }
+ Here is the call graph for this function:

◆ updateObject()

ilObjSurveyQuestionPoolGUI::updateObject ( )

Definition at line 456 of file class.ilObjSurveyQuestionPoolGUI.php.

References ILIAS\Repository\lng().

456  : void
457  {
458  $this->update = $this->object->update();
459  $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
460  }
+ Here is the call graph for this function:

◆ uploadQuestionsObject()

ilObjSurveyQuestionPoolGUI::uploadQuestionsObject ( )

imports question(s) into the questionpool

Definition at line 353 of file class.ilObjSurveyQuestionPoolGUI.php.

References ilObjectGUI\$error, ilObjectGUI\$tpl, ILIAS\Repository\ctrl(), getImportForm(), ilFileUtils\moveUploadedFile(), and ilGlobalTemplateInterface\setContent().

353  : void
354  {
355  $form = $this->getImportForm();
356  if ($form->checkInput()) {
357  // check if file was uploaded
358  $source = $_FILES["qtidoc"]["tmp_name"];
359  $error = 0;
360  if (($source === 'none') || (!$source) || $_FILES["qtidoc"]["error"] > UPLOAD_ERR_OK) {
361  $error = 1;
362  }
363  // check correct file type
364  if (!$error && strpos("xml", $_FILES["qtidoc"]["type"]) !== false) {
365  $error = 1;
366  }
367  if (!$error) {
368  // import file into questionpool
369  // create import directory
370  $this->object->createImportDirectory();
371 
372  // copy uploaded file to import directory
373  $full_path = $this->object->getImportDirectory() . "/" . $_FILES["qtidoc"]["name"];
374 
376  $_FILES["qtidoc"]["tmp_name"],
377  $_FILES["qtidoc"]["name"],
378  $full_path
379  );
380  $source = $full_path;
381  $this->object->importObject($source, true);
382  unlink($source);
383  }
384  $this->ctrl->redirect($this, "questions");
385  } else {
386  $form->setValuesByPost();
387  $tpl = $this->tpl;
388  $tpl->setContent($form->getHTML());
389  }
390  }
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
ilErrorHandling $error
+ Here is the call graph for this function:

Field Documentation

◆ $archives

ILIASArchives ilObjSurveyQuestionPoolGUI::$archives
protected

Definition at line 49 of file class.ilObjSurveyQuestionPoolGUI.php.

◆ $defaultscript

string ilObjSurveyQuestionPoolGUI::$defaultscript

Definition at line 50 of file class.ilObjSurveyQuestionPoolGUI.php.

◆ $edit_manager

ILIAS SurveyQuestionPool Editing EditManager ilObjSurveyQuestionPoolGUI::$edit_manager
protected

Definition at line 41 of file class.ilObjSurveyQuestionPoolGUI.php.

◆ $edit_request

EditingGUIRequest ilObjSurveyQuestionPoolGUI::$edit_request
protected

Definition at line 43 of file class.ilObjSurveyQuestionPoolGUI.php.

◆ $gui

ILIAS SurveyQuestionPool InternalGUIService ilObjSurveyQuestionPoolGUI::$gui
protected

Definition at line 40 of file class.ilObjSurveyQuestionPoolGUI.php.

◆ $help

ilHelpGUI ilObjSurveyQuestionPoolGUI::$help
protected

Definition at line 45 of file class.ilObjSurveyQuestionPoolGUI.php.

Referenced by getTabs().

◆ $http

HTTPServices ilObjSurveyQuestionPoolGUI::$http
protected

Definition at line 48 of file class.ilObjSurveyQuestionPoolGUI.php.

◆ $log

ilLogger ilObjSurveyQuestionPoolGUI::$log
protected

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

◆ $nav_history

ilNavigationHistory ilObjSurveyQuestionPoolGUI::$nav_history
protected

Definition at line 44 of file class.ilObjSurveyQuestionPoolGUI.php.

Referenced by executeCommand().

◆ $refinery

RefineryFactory ilObjSurveyQuestionPoolGUI::$refinery
protected

Definition at line 47 of file class.ilObjSurveyQuestionPoolGUI.php.

◆ $update

bool ilObjSurveyQuestionPoolGUI::$update
protected

Definition at line 42 of file class.ilObjSurveyQuestionPoolGUI.php.


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