WordPress.org

Make WordPress Core

Changeset 1656


Ignore:
Timestamp:
09/14/2004 12:41:09 PM (17 years ago)
Author:
saxmatt
Message:

Initial functionality so level 1 users may be allowed to publish or just post drafts.

Location:
trunk/wp-admin
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-form-advanced.php

    r1631 r1656  
    6666    <fieldset id="poststatusdiv">
    6767      <legend><a href="http://wordpress.org/docs/reference/post/#post_status" title="<?php _e('Help on post status') ?>"><?php _e('Post Status') ?></a></legend>
    68       <div><label for="post_status_publish" class="selectit"><input id="post_status_publish" name="post_status" type="radio" value="publish" <?php checked($post_status, 'publish'); ?> /> <?php _e('Publish') ?></label>
     68      <div>
     69<?php if ( 2 == get_option('new_users_can_blog') && 1 != $user_level ) : ?>
     70<label for="post_status_publish" class="selectit"><input id="post_status_publish" name="post_status" type="radio" value="publish" <?php checked($post_status, 'publish'); ?> /> <?php _e('Publish') ?></label>
     71<?php endif; ?>
    6972      <label for="post_status_draft" class="selectit"><input id="post_status_draft" name="post_status" type="radio" value="draft" <?php checked($post_status, 'draft'); ?> /> <?php _e('Draft') ?></label>
    7073      <label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="radio" value="private" <?php checked($post_status, 'private'); ?> /> <?php _e('Private') ?></label></div>
     
    143146if ('publish' != $post_status || 0 == $post_ID) {
    144147?>
     148<?php if ( 2 == get_option('new_users_can_blog') && 1 != $user_level ) : ?>
    145149    <input name="publish" type="submit" id="publish" tabindex="10" value="<?php _e('Publish') ?>" />
     150<?php endif; ?>
    146151<?php
    147152}
  • trunk/wp-admin/edit-form.php

    r1651 r1656  
    11
    22<div class="wrap">
    3 <?php
    4 $form_action = 'post';
    5 $form_extra = '';
    6 
    7 $form_pingback = '<input type="hidden" name="post_pingback" value="1" id="post_pingback" />';
    8 
    9 $form_trackback = '<p><label for="trackback">' . sprintf(__('<a href="%s" title="Help on trackbacks"><strong>TrackBack</strong> a <abbr title="Universal Resource Identifier">URI</abbr></a>:</label> (Separate multiple <abbr title="Universal Resource Identifier">URI</abbr>s with spaces.)<br />'), 'http://wordpress.org/docs/reference/post/#trackback') .
    10     '<input type="text" name="trackback_url" style="width: 360px" id="trackback" tabindex="7" /></p>';
    11 
    12 
    13 $saveasdraft = '';
    14 
    15 
    16 ?>
    173
    184<form name="post" action="post.php" method="post" id="simple">
    195
    20 <?php
    21 if (isset($mode) && 'bookmarklet' == $mode) {
    22     echo '<input type="hidden" name="mode" value="bookmarklet" />';
    23 }
    24 ?>
     6<?php if (isset($mode) && 'bookmarklet' == $mode) : ?>
     7<input type="hidden" name="mode" value="bookmarklet" />
     8<?php endif; ?>
    259<input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" />
    26 <input type="hidden" name="action" value='<?php echo $form_action . $form_extra ?>' />
     10<input type="hidden" name="action" value='post' />
    2711
    2812<script type="text/javascript">
     
    6751</script>
    6852
    69 <?php echo $form_pingback ?>
    70 <?php echo $form_trackback; ?>
     53<input type="hidden" name="post_pingback" value="1" id="post_pingback" />
     54
     55<p><label for="trackback"> <?php printf(__('<a href="%s" title="Help on trackbacks"><strong>TrackBack</strong> a <abbr title="Universal Resource Identifier">URI</abbr></a>:</label> (Separate multiple <abbr title="Universal Resource Identifier">URI</abbr>s with spaces.)<br />'), 'http://wordpress.org/docs/reference/post/#trackback') ?>
     56    <input type="text" name="trackback_url" style="width: 360px" id="trackback" tabindex="7" /></p>
    7157
    7258<p class="submit"><input name="saveasdraft" type="submit" id="saveasdraft" tabindex="9" value="<?php _e('Save as Draft') ?>" />
    73   <input name="saveasprivate" type="submit" id="saveasprivate" tabindex="10" value="<?php _e('Save as Private') ?>" />
     59  <input name="saveasprivate" type="submit" id="saveasprivate" tabindex="10" value="<?php _e('Save as Private') ?>" />
     60
     61<?php if ( 1 < $user_level || (1 == $user_level && 2 == get_option('new_users_can_blog')) ) : ?>
    7462  <input name="publish" type="submit" id="publish" tabindex="6" style="font-weight: bold;" value="<?php _e('Publish') ?>" />
    75   <?php if ('bookmarklet' != $mode) {
     63<?php endif; ?>
     64
     65<?php if ('bookmarklet' != $mode) {
    7666      echo '<input name="advanced" type="submit" id="advancededit" tabindex="7" value="' .  __('Advanced Editing &raquo;') . '" />';
    7767  } ?>
    7868  <input name="referredby" type="hidden" id="referredby" value="<?php if (isset($_SERVER['HTTP_REFERER'])) echo urlencode($_SERVER['HTTP_REFERER']); ?>" />
    7969</p>
    80 <?php do_action('edit_form', ''); ?>
     70
     71<?php do_action('simple_edit_form', ''); ?>
     72
    8173</div>
    8274</form>
  • trunk/wp-admin/options-general.php

    r1632 r1656  
    4848  <form name="form1" method="post" action="options.php">
    4949    <input type="hidden" name="action" value="update" />
    50     <input type="hidden" name="action" value="update" /> <input type="hidden" name="page_options" value="'blogname','blogdescription','siteurl','admin_email','users_can_register','new_users_can_blog','gmt_offset','date_format','time_format','home','start_of_week'" />
     50    <input type="hidden" name="action" value="update" /> <input type="hidden" name="page_options" value="'blogname','blogdescription','siteurl','admin_email','users_can_register','gmt_offset','date_format','time_format','home','start_of_week'" />
    5151    <table width="100%" cellspacing="2" cellpadding="5" class="editform">
    5252      <tr valign="top">
     
    7979          <input name="users_can_register" type="checkbox" id="users_can_register" value="1" <?php checked('1', get_settings('users_can_register')); ?> />
    8080          <?php _e('Anyone can register') ?></label>
    81           <br />
    82           <label for="new_users_can_blog">
    83           <input name="new_users_can_blog" type="checkbox" id="new_users_can_blog" value="1" <?php checked('1', get_settings('new_users_can_blog')); ?> />
    84           <?php _e('Newly registered members can publish articles') ?> </label></td>
     81</td>
    8582      </tr>
    8683    </table>
  • trunk/wp-admin/options-writing.php

    r1599 r1656  
    4949  <form name="form1" method="post" action="options.php">
    5050    <input type="hidden" name="action" value="update" />
    51     <input type="hidden" name="page_options" value="'default_post_edit_rows','use_smilies','use_balanceTags','advanced_edit','ping_sites','mailserver_url', 'mailserver_port','mailserver_login','mailserver_pass','default_category', 'default_email_category'" />
     51    <input type="hidden" name="page_options" value="'default_post_edit_rows','use_smilies','use_balanceTags','advanced_edit','ping_sites','mailserver_url', 'mailserver_port','mailserver_login','mailserver_pass','default_category','default_email_category','new_users_can_blog'" />
    5252    <table width="100%" cellspacing="2" cellpadding="5" class="editform">
    5353      <tr valign="top">
     
    8888                </select></td>
    8989            </tr>
     90        <th scope="row"><?php _e('Newly registered members:') ?></th>
     91        <td> <label for="new_users_can_blog0"><input name="new_users_can_blog" id="new_users_can_blog0" type="radio" value="0" <?php checked('0', get_settings('new_users_can_blog')); ?> /> <?php _e('Cannot write articles') ?></label><br />
     92<label for="new_users_can_blog1"><input name="new_users_can_blog" id="new_users_can_blog1" type="radio" value="1" <?php checked('1', get_settings('new_users_can_blog')); ?> /> <?php _e('May submit drafts for review') ?></label><br />
     93<label for="new_users_can_blog2"><input name="new_users_can_blog" id="new_users_can_blog2" type="radio" value="2" <?php checked('2', get_settings('new_users_can_blog')); ?> /> <?php _e('May publish articles') ?></label><br /></td>
     94      </tr>
    9095    </table>
    9196    <fieldset class="options">
     
    130135                </select></td>
    131136            </tr>
    132             </table>
     137        </table>
    133138        </fieldset>
    134139    <p class="submit">
  • trunk/wp-admin/post.php

    r1644 r1656  
    6767
    6868        if (empty($post_status)) $post_status = 'draft';
     69        // Double-check
     70        if ( 'publish' == $post_status && 1 == $user_level && 2 != get_option('new_users_can_blog') )
     71            $post_status = 'draft';
    6972        $comment_status = $_POST['comment_status'];
    7073        if (empty($comment_status)) $comment_status = get_settings('default_comment_status');
     
    323326   
    324327    if (isset($_POST['publish'])) $post_status = 'publish';
     328    // Double-check
     329    if ( 'publish' == $post_status && 1 == $user_level && 2 != get_option('new_users_can_blog') )
     330        $post_status = 'draft';
    325331
    326332    if (($user_level > 4) && (!empty($_POST['edit_date']))) {
Note: See TracChangeset for help on using the changeset viewer.