Public Member Functions | |
| ilObjectStatusGUI (&$a_obj) | |
| Constructor public. | |
| & | executeCommand () |
| execute command | |
| & | __initTableGUI () |
| __setTableGUIBasicData (&$tbl, &$result_set, $from="") | |
| __showPermissionsTable ($a_result_set) | |
| __showRolesTable ($a_result_set) | |
| __showObjectSummaryTable ($a_result_set) | |
| getHTML () | |
| getAssignedValidRoles () | |
| getPermissionInfo () | |
| getRoleAssignmentInfo () | |
| getObjectSummary () | |
| getCommands ($a_type) | |
Data Fields | |
| $lng | |
| $ilias | |
| $tpl | |
| $tree | |
| $rbacsystem | |
| $cur_ref_id | |
| $cmd | |
| $mode | |
| $ctrl | |
Definition at line 32 of file class.ilObjectStatusGUI.php.
| & ilObjectStatusGUI::__initTableGUI | ( | ) |
Definition at line 105 of file class.ilObjectStatusGUI.php.
Referenced by __showObjectSummaryTable(), __showPermissionsTable(), and __showRolesTable().
{
include_once "class.ilTableGUI.php";
return new ilTableGUI(0,false);
}
Here is the caller graph for this function:| ilObjectStatusGUI::__setTableGUIBasicData | ( | &$ | tbl, | |
| &$ | result_set, | |||
| $ | from = "" | |||
| ) |
Definition at line 112 of file class.ilObjectStatusGUI.php.
Referenced by __showObjectSummaryTable(), __showPermissionsTable(), and __showRolesTable().
{
global $lng;
$tbl->disable('footer');
$tbl->disable('linkbar');
$tbl->disable('hits');
$tbl->disable('sort');
$tbl->setLimit(0);
$tbl->setData($result_set);
}
Here is the caller graph for this function:| ilObjectStatusGUI::__showObjectSummaryTable | ( | $ | a_result_set | ) |
Definition at line 170 of file class.ilObjectStatusGUI.php.
References $class_name, $lng, $tbl, $tpl, __initTableGUI(), __setTableGUIBasicData(), and ilUtil::getImagePath().
Referenced by getObjectSummary().
{
global $lng;
$tbl =& $this->__initTableGUI();
$tpl =& $tbl->getTemplateObject();
$class_name = get_class($this->object)."gui";
$tpl->setCurrentBlock("tbl_form_header");
$tpl->setVariable("FORMACTION",$this->ctrl->getFormActionByClass($class_name,"info"));
$tpl->parseCurrentBlock();
$tpl->setCurrentBlock("tbl_action_row");
$tpl->setCurrentBlock("plain_button");
$tpl->setVariable("PBTN_NAME","info");
$tpl->setVariable("PBTN_VALUE",$lng->txt("info_change_user_view"));
$tpl->parseCurrentBlock();
$tpl->setCurrentBlock("plain_buttons");
$tpl->parseCurrentBlock();
$tpl->setVariable("COLUMN_COUNTS",7);
$tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("spacer.gif"));
$tpl->setVariable("TPLPATH",$this->tpl->tplPath);
// title & header columns
$tbl->setTitle($lng->txt("info_access_and_status_info"),"icon_".$this->object->getType()."_b.gif",$lng->txt("summary"));
//user must be member
$tbl->setHeaderNames(array(" ",$lng->txt("info_enter_login_or_id")));
//$tbl->setHeaderVars(array("operation","granted"),$this->ctrl->getParameterArray($this->object,"",false));
$tbl->setHeaderVars(array("",""),"");
$tbl->setColumnWidth(array("15%","85%"));
$this->__setTableGUIBasicData($tbl,$a_result_set);
//$tbl->setStyle('table','std');
$tbl->render();
$this->tpl->setVariable('INFO_SUMMARY',$tbl->tpl->get());
return $tbl->tpl->get();
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObjectStatusGUI::__showPermissionsTable | ( | $ | a_result_set | ) |
Definition at line 125 of file class.ilObjectStatusGUI.php.
References $lng, $tbl, $tpl, __initTableGUI(), and __setTableGUIBasicData().
Referenced by getPermissionInfo().
{
global $lng;
$tbl =& $this->__initTableGUI();
$tpl =& $tbl->getTemplateObject();
// title & header columns
$tbl->setTitle($lng->txt("info_access_permissions"),"icon_perm_b.gif",$lng->txt("info_access_permissions"));
//user must be member
$tbl->setHeaderNames(array("",$lng->txt("operation"),$lng->txt("info_from_role")));
//$tbl->setHeaderVars(array("operation","granted"),$this->ctrl->getParameterArray($this->object,"",false));
$tbl->setHeaderVars(array("","operation","role"),"");
$tbl->setColumnWidth(array("1%","39%","60%"));
$this->__setTableGUIBasicData($tbl,$a_result_set);
$tbl->setStyle('table','std');
$tbl->render();
$this->tpl->setVariable('INFO_PERMISSIONS',$tbl->tpl->get());
return $tbl->tpl->get();
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObjectStatusGUI::__showRolesTable | ( | $ | a_result_set | ) |
Definition at line 150 of file class.ilObjectStatusGUI.php.
References $lng, $tbl, $tpl, __initTableGUI(), and __setTableGUIBasicData().
Referenced by getRoleAssignmentInfo().
{
global $lng;
$tbl =& $this->__initTableGUI();
$tpl =& $tbl->getTemplateObject();
// title & header columns
$tbl->setTitle($lng->txt("info_available_roles"),"icon_rolf_b.gif",$lng->txt("info_available_roles"));
$tbl->setHeaderNames(array("",$lng->txt("role"),str_replace(" "," ",$lng->txt("info_permission_source")),str_replace(" "," ",$lng->txt("info_permission_origin"))));
$tbl->setColumnWidth(array("1%","19%","40%","40%"));
$this->__setTableGUIBasicData($tbl,$a_result_set);
$tbl->setStyle('table','std');
$tbl->render();
$this->tpl->setVariable('INFO_ROLES',$tbl->tpl->get());
return $tbl->tpl->get();
}
Here is the call graph for this function:
Here is the caller graph for this function:| & ilObjectStatusGUI::executeCommand | ( | ) |
execute command
Definition at line 99 of file class.ilObjectStatusGUI.php.
{
$next_class = $this->ctrl->getNextClass($this);
$this->ctrl->setCmd("");
}
| ilObjectStatusGUI::getAssignedValidRoles | ( | ) |
Definition at line 220 of file class.ilObjectStatusGUI.php.
References $ops, $ops_data, $rbacreview, ilObjRole::_getTranslation(), and getOperationList().
Referenced by ilObjectStatusGUI().
{
global $rbacreview;
include_once ('class.ilObjRole.php');
$assigned_valid_roles = array();
foreach ($this->valid_roles as $role)
{
if (in_array($role['obj_id'],$this->user_roles))
{
if ($role["obj_id"] == SYSTEM_ROLE_ID)
{
// get all possible operation of current object
$ops_list = getOperationList($this->object->getType());
foreach ($ops_list as $ops_data)
{
$ops[] = (int) $ops_data['ops_id'];
}
$role['ops'] = $ops;
}
else
{
$role['ops'] = $rbacreview->getRoleOperationsOnObject($role["obj_id"],$this->object->getRefId());
}
$role['translation'] = str_replace(" "," ",ilObjRole::_getTranslation($role["title"]));
$assigned_valid_roles[] = $role;
}
}
return $assigned_valid_roles;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObjectStatusGUI::getCommands | ( | $ | a_type | ) |
Definition at line 460 of file class.ilObjectStatusGUI.php.
References $objDefinition.
Referenced by getObjectSummary().
{
global $objDefinition;
$class = $objDefinition->getClassName($a_type);
$location = $objDefinition->getLocation($a_type);
$full_class = "ilObj".$class."Access";
include_once($location."/class.".$full_class.".php");
$cmds = call_user_func(array($full_class, "_getCommands"));
array_push($cmds,array('permission' => 'visible','cmd' => 'info'));
return $cmds;
}
Here is the caller graph for this function:| ilObjectStatusGUI::getHTML | ( | ) |
Definition at line 215 of file class.ilObjectStatusGUI.php.
{
return $this->tpl->get();
}
| ilObjectStatusGUI::getObjectSummary | ( | ) |
Definition at line 371 of file class.ilObjectStatusGUI.php.
References $cmd, $ilAccess, $ilias, $lng, $obj, $rbacreview, __showObjectSummaryTable(), and getCommands().
Referenced by ilObjectStatusGUI().
{
global $lng,$rbacreview,$ilAccess,$ilias;
$infos = array();
$input_field = "<input class=\"std\" type=\"input\" name=\"Fuserid\" value=\"".$this->user->getLogin()."\"/>";
$result_set[0][] = "<b>".$lng->txt("info_view_of_user")."</b>";
$result_set[0][] = $input_field." (".$this->user->getFullname().") (#".$this->user->getId().")";
$assigned_valid_roles = array();
foreach ($this->assigned_valid_roles as $role)
{
$assigned_valid_roles[] = $role["translation"];
}
$roles_str = implode(", ",$assigned_valid_roles);
$result_set[1][] = "<b>".$lng->txt("roles")."</b>";
$result_set[1][] = $roles_str;
/*
$result_set[2][] = "<b>".$lng->txt("object")."</b>";
$result_set[2][] = $this->object->getTitle()." (#".$this->object->getId().") (ref#".$this->object->getRefId().")";
$result_set[3][] = "<b>".$lng->txt("type")."</b>";
$result_set[3][] = $lng->txt("obj_".$this->object->getType());
*/
$result_set[4][] = "<b>".$lng->txt("status")."</b>";
$ilAccess->clear();
$ilAccess->doTreeCheck("visible","info",$this->object->getRefId(),$this->user->getId());
$infos = array_merge($infos,$ilAccess->getInfo());
$ilAccess->clear();
$ilAccess->doPathCheck("visible","info",$this->object->getRefId(),$this->user->getId(),true);
$infos = array_merge($infos,$ilAccess->getInfo());
$ilAccess->clear();
$ilAccess->doConditionCheck("read","info",$this->object->getRefId(),$this->user->getId(),$this->object->getId(),$this->object->getType());
$infos = array_merge($infos,$ilAccess->getInfo());
$cmds = $this->getCommands($this->object->getType());
$ilAccess->clear();
foreach ($cmds as $cmd)
{
$ilAccess->doStatusCheck($cmd['permission'],$cmd['cmd'],$this->object->getRefId(),$this->user->getId(),$this->object->getId(),$this->object->getType());
$infos = array_merge($infos,$ilAccess->getInfo());
}
$alert = "il_ItemAlertProperty";
$okay = "il_ItemOkayProperty";
if (!$infos)
{
$text = "<span class=\"".$okay."\">".$lng->txt("access")."</span><br/> ";
}
else
{
foreach ($infos as $info)
{
switch ($info['type'])
{
case IL_STATUS_MESSAGE:
$text .= "<span class=\"".$okay."\">".$info['text']."</span><br/> ";
break;
case IL_NO_PARENT_ACCESS:
$obj = $ilias->obj_factory->getInstanceByRefId($info['data']);
$text .= "<span class=\"".$alert."\">".$info['text']." (".$lng->txt("obj_".$obj->getType())." #".$obj->getId().": ".$obj->getTitle().")</span><br/> ";
break;
default:
$text .= "<span class=\"".$alert."\">".$info['text']."</span><br/> ";
break;
}
}
}
$result_set[4][] = $text;
return $this->__showObjectSummaryTable($result_set);
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObjectStatusGUI::getPermissionInfo | ( | ) |
Definition at line 257 of file class.ilObjectStatusGUI.php.
References $counter, $ilAccess, $ilUser, $lng, $ops, $rbacreview, __showPermissionsTable(), and getOperationList().
Referenced by ilObjectStatusGUI().
{
global $ilAccess,$lng,$rbacreview,$ilUser;
// icon handlers
$icon_ok = "<img src=\"".ilUtil::getImagePath("icon_ok.gif")."\" alt=\"".$lng->txt("info_assigned")."\" title=\"".$lng->txt("info_assigned")."\" border=\"0\" vspace=\"0\"/>";
$icon_not_ok = "<img src=\"".ilUtil::getImagePath("icon_not_ok.gif")."\" alt=\"".$lng->txt("info_not_assigned")."\" title=\"".$lng->txt("info_not_assigned")."\" border=\"0\" vspace=\"0\"/>";
// get all possible operation of current object
$ops_list = getOperationList($this->object->getType());
$counter = 0;
// check permissions of user
foreach ($ops_list as $ops)
{
$access = $ilAccess->doRBACCheck($ops['operation'],"info",$this->object->getRefId(),$this->user->getId());
$result_set[$counter][] = $access ? $icon_ok : $icon_not_ok;
$result_set[$counter][] = $lng->txt($this->object->getType()."_".$ops['operation']);
$list_role = "";
// get operations on object for each assigned role to user
foreach ($this->assigned_valid_roles as $role)
{
if (in_array($ops['ops_id'],$role['ops']))
{
$list_role[] = $role['translation'];
}
}
if (empty($list_role))
{
$roles_formatted = $lng->txt('none');
}
else
{
$roles_formatted = implode("<br/>",$list_role);
}
$result_set[$counter][] = $roles_formatted;
++$counter;
}
return $this->__showPermissionsTable($result_set);
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObjectStatusGUI::getRoleAssignmentInfo | ( | ) |
Definition at line 306 of file class.ilObjectStatusGUI.php.
References $counter, $lng, $path, $rbacreview, $tree, __showRolesTable(), and ilObjRole::_getTranslation().
Referenced by ilObjectStatusGUI().
{
global $lng,$rbacreview,$tree;
// icon handlers
$icon_ok = "<img src=\"".ilUtil::getImagePath("icon_ok.gif")."\" alt=\"".$lng->txt("info_assigned")."\" title=\"".$lng->txt("info_assigned")."\" border=\"0\" vspace=\"0\"/>";
$icon_not_ok = "<img src=\"".ilUtil::getImagePath("icon_not_ok.gif")."\" alt=\"".$lng->txt("info_not_assigned")."\" title=\"".$lng->txt("info_not_assigned")."\" border=\"0\" vspace=\"0\"/>";
$path = array_reverse($tree->getPathId($this->object->getRefId()));
//var_dump("<pre>",$valid_roles,$parent_roles,"</pre>");
include_once ('class.ilObjRole.php');
$counter = 0;
foreach ($this->valid_roles as $role)
{
$result_set[$counter][] = in_array($role['obj_id'],$this->user_roles) ? $icon_ok : $icon_not_ok;
$result_set[$counter][] = str_replace(" "," ",ilObjRole::_getTranslation($role["title"]));
if ($role['role_type'] != "linked")
{
$result_set[$counter][] = "";
}
else
{
$rolfs = $rbacreview->getFoldersAssignedToRole($role["obj_id"]);
// ok, try to match the next rolf in path
foreach ($path as $node)
{
if ($node == 1)
{
break;
}
$rolf = $rbacreview->getRoleFolderOfObject($node);
if (in_array($rolf['ref_id'],$rolfs))
{
$nodedata = $tree->getNodeData($node);
$result_set[$counter][] = $nodedata["title"];
break;
}
}
}
if (in_array($role['obj_id'],$this->global_roles))
{
$result_set[$counter][] = $lng->txt("global");
}
else
{
$rolf = $rbacreview->getFoldersAssignedToRole($role["obj_id"],true);
$parent_node = $tree->getParentNodeData($rolf[0]);
$result_set[$counter][] = $parent_node["title"];
}
++$counter;
}
return $this->__showRolesTable($result_set);
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObjectStatusGUI::ilObjectStatusGUI | ( | &$ | a_obj | ) |
Constructor public.
Definition at line 48 of file class.ilObjectStatusGUI.php.
References $_POST, $ilCtrl, $ilErr, $ilias, $ilUser, $lng, $rbacreview, $user_id, ilObjUser::_lookupId(), getAssignedValidRoles(), getObjectSummary(), getPermissionInfo(), and getRoleAssignmentInfo().
{
global $ilUser,$ilCtrl,$ilias,$ilErr,$lng,$rbacreview;
$this->ctrl =& $ilCtrl;
$this->object =& $a_obj;
$this->tpl = new ilTemplate("tpl.info_layout.html", false, false);
$this->tpl->setVariable("INFO_REMARK_INTERRUPTED",$lng->txt('info_remark_interrupted'));
if (empty($_POST['Fuserid']))
{
$this->user =& $ilUser;
}
else
{
if (is_numeric($_POST['Fuserid']))
{
$this->user = $ilias->obj_factory->getInstanceByObjId($_POST['Fuserid'],false);
}
else
{
include_once('class.ilObjUser.php');
$user_id = ilObjUser::_lookupId($_POST['Fuserid']);
$this->user = $ilias->obj_factory->getInstanceByObjId($user_id,false);
}
if ($this->user === false)
{
$this->user =& $ilUser;
$ilErr->raiseError($lng->txt("info_err_user_not_exist"),$ilErr->MESSAGE);
}
}
// get all user roles and all valid roles in scope
$this->user_roles = $rbacreview->assignedRoles($this->user->getId());
$this->global_roles = $rbacreview->getGlobalRoles();
$this->valid_roles = $rbacreview->getParentRoleIds($this->object->getRefId());
$this->assigned_valid_roles = $this->getAssignedValidRoles();
$this->getPermissionInfo();
$this->getRoleAssignmentInfo();
$this->getObjectSummary();
}
Here is the call graph for this function:| ilObjectStatusGUI::$cmd |
Definition at line 40 of file class.ilObjectStatusGUI.php.
Referenced by getObjectSummary().
| ilObjectStatusGUI::$ctrl |
Definition at line 42 of file class.ilObjectStatusGUI.php.
| ilObjectStatusGUI::$cur_ref_id |
Definition at line 39 of file class.ilObjectStatusGUI.php.
| ilObjectStatusGUI::$ilias |
Definition at line 35 of file class.ilObjectStatusGUI.php.
Referenced by getObjectSummary(), and ilObjectStatusGUI().
| ilObjectStatusGUI::$lng |
Definition at line 34 of file class.ilObjectStatusGUI.php.
Referenced by __setTableGUIBasicData(), __showObjectSummaryTable(), __showPermissionsTable(), __showRolesTable(), getObjectSummary(), getPermissionInfo(), getRoleAssignmentInfo(), and ilObjectStatusGUI().
| ilObjectStatusGUI::$mode |
Definition at line 41 of file class.ilObjectStatusGUI.php.
| ilObjectStatusGUI::$rbacsystem |
Definition at line 38 of file class.ilObjectStatusGUI.php.
| ilObjectStatusGUI::$tpl |
Definition at line 36 of file class.ilObjectStatusGUI.php.
Referenced by __showObjectSummaryTable(), __showPermissionsTable(), and __showRolesTable().
| ilObjectStatusGUI::$tree |
Definition at line 37 of file class.ilObjectStatusGUI.php.
Referenced by getRoleAssignmentInfo().
1.7.1