ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjQuestionPoolSettingsGeneralGUI Class Reference
+ Collaboration diagram for ilObjQuestionPoolSettingsGeneralGUI:

Public Member Functions

 __construct (ilCtrl $ctrl, ilAccessHandler $access, ilLanguage $lng, ilTemplate $tpl, ilTabsGUI $tabs, ilObjQuestionPoolGUI $poolGUI)
 Constructor.
 executeCommand ()
 Command Execution.

Data Fields

const CMD_SHOW_FORM = 'showForm'
 command constants
const CMD_SAVE_FORM = 'saveForm'

Protected Attributes

 $ctrl = null
 $access = null
 $lng = null
 $tpl = null
 $tabs = null
 $poolGUI = null
 $poolOBJ = null

Private Member Functions

 showFormCmd (ilPropertyFormGUI $form=null)
 saveFormCmd ()
 performSaveForm (ilPropertyFormGUI $form)
 buildForm ()
 getTaxonomySelectInputOptions ()

Detailed Description

Constructor & Destructor Documentation

ilObjQuestionPoolSettingsGeneralGUI::__construct ( ilCtrl  $ctrl,
ilAccessHandler  $access,
ilLanguage  $lng,
ilTemplate  $tpl,
ilTabsGUI  $tabs,
ilObjQuestionPoolGUI  $poolGUI 
)

Constructor.

Definition at line 75 of file class.ilObjQuestionPoolSettingsGeneralGUI.php.

References $access, $ctrl, $lng, $poolGUI, $tabs, and $tpl.

{
$this->ctrl = $ctrl;
$this->access = $access;
$this->lng = $lng;
$this->tpl = $tpl;
$this->tabs = $tabs;
$this->poolGUI = $poolGUI;
$this->poolOBJ = $poolGUI->object;
}

Member Function Documentation

ilObjQuestionPoolSettingsGeneralGUI::buildForm ( )
private

Definition at line 167 of file class.ilObjQuestionPoolSettingsGeneralGUI.php.

References getTaxonomySelectInputOptions(), and ilFormPropertyGUI\setInfo().

Referenced by saveFormCmd(), and showFormCmd().

{
require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->addCommandButton(self::CMD_SAVE_FORM, $this->lng->txt('save'));
$form->setTitle($this->lng->txt('qpl_form_general_settings'));
$form->setId('properties');
// online
$online = new ilCheckboxInputGUI($this->lng->txt('qpl_settings_general_form_property_online'), 'online');
$online->setInfo($this->lng->txt('qpl_settings_general_form_property_online_description'));
$online->setChecked($this->poolOBJ->getOnline());
$form->addItem($online);
// show taxonomies
$showTax = new ilCheckboxInputGUI($this->lng->txt('qpl_settings_general_form_property_show_taxonomies'), 'show_taxonomies');
$showTax->setInfo($this->lng->txt('qpl_settings_general_form_prop_show_tax_desc'));
$showTax->setChecked($this->poolOBJ->getShowTaxonomies());
$form->addItem($showTax);
$taxSelectOptions = $this->getTaxonomySelectInputOptions();
// pool navigation taxonomy
$navTax = new ilSelectInputGUI($this->lng->txt('qpl_settings_general_form_property_nav_taxonomy'), 'nav_taxonomy');
$navTax->setInfo($this->lng->txt('qpl_settings_general_form_property_nav_taxonomy_description'));
$navTax->setValue($this->poolOBJ->getNavTaxonomyId());
$navTax->setOptions($taxSelectOptions);
$showTax->addSubItem($navTax);
return $form;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjQuestionPoolSettingsGeneralGUI::executeCommand ( )

Command Execution.

Definition at line 90 of file class.ilObjQuestionPoolSettingsGeneralGUI.php.

References $cmd, and ilUtil\sendInfo().

{
// allow only write access
if (!$this->access->checkAccess('write', '', $this->poolGUI->ref_id))
{
ilUtil::sendInfo($this->lng->txt('cannot_edit_question_pool'), true);
$this->ctrl->redirectByClass('ilObjQuestionPoolGUI', 'infoScreen');
}
// activate corresponding tab (auto activation does not work in ilObjTestGUI-Tabs-Salad)
$this->tabs->activateTab('settings');
// process command
$nextClass = $this->ctrl->getNextClass();
switch($nextClass)
{
default:
$cmd = $this->ctrl->getCmd(self::CMD_SHOW_FORM).'Cmd';
$this->$cmd();
}
}

+ Here is the call graph for this function:

ilObjQuestionPoolSettingsGeneralGUI::getTaxonomySelectInputOptions ( )
private

Definition at line 205 of file class.ilObjQuestionPoolSettingsGeneralGUI.php.

References ilObject\_lookupTitle().

Referenced by buildForm().

{
$taxSelectOptions = array(
'0' => $this->lng->txt('qpl_settings_general_form_property_opt_notax_selected')
);
foreach($this->poolOBJ->getTaxonomyIds() as $taxId)
{
$taxSelectOptions[$taxId] = ilObject::_lookupTitle($taxId);
}
return $taxSelectOptions;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjQuestionPoolSettingsGeneralGUI::performSaveForm ( ilPropertyFormGUI  $form)
private

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

References ilPropertyFormGUI\getItemByPostVar().

Referenced by saveFormCmd().

{
$online = $form->getItemByPostVar('online');
$this->poolOBJ->setOnline($online->getChecked());
$showTax = $form->getItemByPostVar('show_taxonomies');
$this->poolOBJ->setShowTaxonomies($showTax->getChecked());
$navTax = $form->getItemByPostVar('nav_taxonomy');
$this->poolOBJ->setNavTaxonomyId($navTax->getValue());
$this->poolOBJ->saveToDb();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjQuestionPoolSettingsGeneralGUI::saveFormCmd ( )
private

Definition at line 126 of file class.ilObjQuestionPoolSettingsGeneralGUI.php.

References $errors, buildForm(), performSaveForm(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and showFormCmd().

{
$form = $this->buildForm();
// form validation and initialisation
$errors = !$form->checkInput(); // ALWAYS CALL BEFORE setValuesByPost()
$form->setValuesByPost(); // NEVER CALL THIS BEFORE checkInput()
// return to form when any form validation errors exist
if($errors)
{
ilUtil::sendFailure($this->lng->txt('form_input_not_valid'));
return $this->showFormCmd($form);
}
// perform saving the form data
$this->performSaveForm($form);
// redirect to form output
ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
$this->ctrl->redirect($this, self::CMD_SHOW_FORM);
}

+ Here is the call graph for this function:

ilObjQuestionPoolSettingsGeneralGUI::showFormCmd ( ilPropertyFormGUI  $form = null)
private

Definition at line 116 of file class.ilObjQuestionPoolSettingsGeneralGUI.php.

References buildForm().

Referenced by saveFormCmd().

{
if( $form === null )
{
$form = $this->buildForm();
}
$this->tpl->setContent( $this->ctrl->getHTML($form) );
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilObjQuestionPoolSettingsGeneralGUI::$access = null
protected

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

Referenced by __construct().

ilObjQuestionPoolSettingsGeneralGUI::$ctrl = null
protected

Definition at line 28 of file class.ilObjQuestionPoolSettingsGeneralGUI.php.

Referenced by __construct().

ilObjQuestionPoolSettingsGeneralGUI::$lng = null
protected

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

Referenced by __construct().

ilObjQuestionPoolSettingsGeneralGUI::$poolGUI = null
protected

Definition at line 63 of file class.ilObjQuestionPoolSettingsGeneralGUI.php.

Referenced by __construct().

ilObjQuestionPoolSettingsGeneralGUI::$poolOBJ = null
protected
ilObjQuestionPoolSettingsGeneralGUI::$tabs = null
protected

Definition at line 56 of file class.ilObjQuestionPoolSettingsGeneralGUI.php.

Referenced by __construct().

ilObjQuestionPoolSettingsGeneralGUI::$tpl = null
protected

Definition at line 49 of file class.ilObjQuestionPoolSettingsGeneralGUI.php.

Referenced by __construct().

const ilObjQuestionPoolSettingsGeneralGUI::CMD_SAVE_FORM = 'saveForm'
const ilObjQuestionPoolSettingsGeneralGUI::CMD_SHOW_FORM = 'showForm'

command constants

Definition at line 20 of file class.ilObjQuestionPoolSettingsGeneralGUI.php.


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