quickedit.php
168 lines
| 1 | <?php |
| 2 | /** |
| 3 | * See public inline_edit method of WP_Posts_List_Table class |
| 4 | */ |
| 5 | $post_type_object = get_post_type_object( 'page' ); |
| 6 | $can_publish = current_user_can( $post_type_object->cap->publish_posts ); |
| 7 | ?> |
| 8 | |
| 9 | <form method="get" action=""> |
| 10 | <div class="form-interior"> |
| 11 | <h3><?php _e('Quick Edit', 'nestedpages'); ?></h3> |
| 12 | |
| 13 | <div class="np-quickedit-error" style="clear:both;display:none;"></div> |
| 14 | |
| 15 | <div class="fields"> |
| 16 | |
| 17 | <div class="left"> |
| 18 | |
| 19 | <div class="form-control"> |
| 20 | <label><?php _e( 'Title' ); ?></label> |
| 21 | <input type="text" name="post_title" class="np_title" value="" /> |
| 22 | </div> |
| 23 | <div class="form-control"> |
| 24 | <label><?php _e( 'Slug' ); ?></label> |
| 25 | <input type="text" name="post_name" class="np_slug" value="" /> |
| 26 | </div> |
| 27 | <div> |
| 28 | <label><?php _e( 'Date' ); ?></label> |
| 29 | <div class="dates"><?php touch_time( 1, 1, 0, 1 ); ?></div> |
| 30 | </div> |
| 31 | |
| 32 | <?php |
| 33 | $authors_dropdown = ''; |
| 34 | if ( is_super_admin() || current_user_can( $post_type_object->cap->edit_others_posts ) ) : |
| 35 | $users_opt = array( |
| 36 | 'hide_if_only_one_author' => false, |
| 37 | 'who' => 'authors', |
| 38 | 'name' => 'post_author', |
| 39 | 'id' => 'post_author', |
| 40 | 'class'=> 'authors', |
| 41 | 'multi' => 1, |
| 42 | 'echo' => 0 |
| 43 | ); |
| 44 | |
| 45 | if ( $authors = wp_dropdown_users( $users_opt ) ) : |
| 46 | $authors_dropdown = '<div class="form-control np_author"><label>' . __( 'Author' ) . '</label>'; |
| 47 | $authors_dropdown .= $authors; |
| 48 | $authors_dropdown .= '</div>'; |
| 49 | endif; |
| 50 | echo $authors_dropdown; |
| 51 | endif; |
| 52 | ?> |
| 53 | |
| 54 | <div class="form-control"> |
| 55 | <label><?php _e( 'Status' ); ?></label> |
| 56 | <select name="_status" class="np_status"> |
| 57 | <?php if ( $can_publish ) : ?> |
| 58 | <option value="publish"><?php _e( 'Published' ); ?></option> |
| 59 | <option value="future"><?php _e( 'Scheduled' ); ?></option> |
| 60 | <?php endif; ?> |
| 61 | <option value="pending"><?php _e( 'Pending Review' ); ?></option> |
| 62 | <option value="draft"><?php _e( 'Draft' ); ?></option> |
| 63 | </select> |
| 64 | </div> |
| 65 | |
| 66 | </div><!-- .left --> |
| 67 | |
| 68 | <div class="right"> |
| 69 | <div class="form-control"> |
| 70 | <label><?php _e( 'Template' ); ?></label> |
| 71 | <select name="page_template" class="np_template"> |
| 72 | <option value="default"><?php _e( 'Default Template' ); ?></option> |
| 73 | <?php page_template_dropdown() ?> |
| 74 | </select> |
| 75 | </div> |
| 76 | <div class="comments"> |
| 77 | <label> |
| 78 | <input type="checkbox" name="comment_status" class="np_cs" value="open" /> |
| 79 | <span class="checkbox-title"><?php _e( 'Allow Comments' ); ?></span> |
| 80 | </label> |
| 81 | </div> |
| 82 | |
| 83 | <?php if ( current_user_can('edit_theme_options') ) : ?> |
| 84 | <div class="comments"> |
| 85 | <label> |
| 86 | <input type="checkbox" name="nested_pages_status" class="np_status" value="hide" /> |
| 87 | <span class="checkbox-title"><?php _e( 'Hide in Nested Pages' ); ?></span> |
| 88 | </label> |
| 89 | </div> |
| 90 | <?php endif; // Edit theme options?> |
| 91 | |
| 92 | <?php if ( current_user_can('edit_theme_options') ) : // Menu Options Button ?> |
| 93 | <div class="form-control"> |
| 94 | <a href="#" class="np-btn np-toggle-menuoptions"><?php _e('Menu Options', 'nestedpages'); ?></a> |
| 95 | </div> |
| 96 | <?php endif; ?> |
| 97 | |
| 98 | <?php if ( !empty($this->h_taxonomies) ) : ?> |
| 99 | <div class="form-control"> |
| 100 | <a href="#" class="np-btn np-toggle-taxonomies"><?php _e('Edit Taxonomies', 'nestedpages'); ?></a> |
| 101 | </div> |
| 102 | <?php endif; ?> |
| 103 | |
| 104 | </div><!-- .right --> |
| 105 | |
| 106 | <?php if ( !empty($this->h_taxonomies) ) : ?> |
| 107 | <div class="np-taxonomies"> |
| 108 | <?php foreach ( $this->h_taxonomies as $taxonomy ) : ?> |
| 109 | <div class="np-taxonomy"> |
| 110 | <span class="title"><?php echo esc_html( $taxonomy->labels->name ) ?></span> |
| 111 | <input type="hidden" name="<?php echo ( $taxonomy->name == 'category' ) ? 'post_category[]' : 'tax_input[' . esc_attr( $taxonomy->name ) . '][]'; ?>" value="0" /> |
| 112 | <ul class="cat-checklist <?php echo esc_attr( $taxonomy->name )?>-checklist"> |
| 113 | <?php wp_terms_checklist( null, array( 'taxonomy' => $taxonomy->name ) ) ?> |
| 114 | </ul> |
| 115 | </div><!-- .np-taxonomy --> |
| 116 | <?php endforeach; ?> |
| 117 | </div><!-- .taxonomies --> |
| 118 | <?php endif; // if taxonomies ?> |
| 119 | |
| 120 | |
| 121 | <?php if ( current_user_can('edit_theme_options') ) : // Menu Options?> |
| 122 | <div class="np-menuoptions"> |
| 123 | <div class="menuoptions-left"> |
| 124 | <div class="form-control"> |
| 125 | <label><?php _e( 'Navigation Label', 'nestedpages' ); ?></label> |
| 126 | <input type="text" name="np_nav_title" class="np_nav_title" value="" /> |
| 127 | </div> |
| 128 | <div class="form-control"> |
| 129 | <label><?php _e( 'Title Attribute', 'nestedpages' ); ?></label> |
| 130 | <input type="text" name="np_title_attribute" class="np_title_attribute" value="" /> |
| 131 | </div> |
| 132 | <div class="form-control"> |
| 133 | <label><?php _e( 'CSS Classes', 'nestedpages' ); ?></label> |
| 134 | <input type="text" name="np_nav_css_classes" class="np_nav_css_classes" value="" /> |
| 135 | </div> |
| 136 | </div><!-- .menuoptions-left --> |
| 137 | <div class="menuoptions-right"> |
| 138 | <div class="form-control"> |
| 139 | <label> |
| 140 | <input type="checkbox" name="nav_status" class="np_nav_status" value="hide" /> |
| 141 | <span class="checkbox-title"><?php _e( 'Hide in Nav Menu', 'nestedpages' ); ?></span> |
| 142 | </label> |
| 143 | </div> |
| 144 | <div class="form-control"> |
| 145 | <label> |
| 146 | <input type="checkbox" name="link_target" class="link_target" value="_blank" /> |
| 147 | <span class="checkbox-title"><?php _e( 'Open link in new window', 'nestedpages' ); ?></span> |
| 148 | </label> |
| 149 | </div> |
| 150 | </div><!-- .menuoptions-right --> |
| 151 | </div> |
| 152 | <?php endif; ?> |
| 153 | |
| 154 | </div><!-- .fields --> |
| 155 | |
| 156 | </div><!-- .form-interior --> |
| 157 | |
| 158 | <div class="buttons"> |
| 159 | <input type="hidden" name="post_id" class="np_id" value="<?php echo get_the_id(); ?>"> |
| 160 | <a accesskey="c" href="#inline-edit" class="button-secondary alignleft np-cancel-quickedit"> |
| 161 | <?php _e( 'Cancel' ); ?> |
| 162 | </a> |
| 163 | <a accesskey="s" href="#inline-edit" class="button-primary np-save-quickedit alignright"> |
| 164 | <?php _e( 'Update' ); ?> |
| 165 | </a> |
| 166 | <span class="np-qe-loading"></span> |
| 167 | </div> |
| 168 | </form> |