row.php
131 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Row represents a single page |
| 4 | */ |
| 5 | ?> |
| 6 | <div class="row<?php if ( !$this->post_type->hierarchical ) echo ' non-hierarchical'; ?>" <?php if ( $this->isSearch() ) echo 'style="padding-left:10px;"';?>> |
| 7 | |
| 8 | <?php if ( $this->post_type->hierarchical && !$this->isSearch() ) : ?> |
| 9 | <div class="child-toggle"></div> |
| 10 | <?php endif; ?> |
| 11 | |
| 12 | <div class="row-inner"> |
| 13 | <i class="np-icon-sub-menu"></i> |
| 14 | |
| 15 | <?php if ( $this->user->canSortPages() && !$this->isSearch() ) : ?> |
| 16 | <i class="handle np-icon-menu"></i> |
| 17 | <?php endif; ?> |
| 18 | |
| 19 | <a href="<?php echo get_edit_post_link(); ?>" class="page-link page-title"> |
| 20 | <span class="title"><?php echo $this->post->title; ?></span> |
| 21 | <?php |
| 22 | |
| 23 | if ( function_exists('wpseo_translate_score') ){ |
| 24 | echo '<span class="np-seo-indicator ' . $this->post->score . '"></span>'; |
| 25 | } |
| 26 | |
| 27 | // Post Status |
| 28 | echo '<span class="status">'; |
| 29 | if ( $this->post->status !== 'publish' ) echo '(' . __(ucfirst($this->post->status)) . ')'; |
| 30 | if ( post_password_required($this->post->id) ) echo ' <i class="np-icon-lock"></i>'; |
| 31 | echo '</span>'; |
| 32 | |
| 33 | // Nested Pages Status |
| 34 | if ( $this->post->np_status == 'hide' ) |
| 35 | echo '<i class="np-icon-eye-blocked"></i>'; |
| 36 | |
| 37 | // Nav Status |
| 38 | if ( $this->post->nav_status == 'hide' ){ |
| 39 | echo '<span class="nav-status">' . __('Hidden', 'nestedpages') . '</span>'; |
| 40 | } else { |
| 41 | echo '<span class="nav-status"></span>'; |
| 42 | } |
| 43 | |
| 44 | // Post Lock |
| 45 | if ( $user = wp_check_post_lock($this->post->id) ){ |
| 46 | $u = get_userdata($user); |
| 47 | echo '<span class="locked"><i class="np-icon-lock"></i><em> ' . $u->display_name . ' ' . __('currently editing', 'nestedpages') . '</em></span>'; |
| 48 | } else { |
| 49 | echo '<span class="edit-indicator"><i class="np-icon-pencil"></i>' . __('Edit') . '</span>'; |
| 50 | } |
| 51 | ?> |
| 52 | </a> |
| 53 | |
| 54 | |
| 55 | <!-- Responsive Toggle Button --> |
| 56 | <a href="#" class="np-toggle-edit"><i class="np-icon-pencil"></i></a> |
| 57 | |
| 58 | |
| 59 | <?php if ( !$this->post->hierarchical ) : echo $this->post->hierarchical; ?> |
| 60 | <div class="np-post-columns"> |
| 61 | <ul class="np-post-info"> |
| 62 | <li><span class="np-author-display"><?php echo $this->post->author; ?></span></li> |
| 63 | <li><?php echo get_the_date(); ?></li> |
| 64 | </ul> |
| 65 | </div> |
| 66 | <?php endif; ?> |
| 67 | |
| 68 | |
| 69 | <div class="action-buttons"> |
| 70 | |
| 71 | <?php if ( $this->post->comment_status == 'open' ) : $comments = wp_count_comments($this->post->id); $cs = 'open' ?> |
| 72 | |
| 73 | |
| 74 | <a href="<?php echo admin_url( 'edit-comments.php?p=' . get_the_id() ); ?>" class="np-btn"> |
| 75 | <i class="np-icon-bubble"></i> <?php echo $comments->total_comments; ?> |
| 76 | </a> |
| 77 | |
| 78 | <?php else : $cs = 'closed'; endif; ?> |
| 79 | |
| 80 | |
| 81 | <?php if ( current_user_can('publish_pages') && $this->post_type->hierarchical && !$this->isSearch() ) : ?> |
| 82 | |
| 83 | <a href="#" class="np-btn open-redirect-modal" data-parentid="<?php echo $this->post->id; ?>"><i class="np-icon-link"></i></a> |
| 84 | |
| 85 | <a href="#" class="np-btn add-new-child" data-id="<?php echo get_the_id(); ?>" data-parentname="<?php echo $this->post->title; ?>"><?php _e('Add Child', 'nestedpages'); ?></a> |
| 86 | |
| 87 | <?php endif; ?> |
| 88 | |
| 89 | <?php if ( !$user = wp_check_post_lock($this->post->id) ) : ?> |
| 90 | <a href="#" |
| 91 | class="np-btn np-quick-edit" |
| 92 | data-id="<?php echo $this->post->id; ?>" |
| 93 | data-template="<?php echo $this->post->template; ?>" |
| 94 | data-title="<?php echo $this->post->title; ?>" |
| 95 | data-slug="<?php echo $post->post_name; ?>" |
| 96 | data-commentstatus="<?php echo $cs; ?>" |
| 97 | data-status="<?php echo $this->post->status; ?>" |
| 98 | data-np-status="<?php echo $this->post->np_status; ?>" |
| 99 | data-navstatus="<?php echo $this->post->nav_status; ?>" |
| 100 | data-navtitleattr="<?php echo $this->post->nav_title_attr; ?>" |
| 101 | data-navcss="<?php echo $this->post->nav_css; ?>" |
| 102 | data-linktarget="<?php echo $this->post->link_target; ?>" |
| 103 | data-navtitle="<?php echo $this->post->nav_title; ?>" |
| 104 | data-author="<?php echo $post->post_author; ?>" |
| 105 | <?php if ( current_user_can('publish_pages') ) : ?> |
| 106 | data-password="<?php echo $post->post_password; ?>" |
| 107 | <?php endif; ?> |
| 108 | data-month="<?php echo $this->post->date->month; ?>" |
| 109 | data-day="<?php echo $this->post->date->d; ?>" |
| 110 | data-year="<?php echo $this->post->date->y; ?>" |
| 111 | data-hour="<?php echo $this->post->date->h; ?>" |
| 112 | data-minute="<?php echo $this->post->date->m;?>" |
| 113 | data-datepicker="<?php echo date_i18n('n/j/Y', $this->post->date->datepicker); ?>" |
| 114 | data-time="<?php echo date_i18n('H:i', $this->post->date->datepicker); ?>" |
| 115 | data-formattedtime="<?php echo date_i18n('g:i', $this->post->date->datepicker); ?>" |
| 116 | data-ampm="<?php echo date('a', $this->post->date->datepicker); ?>"> |
| 117 | <?php _e('Quick Edit'); ?> |
| 118 | </a> |
| 119 | <?php endif; ?> |
| 120 | |
| 121 | <a href="<?php echo get_the_permalink(); ?>" class="np-btn" target="_blank"><?php _e('View'); ?></a> |
| 122 | |
| 123 | <?php if ( current_user_can('delete_pages') ) : ?> |
| 124 | <a href="<?php echo get_delete_post_link(get_the_id()); ?>" class="np-btn np-btn-trash"> |
| 125 | <i class="np-icon-remove"></i> |
| 126 | </a> |
| 127 | <?php endif; ?> |
| 128 | |
| 129 | </div><!-- .action-buttons --> |
| 130 | </div><!-- .row-inner --> |
| 131 | </div><!-- .row --> |