ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
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 ()
 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...
 
 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)
 
 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...
 
 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 public

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

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

899  {
900  global $ilAccess, $ilErr, $lng;
901  if ($ilAccess->checkAccess("write", "", $a_target))
902  {
903  $_GET["baseClass"] = "ilObjSurveyQuestionPoolGUI";
904  $_GET["cmd"] = "questions";
905  $_GET["ref_id"] = $a_target;
906  include_once("ilias.php");
907  exit;
908  }
909  else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
910  {
911  ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
914  }
915  $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
916  }
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 750 of file class.ilObjSurveyQuestionPoolGUI.php.

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

751  {
752  global $ilLocator;
753  switch ($this->ctrl->getCmd())
754  {
755  case "create":
756  case "importFile":
757  case "cancel":
758  break;
759  default:
760  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $_GET["ref_id"]);
761  break;
762  }
763  if ((int)$_GET["q_id"])
764  {
765  $q_id = (int)$_GET["q_id"];
766  include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
767  $q_type = SurveyQuestion::_getQuestionType($q_id) . "GUI";
768  $q_title = SurveyQuestion::_getTitle($q_id);
769  if($q_title)
770  {
771  // not on create
772  $this->ctrl->setParameterByClass($q_type, "q_id", $q_id);
773  $ilLocator->addItem($q_title,
774  $this->ctrl->getLinkTargetByClass($q_type, "editQuestion"));
775  }
776  }
777  }
_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 476 of file class.ilObjSurveyQuestionPoolGUI.php.

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

477  {
478  // always send a message
479  ilUtil::sendSuccess($this->lng->txt("object_added"),true);
480 
481  ilUtil::redirect("ilias.php?ref_id=".$a_new_object->getRefId().
482  "&baseClass=ilObjSurveyQuestionPoolGUI");
483  }
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 584 of file class.ilObjSurveyQuestionPoolGUI.php.

References ilSession\clear().

585  {
586  ilSession::clear("ilExportFiles");
587  $this->ctrl->redirect($this, "export");
588  }
static clear($a_var)
Unset a value.
+ 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 558 of file class.ilObjSurveyQuestionPoolGUI.php.

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

559  {
560  if(!isset($_POST["file"]))
561  {
562  ilUtil::sendInfo($this->lng->txt("no_checkbox"),true);
563  $this->ctrl->redirect($this, "export");
564  }
565 
566  ilUtil::sendQuestion($this->lng->txt("info_delete_sure"));
567  include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionPoolExportTableGUI.php";
568  $table_gui = new ilSurveyQuestionPoolExportTableGUI($this, 'export', true);
569  $export_dir = $this->object->getExportDirectory();
570  $data = array();
571  foreach ($_POST['file'] as $exp_file)
572  {
573  $file_arr = explode("__", $exp_file);
574  array_push($data, array('file' => $exp_file, 'date' => ilDatePresentation::formatDate(new ilDateTime($file_arr[0], IL_CAL_UNIX)), 'size' => filesize($export_dir."/".$exp_file)));
575  }
576  $table_gui->setData($data);
577  $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
578  }
$_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 318 of file class.ilObjSurveyQuestionPoolGUI.php.

References $_POST, and ilUtil\sendSuccess().

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

References $_POST, and ilUtil\sendInfo().

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  }
$_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 512 of file class.ilObjSurveyQuestionPoolGUI.php.

References ilUtil\sendInfo().

Referenced by exportQuestionObject().

513  {
514  global $rbacsystem;
515 
516  if ($rbacsystem->checkAccess("write", $this->ref_id))
517  {
518  include_once("./Modules/SurveyQuestionPool/classes/class.ilSurveyQuestionpoolExport.php");
519  $survey_exp = new ilSurveyQuestionpoolExport($this->object);
520  $survey_exp->buildExportFile($questions);
521  $this->ctrl->redirect($this, "export");
522  }
523  else
524  {
525  ilUtil::sendInfo("cannot_export_questionpool");
526  }
527  }
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 688 of file class.ilObjSurveyQuestionPoolGUI.php.

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

689  {
690  global $ilUser;
691 
692  $ilUser->writePref("svy_lastquestiontype", $_POST["sel_question_types"]);
693 
694  include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php";
695  $q_gui =& SurveyQuestionGUI::_getQuestionGUI($_POST["sel_question_types"]);
696  $q_gui->object->setObjId($this->object->getId());
697  $q_gui->object->createNewQuestion();
698 
699  $this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $q_gui->object->getId());
700  $this->ctrl->setParameterByClass(get_class($q_gui), "sel_question_types", $_POST["sel_question_types"]);
701  $this->ctrl->redirectByClass(get_class($q_gui), "editQuestion");
702  }
$_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 593 of file class.ilObjSurveyQuestionPoolGUI.php.

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

594  {
595  $export_dir = $this->object->getExportDirectory();
596  foreach($_POST['file'] as $file)
597  {
598  $file = basename($file);
599 
600  $exp_file = $export_dir."/".$file;
601  $exp_dir = $export_dir."/".substr($file, 0, strlen($file) - 4);
602  if (@is_file($exp_file))
603  {
604  unlink($exp_file);
605  }
606  if (@is_dir($exp_dir))
607  {
608  include_once "./Services/Utilities/classes/class.ilUtil.php";
609  ilUtil::delDir($exp_dir);
610  }
611  }
612  $this->ctrl->redirect($this, "export");
613  }
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 268 of file class.ilObjSurveyQuestionPoolGUI.php.

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

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"]." (".
303  SurveyQuestion::_getQuestionTypeName($data["type_tag"]).")";
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  }
$_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
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 532 of file class.ilObjSurveyQuestionPoolGUI.php.

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

533  {
534  if(!isset($_POST["file"]))
535  {
536  ilUtil::sendInfo($this->lng->txt("no_checkbox"), true);
537  $this->ctrl->redirect($this, "export");
538  }
539 
540  if (count($_POST["file"]) > 1)
541  {
542  ilUtil::sendInfo($this->lng->txt("select_max_one_item"),true);
543  $this->ctrl->redirect($this, "export");
544  }
545 
546 
547  $export_dir = $this->object->getExportDirectory();
548  include_once "./Services/Utilities/classes/class.ilUtil.php";
549 
550  $file = basename($_POST["file"][0]);
551 
552  ilUtil::deliverFile($export_dir."/".$file, $file);
553  }
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(), ilMDEditorGUI\addObserver(), ilObjectGUI\getCreationMode(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), ilUtil\getStyleSheetLocation(), infoScreenForward(), and ilObjectGUI\prepareOutput().

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  }
$_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
addObserver(&$a_class, $a_method, $a_element)
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 488 of file class.ilObjSurveyQuestionPoolGUI.php.

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

489  {
490  global $ilToolbar;
491 
492  $ilToolbar->addButton($this->lng->txt('create_export_file'),
493  $this->ctrl->getLinkTarget($this, 'createExportFile'));
494 
495  include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionPoolExportTableGUI.php";
496  $table_gui = new ilSurveyQuestionPoolExportTableGUI($this, 'export');
497  $export_dir = $this->object->getExportDirectory();
498  $export_files = $this->object->getExportFiles($export_dir);
499  $data = array();
500  foreach ($export_files as $exp_file)
501  {
502  $file_arr = explode("__", $exp_file);
503  array_push($data, array('file' => $exp_file, 'date' => ilDatePresentation::formatDate(new ilDateTime($file_arr[0], IL_CAL_UNIX)), 'size' => filesize($export_dir."/".$exp_file)));
504  }
505  $table_gui->setData($data);
506  $this->tpl->setContent($table_gui->getHTML());
507  }
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 252 of file class.ilObjSurveyQuestionPoolGUI.php.

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

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  }
$_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 404 of file class.ilObjSurveyQuestionPoolGUI.php.

405  {
406  include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionsTableGUI.php";
407  $table_gui = new ilSurveyQuestionsTableGUI($this, 'questions');
408  $table_gui->writeFilterToSession();
409  $this->ctrl->redirect($this, 'questions');
410  }

◆ getTabs()

ilObjSurveyQuestionPoolGUI::getTabs ( $tabs_gui)

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

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

References $_GET.

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

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

637  {
638  global $tpl, $ilErr;
639 
640  $parent_id = $_GET["ref_id"];
641  $new_type = $_REQUEST["new_type"];
642 
643  // create permission is already checked in createObject. This check here is done to prevent hacking attempts
644  if (!$this->checkPermissionBool("create", "", $new_type))
645  {
646  $ilErr->raiseError($this->lng->txt("no_create_permission"));
647  }
648 
649  $this->lng->loadLanguageModule($new_type);
650  $this->ctrl->setParameter($this, "new_type", $new_type);
651 
652  $form = $this->initImportForm($new_type);
653  if ($form->checkInput())
654  {
655  include_once "./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php";
656  $newObj = new ilObjSurveyQuestionPool();
657  $newObj->setType($new_type);
658  $newObj->setTitle("dummy");
659  $newObj->create(true);
660  $this->putObjectInTree($newObj);
661 
662  $newObj->createImportDirectory();
663 
664  // copy uploaded file to import directory
665  $upload = $_FILES["importfile"];
666  $file = pathinfo($upload["name"]);
667  $full_path = $newObj->getImportDirectory()."/".$upload["name"];
668  include_once "./Services/Utilities/classes/class.ilUtil.php";
669  ilUtil::moveUploadedFile($upload["tmp_name"], $upload["name"],
670  $full_path);
671 
672  // import qti data
673  $qtiresult = $newObj->importObject($full_path);
674 
675  ilUtil::sendSuccess($this->lng->txt("object_imported"),true);
676  ilUtil::redirect("ilias.php?ref_id=".$newObj->getRefId().
677  "&baseClass=ilObjSurveyQuestionPoolGUI");
678  }
679 
680  // display form to correct errors
681  $form->setValuesByPost();
682  $tpl->setContent($form->getHtml());
683  }
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 357 of file class.ilObjSurveyQuestionPoolGUI.php.

358  {
359  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_svy_import_question.html", "Modules/SurveyQuestionPool");
360  $this->tpl->setCurrentBlock("adm_content");
361  $this->tpl->setVariable("TEXT_IMPORT_QUESTION", $this->lng->txt("import_question"));
362  $this->tpl->setVariable("TEXT_SELECT_FILE", $this->lng->txt("select_file"));
363  $this->tpl->setVariable("TEXT_UPLOAD", $this->lng->txt("upload"));
364  $this->tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this));
365  $this->tpl->parseCurrentBlock();
366  }

◆ infoScreenForward()

ilObjSurveyQuestionPoolGUI::infoScreenForward ( )

show information screen

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

References $ilErr.

Referenced by executeCommand(), and infoScreenObject().

732  {
733  global $ilErr, $ilAccess;
734 
735  if(!$ilAccess->checkAccess("visible", "", $this->ref_id))
736  {
737  $ilErr->raiseError($this->lng->txt("msg_no_perm_read"));
738  }
739 
740  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
741  $info = new ilInfoScreenGUI($this);
742  $info->enablePrivateNotes();
743 
744  // standard meta data
745  $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
746 
747  $this->ctrl->forwardCommand($info);
748  }
Class ilInfoScreenGUI.
+ 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 721 of file class.ilObjSurveyQuestionPoolGUI.php.

References infoScreenForward().

722  {
723  $this->ctrl->setCmd("showSummary");
724  $this->ctrl->setCmdClass("ilinfoscreengui");
725  $this->infoScreenForward();
726  }
+ Here is the call graph for this function:

◆ initCreationForms()

ilObjSurveyQuestionPoolGUI::initCreationForms (   $a_new_type)
protected

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

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

624  {
625  $form = $this->initImportForm($a_new_type);
626 
627  $forms = array(self::CFORM_NEW => $this->initCreateForm($a_new_type),
628  self::CFORM_IMPORT => $form);
629 
630  return $forms;
631  }
initCreateForm($a_new_type)
Init object creation form.
+ Here is the call graph for this function:

◆ initImportForm()

ilObjSurveyQuestionPoolGUI::initImportForm (   $a_new_type)
protected

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

Referenced by importFileObject(), and initCreationForms().

616  {
617  $form = parent::initImportForm($a_new_type);
618  $form->getItemByPostVar('importfile')->setSuffixes(array("zip", "xml"));
619 
620  return $form;
621  }
+ 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.

References $_POST, and ilUtil\sendInfo().

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

References $_SESSION, and ilUtil\sendInfo().

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']
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 707 of file class.ilObjSurveyQuestionPoolGUI.php.

References $_GET, and SurveyQuestionGUI\_getQuestionGUI().

708  {
709  include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php";
710  $q_gui =& SurveyQuestionGUI::_getQuestionGUI("", $_GET["preview"]);
711  $this->ctrl->setParameterByClass(get_class($q_gui), "sel_question_types", $q_gui->getQuestionType());
712  $this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $_GET["preview"]);
713  $this->ctrl->redirectByClass(get_class($q_gui), "preview");
714  }
$_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 ( )

Questionpool properties.

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

References ilFormPropertyGUI\setInfo().

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 property form user interface.
This class represents a checkbox property in a property form.
setInfo($a_info)
Set Information Text.
+ Here is the call graph for this function:

◆ questionsObject()

ilObjSurveyQuestionPoolGUI::questionsObject (   $arrFilter = null)

list questions of question pool

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

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

Referenced by deleteQuestionsObject(), and exportQuestionObject().

424  {
425  global $rbacsystem;
426  global $ilUser;
427  global $ilToolbar;
428 
429  $this->object->purgeQuestions();
430 
431  $_SESSION['q_id_table_nav'] = $_GET['q_id_table_nav'];
432 
433  if ($rbacsystem->checkAccess('write', $_GET['ref_id']))
434  {
435  include_once "Services/Form/classes/class.ilSelectInputGUI.php";
436  $qtypes = new ilSelectInputGUI("", "sel_question_types");
437  $qtypes->setValue($ilUser->getPref("svy_lastquestiontype"));
438  $ilToolbar->addInputItem($qtypes);
439 
440  $options = array();
441  foreach (ilObjSurveyQuestionPool::_getQuestionTypes() as $translation => $data)
442  {
443  $options[$data["type_tag"]] = $translation;
444  }
445  $qtypes->setOptions($options);
446 
447  $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
448  $ilToolbar->addFormButton($this->lng->txt("svy_create_question"), "createQuestion");
449 
450  $ilToolbar->addSeparator();
451 
452  $ilToolbar->addFormButton($this->lng->txt('import'), 'importQuestions');
453  }
454 
455  include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionsTableGUI.php";
456  $table_gui = new ilSurveyQuestionsTableGUI($this, 'questions', (($rbacsystem->checkAccess('write', $_GET['ref_id']) ? true : false)));
457  $table_gui->setEditable($rbacsystem->checkAccess('write', $_GET['ref_id']));
458  $arrFilter = array();
459  foreach ($table_gui->getFilterItems() as $item)
460  {
461  if ($item->getValue() !== false)
462  {
463  $arrFilter[$item->getPostVar()] = $item->getValue();
464  }
465  }
466  $table_gui->setData($this->object->getQuestionsData($arrFilter));
467  $this->tpl->setContent($table_gui->getHTML());
468  }
< 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']
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 412 of file class.ilObjSurveyQuestionPoolGUI.php.

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

◆ saveObligatoryObject()

ilObjSurveyQuestionPoolGUI::saveObligatoryObject ( )

Save obligatory states.

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

References $_POST, and ilUtil\sendSuccess().

877  {
878  $obligatory = array();
879  foreach ($_POST as $key => $value)
880  {
881  if (preg_match("/obligatory_(\d+)/", $key, $matches))
882  {
883  $obligatory[]= $matches[1];
884  }
885  }
886  $this->object->setObligatoryStates($obligatory);
887 
888  ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
889  $this->ctrl->redirect($this, "questions");
890  }
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 198 of file class.ilObjSurveyQuestionPoolGUI.php.

References $_POST, and ilUtil\sendSuccess().

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  }
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:

◆ updateObject()

ilObjSurveyQuestionPoolGUI::updateObject ( )

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

References ilUtil\sendSuccess().

471  {
472  $this->update = $this->object->update();
473  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
474  }
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 371 of file class.ilObjSurveyQuestionPoolGUI.php.

References ilUtil\moveUploadedFile().

372  {
373  // check if file was uploaded
374  $source = $_FILES["qtidoc"]["tmp_name"];
375  $error = 0;
376  if (($source == 'none') || (!$source) || $_FILES["qtidoc"]["error"] > UPLOAD_ERR_OK)
377  {
378  $error = 1;
379  }
380  // check correct file type
381  if (strpos("xml", $_FILES["qtidoc"]["type"]) !== FALSE)
382  {
383  $error = 1;
384  }
385  if (!$error)
386  {
387  // import file into questionpool
388  // create import directory
389  $this->object->createImportDirectory();
390 
391  // copy uploaded file to import directory
392  $full_path = $this->object->getImportDirectory()."/".$_FILES["qtidoc"]["name"];
393 
394  include_once "./Services/Utilities/classes/class.ilUtil.php";
395  ilUtil::moveUploadedFile($_FILES["qtidoc"]["tmp_name"],
396  $_FILES["qtidoc"]["name"], $full_path);
397  $source = $full_path;
398  $this->object->importObject($source, TRUE);
399  unlink($source);
400  }
401  $this->ctrl->redirect($this, "questions");
402  }
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: