本文整理汇总了PHP中Roles::getAllRoles方法的典型用法代码示例。如果您正苦于以下问题:PHP Roles::getAllRoles方法的具体用法?PHP Roles::getAllRoles怎么用?PHP Roles::getAllRoles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Roles
的用法示例。
在下文中一共展示了Roles::getAllRoles方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Calendar
case 'availableCalendars':
G::LoadClass('calendar');
$calendar = new Calendar();
$calendarObj = $calendar->getCalendarList(true, true);
$oData[] = array('CALENDAR_UID' => '', 'CALENDAR_NAME' => '- None -');
foreach ($calendarObj['array'] as $rowid => $row) {
if ($rowid > 0) {
$oData[] = array('CALENDAR_UID' => $row['CALENDAR_UID'], 'CALENDAR_NAME' => $row['CALENDAR_NAME']);
}
}
print G::json_encode($oData);
break;
case 'rolesList':
require_once PATH_RBAC . "model/Roles.php";
$roles = new Roles();
$rolesData = $roles->getAllRoles();
foreach ($rolesData as $rowid => $row) {
$oData[] = array('ROL_UID' => $row['ROL_CODE'], 'ROL_CODE' => $row['ROL_NAME']);
}
print G::json_encode($oData);
break;
case 'saveUser':
try {
$form = $_POST;
if (isset($_POST['USR_UID'])) {
$form['USR_UID'] = $_POST['USR_UID'];
} else {
$form['USR_UID'] = '';
}
if (!isset($form['USR_NEW_PASS'])) {
$form['USR_NEW_PASS'] = '';
示例2: systemrolesAction
/** List all roles held on system
*/
public function systemrolesAction()
{
$roles = new Roles();
$this->view->roles = $roles->getAllRoles();
}