<?php echo '<br /><h3>2. '; //printf( _ x('Select %s to Modify', 'Users or Groups', 'scoper'), $agent_caption_plural ); printf(__('Select %s to Modify', 'scoper'), $agent_caption_plural); echo '</h3>'; $args = array('suppress_extra_prefix' => true, 'filter_threshold' => 20, 'default_hide_threshold' => 20, 'check_for_incomplete_submission' => true); require_once dirname(__FILE__) . '/agents_checklist_rs.php'; ScoperAgentsChecklist::all_agents_checklist($role_bases, $agents, $args); echo '<p style="clear:both"></p>'; //=================== end users/groups selection display ==================== echo '<hr /><br />'; if ($duration_limits_enabled || $content_date_limits_enabled) { echo '<h3 style="margin-bottom: 0">3. '; _e('Set Role Duration and/or Content Date Limits (optional)', 'scoper'); echo '</h3>'; ScoperAdminBulkLib::display_date_limit_inputs($duration_limits_enabled, $content_date_limits_enabled); echo '<br /><h3>4. '; } else { echo '<br /><h3>3. '; } _e('Select Roles to Assign / Remove', 'scoper'); echo '</h3>'; echo "<a href='javascript:void(0);' onclick=\"agp_check_by_name('roles[]', true, false, true);\">"; _e('select all roles', 'scoper'); echo "</a> | "; echo "<a href='javascript:void(0);' onclick=\"agp_check_by_name('roles[]', '', false, true);\">"; _e('unselect all roles', 'scoper'); echo '</a> | '; if (in_array(ROLE_BASIS_USER, $role_bases)) { echo "<a href='javascript:void(0);' onclick=\"agp_setcss('.user-csv','display','none');\">"; _e('hide users', 'scoper');
function display_inputs($mode, $assignment_modes, $args = array()) { $defaults = array('role_bases' => '', 'agents' => '', 'agent_caption_plural' => '', 'max_scopes' => array(), 'scope' => '', 'src_or_tx_name' => ''); $args = array_merge($defaults, (array) $args); extract($args); global $scoper; echo "<br /><a name='scoper_submit'></a>"; echo '<ul class="rs-list_horiz"><li style="float:left;"><h3>1. '; if (ROLE_ASSIGNMENT_RS == $mode) { $msg = __('Select Assignment Mode', 'scoper'); echo "{$msg}</h3></li>"; if (OBJECT_SCOPE_RS == $scope) { $src = $scoper->data_sources->get($src_or_tx_name); $date_col_defined = !empty($src->cols->date); } elseif (TERM_SCOPE_RS == $scope) { $tx = $scoper->taxonomies->get($src_or_tx_name); $date_col_defined = $scoper->data_sources->member_property($tx->object_source, 'cols', 'date'); } else { $date_col_defined = true; } $duration_limits_enabled = $date_col_defined && scoper_get_option('role_duration_limits'); $content_date_limits_enabled = OBJECT_SCOPE_RS != $scope && $date_col_defined && scoper_get_option('role_content_date_limits'); $num = $duration_limits_enabled || $content_date_limits_enabled ? 5 : 4; } else { $msg = __('Select Restriction Mode', 'scoper'); echo "{$msg}</h3></li>"; $num = 3; $duration_limits_enabled = $content_date_limits_enabled = false; } echo "<li style='float:right;'><h3>{$num}. "; _e('Review and Submit', 'scoper'); echo '</h3></li>'; echo '</ul>'; ?> <ul class="rs-list_horiz"> <?php if (ROLE_RESTRICTION_RS == $mode) { echo '<li>'; echo '<select id="max_scope" name="max_scope">'; $retain_value = isset($_POST["max_scope"]) ? $_POST["max_scope"] : ''; foreach ($max_scopes as $max_scope => $caption) { $selected = $status_id === $retain_value ? 'selected="selected"' : ''; echo "<option value='{$max_scope}' {$selected}>{$caption}</option>"; } echo '</select></li>'; } ?> <li style="margin-left:0.5em"> <?php $for_name = ROLE_ASSIGNMENT_RS == $mode ? 'assign_for' : 'require_for'; echo "<select id='{$for_name}' name='{$for_name}'>"; $retain_value = isset($_POST[$for_name]) ? $_POST[$for_name] : 0; foreach ($assignment_modes as $status_id => $caption) { $selected = $status_id === $retain_value ? 'selected="selected"' : ''; echo "<option value='{$status_id}' {$selected}>{$caption}</option>"; } echo '</select>'; ?> </li><li style='margin: 0 0.25em 0.25em 0.5em;padding-top:0.35em;'> </li> <li style='float:right;margin: 0 0.25em 0.25em 0.25em;'><span class="submit" style="border:none;"> <input type="submit" name="rs_submit" class="button-primary" value="<?php _e('Update »', 'scoper'); ?> " /> </span></li> </ul> <p style="clear:both"></p> <?php if (ROLE_ASSIGNMENT_RS == $mode) { echo '<br /><h3>2. '; //printf( _ x('Select %s to Modify', 'Users or Groups', 'scoper'), $agent_caption_plural ); printf(__('Select %s to Modify', 'scoper'), $agent_caption_plural); echo '</h3>'; $args = array('suppress_extra_prefix' => true, 'filter_threshold' => 20, 'default_hide_threshold' => 20, 'check_for_incomplete_submission' => true); require_once dirname(__FILE__) . '/agents_checklist_rs.php'; ScoperAgentsChecklist::all_agents_checklist($role_bases, $agents, $args); echo '<p style="clear:both"></p>'; echo '<hr />'; } //=================== end users/groups and assignment mode selection display ==================== if ($duration_limits_enabled || $content_date_limits_enabled) { echo '<br /><h3 style="margin-bottom: 0">3. '; _e('Set Role Duration and/or Content Date Limits (optional)', 'scoper'); echo '</h3>'; ScoperAdminBulkLib::display_date_limit_inputs($duration_limits_enabled, $content_date_limits_enabled); } if (ROLE_ASSIGNMENT_RS == $mode) { $num = $duration_limits_enabled || $content_date_limits_enabled ? 4 : 3; echo "<br /><h3>{$num}. "; $msg = __('Select Roles to Assign / Remove', 'scoper'); echo "{$msg}</h3>"; } else { $num = 2; echo "<br /><h3>{$num}. "; $msg = __('Select Roles to Modify', 'scoper'); echo "{$msg}</h3>"; } }