ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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:22
__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 760 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().

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

◆ addLocatorItems()

ilObjSurveyQuestionPoolGUI::addLocatorItems ( )
protected

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

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

664  : void
665  {
666  $ilLocator = $this->locator;
667  switch ($this->ctrl->getCmd()) {
668  case "create":
669  case "importFile":
670  case "cancel":
671  break;
672  default:
673  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $this->edit_request->getRefId());
674  break;
675  }
676  if ($this->edit_request->getQuestionId() > 0) {
677  $q_id = $this->edit_request->getQuestionId();
678  $q_type = SurveyQuestion::_getQuestionType($q_id) . "GUI";
679  $q_title = SurveyQuestion::_getTitle($q_id);
680  if ($q_title) {
681  // not on create
682  $this->ctrl->setParameterByClass($q_type, "q_id", $q_id);
683  $ilLocator->addItem(
684  $q_title,
685  $this->ctrl->getLinkTargetByClass($q_type, "editQuestion")
686  );
687  }
688  }
689  }
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 461 of file class.ilObjSurveyQuestionPoolGUI.php.

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

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

◆ cancelDeleteExportFileObject()

ilObjSurveyQuestionPoolGUI::cancelDeleteExportFileObject ( )

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

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

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

◆ cancelDeleteQuestionsObject()

ilObjSurveyQuestionPoolGUI::cancelDeleteQuestionsObject ( )

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

References ILIAS\Repository\ctrl().

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

◆ confirmDeleteExportFileObject()

ilObjSurveyQuestionPoolGUI::confirmDeleteExportFileObject ( )

confirmation screen for export file deletion

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

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

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

◆ confirmDeleteQuestionsObject()

ilObjSurveyQuestionPoolGUI::confirmDeleteQuestionsObject ( )

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

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

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

◆ copyObject()

ilObjSurveyQuestionPoolGUI::copyObject ( )

Copies checked questions in the questionpool to a clipboard.

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

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

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

◆ createQuestionObject()

ilObjSurveyQuestionPoolGUI::createQuestionObject ( )

create new question

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

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

571  : void
572  {
573  $ilUser = $this->user;
574 
575  $ilUser->writePref(
576  "svy_lastquestiontype",
577  $this->edit_request->getSelectedQuestionTypes()
578  );
579 
581  $this->edit_request->getSelectedQuestionTypes()
582  );
583  $q_gui->object->setObjId($this->object->getId());
584  $q_gui->object->createNewQuestion();
585 
586  $this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $q_gui->object->getId());
587  $this->ctrl->setParameterByClass(
588  get_class($q_gui),
589  "sel_question_types",
590  $this->edit_request->getSelectedQuestionTypes()
591  );
592  $this->ctrl->redirectByClass(get_class($q_gui), "editQuestion");
593  }
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 549 of file class.ilObjSurveyQuestionPoolGUI.php.

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

549  : void
550  {
551  $export_dir = $this->object->getExportDirectory();
552  $files = $this->edit_request->getFiles();
553  foreach ($files as $file) {
554  $file = basename($file);
555 
556  $exp_file = $export_dir . "/" . $file;
557  $exp_dir = $export_dir . "/" . substr($file, 0, -4);
558  if (is_file($exp_file)) {
559  unlink($exp_file);
560  }
561  if (is_dir($exp_dir)) {
562  ilFileUtils::delDir($exp_dir);
563  }
564  }
565  $this->ctrl->redirect($this, "export");
566  }
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 259 of file class.ilObjSurveyQuestionPoolGUI.php.

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

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

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

496  : void
497  {
498  $files = $this->edit_request->getFiles();
499  if (count($files) === 0) {
500  $this->tpl->setOnScreenMessage('info', $this->lng->txt("no_checkbox"), true);
501  $this->ctrl->redirect($this, "export");
502  }
503 
504  if (count($files) > 1) {
505  $this->tpl->setOnScreenMessage('info', $this->lng->txt("select_max_one_item"), true);
506  $this->ctrl->redirect($this, "export");
507  }
508 
509 
510  $export_dir = $this->object->getExportDirectory();
511 
512  $file = basename($files[0]);
513 
514  ilFileDelivery::deliverFileLegacy($export_dir . "/" . $file, $file);
515  }
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 
90  if (!$this->checkPermissionBool("visible") &&
91  !$this->checkPermissionBool("read")) {
92  $this->checkPermission("read");
93  }
94 
95  // add entry to navigation history
96  if (!$this->getCreationMode() &&
97  $this->checkPermissionBool("read")) {
98  $ilNavigationHistory->addItem(
99  $this->ref_id,
100  "ilias.php?baseClass=ilObjSurveyQuestionPoolGUI&cmd=questions&ref_id=" . $this->ref_id,
101  "spl"
102  );
103  }
104 
105  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "survey.css"), "screen");
106  $this->prepareOutput();
107 
108  $cmd = $this->ctrl->getCmd("questions");
109  $next_class = $this->ctrl->getNextClass($this);
110  $this->ctrl->setReturn($this, "questions");
111  $q_type = "";
112  if ($this->edit_request->getQuestionId() < 1) {
113  $q_type = $this->edit_request->getSelectedQuestionTypes();
114  }
115 
116  $this->log->debug("- cmd=" . $cmd . " next_class=" . $next_class);
117  switch ($next_class) {
118  case 'ilobjectmetadatagui':
119  $this->tabs_gui->activateTab("meta_data");
120  $this->checkPermission('write');
121  $md_gui = new ilObjectMetaDataGUI($this->object);
122  $this->ctrl->forwardCommand($md_gui);
123  break;
124 
125  case 'ilpermissiongui':
126  $perm_gui = new ilPermissionGUI($this);
127  $this->ctrl->forwardCommand($perm_gui);
128  break;
129 
130  case 'ilobjectcopygui':
131  $cp = new ilObjectCopyGUI($this);
132  $cp->setType('spl');
133  $this->ctrl->forwardCommand($cp);
134  break;
135 
136  case 'ilinfoscreengui':
137  $this->tabs_gui->activateTab("info_short");
138  $this->infoScreenForward();
139  break;
140 
141  case "ilcommonactiondispatchergui":
143  $this->ctrl->forwardCommand($gui);
144  break;
145 
146  case strtolower(\ILIAS\SurveyQuestionPool\Settings\SettingsGUI::class):
147  $this->checkPermission("write");
148  $this->tabs_gui->activateTab("settings");
149  $gui = $this->gui->settings()->settingsGUI(
150  $this->object->getId(),
151  $this->object->getRefId()
152  );
153  $this->ctrl->forwardCommand($gui);
154  break;
155 
156  case strtolower(ilExportGUI::class):
157  $export = new ilExportGUI($this, $this->object);
158  $this->ctrl->forwardCommand($export);
159  break;
160 
161  case "":
162  $cmd .= "Object";
163  $this->$cmd();
164  break;
165 
166  default:
168  $q_type,
169  $this->edit_request->getQuestionId()
170  );
171  $this->log->debug("- This is the switch/case default, going to question id =" . $this->edit_request->getQuestionId());
172  $q_gui->setQuestionTabs();
173  $this->ctrl->forwardCommand($q_gui);
174 
175  // not on create
176  if ($q_gui->object->isComplete()) {
177  $this->tpl->setTitle($this->lng->txt("question") . ": " . $q_gui->object->getTitle());
178  }
179  break;
180  }
181  if (strtolower($this->edit_request->getBaseClass()) !== "iladministrationgui" &&
182  $this->getCreationMode() !== true) {
183  $this->tpl->printToStdout();
184  }
185  }
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 473 of file class.ilObjSurveyQuestionPoolGUI.php.

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

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

◆ exportQuestionExportTabObject()

ilObjSurveyQuestionPoolGUI::exportQuestionExportTabObject ( )

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

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

244  : void
245  {
246  $qids = $this->http->wrapper()->query()->retrieve(
247  "qid",
248  $this->refinery->custom()->transformation(function (string $value) {
249  $value = urldecode($value);
250  return explode(',', $value);
251  })
252  );
253  $this->createExportFileObject($qids);
254  }
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 233 of file class.ilObjSurveyQuestionPoolGUI.php.

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

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

◆ filterQuestionBrowserObject()

ilObjSurveyQuestionPoolGUI::filterQuestionBrowserObject ( )

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

References ILIAS\Repository\ctrl().

391  : void
392  {
393  $table_gui = new ilSurveyQuestionsTableGUI($this, 'questions');
394  $table_gui->writeFilterToSession();
395  $this->ctrl->redirect($this, 'questions');
396  }
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 333 of file class.ilObjSurveyQuestionPoolGUI.php.

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

Referenced by importQuestionsObject(), and uploadQuestionsObject().

334  {
335  $form = new ilPropertyFormGUI();
336  $form->setFormAction($this->ctrl->getFormAction($this, "uploadQuestions"));
337  $form->setTitle($this->lng->txt("import_question"));
338 
339  $fi = new ilFileInputGUI($this->lng->txt("select_file"), "qtidoc");
340  $fi->setSuffixes(array("xml", "zip"));
341  $fi->setRequired(true);
342  $form->addItem($fi);
343 
344  $form->addCommandButton("uploadQuestions", $this->lng->txt("import"));
345  $form->addCommandButton("questions", $this->lng->txt("cancel"));
346  return $form;
347  }
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 691 of file class.ilObjSurveyQuestionPoolGUI.php.

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

691  : void
692  {
693  $ilHelp = $this->help;
694  $ilHelp->setScreenIdComponent("spl");
695 
696  if ($this->checkPermissionBool("read")) {
697  $this->tabs_gui->addTab(
698  "survey_questions",
699  $this->lng->txt("survey_questions"),
700  $this->ctrl->getLinkTarget($this, 'questions')
701  );
702 
703  $this->tabs_gui->addTab(
704  "info_short",
705  $this->lng->txt("info_short"),
706  $this->ctrl->getLinkTarget($this, "infoScreen")
707  );
708  }
709 
710  if ($this->checkPermissionBool('write')) {
711  $this->tabs_gui->addTab(
712  "settings",
713  $this->lng->txt("settings"),
714  $this->ctrl->getLinkTargetByClass(\ILIAS\SurveyQuestionPool\Settings\SettingsGUI::class)
715  );
716 
717  // meta data
718  $mdgui = new ilObjectMetaDataGUI($this->object);
719  $mdtab = $mdgui->getTab();
720  if ($mdtab) {
721  $this->tabs_gui->addTab(
722  "meta_data",
723  $this->lng->txt("meta_data"),
724  $mdtab
725  );
726  }
727 
728  // export
729  $this->tabs_gui->addTab(
730  "export",
731  $this->lng->txt("export"),
732  $this->ctrl->getLinkTarget($this, 'export')
733  );
734  }
735 
736  if ($this->checkPermissionBool("edit_permission")) {
737  $this->tabs_gui->addTab(
738  "perm_settings",
739  $this->lng->txt("perm_settings"),
740  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm")
741  );
742  }
743  }
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 635 of file class.ilObjSurveyQuestionPoolGUI.php.

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

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

References ilObjectGUI\$tpl, getImportForm(), and ILIAS\UICore\GlobalTemplate\setContent().

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

◆ infoScreenForward()

ilObjSurveyQuestionPoolGUI::infoScreenForward ( )

show information screen

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

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

Referenced by executeCommand().

620  : void
621  {
622  if (!$this->checkPermissionBool("read")) {
623  $this->checkPermission("visible");
624  }
625 
626  $info = new ilInfoScreenGUI($this);
627  $info->enablePrivateNotes();
628 
629  // standard meta data
630  $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
631 
632  $this->ctrl->forwardCommand($info);
633  }
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 612 of file class.ilObjSurveyQuestionPoolGUI.php.

References ILIAS\Repository\ctrl().

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

◆ moveObject()

ilObjSurveyQuestionPoolGUI::moveObject ( )

mark one or more question objects for moving

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

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

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

◆ pasteObject()

ilObjSurveyQuestionPoolGUI::pasteObject ( )

paste questions from the clipboard into the question pool

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

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

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

◆ previewObject()

ilObjSurveyQuestionPoolGUI::previewObject ( )

create preview of object

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

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

598  : void
599  {
601  "",
602  $this->edit_request->getPreview()
603  );
604  $this->ctrl->setParameterByClass(get_class($q_gui), "sel_question_types", $q_gui->getQuestionType());
605  $this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $this->edit_request->getPreview());
606  $this->ctrl->redirectByClass(get_class($q_gui), "preview");
607  }
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 190 of file class.ilObjSurveyQuestionPoolGUI.php.

References ILIAS\Repository\ctrl().

190  : void
191  {
192  $this->ctrl->redirectByClass(\ILIAS\SurveyQuestionPool\Settings\SettingsGUI::class);
193  }
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 408 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().

408  : void
409  {
410  $this->tabs_gui->activateTab("survey_questions");
411  $ilUser = $this->user;
412  $ilToolbar = $this->toolbar;
413 
414  $this->object->purgeQuestions();
415 
416  if ($this->checkPermissionBool('write')) {
417  $qtypes = new ilSelectInputGUI("", "sel_question_types");
418  $qtypes->setValue($ilUser->getPref("svy_lastquestiontype"));
419  $ilToolbar->addInputItem($qtypes);
420 
421  $options = array();
422  foreach (ilObjSurveyQuestionPool::_getQuestiontypes() as $translation => $data) {
423  $options[$data["type_tag"]] = $translation;
424  }
425  $qtypes->setOptions($options);
426 
427  $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
428 
429  $this->gui->button(
430  $this->lng->txt("svy_create_question"),
431  "createQuestion"
432  )->submit()->toToolbar();
433 
434  $ilToolbar->addSeparator();
435  /*
436  $this->gui->button(
437  $this->lng->txt("import"),
438  "importQuestions"
439  )->submit()->toToolbar();
440  */
441  }
442 
443  $table_gui = new ilSurveyQuestionsTableGUI($this, 'questions', $this->checkPermissionBool('write'));
444  $table_gui->setEditable($this->checkPermissionBool('write'));
445  $arrFilter = array();
446  foreach ($table_gui->getFilterItems() as $item) {
447  if ($item->getValue() !== false) {
448  $arrFilter[$item->getPostVar()] = $item->getValue();
449  }
450  }
451  $table_gui->setData($this->object->getQuestionsData($arrFilter));
452  $this->tpl->setContent($table_gui->getHTML());
453  }
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 398 of file class.ilObjSurveyQuestionPoolGUI.php.

References ILIAS\Repository\ctrl().

398  : void
399  {
400  $table_gui = new ilSurveyQuestionsTableGUI($this, 'questions');
401  $table_gui->resetFilter();
402  $this->ctrl->redirect($this, 'questions');
403  }
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 748 of file class.ilObjSurveyQuestionPoolGUI.php.

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

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

◆ updateObject()

ilObjSurveyQuestionPoolGUI::updateObject ( )

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

References ILIAS\Repository\lng().

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

◆ uploadQuestionsObject()

ilObjSurveyQuestionPoolGUI::uploadQuestionsObject ( )

imports question(s) into the questionpool

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

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

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