sitewide = $sitewide; $this->customize_defaults = $customize_defaults; } function option_checkbox( $option_name, $tab_name, $section_name, $hint_text, $trailing_html, $args = array()) { $return = array( 'in_scope' => false, 'val' => '' ); if ( in_array( $option_name, $this->form_options[$tab_name][$section_name] ) ) { $this->all_options []= $option_name; $return['val'] = scoper_get_option($option_name, $this->sitewide, $this->customize_defaults); $js_clause = ( ! empty($args['js_call']) ) ? 'onclick="' . $args['js_call'] . '"' : ''; $style = ( ! empty($args['style']) ) ? $args['style'] : ''; echo "
'; echo $msg; echo '
|
|
'; _e( 'These are the default settings for options which can be adjusted per-site.', 'scoper' ); echo '
'; } else $color_class = 'rs-backtan'; $class_selected = "agp-selected_agent agp-agent $color_class"; $class_unselected = "agp-unselected_agent agp-agent"; // todo: prevent line breaks in these links $js_call = "agp_swap_display('rs-features', 'rs-realm', 'rs_show_features', 'rs_show_realm', '$class_selected', '$class_unselected');"; $js_call .= "agp_swap_display('', 'rs-roledefs', '', 'rs_show_roledefs', '$class_selected', '$class_unselected');"; $js_call .= "agp_swap_display('', 'rs-advanced', '', 'rs_show_advanced', '$class_selected', '$class_unselected');"; $js_call .= "agp_swap_display('', 'wp-roledefs', '', 'wp_show_roledefs', '$class_selected', '$class_unselected');"; $js_call .= "agp_swap_display('', 'rs-optscope', '', 'rs_show_optscope', '$class_selected', '$class_unselected');"; echo "section_captions[$tab][$section]; // --- ROLE BASIS SECTION --- ?> | option_checkbox( 'enable_group_roles', $tab, $section, $hint, '' ); $hint = ''; $ui->option_checkbox( 'enable_user_roles', $tab, $section, $hint, '' ); if ( scoper_get_option('custom_user_blogcaps', $sitewide, $customize_defaults) || ScoperAdminLib::any_custom_caps_assigned() ) { $hint = __('Some users created under older WP versions may have direct-assigned capabilities in addition to their blog-wide role assignment. This setting does not enable or block that feature, but determines whether Role Scoper must account for it. Disable when possible (capabilities unrelated to RS Role Definitions are irrelevant).', 'scoper'); $ui->option_checkbox( 'custom_user_blogcaps', $tab, $section, $hint, '' ); } ?> | ||||||
---|---|---|---|---|---|---|---|
section_captions[$tab][$section]; // --- PAGE STRUCTURE SECTION --- ?> |
all_options []= $id;
$current_setting = strval( scoper_get_option($id, $sitewide, $customize_defaults) ); // force setting and corresponding keys to string, to avoid quirks with integer keys
echo $ui->option_captions['lock_top_pages'];
$captions = array( 'author' => __('Page Authors, Editors and Administrators', 'scoper'), '' => __('Page Editors and Administrators', 'scoper'), '1' => __('Administrators', 'scoper') );
foreach ( $captions as $key => $value) {
$key = strval($key);
echo " | ||||||
section_captions[$tab][$section]; // --- USER PROFILE SECTION --- ?> | option_checkbox( 'display_user_profile_groups', $tab, $section, $hint, '' ); $hint = ''; $ui->option_checkbox( 'display_user_profile_roles', $tab, $section, $hint, '' ); ?> | ||||||
section_captions[$tab][$section]; // --- USER MANAGEMENT SECTION --- ?> | option_checkbox( 'limit_user_edit_by_level', $tab, $section, $hint, '' ); ?> | ||||||
section_captions[$tab][$section]; // --- ADMINISTRATOR DEFINITION SECTION --- ?> |
'manage_options', 'user' => 'edit_users', 'content' => 'activate_plugins' );
$name['content'] = __('Content Administrator', 'scoper');
$name['user'] = __('User Administrator', 'scoper');
$name['option'] = __('Option Administrator', 'scoper');
$descript['content'] = __('RS never applies restricting or enabling content filters', 'scoper');
$descript['user'] = __('RS allows full editing of all user groups and scoped roles / restrictions', 'scoper');
$descript['option'] = __('Can edit Role Scoper options', 'scoper');
_e( 'Role Scoper internally checks the following capabilities for content and role administration. By default, these capabilities are all contained in the Administrator role only. You can use the Capability Manager plugin to split/overlap them among different roles as desired.', 'scoper' );
echo '
';
echo( " ';
_e( 'For example, by using Capability Manager to add a custom capability such as administer_all_content to certain WordPress roles, you could mirror that setting in the SCOPER_CONTENT_ADMIN_CAP definition to ensure that those users are never content-restricted by Role Scoper.', 'scoper');
?>
define( 'SCOPER_CONTENT_ADMIN_CAP', 'your_content_capname' ); " );
echo ''; echo( " define( 'SCOPER_USER_ADMIN_CAP', 'your_user_capname' ); " );
echo ''; echo( " define( 'SCOPER_OPTION_ADMIN_CAP', 'your_option_capname' ); " );
echo ' | ||||||
section_captions[$tab][$section]; // --- LIMITED EDITING ELEMENTS SECTION --- ?> |
form_options[$tab][$section] ) ) :?>
display_hints) {
echo ('
def_otype_options[$option_name]) ) {
if ( ! $opt_vals = scoper_get_option( $option_name, $sitewide, $customize_defaults ) )
$opt_vals = array();
$opt_vals = array_merge($ui->def_otype_options[$option_name], $opt_vals);
$ui->all_otype_options []= $option_name;
$sample_ids = array();
// note: 'post:post' otype option is used for all non-page types
$sample_ids['post:post'] = ' ';
$sample_ids['post:page'] = ' ';
foreach ( $opt_vals as $src_otype => $val ) {
$id = str_replace(':', '_', $option_name . '-' . $src_otype);
$display = $scoper_admin->interpret_src_otype($src_otype, 'singular_name');
echo('');
_e('Remove Edit Form elements with these html IDs from users who do not have full editing capabilities for the post/page. Separate with ;', 'scoper');
echo ' ';
}
?>
');
echo('');
printf(__('%s Edit Form HTML IDs:', 'scoper'), $display);
?>
", '', $sample_ids[$src_otype] ); } ?> form_options[$tab][$section] ) ) : $id = 'hide_non_editor_admin_divs'; $ui->all_options []= $id; $current_setting = strval( scoper_get_option($id, $sitewide, $customize_defaults) ); // force setting and corresponding keys to string, to avoid quirks with integer keys ?>
__('no requirement', 'scoper'), '1' => __('Contributor / Author / Editor', 'scoper'), 'author' => __('Author / Editor', 'scoper'), 'editor' => __awp('Editor'), 'admin_content' => __('Content Administrator', 'scoper'), 'admin_user' => __('User Administrator', 'scoper'), 'admin_option' => __('Option Administrator', 'scoper') );
foreach ( $captions as $key => $value) {
$key = strval($key);
echo "
|
||||||
section_captions[$tab][$section]; // --- ROLE ASSIGNMENT INTERFACE SECTION --- ?> |
otype_option_checkboxes( 'limit_object_editors', $otype_caption, $tab, $section, $hint, ' ', array( 'label_property' => 'singular_name' ) ); $hint = __('In the Edit Post/Edit Page roles tabs, decorate user/group name with colors and symbols if they have the role implicitly via group, general role, category role, or a superior post/page role.', 'scoper'); $ui->option_checkbox( 'indicate_blended_roles', $tab, $section, $hint, ' ' ); $hint = __('Display introductory descriptions at the top of various role assignment / definition screens.', 'scoper'); $ui->option_checkbox( 'display_hints', $tab, $section, $hint, ' ' ); $hint = __('Accept entry of user names or IDs via comma-separated text instead of individual checkboxes.', 'scoper'); $ui->option_checkbox( 'user_role_assignment_csv', $tab, $section, $hint, '' ); ?> | ||||||
section_captions[$tab][$section]; // --- ROLE ASSIGNMENT INTERFACE SECTION --- ?> |
otype_option_checkboxes( 'restrictions_column', $otype_caption, $tab, $section, $hint, ' ' ); $otype_caption = __('Term Roles column in Edit %s listing', 'scoper'); $ui->otype_option_checkboxes( 'term_roles_column', $otype_caption, $tab, $section, $hint, ' ' ); $otype_caption = __('Object Roles column in Edit %s listing', 'scoper'); $ui->otype_option_checkboxes( 'object_roles_column', $otype_caption, $tab, $section, $hint, ' ' ); ?> | ||||||
section_captions[$tab][$section]; ?> |
$equiv_role_handle ) {
$id = "{$role_handle}_role_objscope";
$checked = ( scoper_get_option( $id, $sitewide, $customize_defaults ) ) ? "checked='checked'" : '';
echo ' ';
echo " ';
}
?>
display_hints) {
_e('By default, the above roles are not available for object-specific assignment because another role is usually equivalent. However, the distinctions may be useful if you propagate roles to sub-Pages, set Default Roles or customize RS Role Definitions.', 'scoper');
echo ''; _e('Note: Under the default configuration, the tabs labeled "Reader" in the Post/Page Edit Form actually assign the corresponding Private Reader role.', 'scoper'); } ?> |
section_captions[$tab][$section];
echo ' '; ?> |
all_options array
global $wp_taxonomies;
global $scoper_default_options;
_e('Specify which WordPress Taxonomies can have Restrictions and Roles:', 'scoper');
echo ' '; $scopes = array( 'term', 'object'); foreach ( $scopes as $scope ) { if ( 'object' == $scope ) { ?> |
---|---|
section_captions[$tab][$section]; ?> |
form_options[$tab][$section_alias] ) ) { // use_object_types follow option scope of use_term_roles
$ui->all_options []= $option_name;
if ( isset($scoper_default_options[$option_name]) ) {
if ( ! $opt_vals = scoper_get_option( $option_name, $sitewide, $customize_defaults ) )
$opt_vals = array();
$opt_vals = array_merge($scoper_default_options[$option_name], $opt_vals);
foreach ( $opt_vals as $key => $val ) {
if ( ! $key )
continue;
$id = $option_name . '-' . $key;
?>
';
printf( __( 'NOTE: Non-Administrators need a %1$sTaxonomy-specific Role assignment%2$s to manage Custom Taxonomies selected here.', 'scoper' ), $link_open, $link_close );
echo ' ';
}
} else {
if ( get_post_types( array( '_builtin' => false, 'public' => true ) ) ) {
echo '';
printf( __( 'NOTE: Non-Administrators need a %1$sType-specific Role assignment%2$s to manage Custom Post Types selected here.', 'scoper' ), $link_open, $link_close );
echo ' '; } } } // end foreach scope if ( ! defined( 'SCOPER_EARLY_INIT' ) ) { echo ' ';
_e( 'NOTE: Role Scoper is operating in late-initialization mode, for compatibility with plugins which register taxonomies or post types on the "init" hook without specifying early execution priority. If other plugins internally query posts (or post editing capabilities) on the "init" action, those results will not be filtered. In that event, find a way to register your taxonomies/post types earlier and add the following to wp-config.php:', 'scoper' );
echo ' ';
}
?>
';
echo ( " ';
echo 'define( 'SCOPER_EARLY_INIT', true );" ); echo ' |
section_captions[$tab][$section];
echo ' ( ' . __('see notes', 'scoper') . ' )'; ?> |
all_options array
global $wp_taxonomies;
_e('Specify available Term Restrictions and Roles, for each object type and taxonomy:', 'scoper');
echo ' '; _e('Note: Taxonomy Usage must also be enabled above', 'scoper'); echo ' '; $scopes = array( 'term', 'object'); foreach ( $scopes as $scope ) { if ( 'object' == $scope ) { ?> |
section_captions[$tab][$section]; ?> |
';
_e('Note: Post Type Usage must also be enabled above', 'scoper');
} else // end if loop iteration is for object scope
$section = 'term_scope';
$option_name = "use_{$scope}_roles";
if ( in_array( 'use_term_roles', $ui->form_options[$tab][$section_alias] ) ) { // use_object_roles follow option scope of use_term_roles
$ui->all_otype_options []= $option_name;
if ( isset($ui->def_otype_options[$option_name]) ) {
if ( ! $opt_vals = scoper_get_option( $option_name, $sitewide, $customize_defaults ) )
$opt_vals = array();
if ( 'use_term_roles' == $option_name ) {
foreach( array_keys( $ui->def_otype_options[$option_name] ) as $src_otype ) {
if ( isset( $opt_vals[$src_otype] ) )
$opt_vals[$src_otype] = array_merge( $ui->def_otype_options[$option_name][$src_otype], $opt_vals[$src_otype] );
else
$opt_vals[$src_otype] = $ui->def_otype_options[$option_name][$src_otype];
}
} else
$opt_vals = array_merge($ui->def_otype_options[$option_name], $opt_vals);
foreach ( $opt_vals as $src_otype => $val ) {
if ( TERM_SCOPE_RS == $scope ) {
echo ' ';
foreach( array_keys($opt_vals[$src_otype]) as $taxonomy ) {
$id = str_replace( ':', '_', $option_name . '-' . $src_otype . '-' . $taxonomy );
?>
';
} else {
$id = str_replace( ':', '_', $option_name . '-' . $src_otype );
?>
|
section_captions[$tab][$section]; ?> |
all_options array
_e('Apply Roles and Restrictions for:', 'scoper');
echo ' '; $topic = "access_types"; $opt_vals = scoper_get_option("disabled_{$topic}", $sitewide, $customize_defaults); $all = implode(',', $scoper->access_types->get_all_keys() ); echo ""; foreach ( $scoper->access_types->get_all() as $access_name => $access_type) { $id = $topic . '-' . $access_name; $val = empty( $opt_vals[$access_name] ); ?> |
data_sources->member_property($src_name, 'object_types') ) { $display_names = array(); foreach ( $object_types as $otype) $display_names[] = $otype->labels->name; $display = implode(', ', $display_names); } else { $item_label = $scoper->data_sources->member_property( $src_name, 'labels', 'name' ); $display = sprintf(__("%s data source", 'scoper'), $item_label); } return $display; } ?>