ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
ilObjSurveyQuestionPoolGUI Class Reference

Class ilObjSurveyQuestionPoolGUI. More...

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

Public Member Functions

 ilObjSurveyQuestionPoolGUI ()
 Constructor @access public. More...
 
 executeCommand ()
 execute command More...
 
 propertiesObject ()
 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 ()
 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 (&$tabs_gui)
 adds tabs to tab gui object More...
 
 saveObligatoryObject ()
 Save obligatory states. More...
 
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor @access public. More...
 
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...
 
 getAdminTabs (&$tabs_gui)
 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 ($in_rep=false)
 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...
 
 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

 initImportForm ($a_new_type)
 Init object import form. More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 prepareOutput ()
 prepare output More...
 
 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)
 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...
 
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste More...
 
 getTabs (&$tabs_gui)
 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 ($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...
 

Detailed Description

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

917 {
918 global $ilAccess, $ilErr, $lng;
919 if ($ilAccess->checkAccess("write", "", $a_target))
920 {
921 $_GET["baseClass"] = "ilObjSurveyQuestionPoolGUI";
922 $_GET["cmd"] = "questions";
923 $_GET["ref_id"] = $a_target;
924 include_once("ilias.php");
925 exit;
926 }
927 else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
928 {
929 ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
932 }
933 $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
934 }
$_GET["client_id"]
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.
exit
Definition: login.php:54

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

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

769 {
770 global $ilLocator;
771 switch ($this->ctrl->getCmd())
772 {
773 case "create":
774 case "importFile":
775 case "cancel":
776 break;
777 default:
778 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $_GET["ref_id"]);
779 break;
780 }
781 if ((int)$_GET["q_id"])
782 {
783 $q_id = (int)$_GET["q_id"];
784 include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
785 $q_type = SurveyQuestion::_getQuestionType($q_id) . "GUI";
786 $q_title = SurveyQuestion::_getTitle($q_id);
787 if($q_title)
788 {
789 // not on create
790 $this->ctrl->setParameterByClass($q_type, "q_id", $q_id);
791 $ilLocator->addItem($q_title,
792 $this->ctrl->getLinkTargetByClass($q_type, "editQuestion"));
793 }
794 }
795 }
_getQuestionType($question_id)
Returns the question type of a question with a given id.
_getTitle($question_id)
Returns the question title 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 494 of file class.ilObjSurveyQuestionPoolGUI.php.

495 {
496 // always send a message
497 ilUtil::sendSuccess($this->lng->txt("object_added"),true);
498
499 ilUtil::redirect("ilias.php?ref_id=".$a_new_object->getRefId().
500 "&baseClass=ilObjSurveyQuestionPoolGUI");
501 }
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 602 of file class.ilObjSurveyQuestionPoolGUI.php.

603 {
604 ilSession::clear("ilExportFiles");
605 $this->ctrl->redirect($this, "export");
606 }
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 332 of file class.ilObjSurveyQuestionPoolGUI.php.

333 {
334 // delete questions after confirmation
335 $this->ctrl->redirect($this, "questions");
336 }

◆ confirmDeleteExportFileObject()

ilObjSurveyQuestionPoolGUI::confirmDeleteExportFileObject ( )

confirmation screen for export file deletion

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

577 {
578 if(!isset($_POST["file"]))
579 {
580 ilUtil::sendInfo($this->lng->txt("no_checkbox"),true);
581 $this->ctrl->redirect($this, "export");
582 }
583
584 ilUtil::sendQuestion($this->lng->txt("info_delete_sure"));
585 include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionPoolExportTableGUI.php";
586 $table_gui = new ilSurveyQuestionPoolExportTableGUI($this, 'export', true);
587 $export_dir = $this->object->getExportDirectory();
588 $data = array();
589 foreach ($_POST['file'] as $exp_file)
590 {
591 $file_arr = explode("__", $exp_file);
592 array_push($data, array('file' => $exp_file, 'date' => ilDatePresentation::formatDate(new ilDateTime($file_arr[0], IL_CAL_UNIX)), 'size' => filesize($export_dir."/".$exp_file)));
593 }
594 $table_gui->setData($data);
595 $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
596 }
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.
$_POST['username']
Definition: cron.php:12

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

319 {
320 // delete questions after confirmation
321 ilUtil::sendSuccess($this->lng->txt("qpl_questions_deleted"), true);
322 foreach ($_POST['q_id'] as $q_id)
323 {
324 $this->object->removeQuestion($q_id);
325 }
326 $this->ctrl->redirect($this, "questions");
327 }

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

213 {
214 if (count($_POST["q_id"]) > 0)
215 {
216 foreach ($_POST["q_id"] as $key => $value)
217 {
218 $this->object->copyToClipboard($value);
219 }
220 ilUtil::sendInfo($this->lng->txt("spl_copy_insert_clipboard"), true);
221 }
222 else
223 {
224 ilUtil::sendInfo($this->lng->txt("spl_copy_select_none"), true);
225 }
226 $this->ctrl->redirect($this, "questions");
227 }

References $_POST, and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ createExportFileObject()

ilObjSurveyQuestionPoolGUI::createExportFileObject (   $questions = null)

create export file

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

531 {
532 global $rbacsystem;
533
534 if ($rbacsystem->checkAccess("write", $this->ref_id))
535 {
536 include_once("./Modules/SurveyQuestionPool/classes/class.ilSurveyQuestionpoolExport.php");
537 $survey_exp = new ilSurveyQuestionpoolExport($this->object);
538 $survey_exp->buildExportFile($questions);
539 $this->ctrl->redirect($this, "export");
540 }
541 else
542 {
543 ilUtil::sendInfo("cannot_export_questionpool");
544 }
545 }
Export class for survey questionpools.

References ilUtil\sendInfo().

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

707 {
708 global $ilUser;
709
710 $ilUser->writePref("svy_lastquestiontype", $_POST["sel_question_types"]);
711
712 include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php";
713 $q_gui =& SurveyQuestionGUI::_getQuestionGUI($_POST["sel_question_types"]);
714 $q_gui->object->setObjId($this->object->getId());
715 $q_gui->object->createNewQuestion();
716
717 $this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $q_gui->object->getId());
718 $this->ctrl->setParameterByClass(get_class($q_gui), "sel_question_types", $_POST["sel_question_types"]);
719 $this->ctrl->redirectByClass(get_class($q_gui), "editQuestion");
720 }
static & _getQuestionGUI($questiontype, $question_id=-1)
Creates a question gui representation.
global $ilUser
Definition: imgupload.php:15

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

+ Here is the call graph for this function:

◆ deleteExportFileObject()

ilObjSurveyQuestionPoolGUI::deleteExportFileObject ( )

delete export files

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

612 {
613 $export_dir = $this->object->getExportDirectory();
614 foreach($_POST['file'] as $file)
615 {
616 $file = basename($file);
617
618 $exp_file = $export_dir."/".$file;
619 $exp_dir = $export_dir."/".substr($file, 0, strlen($file) - 4);
620 if (@is_file($exp_file))
621 {
622 unlink($exp_file);
623 }
624 if (@is_dir($exp_dir))
625 {
626 include_once "./Services/Utilities/classes/class.ilUtil.php";
627 ilUtil::delDir($exp_dir);
628 }
629 }
630 $this->ctrl->redirect($this, "export");
631 }
print $file
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively

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

269 {
270 global $rbacsystem;
271
272 // create an array of all checked checkboxes
273 $checked_questions = $_POST['q_id'];
274 if (count($checked_questions) > 0)
275 {
276 if (!$rbacsystem->checkAccess('write', $this->ref_id))
277 {
278 ilUtil::sendFailure($this->lng->txt("qpl_delete_rbac_error"));
279 $this->questionsObject();
280 return;
281 }
282 }
283 elseif (count($checked_questions) == 0)
284 {
285 ilUtil::sendInfo($this->lng->txt("qpl_delete_select_none"));
286 $this->questionsObject();
287 return;
288 }
289
290 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
291 $cgui = new ilConfirmationGUI();
292 $cgui->setHeaderText($this->lng->txt("qpl_confirm_delete_questions"));
293
294 $cgui->setFormAction($this->ctrl->getFormAction($this));
295 $cgui->setCancel($this->lng->txt("cancel"), "cancelDeleteQuestions");
296 $cgui->setConfirm($this->lng->txt("confirm"), "confirmDeleteQuestions");
297
298 include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
299 $infos = $this->object->getQuestionInfos($checked_questions);
300 foreach ($infos as $data)
301 {
302 $txt = $data["title"]." (".
304 if($data["description"])
305 {
306 $txt .= "<div class=\"small\">".$data["description"]."</div>";
307 }
308
309 $cgui->addItem("q_id[]", $data["id"], $txt);
310 }
311
312 $this->tpl->setContent($cgui->getHTML());
313 }
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:10

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

+ Here is the call graph for this function:

◆ downloadExportFileObject()

ilObjSurveyQuestionPoolGUI::downloadExportFileObject ( )

download export file

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

551 {
552 if(!isset($_POST["file"]))
553 {
554 ilUtil::sendInfo($this->lng->txt("no_checkbox"), true);
555 $this->ctrl->redirect($this, "export");
556 }
557
558 if (count($_POST["file"]) > 1)
559 {
560 ilUtil::sendInfo($this->lng->txt("select_max_one_item"),true);
561 $this->ctrl->redirect($this, "export");
562 }
563
564
565 $export_dir = $this->object->getExportDirectory();
566 include_once "./Services/Utilities/classes/class.ilUtil.php";
567
568 $file = basename($_POST["file"][0]);
569
570 ilUtil::deliverFile($export_dir."/".$file, $file);
571 }
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 65 of file class.ilObjSurveyQuestionPoolGUI.php.

66 {
67 global $ilAccess, $ilNavigationHistory, $ilErr;
68
69 if (!$ilAccess->checkAccess("read", "", $this->ref_id) &&
70 !$ilAccess->checkAccess("visible", "", $this->ref_id))
71 {
72 global $ilias;
73 $ilias->raiseError($this->lng->txt("permission_denied"), $ilias->error_obj->MESSAGE);
74 }
75
76 // add entry to navigation history
77 if (!$this->getCreationMode() &&
78 $ilAccess->checkAccess("read", "", $this->ref_id))
79 {
80 $ilNavigationHistory->addItem($this->ref_id,
81 "ilias.php?baseClass=ilObjSurveyQuestionPoolGUI&cmd=questions&ref_id=".$this->ref_id, "spl");
82 }
83
84 $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "survey.css", "Modules/Survey"), "screen");
85 $this->prepareOutput();
86
87 $cmd = $this->ctrl->getCmd("questions");
88 $next_class = $this->ctrl->getNextClass($this);
89 $this->ctrl->setReturn($this, "questions");
90 if ($_GET["q_id"] < 1)
91 {
92 $q_type = ($_POST["sel_question_types"] != "")
93 ? $_POST["sel_question_types"]
94 : $_GET["sel_question_types"];
95 }
96 switch($next_class)
97 {
98 case 'ilmdeditorgui':
99 if(!$ilAccess->checkAccess('write','',$this->object->getRefId()))
100 {
101 $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->WARNING);
102 }
103
104 include_once "./Services/MetaData/classes/class.ilMDEditorGUI.php";
105 $md_gui =& new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType());
106 $md_gui->addObserver($this->object,'MDUpdateListener','General');
107
108 $this->ctrl->forwardCommand($md_gui);
109 break;
110
111 case 'ilpermissiongui':
112 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
113 $perm_gui =& new ilPermissionGUI($this);
114 $ret =& $this->ctrl->forwardCommand($perm_gui);
115 break;
116
117 case "ilsurveyphrasesgui":
118 include_once("./Modules/SurveyQuestionPool/classes/class.ilSurveyPhrasesGUI.php");
119 $phrases_gui =& new ilSurveyPhrasesGUI($this);
120 $ret =& $this->ctrl->forwardCommand($phrases_gui);
121 break;
122
123 case 'ilobjectcopygui':
124 include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
125 $cp = new ilObjectCopyGUI($this);
126 $cp->setType('spl');
127 $this->ctrl->forwardCommand($cp);
128 break;
129
130 case 'ilinfoscreengui':
131 $this->infoScreenForward();
132 break;
133
134 case "ilcommonactiondispatchergui":
135 include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
137 $this->ctrl->forwardCommand($gui);
138 break;
139
140 case "":
141 $cmd.= "Object";
142 $ret =& $this->$cmd();
143 break;
144
145 default:
146 include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php";
147 $q_gui = SurveyQuestionGUI::_getQuestionGUI($q_type, $_GET["q_id"]);
148 // $q_gui->object->setObjId($this->object->getId());
149 $q_gui->setQuestionTabs();
150 $ret =& $this->ctrl->forwardCommand($q_gui);
151
152 // not on create
153 if($q_gui->object->isComplete())
154 {
155 $this->tpl->setTitle($this->lng->txt("question").": ".$q_gui->object->getTitle());
156 }
157 break;
158 }
159 if (strtolower($_GET["baseClass"]) != "iladministrationgui" &&
160 $this->getCreationMode() != true)
161 {
162 $this->tpl->show();
163 }
164 }
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
GUI class for the workflow of copying objects.
prepareOutput()
prepare output
getCreationMode()
get creation mode
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
$cmd
Definition: sahs_server.php:35

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

+ Here is the call graph for this function:

◆ exportObject()

ilObjSurveyQuestionPoolGUI::exportObject ( )

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

507 {
508 global $ilToolbar;
509
510 $ilToolbar->addButton($this->lng->txt('create_export_file'),
511 $this->ctrl->getLinkTarget($this, 'createExportFile'));
512
513 include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionPoolExportTableGUI.php";
514 $table_gui = new ilSurveyQuestionPoolExportTableGUI($this, 'export');
515 $export_dir = $this->object->getExportDirectory();
516 $export_files = $this->object->getExportFiles($export_dir);
517 $data = array();
518 foreach ($export_files as $exp_file)
519 {
520 $file_arr = explode("__", $exp_file);
521 array_push($data, array('file' => $exp_file, 'date' => ilDatePresentation::formatDate(new ilDateTime($file_arr[0], IL_CAL_UNIX)), 'size' => filesize($export_dir."/".$exp_file)));
522 }
523 $table_gui->setData($data);
524 $this->tpl->setContent($table_gui->getHTML());
525 }

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

253 {
254 if (is_array($_POST['q_id']) && count($_POST['q_id']) > 0)
255 {
256 $this->createExportFileObject($_POST['q_id']);
257 }
258 else
259 {
260 ilUtil::sendInfo($this->lng->txt("qpl_export_select_none"));
261 $this->questionsObject();
262 }
263 }
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 414 of file class.ilObjSurveyQuestionPoolGUI.php.

415 {
416 include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionsTableGUI.php";
417 $table_gui = new ilSurveyQuestionsTableGUI($this, 'questions');
418 $table_gui->writeFilterToSession();
419 $this->ctrl->redirect($this, 'questions');
420 }

◆ getTabs()

ilObjSurveyQuestionPoolGUI::getTabs ( $tabs_gui)

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

Reimplemented from ilObjectGUI.

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

803 {
804 global $ilAccess, $ilHelp;
805
806 $ilHelp->setScreenIdComponent("spl");
807
808 $next_class = $this->ctrl->getNextClass($this);
809 switch ($next_class)
810 {
811 case "":
812 case "ilpermissiongui":
813 case "ilmdeditorgui":
814 case "ilsurveyphrasesgui":
815 break;
816 default:
817 return;
818 break;
819 }
820
821 // questions
822 $force_active = (($this->ctrl->getCmdClass() == "" &&
823 $this->ctrl->getCmd() != "properties") ||
824 $this->ctrl->getCmd() == "")
825 ? true
826 : false;
827 if (!$force_active)
828 {
829 if (is_array($_GET["sort"]))
830 {
831 $force_active = true;
832 }
833 }
834 $tabs_gui->addTarget("survey_questions",
835 $this->ctrl->getLinkTarget($this,'questions'),
836 array("questions", "filterQuestionBrowser", "filter", "reset", "createQuestion",
837 "importQuestions", "deleteQuestions", "copy", "paste",
838 "exportQuestions", "confirmDeleteQuestions", "cancelDeleteQuestions",
839 "confirmPasteQuestions", "cancelPasteQuestions", "uploadQuestions",
840 "editQuestion", "addMaterial", "removeMaterial", "save", "cancel",
841 "cancelExplorer", "linkChilds", "addGIT", "addST", "addPG", "preview",
842 "moveCategory", "deleteCategory", "addPhrase", "addCategory", "savePhrase",
843 "addSelectedPhrase", "cancelViewPhrase", "confirmSavePhrase", "cancelSavePhrase",
844 "insertBeforeCategory", "insertAfterCategory", "confirmDeleteCategory",
845 "cancelDeleteCategory", "categories", "saveCategories",
846 "savePhrase", "addPhrase"
847 ),
848 array("ilobjsurveyquestionpoolgui", "ilsurveyphrasesgui"), "", $force_active);
849
850 if ($ilAccess->checkAccess("visible", "", $this->ref_id))
851 {
852 $tabs_gui->addTarget("info_short",
853 $this->ctrl->getLinkTarget($this, "infoScreen"),
854 array("infoScreen", "showSummary"));
855 }
856
857 if ($ilAccess->checkAccess('write', '', $this->ref_id))
858 {
859 // properties
860 $tabs_gui->addTarget("settings",
861 $this->ctrl->getLinkTarget($this,'properties'),
862 "properties",
863 "", "");
864
865 // manage phrases
866 $tabs_gui->addTarget("manage_phrases",
867 $this->ctrl->getLinkTargetByClass("ilsurveyphrasesgui", "phrases"),
868 array("phrases", "deletePhrase", "confirmDeletePhrase", "cancelDeletePhrase", "editPhrase", "newPhrase", "saveEditPhrase", "phraseEditor"),
869 "ilsurveyphrasesgui", "");
870
871 // meta data
872 $tabs_gui->addTarget("meta_data",
873 $this->ctrl->getLinkTargetByClass('ilmdeditorgui','listSection'),
874 "", "ilmdeditorgui");
875
876 // export
877 $tabs_gui->addTarget("export",
878 $this->ctrl->getLinkTarget($this,'export'),
879 array("export", "createExportFile", "confirmDeleteExportFile",
880 "downloadExportFile", "cancelDeleteExportFile", "deleteExportFile"),
881 "", "");
882 }
883
884 if ($ilAccess->checkAccess("edit_permission", "", $this->ref_id))
885 {
886 $tabs_gui->addTarget("perm_settings",
887 $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
888 }
889 }

References $_GET.

◆ ilObjSurveyQuestionPoolGUI()

ilObjSurveyQuestionPoolGUI::ilObjSurveyQuestionPoolGUI ( )

Constructor @access public.

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

51 {
52 global $lng, $ilCtrl;
53
54 $this->type = "spl";
55 $lng->loadLanguageModule("survey");
56 $this->ctrl =& $ilCtrl;
57 $this->ctrl->saveParameter($this, array("ref_id"));
58
59 $this->ilObjectGUI("",$_GET["ref_id"], true, false);
60 }
ilObjectGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor @access public.
global $ilCtrl
Definition: ilias.php:18

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

+ Here is the call graph for this function:

◆ importFileObject()

ilObjSurveyQuestionPoolGUI::importFileObject ( )

form for new survey object import

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

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

References $_GET, $_REQUEST, $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 357 of file class.ilObjSurveyQuestionPoolGUI.php.

358 {
359 global $tpl;
360
361 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
362 $form = new ilPropertyFormGUI();
363 $form->setFormAction($this->ctrl->getFormAction($this, "uploadQuestions"));
364 $form->setTitle($this->lng->txt("import_question"));
365
366 include_once("./Services/Form/classes/class.ilFileInputGUI.php");
367 $fi = new ilFileInputGUI($this->lng->txt("select_file"), "qtidoc");
368 $fi->setSuffixes(array("xml", "zip"));
369 $fi->setRequired(true);
370 $form->addItem($fi);
371
372 $form->addCommandButton("uploadQuestions", $this->lng->txt("import"));
373 $form->addCommandButton("questions", $this->lng->txt("cancel"));
374
375 $tpl->setContent($form->getHTML());
376 }
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 749 of file class.ilObjSurveyQuestionPoolGUI.php.

750 {
751 global $ilErr, $ilAccess;
752
753 if(!$ilAccess->checkAccess("visible", "", $this->ref_id))
754 {
755 $ilErr->raiseError($this->lng->txt("msg_no_perm_read"));
756 }
757
758 include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
759 $info = new ilInfoScreenGUI($this);
760 $info->enablePrivateNotes();
761
762 // standard meta data
763 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
764
765 $this->ctrl->forwardCommand($info);
766 }
Class ilInfoScreenGUI.

References $ilErr.

Referenced by executeCommand(), and infoScreenObject().

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

740 {
741 $this->ctrl->setCmd("showSummary");
742 $this->ctrl->setCmdClass("ilinfoscreengui");
743 $this->infoScreenForward();
744 }

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

642 {
643 $form = $this->initImportForm($a_new_type);
644
645 $forms = array(self::CFORM_NEW => $this->initCreateForm($a_new_type),
646 self::CFORM_IMPORT => $form);
647
648 return $forms;
649 }
initCreateForm($a_new_type)
Init object creation form.

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

+ Here is the call 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 633 of file class.ilObjSurveyQuestionPoolGUI.php.

634 {
635 $form = parent::initImportForm($a_new_type);
636 $form->getItemByPostVar('importfile')->setSuffixes(array("zip", "xml"));
637
638 return $form;
639 }

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

233 {
234 if (count($_POST["q_id"]) > 0)
235 {
236 foreach ($_POST["q_id"] as $key => $value)
237 {
238 $this->object->moveToClipboard($value);
239 }
240 ilUtil::sendInfo($this->lng->txt("spl_move_insert_clipboard"), true);
241 }
242 else
243 {
244 ilUtil::sendInfo($this->lng->txt("spl_move_select_none"), true);
245 }
246 $this->ctrl->redirect($this, "questions");
247 }

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

342 {
343 if (array_key_exists("spl_clipboard", $_SESSION))
344 {
345 $this->object->pasteFromClipboard();
346 }
347 else
348 {
349 ilUtil::sendInfo($this->lng->txt("spl_paste_no_objects"), true);
350 }
351 $this->ctrl->redirect($this, "questions");
352 }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']

References $_SESSION, and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ previewObject()

& ilObjSurveyQuestionPoolGUI::previewObject ( )

create preview of object

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

726 {
727 include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php";
728 $q_gui =& SurveyQuestionGUI::_getQuestionGUI("", $_GET["preview"]);
729 $this->ctrl->setParameterByClass(get_class($q_gui), "sel_question_types", $q_gui->getQuestionType());
730 $this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $_GET["preview"]);
731 $this->ctrl->redirectByClass(get_class($q_gui), "preview");
732 }

References $_GET, and SurveyQuestionGUI\_getQuestionGUI().

+ Here is the call graph for this function:

◆ propertiesObject()

ilObjSurveyQuestionPoolGUI::propertiesObject ( )

Questionpool properties.

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

170 {
171 $save = ((strcmp($this->ctrl->getCmd(), "save") == 0)) ? true : false;
172
173 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
174 $form = new ilPropertyFormGUI();
175 $form->setFormAction($this->ctrl->getFormAction($this, 'properties'));
176 $form->setTitle($this->lng->txt("properties"));
177 $form->setMultipart(false);
178 $form->setId("properties");
179
180 // online
181 $online = new ilCheckboxInputGUI($this->lng->txt("spl_online_property"), "online");
182 $online->setInfo($this->lng->txt("spl_online_property_description"));
183 $online->setChecked($this->object->getOnline());
184 $form->addItem($online);
185
186 $form->addCommandButton("saveProperties", $this->lng->txt("save"));
187
188 if ($save)
189 {
190 $form->checkInput();
191 }
192 $this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
193 }
This class represents a checkbox property in a property form.

◆ questionsObject()

ilObjSurveyQuestionPoolGUI::questionsObject (   $arrFilter = null)

list questions of question pool

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

434 {
435 global $rbacsystem;
436 global $ilUser;
437 global $ilToolbar;
438
439 $this->object->purgeQuestions();
440
441 $_SESSION['q_id_table_nav'] = $_GET['q_id_table_nav'];
442
443 if ($rbacsystem->checkAccess('write', $_GET['ref_id']))
444 {
445 include_once "Services/Form/classes/class.ilSelectInputGUI.php";
446 $qtypes = new ilSelectInputGUI("", "sel_question_types");
447 $qtypes->setValue($ilUser->getPref("svy_lastquestiontype"));
448 $ilToolbar->addInputItem($qtypes);
449
450 $options = array();
451 foreach (ilObjSurveyQuestionPool::_getQuestionTypes() as $translation => $data)
452 {
453 $options[$data["type_tag"]] = $translation;
454 }
455 $qtypes->setOptions($options);
456
457 $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
458
459 include_once "Services/UIComponent/Button/classes/class.ilSubmitButton.php";
460 $button = ilSubmitButton::getInstance();
461 $button->setCaption("svy_create_question");
462 $button->setCommand("createQuestion");
463 $ilToolbar->addButtonInstance($button);
464
465 $ilToolbar->addSeparator();
466
467 $button = ilSubmitButton::getInstance();
468 $button->setCaption("import");
469 $button->setCommand("importQuestions");
470 $ilToolbar->addButtonInstance($button);
471 }
472
473 include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionsTableGUI.php";
474 $table_gui = new ilSurveyQuestionsTableGUI($this, 'questions', (($rbacsystem->checkAccess('write', $_GET['ref_id']) ? true : false)));
475 $table_gui->setEditable($rbacsystem->checkAccess('write', $_GET['ref_id']));
476 $arrFilter = array();
477 foreach ($table_gui->getFilterItems() as $item)
478 {
479 if ($item->getValue() !== false)
480 {
481 $arrFilter[$item->getPostVar()] = $item->getValue();
482 }
483 }
484 $table_gui->setData($this->object->getQuestionsData($arrFilter));
485 $this->tpl->setContent($table_gui->getHTML());
486 }
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, 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 422 of file class.ilObjSurveyQuestionPoolGUI.php.

423 {
424 include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionsTableGUI.php";
425 $table_gui = new ilSurveyQuestionsTableGUI($this, 'questions');
426 $table_gui->resetFilter();
427 $this->ctrl->redirect($this, 'questions');
428 }

◆ saveObligatoryObject()

ilObjSurveyQuestionPoolGUI::saveObligatoryObject ( )

Save obligatory states.

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

895 {
896 $obligatory = array();
897 foreach ($_POST as $key => $value)
898 {
899 if (preg_match("/obligatory_(\d+)/", $key, $matches))
900 {
901 $obligatory[]= $matches[1];
902 }
903 }
904 $this->object->setObligatoryStates($obligatory);
905
906 ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
907 $this->ctrl->redirect($this, "questions");
908 }

References $_POST, and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ savePropertiesObject()

ilObjSurveyQuestionPoolGUI::savePropertiesObject ( )

Save questionpool properties.

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

199 {
200 $qpl_online = $_POST["online"];
201 if (strlen($qpl_online) == 0) $qpl_online = "0";
202 $this->object->setOnline($qpl_online);
203 $this->object->saveToDb();
204 ilUtil::sendSuccess($this->lng->txt("saved_successfully"), true);
205 $this->ctrl->redirect($this, "properties");
206 }

References $_POST, 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 488 of file class.ilObjSurveyQuestionPoolGUI.php.

489 {
490 $this->update = $this->object->update();
491 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
492 }

References ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ uploadQuestionsObject()

ilObjSurveyQuestionPoolGUI::uploadQuestionsObject ( )

imports question(s) into the questionpool

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

382 {
383 // check if file was uploaded
384 $source = $_FILES["qtidoc"]["tmp_name"];
385 $error = 0;
386 if (($source == 'none') || (!$source) || $_FILES["qtidoc"]["error"] > UPLOAD_ERR_OK)
387 {
388 $error = 1;
389 }
390 // check correct file type
391 if (!$error && strpos("xml", $_FILES["qtidoc"]["type"]) !== FALSE)
392 {
393 $error = 1;
394 }
395 if (!$error)
396 {
397 // import file into questionpool
398 // create import directory
399 $this->object->createImportDirectory();
400
401 // copy uploaded file to import directory
402 $full_path = $this->object->getImportDirectory()."/".$_FILES["qtidoc"]["name"];
403
404 include_once "./Services/Utilities/classes/class.ilUtil.php";
405 ilUtil::moveUploadedFile($_FILES["qtidoc"]["tmp_name"],
406 $_FILES["qtidoc"]["name"], $full_path);
407 $source = $full_path;
408 $this->object->importObject($source, TRUE);
409 unlink($source);
410 }
411 $this->ctrl->redirect($this, "questions");
412 }

References ilUtil\moveUploadedFile().

+ Here is the call graph for this function:

Field Documentation

◆ $defaultscript

ilObjSurveyQuestionPoolGUI::$defaultscript

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


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