function display_date_limit_inputs($role_duration = true, $content_date_limits = true) { echo ' <div id="poststuff" class="metabox-holder"> <div id="post-body"> <div id="post-body-content" class="rs-date-limit-inputs"> '; if ($role_duration || $content_date_limits && scoper_get_option('display_hints')) { if (scoper_get_option('display_hints')) { echo '<div class="rs-optionhint" style="margin: 0 0 1em 2em">'; if ($role_duration) { _e("Role Duration specifies the time period in which a role is active.", 'scoper'); echo ' '; } if ($content_date_limits) { _e("Content Date Limits narrow the content which the role applies to.", 'scoper'); } echo '<br />'; echo '</div>'; } } if ($role_duration) { echo '<div style="margin: 0 0 1em 2em">'; if (!empty($_POST['set_role_duration'])) { $checked = "checked='checked'"; $hide_class = ''; } else { $checked = ''; $hide_class = " hide-if-js"; } $js_call = "agp_display_if('role_duration_inputs', 'set_role_duration')"; echo "<label for='set_role_duration'><input type='checkbox' id='set_role_duration' name='set_role_duration' value='1' {$checked} onclick=\"{$js_call}\" /><strong>"; _e('Modify Role Duration', 'scoper'); echo '</strong></label><br />'; echo "<ul class='rs-list_horiz rs-role_date_entry{$hide_class}' id='role_duration_inputs'>"; // TODO: make these horizontal li echo '<li>'; _e('Grant Role on:', 'scoper'); ScoperAdminBulkLib::display_touch_time('', '', 'start_date_gmt_'); echo '</li>'; echo '<li>'; _e('Expire Role on:', 'scoper'); ScoperAdminBulkLib::display_touch_time('', '', 'end_date_gmt_'); echo '</li>'; echo '</ul>'; echo '</div>'; // jQuery to hide the show/hide the date selection UI based on "Keep current setting" checkbox toggle ?> <script type="text/javascript"> /* <![CDATA[ */ jQuery(document).ready( function($) { <?php foreach (array('start_date_gmt', 'end_date_gmt', 'content_min_date_gmt', 'content_max_date_gmt') as $topic) { ?> $('#<?php echo $topic; ?> _keep-timestamp').click(function() { if ( $('#<?php echo $topic; ?> _keep-timestamp').attr( 'checked' ) ) { $('#<?php echo $topic; ?> _timestamp_ui').hide(); } else { $('#<?php echo $topic; ?> _timestamp_ui').show(); } }); <?php } ?> }); /* ]]> */ </script> <?php } if ($content_date_limits) { echo '<div style="margin: 0 0 1em 2em">'; if (!empty($_POST['set_content_date_limits'])) { $checked = "checked='checked'"; $hide_class = ''; } else { $checked = ''; $hide_class = " hide-if-js"; } $js_call = "agp_display_if('role_date_limit_inputs', 'set_content_date_limits')"; echo "<label for='set_content_date_limits'><input type='checkbox' id='set_content_date_limits' name='set_content_date_limits' value='1' {$checked} onclick=\"{$js_call}\" /><strong>"; _e('Modify Content Date Limits', 'scoper'); echo '</strong></label>'; echo "<ul class='rs-list_horiz rs-role_date_entry{$hide_class}' id='role_date_limit_inputs'>"; echo '<li>'; _e('Min Content Date:', 'scoper'); ScoperAdminBulkLib::display_touch_time('', '', 'content_min_date_gmt_'); echo '</li>'; echo '<li>'; _e('Max Content Date:', 'scoper'); ScoperAdminBulkLib::display_touch_time('', '', 'content_max_date_gmt_'); echo '</li>'; echo '</ul>'; echo '</div>'; } if ($role_duration || $content_date_limits && scoper_get_option('display_hints')) { if (scoper_get_option('display_hints')) { echo '<div class="rs-optionhint" style="margin: 2em 0 1em 2em">'; _e('This controls what limits to apply to the User / Group roles you select for creation or modification. <strong>Currently stored limits</strong> are indicated by a dotted border around the User or Group name. For details, hover over the name or view the User or Group Profile.', 'scoper'); echo '</div>'; } } echo ' </div> </div> </div> '; }