ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilSurveyPhrasesGUI Class Reference

Survey phrases GUI class. More...

+ Collaboration diagram for ilSurveyPhrasesGUI:

Public Member Functions

 __construct ($a_object)
 ilSurveyPhrasesGUI constructor
executeCommand ()
 execute command
 getCommand ($cmd)
 Retrieves the ilCtrl command.
 deletePhrase ()
 Creates a confirmation form to delete personal phases from the database.
 phrases ()
 Displays a form to manage the user created phrases.
 cancelDeletePhrase ()
 cancel delete phrases
 confirmDeletePhrase ()
 confirm delete phrases
 deletePhrasesForm ($checked_phrases)
 Creates a confirmation form to delete personal phases from the database.

Data Fields

 $object
 $gui_object
 $lng
 $tpl
 $ctrl
 $ilias
 $tree
 $ref_id

Detailed Description

Survey phrases GUI class.

The ilSurveyPhrases GUI class creates the GUI output for survey phrases (collections of survey categories) of ordinal survey question types.

Author
Helmut Schottmüller ilias.nosp@m.@aur.nosp@m.ealis.nosp@m..de
Version
$Id$

Definition at line 35 of file class.ilSurveyPhrasesGUI.php.

Constructor & Destructor Documentation

ilSurveyPhrasesGUI::__construct (   $a_object)

ilSurveyPhrasesGUI constructor

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

References $ilCtrl, $ilias, $lng, $tpl, and $tree.

{
include_once "./Modules/SurveyQuestionPool/classes/class.ilSurveyPhrases.php";
$this->lng =& $lng;
$this->tpl =& $tpl;
$this->ctrl =& $ilCtrl;
$this->ilias =& $ilias;
$this->gui_object =& $a_object;
$this->object = new ilSurveyPhrases();
$this->tree =& $tree;
$this->ref_id = $a_object->ref_id;
}

Member Function Documentation

ilSurveyPhrasesGUI::cancelDeletePhrase ( )

cancel delete phrases

Definition at line 145 of file class.ilSurveyPhrasesGUI.php.

{
$this->ctrl->redirect($this, "phrases");
}
ilSurveyPhrasesGUI::confirmDeletePhrase ( )

confirm delete phrases

Definition at line 153 of file class.ilSurveyPhrasesGUI.php.

References $_POST, and ilUtil\sendSuccess().

{
$phrases = $_POST['phrase'];
$this->object->deletePhrases($phrases);
ilUtil::sendSuccess($this->lng->txt("qpl_phrases_deleted"), true);
$this->ctrl->redirect($this, "phrases");
}

+ Here is the call graph for this function:

ilSurveyPhrasesGUI::deletePhrase ( )

Creates a confirmation form to delete personal phases from the database.

Definition at line 94 of file class.ilSurveyPhrasesGUI.php.

References $_POST, deletePhrasesForm(), phrases(), ilUtil\sendInfo(), and ilUtil\sendQuestion().

{
$checked_phrases = $_POST['phrase'];
if (count($checked_phrases))
{
ilUtil::sendQuestion($this->lng->txt("qpl_confirm_delete_phrases"));
$this->deletePhrasesForm($checked_phrases);
return;
}
else
{
ilUtil::sendInfo($this->lng->txt("qpl_delete_phrase_select_none"));
$this->phrases();
return;
}
}

+ Here is the call graph for this function:

ilSurveyPhrasesGUI::deletePhrasesForm (   $checked_phrases)

Creates a confirmation form to delete personal phases from the database.

Parameters
array$checked_phrasesAn array with the id's of the phrases checked for deletion

Definition at line 166 of file class.ilSurveyPhrasesGUI.php.

References $data, ilSurveyPhrases\_getAvailablePhrases(), and ilSurveyPhrases\_getCategoriesForPhrase().

Referenced by deletePhrase().

{
include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyPhrasesTableGUI.php";
$table_gui = new ilSurveyPhrasesTableGUI($this, 'phrases', true);
$data = array();
foreach ($checked_phrases as $phrase_id)
{
$phrase_array = $phrases[$phrase_id];
$categories =& ilSurveyPhrases::_getCategoriesForPhrase($phrase_id);
array_push($data, array('phrase_id' => $phrase_id, 'phrase' => $phrase_array["title"], 'answers' => join($categories, ", ")));
}
$table_gui->setData($data);
$this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

& ilSurveyPhrasesGUI::executeCommand ( )

execute command

Definition at line 68 of file class.ilSurveyPhrasesGUI.php.

References $cmd, $ret, and getCommand().

{
$cmd = $this->ctrl->getCmd();
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->getCommand($cmd);
switch($next_class)
{
default:
$ret =& $this->$cmd();
break;
}
return $ret;
}

+ Here is the call graph for this function:

ilSurveyPhrasesGUI::getCommand (   $cmd)

Retrieves the ilCtrl command.

Definition at line 86 of file class.ilSurveyPhrasesGUI.php.

References $cmd.

Referenced by executeCommand().

{
return $cmd;
}

+ Here is the caller graph for this function:

ilSurveyPhrasesGUI::phrases ( )

Displays a form to manage the user created phrases.

public

Definition at line 118 of file class.ilSurveyPhrasesGUI.php.

References $data, ilSurveyPhrases\_getAvailablePhrases(), ilSurveyPhrases\_getCategoriesForPhrase(), and ilUtil\sendInfo().

Referenced by deletePhrase().

{
global $rbacsystem;
if ($rbacsystem->checkAccess("write", $this->ref_id))
{
include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyPhrasesTableGUI.php";
$table_gui = new ilSurveyPhrasesTableGUI($this, 'phrases');
$data = array();
foreach ($phrases as $phrase_id => $phrase_array)
{
$categories =& ilSurveyPhrases::_getCategoriesForPhrase($phrase_id);
array_push($data, array('phrase_id' => $phrase_id, 'phrase' => $phrase_array["title"], 'answers' => join($categories, ", ")));
}
$table_gui->setData($data);
$this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
}
else
{
ilUtil::sendInfo($this->lng->txt("cannot_manage_phrases"));
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilSurveyPhrasesGUI::$ctrl

Definition at line 41 of file class.ilSurveyPhrasesGUI.php.

ilSurveyPhrasesGUI::$gui_object

Definition at line 38 of file class.ilSurveyPhrasesGUI.php.

ilSurveyPhrasesGUI::$ilias

Definition at line 42 of file class.ilSurveyPhrasesGUI.php.

Referenced by __construct().

ilSurveyPhrasesGUI::$lng

Definition at line 39 of file class.ilSurveyPhrasesGUI.php.

Referenced by __construct().

ilSurveyPhrasesGUI::$object

Definition at line 37 of file class.ilSurveyPhrasesGUI.php.

ilSurveyPhrasesGUI::$ref_id

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

ilSurveyPhrasesGUI::$tpl

Definition at line 40 of file class.ilSurveyPhrasesGUI.php.

Referenced by __construct().

ilSurveyPhrasesGUI::$tree

Definition at line 43 of file class.ilSurveyPhrasesGUI.php.

Referenced by __construct().


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