PluginProbe ʕ •ᴥ•ʔ
Nested Pages / 1.3.4
Nested Pages v1.3.4
3.1.8 3.1.9 3.2.0 3.2.1 3.2.10 3.2.11 3.2.12 3.2.13 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 trunk 1.0 1.1 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 1.3.0 1.3.1 1.3.10 1.3.11 1.3.12 1.3.13 1.3.14 1.3.15 1.3.2 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.3.1 1.6.3.2 1.6.4 1.6.5 1.6.5.1 1.6.5.2 1.6.6 1.6.7 1.6.8 1.7.0 1.7.1 2.0.1 2.0.2 2.0.3 2.0.4 3.0.1 3.0.10 3.0.11 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.10 3.1.11 3.1.12 3.1.13 3.1.14 3.1.15 3.1.16 3.1.17 3.1.18 3.1.19 3.1.2 3.1.20 3.1.21 3.1.22 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7
wp-nested-pages / app / Activation / Dependencies.php
wp-nested-pages / app / Activation Last commit date
Updates 11 years ago Activate.php 11 years ago Dependencies.php 11 years ago
Dependencies.php
138 lines
1 <?php namespace NestedPages\Activation;
2
3 use NestedPages\Entities\PostType\PostTypeRepository;
4 /**
5 * Plugin JS & CSS Dependencies
6 */
7 class Dependencies {
8
9 /**
10 * Plugin Directory
11 */
12 private $plugin_dir;
13
14 /**
15 * Plugin Version
16 */
17 private $plugin_version;
18
19 /**
20 * Post Type Repository
21 */
22 private $post_type_repo;
23
24
25 public function __construct()
26 {
27 $this->post_type_repo = new PostTypeRepository;
28 $this->setPluginVersion();
29 add_action( 'admin_enqueue_scripts', array($this, 'styles') );
30 add_action( 'admin_enqueue_scripts', array($this, 'scripts') );
31 $this->plugin_dir = plugins_url() . '/wp-nested-pages';
32 }
33
34
35 /**
36 * Set the Plugin Version
37 */
38 private function setPluginVersion()
39 {
40 global $np_version;
41 $this->plugin_version = $np_version;
42 }
43
44
45 /**
46 * Admin Styles
47 */
48 public function styles()
49 {
50 wp_enqueue_style(
51 'nestedpages',
52 $this->plugin_dir . '/assets/css/nestedpages.css',
53 array(),
54 $this->plugin_version
55 );
56 }
57
58
59 /**
60 * Admin Scripts required by plugin
61 * Only Loads on the Nested Pages screen
62 */
63 public function scripts()
64 {
65 $screen = get_current_screen();
66 global $np_env;
67 if ( strpos( $screen->id, 'nestedpages' ) ) :
68 wp_enqueue_script('suggest');
69 wp_enqueue_script('jquery-ui-core');
70 wp_enqueue_script('jquery-ui-sortable');
71 wp_enqueue_script('jquery-ui-datepicker');
72 wp_enqueue_script(
73 'bootstrap-modal',
74 $this->plugin_dir . '/assets/js/lib/bs-modal.js',
75 array('jquery'),
76 '1.0'
77 );
78 wp_enqueue_script(
79 'ui-touch-punch',
80 $this->plugin_dir . '/assets/js/lib/jquery.ui.touch-punch.min.js',
81 array('jquery', 'jquery-ui-sortable'),
82 '1.0'
83 );
84 wp_enqueue_script(
85 'nested-sortable',
86 $this->plugin_dir . '/assets/js/lib/jquery.mjs.nestedSortable.js',
87 array('jquery', 'jquery-ui-sortable'),
88 '1.0'
89 );
90 if ( $np_env == 'dev' ){
91 wp_enqueue_script(
92 'nestedpages',
93 $this->plugin_dir . '/assets/js/lib/nestedpages.js',
94 array('jquery'),
95 $this->plugin_version
96 );
97 } else {
98 wp_enqueue_script(
99 'nestedpages',
100 $this->plugin_dir . '/assets/js/nestedpages.min.js',
101 array('jquery'),
102 $this->plugin_version
103 );
104 }
105 $localized_data = array(
106 'np_nonce' => wp_create_nonce( 'nestedpages-nonce' ),
107 'expand_text' => __('Expand All', 'nestedpages'),
108 'collapse_text' => __('Collapse All', 'nestedpages'),
109 'show_hidden' => __('Show Hidden', 'nestedpages'),
110 'hide_hidden' => __('Hide Hidden', 'nestedpages'),
111 'add_link' => __('Add Link', 'nestedpages'),
112 'add_child_link' => __('Add Child Link', 'nestedpages'),
113 'title' => __('Title', 'nestedpages'),
114 'quick_edit' => __('Quick Edit', 'nestedpages'),
115 'page_title' => __('Page Title', 'nestedpages'),
116 'view' => __('View', 'nestedpages'),
117 'add_child_short' => __('Add Child', 'nestedpages'),
118 'add_child' => __('Add Child Page', 'nestedpages'),
119 'add_child_pages' => __('Add Child Pages', 'nestedpages'),
120 'add' => __('Add', 'nestedpages'),
121 'add_page' => __('Add Page', 'nestedpages'),
122 'add_pages' => __('Add Pages', 'nestedpages'),
123 'add_multiple' => __('Add Multiple', 'nestedpages'),
124 'trash_confirm' => __('Are you sure you would like to empty the trash? This action is not reversable.', 'nestedpages')
125 );
126 $syncmenu = ( get_option('nestedpages_menusync') == 'sync' ) ? true : false;
127 $localized_data['syncmenu'] = $syncmenu;
128 $localized_data['post_types'] = $this->post_type_repo->getPostTypesObject();
129 wp_localize_script(
130 'nestedpages',
131 'nestedpages',
132 $localized_data
133 );
134 endif;
135 }
136
137
138 }