bulk-add.php
11 years ago
clone-form.php
9 years ago
delete-confirmation-modal.php
9 years ago
empty-trash-modal.php
9 years ago
link-form.php
9 years ago
more-options-modal.php
9 years ago
new-child.php
8 years ago
quickedit-link.php
8 years ago
quickedit-post.php
8 years ago
quickedit-post.php
251 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 | $wpml_pages = ( $this->integrations->plugins->wpml->installed && $this->integrations->plugins->wpml->isDefaultLanguage()) ? true : false; |
| 8 | if ( !$this->integrations->plugins->wpml->installed ) $wpml_pages = true; |
| 9 | ?> |
| 10 | |
| 11 | <form method="get" action=""> |
| 12 | <div class="form-interior"> |
| 13 | <h3><?php _e('Quick Edit'); ?><span class="page_id"></span></h3> |
| 14 | |
| 15 | <div class="np-quickedit-error" style="clear:both;display:none;"></div> |
| 16 | |
| 17 | <div class="fields"> |
| 18 | |
| 19 | <div class="left"> |
| 20 | |
| 21 | <?php if ( !array_key_exists('title', $this->disabled_standard_fields) ) : ?> |
| 22 | <div class="form-control"> |
| 23 | <label><?php _e( 'Title' ); ?></label> |
| 24 | <input type="text" name="post_title" class="np_title" value="" /> |
| 25 | </div> |
| 26 | <?php endif; ?> |
| 27 | |
| 28 | <?php if ( !array_key_exists('slug', $this->disabled_standard_fields) ) : ?> |
| 29 | <div class="form-control"> |
| 30 | <label><?php _e( 'Slug' ); ?></label> |
| 31 | <input type="text" name="post_name" class="np_slug" value="" /> |
| 32 | </div> |
| 33 | <?php endif; ?> |
| 34 | |
| 35 | <?php if ( !array_key_exists('date', $this->disabled_standard_fields) ) : ?> |
| 36 | <?php if ( $this->settings->datepickerEnabled() ) : ?> |
| 37 | <div class="form-control np-datepicker-container"> |
| 38 | <label><?php _e( 'Date' ); ?></label> |
| 39 | <div class="datetime"> |
| 40 | <input type="text" name="np_date" class="np_datepicker" value="" /> |
| 41 | <span><?php _e('@', 'wp-nested-pages'); ?></span> |
| 42 | <div class="np-time-container"> |
| 43 | <?php if ( get_option('time_format') !== 'H:i' ) : ?> |
| 44 | <select name="np_ampm" class="np_ampm"> |
| 45 | <option value="am"><?php _e('am', 'wp-nested-pages'); ?></option> |
| 46 | <option value="pm"><?php _e('pm', 'wp-nested-pages'); ?></option> |
| 47 | </select> |
| 48 | <?php endif; ?> |
| 49 | <input type="text" name="np_time" class="np_time" value="" /> |
| 50 | </div> |
| 51 | </div> |
| 52 | </div> |
| 53 | <?php else : ?> |
| 54 | <div> |
| 55 | <label><?php _e( 'Date' ); ?></label> |
| 56 | <div class="dates"><?php touch_time( 1, 1, 0, 1 ); ?></div> |
| 57 | </div> |
| 58 | <?php endif; endif; ?> |
| 59 | |
| 60 | <?php |
| 61 | /* |
| 62 | * Authors Dropdown |
| 63 | */ |
| 64 | if ( !array_key_exists('author', $this->disabled_standard_fields) ) : |
| 65 | $authors_dropdown = ''; |
| 66 | if ( is_super_admin() || current_user_can( $post_type_object->cap->edit_others_posts ) ) : |
| 67 | $users_opt = array( |
| 68 | 'hide_if_only_one_author' => false, |
| 69 | 'who' => 'authors', |
| 70 | 'name' => 'post_author', |
| 71 | 'id' => 'post_author', |
| 72 | 'class'=> 'authors', |
| 73 | 'multi' => 1, |
| 74 | 'echo' => 0 |
| 75 | ); |
| 76 | |
| 77 | if ( $authors = wp_dropdown_users( $users_opt ) ) : |
| 78 | $authors_dropdown = '<div class="form-control np_author"><label>' . __( 'Author' ) . '</label>'; |
| 79 | $authors_dropdown .= $authors; |
| 80 | $authors_dropdown .= '</div>'; |
| 81 | endif; |
| 82 | echo $authors_dropdown; |
| 83 | endif; |
| 84 | endif; |
| 85 | ?> |
| 86 | |
| 87 | <?php if ( !array_key_exists('status', $this->disabled_standard_fields) ) : ?> |
| 88 | <div class="form-control"> |
| 89 | <label><?php _e( 'Status' ); ?></label> |
| 90 | <select name="_status" class="np_status"> |
| 91 | <?php if ( $can_publish ) : ?> |
| 92 | <option value="publish"><?php _e( 'Published' ); ?></option> |
| 93 | <option value="future"><?php _e( 'Scheduled' ); ?></option> |
| 94 | <?php endif; ?> |
| 95 | <option value="pending"><?php _e( 'Pending Review' ); ?></option> |
| 96 | <option value="draft"><?php _e( 'Draft' ); ?></option> |
| 97 | </select> |
| 98 | </div> |
| 99 | <?php endif; ?> |
| 100 | |
| 101 | </div><!-- .left --> |
| 102 | |
| 103 | <div class="right"> |
| 104 | |
| 105 | <?php if ( $this->post_type->hierarchical && !array_key_exists('template', $this->disabled_standard_fields)) : ?> |
| 106 | <div class="form-control"> |
| 107 | <label><?php _e( 'Template' ); ?></label> |
| 108 | <select name="page_template" class="np_template"> |
| 109 | <option value="default"><?php _e( 'Default Template' ); ?></option> |
| 110 | <?php page_template_dropdown() ?> |
| 111 | </select> |
| 112 | </div> |
| 113 | <?php endif; ?> |
| 114 | |
| 115 | <?php if ( $can_publish && !array_key_exists('password', $this->disabled_standard_fields) ) : ?> |
| 116 | <div class="form-control password"> |
| 117 | <label><?php _e( 'Password' ); ?></label> |
| 118 | <input type="text" class="post_password" name="post_password" value="" /> |
| 119 | <div class="private"> |
| 120 | <em style="margin:2px 8px 0 0" class="alignleft"><?php _e( '–OR–' ); ?></em> |
| 121 | <label> |
| 122 | <input type="checkbox" class="keep_private" name="keep_private" value="private" /> |
| 123 | <?php echo __( 'Private' ); ?> |
| 124 | </label> |
| 125 | </div> |
| 126 | </div> |
| 127 | <?php endif; ?> |
| 128 | |
| 129 | <?php if ( !array_key_exists('allow_comments', $this->disabled_standard_fields) ) : ?> |
| 130 | <div class="comments"> |
| 131 | <label> |
| 132 | <input type="checkbox" name="comment_status" class="np_cs" value="open" /> |
| 133 | <span class="checkbox-title"><?php _e( 'Allow Comments' ); ?></span> |
| 134 | </label> |
| 135 | </div> |
| 136 | <?php endif; ?> |
| 137 | |
| 138 | <?php if ( current_user_can('edit_theme_options') && !array_key_exists('hide_in_np', $this->disabled_standard_fields) ) : ?> |
| 139 | <div class="comments"> |
| 140 | <label> |
| 141 | <input type="checkbox" name="nested_pages_status" class="nested_pages_status" value="hide" /> |
| 142 | <span class="checkbox-title"><?php _e( 'Hide in Nested Pages', 'wp-nested-pages' ); ?></span> |
| 143 | </label> |
| 144 | </div> |
| 145 | <?php endif; // Edit theme options ?> |
| 146 | |
| 147 | <?php if ( !$this->post_type->hierarchical ) : ?> |
| 148 | <div class="comments"> |
| 149 | <label> |
| 150 | <input type="checkbox" name="sticky" class="np-sticky" value="sticky" /> |
| 151 | <span class="checkbox-title"><?php _e( 'Make Sticky', 'wp-nested-pages' ); ?></span> |
| 152 | </label> |
| 153 | </div> |
| 154 | <?php endif; ?> |
| 155 | |
| 156 | <div class="form-control np-toggle-options"> |
| 157 | <?php if ( $this->user->canSortPages() && $this->post_type->name == 'page' && !$this->listing_repo->isSearch() && !array_key_exists('menu_options', $this->disabled_standard_fields) && $wpml_pages ) : ?> |
| 158 | <a href="#" class="np-btn np-btn-half np-toggle-menuoptions"><?php _e('Menu Options', 'wp-nested-pages'); ?></a> |
| 159 | <?php endif; ?> |
| 160 | |
| 161 | <?php if ( !empty($this->h_taxonomies) && !array_key_exists('hide_taxonomies', $this->disabled_standard_fields) ) : ?> |
| 162 | <a href="#" class="np-btn np-btn-half btn-right np-toggle-taxonomies"><?php _e('Taxonomies', 'wp-nested-pages'); ?></a> |
| 163 | <?php endif; ?> |
| 164 | </div> |
| 165 | |
| 166 | </div><!-- .right --> |
| 167 | |
| 168 | <?php if ( !empty($this->h_taxonomies) ) : ?> |
| 169 | <div class="np-taxonomies"> |
| 170 | <?php |
| 171 | foreach ( $this->h_taxonomies as $taxonomy ) : |
| 172 | $disabled = $this->post_type_repo->taxonomyDisabled($taxonomy->name, $this->post_type->name); |
| 173 | if ( !$disabled ) : |
| 174 | ?> |
| 175 | <div class="np-taxonomy"> |
| 176 | <span class="title"><?php echo esc_html( $taxonomy->labels->name ) ?></span> |
| 177 | <input type="hidden" name="<?php echo ( $taxonomy->name == 'category' ) ? 'post_category[]' : 'tax_input[' . esc_attr( $taxonomy->name ) . '][]'; ?>" value="0" /> |
| 178 | <ul class="cat-checklist <?php echo esc_attr( $taxonomy->name )?>-checklist"> |
| 179 | <?php wp_terms_checklist( null, array( 'taxonomy' => $taxonomy->name ) ) ?> |
| 180 | </ul> |
| 181 | </div><!-- .np-taxonomy --> |
| 182 | <?php |
| 183 | endif; |
| 184 | endforeach; |
| 185 | ?> |
| 186 | |
| 187 | <?php |
| 188 | foreach ( $this->f_taxonomies as $taxonomy ) : |
| 189 | $disabled = $this->post_type_repo->taxonomyDisabled($taxonomy->name, $this->post_type->name); |
| 190 | if ( !$disabled ) : |
| 191 | ?> |
| 192 | <div class="np-taxonomy"> |
| 193 | <span class="title"><?php echo esc_html( $taxonomy->labels->name ) ?></span> |
| 194 | <textarea id="<?php echo esc_attr($taxonomy->name); ?>-quickedit" cols="22" rows="1" name="tax_input[<?php echo esc_attr( $taxonomy->name )?>]" class="tax_input_<?php echo esc_attr( $taxonomy->name )?>" data-autotag data-taxonomy="<?php echo esc_attr($taxonomy->name); ?>"></textarea> |
| 195 | </div><!-- .np-taxonomy --> |
| 196 | <?php |
| 197 | endif; |
| 198 | endforeach; |
| 199 | ?> |
| 200 | </div><!-- .taxonomies --> |
| 201 | <?php endif; // if taxonomies ?> |
| 202 | |
| 203 | |
| 204 | <?php if ( $this->user->canSortPages() && !$this->listing_repo->isSearch() ) : ?> |
| 205 | <div class="np-menuoptions"> |
| 206 | <div class="menuoptions-left"> |
| 207 | <div class="form-control"> |
| 208 | <label><?php _e( 'Navigation Label' ); ?></label> |
| 209 | <input type="text" name="np_nav_title" class="np_nav_title" value="" /> |
| 210 | </div> |
| 211 | <div class="form-control"> |
| 212 | <label><?php _e( 'Title Attribute' ); ?></label> |
| 213 | <input type="text" name="np_title_attribute" class="np_title_attribute" value="" /> |
| 214 | </div> |
| 215 | <div class="form-control"> |
| 216 | <label><?php _e( 'CSS Classes' ); ?></label> |
| 217 | <input type="text" name="np_nav_css_classes" class="np_nav_css_classes" value="" /> |
| 218 | </div> |
| 219 | </div><!-- .menuoptions-left --> |
| 220 | <div class="menuoptions-right"> |
| 221 | <div class="form-control"> |
| 222 | <label> |
| 223 | <input type="checkbox" name="nav_status" class="np_nav_status" value="hide" /> |
| 224 | <span class="checkbox-title"><?php _e( 'Hide in Nav Menu', 'wp-nested-pages' ); ?></span> |
| 225 | </label> |
| 226 | </div> |
| 227 | <div class="form-control"> |
| 228 | <label> |
| 229 | <input type="checkbox" name="link_target" class="link_target" value="_blank" /> |
| 230 | <span class="checkbox-title"><?php _e( 'Open link in a new window/tab' ); ?></span> |
| 231 | </label> |
| 232 | </div> |
| 233 | </div><!-- .menuoptions-right --> |
| 234 | </div> |
| 235 | <?php endif; ?> |
| 236 | |
| 237 | </div><!-- .fields --> |
| 238 | |
| 239 | </div><!-- .form-interior --> |
| 240 | |
| 241 | <div class="buttons"> |
| 242 | <input type="hidden" name="post_id" class="np_id" value="<?php echo get_the_id(); ?>"> |
| 243 | <a accesskey="c" href="#inline-edit" class="button-secondary alignleft np-cancel-quickedit"> |
| 244 | <?php _e( 'Cancel' ); ?> |
| 245 | </a> |
| 246 | <a accesskey="s" href="#inline-edit" class="button-primary np-save-quickedit alignright"> |
| 247 | <?php _e( 'Update' ); ?> |
| 248 | </a> |
| 249 | <span class="np-qe-loading"></span> |
| 250 | </div> |
| 251 | </form> |