ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilDataCollectionRecordListViewdefinitionGUI Class Reference

Class ilDataCollectionField. More...

+ Collaboration diagram for ilDataCollectionRecordListViewdefinitionGUI:

Public Member Functions

 __construct ($a_parent_obj, $table_id)
 executeCommand ()
 execute command
 edit ()
 createRecordListViewdefinition
 initForm ()
 initRecordListViewdefinitionForm
 save ($a_mode="create")
 saveRecordListViewdefinition
 doTableSwitch ()
 doTableSwitch

Detailed Description

Constructor & Destructor Documentation

ilDataCollectionRecordListViewdefinitionGUI::__construct (   $a_parent_obj,
  $table_id 
)

Definition at line 23 of file class.ilDataCollectionRecordListViewdefinitionGUI.php.

{
$this->main_table_id = $a_parent_obj->object->getMainTableId();
$this->table_id = $table_id;
$this->obj_id = $a_parent_obj->obj_id;
if(isset($view_id))
{
//TODO
//$this->field_obj = new ilDataCollectionField($field_id);
}
else
{
$this->view_obj->setTableId($table_id);
}
return;
}

Member Function Documentation

ilDataCollectionRecordListViewdefinitionGUI::doTableSwitch ( )

doTableSwitch

Definition at line 211 of file class.ilDataCollectionRecordListViewdefinitionGUI.php.

References $_POST, and $ilCtrl.

{
global $ilCtrl;
$ilCtrl->setParameterByClass("ilObjDataCollectionGUI","table_id", $_POST['table_id']);
$ilCtrl->redirect($this, "edit");
}
ilDataCollectionRecordListViewdefinitionGUI::edit ( )

createRecordListViewdefinition

Definition at line 71 of file class.ilDataCollectionRecordListViewdefinitionGUI.php.

References $tpl, and initForm().

{
global $tpl;
$this->initForm();
$this->getFormValues();
$tpl->setContent($this->form->getHTML());
}

+ Here is the call graph for this function:

ilDataCollectionRecordListViewdefinitionGUI::executeCommand ( )

execute command

Definition at line 46 of file class.ilDataCollectionRecordListViewdefinitionGUI.php.

References $cmd, and $ilCtrl.

{
global $ilCtrl;
$cmd = $ilCtrl->getCmd();
switch($cmd)
{
default:
$this->$cmd();
break;
}
return true;
}
ilDataCollectionRecordListViewdefinitionGUI::initForm ( )

initRecordListViewdefinitionForm

Definition at line 85 of file class.ilDataCollectionRecordListViewdefinitionGUI.php.

References $ilCtrl, $lng, ilSubEnabledFormPropertyGUI\addSubItem(), and ilDataCollectionTable\getAll().

Referenced by edit(), and save().

{
global $lng, $ilCtrl, $ilToolbar;
// Show tables
require_once("./Modules/DataCollection/classes/class.ilDataCollectionTable.php");
$arrTables = ilDataCollectionTable::getAll($this->obj_id);
foreach($arrTables as $table)
{
$options[$table['id']] = $table['title'];
}
include_once './Services/Form/classes/class.ilSelectInputGUI.php';
$table_selection = new ilSelectInputGUI(
'',
'table_id'
);
$table_selection->setOptions($options);
$table_selection->setValue($this->table_id);
$ilToolbar->setFormAction($ilCtrl->getFormActionByClass("ilDataCollectionRecordListViewdefinitionGUI", "doTableSwitch"));
$ilToolbar->addInputItem($table_selection);
$ilToolbar->addFormButton($lng->txt('change'),'doTableSwitch');
// Form
require_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($ilCtrl->getFormAction($this),"save");
$this->form->addCommandButton('save', $lng->txt('dcl_listviewdefinition_update'));
$this->form->addCommandButton('cancel', $lng->txt('cancel'));
//Table-ID
$hidden_prop = new ilHiddenInputGUI("table_id");
$hidden_prop->setValue($this->table_id);
$this->form->addItem($hidden_prop);
//Get fields
require_once("./Modules/DataCollection/classes/class.ilDataCollectionField.php");
$fields = ilDataCollectionField::getAll($this->table_id);
$tabledefinition = array(
"id" => array("title" => $lng->txt("id")),
"table_id" => array("title" => $lng->txt("dcl_table_id")),
"create_date" => array("title" => $lng->txt("create_date")),
"last_update" => array("title" => $lng->txt("last_update")),
"owner" => array("title" => $lng->txt("owner"))
);
//Array zusammenführen
foreach($fields as $key => $value)
{
$tabledefinition[$key] = $value;
}
foreach($tabledefinition as $key => $field)
{
$chk_prop = new ilCheckboxInputGUI($field['title'],'visible_'.$key);
$chk_prop->setOptionTitle($lng->txt('visible'));
$text_prop = new ilTextInputGUI($lng->txt('dcl_field_ordering'), 'order_'.$key);
$chk_prop->addSubItem($text_prop);
$this->form->addItem($chk_prop);
}
$this->form->setTitle($lng->txt('dcl_view_viewdefinition'));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionRecordListViewdefinitionGUI::save (   $a_mode = "create")

saveRecordListViewdefinition

Parameters
string$a_modevalues: create | update

Definition at line 158 of file class.ilDataCollectionRecordListViewdefinitionGUI.php.

References $ilCtrl, $lng, initForm(), and ilUtil\sendSuccess().

{
global $ilCtrl, $lng;
$this->initForm();
if($this->form->checkInput())
{
//Get fields
require_once("./Modules/DataCollection/classes/class.ilDataCollectionField.php");
$fields = ilDataCollectionField::getAll($this->table_id);
//TODO tabledefs global definieren
$tabledefinition = array(
"id" => array("title" => $lng->txt("id")),
"table_id" => array("title" => $lng->txt("dcl_table_id")),
"create_date" => array("title" => $lng->txt("create_date")),
"last_update" => array("title" => $lng->txt("last_update")),
"owner" => array("title" => $lng->txt("owner"))
);
// Array zusammenführen TODO
foreach($fields as $key => $value)
{
$tabledefinition[$key] = $value;
}
foreach($tabledefinition as $key => $field)
{
if($this->form->getInput("visible_".$key))
{
$this->view_obj->setArrFieldOrder($this->form->getInput("order_".$key),$key);
}
}
$this->view_obj->doCreate();
ilUtil::sendSuccess($lng->txt("msg_obj_modified"),true);
$ilCtrl->redirect($this, "edit");
}
else
{
ilUtil::sendSuccess($lng->txt("msg_obj_modified"),false);
$this->form_gui->setValuesByPost();
$this->tpl->setContent($this->form_gui->getHTML());
}
}

+ Here is the call graph for this function:


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