本文整理匯總了PHP中Perms::integerToArray方法的典型用法代碼示例。如果您正苦於以下問題:PHP Perms::integerToArray方法的具體用法?PHP Perms::integerToArray怎麽用?PHP Perms::integerToArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Perms
的用法示例。
在下文中一共展示了Perms::integerToArray方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: foreach
foreach ($group_list as $groupId => $group) {
if (!isset($perm_val[$groupId])) {
$new_groups[$groupId] = $group;
}
}
} else {
/* Do not offer a text box to add new groups. */
$new_groups = false;
}
/* Set up the matrix array, break up each permission integer into an
* array. The keys of this array will be the row headers. */
$rows = array();
$matrix = array();
foreach ($perm_val as $g_id => $g_perms) {
$rows[$g_id] = isset($group_list[$g_id]) ? $group_list[$g_id] : $g_id;
$matrix[$g_id] = Perms::integerToArray($g_perms);
}
$form->addVariable(_("Group permissions"), 'g', 'matrix', false, false, null, array($cols, $rows, $matrix, $new_groups));
/* Set form title. */
$form->setTitle(Horde::img('perms.gif') . ' ' . sprintf(_("Edit permissions for '%s'"), $perms->getTitle($permission->getName())));
if ($form->validate($vars)) {
$form->getInfo($vars, $info);
/* Collapse the array for default/guest/creator. */
$info['default'] = isset($info['default'][0]) ? $info['default'][0] : null;
$info['guest'] = isset($info['guest'][0]) ? $info['guest'][0] : null;
$info['creator'] = isset($info['creator'][0]) ? $info['creator'][0] : null;
/* Update and save the permissions. */
$permission->updatePermissions($info);
$permission->save();
$notification->push(sprintf(_("Updated '%s'."), $permission->getShortName()), 'horde.success');
$url = Horde::applicationUrl('admin/perms/edit.php', true);