ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilObjSurveyQuestionPoolGUI Class Reference

Class ilObjSurveyQuestionPoolGUI. More...

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

Public Member Functions

 ilObjSurveyQuestionPoolGUI ()
 Constructor public. More...
 
 executeCommand ()
 execute command More...
 
 propertiesObject (ilPropertyFormGUI $a_form=null)
 Questionpool properties. More...
 
 savePropertiesObject ()
 Save questionpool properties. More...
 
 copyObject ()
 Copies checked questions in the questionpool to a clipboard. More...
 
 moveObject ()
 mark one or more question objects for moving More...
 
 exportQuestionObject ()
 export a question More...
 
 deleteQuestionsObject ()
 Creates a confirmation form to delete questions from the question pool. More...
 
 confirmDeleteQuestionsObject ()
 delete questions More...
 
 cancelDeleteQuestionsObject ()
 cancel delete questions More...
 
 pasteObject ()
 paste questios from the clipboard into the question pool More...
 
 importQuestionsObject ()
 display the import form to import questions into the questionpool More...
 
 uploadQuestionsObject ()
 imports question(s) into the questionpool More...
 
 filterQuestionBrowserObject ()
 
 resetfilterQuestionBrowserObject ()
 
 questionsObject ($arrFilter=null)
 list questions of question pool More...
 
 updateObject ()
 
 afterSave (ilObject $a_new_object)
 
 exportObject ()
 
 createExportFileObject ($questions=null)
 create export file More...
 
 downloadExportFileObject ()
 download export file More...
 
 confirmDeleteExportFileObject ()
 confirmation screen for export file deletion More...
 
 cancelDeleteExportFileObject ()
 cancel deletion of export files More...
 
 deleteExportFileObject ()
 delete export files More...
 
 importFileObject ()
 form for new survey object import More...
 
createQuestionObject ()
 create new question More...
 
previewObject ()
 create preview of object More...
 
 infoScreenObject ()
 this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed More...
 
 infoScreenForward ()
 show information screen More...
 
 addLocatorItems ()
 
 getTabs (&$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 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 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 ()
 
 initImportForm ($a_new_type)
 
 initCreationForms ($a_new_type)
 
- 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 public More...
 
 setAdminTabs ()
 set admin tabs public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 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...
 
 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...
 

Additional Inherited Members

- Protected Attributes inherited from ilObjectGUI
 $tmp_import_dir
 

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 public

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

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

951  {
952  global $ilAccess, $ilErr, $lng;
953  if ($ilAccess->checkAccess("visible", "", $a_target) ||
954  $ilAccess->checkAccess("read", "", $a_target))
955  {
956  $_GET["baseClass"] = "ilObjSurveyQuestionPoolGUI";
957  $_GET["cmd"] = "infoScreen";
958  $_GET["ref_id"] = $a_target;
959  include_once("ilias.php");
960  exit;
961  }
962  else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
963  {
964  ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
967  }
968  $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
969  }
exit
Definition: login.php:54
$_GET["client_id"]
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupTitle($a_id)
lookup object title
static _lookupObjId($a_id)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjSurveyQuestionPoolGUI::addLocatorItems ( )

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

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

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

◆ afterSave()

ilObjSurveyQuestionPoolGUI::afterSave ( ilObject  $a_new_object)

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

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

521  {
522  // always send a message
523  ilUtil::sendSuccess($this->lng->txt("object_added"),true);
524 
525  ilUtil::redirect("ilias.php?ref_id=".$a_new_object->getRefId().
526  "&baseClass=ilObjSurveyQuestionPoolGUI");
527  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getRefId()
get reference id public
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

◆ cancelDeleteExportFileObject()

ilObjSurveyQuestionPoolGUI::cancelDeleteExportFileObject ( )

cancel deletion of export files

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

References ilSession\clear().

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

◆ cancelDeleteQuestionsObject()

ilObjSurveyQuestionPoolGUI::cancelDeleteQuestionsObject ( )

cancel delete questions

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

359  {
360  // delete questions after confirmation
361  $this->ctrl->redirect($this, "questions");
362  }

◆ confirmDeleteExportFileObject()

ilObjSurveyQuestionPoolGUI::confirmDeleteExportFileObject ( )

confirmation screen for export file deletion

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

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

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

◆ confirmDeleteQuestionsObject()

ilObjSurveyQuestionPoolGUI::confirmDeleteQuestionsObject ( )

delete questions

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

References $_POST, and ilUtil\sendSuccess().

345  {
346  // delete questions after confirmation
347  ilUtil::sendSuccess($this->lng->txt("qpl_questions_deleted"), true);
348  foreach ($_POST['q_id'] as $q_id)
349  {
350  $this->object->removeQuestion($q_id);
351  }
352  $this->ctrl->redirect($this, "questions");
353  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
+ Here is the call graph for this function:

◆ copyObject()

ilObjSurveyQuestionPoolGUI::copyObject ( )

Copies checked questions in the questionpool to a clipboard.

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

References $_POST, and ilUtil\sendInfo().

239  {
240  if (count($_POST["q_id"]) > 0)
241  {
242  foreach ($_POST["q_id"] as $key => $value)
243  {
244  $this->object->copyToClipboard($value);
245  }
246  ilUtil::sendInfo($this->lng->txt("spl_copy_insert_clipboard"), true);
247  }
248  else
249  {
250  ilUtil::sendInfo($this->lng->txt("spl_copy_select_none"), true);
251  }
252  $this->ctrl->redirect($this, "questions");
253  }
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ createExportFileObject()

ilObjSurveyQuestionPoolGUI::createExportFileObject (   $questions = null)

create export file

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

References ilUtil\sendInfo().

Referenced by exportQuestionObject().

557  {
558  global $rbacsystem;
559 
560  if ($rbacsystem->checkAccess("write", $this->ref_id))
561  {
562  include_once("./Modules/SurveyQuestionPool/classes/class.ilSurveyQuestionpoolExport.php");
563  $survey_exp = new ilSurveyQuestionpoolExport($this->object);
564  $survey_exp->buildExportFile($questions);
565  $this->ctrl->redirect($this, "export");
566  }
567  else
568  {
569  ilUtil::sendInfo("cannot_export_questionpool");
570  }
571  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Export class for survey questionpools.
+ 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 732 of file class.ilObjSurveyQuestionPoolGUI.php.

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

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

◆ deleteExportFileObject()

ilObjSurveyQuestionPoolGUI::deleteExportFileObject ( )

delete export files

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

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

638  {
639  $export_dir = $this->object->getExportDirectory();
640  foreach($_POST['file'] as $file)
641  {
642  $file = basename($file);
643 
644  $exp_file = $export_dir."/".$file;
645  $exp_dir = $export_dir."/".substr($file, 0, strlen($file) - 4);
646  if (@is_file($exp_file))
647  {
648  unlink($exp_file);
649  }
650  if (@is_dir($exp_dir))
651  {
652  include_once "./Services/Utilities/classes/class.ilUtil.php";
653  ilUtil::delDir($exp_dir);
654  }
655  }
656  $this->ctrl->redirect($this, "export");
657  }
print $file
$_POST['username']
Definition: cron.php:12
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
+ Here is the call graph for this function:

◆ deleteQuestionsObject()

ilObjSurveyQuestionPoolGUI::deleteQuestionsObject ( )

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

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

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

295  {
296  global $rbacsystem;
297 
298  // create an array of all checked checkboxes
299  $checked_questions = $_POST['q_id'];
300  if (count($checked_questions) > 0)
301  {
302  if (!$rbacsystem->checkAccess('write', $this->ref_id))
303  {
304  ilUtil::sendFailure($this->lng->txt("qpl_delete_rbac_error"));
305  $this->questionsObject();
306  return;
307  }
308  }
309  elseif (count($checked_questions) == 0)
310  {
311  ilUtil::sendInfo($this->lng->txt("qpl_delete_select_none"));
312  $this->questionsObject();
313  return;
314  }
315 
316  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
317  $cgui = new ilConfirmationGUI();
318  $cgui->setHeaderText($this->lng->txt("qpl_confirm_delete_questions"));
319 
320  $cgui->setFormAction($this->ctrl->getFormAction($this));
321  $cgui->setCancel($this->lng->txt("cancel"), "cancelDeleteQuestions");
322  $cgui->setConfirm($this->lng->txt("confirm"), "confirmDeleteQuestions");
323 
324  include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
325  $infos = $this->object->getQuestionInfos($checked_questions);
326  foreach ($infos as $data)
327  {
328  $txt = $data["title"]." (".
329  SurveyQuestion::_getQuestionTypeName($data["type_tag"]).")";
330  if($data["description"])
331  {
332  $txt .= "<div class=\"small\">".$data["description"]."</div>";
333  }
334 
335  $cgui->addItem("q_id[]", $data["id"], $txt);
336  }
337 
338  $this->tpl->setContent($cgui->getHTML());
339  }
$_POST['username']
Definition: cron.php:12
static _getQuestionTypeName($type_tag)
Return the translation for a given question type tag.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
questionsObject($arrFilter=null)
list questions of question pool
$txt
Definition: error.php:12
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Confirmation screen class.
+ Here is the call graph for this function:

◆ downloadExportFileObject()

ilObjSurveyQuestionPoolGUI::downloadExportFileObject ( )

download export file

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

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

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  if (count($_POST["file"]) > 1)
585  {
586  ilUtil::sendInfo($this->lng->txt("select_max_one_item"),true);
587  $this->ctrl->redirect($this, "export");
588  }
589 
590 
591  $export_dir = $this->object->getExportDirectory();
592  include_once "./Services/Utilities/classes/class.ilUtil.php";
593 
594  $file = basename($_POST["file"][0]);
595 
596  ilUtil::deliverFile($export_dir."/".$file, $file);
597  }
print $file
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static deliverFile($a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
+ Here is the call graph for this function:

◆ executeCommand()

ilObjSurveyQuestionPoolGUI::executeCommand ( )

execute command

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

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

66  {
67  global $ilAccess, $ilNavigationHistory, $ilErr;
68 
69  if (!$ilAccess->checkAccess("visible", "", $this->ref_id) &&
70  !$ilAccess->checkAccess("read", "", $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 'ilobjectmetadatagui':
99  if(!$ilAccess->checkAccess('write','',$this->object->getRefId()))
100  {
101  $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->WARNING);
102  }
103  include_once 'Services/Object/classes/class.ilObjectMetaDataGUI.php';
104  $md_gui = new ilObjectMetaDataGUI($this->object);
105  $this->ctrl->forwardCommand($md_gui);
106  break;
107 
108  case 'ilpermissiongui':
109  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
110  $perm_gui =& new ilPermissionGUI($this);
111  $ret =& $this->ctrl->forwardCommand($perm_gui);
112  break;
113 
114  case "ilsurveyphrasesgui":
115  include_once("./Modules/SurveyQuestionPool/classes/class.ilSurveyPhrasesGUI.php");
116  $phrases_gui =& new ilSurveyPhrasesGUI($this);
117  $ret =& $this->ctrl->forwardCommand($phrases_gui);
118  break;
119 
120  case 'ilobjectcopygui':
121  include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
122  $cp = new ilObjectCopyGUI($this);
123  $cp->setType('spl');
124  $this->ctrl->forwardCommand($cp);
125  break;
126 
127  case 'ilinfoscreengui':
128  $this->infoScreenForward();
129  break;
130 
131  case "ilcommonactiondispatchergui":
132  include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
134  $this->ctrl->forwardCommand($gui);
135  break;
136 
137  case "":
138  $cmd.= "Object";
139  $ret =& $this->$cmd();
140  break;
141 
142  default:
143  include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php";
144  $q_gui = SurveyQuestionGUI::_getQuestionGUI($q_type, $_GET["q_id"]);
145  // $q_gui->object->setObjId($this->object->getId());
146  $q_gui->setQuestionTabs();
147  $ret =& $this->ctrl->forwardCommand($q_gui);
148 
149  // not on create
150  if($q_gui->object->isComplete())
151  {
152  $this->tpl->setTitle($this->lng->txt("question").": ".$q_gui->object->getTitle());
153  }
154  break;
155  }
156  if (strtolower($_GET["baseClass"]) != "iladministrationgui" &&
157  $this->getCreationMode() != true)
158  {
159  $this->tpl->show();
160  }
161  }
Class ilObjectMetaDataGUI.
$_POST['username']
Definition: cron.php:12
GUI class for the workflow of copying objects.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
$cmd
Definition: sahs_server.php:35
Survey phrases GUI class.
static & _getQuestionGUI($questiontype, $question_id=-1)
Creates a question gui representation.
prepareOutput()
prepare output
getCreationMode()
get creation mode
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
+ Here is the call graph for this function:

◆ exportObject()

ilObjSurveyQuestionPoolGUI::exportObject ( )

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

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

533  {
534  global $ilToolbar;
535 
536  $ilToolbar->addButton($this->lng->txt('create_export_file'),
537  $this->ctrl->getLinkTarget($this, 'createExportFile'));
538 
539  include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionPoolExportTableGUI.php";
540  $table_gui = new ilSurveyQuestionPoolExportTableGUI($this, 'export');
541  $export_dir = $this->object->getExportDirectory();
542  $export_files = $this->object->getExportFiles($export_dir);
543  $data = array();
544  foreach ($export_files as $exp_file)
545  {
546  $file_arr = explode("__", $exp_file);
547  array_push($data, array('file' => $exp_file, 'date' => ilDatePresentation::formatDate(new ilDateTime($file_arr[0], IL_CAL_UNIX)), 'size' => filesize($export_dir."/".$exp_file)));
548  }
549  $table_gui->setData($data);
550  $this->tpl->setContent($table_gui->getHTML());
551  }
const IL_CAL_UNIX
static formatDate(ilDateTime $date)
Format a date public.
Date and time handling
+ Here is the call graph for this function:

◆ exportQuestionObject()

ilObjSurveyQuestionPoolGUI::exportQuestionObject ( )

export a question

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

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

279  {
280  if (is_array($_POST['q_id']) && count($_POST['q_id']) > 0)
281  {
282  $this->createExportFileObject($_POST['q_id']);
283  }
284  else
285  {
286  ilUtil::sendInfo($this->lng->txt("qpl_export_select_none"));
287  $this->questionsObject();
288  }
289  }
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
questionsObject($arrFilter=null)
list questions of question pool
createExportFileObject($questions=null)
create export file
+ Here is the call graph for this function:

◆ filterQuestionBrowserObject()

ilObjSurveyQuestionPoolGUI::filterQuestionBrowserObject ( )

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

441  {
442  include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionsTableGUI.php";
443  $table_gui = new ilSurveyQuestionsTableGUI($this, 'questions');
444  $table_gui->writeFilterToSession();
445  $this->ctrl->redirect($this, 'questions');
446  }

◆ getTabs()

ilObjSurveyQuestionPoolGUI::getTabs ( $tabs_gui)

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

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

References $_GET.

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

◆ ilObjSurveyQuestionPoolGUI()

ilObjSurveyQuestionPoolGUI::ilObjSurveyQuestionPoolGUI ( )

Constructor public.

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

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

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  }
$_GET["client_id"]
ilObjectGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor public.
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ importFileObject()

ilObjSurveyQuestionPoolGUI::importFileObject ( )

form for new survey object import

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

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

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

◆ importQuestionsObject()

ilObjSurveyQuestionPoolGUI::importQuestionsObject ( )

display the import form to import questions into the questionpool

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

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

384  {
385  global $tpl;
386 
387  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
388  $form = new ilPropertyFormGUI();
389  $form->setFormAction($this->ctrl->getFormAction($this, "uploadQuestions"));
390  $form->setTitle($this->lng->txt("import_question"));
391 
392  include_once("./Services/Form/classes/class.ilFileInputGUI.php");
393  $fi = new ilFileInputGUI($this->lng->txt("select_file"), "qtidoc");
394  $fi->setSuffixes(array("xml", "zip"));
395  $fi->setRequired(true);
396  $form->addItem($fi);
397 
398  $form->addCommandButton("uploadQuestions", $this->lng->txt("import"));
399  $form->addCommandButton("questions", $this->lng->txt("cancel"));
400 
401  $tpl->setContent($form->getHTML());
402  }
This class represents a property form user interface.
This class represents a file property in a property form.
setSuffixes($a_suffixes)
Set Accepted Suffixes.
+ Here is the call graph for this function:

◆ infoScreenForward()

ilObjSurveyQuestionPoolGUI::infoScreenForward ( )

show information screen

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

References $ilErr, and $info.

Referenced by executeCommand(), and infoScreenObject().

776  {
777  global $ilErr, $ilAccess;
778 
779  if(!$ilAccess->checkAccess("visible", "", $this->ref_id) &&
780  !$ilAccess->checkAccess("read", "", $this->ref_id))
781  {
782  $ilErr->raiseError($this->lng->txt("msg_no_perm_read"));
783  }
784 
785  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
786  $info = new ilInfoScreenGUI($this);
787  $info->enablePrivateNotes();
788 
789  // standard meta data
790  $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
791 
792  $this->ctrl->forwardCommand($info);
793  }
Class ilInfoScreenGUI.
$info
Definition: example_052.php:80
+ 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 765 of file class.ilObjSurveyQuestionPoolGUI.php.

References infoScreenForward().

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

◆ initCreationForms()

ilObjSurveyQuestionPoolGUI::initCreationForms (   $a_new_type)
protected

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

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

668  {
669  $form = $this->initImportForm($a_new_type);
670 
671  $forms = array(self::CFORM_NEW => $this->initCreateForm($a_new_type),
672  self::CFORM_IMPORT => $form);
673 
674  return $forms;
675  }
initCreateForm($a_new_type)
Init object creation form.
+ Here is the call graph for this function:

◆ initEditForm()

ilObjSurveyQuestionPoolGUI::initEditForm ( )
protected

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

References ilFormPropertyGUI\setInfo(), ilTextInputGUI\setSubmitFormOnEnter(), ilTextAreaInputGUI\setValue(), and ilObject\TITLE_LENGTH.

Referenced by propertiesObject(), and savePropertiesObject().

164  {
165  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
166  $form = new ilPropertyFormGUI();
167  $form->setFormAction($this->ctrl->getFormAction($this, 'properties'));
168  $form->setTitle($this->lng->txt("properties"));
169  $form->setMultipart(false);
170  $form->setId("properties");
171 
172  // title
173  $title = new ilTextInputGUI($this->lng->txt('title'),'title');
174  $title->setSubmitFormOnEnter(true);
175  $title->setValue($this->object->getTitle());
176  $title->setSize(min(40, ilObject::TITLE_LENGTH));
177  $title->setMaxLength(ilObject::TITLE_LENGTH);
178  $title->setRequired(true);
179  $form->addItem($title);
180 
181  // desc
182  $desc = new ilTextAreaInputGUI($this->lng->txt('description'),'desc');
183  $desc->setValue($this->object->getLongDescription());
184  $desc->setRows(2);
185  $desc->setCols(40);
186  $form->addItem($desc);
187 
188  // online
189  $online = new ilCheckboxInputGUI($this->lng->txt("spl_online_property"), "online");
190  $online->setInfo($this->lng->txt("spl_online_property_description"));
191  $online->setChecked($this->object->getOnline());
192  $form->addItem($online);
193 
194  $form->addCommandButton("saveProperties", $this->lng->txt("save"));
195 
196  return $form;
197  }
setSubmitFormOnEnter($a_val)
Set submit form on enter.
This class represents a property form user interface.
const TITLE_LENGTH
max length of object title
setValue($a_value)
Set Value.
This class represents a checkbox property in a property form.
setInfo($a_info)
Set Information Text.
This class represents a text property in a property form.
This class represents a text area property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initImportForm()

ilObjSurveyQuestionPoolGUI::initImportForm (   $a_new_type)
protected

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

Referenced by importFileObject(), and initCreationForms().

660  {
661  $form = parent::initImportForm($a_new_type);
662  $form->getItemByPostVar('importfile')->setSuffixes(array("zip", "xml"));
663 
664  return $form;
665  }
+ Here is the caller graph for this function:

◆ moveObject()

ilObjSurveyQuestionPoolGUI::moveObject ( )

mark one or more question objects for moving

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

References $_POST, and ilUtil\sendInfo().

259  {
260  if (count($_POST["q_id"]) > 0)
261  {
262  foreach ($_POST["q_id"] as $key => $value)
263  {
264  $this->object->moveToClipboard($value);
265  }
266  ilUtil::sendInfo($this->lng->txt("spl_move_insert_clipboard"), true);
267  }
268  else
269  {
270  ilUtil::sendInfo($this->lng->txt("spl_move_select_none"), true);
271  }
272  $this->ctrl->redirect($this, "questions");
273  }
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ pasteObject()

ilObjSurveyQuestionPoolGUI::pasteObject ( )

paste questios from the clipboard into the question pool

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

References $_SESSION, and ilUtil\sendInfo().

368  {
369  if (array_key_exists("spl_clipboard", $_SESSION))
370  {
371  $this->object->pasteFromClipboard();
372  }
373  else
374  {
375  ilUtil::sendInfo($this->lng->txt("spl_paste_no_objects"), true);
376  }
377  $this->ctrl->redirect($this, "questions");
378  }
$_SESSION["AccountId"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ previewObject()

& ilObjSurveyQuestionPoolGUI::previewObject ( )

create preview of object

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

References $_GET, and SurveyQuestionGUI\_getQuestionGUI().

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

◆ propertiesObject()

ilObjSurveyQuestionPoolGUI::propertiesObject ( ilPropertyFormGUI  $a_form = null)

Questionpool properties.

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

References initEditForm().

Referenced by savePropertiesObject().

203  {
204  if(!$a_form)
205  {
206  $a_form = $this->initEditForm();
207  }
208 
209  $this->tpl->setVariable("ADM_CONTENT", $a_form->getHTML());
210  }
+ 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 459 of file class.ilObjSurveyQuestionPoolGUI.php.

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

Referenced by deleteQuestionsObject(), and exportQuestionObject().

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

◆ resetfilterQuestionBrowserObject()

ilObjSurveyQuestionPoolGUI::resetfilterQuestionBrowserObject ( )

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

449  {
450  include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionsTableGUI.php";
451  $table_gui = new ilSurveyQuestionsTableGUI($this, 'questions');
452  $table_gui->resetFilter();
453  $this->ctrl->redirect($this, 'questions');
454  }

◆ saveObligatoryObject()

ilObjSurveyQuestionPoolGUI::saveObligatoryObject ( )

Save obligatory states.

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

References $_POST, and ilUtil\sendSuccess().

929  {
930  $obligatory = array();
931  foreach ($_POST as $key => $value)
932  {
933  if (preg_match("/obligatory_(\d+)/", $key, $matches))
934  {
935  $obligatory[]= $matches[1];
936  }
937  }
938  $this->object->setObligatoryStates($obligatory);
939 
940  ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
941  $this->ctrl->redirect($this, "questions");
942  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
+ Here is the call graph for this function:

◆ savePropertiesObject()

ilObjSurveyQuestionPoolGUI::savePropertiesObject ( )

Save questionpool properties.

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

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

216  {
217  $form = $this->initEditForm();
218  if($form->checkInput())
219  {
220  $this->object->setTitle($form->getInput("title"));
221  $this->object->setDescription($form->getInput("desc"));
222  $this->object->setOnline((int)$form->getInput("online"));
223 
224  $this->object->saveToDb();
225 
226  ilUtil::sendSuccess($this->lng->txt("saved_successfully"), true);
227  $this->ctrl->redirect($this, "properties");
228  }
229 
230  $form->setValuesByPost();
231  $this->propertiesObject($form);
232  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
propertiesObject(ilPropertyFormGUI $a_form=null)
Questionpool properties.
+ Here is the call graph for this function:

◆ updateObject()

ilObjSurveyQuestionPoolGUI::updateObject ( )

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

References ilUtil\sendSuccess().

515  {
516  $this->update = $this->object->update();
517  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
518  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
+ Here is the call graph for this function:

◆ uploadQuestionsObject()

ilObjSurveyQuestionPoolGUI::uploadQuestionsObject ( )

imports question(s) into the questionpool

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

References ilUtil\moveUploadedFile().

408  {
409  // check if file was uploaded
410  $source = $_FILES["qtidoc"]["tmp_name"];
411  $error = 0;
412  if (($source == 'none') || (!$source) || $_FILES["qtidoc"]["error"] > UPLOAD_ERR_OK)
413  {
414  $error = 1;
415  }
416  // check correct file type
417  if (!$error && strpos("xml", $_FILES["qtidoc"]["type"]) !== FALSE)
418  {
419  $error = 1;
420  }
421  if (!$error)
422  {
423  // import file into questionpool
424  // create import directory
425  $this->object->createImportDirectory();
426 
427  // copy uploaded file to import directory
428  $full_path = $this->object->getImportDirectory()."/".$_FILES["qtidoc"]["name"];
429 
430  include_once "./Services/Utilities/classes/class.ilUtil.php";
431  ilUtil::moveUploadedFile($_FILES["qtidoc"]["tmp_name"],
432  $_FILES["qtidoc"]["name"], $full_path);
433  $source = $full_path;
434  $this->object->importObject($source, TRUE);
435  unlink($source);
436  }
437  $this->ctrl->redirect($this, "questions");
438  }
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
+ 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: