本文整理汇总了PHP中RBAC::getFileGroupAccessList方法的典型用法代码示例。如果您正苦于以下问题:PHP RBAC::getFileGroupAccessList方法的具体用法?PHP RBAC::getFileGroupAccessList怎么用?PHP RBAC::getFileGroupAccessList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RBAC
的用法示例。
在下文中一共展示了RBAC::getFileGroupAccessList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAname
public function getAname($authId)
{
import('@.ORG.RBAC');
$groupList = RBAC::getFileGroupAccessList();
// 查询菜单分组
$model = M("group");
//管理员排除验证
if (!isset($_SESSION['a'])) {
$map['status'] = 1;
if ($groupList) {
$map['id'] = array(" in ", $groupList);
} else {
$map['id'] = 0;
}
} else {
$map['status'] = array('gt', 0);
}
$list = $model->where($map)->order("sorts asc")->select();
$pModel = D("Public");
$nlist = array();
foreach ($list as $key => $val) {
$nlist[$val['id']] = $pModel->menuLeftTree($val['id']);
}
return $nlist;
}
示例2: getSysGroupList
/**
* @Title: getSysGroupList
* @Description: todo(生成系统首页菜单分组方法)
* @author liminggang
* @date 2014-8-29 上午10:56:35
* @throws
*/
public function getSysGroupList()
{
$pannels = "";
// 实例化换成模型
$mMisRuntimeData = D('MisRuntimeData');
// 从当前登录用户获取group的换成
$pannels = $mMisRuntimeData->getRuntimeCache("Group", 'grouplist');
if (empty($pannels)) {
import('@.ORG.RBAC');
$groupList = RBAC::getFileGroupAccessList();
// 查询菜单分组
$model = M("group");
// 管理员排除验证
if (!isset($_SESSION['a'])) {
$map['status'] = 1;
if ($groupList) {
$map['id'] = array(" in ", $groupList);
} else {
$map['id'] = 0;
}
} else {
$map['status'] = array('gt', 0);
}
$list = $model->where($map)->order("sorts asc")->select();
if (isset($_SESSION[C('USER_AUTH_KEY')])) {
$i = 0;
$h .= "<ul class=\"clearfix\">";
foreach ($list as $k => $v) {
$i++;
$h .= "<li>";
$sysh = "<li class=\"mainlist\">";
if (!$v["icon"]) {
$v["icon"] = "appbtn_61.png";
}
if ($v['indexlink']) {
//$h .= "<a href='__APP__/Public/nvigateTO/groupid/" . $v ["id"] . "' target='navTab' rel='" . $v ["name"] . "'>";
$h .= "<a href='__APP__/Common/nvigateTO/groupid/" . $v["id"] . "' target='navTab' rel='" . $v["name"] . "'>";
//$sysh .= '<a href="#" url="__APP__/Public/nvigateTO/id/' . $v ["id"] . '" targets="navTab" rel="' . $v ["name"] . '" title="' . $v ["name"] . '"><img alt="' . $v ["name"] . '" height="64" src="__PUBLIC__/Images/xyicon/' . $v ["icon"] . '" width="64" /><span>' . $v ["name"] . '</span></a>';
$sysh .= '<a href="#" url="__APP__/Common/nvigateTO/id/' . $v["id"] . '" targets="navTab" rel="' . $v["name"] . '" title="' . $v["name"] . '"><img alt="' . $v["name"] . '" height="64" src="__PUBLIC__/Images/xyicon/' . $v["icon"] . '" width="64" /><span>' . $v["name"] . '</span></a>';
} else {
$h .= "<a href='#'>";
$sysh .= '<a class="maina" href="#" title="' . $v["name"] . '"><img alt="' . $v["name"] . '" height="64" src="__PUBLIC__/Images/xyicon/' . $v["icon"] . '" width="64" /><span>' . $v["name"] . '</span></a>';
}
$h .= '<img alt="' . $v["title"] . '" height="32" src="__PUBLIC__/Images/xyicon/' . $v["icon"] . '" width="32" />';
$h .= "<span>" . $v["name"] . "</span></a>";
$h .= "</li>";
}
$h .= "</ul>";
if ($i > 0) {
$pannels .= $h;
}
}
// 如果pannels不为空,就写入当前用户换成中
if ($pannels) {
$mMisRuntimeData->setRuntimeCache($pannels, "Group", 'grouplist');
}
}
return $pannels;
}