本文整理汇总了PHP中Groups::get_groups方法的典型用法代码示例。如果您正苦于以下问题:PHP Groups::get_groups方法的具体用法?PHP Groups::get_groups怎么用?PHP Groups::get_groups使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Groups
的用法示例。
在下文中一共展示了Groups::get_groups方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: group_access_restrictions
function group_access_restrictions($group_access = false)
{
$groups = Groups::get_groups();
?>
<div>
<table style="width:600px">
<tr>
<td><label>Access levels:</label></td>
<td colspan="4">
<ul id="access_levels">
<?php
if ($group_access) {
?>
<?php
foreach ($group_access as $group_id => $extra) {
?>
<?php
$group = Groups::get_group($group_id);
?>
<li id="<?php
echo $group_id;
?>
"><span><?php
echo $group['name'];
?>
: </span><span><?php
echo $extra['sites'];
?>
</span>
<input type="hidden"
name="access_levels[<?php
echo $group_id;
?>
][group_id]"
value="<?php
echo $group_id;
?>
" /> <input type="hidden"
name="access_levels[<?php
echo $group_id;
?>
][sites]"
value="<?php
echo $extra['sites'];
?>
" /> <a href="#"
onclick="removeAccesssLevel('<?php
echo $group_id;
?>
')">(x)</a></li>
<?php
}
?>
<?php
}
?>
</ul>
</td>
</tr>
<tr>
<td><label
style="width: 50px; display: block; float: left; font-weight: bold;">Group:</label>
</td>
<td>
<select id="group_access" name="group_access"
style="float: left; margin-right: 20px">
<?php
foreach ($groups as $group => $extra) {
?>
<option value="<?php
echo esc_attr($group);
?>
"><?php
echo esc_html(trim($extra['name']));
?>
</option>
<?php
}
?>
</select>
</td>
<td>
<label style="width: 130px; display: block; float: left; font-weight: bold;">Number
of sites:</label>
</td>
<td>
<input id="group_register_sites" value="" type="text"
size="5" style="width: 30px" /> (*=unlimited)
</td><td> <input type="button"
name="add_access" class="button-secondary"
value="<?php
_e('Add access', 'crusheddirectory');
?>
"
onclick="add_access_level()" /></td>
</tr>
</table>
</div>
<?php
}