本文整理汇总了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);