PluginProbe
CSS & JavaScript Toolbox / 7.2
CSS & JavaScript Toolbox v7.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/extensions/package/extension.php +20 -20 127.2 View file →
@@ -1,31 +1,31 @@
1 1 <?php
2 2 /**
3 -*
3 +*
4 4 */
5 5
6 6 /**
7 -*
7 +*
8 8 */
9 9 abstract class CJT_Framework_Extensions_Package_Extension extends CJTHookableClass {
10 10
11 11 /**
12 12 * put your comment there...
13 - *
13 + *
14 14 * @var mixed
15 15 */
16 16 protected $extension;
17 -
17 +
18 18 /**
19 19 * put your comment there...
20 - *
20 + *
21 21 * @var mixed
22 22 */
23 23 protected $extensionClass;
24 -
24 +
25 25 /**
26 26 * put your comment there...
27 - *
27 + *
28 28 * @param mixed $extension
29 29 * @return CJT_Framework_Extensions_Package_Extension
30 30 */
31 31 public function __construct($extension) {
@@ -35,9 +35,9 @@
35 35 }
36 36
37 37 /**
38 38 * Uninstaller for all Package Extension
39 - *
39 + *
40 40 * @param mixed $method
41 41 * @param mixed $params
42 42 * @return CJTWordpressEvents
43 43 */
@@ -60,9 +60,9 @@
60 60 }
61 61
62 62 /**
63 63 * put your comment there...
64 - *
64 + *
65 65 */
66 66 public function _checkInstallationState() {
67 67 # Initialize
68 68 $extensionClass = $this->extensionClass;
@@ -68,9 +68,9 @@
68 68 $extensionClass = $this->extensionClass;
69 69 $extension =& $this->extension;
70 70 $extensionDeDoc =& $extension['defDoc'];
71 71 $extensionState = new CJT_Framework_Extensions_Package_State_Extension($extensionDeDoc);
72 - # Upgrade and Install is the same both
72 + # Upgrade and Install is the same both
73 73 # required checking the packages inside
74 74 # Package-Extension is a only a wrapper for packages inside!
75 75 if ($extensionState->getState() != CJT_Framework_Extensions_Package_State_Extension::INSTALLED) {
76 76 # Initialize
@@ -75,9 +75,9 @@
75 75 if ($extensionState->getState() != CJT_Framework_Extensions_Package_State_Extension::INSTALLED) {
76 76 # Initialize
77 77 $packageFileModel = CJTModel::getInstance('package-file');
78 78 $packageModel = CJTModel::getInstance('package');
79 - $extensionDir = WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . $extension['dir'];
79 + $extensionDir = ABSPATH . PLUGINDIR . DIRECTORY_SEPARATOR . $extension['dir'];
80 80 $packagesFolderPath = $extensionDir . DIRECTORY_SEPARATOR . ((string) $extensionDeDoc->packages->attributes()->folder);
81 81 # Getting packages state
82 82 $extensionPackagesState = new CJT_Framework_Extensions_Package_State_Packages($extensionDeDoc);
83 83 # Check packages
@@ -113,15 +113,15 @@
113 113 $extensionPackagesState->upgrade();
114 114 # Upgrade extension state
115 115 $extensionState->upgrade($extension['defFile']);
116 116 # Register uninstaller
117 - register_uninstall_hook($extension['pluginFile'], array(__CLASS__, "uninstall_{$extensionClass}"));
117 + register_uninstall_hook($extension['pluginFile'], array(__CLASS__, "uninstall_{$extensionClass}"));
118 118 }
119 119 }
120 120
121 121 /**
122 122 * put your comment there...
123 - *
123 + *
124 124 */
125 125 public function _extensionDeactivated() {
126 126 # Initialize
127 127 $extension =& $this->extension;
@@ -132,33 +132,33 @@
132 132 }
133 133
134 134 /**
135 135 * put your comment there...
136 - *
136 + *
137 137 */
138 138 public function getInvolved() {
139 - # Check installation state
139 + # Check installation state
140 140 if (CJTPlugin::getInstance()->isInstalled()) {
141 141 # INitialize
142 142 $extensionClass = $this->extensionClass;
143 143 $extension =& $this->extension;
144 - $extensionFile = WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . $extension['dir'] . DIRECTORY_SEPARATOR . $extension['file'];
144 + $extensionFile = ABSPATH . PLUGINDIR . DIRECTORY_SEPARATOR . $extension['dir'] . DIRECTORY_SEPARATOR . $extension['file'];
145 145 # Load/install extensions packages hook
146 - add_action('init', array($this, '_checkInstallationState'));
146 + add_action('init', array($this, '_checkInstallationState'));
147 147 # Deactivation hooks
148 148 register_deactivation_hook($extensionFile, array($this, '_extensionDeactivated'));
149 149 }
150 150 }
151 -
151 +
152 152 /**
153 153 * put your comment there...
154 - *
154 + *
155 155 * @param mixed $class
156 156 */
157 157 public static function getPluginExtensionClass($object) {
158 158 return str_replace('_Plugin', '', get_class($object));
159 159 }
160 -
160 +
161 161 } # End class
162 162
163 163 // Hiookable!
164 164 CJT_Framework_Extensions_Package_Extension::define('CJT_Framework_Extensions_Package_Extension', array('hookType' => CJTWordpressEvents::HOOK_FILTER));