ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilObjSurveyQuestionPoolGUI Class Reference

Class ilObjSurveyQuestionPoolGUI. More...

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

Public Member Functions

 __construct ()
 Constructor public. More...
 
 executeCommand ()
 execute command More...
 
 propertiesObject (ilPropertyFormGUI $a_form=null)
 Questionpool properties. More...
 
 savePropertiesObject ()
 Save questionpool 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...
 
 deleteQuestionsObject ()
 Creates a confirmation form to delete questions from the question pool. More...
 
 confirmDeleteQuestionsObject ()
 delete questions More...
 
 cancelDeleteQuestionsObject ()
 cancel delete questions More...
 
 pasteObject ()
 paste questios from the clipboard into the question pool More...
 
 importQuestionsObject ()
 display the import form to import questions into the questionpool More...
 
 uploadQuestionsObject ()
 imports question(s) into the questionpool More...
 
 filterQuestionBrowserObject ()
 
 resetfilterQuestionBrowserObject ()
 
 questionsObject ($arrFilter=null)
 list questions of question pool More...
 
 updateObject ()
 
 afterSave (ilObject $a_new_object)
 
 exportObject ()
 
 createExportFileObject ($questions=null)
 create export file More...
 
 downloadExportFileObject ()
 download export file More...
 
 confirmDeleteExportFileObject ()
 confirmation screen for export file deletion More...
 
 cancelDeleteExportFileObject ()
 cancel deletion of export files More...
 
 deleteExportFileObject ()
 delete export files More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 form for new survey object import More...
 
createQuestionObject ()
 create new question More...
 
previewObject ()
 create preview of object More...
 
 infoScreenObject ()
 this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed More...
 
 infoScreenForward ()
 show information screen More...
 
 addLocatorItems ()
 
 getTabs ()
 adds tabs to tab gui object More...
 
 saveObligatoryObject ()
 Save obligatory states. More...
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. More...
 

Static Public Member Functions

static _goto ($a_target)
 Redirect script to call a survey question pool reference id. More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 

Data Fields

 $defaultscript
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Protected Member Functions

 initEditForm ()
 
 initImportForm ($a_new_type)
 
 initCreationForms ($a_new_type)
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 Get object service. More...
 
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs public More...
 
 setAdminTabs ()
 set admin tabs public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_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 $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Protected Attributes

 $nav_history
 
 $error
 
 $help
 
 $log
 
- Protected Attributes inherited from ilObjectGUI
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjSurveyQuestionPoolGUI::__construct ( )

Constructor public.

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

References $_GET, $DIC, $ilCtrl, ilObjectGUI\$lng, ilLoggerFactory\getLogger(), and user().

71  {
72  global $DIC;
73 
74  $this->lng = $DIC->language();
75  $this->nav_history = $DIC["ilNavigationHistory"];
76  $this->tpl = $DIC["tpl"];
77  $this->user = $DIC->user();
78  $this->toolbar = $DIC->toolbar();
79  $this->error = $DIC["ilErr"];
80  $this->locator = $DIC["ilLocator"];
81  $this->help = $DIC["ilHelp"];
82  $lng = $DIC->language();
83  $ilCtrl = $DIC->ctrl();
84 
85  $this->type = "spl";
86  $lng->loadLanguageModule("survey");
87  $this->ctrl = $ilCtrl;
88  $this->ctrl->saveParameter($this, array("ref_id"));
89 
90  parent::__construct("", $_GET["ref_id"], true, false);
91 
92  $this->log = ilLoggerFactory::getLogger('svy');
93  }
global $DIC
Definition: saml.php:7
$_GET["client_id"]
user()
Definition: user.php:4
global $ilCtrl
Definition: ilias.php:18
static getLogger($a_component_id)
Get component logger.
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjSurveyQuestionPoolGUI::_goto (   $a_target)
static

Redirect script to call a survey question pool reference id.

Parameters
integer$a_targetThe reference id of the question pool public

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

References $_GET, $DIC, ilObjectGUI\$lng, ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), exit, and ilUtil\sendFailure().

956  {
957  global $DIC;
958 
959  $ilAccess = $DIC->access();
960  $lng = $DIC->language();
961 
962  if ($ilAccess->checkAccess("visible", "", $a_target) ||
963  $ilAccess->checkAccess("read", "", $a_target)) {
964  $_GET["baseClass"] = "ilObjSurveyQuestionPoolGUI";
965  $_GET["cmd"] = "infoScreen";
966  $_GET["ref_id"] = $a_target;
967  include_once("ilias.php");
968  exit;
969  } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
970  ilUtil::sendFailure(sprintf(
971  $lng->txt("msg_no_perm_read_item"),
973  ), true);
975  }
976  }
global $DIC
Definition: saml.php:7
$_GET["client_id"]
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupTitle($a_id)
lookup object title
static _lookupObjId($a_id)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
exit
Definition: backend.php:16
+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjSurveyQuestionPoolGUI::addLocatorItems ( )

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

References $_GET, ilObjectGUI\$locator, SurveyQuestion\_getQuestionType(), and SurveyQuestion\_getTitle().

789  {
790  $ilLocator = $this->locator;
791  switch ($this->ctrl->getCmd()) {
792  case "create":
793  case "importFile":
794  case "cancel":
795  break;
796  default:
797  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $_GET["ref_id"]);
798  break;
799  }
800  if ((int) $_GET["q_id"]) {
801  $q_id = (int) $_GET["q_id"];
802  include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
803  $q_type = SurveyQuestion::_getQuestionType($q_id) . "GUI";
804  $q_title = SurveyQuestion::_getTitle($q_id);
805  if ($q_title) {
806  // not on create
807  $this->ctrl->setParameterByClass($q_type, "q_id", $q_id);
808  $ilLocator->addItem(
809  $q_title,
810  $this->ctrl->getLinkTargetByClass($q_type, "editQuestion")
811  );
812  }
813  }
814  }
$_GET["client_id"]
static _getTitle($question_id)
Returns the question title of a question with a given id.
static _getQuestionType($question_id)
Returns the question type of a question with a given id.
+ Here is the call graph for this function:

◆ afterSave()

ilObjSurveyQuestionPoolGUI::afterSave ( ilObject  $a_new_object)

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

References ilObject\getRefId(), and ilUtil\redirect().

530  {
531  // always send a message
532  ilUtil::sendSuccess($this->lng->txt("object_added"), true);
533 
534  ilUtil::redirect("ilias.php?ref_id=" . $a_new_object->getRefId() .
535  "&baseClass=ilObjSurveyQuestionPoolGUI");
536  }
getRefId()
get reference id public
static redirect($a_script)
+ Here is the call graph for this function:

◆ cancelDeleteExportFileObject()

ilObjSurveyQuestionPoolGUI::cancelDeleteExportFileObject ( )

cancel deletion of export files

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

References ilSession\clear().

627  {
628  ilSession::clear("ilExportFiles");
629  $this->ctrl->redirect($this, "export");
630  }
static clear($a_var)
Unset a value.
+ Here is the call graph for this function:

◆ cancelDeleteQuestionsObject()

ilObjSurveyQuestionPoolGUI::cancelDeleteQuestionsObject ( )

cancel delete questions

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

377  {
378  // delete questions after confirmation
379  $this->ctrl->redirect($this, "questions");
380  }

◆ confirmDeleteExportFileObject()

ilObjSurveyQuestionPoolGUI::confirmDeleteExportFileObject ( )

confirmation screen for export file deletion

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

References $_POST, ilObjectGUI\$data, ilDatePresentation\formatDate(), IL_CAL_UNIX, ilUtil\sendInfo(), and ilUtil\sendQuestion().

603  {
604  if (!isset($_POST["file"])) {
605  ilUtil::sendInfo($this->lng->txt("no_checkbox"), true);
606  $this->ctrl->redirect($this, "export");
607  }
608 
609  ilUtil::sendQuestion($this->lng->txt("info_delete_sure"));
610  include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionPoolExportTableGUI.php";
611  $table_gui = new ilSurveyQuestionPoolExportTableGUI($this, 'export', true);
612  $export_dir = $this->object->getExportDirectory();
613  $data = array();
614  foreach ($_POST['file'] as $exp_file) {
615  $file_arr = explode("__", $exp_file);
616  array_push($data, array('file' => $exp_file, 'date' => ilDatePresentation::formatDate(new ilDateTime($file_arr[0], IL_CAL_UNIX)), 'size' => filesize($export_dir . "/" . $exp_file)));
617  }
618  $table_gui->setData($data);
619  $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
620  }
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Date and time handling
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ confirmDeleteQuestionsObject()

ilObjSurveyQuestionPoolGUI::confirmDeleteQuestionsObject ( )

delete questions

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

References $_POST.

364  {
365  // delete questions after confirmation
366  ilUtil::sendSuccess($this->lng->txt("qpl_questions_deleted"), true);
367  foreach ($_POST['q_id'] as $q_id) {
368  $this->object->removeQuestion($q_id);
369  }
370  $this->ctrl->redirect($this, "questions");
371  }
$_POST["username"]

◆ copyObject()

ilObjSurveyQuestionPoolGUI::copyObject ( )

Copies checked questions in the questionpool to a clipboard.

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

References $_POST, $key, and ilUtil\sendInfo().

281  {
282  if (count($_POST["q_id"]) > 0) {
283  foreach ($_POST["q_id"] as $key => $value) {
284  $this->object->copyToClipboard($value);
285  }
286  ilUtil::sendInfo($this->lng->txt("spl_copy_insert_clipboard"), true);
287  } else {
288  ilUtil::sendInfo($this->lng->txt("spl_copy_select_none"), true);
289  }
290  $this->ctrl->redirect($this, "questions");
291  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$key
Definition: croninfo.php:18
$_POST["username"]
+ Here is the call graph for this function:

◆ createExportFileObject()

ilObjSurveyQuestionPoolGUI::createExportFileObject (   $questions = null)

create export file

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

References ilObjectGUI\checkPermission().

Referenced by exportQuestionObject().

567  {
568  $this->checkPermission("write");
569 
570  include_once("./Modules/SurveyQuestionPool/classes/class.ilSurveyQuestionpoolExport.php");
571  $survey_exp = new ilSurveyQuestionpoolExport($this->object);
572  $survey_exp->buildExportFile($questions);
573  $this->ctrl->redirect($this, "export");
574  }
Export class for survey questionpools.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createQuestionObject()

& ilObjSurveyQuestionPoolGUI::createQuestionObject ( )

create new question

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

References $_POST, $ilUser, ilObjectGUI\$user, and SurveyQuestionGUI\_getQuestionGUI().

730  {
732 
733  $ilUser->writePref("svy_lastquestiontype", $_POST["sel_question_types"]);
734 
735  include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php";
736  $q_gui = &SurveyQuestionGUI::_getQuestionGUI($_POST["sel_question_types"]);
737  $q_gui->object->setObjId($this->object->getId());
738  $q_gui->object->createNewQuestion();
739 
740  $this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $q_gui->object->getId());
741  $this->ctrl->setParameterByClass(get_class($q_gui), "sel_question_types", $_POST["sel_question_types"]);
742  $this->ctrl->redirectByClass(get_class($q_gui), "editQuestion");
743  }
static _getQuestionGUI($questiontype, $question_id=-1)
Creates a question gui representation.
$ilUser
Definition: imgupload.php:18
$_POST["username"]
+ Here is the call graph for this function:

◆ deleteExportFileObject()

ilObjSurveyQuestionPoolGUI::deleteExportFileObject ( )

delete export files

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

References $_POST, and ilUtil\delDir().

636  {
637  $export_dir = $this->object->getExportDirectory();
638  foreach ($_POST['file'] as $file) {
639  $file = basename($file);
640 
641  $exp_file = $export_dir . "/" . $file;
642  $exp_dir = $export_dir . "/" . substr($file, 0, strlen($file) - 4);
643  if (@is_file($exp_file)) {
644  unlink($exp_file);
645  }
646  if (@is_dir($exp_dir)) {
647  ilUtil::delDir($exp_dir);
648  }
649  }
650  $this->ctrl->redirect($this, "export");
651  }
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
$_POST["username"]
+ 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 325 of file class.ilObjSurveyQuestionPoolGUI.php.

References $_POST, ilObjectGUI\$data, $txt, SurveyQuestion\_getQuestionTypeName(), ilObjectGUI\checkPermission(), questionsObject(), and ilUtil\sendInfo().

326  {
327  $this->checkPermission('write');
328 
329  // create an array of all checked checkboxes
330  $checked_questions = $_POST['q_id'];
331  if (count($checked_questions) == 0) {
332  ilUtil::sendInfo($this->lng->txt("qpl_delete_select_none"));
333  $this->questionsObject();
334  return;
335  }
336 
337  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
338  $cgui = new ilConfirmationGUI();
339  $cgui->setHeaderText($this->lng->txt("qpl_confirm_delete_questions"));
340 
341  $cgui->setFormAction($this->ctrl->getFormAction($this));
342  $cgui->setCancel($this->lng->txt("cancel"), "cancelDeleteQuestions");
343  $cgui->setConfirm($this->lng->txt("confirm"), "confirmDeleteQuestions");
344 
345  include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
346  $infos = $this->object->getQuestionInfos($checked_questions);
347  foreach ($infos as $data) {
348  $txt = $data["title"] . " (" .
349  SurveyQuestion::_getQuestionTypeName($data["type_tag"]) . ")";
350  if ($data["description"]) {
351  $txt .= "<div class=\"small\">" . $data["description"] . "</div>";
352  }
353 
354  $cgui->addItem("q_id[]", $data["id"], $txt);
355  }
356 
357  $this->tpl->setContent($cgui->getHTML());
358  }
static _getQuestionTypeName($type_tag)
Return the translation for a given question type tag.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
questionsObject($arrFilter=null)
list questions of question pool
$txt
Definition: error.php:11
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ downloadExportFileObject()

ilObjSurveyQuestionPoolGUI::downloadExportFileObject ( )

download export file

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

References $_POST, ilUtil\deliverFile(), and ilUtil\sendInfo().

580  {
581  if (!isset($_POST["file"])) {
582  ilUtil::sendInfo($this->lng->txt("no_checkbox"), true);
583  $this->ctrl->redirect($this, "export");
584  }
585 
586  if (count($_POST["file"]) > 1) {
587  ilUtil::sendInfo($this->lng->txt("select_max_one_item"), true);
588  $this->ctrl->redirect($this, "export");
589  }
590 
591 
592  $export_dir = $this->object->getExportDirectory();
593 
594  $file = basename($_POST["file"][0]);
595 
596  ilUtil::deliverFile($export_dir . "/" . $file, $file);
597  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$_POST["username"]
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
+ Here is the call graph for this function:

◆ executeCommand()

ilObjSurveyQuestionPoolGUI::executeCommand ( )

execute command

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

References $_GET, $_POST, $nav_history, $ret, SurveyQuestionGUI\_getQuestionGUI(), ilObjectGUI\checkPermission(), ilObjectGUI\checkPermissionBool(), ilObjectGUI\getCreationMode(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), ilUtil\getStyleSheetLocation(), infoScreenForward(), and ilObjectGUI\prepareOutput().

99  {
100  $ilNavigationHistory = $this->nav_history;
101 
102  if (!$this->checkPermissionBool("visible") &&
103  !$this->checkPermissionBool("read")) {
104  $this->checkPermission("read");
105  }
106 
107  // add entry to navigation history
108  if (!$this->getCreationMode() &&
109  $this->checkPermissionBool("read")) {
110  $ilNavigationHistory->addItem(
111  $this->ref_id,
112  "ilias.php?baseClass=ilObjSurveyQuestionPoolGUI&cmd=questions&ref_id=" . $this->ref_id,
113  "spl"
114  );
115  }
116 
117  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "survey.css", "Modules/Survey"), "screen");
118  $this->prepareOutput();
119 
120  $cmd = $this->ctrl->getCmd("questions");
121  $next_class = $this->ctrl->getNextClass($this);
122  $this->ctrl->setReturn($this, "questions");
123  if ($_GET["q_id"] < 1) {
124  $q_type = ($_POST["sel_question_types"] != "")
125  ? $_POST["sel_question_types"]
126  : $_GET["sel_question_types"];
127  }
128 
129  $this->log->debug("- cmd=" . $cmd . " next_class=" . $next_class);
130  switch ($next_class) {
131  case 'ilobjectmetadatagui':
132  $this->checkPermission('write');
133  include_once 'Services/Object/classes/class.ilObjectMetaDataGUI.php';
134  $md_gui = new ilObjectMetaDataGUI($this->object);
135  $this->ctrl->forwardCommand($md_gui);
136  break;
137 
138  case 'ilpermissiongui':
139  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
140  $perm_gui = new ilPermissionGUI($this);
141  $ret = &$this->ctrl->forwardCommand($perm_gui);
142  break;
143 
144  case "ilsurveyphrasesgui":
145  include_once("./Modules/SurveyQuestionPool/classes/class.ilSurveyPhrasesGUI.php");
146  $phrases_gui = new ilSurveyPhrasesGUI($this);
147  $ret = &$this->ctrl->forwardCommand($phrases_gui);
148  break;
149 
150  case 'ilobjectcopygui':
151  include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
152  $cp = new ilObjectCopyGUI($this);
153  $cp->setType('spl');
154  $this->ctrl->forwardCommand($cp);
155  break;
156 
157  case 'ilinfoscreengui':
158  $this->infoScreenForward();
159  break;
160 
161  case "ilcommonactiondispatchergui":
162  include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
164  $this->ctrl->forwardCommand($gui);
165  break;
166 
167  case "":
168  $cmd .= "Object";
169  $ret = &$this->$cmd();
170  break;
171 
172  default:
173  include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php";
174  $q_gui = SurveyQuestionGUI::_getQuestionGUI($q_type, $_GET["q_id"]);
175  $this->log->debug("- This is the switch/case default, going to question id =" . $_GET["q_id"]);
176  // $q_gui->object->setObjId($this->object->getId());
177  $q_gui->setQuestionTabs();
178  $ret = &$this->ctrl->forwardCommand($q_gui);
179 
180  // not on create
181  if ($q_gui->object->isComplete()) {
182  $this->tpl->setTitle($this->lng->txt("question") . ": " . $q_gui->object->getTitle());
183  }
184  break;
185  }
186  if (strtolower($_GET["baseClass"]) != "iladministrationgui" &&
187  $this->getCreationMode() != true) {
188  $this->tpl->show();
189  }
190  }
Class ilObjectMetaDataGUI.
GUI class for the workflow of copying objects.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
Survey phrases GUI class.
static _getQuestionGUI($questiontype, $question_id=-1)
Creates a question gui representation.
prepareOutput($a_show_subobjects=true)
prepare output
$ret
Definition: parser.php:6
getCreationMode()
get creation mode
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
$_POST["username"]
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
+ Here is the call graph for this function:

◆ exportObject()

ilObjSurveyQuestionPoolGUI::exportObject ( )

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

References ilObjectGUI\$data, ilObjectGUI\$toolbar, ilDatePresentation\formatDate(), and IL_CAL_UNIX.

542  {
543  $ilToolbar = $this->toolbar;
544 
545  $ilToolbar->addButton(
546  $this->lng->txt('create_export_file'),
547  $this->ctrl->getLinkTarget($this, 'createExportFile')
548  );
549 
550  include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionPoolExportTableGUI.php";
551  $table_gui = new ilSurveyQuestionPoolExportTableGUI($this, 'export');
552  $export_dir = $this->object->getExportDirectory();
553  $export_files = $this->object->getExportFiles($export_dir);
554  $data = array();
555  foreach ($export_files as $exp_file) {
556  $file_arr = explode("__", $exp_file);
557  array_push($data, array('file' => $exp_file, 'date' => ilDatePresentation::formatDate(new ilDateTime($file_arr[0], IL_CAL_UNIX)), 'size' => filesize($export_dir . "/" . $exp_file)));
558  }
559  $table_gui->setData($data);
560  $this->tpl->setContent($table_gui->getHTML());
561  }
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
Date and time handling
+ Here is the call graph for this function:

◆ exportQuestionObject()

ilObjSurveyQuestionPoolGUI::exportQuestionObject ( )

export a question

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

References $_POST, createExportFileObject(), questionsObject(), and ilUtil\sendInfo().

313  {
314  if (is_array($_POST['q_id']) && count($_POST['q_id']) > 0) {
315  $this->createExportFileObject($_POST['q_id']);
316  } else {
317  ilUtil::sendInfo($this->lng->txt("qpl_export_select_none"));
318  $this->questionsObject();
319  }
320  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
questionsObject($arrFilter=null)
list questions of question pool
createExportFileObject($questions=null)
create export file
$_POST["username"]
+ Here is the call graph for this function:

◆ filterQuestionBrowserObject()

ilObjSurveyQuestionPoolGUI::filterQuestionBrowserObject ( )

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

455  {
456  include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionsTableGUI.php";
457  $table_gui = new ilSurveyQuestionsTableGUI($this, 'questions');
458  $table_gui->writeFilterToSession();
459  $this->ctrl->redirect($this, 'questions');
460  }

◆ getTabs()

ilObjSurveyQuestionPoolGUI::getTabs ( )

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

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

References $_GET, $help, and ilObjectGUI\checkPermissionBool().

822  {
823  $ilHelp = $this->help;
824 
825  $ilHelp->setScreenIdComponent("spl");
826 
827  $next_class = $this->ctrl->getNextClass($this);
828  switch ($next_class) {
829  case "":
830  case "ilpermissiongui":
831  case "ilobjectmetadatagui":
832  case "ilsurveyphrasesgui":
833  break;
834  default:
835  return;
836  break;
837  }
838 
839  // questions
840  $force_active = (($this->ctrl->getCmdClass() == "" &&
841  $this->ctrl->getCmd() != "properties" && $this->ctrl->getCmd() != "infoScreen") ||
842  $this->ctrl->getCmd() == "")
843  ? true
844  : false;
845  if (!$force_active) {
846  if (is_array($_GET["sort"])) {
847  $force_active = true;
848  }
849  }
850 
851  if ($this->checkPermissionBool("read")) {
852  $this->tabs_gui->addTarget(
853  "survey_questions",
854  $this->ctrl->getLinkTarget($this, 'questions'),
855  array("questions", "filterQuestionBrowser", "filter", "reset", "createQuestion",
856  "importQuestions", "deleteQuestions", "copy", "paste",
857  "exportQuestions", "confirmDeleteQuestions", "cancelDeleteQuestions",
858  "confirmPasteQuestions", "cancelPasteQuestions", "uploadQuestions",
859  "editQuestion", "addMaterial", "removeMaterial", "save", "cancel",
860  "cancelExplorer", "linkChilds", "addGIT", "addST", "addPG", "preview",
861  "moveCategory", "deleteCategory", "addPhrase", "addCategory", "savePhrase",
862  "addSelectedPhrase", "cancelViewPhrase", "confirmSavePhrase", "cancelSavePhrase",
863  "insertBeforeCategory", "insertAfterCategory", "confirmDeleteCategory",
864  "cancelDeleteCategory", "categories", "saveCategories",
865  "savePhrase", "addPhrase"
866  ),
867  array("ilobjsurveyquestionpoolgui", "ilsurveyphrasesgui"),
868  "",
869  $force_active
870  );
871 
872  $this->tabs_gui->addTarget(
873  "info_short",
874  $this->ctrl->getLinkTarget($this, "infoScreen"),
875  array("infoScreen", "showSummary")
876  );
877  }
878 
879  if ($this->checkPermissionBool('write')) {
880  // properties
881  $this->tabs_gui->addTarget(
882  "settings",
883  $this->ctrl->getLinkTarget($this, 'properties'),
884  array("properties", "saveProperties"),
885  "",
886  ""
887  );
888 
889  // manage phrases
890  $this->tabs_gui->addTarget(
891  "manage_phrases",
892  $this->ctrl->getLinkTargetByClass("ilsurveyphrasesgui", "phrases"),
893  array("phrases", "deletePhrase", "confirmDeletePhrase", "cancelDeletePhrase", "editPhrase", "newPhrase", "saveEditPhrase", "phraseEditor"),
894  "ilsurveyphrasesgui",
895  ""
896  );
897 
898  // meta data
899  include_once "Services/Object/classes/class.ilObjectMetaDataGUI.php";
900  $mdgui = new ilObjectMetaDataGUI($this->object);
901  $mdtab = $mdgui->getTab();
902  if ($mdtab) {
903  $this->tabs_gui->addTarget(
904  "meta_data",
905  $mdtab,
906  "",
907  "ilmdeditorgui"
908  );
909  }
910 
911  // export
912  $this->tabs_gui->addTarget(
913  "export",
914  $this->ctrl->getLinkTarget($this, 'export'),
915  array("export", "createExportFile", "confirmDeleteExportFile",
916  "downloadExportFile", "cancelDeleteExportFile", "deleteExportFile"),
917  "",
918  ""
919  );
920  }
921 
922  if ($this->checkPermissionBool("edit_permission")) {
923  $this->tabs_gui->addTarget(
924  "perm_settings",
925  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"),
926  array("perm","info","owner"),
927  'ilpermissiongui'
928  );
929  }
930  }
Class ilObjectMetaDataGUI.
$_GET["client_id"]
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
+ Here is the call graph for this function:

◆ importFileObject()

ilObjSurveyQuestionPoolGUI::importFileObject (   $parent_id = null,
  $a_catch_errors = true 
)

form for new survey object import

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

References $_GET, $error, $form, ilObjectGUI\$ilErr, ilObjectGUI\$tpl, ilObjectGUI\checkPermissionBool(), initImportForm(), ilObjectGUI\putObjectInTree(), and ilUtil\redirect().

675  {
676  $tpl = $this->tpl;
678 
679  if (!$parent_id) {
680  $parent_id = $_GET["ref_id"];
681  }
682  $new_type = $_REQUEST["new_type"];
683 
684  // create permission is already checked in createObject. This check here is done to prevent hacking attempts
685  if (!$this->checkPermissionBool("create", "", $new_type)) {
686  $ilErr->raiseError($this->lng->txt("no_create_permission"));
687  }
688 
689  $this->lng->loadLanguageModule($new_type);
690  $this->ctrl->setParameter($this, "new_type", $new_type);
691 
692  $form = $this->initImportForm($new_type);
693  if ($form->checkInput()) {
694  include_once "./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php";
695  $newObj = new ilObjSurveyQuestionPool();
696  $newObj->setType($new_type);
697  $newObj->setTitle("dummy");
698  $newObj->create(true);
699  $this->putObjectInTree($newObj);
700 
701  $newObj->createImportDirectory();
702 
703  // copy uploaded file to import directory
704  $upload = $_FILES["importfile"];
705  $file = pathinfo($upload["name"]);
706  $full_path = $newObj->getImportDirectory() . "/" . $upload["name"];
707  ilUtil::moveUploadedFile(
708  $upload["tmp_name"],
709  $upload["name"],
710  $full_path
711  );
712 
713  // import qti data
714  $qtiresult = $newObj->importObject($full_path);
715 
716  ilUtil::sendSuccess($this->lng->txt("object_imported"), true);
717  ilUtil::redirect("ilias.php?ref_id=" . $newObj->getRefId() .
718  "&baseClass=ilObjSurveyQuestionPoolGUI");
719  }
720 
721  // display form to correct errors
722  $form->setValuesByPost();
723  $tpl->setContent($form->getHtml());
724  }
$_GET["client_id"]
if(isset($_POST['submit'])) $form
putObjectInTree(ilObject $a_obj, $a_parent_node_id=null)
Add object to tree at given position.
static redirect($a_script)
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
+ Here is the call graph for this function:

◆ importQuestionsObject()

ilObjSurveyQuestionPoolGUI::importQuestionsObject ( )

display the import form to import questions into the questionpool

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

References $form, ilObjectGUI\$tpl, and ilFileInputGUI\setSuffixes().

399  {
400  $tpl = $this->tpl;
401 
402  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
403  $form = new ilPropertyFormGUI();
404  $form->setFormAction($this->ctrl->getFormAction($this, "uploadQuestions"));
405  $form->setTitle($this->lng->txt("import_question"));
406 
407  include_once("./Services/Form/classes/class.ilFileInputGUI.php");
408  $fi = new ilFileInputGUI($this->lng->txt("select_file"), "qtidoc");
409  $fi->setSuffixes(array("xml", "zip"));
410  $fi->setRequired(true);
411  $form->addItem($fi);
412 
413  $form->addCommandButton("uploadQuestions", $this->lng->txt("import"));
414  $form->addCommandButton("questions", $this->lng->txt("cancel"));
415 
416  $tpl->setContent($form->getHTML());
417  }
This class represents a property form user interface.
This class represents a file property in a property form.
if(isset($_POST['submit'])) $form
setSuffixes($a_suffixes)
Set Accepted Suffixes.
+ Here is the call graph for this function:

◆ infoScreenForward()

ilObjSurveyQuestionPoolGUI::infoScreenForward ( )

show information screen

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

References $info, ilObjectGUI\checkPermission(), and ilObjectGUI\checkPermissionBool().

Referenced by executeCommand(), and infoScreenObject().

773  {
774  if (!$this->checkPermissionBool("read")) {
775  $this->checkPermission("visible");
776  }
777 
778  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
779  $info = new ilInfoScreenGUI($this);
780  $info->enablePrivateNotes();
781 
782  // standard meta data
783  $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
784 
785  $this->ctrl->forwardCommand($info);
786  }
Class ilInfoScreenGUI.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
$info
Definition: index.php:5
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
+ 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 not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed

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

References infoScreenForward().

763  {
764  $this->ctrl->setCmd("showSummary");
765  $this->ctrl->setCmdClass("ilinfoscreengui");
766  $this->infoScreenForward();
767  }
+ Here is the call graph for this function:

◆ initCreationForms()

ilObjSurveyQuestionPoolGUI::initCreationForms (   $a_new_type)
protected

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

References $form, ilObjectGUI\initCreateForm(), and initImportForm().

662  {
663  $form = $this->initImportForm($a_new_type);
664 
665  $forms = array(self::CFORM_NEW => $this->initCreateForm($a_new_type),
666  self::CFORM_IMPORT => $form);
667 
668  return $forms;
669  }
if(isset($_POST['submit'])) $form
initCreateForm($a_new_type)
Init object creation form.
+ Here is the call graph for this function:

◆ initEditForm()

ilObjSurveyQuestionPoolGUI::initEditForm ( )
protected

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

References $form, ilObjectGUI\$object_service, $section, $title, ilFormPropertyGUI\setInfo(), ilTextAreaInputGUI\setValue(), and ilObject\TITLE_LENGTH.

Referenced by propertiesObject(), and savePropertiesObject().

193  {
194  $obj_service = $this->object_service;
195 
196  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
197  $form = new ilPropertyFormGUI();
198  $form->setFormAction($this->ctrl->getFormAction($this, 'properties'));
199  $form->setTitle($this->lng->txt("properties"));
200  $form->setMultipart(false);
201  $form->setId("properties");
202 
203  // title
204  $title = new ilTextInputGUI($this->lng->txt('title'), 'title');
205  $title->setSubmitFormOnEnter(true);
206  $title->setValue($this->object->getTitle());
207  $title->setSize(min(40, ilObject::TITLE_LENGTH));
208  $title->setMaxLength(ilObject::TITLE_LENGTH);
209  $title->setRequired(true);
210  $form->addItem($title);
211 
212  // desc
213  $desc = new ilTextAreaInputGUI($this->lng->txt('description'), 'desc');
214  $desc->setValue($this->object->getLongDescription());
215  $desc->setRows(2);
216  $desc->setCols(40);
217  $form->addItem($desc);
218 
219  // online
220  $online = new ilCheckboxInputGUI($this->lng->txt("spl_online_property"), "online");
221  $online->setInfo($this->lng->txt("spl_online_property_description"));
222  $online->setChecked($this->object->getOnline());
223  $form->addItem($online);
224 
226  $section->setTitle($this->lng->txt('obj_presentation'));
227  $form->addItem($section);
228 
229  // tile image
230  $obj_service->commonSettings()->legacyForm($form, $this->object)->addTileImage();
231 
232 
233  $form->addCommandButton("saveProperties", $this->lng->txt("save"));
234 
235  return $form;
236  }
This class represents a property form user interface.
const TITLE_LENGTH
max length of object title
This class represents a section header in a property form.
setValue($a_value)
Set Value.
This class represents a checkbox property in a property form.
setInfo($a_info)
Set Information Text.
$section
Definition: Utf8Test.php:83
if(isset($_POST['submit'])) $form
This class represents a text property in a property form.
This class represents a text area property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initImportForm()

ilObjSurveyQuestionPoolGUI::initImportForm (   $a_new_type)
protected

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

References $form.

Referenced by importFileObject(), and initCreationForms().

654  {
655  $form = parent::initImportForm($a_new_type);
656  $form->getItemByPostVar('importfile')->setSuffixes(array("zip", "xml"));
657 
658  return $form;
659  }
if(isset($_POST['submit'])) $form
+ Here is the caller graph for this function:

◆ moveObject()

ilObjSurveyQuestionPoolGUI::moveObject ( )

mark one or more question objects for moving

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

References $_POST, $key, and ilUtil\sendInfo().

297  {
298  if (count($_POST["q_id"]) > 0) {
299  foreach ($_POST["q_id"] as $key => $value) {
300  $this->object->moveToClipboard($value);
301  }
302  ilUtil::sendInfo($this->lng->txt("spl_move_insert_clipboard"), true);
303  } else {
304  ilUtil::sendInfo($this->lng->txt("spl_move_select_none"), true);
305  }
306  $this->ctrl->redirect($this, "questions");
307  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$key
Definition: croninfo.php:18
$_POST["username"]
+ Here is the call graph for this function:

◆ pasteObject()

ilObjSurveyQuestionPoolGUI::pasteObject ( )

paste questios from the clipboard into the question pool

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

References $_SESSION, and ilUtil\sendInfo().

386  {
387  if (array_key_exists("spl_clipboard", $_SESSION)) {
388  $this->object->pasteFromClipboard();
389  } else {
390  ilUtil::sendInfo($this->lng->txt("spl_paste_no_objects"), true);
391  }
392  $this->ctrl->redirect($this, "questions");
393  }
$_SESSION["AccountId"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ previewObject()

& ilObjSurveyQuestionPoolGUI::previewObject ( )

create preview of object

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

References $_GET, and SurveyQuestionGUI\_getQuestionGUI().

749  {
750  include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php";
751  $q_gui = &SurveyQuestionGUI::_getQuestionGUI("", $_GET["preview"]);
752  $this->ctrl->setParameterByClass(get_class($q_gui), "sel_question_types", $q_gui->getQuestionType());
753  $this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $_GET["preview"]);
754  $this->ctrl->redirectByClass(get_class($q_gui), "preview");
755  }
$_GET["client_id"]
static _getQuestionGUI($questiontype, $question_id=-1)
Creates a question gui representation.
+ Here is the call graph for this function:

◆ propertiesObject()

ilObjSurveyQuestionPoolGUI::propertiesObject ( ilPropertyFormGUI  $a_form = null)

Questionpool properties.

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

References initEditForm().

Referenced by savePropertiesObject().

242  {
243  if (!$a_form) {
244  $a_form = $this->initEditForm();
245  }
246 
247  $this->tpl->setVariable("ADM_CONTENT", $a_form->getHTML());
248  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ questionsObject()

ilObjSurveyQuestionPoolGUI::questionsObject (   $arrFilter = null)

list questions of question pool

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

References $_GET, $_SESSION, ilObjectGUI\$data, $ilUser, PHPMailer\PHPMailer\$options, ilObjectGUI\$toolbar, ilObjectGUI\$user, ilObjectGUI\checkPermissionBool(), and ilSubmitButton\getInstance().

Referenced by deleteQuestionsObject(), and exportQuestionObject().

474  {
476  $ilToolbar = $this->toolbar;
477 
478  $this->object->purgeQuestions();
479 
480  $_SESSION['q_id_table_nav'] = $_GET['q_id_table_nav'];
481 
482  if ($this->checkPermissionBool('write')) {
483  include_once "Services/Form/classes/class.ilSelectInputGUI.php";
484  $qtypes = new ilSelectInputGUI("", "sel_question_types");
485  $qtypes->setValue($ilUser->getPref("svy_lastquestiontype"));
486  $ilToolbar->addInputItem($qtypes);
487 
488  $options = array();
489  foreach (ilObjSurveyQuestionPool::_getQuestionTypes() as $translation => $data) {
490  $options[$data["type_tag"]] = $translation;
491  }
492  $qtypes->setOptions($options);
493 
494  $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
495 
496  include_once "Services/UIComponent/Button/classes/class.ilSubmitButton.php";
497  $button = ilSubmitButton::getInstance();
498  $button->setCaption("svy_create_question");
499  $button->setCommand("createQuestion");
500  $ilToolbar->addButtonInstance($button);
501 
502  $ilToolbar->addSeparator();
503 
504  $button = ilSubmitButton::getInstance();
505  $button->setCaption("import");
506  $button->setCommand("importQuestions");
507  $ilToolbar->addButtonInstance($button);
508  }
509 
510  include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionsTableGUI.php";
511  $table_gui = new ilSurveyQuestionsTableGUI($this, 'questions', (($this->checkPermissionBool('write') ? true : false)));
512  $table_gui->setEditable($this->checkPermissionBool('write'));
513  $arrFilter = array();
514  foreach ($table_gui->getFilterItems() as $item) {
515  if ($item->getValue() !== false) {
516  $arrFilter[$item->getPostVar()] = $item->getValue();
517  }
518  }
519  $table_gui->setData($this->object->getQuestionsData($arrFilter));
520  $this->tpl->setContent($table_gui->getHTML());
521  }
$_SESSION["AccountId"]
This class represents a selection list property in a property form.
$_GET["client_id"]
$ilUser
Definition: imgupload.php:18
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetfilterQuestionBrowserObject()

ilObjSurveyQuestionPoolGUI::resetfilterQuestionBrowserObject ( )

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

463  {
464  include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionsTableGUI.php";
465  $table_gui = new ilSurveyQuestionsTableGUI($this, 'questions');
466  $table_gui->resetFilter();
467  $this->ctrl->redirect($this, 'questions');
468  }

◆ saveObligatoryObject()

ilObjSurveyQuestionPoolGUI::saveObligatoryObject ( )

Save obligatory states.

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

References $_POST, and $key.

936  {
937  $obligatory = array();
938  foreach ($_POST as $key => $value) {
939  if (preg_match("/obligatory_(\d+)/", $key, $matches)) {
940  $obligatory[] = $matches[1];
941  }
942  }
943  $this->object->setObligatoryStates($obligatory);
944 
945  ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
946  $this->ctrl->redirect($this, "questions");
947  }
$key
Definition: croninfo.php:18
$_POST["username"]

◆ savePropertiesObject()

ilObjSurveyQuestionPoolGUI::savePropertiesObject ( )

Save questionpool properties.

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

References $form, ilObjectGUI\$object_service, initEditForm(), and propertiesObject().

254  {
255  $obj_service = $this->object_service;
256  $form = $this->initEditForm();
257  if ($form->checkInput()) {
258  $this->object->setTitle($form->getInput("title"));
259  $this->object->setDescription($form->getInput("desc"));
260  $this->object->setOnline((int) $form->getInput("online"));
261 
262  $this->object->saveToDb();
263 
264  // tile image
265  $obj_service->commonSettings()->legacyForm($form, $this->object)->saveTileImage();
266 
267 
268  ilUtil::sendSuccess($this->lng->txt("saved_successfully"), true);
269  $this->ctrl->redirect($this, "properties");
270  }
271 
272  $form->setValuesByPost();
273  $this->propertiesObject($form);
274  }
if(isset($_POST['submit'])) $form
propertiesObject(ilPropertyFormGUI $a_form=null)
Questionpool properties.
+ Here is the call graph for this function:

◆ updateObject()

ilObjSurveyQuestionPoolGUI::updateObject ( )

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

References League\Flysystem\Adapter\Polyfill\update().

524  {
525  $this->update = $this->object->update();
526  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
527  }
update($pash, $contents, Config $config)
+ Here is the call graph for this function:

◆ uploadQuestionsObject()

ilObjSurveyQuestionPoolGUI::uploadQuestionsObject ( )

imports question(s) into the questionpool

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

References $error, and $source.

423  {
424  // check if file was uploaded
425  $source = $_FILES["qtidoc"]["tmp_name"];
426  $error = 0;
427  if (($source == 'none') || (!$source) || $_FILES["qtidoc"]["error"] > UPLOAD_ERR_OK) {
428  $error = 1;
429  }
430  // check correct file type
431  if (!$error && strpos("xml", $_FILES["qtidoc"]["type"]) !== false) {
432  $error = 1;
433  }
434  if (!$error) {
435  // import file into questionpool
436  // create import directory
437  $this->object->createImportDirectory();
438 
439  // copy uploaded file to import directory
440  $full_path = $this->object->getImportDirectory() . "/" . $_FILES["qtidoc"]["name"];
441 
442  ilUtil::moveUploadedFile(
443  $_FILES["qtidoc"]["tmp_name"],
444  $_FILES["qtidoc"]["name"],
445  $full_path
446  );
447  $source = $full_path;
448  $this->object->importObject($source, true);
449  unlink($source);
450  }
451  $this->ctrl->redirect($this, "questions");
452  }
$source
Definition: linkback.php:22

Field Documentation

◆ $defaultscript

ilObjSurveyQuestionPoolGUI::$defaultscript

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

◆ $error

ilObjSurveyQuestionPoolGUI::$error
protected

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

Referenced by importFileObject(), and uploadQuestionsObject().

◆ $help

ilObjSurveyQuestionPoolGUI::$help
protected

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

Referenced by getTabs().

◆ $log

ilObjSurveyQuestionPoolGUI::$log
protected

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

◆ $nav_history

ilObjSurveyQuestionPoolGUI::$nav_history
protected

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

Referenced by executeCommand().


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