ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilPermission2GUI Class Reference

Class ilPermissionGUI RBAC related output. More...

+ Inheritance diagram for ilPermission2GUI:
+ Collaboration diagram for ilPermission2GUI:

Public Member Functions

 __construct ($a_gui_obj)
 owner ()
 changeOwner ()
 __initSubTabs ($a_cmd)
 log ()
 applyLogFilter ()
 resetLogFilter ()

Protected Attributes

 $gui_obj = null
 $ilErr = null
 $ctrl = null
 $lng = null

Detailed Description

Class ilPermissionGUI RBAC related output.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Sascha Hofmann sasch.nosp@m.ahof.nosp@m.mann@.nosp@m.gmx..nosp@m.de
Version
Id:
class.ilPermissionGUI.php 20310 2009-06-23 12:57:19Z smeyer

Definition at line 17 of file class.ilPermission2GUI.php.

Constructor & Destructor Documentation

ilPermission2GUI::__construct (   $a_gui_obj)

Reimplemented in ilPermissionGUI.

Definition at line 24 of file class.ilPermission2GUI.php.

References $ilCtrl, $ilErr, $lng, $tpl, and PEAR_ERROR_CALLBACK.

{
global $ilias, $objDefinition, $tpl, $tree, $ilCtrl, $ilErr, $lng;
if (!isset($ilErr))
{
$ilErr = new ilErrorHandling();
$ilErr->setErrorHandling(PEAR_ERROR_CALLBACK,array($ilErr,'errorHandler'));
}
else
{
$this->ilErr =& $ilErr;
}
$this->objDefinition =& $objDefinition;
$this->tpl =& $tpl;
$this->lng =& $lng;
$this->lng->loadLanguageModule("rbac");
$this->ctrl =& $ilCtrl;
$this->gui_obj = $a_gui_obj;
$this->roles = array();
$this->num_roles = 0;
}

Member Function Documentation

ilPermission2GUI::__initSubTabs (   $a_cmd)

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

References $log, and ilRbacLog\isActive().

Referenced by ilPermissionGUI\executeCommand(), log(), owner(), and ilPermissionGUI\perm().

{
global $ilTabs;
$perm = ($a_cmd == 'perm') ? true : false;
$info = ($a_cmd == 'perminfo') ? true : false;
$owner = ($a_cmd == 'owner') ? true : false;
$log = ($a_cmd == 'log') ? true : false;
$ilTabs->addSubTabTarget("permission_settings", $this->ctrl->getLinkTarget($this, "perm"),
"", "", "", $perm);
#$ilTabs->addSubTabTarget("permission_settings", $this->ctrl->getLinkTarget($this, "perm2"),
# "", "", "", $perm);
$ilTabs->addSubTabTarget("info_status_info", $this->ctrl->getLinkTargetByClass(array(get_class($this),"ilobjectpermissionstatusgui"), "perminfo"),
"", "", "", $info);
$ilTabs->addSubTabTarget("owner", $this->ctrl->getLinkTarget($this, "owner"),
"", "", "", $owner);
include_once "Services/AccessControl/classes/class.ilRbacLog.php";
{
$ilTabs->addSubTabTarget("log", $this->ctrl->getLinkTarget($this, "log"),
"", "", "", $log);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPermission2GUI::applyLogFilter ( )

Definition at line 161 of file class.ilPermission2GUI.php.

References log(), and ilTable2GUI\resetOffset().

{
include_once "Services/AccessControl/classes/class.ilRbacLogTableGUI.php";
$table = new ilRbacLogTableGUI($this, "log", $this->gui_obj->object->getRefId());
$table->resetOffset();
$table->writeFilterToSession();
$this->log();
}

+ Here is the call graph for this function:

ilPermission2GUI::changeOwner ( )

Definition at line 79 of file class.ilPermission2GUI.php.

References $_POST, ilObjUser\_lookupId(), ilRbacLog\add(), ilRbacLog\CHANGE_OWNER, ilRbacLog\isActive(), owner(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

{
global $rbacsystem,$ilObjDataCache;
if(!$user_id = ilObjUser::_lookupId($_POST['owner']))
{
ilUtil::sendFailure($this->lng->txt('user_not_known'));
$this->owner();
return true;
}
// no need to change?
if($user_id != $this->gui_obj->object->getOwner())
{
$this->gui_obj->object->setOwner($user_id);
$this->gui_obj->object->updateOwner();
$ilObjDataCache->deleteCachedEntry($this->gui_obj->object->getId());
include_once "Services/AccessControl/classes/class.ilRbacLog.php";
{
ilRbacLog::add(ilRbacLog::CHANGE_OWNER, $this->gui_obj->object->getRefId(), array($user_id));
}
}
ilUtil::sendSuccess($this->lng->txt('owner_updated'),true);
if (!$rbacsystem->checkAccess("edit_permission",$this->gui_obj->object->getRefId()))
{
$this->ctrl->redirect($this->gui_obj);
return true;
}
$this->ctrl->redirect($this,'owner');
return true;
}

+ Here is the call graph for this function:

ilPermission2GUI::log ( )

Definition at line 146 of file class.ilPermission2GUI.php.

References __initSubTabs(), and ilRbacLog\isActive().

Referenced by applyLogFilter(), and resetLogFilter().

{
include_once "Services/AccessControl/classes/class.ilRbacLog.php";
{
$this->ctrl->redirect($this, "perm");
}
$this->__initSubTabs("log");
include_once "Services/AccessControl/classes/class.ilRbacLogTableGUI.php";
$table = new ilRbacLogTableGUI($this, "log", $this->gui_obj->object->getRefId());
$this->tpl->setContent($table->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPermission2GUI::owner ( )

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

References __initSubTabs(), ilObjUser\_lookupLogin(), and ilTextInputGUI\setDataSource().

Referenced by changeOwner().

{
$this->__initSubTabs("owner");
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this, "owner"));
$form->setTitle($this->lng->txt("info_owner_of_object"));
$login = new ilTextInputGUI($this->lng->txt("login"), "owner");
$login->setDataSource($this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilRepositorySearchGUI'), 'doUserAutoComplete', '', true));
$login->setRequired(true);
$login->setSize(50);
$login->setInfo($this->lng->txt("chown_warning"));
$login->setValue(ilObjUser::_lookupLogin($this->gui_obj->object->getOwner()));
$form->addItem($login);
$form->addCommandButton("changeOwner", $this->lng->txt("change_owner"));
$this->tpl->setContent($form->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPermission2GUI::resetLogFilter ( )

Definition at line 170 of file class.ilPermission2GUI.php.

References log(), and ilTable2GUI\resetOffset().

{
include_once "Services/AccessControl/classes/class.ilRbacLogTableGUI.php";
$table = new ilRbacLogTableGUI($this, "log", $this->gui_obj->object->getRefId());
$table->resetOffset();
$table->resetFilter();
$this->log();
}

+ Here is the call graph for this function:

Field Documentation

ilPermission2GUI::$ctrl = null
protected

Definition at line 21 of file class.ilPermission2GUI.php.

ilPermission2GUI::$gui_obj = null
protected

Definition at line 19 of file class.ilPermission2GUI.php.

ilPermission2GUI::$ilErr = null
protected
ilPermission2GUI::$lng = null
protected

Definition at line 22 of file class.ilPermission2GUI.php.

Referenced by __construct().


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