bulk-add.php
6 years ago
clone-form.php
3 years ago
delete-confirmation-modal.php
6 years ago
empty-trash-modal.php
6 years ago
link-form.php
2 days ago
new-child.php
2 days ago
quickedit-link.php
6 years ago
quickedit-post.php
2 days ago
quickedit-post.php
303 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 | $has_taxonomies = ( !empty($this->h_taxonomies) || !empty($this->f_taxonomies) ) ? true : false; |
| 11 | $has_taxonomies = ( $has_taxonomies && !array_key_exists('hide_taxonomies', $this->disabled_standard_fields) ) ? true : false; |
| 12 | $has_menu_options = ( $this->user->canSortPosts($this->post_type->name) && $this->post_type->name == 'page' && !$this->listing_repo->isSearch() && !array_key_exists('menu_options', $this->disabled_standard_fields) && $wpml_pages && !$this->settings->menusDisabled() ) ? true : false; |
| 13 | ?> |
| 14 | |
| 15 | <form method="get" action=""> |
| 16 | |
| 17 | <div class="header <?php if ( !$has_taxonomies && $this->post_type->name !== 'page' ) echo 'no-tabs'; ?>"> |
| 18 | <h3><?php _e('Quick Edit', 'wp-nested-pages'); ?><span class="page_id"></span></h3> |
| 19 | <div class="np-quickedit-error" style="clear:both;display:none;"></div> |
| 20 | <ul class="np-tabs"> |
| 21 | <li class="active"><a href="#" data-np-tab-group="quick-edit" data-np-tab-toggle="post-info"><?php esc_html_e($this->post_type->labels->singular_name); ?></a></li> |
| 22 | <?php if ( $has_taxonomies ) : ?> |
| 23 | <li><a href="#" data-np-tab-group="quick-edit" data-np-tab-toggle="taxonomies"><?php esc_html_e('Taxonomies', 'wp-nested-pages'); ?></a></li> |
| 24 | <?php endif; ?> |
| 25 | <?php if ( $has_menu_options ) : ?> |
| 26 | <li><a href="#" data-np-tab-group="quick-edit" data-np-tab-toggle="menu-options"><?php esc_html_e('Menu Options', 'wp-nested-pages'); ?></a></li> |
| 27 | <?php endif; ?> |
| 28 | </ul> |
| 29 | </div> |
| 30 | |
| 31 | <div class="form-interior"> |
| 32 | |
| 33 | <div class="fields"> |
| 34 | |
| 35 | <div class="np-tab-pane" data-np-tab-pane="post-info" data-np-tab-group="quick-edit" style="display: block;"> |
| 36 | <div class="left"> |
| 37 | |
| 38 | <?php if ( !array_key_exists('title', $this->disabled_standard_fields) ) : ?> |
| 39 | <div class="form-control"> |
| 40 | <label><?php _e( 'Title' ); ?></label> |
| 41 | <input type="text" name="post_title" class="np_title" value="" /> |
| 42 | </div> |
| 43 | <?php endif; ?> |
| 44 | |
| 45 | <?php if ( !array_key_exists('slug', $this->disabled_standard_fields) ) : ?> |
| 46 | <div class="form-control"> |
| 47 | <label><?php _e( 'Slug' ); ?></label> |
| 48 | <input type="text" name="post_name" class="np_slug" value="" /> |
| 49 | </div> |
| 50 | <?php endif; ?> |
| 51 | |
| 52 | <?php if ( !array_key_exists('date', $this->disabled_standard_fields) ) : ?> |
| 53 | <?php if ( $this->settings->datepickerEnabled() ) : ?> |
| 54 | <div class="form-control np-datepicker-container"> |
| 55 | <label><?php _e( 'Date' ); ?></label> |
| 56 | <div class="datetime"> |
| 57 | <input type="text" name="np_date" class="np_datepicker np_publish_date" value="" /> |
| 58 | <span><?php _e('@', 'wp-nested-pages'); ?></span> |
| 59 | <div class="np-time-container"> |
| 60 | <?php if ( get_option('time_format') !== 'H:i' ) : ?> |
| 61 | <select name="np_ampm" class="np_ampm"> |
| 62 | <option value="am"><?php _e('am', 'wp-nested-pages'); ?></option> |
| 63 | <option value="pm"><?php _e('pm', 'wp-nested-pages'); ?></option> |
| 64 | </select> |
| 65 | <?php endif; ?> |
| 66 | <input type="text" name="np_time" class="np_time" value="" /> |
| 67 | </div> |
| 68 | </div> |
| 69 | </div> |
| 70 | <?php else : ?> |
| 71 | <div> |
| 72 | <label><?php _e( 'Date', 'wp-nested-pages' ); ?></label> |
| 73 | <div class="dates"><?php touch_time( 1, 1, 0, 1 ); ?></div> |
| 74 | </div> |
| 75 | <?php endif; endif; ?> |
| 76 | |
| 77 | <?php |
| 78 | /* |
| 79 | * Authors Dropdown |
| 80 | */ |
| 81 | if ( !array_key_exists('author', $this->disabled_standard_fields) ) : |
| 82 | $authors_dropdown = ''; |
| 83 | if ( is_super_admin() || current_user_can( $post_type_object->cap->edit_others_posts ) ) : |
| 84 | $users_opt = [ |
| 85 | 'hide_if_only_one_author' => false, |
| 86 | 'capability' => 'edit_posts', |
| 87 | 'name' => 'post_author', |
| 88 | 'id' => 'post_author', |
| 89 | 'class'=> 'authors', |
| 90 | 'multi' => 1, |
| 91 | 'echo' => 0 |
| 92 | ]; |
| 93 | |
| 94 | if ( $authors = wp_dropdown_users( $users_opt ) ) : |
| 95 | $authors_dropdown = '<div class="form-control np_author"><label>' . __( 'Author' ) . '</label>'; |
| 96 | $authors_dropdown .= $authors; |
| 97 | $authors_dropdown .= '</div>'; |
| 98 | endif; |
| 99 | echo $authors_dropdown; |
| 100 | endif; |
| 101 | endif; |
| 102 | ?> |
| 103 | |
| 104 | <?php |
| 105 | if ( !array_key_exists('status', $this->disabled_standard_fields) ) : |
| 106 | $statuses = $this->post_type_repo->quickEditStatuses($this->post_type->name); |
| 107 | ?> |
| 108 | <div class="form-control"> |
| 109 | <label><?php _e( 'Status' ); ?></label> |
| 110 | <select name="_status" class="np_status"> |
| 111 | <?php |
| 112 | if ( $can_publish && isset($statuses['can_publish']) ) : |
| 113 | foreach ( $statuses['can_publish'] as $status => $label ){ |
| 114 | echo '<option value="' . $status . '">' . $label . '</option>'; |
| 115 | } |
| 116 | endif; |
| 117 | foreach ( $statuses['other'] as $status => $label ){ |
| 118 | echo '<option value="' . $status . '">' . $label . '</option>'; |
| 119 | } |
| 120 | ?> |
| 121 | </select> |
| 122 | </div> |
| 123 | <?php endif; ?> |
| 124 | |
| 125 | <?php |
| 126 | $custom_fields_left = $this->custom_fields_repo->outputQuickEditFields($this->post_type, 'left'); |
| 127 | if ( $custom_fields_left ) echo $custom_fields_left; |
| 128 | ?> |
| 129 | |
| 130 | </div><!-- .left --> |
| 131 | |
| 132 | <div class="right"> |
| 133 | |
| 134 | <?php if ( $this->post_type->hierarchical && !array_key_exists('template', $this->disabled_standard_fields)) : ?> |
| 135 | <div class="form-control"> |
| 136 | <label><?php _e( 'Template' ); ?></label> |
| 137 | <select name="page_template" class="np_template"> |
| 138 | <option value="default"><?php _e( 'Default Template' ); ?></option> |
| 139 | <?php |
| 140 | if( is_page() ){ |
| 141 | page_template_dropdown(); |
| 142 | }else{ |
| 143 | page_template_dropdown('', $this->post_type->name); |
| 144 | } |
| 145 | ?> |
| 146 | </select> |
| 147 | </div> |
| 148 | <?php endif; ?> |
| 149 | |
| 150 | <?php if ( $can_publish && !array_key_exists('password', $this->disabled_standard_fields) ) : ?> |
| 151 | <div class="form-control password"> |
| 152 | <label><?php _e( 'Password' ); ?></label> |
| 153 | <input type="text" class="post_password" name="post_password" value="" /> |
| 154 | <div class="private"> |
| 155 | <em style="margin:2px 8px 0 0" class="alignleft"><?php _e( '–OR–' ); ?></em> |
| 156 | <label> |
| 157 | <input type="checkbox" class="keep_private" name="keep_private" value="private" /> |
| 158 | <?php echo __( 'Private' ); ?> |
| 159 | </label> |
| 160 | </div> |
| 161 | </div> |
| 162 | <?php endif; ?> |
| 163 | |
| 164 | <?php if ( !array_key_exists('allow_comments', $this->disabled_standard_fields) ) : ?> |
| 165 | <div class="comments"> |
| 166 | <label> |
| 167 | <input type="checkbox" name="comment_status" class="np_cs" value="open" /> |
| 168 | <span class="checkbox-title"><?php _e( 'Allow Comments' ); ?></span> |
| 169 | </label> |
| 170 | </div> |
| 171 | <?php endif; ?> |
| 172 | |
| 173 | <?php if ( current_user_can('edit_theme_options') && !array_key_exists('hide_in_np', $this->disabled_standard_fields) ) : ?> |
| 174 | <div class="comments"> |
| 175 | <label> |
| 176 | <input type="checkbox" name="nested_pages_status" class="nested_pages_status" value="hide" /> |
| 177 | <span class="checkbox-title"><?php _e( 'Hide in Nested Pages', 'wp-nested-pages' ); ?></span> |
| 178 | </label> |
| 179 | </div> |
| 180 | <?php endif; // Edit theme options ?> |
| 181 | |
| 182 | <?php |
| 183 | $sticky_available = ( $this->post_type->hierarchical ) ? false : true; |
| 184 | $sticky_available = apply_filters('nestedpages_sticky_available', $sticky_available, $this->post, $this->post_type); |
| 185 | $make_sticky = apply_filters('nestedpages_make_sticky_text', __('Make Sticky', 'wp-nested-pages'), $this->post, $this->post_type); |
| 186 | if ( $sticky_available ) : |
| 187 | ?> |
| 188 | <div class="comments"> |
| 189 | <label> |
| 190 | <input type="checkbox" name="sticky" class="np-sticky" value="sticky" /> |
| 191 | <span class="checkbox-title"><?php echo $make_sticky; ?></span> |
| 192 | </label> |
| 193 | </div> |
| 194 | <?php endif; ?> |
| 195 | |
| 196 | <?php |
| 197 | $custom_fields_right = $this->custom_fields_repo->outputQuickEditFields($this->post_type, 'right'); |
| 198 | if ( $custom_fields_right ) echo $custom_fields_right; |
| 199 | ?> |
| 200 | |
| 201 | </div><!-- .right --> |
| 202 | </div><!-- .np-tab-pane --> |
| 203 | |
| 204 | |
| 205 | <?php if ( $has_taxonomies ) : ?> |
| 206 | <div class="np-tab-pane np-taxonomies" data-np-tab-pane="taxonomies" data-np-tab-group="quick-edit"> |
| 207 | <?php |
| 208 | foreach ( $this->h_taxonomies as $taxonomy ) : |
| 209 | $disabled = $this->post_type_repo->taxonomyDisabled($taxonomy->name, $this->post_type->name); |
| 210 | if ( !$disabled ) : |
| 211 | ?> |
| 212 | <div class="np-taxonomy"> |
| 213 | <span class="title"><?php esc_html_e( $taxonomy->labels->name ) ?></span> |
| 214 | <input type="hidden" name="<?php echo ( $taxonomy->name == 'category' ) ? 'post_category[]' : 'tax_input[' . esc_attr( $taxonomy->name ) . '][]'; ?>" value="0" /> |
| 215 | <ul class="cat-checklist <?php echo esc_attr( $taxonomy->name )?>-checklist"> |
| 216 | <?php wp_terms_checklist( null, array( 'taxonomy' => $taxonomy->name ) ) ?> |
| 217 | </ul> |
| 218 | </div><!-- .np-taxonomy --> |
| 219 | <?php |
| 220 | endif; |
| 221 | endforeach; |
| 222 | ?> |
| 223 | |
| 224 | <?php |
| 225 | foreach ( $this->f_taxonomies as $taxonomy ) : |
| 226 | $disabled = $this->post_type_repo->taxonomyDisabled($taxonomy->name, $this->post_type->name); |
| 227 | if ( !$disabled ) : |
| 228 | ?> |
| 229 | <div class="np-taxonomy"> |
| 230 | <span class="title"><?php esc_html_e( $taxonomy->labels->name ) ?></span> |
| 231 | <textarea id="<?php esc_attr_e($taxonomy->name); ?>-quickedit" cols="22" rows="1" name="tax_input[<?php esc_attr_e( $taxonomy->name )?>]" class="tax_input_<?php esc_attr_e( $taxonomy->name )?>" data-autotag data-taxonomy="<?php esc_attr_e($taxonomy->name); ?>"></textarea> |
| 232 | </div><!-- .np-taxonomy --> |
| 233 | <?php |
| 234 | endif; |
| 235 | endforeach; |
| 236 | ?> |
| 237 | </div><!-- .taxonomies.tab-pane --> |
| 238 | <?php endif; // if taxonomies ?> |
| 239 | |
| 240 | |
| 241 | <?php if ( $has_menu_options ) : ?> |
| 242 | <div class="np-tab-pane np-menuoptions" data-np-tab-pane="menu-options" data-np-tab-group="quick-edit"> |
| 243 | <?php |
| 244 | $current_menu_term = $this->settings->getMenuTerm(); |
| 245 | if ( $current_menu_term ) : |
| 246 | $edit_url = admin_url("nav-menus.php?menu=$current_menu_term->term_id"); |
| 247 | ?> |
| 248 | <div class="np-menuoptions-description"> |
| 249 | <p class="current-menu"><?php echo wp_kses(sprintf(__('<strong>Current Menu</strong>: %s', 'wp-nested-pages'), $current_menu_term->name), ['strong' => []]); ?> (<a href="<?php echo $edit_url; ?>"><?php _e('Edit', 'wp-nested-pages'); ?></a>)</p> |
| 250 | </div> |
| 251 | <?php endif; ?> |
| 252 | <div class="left"> |
| 253 | <div class="form-control"> |
| 254 | <label><?php _e( 'Navigation Label' ); ?></label> |
| 255 | <input type="text" name="np_nav_title" class="np_nav_title" value="" /> |
| 256 | </div> |
| 257 | <div class="form-control"> |
| 258 | <label><?php _e( 'Title Attribute' ); ?></label> |
| 259 | <input type="text" name="np_title_attribute" class="np_title_attribute" value="" /> |
| 260 | </div> |
| 261 | <div class="form-control"> |
| 262 | <label><?php _e( 'CSS Classes' ); ?></label> |
| 263 | <input type="text" name="np_nav_css_classes" class="np_nav_css_classes" value="" /> |
| 264 | </div> |
| 265 | <div class="form-control"> |
| 266 | <label><?php _e( 'Custom URL' ); ?></label> |
| 267 | <input type="text" name="np_nav_custom_url" class="np_nav_custom_url" placeholder="<?php _e('Example: #', 'wp-nested-pages'); ?>" value="" /> |
| 268 | </div> |
| 269 | </div><!-- .menuoptions-left --> |
| 270 | <div class="right"> |
| 271 | <div class="form-control"> |
| 272 | <label> |
| 273 | <input type="checkbox" name="nav_status" class="np_nav_status" value="hide" /> |
| 274 | <span class="checkbox-title"><?php _e( 'Hide in Nav Menu', 'wp-nested-pages' ); ?></span> |
| 275 | </label> |
| 276 | </div> |
| 277 | <div class="form-control"> |
| 278 | <label> |
| 279 | <input type="checkbox" name="link_target" class="link_target" value="_blank" /> |
| 280 | <span class="checkbox-title"><?php _e( 'Open link in a new window/tab' ); ?></span> |
| 281 | </label> |
| 282 | </div> |
| 283 | </div><!-- .menuoptions-right --> |
| 284 | </div> |
| 285 | <?php endif; ?> |
| 286 | |
| 287 | </div><!-- .fields --> |
| 288 | |
| 289 | </div><!-- .form-interior --> |
| 290 | |
| 291 | <div class="buttons"> |
| 292 | <input type="hidden" name="post_id" class="np_id" value="<?php echo get_the_id(); ?>"> |
| 293 | <a accesskey="c" href="#inline-edit" class="button-secondary alignleft np-cancel-quickedit"> |
| 294 | <?php _e( 'Cancel' ); ?> |
| 295 | </a> |
| 296 | <a accesskey="s" href="#inline-edit" class="button-primary np-save-quickedit alignright"> |
| 297 | <?php _e( 'Update' ); ?> |
| 298 | </a> |
| 299 | <div class="np-qe-loading"> |
| 300 | <?php include( NestedPages\Helpers::asset('images/spinner.svg') ); ?> |
| 301 | </div> |
| 302 | </div> |
| 303 | </form> |