PluginProbe
UpdraftCentral Dashboard / 0.8.13
UpdraftCentral Dashboard v0.8.13
0.8.33 0.7.2 0.7.3 0.7.4 0.8.0 0.8.1 0.8.10 0.8.11 0.8.12 0.8.13 0.8.14 0.8.15 0.8.16 0.8.17 0.8.18 0.8.19 0.8.2 0.8.20 0.8.21 0.8.22 0.8.23 0.8.24 0.8.25 0.8.26 0.8.27 All 51 releases
updraftcentral / modules / site_search / loader.php

loader.php in UpdraftCentral Dashboard 0.8.13, at modules/site_search/loader.php

72 lines 2.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if (!defined('UD_CENTRAL_DIR')) die('Security check');
4
5 class UpdraftCentral_Module_Site_Search {
6 const MODULE_NAME = 'site_search';
7
8 /**
9 * Constructor
10 */
11 public function __construct() {
12 add_action('updraftcentral_load_dashboard_js', array($this, 'load_dashboard_js'));
13 add_action('updraftcentral_load_dashboard_css', array($this, 'load_dashboard_css'));
14 add_filter('updraftcentral_udrclion', array($this, 'udrclion'));
15 add_filter('updraftcentral_template_directories', array($this, 'template_directories'));
16 add_action('updraftcentral_dashboard_pre_header', array($this, 'dashboard_pre_header'), 999);
17 }
18
19 /**
20 * Function to load the template directories
21 *
22 * @param string $template_directories - The array with all template directories
23 * @return string $template_directories - The updated array with this modules templates in it
24 */
25 public function template_directories($template_directories) {
26 $template_directories[self::MODULE_NAME] = __DIR__.'/templates';
27 return $template_directories;
28 }
29
30 /**
31 * Function to load this modules js files
32 *
33 * @param {string} $enqueue_version - the version number
34 * @return {void}
35 */
36 public function load_dashboard_js($enqueue_version) {
37 wp_enqueue_script('updraftcentral-dashboard-activities-'.self::MODULE_NAME, UD_CENTRAL_URL.'/modules/'.self::MODULE_NAME.'/'.self::MODULE_NAME.'.js', array('updraftcentral-dashboard', 'jquery'), $enqueue_version);
38 }
39
40 /**
41 * Function to load this modules css files
42 *
43 * @param {string} $enqueue_version - the version number
44 * @return {void}
45 */
46 public function load_dashboard_css($enqueue_version) {
47 wp_enqueue_style('updraftcentral-dashboard-css-'.self::MODULE_NAME, UD_CENTRAL_URL.'/modules/'.self::MODULE_NAME.'/'.self::MODULE_NAME.'.css', array('updraftcentral-dashboard-css'), $enqueue_version);
48 }
49
50 /**
51 * Function to load this modules translations file
52 *
53 * @param {array} $localize - The array with all the modules translations files
54 * @return {array} $localize - The updated array with this modules templates in it.
55 */
56 public function udrclion($localize) {
57 $localize[self::MODULE_NAME] = include(__DIR__.'/translations-dashboard.php');
58 return $localize;
59 }
60
61 /**
62 * Function to load the file with management actions
63 *
64 * @return {void}
65 */
66 public function dashboard_pre_header() {
67 UpdraftCentral()->include_template(self::MODULE_NAME.'/management-actions.php');
68 }
69 }
70
71 $updraftcentral_module_site_search = new UpdraftCentral_Module_Site_Search();
72