PluginProbe
CSS & JavaScript Toolbox / 8.2
CSS & JavaScript Toolbox v8.2
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 | framework/access-points/access-point.class.php +54 -54 128.2 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");
@@ -9,60 +9,60 @@
9 9 /**
10 10 * Access Point interface
11 11 */
12 12 interface CJTIAccessPoint {
13 -
13 +
14 14 /**
15 15 * put your comment there...
16 - *
16 + *
17 17 */
18 18 public function listen();
19 -
19 +
20 20 }
21 21
22 22 /**
23 -*
23 +*
24 24 */
25 25 abstract class CJTAccessPoint extends CJTHookableClass implements CJTIAccessPoint {
26 -
26 +
27 27 /**
28 28 * put your comment there...
29 - *
29 + *
30 30 * @var mixed
31 31 */
32 32 protected static $connected;
33 -
33 +
34 34 /**
35 35 * put your comment there...
36 - *
36 + *
37 37 * @var mixed
38 38 */
39 39 protected $controller;
40 -
40 +
41 41 /**
42 42 * put your comment there...
43 - *
43 + *
44 44 * @var mixed
45 45 */
46 46 protected $controllerName;
47 -
47 +
48 48 /**
49 49 * put your comment there...
50 - *
50 + *
51 51 * @var mixed
52 52 */
53 53 protected $name;
54 -
54 +
55 55 /**
56 56 * put your comment there...
57 - *
57 + *
58 58 * @var mixed
59 59 */
60 60 protected $onconnected = array('parameters' => array('state'));
61 -
61 +
62 62 /**
63 63 * put your comment there...
64 - *
64 + *
65 65 * @var mixed
66 66 */
67 67 protected $ongetdefaultcontrollername = array('parameters' => array('controller'));
68 68
@@ -67,44 +67,44 @@
67 67 protected $ongetdefaultcontrollername = array('parameters' => array('controller'));
68 68
69 69 /**
70 70 * put your comment there...
71 - *
71 + *
72 72 * @var mixed
73 73 */
74 74 protected $onlisten = array('hookType' =>CJTWordpressEvents::HOOK_ACTION);
75 -
75 +
76 76 /**
77 77 * put your comment there...
78 - *
78 + *
79 79 * @var mixed
80 80 */
81 81 protected $onsetcontroller = array('parameters' => array('controller'));
82 -
82 +
83 83 /**
84 84 * put your comment there...
85 - *
85 + *
86 86 * @var mixed
87 87 */
88 88 protected $overrideControllersPath = null;
89 -
89 +
90 90 /**
91 91 * put your comment there...
92 - *
92 + *
93 93 * @var mixed
94 94 */
95 95 protected $overrideControllersPrefix = null;
96 -
96 +
97 97 /**
98 98 * put your comment there...
99 - *
99 + *
100 100 * @var mixed
101 101 */
102 102 protected $pageId = CJTPlugin::PLUGIN_REQUEST_ID;
103 -
103 +
104 104 /**
105 105 * put your comment there...
106 - *
106 + *
107 107 */
108 108 public function __construct($defaultController = 'blocks') {
109 109 // Initialize Hookable.
110 110 parent::__construct();
@@ -110,18 +110,18 @@
110 110 parent::__construct();
111 111 // Overrides controllers path using current Access Point model class path
112 112 $accessPointClassLoader =& CJT_Framework_Autoload_Loader::findClassLoader(get_class($this));
113 113 if ($accessPointClassLoader) {
114 - $this->overrideControllersPath = $accessPointClassLoader->getPath() . DIRECTORY_SEPARATOR . 'controllers';
114 + $this->overrideControllersPath = $accessPointClassLoader->getPath() . DIRECTORY_SEPARATOR . 'controllers';
115 115 $this->overrideControllersPrefix = $accessPointClassLoader->getPrefix();
116 116 }
117 117 // Initialize!
118 - $this->controllerName = $this->ongetdefaultcontrollername(isset($_REQUEST['controller']) ? esc_html($_REQUEST['controller']) : $defaultController);
118 + $this->controllerName = $this->ongetdefaultcontrollername(isset($_REQUEST['controller']) ? $_REQUEST['controller'] : $defaultController);
119 119 }
120 -
120 +
121 121 /**
122 122 * put your comment there...
123 - *
123 + *
124 124 * @return Boolean TRUE if it wasn't connected! FALSE otherwise.
125 125 */
126 126 protected function connected() {
127 127 // Do connect only if not connected yet
@@ -132,58 +132,58 @@
132 132 self::$connected = $this;
133 133 }
134 134 return $returns;
135 135 }
136 -
136 +
137 137 /**
138 138 * put your comment there...
139 - *
139 + *
140 140 */
141 141 protected abstract function doListen();
142 -
142 +
143 143 /**
144 144 * put your comment there...
145 - *
145 + *
146 146 */
147 147 public function & getController() {
148 - return $this->controller;
148 + return $this->controller;
149 149 }
150 -
150 +
151 151 /**
152 152 * put your comment there...
153 - *
153 + *
154 154 */
155 155 public function getControllerName() {
156 - return $this->controllerName;
156 + return $this->controllerName;
157 157 }
158 -
158 +
159 159 /**
160 160 * put your comment there...
161 - *
161 + *
162 162 */
163 163 public function getName() {
164 164 return $this->name;
165 165 }
166 -
166 +
167 167 /**
168 168 * put your comment there...
169 - *
169 + *
170 170 */
171 171 public static function & isConnected() {
172 172 return self::$connected;
173 173 }
174 -
174 +
175 175 /**
176 176 * put your comment there...
177 - *
177 + *
178 178 */
179 179 public function hasAccess() {
180 180 return current_user_can('administrator');
181 181 }
182 -
182 +
183 183 /**
184 184 * put your comment there...
185 - *
185 + *
186 186 */
187 187 public function listen() {
188 188 // Fire listen event!
189 189 $this->onlisten();
@@ -190,12 +190,12 @@
190 190 // Allow access points to bind their hooks
191 191 $this->doListen();
192 192 return $this;
193 193 }
194 -
194 +
195 195 /**
196 196 * put your comment there...
197 - *
197 + *
198 198 * @param mixed $request
199 199 */
200 200 public function route($loadView = null, $request = null) {
201 201 // Only loading one controller is allowed.
@@ -204,10 +204,10 @@
204 204 require_once CJTOOLBOX_MVC_FRAMEWOK . '/view.inc.php';
205 205 // Instantiate controller!
206 206 $this->controller = $this->onsetcontroller(
207 207 CJTController::getInstance(
208 - $this->controllerName,
209 - $loadView,
208 + $this->controllerName,
209 + $loadView,
210 210 $request,
211 211 $this->overrideControllersPath,
212 212 $this->overrideControllersPrefix
213 213 ));
@@ -213,9 +213,9 @@
213 213 ));
214 214 }
215 215 return $this->controller;
216 216 }
217 -
217 +
218 218 } // End class.
219 219
220 220 // Hookable!
221 -CJTAccessPoint::define('CJTAccessPoint', array('hookType' => CJTWordpressEvents::HOOK_FILTER));
221 +CJTAccessPoint::define('CJTAccessPoint', array('hookType' => CJTWordpressEvents::HOOK_FILTER));