PluginProbe
CSS & JavaScript Toolbox / 6.0
CSS & JavaScript Toolbox v6.0
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 / installer.accesspoint.php

installer.accesspoint.php in CSS & JavaScript Toolbox 6.0, at access.points/installer.accesspoint.php

90 lines 1.8 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 *
11 */
12 class CJTInstallerAccessPoint extends CJTAccessPoint {
13
14 /**
15 * put your comment there...
16 *
17 * @var mixed
18 */
19 protected $stopNotices = false;
20
21 /**
22 * put your comment there...
23 *
24 */
25 public function __construct() {
26 // Initialize parent.
27 parent::__construct();
28 // Set name!
29 $this->name = 'installer';
30 }
31 /**
32 * put your comment there...
33 *
34 */
35 protected function doListen() {
36 // If not installed and not in manage page display admin notice!
37 if (!CJTPlugin::getInstance()->isInstalled() && $this->hasAccess()) {
38 add_action('admin_notices', array(&$this, 'notInstalledAdminNotice'));
39 }
40 }
41
42 /**
43 * put your comment there...
44 *
45 */
46 public function installationPage() {
47 if ($this->hasAccess()) {
48 // Set as connected object!
49 $this->connected();
50 // Set controller internal parameters.
51 $_REQUEST['view'] = 'installer/install';
52 // create controller.
53 return $this->route()
54 // Set Action
55 ->setAction('install');
56 }
57 }
58
59 /**
60 * put your comment there...
61 *
62 */
63 public function notInstalledAdminNotice() {
64 // Show Not installed admin notice only
65 // if there is no access point processed/connected the request
66 if (!$this->stopNotices) {
67 // Set MVC request parameters.
68 $_REQUEST['view'] = 'installer/notice';
69 // Instantiate installer cotroller and fire notice action!
70 $this->route()
71 // Set action name.
72 ->setAction('notInstalledNotice')
73 // Fire action!
74 ->_doAction();
75 }
76 }
77
78 /**
79 * put your comment there...
80 *
81 */
82 public function stopNotices() {
83 // Do not show admin notcies!
84 $this->stopNotices = true;
85 }
86
87 } // End class.
88
89 // Hookable!
90 CJTInstallerAccessPoint::define('CJTInstallerAccessPoint', array('hookType' => CJTWordpressEvents::HOOK_FILTER));