PluginProbe
Taskbuilder – Project Management & Task Management Tool With Kanban Board / 4.0.3
Taskbuilder – Project Management & Task Management Tool With Kanban Board v4.0.3
6.0.5 6.0.2 6.0.3 6.0.4 6.0.1 6.0.0 5.0.8 5.0.9 4.0.9 5.0.0 5.0.1 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 All 57 releases
taskbuilder / includes / class-wppm-frontend.php

class-wppm-frontend.php in Taskbuilder – Project Management & Task Management Tool With Kanban Board 4.0.3, at includes/class-wppm-frontend.php

88 lines 4.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 exit; // Exit if accessed directly
4 }
5
6 if ( ! class_exists( 'WPPM_Frontend' ) ) :
7
8 final class WPPM_Frontend {
9
10 // constructor
11 public function __construct() {
12 add_action( 'wp_enqueue_scripts', array( $this, 'loadScripts') );
13 add_shortcode( 'wppm_projects', array( $this, 'wppm_projects' ) );
14 add_shortcode( 'wppm_tasks', array( $this, 'wppm_tasks' ) );
15 add_shortcode( 'wppm_public_projects_tasks', array( $this, 'wppm_public_projects_tasks' ) );
16 add_action('wp_ajax_nopriv_wppm_sign_in',array($this,'wppm_sign_in'));
17 add_action('wp_ajax_nopriv_wppm_set_user_login',array($this,'wppm_set_user_login'));
18 }
19
20 // Load scripts
21 public function loadScripts(){
22 //bootstrap
23 wp_register_style('wppm-bootstrap-css', WPPM_PLUGIN_URL.'asset/css/wppm_bootstrap.css?version='.WPPM_VERSION );
24 //admin scripts
25 wp_register_script('wppm-admin', WPPM_PLUGIN_URL.'asset/js/admin.js?version='.WPPM_VERSION, array('jquery'));
26 wp_register_script('wppm-public', WPPM_PLUGIN_URL.'asset/js/public.js?version='.WPPM_VERSION, array('jquery'));
27 wp_register_script('wppm-modal', WPPM_PLUGIN_URL.'asset/js/modal.js?version='.WPPM_VERSION, array('jquery'));
28 wp_register_script('wppm-flatpickr-js', WPPM_PLUGIN_URL.'asset/lib/flatpickr/flatpickr.js?version='.WPPM_VERSION, array('jquery'));
29 wp_register_script('wppm-select2-js', WPPM_PLUGIN_URL.'asset/lib/select2/select2.min.js?version='.WPPM_VERSION, array('jquery'));
30 wp_register_script('wppm-gpopover-js', WPPM_PLUGIN_URL.'asset/lib/gpopover/jquery.gpopover.js?version='.WPPM_VERSION, array('jquery'));
31 wp_register_script('wppm-dragula-js', WPPM_PLUGIN_URL.'asset/lib/dragula/dragula.min.js?version='.WPPM_VERSION, array('jquery'));
32 wp_register_script('wppm-datatable-js', WPPM_PLUGIN_URL.'asset/lib/DataTables/datatables.min.js?version='.WPPM_VERSION, array('jquery'));
33 wp_register_style('wppm-public-css', WPPM_PLUGIN_URL . 'asset/css/public.css?version='.WPPM_VERSION );
34 wp_register_style('wppm-admin-css', WPPM_PLUGIN_URL . 'asset/css/admin.css?version='.WPPM_VERSION );
35 wp_register_style('wppm-modal-css', WPPM_PLUGIN_URL . 'asset/css/modal.css?version='.WPPM_VERSION );
36 wp_register_style('wppm-flatpickr-css', WPPM_PLUGIN_URL . 'asset/lib/flatpickr/flatpickr.min.css?version='.WPPM_VERSION );
37 wp_register_style('wppm-select2-css', WPPM_PLUGIN_URL . 'asset/lib/select2/select2.min.css?version='.WPPM_VERSION );
38 wp_register_style('wppm-gpopover-css', WPPM_PLUGIN_URL . 'asset/lib/gpopover/jquery.gpopover.css?version='.WPPM_VERSION );
39 wp_register_style('wppm-dragula-css', WPPM_PLUGIN_URL . 'asset/lib/dragula/dragula.min.css?version='.WPPM_VERSION );
40 wp_register_script('wppm-datatable-js',WPPM_PLUGIN_URL.'asset/lib/DataTables/datatables.min.js?version='.WPPM_VERSION, array('jquery'));
41 wp_register_style('wppm-datatable-css',WPPM_PLUGIN_URL.'asset/lib/DataTables/datatables.min.css?version='.WPPM_VERSION );
42 //localize script
43 $loading_html = '<div class="wppm_loading_icon"><img src="'.WPPM_PLUGIN_URL.'asset/images/ajax-loading.gif"></div>';
44 $localize_script_data = apply_filters( 'wppm_public_localize_script', array(
45 'ajax_url' => admin_url( 'admin-ajax.php' ),
46 'loading_html' => $loading_html,
47 'please_wait' =>__('Please wait ...','taskbuilder'),
48 'confirm' =>__('Are you sure?','taskbuilder'),
49 'auth_code' => isset($_REQUEST['auth-code'])? sanitize_text_field($_REQUEST['auth-code']) :""
50 ));
51 wp_localize_script( 'wppm-public', 'wppm_admin', $localize_script_data );
52 do_action('wppm_after_enqueue_script',$localize_script_data);
53 }
54 /**
55 * Main shortcode
56 */
57
58 function wppm_projects(){
59 ob_start();
60 include WPPM_ABSPATH.'includes/frontend/shortcode.php';
61 return ob_get_clean();
62 }
63
64 function wppm_tasks($attr){
65 ob_start();
66 include WPPM_ABSPATH.'includes/frontend/wppm_tasks_shortcode.php';
67 return ob_get_clean();
68 }
69
70 function wppm_sign_in(){
71 include WPPM_ABSPATH.'includes/frontend/wppm_sign_in.php';
72 die();
73 }
74
75 function wppm_set_user_login(){
76 include WPPM_ABSPATH.'includes/frontend/wppm_set_user_login.php';
77 }
78
79 function wppm_public_projects_tasks(){
80 ob_start();
81 include WPPM_ABSPATH.'includes/frontend/wppm_public_projects_tasks.php';
82 return ob_get_clean();
83 }
84
85 }
86 endif;
87
88 new WPPM_Frontend();