PluginProbe
CSS & JavaScript Toolbox / 8.0.3
CSS & JavaScript Toolbox v8.0.3
trunk 0.3 0.8 10 10.1 11 11.2 11.3 11.4 11.5 11.6 11.7 11.8 11.9 11.9.1 12 12.0 12.0.1 12.0.3 12.0.4 12.0.5 12.0.6 12.0.7 6.0 6.0.11 All 60 releases
← All changes | access.points/extensions.accesspoint.php +17 -43 108.0.3 View file →
@@ -1,7 +1,7 @@
1 1 <?php
2 2 /**
3 -*
3 +*
4 4 */
5 5
6 6 // Disallow direct access.
7 7 defined('ABSPATH') or die("Access denied");
@@ -6,25 +6,25 @@
6 6 // Disallow direct access.
7 7 defined('ABSPATH') or die("Access denied");
8 8
9 9 /**
10 -*
10 +*
11 11 */
12 12 class CJTExtensionsAccessPoint extends CJTAccessPoint {
13 -
13 +
14 14 /**
15 - *
15 + *
16 16 */
17 17 const MENU_POSITION_INDEX = 2;
18 -
18 +
19 19 /**
20 - *
20 + *
21 21 */
22 - const PLUGINS_PAGE_SEARCH_TERM = 'css-javascript-toolbox';
23 -
22 + const PLUGINS_PAGE_SEARCH_TERM = 'CJT-Extension';
23 +
24 24 /**
25 25 * put your comment there...
26 - *
26 + *
27 27 */
28 28 public function __construct() {
29 29 // Initialize Access Point base!
30 30 parent::__construct();
@@ -33,9 +33,9 @@
33 33 }
34 34
35 35 /**
36 36 * put your comment there...
37 - *
37 + *
38 38 */
39 39 protected function doListen() {
40 40 // Only if permitted!
41 41 if ($this->hasAccess()) {
@@ -42,51 +42,25 @@
42 42 // Add menu pages.
43 43 add_action('admin_menu', array(&$this, 'menu'), 13);
44 44 }
45 45 }
46 -
46 +
47 47 /**
48 48 * put your comment there...
49 - *
49 + *
50 50 */
51 51 public function menu() {
52 52 // Extensions page.
53 - // add_submenu_page(CJTPlugin::PLUGIN_REQUEST_ID, null, cssJSToolbox::getText('Extensions'), 'administrator', null);
53 + add_submenu_page(CJTPlugin::PLUGIN_REQUEST_ID, null, cssJSToolbox::getText('Extensions'), 'administrator', null);
54 54 // Hack Extensions menu item to point to Plugins page!
55 - // $GLOBALS['submenu'][CJTPlugin::PLUGIN_REQUEST_ID][self::MENU_POSITION_INDEX][2] = admin_url('plugins.php?s=' . self::PLUGINS_PAGE_SEARCH_TERM);
55 + $GLOBALS['submenu'][CJTPlugin::PLUGIN_REQUEST_ID][self::MENU_POSITION_INDEX][2] = admin_url('plugins.php?s=' . self::PLUGINS_PAGE_SEARCH_TERM);
56 56 // When plugins page loaded!
57 -
58 - /**
59 - * Need this to fix the menu issue with CJT PLUS 8.4 or lower.
60 - *
61 - */
62 - if ( class_exists( 'CJTPlus' ) ) :
63 - $reflector = new \ReflectionClass( 'CJTPlus' );
64 - $CJTPlusVersion = get_plugin_data( str_replace( 'plus.class', 'plus', $reflector->getFileName() ) )['Version'];
65 -
66 - if ( version_compare( $CJTPlusVersion, '8.4', '<=' ) ) {
67 - global $menu, $submenu;
68 -
69 - # Find CJT Menu and Sub Menu, ADD PLUS to the title
70 - foreach( $menu as & $menuItem )
71 - {
72 -
73 - if ( $menuItem[ 2 ] == 'cjtoolbox' )
74 - {
75 - $submenu[ 'cjtoolbox' ][ 0 ] [ 0 ] = $menuItem[ 0 ];
76 - $submenu[ 'cjtoolbox' ][ 0 ] [ 1 ] = 'administrator';
77 - $submenu[ 'cjtoolbox' ][ 0 ] [ 2 ] = 'cjtoolbox';
78 - }
79 - }
80 - }
81 - endif;
82 -
83 57 add_action('load-plugins.php', array($this, 'route'), 10, 0);
84 58 }
85 -
59 +
86 60 /**
87 61 * put your comment there...
88 - *
62 + *
89 63 */
90 64 public function route($loadView = null, $request = array('view' => 'extensions/plugins-list')) {
91 65 // Set as connected object!
92 66 $this->connected();
@@ -96,9 +70,9 @@
96 70 ->setAction('extensions')
97 71 // Dispatch the call!
98 72 ->_doAction();
99 73 }
100 -
74 +
101 75 } // End class.
102 76
103 77 // Hookable!
104 78 CJTExtensionsAccessPoint::define('CJTExtensionsAccessPoint', array('hookType' => CJTWordpressEvents::HOOK_FILTER));