ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjSurveyQuestionPoolGUI Class Reference

Class ilObjSurveyQuestionPoolGUI. More...

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

Public Member Functions

 ilObjSurveyQuestionPoolGUI ()
 Constructor public.
 executeCommand ()
 execute command
 cancelObject ()
 cancel action and go back to previous page
 propertiesObject ()
 Questionpool properties.
 savePropertiesObject ()
 Save questionpool properties.
 copyObject ()
 Copies checked questions in the questionpool to a clipboard.
 moveObject ()
 mark one or more question objects for moving
 exportQuestionObject ()
 export a question
 deleteQuestionsObject ()
 Creates a confirmation form to delete questions from the question pool.
 confirmDeleteQuestionsObject ()
 delete questions
 cancelDeleteQuestionsObject ()
 cancel delete questions
 pasteObject ()
 paste questios from the clipboard into the question pool
 importQuestionsObject ()
 display the import form to import questions into the questionpool
 uploadQuestionsObject ()
 imports question(s) into the questionpool
 filterQuestionBrowserObject ()
 resetfilterQuestionBrowserObject ()
 questionsObject ($arrFilter=null)
 list questions of question pool
 updateObject ()
 updates object entry in object_data
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook.
 exportObject ()
 createExportFileObject ($questions=null)
 create export file
 downloadExportFileObject ()
 download export file
 confirmDeleteExportFileObject ()
 confirmation screen for export file deletion
 cancelDeleteExportFileObject ()
 cancel deletion of export files
 deleteExportFileObject ()
 delete export files
 importFileObject ()
 form for new survey object import
createQuestionObject ()
 create new question
editQuestionForSurveyObject ()
 edit question
createQuestionForSurveyObject ()
 create question from survey
previewObject ()
 create preview of object
 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
 infoScreenForward ()
 show information screen
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 getTabs (&$tabs_gui)
 adds tabs to tab gui object
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public.
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not)
 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
 getCreationMode ()
 get creation mode
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder
 getHTML ()
 undeleteObject ()
 Get objects back from trash.
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
 cancelDeleteObject ()
 cancel deletion of object
 removeFromSystemObject ()
 remove objects from trash bin and all entries therefore every object needs a specific deleteObject() method
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 createObject ()
 create new object form
 cancelCreation ()
 cancel create action and go back to repository parent
 saveObject ()
 save object
 editObject ()
 edit object
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g.
 isVisible ($a_ref_id, $a_type)
 viewObject ()
 list childs of current object
 deleteObject ($a_error=false)
 Display deletion confirmation screen.
 trashObject ()
 Show trash content of object.
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI.
 copyWizardHasOptions ($a_mode)
 Check if there is any modules specific option.

Static Public Member Functions

static _goto ($a_target)
 Redirect script to call a survey question pool reference id.

Data Fields

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

Protected Member Functions

 initImportForm ($a_new_type)
 Init object import form.
 initCreationForms ($a_new_type)
 Init creation froms.
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 prepareOutput ()
 prepare output
 setTitleAndDescription ()
 called by prepare output
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu.
 insertHeaderAction ($a_list_gui)
 Insert header action into main template.
 addHeaderAction ()
 Add header action menu.
 redrawHeaderActionObject ()
 Ajax call: redraw action header only.
 showUpperIcon ()
 setTabs ()
 set admin tabs public
 setAdminTabs ()
 set admin tabs public
 setLocator ()
 set Locator
 omitLocator ($a_omit=true)
 addAdminLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion)
 initCreateForm ($a_new_type)
 Init object creation form.
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types.
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates.
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen.
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position.
 initEditForm ()
 Init object edit form.
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form.
 getEditFormValues ()
 Get values for edit form.
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields.
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object.
 afterUpdate ()
 Post (successful) object update hook.
 importFileObject ($parent_id=null)
 Import.
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook.
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g.
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g.
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu)
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste
 __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
 __showClipboardTable ($a_result_set, $a_from="")
 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
 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.
 getCenterColumnHTML ()
 Get center column.
 getRightColumnHTML ()
 Display right column.
 setColumnSettings ($column_gui)
 May be overwritten in subclasses.
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error.
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission.

Detailed Description

Member Function Documentation

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

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

{
global $ilAccess, $ilErr, $lng;
if ($ilAccess->checkAccess("write", "", $a_target))
{
$_GET["baseClass"] = "ilObjSurveyQuestionPoolGUI";
$_GET["cmd"] = "questions";
$_GET["ref_id"] = $a_target;
include_once("ilias.php");
}
else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
{
$_GET["cmd"] = "frameset";
$_GET["target"] = "";
$_GET["ref_id"] = ROOT_FOLDER_ID;
ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
include("repository.php");
}
$ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::addLocatorItems ( )

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

Reimplemented from ilObjectGUI.

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

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

{
global $ilLocator;
switch ($this->ctrl->getCmd())
{
case "create":
case "importFile":
case "cancel":
break;
default:
$ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $_GET["ref_id"]);
break;
}
if ($_GET["q_id"] > 0)
{
include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
$q_type = SurveyQuestion::_getQuestionType($_GET["q_id"]) . "GUI";
$this->ctrl->setParameterByClass($q_type, "q_id", $_GET["q_id"]);
$ilLocator->addItem(SurveyQuestion::_getTitle($_GET["q_id"]), $this->ctrl->getLinkTargetByClass($q_type, "editQuestion"));
}
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::afterSave ( ilObject  $a_new_object)

Post (successful) object creation hook.

Parameters
ilObject$a_new_object

Reimplemented from ilObjectGUI.

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

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

{
// always send a message
ilUtil::sendSuccess($this->lng->txt("object_added"),true);
ilUtil::redirect("ilias.php?ref_id=".$a_new_object->getRefId().
"&baseClass=ilObjSurveyQuestionPoolGUI");
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::cancelDeleteExportFileObject ( )

cancel deletion of export files

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

{
session_unregister("ilExportFiles");
$this->ctrl->redirect($this, "export");
}
ilObjSurveyQuestionPoolGUI::cancelDeleteQuestionsObject ( )

cancel delete questions

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

{
// delete questions after confirmation
$this->ctrl->redirect($this, "questions");
}
ilObjSurveyQuestionPoolGUI::cancelObject ( )

cancel action and go back to previous page

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

References $_GET, and ilUtil\redirect().

{
ilUtil::redirect("repository.php?cmd=frameset&ref_id=".$_GET["ref_id"]);
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::confirmDeleteExportFileObject ( )

confirmation screen for export file deletion

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

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

{
if(!isset($_POST["file"]))
{
ilUtil::sendInfo($this->lng->txt("no_checkbox"),true);
$this->ctrl->redirect($this, "export");
}
ilUtil::sendQuestion($this->lng->txt("info_delete_sure"));
include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionPoolExportTableGUI.php";
$table_gui = new ilSurveyQuestionPoolExportTableGUI($this, 'export', true);
$export_dir = $this->object->getExportDirectory();
$data = array();
foreach ($_POST['file'] as $exp_file)
{
$file_arr = explode("__", $exp_file);
array_push($data, array('file' => $exp_file, 'date' => ilDatePresentation::formatDate(new ilDateTime($file_arr[0], IL_CAL_UNIX)), 'size' => filesize($export_dir."/".$exp_file)));
}
$table_gui->setData($data);
$this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::confirmDeleteQuestionsObject ( )

delete questions

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

References $_POST, and ilUtil\sendSuccess().

{
// delete questions after confirmation
ilUtil::sendSuccess($this->lng->txt("qpl_questions_deleted"), true);
foreach ($_POST['q_id'] as $q_id)
{
$this->object->removeQuestion($q_id);
}
$this->ctrl->redirect($this, "questions");
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::copyObject ( )

Copies checked questions in the questionpool to a clipboard.

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

References $_POST, and ilUtil\sendInfo().

{
if (count($_POST["q_id"]) > 0)
{
foreach ($_POST["q_id"] as $key => $value)
{
$this->object->copyToClipboard($value);
}
ilUtil::sendInfo($this->lng->txt("spl_copy_insert_clipboard"), true);
}
else
{
ilUtil::sendInfo($this->lng->txt("spl_copy_select_none"), true);
}
$this->ctrl->redirect($this, "questions");
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::createExportFileObject (   $questions = null)

create export file

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

References ilUtil\sendInfo().

Referenced by exportQuestionObject().

{
global $rbacsystem;
if ($rbacsystem->checkAccess("write", $this->ref_id))
{
include_once("./Modules/SurveyQuestionPool/classes/class.ilSurveyQuestionpoolExport.php");
$survey_exp = new ilSurveyQuestionpoolExport($this->object);
$survey_exp->buildExportFile($questions);
$this->ctrl->redirect($this, "export");
}
else
{
ilUtil::sendInfo("cannot_export_questionpool");
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

& ilObjSurveyQuestionPoolGUI::createQuestionForSurveyObject ( )

create question from survey

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

References $_GET, and SurveyQuestionGUI\_getQuestionGUI().

{
include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php";
$q_gui =& SurveyQuestionGUI::_getQuestionGUI($_GET["sel_question_types"]);
$q_gui->object->createNewQuestion();
$this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $q_gui->object->getId());
$this->ctrl->setParameterByClass(get_class($q_gui), "sel_question_types", $q_gui->getQuestionType());
$this->ctrl->setParameterByClass(get_class($q_gui), "pgov", $_GET["pgov"]);
$this->ctrl->setParameterByClass(get_class($q_gui), "pgov_pos", $_GET["pgov_pos"]);
$this->ctrl->redirectByClass(get_class($q_gui), "editQuestion");
}

+ Here is the call graph for this function:

& ilObjSurveyQuestionPoolGUI::createQuestionObject ( )

create new question

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

References $_POST, and SurveyQuestionGUI\_getQuestionGUI().

{
global $ilUser;
$ilUser->writePref("svy_lastquestiontype", $_POST["sel_question_types"]);
include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php";
$q_gui =& SurveyQuestionGUI::_getQuestionGUI($_POST["sel_question_types"]);
$q_gui->object->setObjId($this->object->getId());
$q_gui->object->createNewQuestion();
$this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $q_gui->object->getId());
$this->ctrl->setParameterByClass(get_class($q_gui), "sel_question_types", $_POST["sel_question_types"]);
$this->ctrl->redirectByClass(get_class($q_gui), "editQuestion");
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::deleteExportFileObject ( )

delete export files

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

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

{
$export_dir = $this->object->getExportDirectory();
foreach($_POST['file'] as $file)
{
$file = basename($file);
$exp_file = $export_dir."/".$file;
$exp_dir = $export_dir."/".substr($file, 0, strlen($file) - 4);
if (@is_file($exp_file))
{
unlink($exp_file);
}
if (@is_dir($exp_dir))
{
include_once "./Services/Utilities/classes/class.ilUtil.php";
ilUtil::delDir($exp_dir);
}
}
$this->ctrl->redirect($this, "export");
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::deleteQuestionsObject ( )

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

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

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

{
global $rbacsystem;
// create an array of all checked checkboxes
$checked_questions = $_POST['q_id'];
if (count($checked_questions) > 0)
{
if ($rbacsystem->checkAccess('write', $this->ref_id))
{
ilUtil::sendQuestion($this->lng->txt("qpl_confirm_delete_questions"));
}
else
{
ilUtil::sendFailure($this->lng->txt("qpl_delete_rbac_error"));
$this->questionsObject();
return;
}
}
elseif (count($checked_questions) == 0)
{
ilUtil::sendInfo($this->lng->txt("qpl_delete_select_none"));
$this->questionsObject();
return;
}
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_svy_qpl_confirm_delete_questions.html", "Modules/SurveyQuestionPool");
$infos = $this->object->getQuestionInfos($checked_questions);
$colors = array("tblrow1", "tblrow2");
$counter = 0;
include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
foreach ($infos as $data)
{
$this->tpl->setCurrentBlock("row");
$this->tpl->setVariable("COLOR_CLASS", $colors[$counter % 2]);
$this->tpl->setVariable("TXT_TITLE", $data["title"]);
$this->tpl->setVariable("TXT_DESCRIPTION", $data["description"]);
$this->tpl->setVariable("TXT_TYPE", SurveyQuestion::_getQuestionTypeName($data["type_tag"]));
$this->tpl->parseCurrentBlock();
$counter++;
}
foreach ($checked_questions as $id)
{
$this->tpl->setCurrentBlock("hidden");
$this->tpl->setVariable("HIDDEN_NAME", "q_id[]");
$this->tpl->setVariable("HIDDEN_VALUE", $id);
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock("adm_content");
$this->tpl->setVariable("TXT_TITLE", $this->lng->txt("title"));
$this->tpl->setVariable("TXT_DESCRIPTION", $this->lng->txt("description"));
$this->tpl->setVariable("TXT_TYPE", $this->lng->txt("question_type"));
$this->tpl->setVariable("BTN_CONFIRM", $this->lng->txt("confirm"));
$this->tpl->setVariable("BTN_CANCEL", $this->lng->txt("cancel"));
$this->tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this));
$this->tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::downloadExportFileObject ( )

download export file

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

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

{
if(!isset($_POST["file"]))
{
ilUtil::sendInfo($this->lng->txt("no_checkbox"), true);
$this->ctrl->redirect($this, "export");
}
if (count($_POST["file"]) > 1)
{
ilUtil::sendInfo($this->lng->txt("select_max_one_item"),true);
$this->ctrl->redirect($this, "export");
}
$export_dir = $this->object->getExportDirectory();
include_once "./Services/Utilities/classes/class.ilUtil.php";
$file = basename($_POST["file"][0]);
ilUtil::deliverFile($export_dir."/".$file, $file);
}

+ Here is the call graph for this function:

& ilObjSurveyQuestionPoolGUI::editQuestionForSurveyObject ( )

edit question

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

References $_GET, and SurveyQuestionGUI\_getQuestionGUI().

{
include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php";
$q_gui =& SurveyQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
$this->ctrl->setParameterByClass(get_class($q_gui), "sel_question_types", $q_gui->getQuestionType());
$this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $_GET["q_id"]);
$this->ctrl->setParameterByClass(get_class($q_gui), "pgov", $_GET["pgov"]);
$this->ctrl->setParameterByClass(get_class($q_gui), "pgov_pos", $_GET["pgov_pos"]);
$this->ctrl->redirectByClass(get_class($q_gui), "editQuestion");
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

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

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

{
global $ilAccess, $ilNavigationHistory;
if ((!$ilAccess->checkAccess("read", "", $_GET["ref_id"])) && (!$ilAccess->checkAccess("visible", "", $_GET["ref_id"])))
{
global $ilias;
$ilias->raiseError($this->lng->txt("permission_denied"), $ilias->error_obj->MESSAGE);
}
// add entry to navigation history
if (!$this->getCreationMode() &&
$ilAccess->checkAccess("read", "", $_GET["ref_id"]))
{
$ilNavigationHistory->addItem($_GET["ref_id"],
"ilias.php?baseClass=ilObjSurveyQuestionPoolGUI&cmd=questions&ref_id=".$_GET["ref_id"], "spl");
}
$this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "survey.css", "Modules/Survey"), "screen");
$this->prepareOutput();
$cmd = $this->ctrl->getCmd("questions");
$next_class = $this->ctrl->getNextClass($this);
$this->ctrl->setReturn($this, "questions");
if ($_GET["q_id"] < 1)
{
$q_type = ($_POST["sel_question_types"] != "")
? $_POST["sel_question_types"]
: $_GET["sel_question_types"];
}
switch($next_class)
{
case 'ilmdeditorgui':
include_once "./Services/MetaData/classes/class.ilMDEditorGUI.php";
$md_gui =& new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType());
$md_gui->addObserver($this->object,'MDUpdateListener','General');
$this->ctrl->forwardCommand($md_gui);
break;
case 'ilpermissiongui':
include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
$perm_gui =& new ilPermissionGUI($this);
$ret =& $this->ctrl->forwardCommand($perm_gui);
break;
case "ilsurveyphrasesgui":
include_once("./Modules/SurveyQuestionPool/classes/class.ilSurveyPhrasesGUI.php");
$phrases_gui =& new ilSurveyPhrasesGUI($this);
$ret =& $this->ctrl->forwardCommand($phrases_gui);
break;
case 'ilobjectcopygui':
include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
$cp = new ilObjectCopyGUI($this);
$cp->setType('spl');
$this->ctrl->forwardCommand($cp);
break;
case 'ilinfoscreengui':
break;
case "":
$cmd.= "Object";
$ret =& $this->$cmd();
break;
default:
include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php";
$q_gui = SurveyQuestionGUI::_getQuestionGUI($q_type, $_GET["q_id"]);
$q_gui->object->setObjId($this->object->getId());
$q_gui->setQuestionTabs();
$ret =& $this->ctrl->forwardCommand($q_gui);
break;
}
if (strtolower($_GET["baseClass"]) != "iladministrationgui" &&
$this->getCreationMode() != true)
{
$this->tpl->show();
}
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::exportObject ( )

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

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

{
include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionPoolExportTableGUI.php";
$table_gui = new ilSurveyQuestionPoolExportTableGUI($this, 'export');
$export_dir = $this->object->getExportDirectory();
$export_files = $this->object->getExportFiles($export_dir);
$data = array();
foreach ($export_files as $exp_file)
{
$file_arr = explode("__", $exp_file);
array_push($data, array('file' => $exp_file, 'date' => ilDatePresentation::formatDate(new ilDateTime($file_arr[0], IL_CAL_UNIX)), 'size' => filesize($export_dir."/".$exp_file)));
}
$table_gui->setData($data);
$this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::exportQuestionObject ( )

export a question

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

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

{
if (is_array($_POST['q_id']) && count($_POST['q_id']) > 0)
{
$this->createExportFileObject($_POST['q_id']);
}
else
{
ilUtil::sendInfo($this->lng->txt("qpl_export_select_none"));
$this->questionsObject();
}
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::filterQuestionBrowserObject ( )

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

{
include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionsTableGUI.php";
$table_gui = new ilSurveyQuestionsTableGUI($this, 'questions');
$table_gui->writeFilterToSession();
$this->ctrl->redirect($this, 'questions');
}
ilObjSurveyQuestionPoolGUI::getTabs ( $tabs_gui)

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

Reimplemented from ilObjectGUI.

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

References $_GET.

{
global $ilAccess;
$next_class = $this->ctrl->getNextClass($this);
switch ($next_class)
{
case "":
case "ilpermissiongui":
case "ilmdeditorgui":
case "ilsurveyphrasesgui":
break;
default:
return;
break;
}
if (($_GET["calling_survey"] > 0) || ($_GET["new_for_survey"] > 0)) return;
// questions
$force_active = (($this->ctrl->getCmdClass() == "" &&
$this->ctrl->getCmd() != "properties") ||
$this->ctrl->getCmd() == "")
? true
: false;
if (!$force_active)
{
if (is_array($_GET["sort"]))
{
$force_active = true;
}
}
$tabs_gui->addTarget("survey_questions",
$this->ctrl->getLinkTarget($this,'questions'),
array("questions", "filterQuestionBrowser", "filter", "reset", "createQuestion",
"importQuestions", "deleteQuestions", "copy", "paste",
"exportQuestions", "confirmDeleteQuestions", "cancelDeleteQuestions",
"confirmPasteQuestions", "cancelPasteQuestions", "uploadQuestions",
"editQuestion", "addMaterial", "removeMaterial", "save", "cancel",
"cancelExplorer", "linkChilds", "addGIT", "addST", "addPG", "preview",
"moveCategory", "deleteCategory", "addPhrase", "addCategory", "savePhrase",
"addSelectedPhrase", "cancelViewPhrase", "confirmSavePhrase", "cancelSavePhrase",
"insertBeforeCategory", "insertAfterCategory", "confirmDeleteCategory",
"cancelDeleteCategory", "categories", "saveCategories",
"savePhrase", "addPhrase"
),
array("ilobjsurveyquestionpoolgui", "ilsurveyphrasesgui"), "", $force_active);
if ($ilAccess->checkAccess("visible", "", $this->ref_id))
{
$tabs_gui->addTarget("info_short",
$this->ctrl->getLinkTarget($this, "infoScreen"),
array("infoScreen", "showSummary"));
}
if ($ilAccess->checkAccess('write', '', $this->ref_id))
{
// properties
$tabs_gui->addTarget("settings",
$this->ctrl->getLinkTarget($this,'properties'),
"properties",
"", "");
// manage phrases
$tabs_gui->addTarget("manage_phrases",
$this->ctrl->getLinkTargetByClass("ilsurveyphrasesgui", "phrases"),
array("phrases", "deletePhrase", "confirmDeletePhrase", "cancelDeletePhrase", "editPhrase", "newPhrase", "saveEditPhrase", "phraseEditor"),
"ilsurveyphrasesgui", "");
// meta data
$tabs_gui->addTarget("meta_data",
$this->ctrl->getLinkTargetByClass('ilmdeditorgui','listSection'),
"", "ilmdeditorgui");
// export
$tabs_gui->addTarget("export",
$this->ctrl->getLinkTarget($this,'export'),
array("export", "createExportFile", "confirmDeleteExportFile",
"downloadExportFile", "cancelDeleteExportFile", "deleteExportFile"),
"", "");
}
if ($ilAccess->checkAccess("edit_permission", "", $this->ref_id))
{
$tabs_gui->addTarget("perm_settings",
$this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
}
}
ilObjSurveyQuestionPoolGUI::ilObjSurveyQuestionPoolGUI ( )

Constructor public.

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

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

{
global $lng, $ilCtrl;
$this->type = "spl";
$lng->loadLanguageModule("survey");
$this->ctrl =& $ilCtrl;
$this->ctrl->saveParameter($this, array("ref_id", "calling_survey", "new_for_survey", "pgov", "pgov_pos"));
$this->ilObjectGUI("",$_GET["ref_id"], true, false);
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::importFileObject ( )

form for new survey object import

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

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

{
global $tpl, $ilErr;
$parent_id = $_GET["ref_id"];
$new_type = $_REQUEST["new_type"];
// create permission is already checked in createObject. This check here is done to prevent hacking attempts
if (!$this->checkPermissionBool("create", "", $new_type))
{
$ilErr->raiseError($this->lng->txt("no_create_permission"));
}
$this->lng->loadLanguageModule($new_type);
$this->ctrl->setParameter($this, "new_type", $new_type);
$form = $this->initImportForm($new_type);
if ($form->checkInput())
{
include_once "./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php";
$newObj = new ilObjSurveyQuestionPool();
$newObj->setType($new_type);
$newObj->setTitle("dummy");
$newObj->create(true);
$this->putObjectInTree($newObj);
$newObj->createImportDirectory();
// copy uploaded file to import directory
$upload = $_FILES["importfile"];
$file = pathinfo($upload["name"]);
$full_path = $newObj->getImportDirectory()."/".$upload["name"];
include_once "./Services/Utilities/classes/class.ilUtil.php";
ilUtil::moveUploadedFile($upload["tmp_name"], $upload["name"],
$full_path);
// import qti data
$qtiresult = $newObj->importObject($full_path);
ilUtil::sendSuccess($this->lng->txt("object_imported"),true);
ilUtil::redirect("ilias.php?ref_id=".$newObj->getRefId().
"&baseClass=ilObjSurveyQuestionPoolGUI");
}
// display form to correct errors
$form->setValuesByPost();
$tpl->setContent($form->getHtml());
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::importQuestionsObject ( )

display the import form to import questions into the questionpool

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

{
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_svy_import_question.html", "Modules/SurveyQuestionPool");
$this->tpl->setCurrentBlock("adm_content");
$this->tpl->setVariable("TEXT_IMPORT_QUESTION", $this->lng->txt("import_question"));
$this->tpl->setVariable("TEXT_SELECT_FILE", $this->lng->txt("select_file"));
$this->tpl->setVariable("TEXT_UPLOAD", $this->lng->txt("upload"));
$this->tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this));
$this->tpl->parseCurrentBlock();
}
ilObjSurveyQuestionPoolGUI::infoScreenForward ( )

show information screen

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

References $ilErr.

Referenced by executeCommand(), and infoScreenObject().

{
global $ilErr, $ilAccess;
if(!$ilAccess->checkAccess("visible", "", $this->ref_id))
{
$ilErr->raiseError($this->lng->txt("msg_no_perm_read"));
}
include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
$info = new ilInfoScreenGUI($this);
$info->enablePrivateNotes();
// standard meta data
$info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
$this->ctrl->forwardCommand($info);
}

+ Here is the caller graph for this function:

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

References infoScreenForward().

{
$this->ctrl->setCmd("showSummary");
$this->ctrl->setCmdClass("ilinfoscreengui");
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::initCreationForms (   $a_new_type)
protected

Init creation froms.

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

Parameters
string$a_new_type
Returns
array

Reimplemented from ilObjectGUI.

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

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

{
$form = $this->initImportForm($a_new_type);
$forms = array(self::CFORM_NEW => $this->initCreateForm($a_new_type),
self::CFORM_IMPORT => $form);
return $forms;
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::initImportForm (   $a_new_type)
protected

Init object import form.

Parameters
stringnew type
Returns
ilPropertyFormGUI

Reimplemented from ilObjectGUI.

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

Referenced by importFileObject(), and initCreationForms().

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

+ Here is the caller graph for this function:

ilObjSurveyQuestionPoolGUI::moveObject ( )

mark one or more question objects for moving

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

References $_POST, and ilUtil\sendInfo().

{
if (count($_POST["q_id"]) > 0)
{
foreach ($_POST["q_id"] as $key => $value)
{
$this->object->moveToClipboard($value);
}
ilUtil::sendInfo($this->lng->txt("spl_move_insert_clipboard"), true);
}
else
{
ilUtil::sendInfo($this->lng->txt("spl_move_select_none"), true);
}
$this->ctrl->redirect($this, "questions");
}

+ Here is the call graph for this function:

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().

{
if (array_key_exists("spl_clipboard", $_SESSION))
{
$this->object->pasteFromClipboard();
}
else
{
ilUtil::sendInfo($this->lng->txt("spl_paste_no_objects"), true);
}
$this->ctrl->redirect($this, "questions");
}

+ Here is the call graph for this function:

& ilObjSurveyQuestionPoolGUI::previewObject ( )

create preview of object

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

References $_GET, and SurveyQuestionGUI\_getQuestionGUI().

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

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::propertiesObject ( )

Questionpool properties.

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

References ilFormPropertyGUI\setInfo().

{
$save = ((strcmp($this->ctrl->getCmd(), "save") == 0)) ? true : false;
include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this, 'properties'));
$form->setTitle($this->lng->txt("properties"));
$form->setMultipart(false);
$form->setId("properties");
// online
$online = new ilCheckboxInputGUI($this->lng->txt("spl_online_property"), "online");
$online->setInfo($this->lng->txt("spl_online_property_description"));
$online->setChecked($this->object->getOnline());
$form->addItem($online);
$form->addCommandButton("saveProperties", $this->lng->txt("save"));
if ($save)
{
$form->checkInput();
}
$this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
}

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::questionsObject (   $arrFilter = null)

list questions of question pool

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

References $_GET, $_REQUEST, $_SESSION, ilObjectGUI\$data, ilObjectGUI\$ref_id, ilUtil\redirect(), and ilSurveyQuestionsTableGUI\setEditable().

Referenced by deleteQuestionsObject(), and exportQuestionObject().

{
global $rbacsystem;
global $ilUser;
if(get_class($this->object) == "ilObjSurvey")
{
if (($_GET["calling_survey"] > 0) || ($_GET["new_for_survey"] > 0))
{
$ref_id = $_GET["calling_survey"];
if (!strlen($ref_id)) $ref_id = $_GET["new_for_survey"];
$addurl = "";
if (strlen($_GET["new_for_survey"]))
{
$addurl = "&new_id=" . $_GET["q_id"];
}
if ($_REQUEST["pgov"])
{
$addurl .= "&pgov=".$_REQUEST["pgov"];
$addurl .= "&pgov_pos=".$_REQUEST["pgov_pos"];
}
ilUtil::redirect("ilias.php?baseClass=ilObjSurveyGUI&ref_id=".$ref_id."&cmd=questions".$addurl);
}
}
$this->object->purgeQuestions();
$_SESSION['q_id_table_nav'] = $_GET['q_id_table_nav'];
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_svy_qpl_questionbrowser.html", "Modules/SurveyQuestionPool");
include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionsTableGUI.php";
$table_gui = new ilSurveyQuestionsTableGUI($this, 'questions', (($rbacsystem->checkAccess('write', $_GET['ref_id']) ? true : false)));
$table_gui->setEditable($rbacsystem->checkAccess('write', $_GET['ref_id']));
$arrFilter = array();
foreach ($table_gui->getFilterItems() as $item)
{
if ($item->getValue() !== false)
{
$arrFilter[$item->getPostVar()] = $item->getValue();
}
}
$data = $this->object->getQuestionsData($arrFilter);
$table_gui->setData($data);
$this->tpl->setVariable('TABLE', $table_gui->getHTML());
if ($rbacsystem->checkAccess('write', $_GET['ref_id']))
{
$this->tpl->setCurrentBlock("QTypes");
$types =& ilObjSurveyQuestionPool::_getQuestionTypes();
$lastquestiontype = $ilUser->getPref("svy_lastquestiontype");
foreach ($types as $translation => $data)
{
if ($data["type_tag"] == $lastquestiontype)
{
$this->tpl->setVariable("QUESTION_TYPE_SELECTED", " selected=\"selected\"");
}
$this->tpl->setVariable("QUESTION_TYPE_ID", $data["type_tag"]);
$this->tpl->setVariable("QUESTION_TYPE", $translation);
$this->tpl->parseCurrentBlock();
}
$this->tpl->setVariable("QUESTION_ADD", $this->lng->txt("create"));
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this, 'questions'));
$this->tpl->parseCurrentBlock();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjSurveyQuestionPoolGUI::resetfilterQuestionBrowserObject ( )

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

{
include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionsTableGUI.php";
$table_gui = new ilSurveyQuestionsTableGUI($this, 'questions');
$table_gui->resetFilter();
$this->ctrl->redirect($this, 'questions');
}
ilObjSurveyQuestionPoolGUI::savePropertiesObject ( )

Save questionpool properties.

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

References $_POST, and ilUtil\sendSuccess().

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

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::updateObject ( )

updates object entry in object_data

Reimplemented from ilObjectGUI.

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

References ilUtil\sendSuccess().

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

+ Here is the call graph for this function:

ilObjSurveyQuestionPoolGUI::uploadQuestionsObject ( )

imports question(s) into the questionpool

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

References ilUtil\moveUploadedFile().

{
// check if file was uploaded
$source = $_FILES["qtidoc"]["tmp_name"];
$error = 0;
if (($source == 'none') || (!$source) || $_FILES["qtidoc"]["error"] > UPLOAD_ERR_OK)
{
$error = 1;
}
// check correct file type
if (strpos("xml", $_FILES["qtidoc"]["type"]) !== FALSE)
{
$error = 1;
}
if (!$error)
{
// import file into questionpool
// create import directory
$this->object->createImportDirectory();
// copy uploaded file to import directory
$full_path = $this->object->getImportDirectory()."/".$_FILES["qtidoc"]["name"];
include_once "./Services/Utilities/classes/class.ilUtil.php";
ilUtil::moveUploadedFile($_FILES["qtidoc"]["tmp_name"],
$_FILES["qtidoc"]["name"], $full_path);
$source = $full_path;
$this->object->importObject($source, TRUE);
unlink($source);
}
$this->ctrl->redirect($this, "questions");
}

+ Here is the call graph for this function:

Field Documentation

ilObjSurveyQuestionPoolGUI::$defaultscript

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


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