| 1 |
<?php |
| 2 |
/** |
| 3 |
* |
| 4 |
*/ |
| 5 |
|
| 6 |
// Disallow direct access. |
| 7 |
defined('ABSPATH') or die("Access denied"); |
| 8 |
|
| 9 |
/** |
| 10 |
* |
| 11 |
*/ |
| 12 |
class CJTManageAccessPoint extends CJTPageAccessPoint { |
| 13 |
|
| 14 |
/** |
| 15 |
* put your comment there... |
| 16 |
* |
| 17 |
*/ |
| 18 |
public function __construct() { |
| 19 |
// Initialize Access Point base! |
| 20 |
parent::__construct(); |
| 21 |
// Set access point name! |
| 22 |
$this->name = 'manage'; |
| 23 |
} |
| 24 |
|
| 25 |
/** |
| 26 |
* put your comment there... |
| 27 |
* |
| 28 |
*/ |
| 29 |
protected function doListen() { |
| 30 |
// Only if permitted! |
| 31 |
if ($this->hasAccess()) { |
| 32 |
// Add menu page. |
| 33 |
add_action('admin_menu', array(&$this, 'menu')); |
| 34 |
} |
| 35 |
} |
| 36 |
|
| 37 |
/** |
| 38 |
* put your comment there... |
| 39 |
* |
| 40 |
*/ |
| 41 |
public function menu() { |
| 42 |
// Blocks Manager page! The only Wordpress menu item we've. |
| 43 |
$pageHookId= add_menu_page( |
| 44 |
cssJSToolbox::getText('CSS & JavaScript Toolbox'), |
| 45 |
cssJSToolbox::getText('CSS & JavaScript Toolbox'), |
| 46 |
'administrator', |
| 47 |
CJTPlugin::PLUGIN_REQUEST_ID, |
| 48 |
array(&$this->controller, '_doAction'), |
| 49 |
CJTOOLBOX_VIEWS_URL . '/blocks/manager/public/images/menu.svg' |
| 50 |
); |
| 51 |
// Process request if installed! |
| 52 |
add_action("load-{$pageHookId}", array($this, 'getPage')); |
| 53 |
} |
| 54 |
|
| 55 |
} // End class. |
| 56 |
|
| 57 |
// Hookable! |
| 58 |
CJTManageAccessPoint::define('CJTManageAccessPoint', array('hookType' => CJTWordpressEvents::HOOK_FILTER)); |