ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilObjSurveyQuestionPoolGUI Class Reference

Class ilObjSurveyQuestionPoolGUI. More...

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

Public Member Functions

 __construct ()
 Constructor @access 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 ()
 updates object entry in object_data More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 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 ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 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 @access public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object 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...
 

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
 
 $ilias
 
 $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 ()
 Init object edit form. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
- Protected Member Functions inherited from ilObjectGUI
 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 @access public More...
 
 setAdminTabs ()
 set admin tabs @access 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...
 
 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...
 
 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

 $log
 
- Protected Attributes inherited from ilObjectGUI
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjSurveyQuestionPoolGUI::__construct ( )

Constructor @access public.

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

56 {
57 global $lng, $ilCtrl;
58
59 $this->type = "spl";
60 $lng->loadLanguageModule("survey");
61 $this->ctrl = $ilCtrl;
62 $this->ctrl->saveParameter($this, array("ref_id"));
63
64 parent::__construct("", $_GET["ref_id"], true, false);
65
66 $this->log = ilLoggerFactory::getLogger('svy');
67 }
$_GET["client_id"]
static getLogger($a_component_id)
Get component logger.
global $ilCtrl
Definition: ilias.php:18

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

+ 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 @access public

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

935 {
936 global $ilAccess, $lng;
937
938 if ($ilAccess->checkAccess("visible", "", $a_target) ||
939 $ilAccess->checkAccess("read", "", $a_target))
940 {
941 $_GET["baseClass"] = "ilObjSurveyQuestionPoolGUI";
942 $_GET["cmd"] = "infoScreen";
943 $_GET["ref_id"] = $a_target;
944 include_once("ilias.php");
945 exit;
946 }
947 else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
948 {
949 ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
952 }
953 }
sprintf('%.4f', $callTime)
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

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

+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjSurveyQuestionPoolGUI::addLocatorItems ( )

should be overwritten to add object specific items (repository items are preloaded)

Reimplemented from ilObjectGUI.

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

780 {
781 global $ilLocator;
782 switch ($this->ctrl->getCmd())
783 {
784 case "create":
785 case "importFile":
786 case "cancel":
787 break;
788 default:
789 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $_GET["ref_id"]);
790 break;
791 }
792 if ((int)$_GET["q_id"])
793 {
794 $q_id = (int)$_GET["q_id"];
795 include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
796 $q_type = SurveyQuestion::_getQuestionType($q_id) . "GUI";
797 $q_title = SurveyQuestion::_getTitle($q_id);
798 if($q_title)
799 {
800 // not on create
801 $this->ctrl->setParameterByClass($q_type, "q_id", $q_id);
802 $ilLocator->addItem($q_title,
803 $this->ctrl->getLinkTargetByClass($q_type, "editQuestion"));
804 }
805 }
806 }
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.

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

+ Here is the call graph for this function:

◆ afterSave()

ilObjSurveyQuestionPoolGUI::afterSave ( ilObject  $a_new_object)

Post (successful) object creation hook.

Parameters
ilObject$a_new_object

Reimplemented from ilObjectGUI.

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

515 {
516 // always send a message
517 ilUtil::sendSuccess($this->lng->txt("object_added"),true);
518
519 ilUtil::redirect("ilias.php?ref_id=".$a_new_object->getRefId().
520 "&baseClass=ilObjSurveyQuestionPoolGUI");
521 }
getRefId()
get reference id @access public
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static redirect($a_script)
http redirect to other script

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

+ Here is the call graph for this function:

◆ cancelDeleteExportFileObject()

ilObjSurveyQuestionPoolGUI::cancelDeleteExportFileObject ( )

cancel deletion of export files

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

615 {
616 ilSession::clear("ilExportFiles");
617 $this->ctrl->redirect($this, "export");
618 }
static clear($a_var)
Unset a value.

References ilSession\clear().

+ Here is the call graph for this function:

◆ cancelDeleteQuestionsObject()

ilObjSurveyQuestionPoolGUI::cancelDeleteQuestionsObject ( )

cancel delete questions

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

356 {
357 // delete questions after confirmation
358 $this->ctrl->redirect($this, "questions");
359 }

◆ confirmDeleteExportFileObject()

ilObjSurveyQuestionPoolGUI::confirmDeleteExportFileObject ( )

confirmation screen for export file deletion

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

589 {
590 if(!isset($_POST["file"]))
591 {
592 ilUtil::sendInfo($this->lng->txt("no_checkbox"),true);
593 $this->ctrl->redirect($this, "export");
594 }
595
596 ilUtil::sendQuestion($this->lng->txt("info_delete_sure"));
597 include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionPoolExportTableGUI.php";
598 $table_gui = new ilSurveyQuestionPoolExportTableGUI($this, 'export', true);
599 $export_dir = $this->object->getExportDirectory();
600 $data = array();
601 foreach ($_POST['file'] as $exp_file)
602 {
603 $file_arr = explode("__", $exp_file);
604 array_push($data, array('file' => $exp_file, 'date' => ilDatePresentation::formatDate(new ilDateTime($file_arr[0], IL_CAL_UNIX)), 'size' => filesize($export_dir."/".$exp_file)));
605 }
606 $table_gui->setData($data);
607 $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
608 }
$_POST["username"]
const IL_CAL_UNIX
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

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

+ Here is the call graph for this function:

◆ confirmDeleteQuestionsObject()

ilObjSurveyQuestionPoolGUI::confirmDeleteQuestionsObject ( )

delete questions

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

342 {
343 // delete questions after confirmation
344 ilUtil::sendSuccess($this->lng->txt("qpl_questions_deleted"), true);
345 foreach ($_POST['q_id'] as $q_id)
346 {
347 $this->object->removeQuestion($q_id);
348 }
349 $this->ctrl->redirect($this, "questions");
350 }

References $_POST, and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ copyObject()

ilObjSurveyQuestionPoolGUI::copyObject ( )

Copies checked questions in the questionpool to a clipboard.

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

245 {
246 if (count($_POST["q_id"]) > 0)
247 {
248 foreach ($_POST["q_id"] as $key => $value)
249 {
250 $this->object->copyToClipboard($value);
251 }
252 ilUtil::sendInfo($this->lng->txt("spl_copy_insert_clipboard"), true);
253 }
254 else
255 {
256 ilUtil::sendInfo($this->lng->txt("spl_copy_select_none"), true);
257 }
258 $this->ctrl->redirect($this, "questions");
259 }

References $_POST, and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ createExportFileObject()

ilObjSurveyQuestionPoolGUI::createExportFileObject (   $questions = null)

create export file

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

551 {
552 $this->checkPermission("write");
553
554 include_once("./Modules/SurveyQuestionPool/classes/class.ilSurveyQuestionpoolExport.php");
555 $survey_exp = new ilSurveyQuestionpoolExport($this->object);
556 $survey_exp->buildExportFile($questions);
557 $this->ctrl->redirect($this, "export");
558 }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
Export class for survey questionpools.

References ilObjectGUI\checkPermission().

Referenced by exportQuestionObject().

+ 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 719 of file class.ilObjSurveyQuestionPoolGUI.php.

720 {
721 global $ilUser;
722
723 $ilUser->writePref("svy_lastquestiontype", $_POST["sel_question_types"]);
724
725 include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php";
726 $q_gui =& SurveyQuestionGUI::_getQuestionGUI($_POST["sel_question_types"]);
727 $q_gui->object->setObjId($this->object->getId());
728 $q_gui->object->createNewQuestion();
729
730 $this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $q_gui->object->getId());
731 $this->ctrl->setParameterByClass(get_class($q_gui), "sel_question_types", $_POST["sel_question_types"]);
732 $this->ctrl->redirectByClass(get_class($q_gui), "editQuestion");
733 }
static _getQuestionGUI($questiontype, $question_id=-1)
Creates a question gui representation.
$ilUser
Definition: imgupload.php:18

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

+ Here is the call graph for this function:

◆ deleteExportFileObject()

ilObjSurveyQuestionPoolGUI::deleteExportFileObject ( )

delete export files

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

624 {
625 $export_dir = $this->object->getExportDirectory();
626 foreach($_POST['file'] as $file)
627 {
628 $file = basename($file);
629
630 $exp_file = $export_dir."/".$file;
631 $exp_dir = $export_dir."/".substr($file, 0, strlen($file) - 4);
632 if (@is_file($exp_file))
633 {
634 unlink($exp_file);
635 }
636 if (@is_dir($exp_dir))
637 {
638 ilUtil::delDir($exp_dir);
639 }
640 }
641 $this->ctrl->redirect($this, "export");
642 }
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file

References $_POST, $file, and ilUtil\delDir().

+ 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 300 of file class.ilObjSurveyQuestionPoolGUI.php.

301 {
302 $this->checkPermission('write');
303
304 // create an array of all checked checkboxes
305 $checked_questions = $_POST['q_id'];
306 if (count($checked_questions) == 0)
307 {
308 ilUtil::sendInfo($this->lng->txt("qpl_delete_select_none"));
309 $this->questionsObject();
310 return;
311 }
312
313 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
314 $cgui = new ilConfirmationGUI();
315 $cgui->setHeaderText($this->lng->txt("qpl_confirm_delete_questions"));
316
317 $cgui->setFormAction($this->ctrl->getFormAction($this));
318 $cgui->setCancel($this->lng->txt("cancel"), "cancelDeleteQuestions");
319 $cgui->setConfirm($this->lng->txt("confirm"), "confirmDeleteQuestions");
320
321 include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
322 $infos = $this->object->getQuestionInfos($checked_questions);
323 foreach ($infos as $data)
324 {
325 $txt = $data["title"]." (".
327 if($data["description"])
328 {
329 $txt .= "<div class=\"small\">".$data["description"]."</div>";
330 }
331
332 $cgui->addItem("q_id[]", $data["id"], $txt);
333 }
334
335 $this->tpl->setContent($cgui->getHTML());
336 }
static _getQuestionTypeName($type_tag)
Return the translation for a given question type tag.
Confirmation screen class.
questionsObject($arrFilter=null)
list questions of question pool
$txt
Definition: error.php:12

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

+ Here is the call graph for this function:

◆ downloadExportFileObject()

ilObjSurveyQuestionPoolGUI::downloadExportFileObject ( )

download export file

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

564 {
565 if(!isset($_POST["file"]))
566 {
567 ilUtil::sendInfo($this->lng->txt("no_checkbox"), true);
568 $this->ctrl->redirect($this, "export");
569 }
570
571 if (count($_POST["file"]) > 1)
572 {
573 ilUtil::sendInfo($this->lng->txt("select_max_one_item"),true);
574 $this->ctrl->redirect($this, "export");
575 }
576
577
578 $export_dir = $this->object->getExportDirectory();
579
580 $file = basename($_POST["file"][0]);
581
582 ilUtil::deliverFile($export_dir."/".$file, $file);
583 }
static deliverFile($a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.

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

+ Here is the call graph for this function:

◆ executeCommand()

ilObjSurveyQuestionPoolGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

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

73 {
74 global $ilNavigationHistory;
75
76 if (!$this->checkPermissionBool("visible") &&
77 !$this->checkPermissionBool("read"))
78 {
79 $this->checkPermission("read");
80 }
81
82 // add entry to navigation history
83 if (!$this->getCreationMode() &&
84 $this->checkPermissionBool("read"))
85 {
86 $ilNavigationHistory->addItem($this->ref_id,
87 "ilias.php?baseClass=ilObjSurveyQuestionPoolGUI&cmd=questions&ref_id=".$this->ref_id, "spl");
88 }
89
90 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "survey.css", "Modules/Survey"), "screen");
91 $this->prepareOutput();
92
93 $cmd = $this->ctrl->getCmd("questions");
94 $next_class = $this->ctrl->getNextClass($this);
95 $this->ctrl->setReturn($this, "questions");
96 if ($_GET["q_id"] < 1)
97 {
98 $q_type = ($_POST["sel_question_types"] != "")
99 ? $_POST["sel_question_types"]
100 : $_GET["sel_question_types"];
101 }
102
103 $this->log->debug("- cmd=".$cmd." next_class=".$next_class);
104 switch($next_class)
105 {
106 case 'ilobjectmetadatagui':
107 $this->checkPermission('write');
108 include_once 'Services/Object/classes/class.ilObjectMetaDataGUI.php';
109 $md_gui = new ilObjectMetaDataGUI($this->object);
110 $this->ctrl->forwardCommand($md_gui);
111 break;
112
113 case 'ilpermissiongui':
114 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
115 $perm_gui = new ilPermissionGUI($this);
116 $ret =& $this->ctrl->forwardCommand($perm_gui);
117 break;
118
119 case "ilsurveyphrasesgui":
120 include_once("./Modules/SurveyQuestionPool/classes/class.ilSurveyPhrasesGUI.php");
121 $phrases_gui = new ilSurveyPhrasesGUI($this);
122 $ret =& $this->ctrl->forwardCommand($phrases_gui);
123 break;
124
125 case 'ilobjectcopygui':
126 include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
127 $cp = new ilObjectCopyGUI($this);
128 $cp->setType('spl');
129 $this->ctrl->forwardCommand($cp);
130 break;
131
132 case 'ilinfoscreengui':
133 $this->infoScreenForward();
134 break;
135
136 case "ilcommonactiondispatchergui":
137 include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
139 $this->ctrl->forwardCommand($gui);
140 break;
141
142 case "":
143 $cmd.= "Object";
144 $ret =& $this->$cmd();
145 break;
146
147 default:
148 include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php";
149 $q_gui = SurveyQuestionGUI::_getQuestionGUI($q_type, $_GET["q_id"]);
150 $this->log->debug("- This is the switch/case default, going to question id =".$_GET["q_id"]);
151 // $q_gui->object->setObjId($this->object->getId());
152 $q_gui->setQuestionTabs();
153 $ret =& $this->ctrl->forwardCommand($q_gui);
154
155 // not on create
156 if($q_gui->object->isComplete())
157 {
158 $this->tpl->setTitle($this->lng->txt("question").": ".$q_gui->object->getTitle());
159 }
160 break;
161 }
162 if (strtolower($_GET["baseClass"]) != "iladministrationgui" &&
163 $this->getCreationMode() != true)
164 {
165 $this->tpl->show();
166 }
167 }
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
GUI class for the workflow of copying objects.
prepareOutput($a_show_subobjects=true)
prepare output
getCreationMode()
get creation mode
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
Class ilObjectMetaDataGUI.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
Survey phrases GUI class.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$ret
Definition: parser.php:6
$cmd
Definition: sahs_server.php:35

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

+ Here is the call graph for this function:

◆ exportObject()

ilObjSurveyQuestionPoolGUI::exportObject ( )

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

527 {
528 global $ilToolbar;
529
530 $ilToolbar->addButton($this->lng->txt('create_export_file'),
531 $this->ctrl->getLinkTarget($this, 'createExportFile'));
532
533 include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionPoolExportTableGUI.php";
534 $table_gui = new ilSurveyQuestionPoolExportTableGUI($this, 'export');
535 $export_dir = $this->object->getExportDirectory();
536 $export_files = $this->object->getExportFiles($export_dir);
537 $data = array();
538 foreach ($export_files as $exp_file)
539 {
540 $file_arr = explode("__", $exp_file);
541 array_push($data, array('file' => $exp_file, 'date' => ilDatePresentation::formatDate(new ilDateTime($file_arr[0], IL_CAL_UNIX)), 'size' => filesize($export_dir."/".$exp_file)));
542 }
543 $table_gui->setData($data);
544 $this->tpl->setContent($table_gui->getHTML());
545 }

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

+ Here is the call graph for this function:

◆ exportQuestionObject()

ilObjSurveyQuestionPoolGUI::exportQuestionObject ( )

export a question

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

285 {
286 if (is_array($_POST['q_id']) && count($_POST['q_id']) > 0)
287 {
288 $this->createExportFileObject($_POST['q_id']);
289 }
290 else
291 {
292 ilUtil::sendInfo($this->lng->txt("qpl_export_select_none"));
293 $this->questionsObject();
294 }
295 }
createExportFileObject($questions=null)
create export file

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

+ Here is the call graph for this function:

◆ filterQuestionBrowserObject()

ilObjSurveyQuestionPoolGUI::filterQuestionBrowserObject ( )

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

437 {
438 include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionsTableGUI.php";
439 $table_gui = new ilSurveyQuestionsTableGUI($this, 'questions');
440 $table_gui->writeFilterToSession();
441 $this->ctrl->redirect($this, 'questions');
442 }

◆ getTabs()

ilObjSurveyQuestionPoolGUI::getTabs ( )

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

Reimplemented from ilObjectGUI.

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

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

References $_GET, and ilObjectGUI\checkPermissionBool().

+ Here is the call graph for this function:

◆ importFileObject()

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

form for new survey object import

Reimplemented from ilObjectGUI.

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

666 {
667 global $tpl, $ilErr;
668
669 if(!$parent_id)
670 {
671 $parent_id = $_GET["ref_id"];
672 }
673 $new_type = $_REQUEST["new_type"];
674
675 // create permission is already checked in createObject. This check here is done to prevent hacking attempts
676 if (!$this->checkPermissionBool("create", "", $new_type))
677 {
678 $ilErr->raiseError($this->lng->txt("no_create_permission"));
679 }
680
681 $this->lng->loadLanguageModule($new_type);
682 $this->ctrl->setParameter($this, "new_type", $new_type);
683
684 $form = $this->initImportForm($new_type);
685 if ($form->checkInput())
686 {
687 include_once "./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php";
688 $newObj = new ilObjSurveyQuestionPool();
689 $newObj->setType($new_type);
690 $newObj->setTitle("dummy");
691 $newObj->create(true);
692 $this->putObjectInTree($newObj);
693
694 $newObj->createImportDirectory();
695
696 // copy uploaded file to import directory
697 $upload = $_FILES["importfile"];
698 $file = pathinfo($upload["name"]);
699 $full_path = $newObj->getImportDirectory()."/".$upload["name"];
700 ilUtil::moveUploadedFile($upload["tmp_name"], $upload["name"],
701 $full_path);
702
703 // import qti data
704 $qtiresult = $newObj->importObject($full_path);
705
706 ilUtil::sendSuccess($this->lng->txt("object_imported"),true);
707 ilUtil::redirect("ilias.php?ref_id=".$newObj->getRefId().
708 "&baseClass=ilObjSurveyQuestionPoolGUI");
709 }
710
711 // display form to correct errors
712 $form->setValuesByPost();
713 $tpl->setContent($form->getHtml());
714 }
initImportForm($a_new_type)
Init object import form.
putObjectInTree(ilObject $a_obj, $a_parent_node_id=null)
Add object to tree at given position.
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
global $ilErr
Definition: raiseError.php:16

References $_GET, $file, $ilErr, ilObjectGUI\$tpl, ilObjectGUI\checkPermissionBool(), initImportForm(), ilUtil\moveUploadedFile(), ilObjectGUI\putObjectInTree(), ilUtil\redirect(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ importQuestionsObject()

ilObjSurveyQuestionPoolGUI::importQuestionsObject ( )

display the import form to import questions into the questionpool

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

381 {
382 global $tpl;
383
384 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
385 $form = new ilPropertyFormGUI();
386 $form->setFormAction($this->ctrl->getFormAction($this, "uploadQuestions"));
387 $form->setTitle($this->lng->txt("import_question"));
388
389 include_once("./Services/Form/classes/class.ilFileInputGUI.php");
390 $fi = new ilFileInputGUI($this->lng->txt("select_file"), "qtidoc");
391 $fi->setSuffixes(array("xml", "zip"));
392 $fi->setRequired(true);
393 $form->addItem($fi);
394
395 $form->addCommandButton("uploadQuestions", $this->lng->txt("import"));
396 $form->addCommandButton("questions", $this->lng->txt("cancel"));
397
398 $tpl->setContent($form->getHTML());
399 }
This class represents a file property in a property form.
This class represents a property form user interface.

References ilObjectGUI\$tpl.

◆ infoScreenForward()

ilObjSurveyQuestionPoolGUI::infoScreenForward ( )

show information screen

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

763 {
764 if (!$this->checkPermissionBool("read"))
765 {
766 $this->checkPermission("visible");
767 }
768
769 include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
770 $info = new ilInfoScreenGUI($this);
771 $info->enablePrivateNotes();
772
773 // standard meta data
774 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
775
776 $this->ctrl->forwardCommand($info);
777 }
Class ilInfoScreenGUI.
$info
Definition: example_052.php:80

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

Referenced by executeCommand(), and infoScreenObject().

+ 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 752 of file class.ilObjSurveyQuestionPoolGUI.php.

753 {
754 $this->ctrl->setCmd("showSummary");
755 $this->ctrl->setCmdClass("ilinfoscreengui");
756 $this->infoScreenForward();
757 }

References infoScreenForward().

+ Here is the call graph for this function:

◆ initCreationForms()

ilObjSurveyQuestionPoolGUI::initCreationForms (   $a_new_type)
protected

Init creation froms.

this will create the default creation forms: new, import, clone

Parameters
string$a_new_type
Returns
array

Reimplemented from ilObjectGUI.

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

653 {
654 $form = $this->initImportForm($a_new_type);
655
656 $forms = array(self::CFORM_NEW => $this->initCreateForm($a_new_type),
657 self::CFORM_IMPORT => $form);
658
659 return $forms;
660 }
initCreateForm($a_new_type)
Init object creation form.

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

+ Here is the call graph for this function:

◆ initEditForm()

ilObjSurveyQuestionPoolGUI::initEditForm ( )
protected

Init object edit form.

Returns
ilPropertyFormGUI

Reimplemented from ilObjectGUI.

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

170 {
171 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
172 $form = new ilPropertyFormGUI();
173 $form->setFormAction($this->ctrl->getFormAction($this, 'properties'));
174 $form->setTitle($this->lng->txt("properties"));
175 $form->setMultipart(false);
176 $form->setId("properties");
177
178 // title
179 $title = new ilTextInputGUI($this->lng->txt('title'),'title');
180 $title->setSubmitFormOnEnter(true);
181 $title->setValue($this->object->getTitle());
182 $title->setSize(min(40, ilObject::TITLE_LENGTH));
183 $title->setMaxLength(ilObject::TITLE_LENGTH);
184 $title->setRequired(true);
185 $form->addItem($title);
186
187 // desc
188 $desc = new ilTextAreaInputGUI($this->lng->txt('description'),'desc');
189 $desc->setValue($this->object->getLongDescription());
190 $desc->setRows(2);
191 $desc->setCols(40);
192 $form->addItem($desc);
193
194 // online
195 $online = new ilCheckboxInputGUI($this->lng->txt("spl_online_property"), "online");
196 $online->setInfo($this->lng->txt("spl_online_property_description"));
197 $online->setChecked($this->object->getOnline());
198 $form->addItem($online);
199
200 $form->addCommandButton("saveProperties", $this->lng->txt("save"));
201
202 return $form;
203 }
This class represents a checkbox property in a property form.
const TITLE_LENGTH
max length of object title
This class represents a text area property in a property form.
This class represents a text property in a property form.

References $title, and ilObject\TITLE_LENGTH.

Referenced by propertiesObject(), and savePropertiesObject().

+ Here is the caller graph for this function:

◆ initImportForm()

ilObjSurveyQuestionPoolGUI::initImportForm (   $a_new_type)
protected

Init object import form.

Parameters
stringnew type
Returns
ilPropertyFormGUI

Reimplemented from ilObjectGUI.

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

645 {
646 $form = parent::initImportForm($a_new_type);
647 $form->getItemByPostVar('importfile')->setSuffixes(array("zip", "xml"));
648
649 return $form;
650 }

Referenced by importFileObject(), and initCreationForms().

+ Here is the caller graph for this function:

◆ moveObject()

ilObjSurveyQuestionPoolGUI::moveObject ( )

mark one or more question objects for moving

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

265 {
266 if (count($_POST["q_id"]) > 0)
267 {
268 foreach ($_POST["q_id"] as $key => $value)
269 {
270 $this->object->moveToClipboard($value);
271 }
272 ilUtil::sendInfo($this->lng->txt("spl_move_insert_clipboard"), true);
273 }
274 else
275 {
276 ilUtil::sendInfo($this->lng->txt("spl_move_select_none"), true);
277 }
278 $this->ctrl->redirect($this, "questions");
279 }

References $_POST, and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ pasteObject()

ilObjSurveyQuestionPoolGUI::pasteObject ( )

paste questios from the clipboard into the question pool

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

365 {
366 if (array_key_exists("spl_clipboard", $_SESSION))
367 {
368 $this->object->pasteFromClipboard();
369 }
370 else
371 {
372 ilUtil::sendInfo($this->lng->txt("spl_paste_no_objects"), true);
373 }
374 $this->ctrl->redirect($this, "questions");
375 }
$_SESSION["AccountId"]

References $_SESSION, and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ previewObject()

& ilObjSurveyQuestionPoolGUI::previewObject ( )

create preview of object

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

739 {
740 include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php";
741 $q_gui =& SurveyQuestionGUI::_getQuestionGUI("", $_GET["preview"]);
742 $this->ctrl->setParameterByClass(get_class($q_gui), "sel_question_types", $q_gui->getQuestionType());
743 $this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $_GET["preview"]);
744 $this->ctrl->redirectByClass(get_class($q_gui), "preview");
745 }

References $_GET, and SurveyQuestionGUI\_getQuestionGUI().

+ Here is the call graph for this function:

◆ propertiesObject()

ilObjSurveyQuestionPoolGUI::propertiesObject ( ilPropertyFormGUI  $a_form = null)

Questionpool properties.

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

209 {
210 if(!$a_form)
211 {
212 $a_form = $this->initEditForm();
213 }
214
215 $this->tpl->setVariable("ADM_CONTENT", $a_form->getHTML());
216 }

References initEditForm().

Referenced by savePropertiesObject().

+ 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 455 of file class.ilObjSurveyQuestionPoolGUI.php.

456 {
457 global $ilUser, $ilToolbar;
458
459 $this->object->purgeQuestions();
460
461 $_SESSION['q_id_table_nav'] = $_GET['q_id_table_nav'];
462
463 if ($this->checkPermissionBool('write'))
464 {
465 include_once "Services/Form/classes/class.ilSelectInputGUI.php";
466 $qtypes = new ilSelectInputGUI("", "sel_question_types");
467 $qtypes->setValue($ilUser->getPref("svy_lastquestiontype"));
468 $ilToolbar->addInputItem($qtypes);
469
470 $options = array();
471 foreach (ilObjSurveyQuestionPool::_getQuestionTypes() as $translation => $data)
472 {
473 $options[$data["type_tag"]] = $translation;
474 }
475 $qtypes->setOptions($options);
476
477 $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
478
479 include_once "Services/UIComponent/Button/classes/class.ilSubmitButton.php";
480 $button = ilSubmitButton::getInstance();
481 $button->setCaption("svy_create_question");
482 $button->setCommand("createQuestion");
483 $ilToolbar->addButtonInstance($button);
484
485 $ilToolbar->addSeparator();
486
487 $button = ilSubmitButton::getInstance();
488 $button->setCaption("import");
489 $button->setCommand("importQuestions");
490 $ilToolbar->addButtonInstance($button);
491 }
492
493 include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionsTableGUI.php";
494 $table_gui = new ilSurveyQuestionsTableGUI($this, 'questions', (($this->checkPermissionBool('write') ? true : false)));
495 $table_gui->setEditable($this->checkPermissionBool('write'));
496 $arrFilter = array();
497 foreach ($table_gui->getFilterItems() as $item)
498 {
499 if ($item->getValue() !== false)
500 {
501 $arrFilter[$item->getPostVar()] = $item->getValue();
502 }
503 }
504 $table_gui->setData($this->object->getQuestionsData($arrFilter));
505 $this->tpl->setContent($table_gui->getHTML());
506 }
This class represents a selection list property in a property form.
static getInstance()
Factory.
if(!is_array($argv)) $options

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

Referenced by deleteQuestionsObject(), and exportQuestionObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetfilterQuestionBrowserObject()

ilObjSurveyQuestionPoolGUI::resetfilterQuestionBrowserObject ( )

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

445 {
446 include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionsTableGUI.php";
447 $table_gui = new ilSurveyQuestionsTableGUI($this, 'questions');
448 $table_gui->resetFilter();
449 $this->ctrl->redirect($this, 'questions');
450 }

◆ saveObligatoryObject()

ilObjSurveyQuestionPoolGUI::saveObligatoryObject ( )

Save obligatory states.

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

913 {
914 $obligatory = array();
915 foreach ($_POST as $key => $value)
916 {
917 if (preg_match("/obligatory_(\d+)/", $key, $matches))
918 {
919 $obligatory[]= $matches[1];
920 }
921 }
922 $this->object->setObligatoryStates($obligatory);
923
924 ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
925 $this->ctrl->redirect($this, "questions");
926 }

References $_POST, and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ savePropertiesObject()

ilObjSurveyQuestionPoolGUI::savePropertiesObject ( )

Save questionpool properties.

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

222 {
223 $form = $this->initEditForm();
224 if($form->checkInput())
225 {
226 $this->object->setTitle($form->getInput("title"));
227 $this->object->setDescription($form->getInput("desc"));
228 $this->object->setOnline((int)$form->getInput("online"));
229
230 $this->object->saveToDb();
231
232 ilUtil::sendSuccess($this->lng->txt("saved_successfully"), true);
233 $this->ctrl->redirect($this, "properties");
234 }
235
236 $form->setValuesByPost();
237 $this->propertiesObject($form);
238 }
propertiesObject(ilPropertyFormGUI $a_form=null)
Questionpool properties.

References initEditForm(), propertiesObject(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ updateObject()

ilObjSurveyQuestionPoolGUI::updateObject ( )

updates object entry in object_data

Reimplemented from ilObjectGUI.

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

509 {
510 $this->update = $this->object->update();
511 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
512 }

References ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ uploadQuestionsObject()

ilObjSurveyQuestionPoolGUI::uploadQuestionsObject ( )

imports question(s) into the questionpool

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

405 {
406 // check if file was uploaded
407 $source = $_FILES["qtidoc"]["tmp_name"];
408 $error = 0;
409 if (($source == 'none') || (!$source) || $_FILES["qtidoc"]["error"] > UPLOAD_ERR_OK)
410 {
411 $error = 1;
412 }
413 // check correct file type
414 if (!$error && strpos("xml", $_FILES["qtidoc"]["type"]) !== FALSE)
415 {
416 $error = 1;
417 }
418 if (!$error)
419 {
420 // import file into questionpool
421 // create import directory
422 $this->object->createImportDirectory();
423
424 // copy uploaded file to import directory
425 $full_path = $this->object->getImportDirectory()."/".$_FILES["qtidoc"]["name"];
426
427 ilUtil::moveUploadedFile($_FILES["qtidoc"]["tmp_name"],
428 $_FILES["qtidoc"]["name"], $full_path);
429 $source = $full_path;
430 $this->object->importObject($source, TRUE);
431 unlink($source);
432 }
433 $this->ctrl->redirect($this, "questions");
434 }
$error
Definition: Error.php:17

References $error, and ilUtil\moveUploadedFile().

+ Here is the call graph for this function:

Field Documentation

◆ $defaultscript

ilObjSurveyQuestionPoolGUI::$defaultscript

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

◆ $log

ilObjSurveyQuestionPoolGUI::$log
protected

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


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