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 }