form.php
1.23 KB
<?php
if (!isset($selected)) {
throw new UnderflowException('Current Page Permission settings not provided');
}
$opt_selected = $selected[PagePermissions::ELE_SEL];
?>
<select id="<?php echo PagePermissions::ELE_SEL; ?>" name="<?php echo PagePermissions::ELE_SEL; ?>">
<option value="<?php echo PagePermissions::OPT_ALL . '"' . (PagePermissions::OPT_ALL == $opt_selected ? ' selected' : ''); ?>>Anyone</option>
<option value="<?php echo PagePermissions::OPT_AUTH . '"' . (PagePermissions::OPT_AUTH == $opt_selected ? ' selected' : ''); ?>>Must be Logged In</option>
<option value="<?php echo PagePermissions::OPT_CUST . '"' . (PagePermissions::OPT_CUST == $opt_selected ? ' selected' : ''); ?>>Specific Roles</option>
</select>
<div id="TzSpecific">
<?php
$rc = new WP_Roles();
$roles = $rc->role_names;
ksort($roles);
unset($rc, $roles['administrator']);
foreach ($roles as $key => $display) {
$checked = (isset($selected[PagePermissions::ELE_CUST][$key]) ? ' checked' : '');
echo '<br /><input type="checkbox" id="' . $key . '" name="' . PagePermissions::ELE_CUST . '[' . $key . ']" value="1"' . $checked . ' />';
echo '<label for="' . $key . '">' . $display . '</label>';
}
?>
</div>