bulk-edit.php
9 years ago
list-header.php
9 years ago
row-link.php
8 years ago
row.php
8 years ago
tool-list.php
8 years ago
wpml-translations.php
8 years ago
row.php
203 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Row represents a single page |
| 4 | */ |
| 5 | $wpml = $this->integrations->plugins->wpml->installed; |
| 6 | $wpml_pages = ( $wpml && $this->integrations->plugins->wpml->isDefaultLanguage()) ? true : false; |
| 7 | if ( !$wpml ) $wpml_pages = true; |
| 8 | ?> |
| 9 | <div class="row<?php echo $row_classes; ?>"> |
| 10 | |
| 11 | <?php if ( $this->post_type->hierarchical ) : ?> |
| 12 | <div class="child-toggle"> |
| 13 | <div class="child-toggle-spacer"></div> |
| 14 | </div> |
| 15 | <?php endif; ?> |
| 16 | |
| 17 | <?php if ( !$this->post_type->hierarchical ) echo '<div class="non-hierarchical-spacer"></div>'; ?> |
| 18 | |
| 19 | <div class="row-inner"> |
| 20 | <i class="np-icon-sub-menu"></i> |
| 21 | |
| 22 | <?php if ( $this->user->canSortPages() && !$this->listing_repo->isSearch() && !$this->post_type_settings->disable_sorting && $wpml_current_language !== 'all' ) : ?> |
| 23 | <i class="handle np-icon-menu"></i> |
| 24 | <?php endif; ?> |
| 25 | |
| 26 | <a href="<?php echo apply_filters('nestedpages_edit_link', get_edit_post_link(), $this->post); ?>" class="page-link page-title"> |
| 27 | <span class="title"> |
| 28 | <?php |
| 29 | echo apply_filters( 'the_title', $this->post->title, $this->post->id, $view = 'nestedpages_title' ); |
| 30 | if ( !$assigned_pt ) : |
| 31 | if ( $this->post->id == get_option('page_on_front') ) echo ' <em class="np-page-type"><strong>– ' . __('Front Page', 'wp-nested-pages') . '</strong></em>'; |
| 32 | if ( $this->post->id == get_option('page_for_posts') ) echo ' <em class="np-page-type"><strong>– ' . __('Posts Page', 'wp-nested-pages') . '</strong></em>'; |
| 33 | endif; |
| 34 | ?> |
| 35 | </span> |
| 36 | <?php |
| 37 | // Post Status |
| 38 | echo '<span class="status">'; |
| 39 | if ( $this->post->status !== 'publish' ) echo '(' . __(ucfirst($this->post->status)) . ')'; |
| 40 | if ( post_password_required($this->post->id) ) echo ' <i class="np-icon-lock"></i>'; |
| 41 | echo '</span>'; |
| 42 | |
| 43 | // Nested Pages Status |
| 44 | if ( $this->post->np_status == 'hide' && !$wpml ) |
| 45 | echo '<i class="np-icon-eye-blocked"></i>'; |
| 46 | |
| 47 | // Nav Status |
| 48 | if ( $this->post->nav_status == 'hide' && !$wpml ){ |
| 49 | echo '<span class="nav-status">' . __('Hidden', 'wp-nested-pages') . '</span>'; |
| 50 | } else { |
| 51 | echo '<span class="nav-status"></span>'; |
| 52 | } |
| 53 | |
| 54 | // Post Lock |
| 55 | if ( $user = wp_check_post_lock($this->post->id) ){ |
| 56 | $u = get_userdata($user); |
| 57 | echo '<span class="locked"><i class="np-icon-lock"></i><em> ' . esc_html($u->display_name) . ' ' . __('currently editing', 'wp-nested-pages') . '</em></span>'; |
| 58 | } elseif ( !$this->integrations->plugins->editorial_access_manager->hasAccess($this->post->id) ){ |
| 59 | echo '<span class="locked"><i class="np-icon-lock"></i></span>'; |
| 60 | } else { |
| 61 | echo '<span class="edit-indicator"><i class="np-icon-pencil"></i>' . apply_filters('nestedpages_edit_link_text', __('Edit'), $this->post) . '</span>'; |
| 62 | } |
| 63 | |
| 64 | // Sticky |
| 65 | echo '<span class="sticky"'; |
| 66 | if ( !in_array($this->post->id, $this->sticky_posts) ) echo ' style="display:none;"'; |
| 67 | echo '>(' . __('Sticky', 'wp-nested-pages') . ')<span>'; |
| 68 | |
| 69 | if ( $this->post->status !== 'publish' ) echo '(' . __(ucfirst($this->post->status)) . ')'; |
| 70 | if ( post_password_required($this->post->id) ) echo ' <i class="np-icon-lock"></i>'; |
| 71 | |
| 72 | |
| 73 | |
| 74 | ?> |
| 75 | </a> |
| 76 | |
| 77 | <?php if ( $assigned_pt ) : ?> |
| 78 | <ul class="np-assigned-pt-actions"> |
| 79 | <?php if ( current_user_can('publish_posts') ) : ?> |
| 80 | <li><a href="<?php echo $this->post_type_repo->addNewPostLink($assigned_pt->name); ?>" class=""><?php echo $assigned_pt->labels->add_new; ?></a></li> |
| 81 | <?php endif; ?> |
| 82 | <li><a href="<?php echo $this->post_type_repo->allPostsLink($assigned_pt->name); ?>" class=""><?php echo $assigned_pt->labels->all_items . ' (' . $this->listing_repo->postCount($assigned_pt->name) . ')'; ?></a></li> |
| 83 | </ul> |
| 84 | <?php endif; ?> |
| 85 | |
| 86 | <!-- Responsive Toggle Button --> |
| 87 | <a href="#" class="np-toggle-edit"><i class="np-icon-pencil"></i></a> |
| 88 | |
| 89 | <?php if ( !$this->post->hierarchical ) : echo $this->post->hierarchical; ?> |
| 90 | <div class="np-post-columns"> |
| 91 | <ul class="np-post-info"> |
| 92 | <li><span class="np-author-display"><?php echo $this->post->author; ?></span></li> |
| 93 | <li><?php echo get_the_date(); ?></li> |
| 94 | </ul> |
| 95 | </div> |
| 96 | <?php endif; ?> |
| 97 | |
| 98 | <?php |
| 99 | if ( $this->integrations->plugins->yoast->installed ){ |
| 100 | echo '<span class="np-seo-indicator ' . esc_html($this->post->score) . '"></span>'; |
| 101 | } |
| 102 | ?> |
| 103 | |
| 104 | <div class="action-buttons"> |
| 105 | <?php if ( $wpml ) : ?> |
| 106 | <a href="#" class="np-btn" data-nestedpages-translations><?php _e('Translations', 'wp-nested-pages'); ?> (<?php echo $this->integrations->plugins->wpml->getAllTranslations($this->post->id, 'count'); ?>)</a> |
| 107 | <?php endif; ?> |
| 108 | |
| 109 | <?php if ( $this->post->comment_status == 'open' ) : $comments = wp_count_comments($this->post->id); $cs = 'open' ?> |
| 110 | |
| 111 | <a href="<?php echo admin_url( 'edit-comments.php?p=' . get_the_id() ); ?>" class="np-btn"> |
| 112 | <i class="np-icon-bubble"></i> <?php echo $comments->total_comments; ?> |
| 113 | </a> |
| 114 | |
| 115 | <?php else : $cs = 'closed'; endif; ?> |
| 116 | |
| 117 | <?php if ( current_user_can('publish_pages') && $this->post_type->hierarchical && !$this->listing_repo->isSearch() && $wpml_pages ) : ?> |
| 118 | |
| 119 | <?php if (!$this->settings->menusDisabled() && !$this->integrations->plugins->wpml->installed) : ?> |
| 120 | <a href="#" class="np-btn open-redirect-modal" data-parentid="<?php echo esc_attr($this->post->id); ?>"><i class="np-icon-link"></i></a> |
| 121 | <?php endif; ?> |
| 122 | |
| 123 | <a href="#" class="np-btn add-new-child" data-id="<?php echo esc_attr(get_the_id()); ?>" data-parentname="<?php echo esc_html($this->post->title); ?>"><?php _e('Add Child', 'wp-nested-pages'); ?></a> |
| 124 | |
| 125 | <?php endif; ?> |
| 126 | |
| 127 | <?php if ( current_user_can('edit_pages') && current_user_can('edit_posts') && $wpml_pages ) : ?> |
| 128 | <a href="#" class="np-btn clone-post" data-id="<?php echo esc_attr(get_the_id()); ?>" data-parentname="<?php echo esc_html($this->post->title); ?>"><?php _e('Clone', 'wp-nested-pages'); ?></a> |
| 129 | <?php endif; ?> |
| 130 | |
| 131 | <?php if ( !$user = wp_check_post_lock($this->post->id) || !$this->integrations->plugins->editorial_access_manager->hasAccess($this->post->id) ) : ?> |
| 132 | <a href="#" |
| 133 | class="np-btn np-quick-edit" |
| 134 | data-id="<?php echo esc_attr($this->post->id); ?>" |
| 135 | data-template="<?php echo esc_attr($this->post->template); ?>" |
| 136 | data-title="<?php echo esc_attr($this->post->title); ?>" |
| 137 | data-slug="<?php echo esc_attr(urldecode($post->post_name)); ?>" |
| 138 | data-commentstatus="<?php echo esc_attr($cs); ?>" |
| 139 | data-status="<?php echo esc_attr($this->post->status); ?>" |
| 140 | data-np-status="<?php echo esc_attr($this->post->np_status); ?>" |
| 141 | data-navstatus="<?php echo esc_attr($this->post->nav_status); ?>" |
| 142 | data-navtitleattr="<?php echo esc_attr($this->post->nav_title_attr); ?>" |
| 143 | data-navcss="<?php echo esc_attr($this->post->nav_css); ?>" |
| 144 | data-linktarget="<?php echo esc_attr($this->post->link_target); ?>" |
| 145 | data-navtitle="<?php echo esc_attr($this->post->nav_title); ?>" |
| 146 | data-author="<?php echo esc_attr($post->post_author); ?>" |
| 147 | <?php if ( current_user_can('publish_pages') ) : ?> |
| 148 | data-password="<?php echo esc_attr($post->post_password); ?>" |
| 149 | <?php endif; ?> |
| 150 | data-month="<?php echo esc_attr($this->post->date->month); ?>" |
| 151 | data-day="<?php echo esc_attr($this->post->date->d); ?>" |
| 152 | data-year="<?php echo esc_attr($this->post->date->y); ?>" |
| 153 | data-hour="<?php echo esc_attr($this->post->date->h); ?>" |
| 154 | data-minute="<?php echo esc_attr($this->post->date->m);?>" |
| 155 | data-datepicker="<?php echo date_i18n('n/j/Y', $this->post->date->datepicker); ?>" |
| 156 | data-time="<?php echo date_i18n('H:i', $this->post->date->datepicker); ?>" |
| 157 | data-formattedtime="<?php echo date_i18n('g:i', $this->post->date->datepicker); ?>" |
| 158 | data-timeformat="<?php echo get_option('time_format'); ?>" |
| 159 | data-ampm="<?php echo date('a', $this->post->date->datepicker); ?>" |
| 160 | data-sticky="<?php if ( in_array($this->post->id, $this->sticky_posts) ) echo 'sticky'; ?>"> |
| 161 | <?php _e('Quick Edit'); ?> |
| 162 | </a> |
| 163 | <?php endif; ?> |
| 164 | |
| 165 | <a href="<?php echo apply_filters('nestedpages_view_link', get_the_permalink(), $this->post); ?>" class="np-btn np-view-button" target="_blank"> |
| 166 | <?php echo apply_filters('nestedpages_view_link_text', __('View'), $this->post); ?> |
| 167 | </a> |
| 168 | |
| 169 | <!-- <a href="#" class="np-btn"><i class="np-icon-more_vert"></i></a> --> |
| 170 | |
| 171 | <?php if ( current_user_can('delete_pages') && $this->integrations->plugins->editorial_access_manager->hasAccess($this->post->id) ) : ?> |
| 172 | <a href="<?php echo get_delete_post_link(get_the_id()); ?>" class="np-btn np-btn-trash"> |
| 173 | <i class="np-icon-remove"></i> |
| 174 | </a> |
| 175 | <?php endif; ?> |
| 176 | |
| 177 | </div><!-- .action-buttons --> |
| 178 | </div><!-- .row-inner --> |
| 179 | |
| 180 | <?php |
| 181 | // Thumbnail |
| 182 | $thumbnail_source = $this->post_type_repo->thumbnails($this->post_type->name, 'source'); |
| 183 | $thumbnail_size = $this->post_type_repo->thumbnails($this->post_type->name, 'display_size'); |
| 184 | if ( $thumbnail_source ) : |
| 185 | $out = '<div class="np-thumbnail ' . $thumbnail_size . '">'; |
| 186 | if ( has_post_thumbnail($this->post->id) ) : |
| 187 | $image = get_the_post_thumbnail($this->post->id, $thumbnail_source); |
| 188 | $out .= apply_filters('nestedpages_thumbnail', $image, $this->post); |
| 189 | else : |
| 190 | $image_fallback = apply_filters('nestedpages_thumbnail_fallback', false, $this->post); |
| 191 | if ( $image_fallback ) : |
| 192 | $out .= apply_filters('nestedpages_thumbnail_fallback', $image_fallback, $this->post); |
| 193 | endif; |
| 194 | endif; |
| 195 | $out .= '</div>'; |
| 196 | echo $out; |
| 197 | endif; |
| 198 | ?> |
| 199 | |
| 200 | <div class="np-bulk-checkbox"> |
| 201 | <input type="checkbox" name="nestedpages_bulk[]" value="<?php echo esc_attr($this->post->id); ?>" data-np-bulk-checkbox="<?php echo esc_attr($this->post->title); ?>" data-np-post-type="<?php echo esc_attr($this->post->post_type); ?>" /> |
| 202 | </div> |
| 203 | </div><!-- .row --> |