PluginProbe
CSS & JavaScript Toolbox / 11
CSS & JavaScript Toolbox v11
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
css-javascript-toolbox / access.points / autoupgrade.accesspoint.php

autoupgrade.accesspoint.php in CSS & JavaScript Toolbox 11, at access.points/autoupgrade.accesspoint.php

70 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 *
4 */
5
6 // Disallow direct access.
7 defined('ABSPATH') or die("Access denied");
8
9 /**
10 * Enable automatic upgrades CJT Plugin
11 * and all its installed extensions!
12 *
13 * Special type of access point that will do the job and
14 * then it'll unload itself!
15 *
16 * @author Ahmed Hamed
17 */
18 class CJTAutoUpgradeAccessPoint extends CJTAccessPoint {
19
20 /**
21 * put your comment there...
22 *
23 */
24 public function __construct() {
25 // Initialize Access Point base!
26 parent::__construct();
27 // Set access point name!
28 $this->name = 'auto-upgrade';
29 }
30
31 /**
32 * put your comment there...
33 *
34 */
35 protected function doListen() {
36 // Only if permitted!
37 if ($this->hasAccess()) {
38 add_action('admin_init', array(&$this, 'route'), 10, 0);
39 }
40 }
41
42 /**
43 * This access point is to do internal jobs without
44 * taking the place of the activate controller that requested
45 * by client!
46 *
47 * @return Boolean false
48 */
49 public function connected() {
50 throw new Exception('I\'ll never be the connected object!');
51 }
52
53 /**
54 * put your comment there...
55 *
56 */
57 public function route($loadView = false, $request = null) {
58 // Load Auto Upgrade controller!
59 $this->controllerName = 'auto-upgrade';
60 parent::route($loadView, $request)
61 // Set action name to autoUpgrade
62 ->setAction('enable')
63 // fire action to enable automatic upgrade!
64 ->_doAction();
65 }
66
67 } // End class.
68
69 // Hookable!
70 CJTAutoUpgradeAccessPoint::define('CJTAutoUpgradeAccessPoint', array('hookType' => CJTWordpressEvents::HOOK_FILTER));