本文整理汇总了PHP中Roles::get_users_with_idrole方法的典型用法代码示例。如果您正苦于以下问题:PHP Roles::get_users_with_idrole方法的具体用法?PHP Roles::get_users_with_idrole怎么用?PHP Roles::get_users_with_idrole使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Roles
的用法示例。
在下文中一共展示了Roles::get_users_with_idrole方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
$role_detail = $do_role->get_role_detail($idrole);
if (count($role_detail) > 0) {
$allow_role_delete = true;
} else {
$msg = _('The role you are trying to delete does not exist !');
}
}
if ($allow_role_delete === false) {
echo '<div class="alert alert-error alert-block" style="height:100px;margin-top:20px;margin-left:200px;margin-right:200px;">';
echo '<h4>';
echo _('Delete not allowed !');
echo '</h4>';
echo $msg;
echo '</div>';
} elseif ($allow_role_delete === true) {
$users = $do_role->get_users_with_idrole($idrole);
if ($users === false) {
echo '<div class="alert alert-info">';
echo _('There is no user associated with this role, so you can delete the role without having to transfer any data');
echo '</div>';
} else {
echo '<div class="alert alert-info">';
echo _('Following users are associated with the role you are trying to delete, please assign a different role to these users before delting the role.');
echo '<br />';
foreach ($users as $users) {
echo '- ' . $users["user_name"] . '( ' . $users["full_name"] . ' )<br />';
}
echo '</div>';
}
$e_del = new Event("Roles->eventDeleteRole");
$e_del->addParam("idrole", $idrole);