PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.1.7
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.1.7
4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 All 139 releases
learnpress / inc / admin / views / course / pagination.php

pagination.php in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.1.7, at inc/admin/views/course/pagination.php

74 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Pagination.
5 *
6 * @since 3.0.0
7 */
8
9 ?>
10
11 <script type="text/x-template" id="tmpl-lp-pagination">
12 <div class="pagination" v-if="total > 1">
13 <form prevent.submit="">
14 <button class="button first" :disabled="page == 1" v-if="total > 2 && page > 1 && page != 2"
15 @click.prevent="previousFirstPage">«
16 </button>
17 <button class="button previous" :disabled="page == 1"
18 @click.prevent="previousPage"><?php echo esc_html_x( 'Previous', 'page-navigation', 'learnpress' ); ?></button>
19 <button class="button next" :disabled="page == total"
20 @click.prevent="nextPage"><?php echo esc_html_x( 'Next', 'page-navigation', 'learnpress' ); ?></button>
21 <button class="button last" :disabled="page == total"
22 v-if="total > 2 && page < total && page != (total - 1)"
23 @click.prevent="nextLastPage">»
24 </button>
25 <span class="index">{{page}} / {{total}}</span>
26 </form>
27 </div>
28 </script>
29
30 <script type="text/javascript">
31 window.$Vue = window.$Vue || Vue;
32
33 jQuery( function( $ ) {
34 ( function( $store ) {
35 $Vue.component( 'lp-pagination', {
36 template: '#tmpl-lp-pagination',
37 props: ['total'],
38 data: function () {
39 return { page: 1 }
40 },
41 methods: {
42 update: function() {
43 this.$emit( 'update', this.page );
44 },
45 nextPage: function() {
46 if ( this.page < this.total ) {
47 this.page++;
48 this.update();
49 }
50 },
51 nextLastPage: function() {
52 if ( this.page < this.total ) {
53 this.page = this.total;
54 this.update();
55 }
56 },
57 previousPage: function() {
58 if ( this.page > 1 ) {
59 this.page--;
60 this.update();
61 }
62 },
63 previousFirstPage: function() {
64 if ( this.page > 1 ) {
65 this.page = 1;
66 this.update();
67 }
68 }
69 }
70 });
71 })( LP_Curriculum_Store );
72 });
73 </script>
74