ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilDataCollectionFieldListGUI Class Reference

Class ilDataCollectionFieldListGUI. More...

+ Collaboration diagram for ilDataCollectionFieldListGUI:

Public Member Functions

 __construct (ilObjDataCollectionGUI $a_parent_obj, $table_id)
 Constructor.
 executeCommand ()
 execute command
 save ()
 listFields ()
 list fields
 doTableSwitch ()

Protected Member Functions

 checkAccess ()

Detailed Description

Constructor & Destructor Documentation

ilDataCollectionFieldListGUI::__construct ( ilObjDataCollectionGUI  $a_parent_obj,
  $table_id 
)

Constructor.

Parameters
object$a_parent_obj
int$table_id

Definition at line 30 of file class.ilDataCollectionFieldListGUI.php.

References $ilCtrl, $lng, checkAccess(), and ilUtil\sendFailure().

{
global $ilCtrl, $lng;
$this->main_table_id = $a_parent_obj->object->getMainTableId();
$this->table_id = $table_id;
$this->parent_obj = $a_parent_obj;
$this->obj_id = $a_parent_obj->obj_id;
if ( ! $this->checkAccess()) {
ilUtil::sendFailure($lng->txt('permission_denied'), true);
$ilCtrl->redirectByClass('ildatacollectionrecordlistgui', 'listRecords');
}
}

+ Here is the call graph for this function:

Member Function Documentation

ilDataCollectionFieldListGUI::checkAccess ( )
protected
Returns
bool

Definition at line 142 of file class.ilDataCollectionFieldListGUI.php.

References $ref_id, and ilObjDataCollection\_hasWriteAccess().

Referenced by __construct().

{
$ref_id = $this->parent_obj->getDataCollectionObject()->getRefId();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionFieldListGUI::doTableSwitch ( )

Definition at line 131 of file class.ilDataCollectionFieldListGUI.php.

References $_POST, and $ilCtrl.

{
global $ilCtrl;
$ilCtrl->setParameterByClass("ilObjDataCollectionGUI", "table_id", $_POST['table_id']);
$ilCtrl->redirectByClass("ilDataCollectionFieldListGUI", "listFields");
}
ilDataCollectionFieldListGUI::executeCommand ( )

execute command

Definition at line 48 of file class.ilDataCollectionFieldListGUI.php.

References $cmd, $ilCtrl, and $tpl.

{
global $tpl, $ilCtrl;
$cmd = $ilCtrl->getCmd();
switch($cmd)
{
default:
$this->$cmd();
break;
}
}
ilDataCollectionFieldListGUI::listFields ( )

list fields

Definition at line 89 of file class.ilDataCollectionFieldListGUI.php.

References $ilCtrl, $lng, $options, and $tpl.

Referenced by save().

{
global $tpl, $lng, $ilCtrl, $ilToolbar;
// Show tables
require_once("./Modules/DataCollection/classes/class.ilDataCollectionTable.php");
$tables = $this->parent_obj->object->getTables();
foreach($tables as $table)
{
$options[$table->getId()] = $table->getTitle();
}
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("ilDataCollectionFieldListGUI", "doTableSwitch"));
$ilToolbar->addText($lng->txt("dcl_table"));
$ilToolbar->addInputItem($table_selection);
$ilToolbar->addFormButton($lng->txt('change'),'doTableSwitch');
$ilToolbar->addSeparator();
$ilToolbar->addButton($lng->txt("dcl_add_new_table"), $ilCtrl->getLinkTargetByClass("ildatacollectiontableeditgui", "create"));
$ilToolbar->addSeparator();
$ilCtrl->setParameterByClass("ildatacollectiontableeditgui", "table_id", $this->table_id);
$ilToolbar->addButton($lng->txt("dcl_table_settings"), $ilCtrl->getLinkTargetByClass("ildatacollectiontableeditgui", "edit"));
$ilToolbar->addButton($lng->txt("dcl_delete_table"), $ilCtrl->getLinkTargetByClass("ildatacollectiontableeditgui", "confirmDelete"));
$ilToolbar->addButton($lng->txt("dcl_add_new_field"), $ilCtrl->getLinkTargetByClass("ildatacollectionfieldeditgui", "create"));
// requested not to implement this way...
// $tpl->addJavaScript("Modules/DataCollection/js/fastTableSwitcher.js");
require_once('./Modules/DataCollection/classes/class.ilDataCollectionFieldListTableGUI.php');
$list = new ilDataCollectionFieldListTableGUI($this, $ilCtrl->getCmd(), $this->table_id);
$tpl->setContent($list->getHTML());
}

+ Here is the caller graph for this function:

ilDataCollectionFieldListGUI::save ( )

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

References $_GET, $_POST, $lng, ilDataCollectionCache\getTableCache(), listFields(), and ilUtil\sendSuccess().

{
global $lng;
$fields = &$table->getFields();
foreach($fields as &$field)
{
$field->setVisible($_POST['visible'][$field->getId()] == "on");
$field->setEditable($_POST['editable'][$field->getId()] == "on");
$field->setFilterable($_POST['filterable'][$field->getId()] == "on");
$field->setLocked($_POST['locked'][$field->getId()] == "on");
$field->setExportable($_POST['exportable'][$field->getId()] == "on");
$field->setOrder($_POST['order'][$field->getId()]);
$field->doUpdate();
}
$table->buildOrderFields();
ilUtil::sendSuccess($lng->txt("dcl_table_settings_saved"));
$this->listFields();
}

+ Here is the call graph for this function:


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