PluginProbe
Taskbuilder – Project Management & Task Management Tool With Kanban Board / 3.0.6
Taskbuilder – Project Management & Task Management Tool With Kanban Board v3.0.6
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 3.0.6, at includes/class-wppm-frontend.php

80 lines 4.5 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_action('wp_ajax_nopriv_wppm_sign_in',array($this,'wppm_sign_in'));
16 add_action('wp_ajax_nopriv_wppm_set_user_login',array($this,'wppm_set_user_login'));
17 }
18
19 // Load scripts
20 public function loadScripts(){
21 //bootstrap
22 wp_register_style('wppm-bootstrap-css', WPPM_PLUGIN_URL.'asset/css/wppm_bootstrap.css?version='.WPPM_VERSION );
23 //admin scripts
24 wp_register_script('wppm-admin', WPPM_PLUGIN_URL.'asset/js/admin.js?version='.WPPM_VERSION, array('jquery'));
25 wp_register_script('wppm-public', WPPM_PLUGIN_URL.'asset/js/public.js?version='.WPPM_VERSION, array('jquery'));
26 wp_register_script('wppm-modal', WPPM_PLUGIN_URL.'asset/js/modal.js?version='.WPPM_VERSION, array('jquery'));
27 wp_register_script('wppm-flatpickr-js', WPPM_PLUGIN_URL.'asset/lib/flatpickr/flatpickr.js?version='.WPPM_VERSION, array('jquery'));
28 wp_register_script('wppm-select2-js', WPPM_PLUGIN_URL.'asset/lib/select2/select2.min.js?version='.WPPM_VERSION, array('jquery'));
29 wp_register_script('wppm-gpopover-js', WPPM_PLUGIN_URL.'asset/lib/gpopover/jquery.gpopover.js?version='.WPPM_VERSION, array('jquery'));
30 wp_register_script('wppm-dragula-js', WPPM_PLUGIN_URL.'asset/lib/dragula/dragula.min.js?version='.WPPM_VERSION, array('jquery'));
31 wp_register_script('wppm-datatable-js', WPPM_PLUGIN_URL.'asset/lib/DataTables/datatables.min.js?version='.WPPM_VERSION, array('jquery'));
32 wp_register_style('wppm-public-css', WPPM_PLUGIN_URL . 'asset/css/public.css?version='.WPPM_VERSION );
33 wp_register_style('wppm-admin-css', WPPM_PLUGIN_URL . 'asset/css/admin.css?version='.WPPM_VERSION );
34 wp_register_style('wppm-modal-css', WPPM_PLUGIN_URL . 'asset/css/modal.css?version='.WPPM_VERSION );
35 wp_register_style('wppm-flatpickr-css', WPPM_PLUGIN_URL . 'asset/lib/flatpickr/flatpickr.min.css?version='.WPPM_VERSION );
36 wp_register_style('wppm-select2-css', WPPM_PLUGIN_URL . 'asset/lib/select2/select2.min.css?version='.WPPM_VERSION );
37 wp_register_style('wppm-gpopover-css', WPPM_PLUGIN_URL . 'asset/lib/gpopover/jquery.gpopover.css?version='.WPPM_VERSION );
38 wp_register_style('wppm-dragula-css', WPPM_PLUGIN_URL . 'asset/lib/dragula/dragula.min.css?version='.WPPM_VERSION );
39 wp_register_script('wppm-datatable-js',WPPM_PLUGIN_URL.'asset/lib/DataTables/datatables.min.js?version='.WPPM_VERSION, array('jquery'));
40 wp_register_style('wppm-datatable-css',WPPM_PLUGIN_URL.'asset/lib/DataTables/datatables.min.css?version='.WPPM_VERSION );
41 //localize script
42 $loading_html = '<div class="wppm_loading_icon"><img src="'.WPPM_PLUGIN_URL.'asset/images/ajax-loading.gif"></div>';
43 $localize_script_data = apply_filters( 'wppm_public_localize_script', array(
44 'ajax_url' => admin_url( 'admin-ajax.php' ),
45 'loading_html' => $loading_html,
46 'please_wait' =>__('Please wait ...','taskbuilder'),
47 'confirm' =>__('Are you sure?','taskbuilder')
48 ));
49 wp_localize_script( 'wppm-public', 'wppm_admin', $localize_script_data );
50 do_action('wppm_after_enqueue_script',$localize_script_data);
51 }
52 /**
53 * Main shortcode
54 */
55
56 function wppm_projects(){
57 ob_start();
58 include WPPM_ABSPATH.'includes/frontend/shortcode.php';
59 return ob_get_clean();
60 }
61
62 function wppm_tasks($attr){
63 ob_start();
64 include WPPM_ABSPATH.'includes/frontend/wppm_tasks_shortcode.php';
65 return ob_get_clean();
66 }
67
68 function wppm_sign_in(){
69 include WPPM_ABSPATH.'includes/frontend/wppm_sign_in.php';
70 die();
71 }
72
73 function wppm_set_user_login(){
74 include WPPM_ABSPATH.'includes/frontend/wppm_set_user_login.php';
75 }
76
77 }
78 endif;
79
80 new WPPM_Frontend();