CSS & JavaScript Toolbox - Version 9.4

Version Description

  • Improved variable security throughout the plugin.
  • Fix: Bugs fixed.
  • Fix: PHP notices and warnings fixed.
Download this release

Release Info

Developer wipeoutmedia
Plugin Icon 128x128 CSS & JavaScript Toolbox
Version 9.4
Comparing to
See all releases

Code changes from version 9.3.1 to 9.4

access.points/ajax.accesspoint.php CHANGED
@@ -1,19 +1,19 @@
1
  <?php
2
  /**
3
- *
4
  */
5
 
6
  // Disallow direct access.
7
  defined('ABSPATH') or die("Access denied");
8
 
9
  /**
10
- *
11
  */
12
  class CJTAjaxAccessPoint extends CJTAccessPoint {
13
-
14
  /**
15
  * put your comment there...
16
- *
17
  */
18
  public function __construct() {
19
  // Initialize Access Point base!
@@ -24,37 +24,37 @@ class CJTAjaxAccessPoint extends CJTAccessPoint {
24
 
25
  /**
26
  * put your comment there...
27
- *
28
  */
29
  protected function doListen() {
30
  // Define CJT AJAX access point!
31
  add_action("wp_ajax_{$this->pageId}_api", array(&$this, 'route'), 10, 0);
32
  }
33
-
34
  /**
35
  * put your comment there...
36
- *
37
  */
38
  public function route($loadView = null, $request = null) {
39
  // Initializing!
40
  $controller = false;
41
  // Controllers allowed to be Loaded if not installed
42
  $notInstalledAllowedControllers = array('installer', 'setup');
43
- // Veil access point unless CJT installed or the controller is installer (to allow instalaltion throught AJAX)!
44
  if (CJTPlugin::getInstance()->isInstalled() || in_array($this->controllerName, $notInstalledAllowedControllers)) {
45
  // Connected!
46
  $this->connected();
47
- // IF Module-Prefix passed THEN Point to correct Controller path
48
  if (isset($_REQUEST['cjtajaxmodule'])) {
49
  # try to get module associated to passed module
50
  $accessPointClassLoader = CJT_Framework_Autoload_Loader::autoLoad($_REQUEST['cjtajaxmodule']);
51
-
52
  // CODE MODIFIED BY RBJ -- START
53
  if ($accessPointClassLoader) {
54
  if ($_REQUEST['cjtajaxmodule'] == 'ECMEHD') {
55
  $this->overrideControllersPath = dirname(__DIR__) . '-plus/CJTEnv/controllers';
56
  } else {
57
- $this->overrideControllersPath = $accessPointClassLoader->getPath() . DIRECTORY_SEPARATOR . 'controllers';
58
  }
59
  $this->overrideControllersPrefix = $accessPointClassLoader->getPrefix();
60
  }
@@ -65,11 +65,11 @@ class CJTAjaxAccessPoint extends CJTAccessPoint {
65
  // Dispatch the call as its originally requested from ajax action!
66
  $action = "wp_ajax_{$this->pageId}_{$_REQUEST['CJTAjaxAction']}";
67
  // Fire Ajax action.
68
- do_action($action);
69
  }
70
  return $controller;
71
  }
72
-
73
  } // End class.
74
 
75
  // Hookable!
1
  <?php
2
  /**
3
+ *
4
  */
5
 
6
  // Disallow direct access.
7
  defined('ABSPATH') or die("Access denied");
8
 
9
  /**
10
+ *
11
  */
12
  class CJTAjaxAccessPoint extends CJTAccessPoint {
13
+
14
  /**
15
  * put your comment there...
16
+ *
17
  */
18
  public function __construct() {
19
  // Initialize Access Point base!
24
 
25
  /**
26
  * put your comment there...
27
+ *
28
  */
29
  protected function doListen() {
30
  // Define CJT AJAX access point!
31
  add_action("wp_ajax_{$this->pageId}_api", array(&$this, 'route'), 10, 0);
32
  }
33
+
34
  /**
35
  * put your comment there...
36
+ *
37
  */
38
  public function route($loadView = null, $request = null) {
39
  // Initializing!
40
  $controller = false;
41
  // Controllers allowed to be Loaded if not installed
42
  $notInstalledAllowedControllers = array('installer', 'setup');
43
+ // Veil access point unless CJT installed or the controller is installer (to allow instalaltion through AJAX)!
44
  if (CJTPlugin::getInstance()->isInstalled() || in_array($this->controllerName, $notInstalledAllowedControllers)) {
45
  // Connected!
46
  $this->connected();
47
+ // IF Module-Prefix passed THEN Point to correct Controller path
48
  if (isset($_REQUEST['cjtajaxmodule'])) {
49
  # try to get module associated to passed module
50
  $accessPointClassLoader = CJT_Framework_Autoload_Loader::autoLoad($_REQUEST['cjtajaxmodule']);
51
+
52
  // CODE MODIFIED BY RBJ -- START
53
  if ($accessPointClassLoader) {
54
  if ($_REQUEST['cjtajaxmodule'] == 'ECMEHD') {
55
  $this->overrideControllersPath = dirname(__DIR__) . '-plus/CJTEnv/controllers';
56
  } else {
57
+ $this->overrideControllersPath = $accessPointClassLoader->getPath() . DIRECTORY_SEPARATOR . 'controllers';
58
  }
59
  $this->overrideControllersPrefix = $accessPointClassLoader->getPrefix();
60
  }
65
  // Dispatch the call as its originally requested from ajax action!
66
  $action = "wp_ajax_{$this->pageId}_{$_REQUEST['CJTAjaxAction']}";
67
  // Fire Ajax action.
68
+ do_action($action);
69
  }
70
  return $controller;
71
  }
72
+
73
  } // End class.
74
 
75
  // Hookable!
css-js-toolbox.class.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- *
4
  */
5
 
6
  // Disallow direct access.
@@ -43,262 +43,262 @@ define( 'CJTOOLBOX_HTML_CONPONENTS_URL', CJTOOLBOX_URL . '/framework/html/compon
43
 
44
  /**
45
  * CJT Core class.
46
- *
47
  * @package CJT
48
  * @author Original Developer
49
  * @version 0.3
50
  */
51
- class cssJSToolbox extends CJTHookableClass
52
  {
53
 
54
  /**
55
- *
56
  */
57
  const CJT_WEB_SITE_DOMAIN = 'css-javascript-toolbox.com';
58
-
59
  /**
60
  * put your comment there...
61
- *
62
  * @todo remove this and use configuration instead
63
- *
64
  * @var mixed
65
  */
66
  public static $config = null;
67
-
68
  /**
69
  * put your comment there...
70
- *
71
  * @var mixed
72
  */
73
  private $dbDriver;
74
-
75
  /**
76
  * Reference of CJT Plugin object.
77
- *
78
  * @var cssJSToolbox
79
  */
80
  public static $instance = null;
81
 
82
  /**
83
  * put your comment there...
84
- *
85
  * @var mixed
86
  */
87
  protected static $ongettext = array( 'parameters' => array( 'text' ) );
88
-
89
  /**
90
  * put your comment there...
91
- *
92
  * @var mixed
93
  */
94
  protected static $onimport = array( 'parameters' => array( 'vpaths' ) );
95
-
96
  /**
97
  * put your comment there...
98
- *
99
  * @var mixed
100
  */
101
  protected static $oninstantiate = array( 'parameters' => array( 'instance' ) );
102
-
103
  /**
104
  * put your comment there...
105
- *
106
  * @var mixed
107
  */
108
  protected $onloadconfiguration = array( 'parameters' => array( 'configuration' ) );
109
-
110
  /**
111
  * put your comment there...
112
- *
113
  * @var mixed
114
  */
115
  protected $onloaddbdriver = array( 'parameters' => array( 'dbdriver' ) );
116
 
117
  /**
118
  * put your comment there...
119
- *
120
  * @var mixed
121
  */
122
  protected static $onresolvepath = array( 'parameters' => array( 'path', 'vpath' ) );
123
-
124
  /**
125
  * put your comment there...
126
- *
127
  * @param mixed $text
128
  */
129
  public static function _( $formattedText )
130
  {
131
-
132
  // Get formats as single args
133
  $args = func_get_args();
134
  array_shift( $args );
135
-
136
  // Shift localized text into first array items
137
  array_unshift( $args, self::getText( $formattedText ) );
138
-
139
  // Return formatted text
140
  return call_user_func_array( 'sprintf', $args );
141
  }
142
-
143
  /**
144
- * Initialize Plugin.
145
- *
146
  * @return void
147
  */
148
- protected function __construct()
149
  {
150
-
151
  parent::__construct();
152
-
153
  // Load configuration.
154
  self::$config = $this->onloadconfiguration( require( self::resolvePath( 'configuration.inc.php' ) ) );
155
-
156
-
157
  self::import( 'framework:db:mysql:queue-driver.inc.php' );
158
-
159
  $this->dbDriver = $this->onloaddbdriver( new CJTMYSQLQueueDriver( $GLOBALS[ 'wpdb' ] ) );
160
  }
161
-
162
  /**
163
  * put your comment there...
164
- *
165
  */
166
- public static function getCJTWebSiteURL( $path = null )
167
  {
168
  $domain = self::CJT_WEB_SITE_DOMAIN;
169
-
170
- return "http://{$domain}/{$path}";
171
  }
172
-
173
  /**
174
  * put your comment there...
175
- *
176
  */
177
- public function & getDBDriver()
178
  {
179
- return $this->dbDriver;
180
  }
181
-
182
  /**
183
  * Get CJT Plugin object.
184
- *
185
  * @return cssJSToolbox
186
  */
187
- public static function & getInstance()
188
  {
189
-
190
  if ( ! self::$instance )
191
  {
192
  self::$instance = self::trigger( 'cssJSToolbox.instantiate', ( new cssJSToolbox() ) );
193
  }
194
-
195
  return self::$instance;
196
  }
197
-
198
  /**
199
  * put your comment there...
200
- *
201
  */
202
- public static function getSecurityToken()
203
  {
204
  return wp_create_nonce( CJTController::NONCE_ACTION );
205
  }
206
-
207
  /**
208
  * put your comment there...
209
- *
210
  * @param mixed $text
211
  */
212
- public static function getText( $text )
213
  {
214
  // Make sure to don't use $this while calling!
215
  // $this might be an object other than CssJSToolbox!
216
  return self::__callStatic( 'cssJSToolbox.ongettext', array( __( $text, CJTOOLBOX_TEXT_DOMAIN ) ) );
217
  }
218
-
219
  /**
220
  * put your comment there...
221
- *
222
  * @param mixed $path
223
  */
224
- public static function getURI( $vPath, $uriBase = null )
225
  {
226
  // PHP wrapper however its not imlpemented as wrapper yet
227
  // because this is not the point right now!
228
- if ( strpos( $vPath, 'extension://' ) === 0)
229
  {
230
  // Expression for getting plugin/extension name!
231
  $exp = '/^extension\:\/\/([^\/]+)/';
232
  preg_match( $exp, $vPath, $extensionPath );
233
-
234
  // Get base URI + removing extension:// wrapper!
235
  $uriBase = plugins_url( $extensionPath[ 1 ] );
236
-
237
  $uri = self::getURI( preg_replace( $exp, '', $vPath ), $uriBase );
238
-
239
- }
240
- else
241
  {
242
  // Translate Virtual path to real path.
243
  $path = str_replace( ':', '/', $vPath );
244
-
245
  // Get full URI.
246
- if ( ! isset( $uriBase ) )
247
  {
248
-
249
  $uriBase = plugin_dir_url( __FILE__ );
250
-
251
  }
252
-
253
- $uri = "{$uriBase}{$path}";
254
  }
255
-
256
  return $uri;
257
  }
258
-
259
  /**
260
  * put your comment there...
261
- *
262
  */
263
- public static function import()
264
  {
265
 
266
  $params = func_get_args();
267
-
268
  // Allow vriables list parameters.
269
  $vPaths = self::trigger( 'cssJSToolbox.import', $params );
270
- foreach ( $vPaths as $vPath )
271
  {
272
  require_once self::resolvePath( $vPath );
273
  }
274
-
275
  }
276
-
277
  /**
278
  * put your comment there...
279
- *
280
  * @param mixed $vPath
281
  * @param mixed $base
282
  */
283
- public static function resolvePath( $vPath, $base = CJTOOLBOX_PATH )
284
  {
285
  // Resolve CJT extensions path
286
- if ( strpos( $vPath, 'extension://' ) === 0 )
287
  {
288
  // Remove extension wrapper
289
  $vPath = str_replace( 'extension://', '', $vPath );
290
-
291
  // Point to plugin directory
292
  $base = WP_PLUGIN_DIR;
293
-
294
  }
295
  // Replace all :'s with /'s.
296
  $path = str_replace( ':', '/', $vPath );
297
  $path = "{$base}/{$path}";
298
-
299
  return self::trigger( 'cssJSToolbox.resolvepath', $path, $vPath );
300
  }
301
-
302
  }// End Class
303
 
304
  // Hookable!
1
  <?php
2
  /**
3
+ *
4
  */
5
 
6
  // Disallow direct access.
43
 
44
  /**
45
  * CJT Core class.
46
+ *
47
  * @package CJT
48
  * @author Original Developer
49
  * @version 0.3
50
  */
51
+ class cssJSToolbox extends CJTHookableClass
52
  {
53
 
54
  /**
55
+ *
56
  */
57
  const CJT_WEB_SITE_DOMAIN = 'css-javascript-toolbox.com';
58
+
59
  /**
60
  * put your comment there...
61
+ *
62
  * @todo remove this and use configuration instead
63
+ *
64
  * @var mixed
65
  */
66
  public static $config = null;
67
+
68
  /**
69
  * put your comment there...
70
+ *
71
  * @var mixed
72
  */
73
  private $dbDriver;
74
+
75
  /**
76
  * Reference of CJT Plugin object.
77
+ *
78
  * @var cssJSToolbox
79
  */
80
  public static $instance = null;
81
 
82
  /**
83
  * put your comment there...
84
+ *
85
  * @var mixed
86
  */
87
  protected static $ongettext = array( 'parameters' => array( 'text' ) );
88
+
89
  /**
90
  * put your comment there...
91
+ *
92
  * @var mixed
93
  */
94
  protected static $onimport = array( 'parameters' => array( 'vpaths' ) );
95
+
96
  /**
97
  * put your comment there...
98
+ *
99
  * @var mixed
100
  */
101
  protected static $oninstantiate = array( 'parameters' => array( 'instance' ) );
102
+
103
  /**
104
  * put your comment there...
105
+ *
106
  * @var mixed
107
  */
108
  protected $onloadconfiguration = array( 'parameters' => array( 'configuration' ) );
109
+
110
  /**
111
  * put your comment there...
112
+ *
113
  * @var mixed
114
  */
115
  protected $onloaddbdriver = array( 'parameters' => array( 'dbdriver' ) );
116
 
117
  /**
118
  * put your comment there...
119
+ *
120
  * @var mixed
121
  */
122
  protected static $onresolvepath = array( 'parameters' => array( 'path', 'vpath' ) );
123
+
124
  /**
125
  * put your comment there...
126
+ *
127
  * @param mixed $text
128
  */
129
  public static function _( $formattedText )
130
  {
131
+
132
  // Get formats as single args
133
  $args = func_get_args();
134
  array_shift( $args );
135
+
136
  // Shift localized text into first array items
137
  array_unshift( $args, self::getText( $formattedText ) );
138
+
139
  // Return formatted text
140
  return call_user_func_array( 'sprintf', $args );
141
  }
142
+
143
  /**
144
+ * Initialize Plugin.
145
+ *
146
  * @return void
147
  */
148
+ protected function __construct()
149
  {
150
+
151
  parent::__construct();
152
+
153
  // Load configuration.
154
  self::$config = $this->onloadconfiguration( require( self::resolvePath( 'configuration.inc.php' ) ) );
155
+
156
+
157
  self::import( 'framework:db:mysql:queue-driver.inc.php' );
158
+
159
  $this->dbDriver = $this->onloaddbdriver( new CJTMYSQLQueueDriver( $GLOBALS[ 'wpdb' ] ) );
160
  }
161
+
162
  /**
163
  * put your comment there...
164
+ *
165
  */
166
+ public static function getCJTWebSiteURL( $path = null )
167
  {
168
  $domain = self::CJT_WEB_SITE_DOMAIN;
169
+
170
+ return "https://{$domain}/{$path}";
171
  }
172
+
173
  /**
174
  * put your comment there...
175
+ *
176
  */
177
+ public function & getDBDriver()
178
  {
179
+ return $this->dbDriver;
180
  }
181
+
182
  /**
183
  * Get CJT Plugin object.
184
+ *
185
  * @return cssJSToolbox
186
  */
187
+ public static function & getInstance()
188
  {
189
+
190
  if ( ! self::$instance )
191
  {
192
  self::$instance = self::trigger( 'cssJSToolbox.instantiate', ( new cssJSToolbox() ) );
193
  }
194
+
195
  return self::$instance;
196
  }
197
+
198
  /**
199
  * put your comment there...
200
+ *
201
  */
202
+ public static function getSecurityToken()
203
  {
204
  return wp_create_nonce( CJTController::NONCE_ACTION );
205
  }
206
+
207
  /**
208
  * put your comment there...
209
+ *
210
  * @param mixed $text
211
  */
212
+ public static function getText( $text )
213
  {
214
  // Make sure to don't use $this while calling!
215
  // $this might be an object other than CssJSToolbox!
216
  return self::__callStatic( 'cssJSToolbox.ongettext', array( __( $text, CJTOOLBOX_TEXT_DOMAIN ) ) );
217
  }
218
+
219
  /**
220
  * put your comment there...
221
+ *
222
  * @param mixed $path
223
  */
224
+ public static function getURI( $vPath, $uriBase = null )
225
  {
226
  // PHP wrapper however its not imlpemented as wrapper yet
227
  // because this is not the point right now!
228
+ if ( strpos( $vPath, 'extension://' ) === 0)
229
  {
230
  // Expression for getting plugin/extension name!
231
  $exp = '/^extension\:\/\/([^\/]+)/';
232
  preg_match( $exp, $vPath, $extensionPath );
233
+
234
  // Get base URI + removing extension:// wrapper!
235
  $uriBase = plugins_url( $extensionPath[ 1 ] );
236
+
237
  $uri = self::getURI( preg_replace( $exp, '', $vPath ), $uriBase );
238
+
239
+ }
240
+ else
241
  {
242
  // Translate Virtual path to real path.
243
  $path = str_replace( ':', '/', $vPath );
244
+
245
  // Get full URI.
246
+ if ( ! isset( $uriBase ) )
247
  {
248
+
249
  $uriBase = plugin_dir_url( __FILE__ );
250
+
251
  }
252
+
253
+ $uri = "{$uriBase}{$path}";
254
  }
255
+
256
  return $uri;
257
  }
258
+
259
  /**
260
  * put your comment there...
261
+ *
262
  */
263
+ public static function import()
264
  {
265
 
266
  $params = func_get_args();
267
+
268
  // Allow vriables list parameters.
269
  $vPaths = self::trigger( 'cssJSToolbox.import', $params );
270
+ foreach ( $vPaths as $vPath )
271
  {
272
  require_once self::resolvePath( $vPath );
273
  }
274
+
275
  }
276
+
277
  /**
278
  * put your comment there...
279
+ *
280
  * @param mixed $vPath
281
  * @param mixed $base
282
  */
283
+ public static function resolvePath( $vPath, $base = CJTOOLBOX_PATH )
284
  {
285
  // Resolve CJT extensions path
286
+ if ( strpos( $vPath, 'extension://' ) === 0 )
287
  {
288
  // Remove extension wrapper
289
  $vPath = str_replace( 'extension://', '', $vPath );
290
+
291
  // Point to plugin directory
292
  $base = WP_PLUGIN_DIR;
293
+
294
  }
295
  // Replace all :'s with /'s.
296
  $path = str_replace( ':', '/', $vPath );
297
  $path = "{$base}/{$path}";
298
+
299
  return self::trigger( 'cssJSToolbox.resolvepath', $path, $vPath );
300
  }
301
+
302
  }// End Class
303
 
304
  // Hookable!
css-js-toolbox.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
  /*
3
  Plugin Name: CSS & JavaScript Toolbox
4
- Plugin URI: http://css-javascript-toolbox.com/
5
  Description: Easily add CSS, JavaScript, HTML and PHP code to unique CJT code blocks and assign them anywhere on your website.
6
- Version: 9.3.1
7
  Author: Wipeout Media
8
- Author URI: http://css-javascript-toolbox.com
9
  License:
10
 
11
  The Software is package as a WordPress¨ plugin. The PHP code associated with the Software is licensed under the GPL version 2.0 license (as found at http://www.gnu.org/licenses/gpl-2.0.txt GNU/GPLv2 or "GPLv2"). You may redistribute, repackage, and modify the PHP code as you see fit and as consistent with GPLv2.
@@ -98,7 +98,7 @@ class CJTPlugin extends CJTHookableClass
98
  /**
99
  *
100
  */
101
- const VERSION = '9.3.1';
102
 
103
  /**
104
  *
1
  <?php
2
  /*
3
  Plugin Name: CSS & JavaScript Toolbox
4
+ Plugin URI: https://css-javascript-toolbox.com/
5
  Description: Easily add CSS, JavaScript, HTML and PHP code to unique CJT code blocks and assign them anywhere on your website.
6
+ Version: 9.4
7
  Author: Wipeout Media
8
+ Author URI: https://css-javascript-toolbox.com
9
  License:
10
 
11
  The Software is package as a WordPress¨ plugin. The PHP code associated with the Software is licensed under the GPL version 2.0 license (as found at http://www.gnu.org/licenses/gpl-2.0.txt GNU/GPLv2 or "GPLv2"). You may redistribute, repackage, and modify the PHP code as you see fit and as consistent with GPLv2.
98
  /**
99
  *
100
  */
101
+ const VERSION = '9.4';
102
 
103
  /**
104
  *
framework/css/install-notice.css ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ .cjt-installation-notice {
2
+ padding-bottom: 10px !important;
3
+ }
4
+ .cjt-installation-notice p {
5
+ font-size: 14px;
6
+ }
7
+ .cjt-second-title {
8
+ color: red;
9
+ }
framework/js/ajax/cjt-server/cjt-server.localization.php CHANGED
@@ -5,18 +5,18 @@
5
  */
6
 
7
  /**
8
- *
9
- *
10
  * Localization text for backups script.
11
  */
12
  return array
13
  (
14
 
15
  'confirmSubmitErrorForm' => cssJSToolbox::getText( "Unhandled error has been detected while processing the background request.
16
- As the error is not handled we cannot tell if the previous operation is executed successed or not.
17
- To help us fixing those kind of issues you can check the error details and submit it throught CJT Web site.\n\n
18
  Would you like to check the error details?" ),
19
-
20
- 'confirmCloseErrorForm' => cssJSToolbox::getText( "Its highly recomended to send us the error details so we can enahce CJT products.
21
  This error is not saved anywhere and you cant reach it again.\n Would you like to close the form?" )
22
  );
5
  */
6
 
7
  /**
8
+ *
9
+ *
10
  * Localization text for backups script.
11
  */
12
  return array
13
  (
14
 
15
  'confirmSubmitErrorForm' => cssJSToolbox::getText( "Unhandled error has been detected while processing the background request.
16
+ As the error is not handled we cannot tell if the previous operation is executed successfully or not.
17
+ To help us fixing those kind of issues you can check the error details and submit it through CJT Web site.\n\n
18
  Would you like to check the error details?" ),
19
+
20
+ 'confirmCloseErrorForm' => cssJSToolbox::getText( "Its highly recommended to send us the error details so we can enhance CJT products.
21
  This error is not saved anywhere and you cant reach it again.\n Would you like to close the form?" )
22
  );
framework/mvc/controller-ajax.inc.php CHANGED
@@ -1,89 +1,89 @@
1
  <?php
2
  /**
3
- *
4
  */
5
 
6
  /**
7
- *
8
  */
9
  abstract class CJTAjaxController extends CJTController {
10
-
11
  /** */
12
  const ACTION_PREFIX = 'wp_ajax_cjtoolbox_';
13
-
14
  /**
15
  * put your comment there...
16
- *
17
  * @var mixed
18
  */
19
  protected $methodName;
20
-
21
  /**
22
  * put your comment there...
23
- *
24
  * @var mixed
25
  */
26
  protected $actionsMap = array();
27
-
28
  /**
29
  * put your comment there...
30
- *
31
  * @var mixed
32
  */
33
  protected $defaultCapability = array('administrator');
34
-
35
  /**
36
  * put your comment there...
37
- *
38
  * @var mixed
39
  */
40
  protected $impersonated = false;
41
-
42
  /**
43
  * put your comment there...
44
- *
45
  * @var mixed
46
  */
47
  public $httpCode = '200 OK';
48
-
49
  /**
50
  * put your comment there...
51
- *
52
  * @var mixed
53
  */
54
  public $httpContentType = 'text/plain';
55
-
56
  /**
57
  * put your comment there...
58
- *
59
  * @var mixed
60
  */
61
  protected $onauthorize = array('parameters' => array('authorized'));
62
-
63
  /**
64
  * put your comment there...
65
- *
66
  * @var mixed
67
  */
68
  protected $onregisteraction = array('parameters' => array('callback', 'action'));
69
-
70
  /**
71
  * put your comment there...
72
- *
73
  * @var mixed
74
  */
75
  protected $onresponse = array('hookType' => CJTWordpressEvents::HOOK_ACTION);
76
-
77
  /**
78
  * put your comment there...
79
- *
80
  * @var mixed
81
  */
82
  public $response = false;
83
-
84
  /**
85
  * put your comment there...
86
- *
87
  */
88
  public function _doAction() {
89
  // Authorize request.
@@ -150,7 +150,7 @@ abstract class CJTAjaxController extends CJTController {
150
  case 'text/plain':
151
  echo json_encode($this->response);
152
  break;
153
-
154
  default :
155
  echo $this->response;
156
  }
@@ -159,24 +159,24 @@ abstract class CJTAjaxController extends CJTController {
159
 
160
  /**
161
  * Display templates manager form.
162
- *
163
  */
164
- protected function displayAction() {
165
  // Return view.
166
  $this->httpContentType = 'text/html';
167
  $this->response = parent::displayAction();
168
  }
169
-
170
  /**
171
  * Redirect the request to another controller.
172
- *
173
  * Why this method is created anyway is to allow
174
  * deprecating old controllers and start to create new one
175
  * a quiet manner!
176
- *
177
  * The idea is to create the new controller, adding new Action there
178
- * and redirect the call throught current deprecated controller.
179
- *
180
  * @param mixed $controller
181
  */
182
  protected function redirect($controller) {
@@ -189,10 +189,10 @@ abstract class CJTAjaxController extends CJTController {
189
  // Fire the action manually.
190
  do_action($currentFilter);
191
  }
192
-
193
  /**
194
  * put your comment there...
195
- *
196
  * @param mixed $action
197
  * @param mixed $priority
198
  * @param mixed $paramsCount
@@ -204,7 +204,7 @@ abstract class CJTAjaxController extends CJTController {
204
  add_action($action, $callback , $priority, $paramsCount);
205
  return $this;
206
  }
207
-
208
  } // End class.
209
 
210
  // Hookable!
1
  <?php
2
  /**
3
+ *
4
  */
5
 
6
  /**
7
+ *
8
  */
9
  abstract class CJTAjaxController extends CJTController {
10
+
11
  /** */
12
  const ACTION_PREFIX = 'wp_ajax_cjtoolbox_';
13
+
14
  /**
15
  * put your comment there...
16
+ *
17
  * @var mixed
18
  */
19
  protected $methodName;
20
+
21
  /**
22
  * put your comment there...
23
+ *
24
  * @var mixed
25
  */
26
  protected $actionsMap = array();
27
+
28
  /**
29
  * put your comment there...
30
+ *
31
  * @var mixed
32
  */
33
  protected $defaultCapability = array('administrator');
34
+
35
  /**
36
  * put your comment there...
37
+ *
38
  * @var mixed
39
  */
40
  protected $impersonated = false;
41
+
42
  /**
43
  * put your comment there...
44
+ *
45
  * @var mixed
46
  */
47
  public $httpCode = '200 OK';
48
+
49
  /**
50
  * put your comment there...
51
+ *
52
  * @var mixed
53
  */
54
  public $httpContentType = 'text/plain';
55
+
56
  /**
57
  * put your comment there...
58
+ *
59
  * @var mixed
60
  */
61
  protected $onauthorize = array('parameters' => array('authorized'));
62
+
63
  /**
64
  * put your comment there...
65
+ *
66
  * @var mixed
67
  */
68
  protected $onregisteraction = array('parameters' => array('callback', 'action'));
69
+
70
  /**
71
  * put your comment there...
72
+ *
73
  * @var mixed
74
  */
75
  protected $onresponse = array('hookType' => CJTWordpressEvents::HOOK_ACTION);
76
+
77
  /**
78
  * put your comment there...
79
+ *
80
  * @var mixed
81
  */
82
  public $response = false;
83
+
84
  /**
85
  * put your comment there...
86
+ *
87
  */
88
  public function _doAction() {
89
  // Authorize request.
150
  case 'text/plain':
151
  echo json_encode($this->response);
152
  break;
153
+
154
  default :
155
  echo $this->response;
156
  }
159
 
160
  /**
161
  * Display templates manager form.
162
+ *
163
  */
164
+ protected function displayAction() {
165
  // Return view.
166
  $this->httpContentType = 'text/html';
167
  $this->response = parent::displayAction();
168
  }
169
+
170
  /**
171
  * Redirect the request to another controller.
172
+ *
173
  * Why this method is created anyway is to allow
174
  * deprecating old controllers and start to create new one
175
  * a quiet manner!
176
+ *
177
  * The idea is to create the new controller, adding new Action there
178
+ * and redirect the call through current deprecated controller.
179
+ *
180
  * @param mixed $controller
181
  */
182
  protected function redirect($controller) {
189
  // Fire the action manually.
190
  do_action($currentFilter);
191
  }
192
+
193
  /**
194
  * put your comment there...
195
+ *
196
  * @param mixed $action
197
  * @param mixed $priority
198
  * @param mixed $paramsCount
204
  add_action($action, $callback , $priority, $paramsCount);
205
  return $this;
206
  }
207
+
208
  } // End class.
209
 
210
  // Hookable!
framework/wordpress/feed.php CHANGED
@@ -1,58 +1,58 @@
1
  <?php
2
  /**
3
- *
4
  */
5
 
6
  /**
7
- *
8
  */
9
  class CJT_Framework_Wordpress_Feed {
10
-
11
  /**
12
  * put your comment there...
13
- *
14
  * @var mixed
15
  */
16
  protected $feed;
17
-
18
  /**
19
  * put your comment there...
20
- *
21
  * @var mixed
22
  */
23
  protected $fields;
24
-
25
  /**
26
  * put your comment there...
27
- *
28
  * @var mixed
29
  */
30
  protected $path;
31
-
32
  /**
33
  * put your comment there...
34
- *
35
  * @var mixed
36
  */
37
  protected $site;
38
-
39
  /**
40
  * put your comment there...
41
- *
42
  * @param mixed $site
43
  * @param mixed $path
44
  * @return CJT_Framework_Wordpress_Feed
45
  */
46
- public function __construct($site, $path, $fields)
47
  {
48
-
49
  $this->site =& $site;
50
  $this->path =& $path;
51
  $this->fields = $fields;
52
-
53
  # Request server => get raw XML feed
54
  $feed = wp_remote_get( "http://{$this->site}/{$this->path}" );
55
-
56
  # Getting XML content
57
  $xmlContent = ( is_array( $feed ) && ( $feed[ 'response' ][ 'code' ] == 200 ) ) ?
58
  wp_remote_retrieve_body( $feed ) :
@@ -61,17 +61,17 @@ class CJT_Framework_Wordpress_Feed {
61
  <item>
62
  <title>ERROR !!!</title>
63
  <description>ERROR Fetching data from CJT Server</description>
64
- <link>http://css-javascript-toolbox.com/</link>
65
  </item>
66
  </channel>
67
  </cjterrorrequest>';
68
  # Creating feed
69
  $this->feed = new SimpleXMLElement($xmlContent);
70
  }
71
-
72
  /**
73
  * put your comment there...
74
- *
75
  */
76
  public function getAllItems() {
77
  // Initialize.
@@ -88,12 +88,12 @@ class CJT_Framework_Wordpress_Feed {
88
  $items[] = $item;
89
  }
90
  # Return items.
91
- return $items;
92
  }
93
 
94
  /**
95
  * put your comment there...
96
- *
97
  * @param mixed $count
98
  */
99
  public function getLatestItems($count) {
@@ -117,20 +117,20 @@ class CJT_Framework_Wordpress_Feed {
117
  $items[] = $item;
118
  }
119
  # Return items.
120
- return $items;
121
  }
122
 
123
  /**
124
  * put your comment there...
125
- *
126
  */
127
  protected function getPath() {
128
  return $this->path;
129
  }
130
-
131
  /**
132
  * put your comment there...
133
- *
134
  */
135
  public function getSite() {
136
  return $this->site;
@@ -138,7 +138,7 @@ class CJT_Framework_Wordpress_Feed {
138
 
139
  /**
140
  * put your comment there...
141
- *
142
  */
143
  public function isError() {
144
  return !$this->feed || $this->feed->channel->attributes()->cjt_error;
1
  <?php
2
  /**
3
+ *
4
  */
5
 
6
  /**
7
+ *
8
  */
9
  class CJT_Framework_Wordpress_Feed {
10
+
11
  /**
12
  * put your comment there...
13
+ *
14
  * @var mixed
15
  */
16
  protected $feed;
17
+
18
  /**
19
  * put your comment there...
20
+ *
21
  * @var mixed
22
  */
23
  protected $fields;
24
+
25
  /**
26
  * put your comment there...
27
+ *
28
  * @var mixed
29
  */
30
  protected $path;
31
+
32
  /**
33
  * put your comment there...
34
+ *
35
  * @var mixed
36
  */
37
  protected $site;
38
+
39
  /**
40
  * put your comment there...
41
+ *
42
  * @param mixed $site
43
  * @param mixed $path
44
  * @return CJT_Framework_Wordpress_Feed
45
  */
46
+ public function __construct($site, $path, $fields)
47
  {
48
+
49
  $this->site =& $site;
50
  $this->path =& $path;
51
  $this->fields = $fields;
52
+
53
  # Request server => get raw XML feed
54
  $feed = wp_remote_get( "http://{$this->site}/{$this->path}" );
55
+
56
  # Getting XML content
57
  $xmlContent = ( is_array( $feed ) && ( $feed[ 'response' ][ 'code' ] == 200 ) ) ?
58
  wp_remote_retrieve_body( $feed ) :
61
  <item>
62
  <title>ERROR !!!</title>
63
  <description>ERROR Fetching data from CJT Server</description>
64
+ <link>https://css-javascript-toolbox.com/</link>
65
  </item>
66
  </channel>
67
  </cjterrorrequest>';
68
  # Creating feed
69
  $this->feed = new SimpleXMLElement($xmlContent);
70
  }
71
+
72
  /**
73
  * put your comment there...
74
+ *
75
  */
76
  public function getAllItems() {
77
  // Initialize.
88
  $items[] = $item;
89
  }
90
  # Return items.
91
+ return $items;
92
  }
93
 
94
  /**
95
  * put your comment there...
96
+ *
97
  * @param mixed $count
98
  */
99
  public function getLatestItems($count) {
117
  $items[] = $item;
118
  }
119
  # Return items.
120
+ return $items;
121
  }
122
 
123
  /**
124
  * put your comment there...
125
+ *
126
  */
127
  protected function getPath() {
128
  return $this->path;
129
  }
130
+
131
  /**
132
  * put your comment there...
133
+ *
134
  */
135
  public function getSite() {
136
  return $this->site;
138
 
139
  /**
140
  * put your comment there...
141
+ *
142
  */
143
  public function isError() {
144
  return !$this->feed || $this->feed->channel->attributes()->cjt_error;
locals/languages/css-javascript-toolbox-en_US.po CHANGED
@@ -104,7 +104,7 @@ msgid ""
104
  "\tas the error is not handled we cannot tell if the previous operation is "
105
  "executed successed or not!\n"
106
  "\tTo help us fixing those kind of issues you can check the error details and "
107
- "submit it throught CJT Web site!\n"
108
  "\n"
109
  "\n"
110
  "\tWould you like to check the error details?"
@@ -112,7 +112,7 @@ msgstr ""
112
 
113
  #: /framework/js/ajax/cjt-server/cjt-server.localization.php:17
114
  msgid ""
115
- "Its heighly recomended to send us the error details so we can enahce CJT "
116
  "products!\n"
117
  "\tThis error is not saved anywhere and you cant reach it again!\n"
118
  "\n"
@@ -487,9 +487,9 @@ msgstr ""
487
 
488
  #: /views/setup/activation-form/public/js/default/default.localization.php:13
489
  msgid ""
490
- "External request need to be made to to css-javascript-toolbox offical web "
491
  "site! The operation will take an effect once its successed! You can always "
492
- "deactivate license key throught this form!\n"
493
  "\n"
494
  "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"
495
  "\t\t\t\t\t\t\tAre you sure would you like to process?"
@@ -497,9 +497,9 @@ msgstr ""
497
 
498
  #: /views/setup/activation-form/public/js/default/default.localization.php:15
499
  msgid ""
500
- "External request need to be made to to css-javascript-toolbox offical web "
501
  "site! The operation will take an effect once its successed! You can always "
502
- "activate license key throught this form!\n"
503
  "\n"
504
  "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"
505
  "\t\t\t\t\t\t\tAre you sure would you like to process?"
@@ -603,7 +603,7 @@ msgid "Could not deactivate License Key due to the server error!"
603
  msgstr ""
604
 
605
  #: /views/setup/activation-form/public/js/default/default.localization.php:48
606
- msgid "The ckeck operation detects that the provided key is a valid key!"
607
  msgstr ""
608
 
609
  #: /views/setup/activation-form/public/js/default/default.localization.php:49
@@ -616,13 +616,13 @@ msgstr ""
616
 
617
  #: /views/setup/activation-form/public/js/default/default.localization.php:51
618
  msgid ""
619
- "The ckeck operation detects that the provided key is a valid key! The key is "
620
  "not being activated yet."
621
  msgstr ""
622
 
623
  #: /views/setup/activation-form/public/js/default/default.localization.php:52
624
  msgid ""
625
- "The ckeck operation detects that the provided key is a valid key! The "
626
  "license key need to be activated from the CJT Website."
627
  msgstr ""
628
 
104
  "\tas the error is not handled we cannot tell if the previous operation is "
105
  "executed successed or not!\n"
106
  "\tTo help us fixing those kind of issues you can check the error details and "
107
+ "submit it through CJT Web site!\n"
108
  "\n"
109
  "\n"
110
  "\tWould you like to check the error details?"
112
 
113
  #: /framework/js/ajax/cjt-server/cjt-server.localization.php:17
114
  msgid ""
115
+ "Its heighly recommended to send us the error details so we can enhance CJT "
116
  "products!\n"
117
  "\tThis error is not saved anywhere and you cant reach it again!\n"
118
  "\n"
487
 
488
  #: /views/setup/activation-form/public/js/default/default.localization.php:13
489
  msgid ""
490
+ "External request need to be made to to css-javascript-toolbox official web "
491
  "site! The operation will take an effect once its successed! You can always "
492
+ "deactivate license key through this form!\n"
493
  "\n"
494
  "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"
495
  "\t\t\t\t\t\t\tAre you sure would you like to process?"
497
 
498
  #: /views/setup/activation-form/public/js/default/default.localization.php:15
499
  msgid ""
500
+ "External request need to be made to to css-javascript-toolbox official web "
501
  "site! The operation will take an effect once its successed! You can always "
502
+ "activate license key through this form!\n"
503
  "\n"
504
  "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"
505
  "\t\t\t\t\t\t\tAre you sure would you like to process?"
603
  msgstr ""
604
 
605
  #: /views/setup/activation-form/public/js/default/default.localization.php:48
606
+ msgid "The check operation detects that the provided key is a valid key!"
607
  msgstr ""
608
 
609
  #: /views/setup/activation-form/public/js/default/default.localization.php:49
616
 
617
  #: /views/setup/activation-form/public/js/default/default.localization.php:51
618
  msgid ""
619
+ "The check operation detects that the provided key is a valid key! The key is "
620
  "not being activated yet."
621
  msgstr ""
622
 
623
  #: /views/setup/activation-form/public/js/default/default.localization.php:52
624
  msgid ""
625
+ "The check operation detects that the provided key is a valid key! The "
626
  "license key need to be activated from the CJT Website."
627
  msgstr ""
628
 
models/block.php CHANGED
@@ -15,9 +15,9 @@ require_once CJTOOLBOX_MVC_FRAMEWOK . '/model.inc.php';
15
 
16
  /**
17
  * Represent single block object.
18
- *
19
  * Provide simple access read or write to block properties.
20
- *
21
  * @author Ahmed Said
22
  * @version 6
23
  */
@@ -28,28 +28,28 @@ class CJTBlockModel extends CJTModel {
28
  */
29
  const PINS_FRONTEND = 0x01;
30
  const PINS_BACKEND = 0x02;
31
-
32
  /**
33
  * Pages Pins.
34
  */
35
  const PINS_PAGES_ALL_PAGES = 0x10;
36
  const PINS_PAGES_CUSTOM_PAGE = 0x20;
37
  const PINS_PAGES_FRONT_PAGE = 0x40;
38
-
39
  /**
40
  * Posts Pins.
41
- */
42
  const PINS_POSTS_ALL_POSTS = 0x100;
43
  const PINS_POSTS_CUSTOM_POST = 0x200;
44
  const PINS_POSTS_RECENT = 0x400;
45
  const PINS_POSTS_BLOG_INDEX = 0x800;
46
-
47
  /**
48
  * Categories Pins.
49
  */
50
  const PINS_CATEGORIES_ALL_CATEGORIES = 0x1000;
51
  const PINS_CATEGORIES_CUSTOM_CATEGORY = 0x2000;
52
-
53
  /**
54
  * Other general pages pins.
55
  */
@@ -59,28 +59,28 @@ class CJTBlockModel extends CJTModel {
59
  const PINS_AUTHOR = 0x80000;
60
  const PINS_ATTACHMENT = 0x100000;
61
  const PINS_404_ERROR = 0x200000;
62
-
63
  /**
64
- *
65
  */
66
  const PINS_LINKS = 0x1000000;
67
  const PINS_EXPRESSIONS = 0x2000000;
68
-
69
  /**
70
- *
71
  */
72
  const PINS_LINK_EXPRESSION = 0x3000000;
73
-
74
  /**
75
  * put your comment there...
76
- *
77
  * @var mixed
78
  */
79
  private static $customPins;
80
-
81
  /**
82
  * put your comment there...
83
- *
84
  * @var mixed
85
  */
86
  private $propertiesMeta = array
@@ -94,92 +94,91 @@ class CJTBlockModel extends CJTModel {
94
  'expressions' => array(),
95
  'id' => array(),
96
  );
97
-
98
  /**
99
  * Create block object.
100
- *
101
  * @param integer Block id.
102
  * @param array Block data array or null to use default data.
103
  * @return void
104
  */
105
- public function __construct( $values = array() )
106
  {
107
  // Allow pluggable custom pins
108
  $customPins = self::getCustomPins();
109
-
110
  // Allow pluggable fields
111
  $this->propertiesMeta = apply_filters( CJTPluggableHelper::FILTER_BLOCK_MODEL_PROPERTIES_META, $this->propertiesMeta );
112
-
113
  // Merge prpperties meta wioth custom pins to create one full propertiesMeta objetc
114
  // that hold both fields and custom pins fields
115
  $this->propertiesMeta = array_merge( $this->propertiesMeta, $customPins );
116
-
117
- // Properties backward compatibolity to hold all available properties
118
- $this->properties = array_combine(
119
-
120
- array_keys( $this->propertiesMeta ),
121
-
122
- array_fill( 0, count( $this->propertiesMeta ), null )
123
-
124
  );
125
-
126
  // Set block properties.
127
  $this->setValues( $values );
128
  }
129
-
130
  /**
131
  * Get block property value.
132
- *
133
  * @param string Property name.
134
  * @return mixed Property value.
135
  */
136
  public function __get( $property )
137
  {
138
-
139
  // Return default values
140
- $value = ( ( $this->properties[ $property ] === null ) &&
141
- ( isset( $this->propertiesMeta[ $property ][ 'default' ] ) ) ) ?
142
-
143
  $this->propertiesMeta[ $property ][ 'default' ] :
144
  $this->properties[ $property ];
145
-
146
  return $value;
147
  }
148
-
149
  /**
150
  * Set block proprty value.
151
- *
152
  * @param string Property name.
153
  * @param mixed Property value.
154
  * @return void
155
  */
156
- public function __set($property, $value)
157
  {
158
- switch ( $property )
159
  {
160
  case 'code':
161
-
162
  case 'links':
163
-
164
  case 'expressions':
165
-
166
  // New lines submitted to server as CRLF but displayed in browser as LF.
167
  // PHP script and JS work on two different versions of texts.
168
  // Replace CRLF with LF just as displayed in browsers.
169
  $value = preg_replace( "/\x0D\x0A/", "\x0A", $value );
170
-
171
  break;
172
  }
173
-
174
  $this->properties[ $property ] = $value;
175
  }
176
-
177
  /**
178
  * put your comment there...
179
- *
180
  * @param mixed $blockData
181
  */
182
- public static function arrangePins( & $blockData )
183
  {
184
 
185
  $pinsGroupNames = array_flip( array_merge( array_keys( self::getCustomPins() ), array( 'pinPoint' ) ) );
@@ -188,93 +187,93 @@ class CJTBlockModel extends CJTModel {
188
  $block = $mdlBlock->getBlock( $blockData->id, array(), array( 'id', 'pinPoint' ) );
189
  $submittedPins = array_intersect_key( ( ( array ) $blockData ), $pinsGroupNames );
190
  $assignedPins = array_intersect_key( ( ( array ) $block ), $pinsGroupNames );
191
-
192
  // Transfer assigned PinPoint from "FLAGGED INTEGER" TO "ARRAY" like
193
  // the other pins.
194
  $assignedPins[ 'pinPoint' ] = array_keys( CJT_Models_Block_Assignmentpanel_Helpers_Auxiliary
195
  ::getInstance()
196
  ->getPinsArray( $assignedPins[ 'pinPoint' ] ) );
197
-
198
  // Walk through all assigned pins.
199
  // Unassigned any item with 'value=false'.
200
  // Whenever an item is found on the submitted
201
  // pins it should be removed from the submitted list
202
- foreach ( $submittedPins as $groupName => $submittedGroup )
203
  {
204
- // Get assigned pins group if found
205
- if ( ! isset( $assignedPins[ $groupName ] ) )
206
  {
207
  // Initialize new assigned group array.
208
  $assignedPins[ $groupName ] = array();
209
  }
210
-
211
  $assignedGroup =& $assignedPins[ $groupName ];
212
-
213
  // For every submitted item there is three types.
214
  // 1. Already assigned :WHEN: (sync == true and value == true)
215
  // 2. Unassigned :WHEN: (value == false)
216
  // 3. Newly assigned :WHEN: (sync = false).
217
- foreach ( $submittedGroup as $submittedPinId => $submittedPin )
218
  {
219
  // Unassigned pin
220
- if ( ! $submittedPin[ 'value' ] )
221
  {
222
  // Find the submittedPinId AssignedPins index.
223
  $assignedIndex = array_search( $submittedPinId, $assignedGroup );
224
  // Unassigned it :REMOVE FROM ARRAY:
225
  unset( $assignedGroup[ $assignedIndex ] );
226
  }
227
- else if ( ! $submittedPin[ 'sync' ] )
228
  {
229
  // Add newly assigned item.
230
  $assignedGroup[] = $submittedPinId;
231
  }
232
-
233
  }
234
-
235
  }
236
-
237
  // Copy all assigned pins back to the block object.
238
  foreach ( $assignedPins as $groupName => $finalGroupAssigns )
239
  {
240
  $blockData->{$groupName} = $finalGroupAssigns;
241
  }
242
-
243
  // Important for caller short-circle condition.
244
  return true;
245
  }
246
 
247
  /**
248
  * put your comment there...
249
- *
250
  * @deprecated Use calculatePinpoint
251
  */
252
- public static function calculateBlockPinPoint( & $block )
253
  {
254
-
255
  // Generate PinPoint Value.
256
- if ( isset( $block->pinPoint ) && is_array( $block->pinPoint ) )
257
  {
258
  $pinPoint = 0;
259
-
260
  // Each item is a bit flag.
261
- foreach ( $block->pinPoint as $pin )
262
  {
263
  $pinPoint |= hexdec($pin);
264
  }
265
-
266
  }
267
- else
268
  {
269
  // Provided as integer or not even provided!
270
- if ( ! isset( $block->pinPoint ) )
271
  {
272
  $block->pinPoint = 0;
273
  }
274
-
275
  $pinPoint = (int) $block->pinPoint;
276
  }
277
-
278
  // Pin should be set only for not empty properties.
279
  // This help us retreiving only needed blocks when querying blocks code.
280
  $pins = array
@@ -282,81 +281,81 @@ class CJTBlockModel extends CJTModel {
282
  self::PINS_LINKS => 'links',
283
  self::PINS_EXPRESSIONS => 'expressions',
284
  );
285
-
286
  $customPins = self::getCustomPins();
287
-
288
  // Add Custom Pins to pins to be calculated below
289
  foreach ( $customPins as $customPinName => $customPin )
290
  {
291
  $pins[ $customPin[ 'pinValue' ] ] = $customPinName;
292
  }
293
 
294
- foreach ( $pins as $flag => $pin )
295
  {
296
  $pinPoint |= abs( ( int ) ( ! empty( $block->{$pin} ) ) ) * $flag;
297
  }
298
-
299
  $block->pinPoint = $pinPoint;
300
-
301
  return $block;
302
  }
303
-
304
  /**
305
  * put your comment there...
306
- *
307
  * @param mixed $block
308
  * @param mixed $pins
309
  */
310
- public static function calculatePinPoint( $block, $pins )
311
  {
312
  // Add pins to Block object so that calculateBlockPinPoint can calculate PinPoint value!
313
  $block = ( object ) array_merge( $block, $pins );
314
-
315
  $pinPoint = self::calculateBlockPinPoint( $block )->pinPoint;
316
-
317
  return $pinPoint;
318
  }
319
 
320
  /**
321
  * put your comment there...
322
- *
323
  */
324
  public static function getCustomPins()
325
  {
326
  static $pins = array
327
- (
328
  'pages' => array
329
- (
330
-
331
  'default' => array(),
332
- 'pinValue' => self::PINS_PAGES_CUSTOM_PAGE
333
-
334
  ),
335
-
336
  'posts' => array
337
- (
338
-
339
  'default' => array(),
340
- 'pinValue' => self::PINS_POSTS_CUSTOM_POST
341
-
342
  ),
343
-
344
  'categories' => array
345
- (
346
-
347
  'default' => array(),
348
- 'pinValue' => self::PINS_CATEGORIES_CUSTOM_CATEGORY
349
-
350
  ),
351
  );
352
-
353
  // Cache custom pins
354
  if ( ! self::$customPins )
355
  {
356
- self::$customPins = apply_filters( CJTPluggableHelper::FILTER_BLOCK_MODEL_CUSTOM_PINS, $pins );
357
  }
358
-
359
  return self::$customPins;
360
  }
361
-
362
  } // End class.
15
 
16
  /**
17
  * Represent single block object.
18
+ *
19
  * Provide simple access read or write to block properties.
20
+ *
21
  * @author Ahmed Said
22
  * @version 6
23
  */
28
  */
29
  const PINS_FRONTEND = 0x01;
30
  const PINS_BACKEND = 0x02;
31
+
32
  /**
33
  * Pages Pins.
34
  */
35
  const PINS_PAGES_ALL_PAGES = 0x10;
36
  const PINS_PAGES_CUSTOM_PAGE = 0x20;
37
  const PINS_PAGES_FRONT_PAGE = 0x40;
38
+
39
  /**
40
  * Posts Pins.
41
+ */
42
  const PINS_POSTS_ALL_POSTS = 0x100;
43
  const PINS_POSTS_CUSTOM_POST = 0x200;
44
  const PINS_POSTS_RECENT = 0x400;
45
  const PINS_POSTS_BLOG_INDEX = 0x800;
46
+
47
  /**
48
  * Categories Pins.
49
  */
50
  const PINS_CATEGORIES_ALL_CATEGORIES = 0x1000;
51
  const PINS_CATEGORIES_CUSTOM_CATEGORY = 0x2000;
52
+
53
  /**
54
  * Other general pages pins.
55
  */
59
  const PINS_AUTHOR = 0x80000;
60
  const PINS_ATTACHMENT = 0x100000;
61
  const PINS_404_ERROR = 0x200000;
62
+
63
  /**
64
+ *
65
  */
66
  const PINS_LINKS = 0x1000000;
67
  const PINS_EXPRESSIONS = 0x2000000;
68
+
69
  /**
70
+ *
71
  */
72
  const PINS_LINK_EXPRESSION = 0x3000000;
73
+
74
  /**
75
  * put your comment there...
76
+ *
77
  * @var mixed
78
  */
79
  private static $customPins;
80
+
81
  /**
82
  * put your comment there...
83
+ *
84
  * @var mixed
85
  */
86
  private $propertiesMeta = array
94
  'expressions' => array(),
95
  'id' => array(),
96
  );
97
+
98
  /**
99
  * Create block object.
100
+ *
101
  * @param integer Block id.
102
  * @param array Block data array or null to use default data.
103
  * @return void
104
  */
105
+ public function __construct( $values = array() )
106
  {
107
  // Allow pluggable custom pins
108
  $customPins = self::getCustomPins();
109
+
110
  // Allow pluggable fields
111
  $this->propertiesMeta = apply_filters( CJTPluggableHelper::FILTER_BLOCK_MODEL_PROPERTIES_META, $this->propertiesMeta );
112
+
113
  // Merge prpperties meta wioth custom pins to create one full propertiesMeta objetc
114
  // that hold both fields and custom pins fields
115
  $this->propertiesMeta = array_merge( $this->propertiesMeta, $customPins );
116
+
117
+ // Properties backward compatibolity to hold all available properties
118
+ $this->properties = array_combine(
119
+
120
+ array_keys( $this->propertiesMeta ),
121
+
122
+ array_fill( 0, count( $this->propertiesMeta ), null )
123
+
124
  );
125
+
126
  // Set block properties.
127
  $this->setValues( $values );
128
  }
129
+
130
  /**
131
  * Get block property value.
132
+ *
133
  * @param string Property name.
134
  * @return mixed Property value.
135
  */
136
  public function __get( $property )
137
  {
 
138
  // Return default values
139
+ $value = ( ( $this->properties[ $property ] === null ) &&
140
+ ( isset( $this->propertiesMeta[ $property ][ 'default' ] ) ) ) ?
141
+
142
  $this->propertiesMeta[ $property ][ 'default' ] :
143
  $this->properties[ $property ];
144
+
145
  return $value;
146
  }
147
+
148
  /**
149
  * Set block proprty value.
150
+ *
151
  * @param string Property name.
152
  * @param mixed Property value.
153
  * @return void
154
  */
155
+ public function __set($property, $value)
156
  {
157
+ switch ( $property )
158
  {
159
  case 'code':
160
+
161
  case 'links':
162
+
163
  case 'expressions':
164
+
165
  // New lines submitted to server as CRLF but displayed in browser as LF.
166
  // PHP script and JS work on two different versions of texts.
167
  // Replace CRLF with LF just as displayed in browsers.
168
  $value = preg_replace( "/\x0D\x0A/", "\x0A", $value );
169
+
170
  break;
171
  }
172
+
173
  $this->properties[ $property ] = $value;
174
  }
175
+
176
  /**
177
  * put your comment there...
178
+ *
179
  * @param mixed $blockData
180
  */
181
+ public static function arrangePins( & $blockData )
182
  {
183
 
184
  $pinsGroupNames = array_flip( array_merge( array_keys( self::getCustomPins() ), array( 'pinPoint' ) ) );
187
  $block = $mdlBlock->getBlock( $blockData->id, array(), array( 'id', 'pinPoint' ) );
188
  $submittedPins = array_intersect_key( ( ( array ) $blockData ), $pinsGroupNames );
189
  $assignedPins = array_intersect_key( ( ( array ) $block ), $pinsGroupNames );
190
+
191
  // Transfer assigned PinPoint from "FLAGGED INTEGER" TO "ARRAY" like
192
  // the other pins.
193
  $assignedPins[ 'pinPoint' ] = array_keys( CJT_Models_Block_Assignmentpanel_Helpers_Auxiliary
194
  ::getInstance()
195
  ->getPinsArray( $assignedPins[ 'pinPoint' ] ) );
196
+
197
  // Walk through all assigned pins.
198
  // Unassigned any item with 'value=false'.
199
  // Whenever an item is found on the submitted
200
  // pins it should be removed from the submitted list
201
+ foreach ( $submittedPins as $groupName => $submittedGroup )
202
  {
203
+ // Get assigned pins group if found
204
+ if ( ! isset( $assignedPins[ $groupName ] ) )
205
  {
206
  // Initialize new assigned group array.
207
  $assignedPins[ $groupName ] = array();
208
  }
209
+
210
  $assignedGroup =& $assignedPins[ $groupName ];
211
+
212
  // For every submitted item there is three types.
213
  // 1. Already assigned :WHEN: (sync == true and value == true)
214
  // 2. Unassigned :WHEN: (value == false)
215
  // 3. Newly assigned :WHEN: (sync = false).
216
+ foreach ( $submittedGroup as $submittedPinId => $submittedPin )
217
  {
218
  // Unassigned pin
219
+ if ( ! $submittedPin[ 'value' ] )
220
  {
221
  // Find the submittedPinId AssignedPins index.
222
  $assignedIndex = array_search( $submittedPinId, $assignedGroup );
223
  // Unassigned it :REMOVE FROM ARRAY:
224
  unset( $assignedGroup[ $assignedIndex ] );
225
  }
226
+ else if ( ! $submittedPin[ 'sync' ] )
227
  {
228
  // Add newly assigned item.
229
  $assignedGroup[] = $submittedPinId;
230
  }
231
+
232
  }
233
+
234
  }
235
+
236
  // Copy all assigned pins back to the block object.
237
  foreach ( $assignedPins as $groupName => $finalGroupAssigns )
238
  {
239
  $blockData->{$groupName} = $finalGroupAssigns;
240
  }
241
+
242
  // Important for caller short-circle condition.
243
  return true;
244
  }
245
 
246
  /**
247
  * put your comment there...
248
+ *
249
  * @deprecated Use calculatePinpoint
250
  */
251
+ public static function calculateBlockPinPoint( & $block )
252
  {
253
+
254
  // Generate PinPoint Value.
255
+ if ( isset( $block->pinPoint ) && is_array( $block->pinPoint ) )
256
  {
257
  $pinPoint = 0;
258
+
259
  // Each item is a bit flag.
260
+ foreach ( $block->pinPoint as $pin )
261
  {
262
  $pinPoint |= hexdec($pin);
263
  }
264
+
265
  }
266
+ else
267
  {
268
  // Provided as integer or not even provided!
269
+ if ( ! isset( $block->pinPoint ) )
270
  {
271
  $block->pinPoint = 0;
272
  }
273
+
274
  $pinPoint = (int) $block->pinPoint;
275
  }
276
+
277
  // Pin should be set only for not empty properties.
278
  // This help us retreiving only needed blocks when querying blocks code.
279
  $pins = array
281
  self::PINS_LINKS => 'links',
282
  self::PINS_EXPRESSIONS => 'expressions',
283
  );
284
+
285
  $customPins = self::getCustomPins();
286
+
287
  // Add Custom Pins to pins to be calculated below
288
  foreach ( $customPins as $customPinName => $customPin )
289
  {
290
  $pins[ $customPin[ 'pinValue' ] ] = $customPinName;
291
  }
292
 
293
+ foreach ( $pins as $flag => $pin )
294
  {
295
  $pinPoint |= abs( ( int ) ( ! empty( $block->{$pin} ) ) ) * $flag;
296
  }
297
+
298
  $block->pinPoint = $pinPoint;
299
+
300
  return $block;
301
  }
302
+
303
  /**
304
  * put your comment there...
305
+ *
306
  * @param mixed $block
307
  * @param mixed $pins
308
  */
309
+ public static function calculatePinPoint( $block, $pins )
310
  {
311
  // Add pins to Block object so that calculateBlockPinPoint can calculate PinPoint value!
312
  $block = ( object ) array_merge( $block, $pins );
313
+
314
  $pinPoint = self::calculateBlockPinPoint( $block )->pinPoint;
315
+
316
  return $pinPoint;
317
  }
318
 
319
  /**
320
  * put your comment there...
321
+ *
322
  */
323
  public static function getCustomPins()
324
  {
325
  static $pins = array
326
+ (
327
  'pages' => array
328
+ (
329
+
330
  'default' => array(),
331
+ 'pinValue' => self::PINS_PAGES_CUSTOM_PAGE
332
+
333
  ),
334
+
335
  'posts' => array
336
+ (
337
+
338
  'default' => array(),
339
+ 'pinValue' => self::PINS_POSTS_CUSTOM_POST
340
+
341
  ),
342
+
343
  'categories' => array
344
+ (
345
+
346
  'default' => array(),
347
+ 'pinValue' => self::PINS_CATEGORIES_CUSTOM_CATEGORY
348
+
349
  ),
350
  );
351
+
352
  // Cache custom pins
353
  if ( ! self::$customPins )
354
  {
355
+ self::$customPins = apply_filters( CJTPluggableHelper::FILTER_BLOCK_MODEL_CUSTOM_PINS, $pins );
356
  }
357
+
358
  return self::$customPins;
359
  }
360
+
361
  } // End class.
models/extensions.php CHANGED
@@ -1,23 +1,23 @@
1
  <?php
2
  /**
3
- *
4
  */
5
 
6
  // Disallow direct access.
7
  defined('ABSPATH') or die("Access denied");
8
 
9
  /**
10
- *
11
  */
12
  class CJTExtensionsModel {
13
-
14
  /**
15
  * put your comment there...
16
- *
17
  */
18
  public function getListTypeName() {
19
  // if the search term is for CJT extensions return 'extensions' otherwise return 'plugins'
20
  return ((isset($_REQUEST['s']) && ($_REQUEST['s'] == CJTExtensionsAccessPoint::PLUGINS_PAGE_SEARCH_TERM)) ? 'extensions' : 'plugins');
21
  }
22
-
23
  } // End class.
1
  <?php
2
  /**
3
+ *
4
  */
5
 
6
  // Disallow direct access.
7
  defined('ABSPATH') or die("Access denied");
8
 
9
  /**
10
+ *
11
  */
12
  class CJTExtensionsModel {
13
+
14
  /**
15
  * put your comment there...
16
+ *
17
  */
18
  public function getListTypeName() {
19
  // if the search term is for CJT extensions return 'extensions' otherwise return 'plugins'
20
  return ((isset($_REQUEST['s']) && ($_REQUEST['s'] == CJTExtensionsAccessPoint::PLUGINS_PAGE_SEARCH_TERM)) ? 'extensions' : 'plugins');
21
  }
22
+
23
  } // End class.
models/installer.php CHANGED
@@ -1,56 +1,56 @@
1
  <?php
2
  /**
3
- *
4
  */
5
 
6
  // Disallow direct access.
7
  defined('ABSPATH') or die("Access denied");
8
 
9
  /**
10
- *
11
  */
12
  class CJTInstallerModel {
13
-
14
  /**
15
- *
16
  */
17
  const OPERATION_STATE_INSTALLED = 'installed';
18
-
19
  /**
20
- *
21
  */
22
  const INSTALLATION_STATE = 'state.CJTInstallerModel.operations';
23
-
24
  /**
25
- *
26
  */
27
  const NOTICED_DISMISSED_OPTION_NAME = 'settings.CJTInstallerModel.noticeDismissed';
28
-
29
  /**
30
  * put your comment there...
31
- *
32
  * @var mixed
33
  */
34
  protected $input;
35
-
36
  /**
37
  * put your comment there...
38
- *
39
  * @var mixed
40
  */
41
  protected $installedDbVersion;
42
-
43
  /**
44
  * put your comment there...
45
- *
46
  */
47
  public function __construct() {
48
  $this->installedDbVersion = get_option(CJTPlugin::DB_VERSION_OPTION_NAME);
49
  }
50
-
51
  /**
52
  * put your comment there...
53
- *
54
  * @param mixed $dismiss
55
  */
56
  public function dismissNotice($dismiss = null) {
@@ -62,18 +62,18 @@ class CJTInstallerModel {
62
  }
63
  return $currentValue;
64
  }
65
-
66
  /**
67
  * put your comment there...
68
- *
69
  */
70
  public function getInstalledDbVersion() {
71
  return $this->installedDbVersion;
72
  }
73
-
74
  /**
75
  * put your comment there...
76
- *
77
  */
78
  public function getInternalVersionName() {
79
  return str_replace(array('.', '-'), '', $this->installedDbVersion);
@@ -81,7 +81,7 @@ class CJTInstallerModel {
81
 
82
  /**
83
  * Get installer operations for current CJT version!
84
- *
85
  * @return array Operations list metadata.
86
  */
87
  public function getOperations() {
@@ -104,16 +104,16 @@ class CJTInstallerModel {
104
  }
105
  // Import upgrader + reflect its operations!
106
  cssJSToolbox::import($upgrader['file']);
107
- $operations[CJTPlugin::DB_VERSION]['operations']['upgrade'] = CJTInstallerReflection::getInstance($upgrader['class'], 'CJTUpgradeNonTabledVersions')->getOperations();
108
  }
109
- update_option(self::INSTALLATION_STATE, $operations);
110
  }
111
  return $operations[CJTPlugin::DB_VERSION];
112
  }
113
 
114
  /**
115
  * put your comment there...
116
- *
117
  */
118
  public function getUpgrader() {
119
  // Upgrader file.
@@ -122,12 +122,12 @@ class CJTInstallerModel {
122
  $upgrader['class'] = "CJTV{$this->getInternalVersionName()}Upgrade";
123
  return $upgrader;
124
  }
125
-
126
  /**
127
  * Allow executing of a single installation operation!
128
- * Both Install and Upgrade operations can be executed throught here
129
- *
130
- *
131
  * @return void
132
  */
133
  public function install() {
@@ -171,10 +171,10 @@ class CJTInstallerModel {
171
  }
172
  return $result;
173
  }
174
-
175
  /**
176
  * put your comment there...
177
- *
178
  */
179
  public function isCommonRelease() {
180
  // Check weather the current installed version is in the same
@@ -195,22 +195,22 @@ class CJTInstallerModel {
195
 
196
  /**
197
  * put your comment there...
198
- *
199
  */
200
  public function isUpgrade() {
201
  // If the version is not the same and not equal to current version then its upgrading!
202
  $isUpgrade = (($this->installedDbVersion != CJTPlugin::DB_VERSION) && ($this->installedDbVersion != ''));
203
  return $isUpgrade;
204
  }
205
-
206
  /**
207
  * put your comment there...
208
- *
209
  * @param mixed $input
210
  */
211
  public function setInput(& $input) {
212
  $this->input = $input;
213
  return $this; // Chaining!
214
  }
215
-
216
  } // End class.
1
  <?php
2
  /**
3
+ *
4
  */
5
 
6
  // Disallow direct access.
7
  defined('ABSPATH') or die("Access denied");
8
 
9
  /**
10
+ *
11
  */
12
  class CJTInstallerModel {
13
+
14
  /**
15
+ *
16
  */
17
  const OPERATION_STATE_INSTALLED = 'installed';
18
+
19
  /**
20
+ *
21
  */
22
  const INSTALLATION_STATE = 'state.CJTInstallerModel.operations';
23
+
24
  /**
25
+ *
26
  */
27
  const NOTICED_DISMISSED_OPTION_NAME = 'settings.CJTInstallerModel.noticeDismissed';
28
+
29
  /**
30
  * put your comment there...
31
+ *
32
  * @var mixed
33
  */
34
  protected $input;
35
+
36
  /**
37
  * put your comment there...
38
+ *
39
  * @var mixed
40
  */
41
  protected $installedDbVersion;
42
+
43
  /**
44
  * put your comment there...
45
+ *
46
  */
47
  public function __construct() {
48
  $this->installedDbVersion = get_option(CJTPlugin::DB_VERSION_OPTION_NAME);
49
  }
50
+
51
  /**
52
  * put your comment there...
53
+ *
54
  * @param mixed $dismiss
55
  */
56
  public function dismissNotice($dismiss = null) {
62
  }
63
  return $currentValue;
64
  }
65
+
66
  /**
67
  * put your comment there...
68
+ *
69
  */
70
  public function getInstalledDbVersion() {
71
  return $this->installedDbVersion;
72
  }
73
+
74
  /**
75
  * put your comment there...
76
+ *
77
  */
78
  public function getInternalVersionName() {
79
  return str_replace(array('.', '-'), '', $this->installedDbVersion);
81
 
82
  /**
83
  * Get installer operations for current CJT version!
84
+ *
85
  * @return array Operations list metadata.
86
  */
87
  public function getOperations() {
104
  }
105
  // Import upgrader + reflect its operations!
106
  cssJSToolbox::import($upgrader['file']);
107
+ $operations[CJTPlugin::DB_VERSION]['operations']['upgrade'] = CJTInstallerReflection::getInstance($upgrader['class'], 'CJTUpgradeNonTabledVersions')->getOperations();
108
  }
109
+ update_option(self::INSTALLATION_STATE, $operations);
110
  }
111
  return $operations[CJTPlugin::DB_VERSION];
112
  }
113
 
114
  /**
115
  * put your comment there...
116
+ *
117
  */
118
  public function getUpgrader() {
119
  // Upgrader file.
122
  $upgrader['class'] = "CJTV{$this->getInternalVersionName()}Upgrade";
123
  return $upgrader;
124
  }
125
+
126
  /**
127
  * Allow executing of a single installation operation!
128
+ * Both Install and Upgrade operations can be executed through here
129
+ *
130
+ *
131
  * @return void
132
  */
133
  public function install() {
171
  }
172
  return $result;
173
  }
174
+
175
  /**
176
  * put your comment there...
177
+ *
178
  */
179
  public function isCommonRelease() {
180
  // Check weather the current installed version is in the same
195
 
196
  /**
197
  * put your comment there...
198
+ *
199
  */
200
  public function isUpgrade() {
201
  // If the version is not the same and not equal to current version then its upgrading!
202
  $isUpgrade = (($this->installedDbVersion != CJTPlugin::DB_VERSION) && ($this->installedDbVersion != ''));
203
  return $isUpgrade;
204
  }
205
+
206
  /**
207
  * put your comment there...
208
+ *
209
  * @param mixed $input
210
  */
211
  public function setInput(& $input) {
212
  $this->input = $input;
213
  return $this; // Chaining!
214
  }
215
+
216
  } // End class.
models/metabox.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- *
4
  */
5
 
6
  // No direct access allowed.
@@ -10,33 +10,33 @@ defined('ABSPATH') or die("Access denied");
10
  cssJSToolbox::import('tables:blocks.php');
11
 
12
  /**
13
- *
14
  */
15
  class CJTMetaboxModel {
16
-
17
  /** */
18
  const STATE_CREATED = 'created';
19
 
20
  /** */
21
  const STATE_DELETED = 'deleted';
22
-
23
  /**
24
  * put your comment there...
25
- *
26
  * @var mixed
27
  */
28
  private $dbDriver = null;
29
-
30
  /**
31
  * put your comment there...
32
- *
33
  * @var mixed
34
  */
35
  protected $post = null;
36
-
37
  /**
38
  * put your comment there...
39
- *
40
  * @param mixed $post
41
  * @return CJTPostModel
42
  */
@@ -48,10 +48,10 @@ class CJTMetaboxModel {
48
  // Instantiate MYSQL DB Driver object.
49
  $this->dbDriver = new CJTMYSQLQueueDriver($GLOBALS['wpdb']);
50
  }
51
-
52
  /**
53
  * put your comment there...
54
- *
55
  * @param mixed $blockId
56
  */
57
  public function create(& $pin = null) {
@@ -82,19 +82,19 @@ class CJTMetaboxModel {
82
  // Chains!
83
  return $this;
84
  }
85
-
86
  /**
87
  * put your comment there...
88
- *
89
  */
90
  public function delete() {
91
  return $this->setState(self::STATE_DELETED);
92
  }
93
-
94
  /**
95
  * Check whether is the current post type
96
  * can has CJT Block metabox?
97
- *
98
  */
99
  public function doPost() {
100
  // Get all post types selected by user.
@@ -103,10 +103,10 @@ class CJTMetaboxModel {
103
  $allowedPostTypes = $metaboxSettings->postTypes;
104
  return in_array($this->getPost()->post_type, $allowedPostTypes);
105
  }
106
-
107
  /**
108
  * put your comment there...
109
- *
110
  */
111
  public function getMetaboxId() {
112
  $metaboxId = get_post_meta($this->getPost()->ID, CJTBlocksTable::BLOCK_META_BOX_ID_META_NAME, true);
@@ -114,28 +114,28 @@ class CJTMetaboxModel {
114
  $metaboxId = (int) $metaboxId;
115
  return $metaboxId;
116
  }
117
-
118
  /**
119
  * put your comment there...
120
- *
121
  */
122
  public function getPost() {
123
- return $this->post;
124
  }
125
-
126
  /**
127
  * put your comment there...
128
- *
129
  */
130
  public function hasBlock() {
131
  // If $postMeta seto to a blockId then it has block otherwise(0) it hasn't.
132
  $metaboxStatus = get_post_meta($this->getPost()->ID, CJTBlocksTable::BLOCK_META_BOX_STATUS_META_NAME, true);
133
  return ($metaboxStatus == self::STATE_CREATED);
134
  }
135
-
136
  /**
137
  * put your comment there...
138
- *
139
  */
140
  public function reservedMetaboxBlockId() {
141
  // Reserved if only if not already taken!
@@ -149,20 +149,20 @@ class CJTMetaboxModel {
149
  }
150
  return $reservedId;
151
  }
152
-
153
  /**
154
  * put your comment there...
155
- *
156
  */
157
  public function save() {
158
  $this->dbDriver->processQueue();
159
  // Chains
160
  return $this;
161
  }
162
-
163
  /**
164
  * put your comment there...
165
- *
166
  * @param mixed $state
167
  */
168
  public function setState($state) {
@@ -171,5 +171,5 @@ class CJTMetaboxModel {
171
  // Chaining!
172
  return $this;
173
  }
174
-
175
  } // End class.
1
  <?php
2
  /**
3
+ *
4
  */
5
 
6
  // No direct access allowed.
10
  cssJSToolbox::import('tables:blocks.php');
11
 
12
  /**
13
+ *
14
  */
15
  class CJTMetaboxModel {
16
+
17
  /** */
18
  const STATE_CREATED = 'created';
19
 
20
  /** */
21
  const STATE_DELETED = 'deleted';
22
+
23
  /**
24
  * put your comment there...
25
+ *
26
  * @var mixed
27
  */
28
  private $dbDriver = null;
29
+
30
  /**
31
  * put your comment there...
32
+ *
33
  * @var mixed
34
  */
35
  protected $post = null;
36
+
37
  /**
38
  * put your comment there...
39
+ *
40
  * @param mixed $post
41
  * @return CJTPostModel
42
  */
48
  // Instantiate MYSQL DB Driver object.
49
  $this->dbDriver = new CJTMYSQLQueueDriver($GLOBALS['wpdb']);
50
  }
51
+
52
  /**
53
  * put your comment there...
54
+ *
55
  * @param mixed $blockId
56
  */
57
  public function create(& $pin = null) {
82
  // Chains!
83
  return $this;
84
  }
85
+
86
  /**
87
  * put your comment there...
88
+ *
89
  */
90
  public function delete() {
91
  return $this->setState(self::STATE_DELETED);
92
  }
93
+
94
  /**
95
  * Check whether is the current post type
96
  * can has CJT Block metabox?
97
+ *
98
  */
99
  public function doPost() {
100
  // Get all post types selected by user.
103
  $allowedPostTypes = $metaboxSettings->postTypes;
104
  return in_array($this->getPost()->post_type, $allowedPostTypes);
105
  }
106
+
107
  /**
108
  * put your comment there...
109
+ *
110
  */
111
  public function getMetaboxId() {
112
  $metaboxId = get_post_meta($this->getPost()->ID, CJTBlocksTable::BLOCK_META_BOX_ID_META_NAME, true);
114
  $metaboxId = (int) $metaboxId;
115
  return $metaboxId;
116
  }
117
+
118
  /**
119
  * put your comment there...
120
+ *
121
  */
122
  public function getPost() {
123
+ return $this->post;
124
  }
125
+
126
  /**
127
  * put your comment there...
128
+ *
129
  */
130
  public function hasBlock() {
131
  // If $postMeta seto to a blockId then it has block otherwise(0) it hasn't.
132
  $metaboxStatus = get_post_meta($this->getPost()->ID, CJTBlocksTable::BLOCK_META_BOX_STATUS_META_NAME, true);
133
  return ($metaboxStatus == self::STATE_CREATED);
134
  }
135
+
136
  /**
137
  * put your comment there...
138
+ *
139
  */
140
  public function reservedMetaboxBlockId() {
141
  // Reserved if only if not already taken!
149
  }
150
  return $reservedId;
151
  }
152
+
153
  /**
154
  * put your comment there...
155
+ *
156
  */
157
  public function save() {
158
  $this->dbDriver->processQueue();
159
  // Chains
160
  return $this;
161
  }
162
+
163
  /**
164
  * put your comment there...
165
+ *
166
  * @param mixed $state
167
  */
168
  public function setState($state) {
171
  // Chaining!
172
  return $this;
173
  }
174
+
175
  } // End class.
models/package.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- *
4
  */
5
 
6
  // Disllow direct access.
@@ -8,27 +8,27 @@ defined('ABSPATH') or die('Access denied');
8
 
9
  // Import dependencies.
10
  cssJSToolbox::import('framework:db:mysql:xtable.inc.php');
11
-
12
  /**
13
- *
14
  */
15
  class CJTPackageModel extends CJTHookableClass {
16
 
17
  /**
18
  * put your comment there...
19
- *
20
  * @var mixed
21
  */
22
  protected $params = array();
23
 
24
  /**
25
  * Delete single package.
26
- *
27
  * This method is going to delete the package
28
  * and all the templates and blocks associated to it,
29
  * therefor it'll unlink/break-down the relationship
30
  * between those templates and blocks.
31
- *
32
  * @param Integer Package Id.
33
  * @return CJTPackageModel Return $this.
34
  */
@@ -36,8 +36,8 @@ class CJTPackageModel extends CJTHookableClass {
36
  // Initialize.
37
  $modelTemplates = CJTModel::getInstance('templates-manager');
38
  $dbd = cssJSToolbox::getInstance()->getDBDriver();
39
- $assoObjectsQueryTmp = 'SELECT objectId
40
- FROM #__cjtoolbox_package_objects
41
  WHERE packageId = %d AND objectType = "%s" AND relType = "%s";';
42
  // Delete the package.
43
  CJTxTable::getInstance('package')
@@ -65,7 +65,7 @@ class CJTPackageModel extends CJTHookableClass {
65
 
66
  /**
67
  * put your comment there...
68
- *
69
  * @param mixed $packageName
70
  */
71
  public function exists($packageName) {
@@ -79,7 +79,7 @@ class CJTPackageModel extends CJTHookableClass {
79
 
80
  /**
81
  * put your comment there...
82
- *
83
  */
84
  public function getFileContent() {
85
  // Get package ID.
@@ -97,7 +97,7 @@ class CJTPackageModel extends CJTHookableClass {
97
 
98
  /**
99
  * put your comment there...
100
- *
101
  * @param mixed $name
102
  */
103
  public function getParam($name) {
@@ -106,7 +106,7 @@ class CJTPackageModel extends CJTHookableClass {
106
 
107
  /**
108
  * put your comment there...
109
- *
110
  * @param mixed $package
111
  */
112
  public function save($package) {
@@ -115,10 +115,10 @@ class CJTPackageModel extends CJTHookableClass {
115
  ->setData($package)
116
  ->save()->get('id');
117
  }
118
-
119
  /**
120
  * put your comment there...
121
- *
122
  * @param mixed $name
123
  * @param mixed $value
124
  */
1
  <?php
2
  /**
3
+ *
4
  */
5
 
6
  // Disllow direct access.
8
 
9
  // Import dependencies.
10
  cssJSToolbox::import('framework:db:mysql:xtable.inc.php');
11
+
12
  /**
13
+ *
14
  */
15
  class CJTPackageModel extends CJTHookableClass {
16
 
17
  /**
18
  * put your comment there...
19
+ *
20
  * @var mixed
21
  */
22
  protected $params = array();
23
 
24
  /**
25
  * Delete single package.
26
+ *
27
  * This method is going to delete the package
28
  * and all the templates and blocks associated to it,
29
  * therefor it'll unlink/break-down the relationship
30
  * between those templates and blocks.
31
+ *
32
  * @param Integer Package Id.
33
  * @return CJTPackageModel Return $this.
34
  */
36
  // Initialize.
37
  $modelTemplates = CJTModel::getInstance('templates-manager');
38
  $dbd = cssJSToolbox::getInstance()->getDBDriver();
39
+ $assoObjectsQueryTmp = 'SELECT objectId
40
+ FROM #__cjtoolbox_package_objects
41
  WHERE packageId = %d AND objectType = "%s" AND relType = "%s";';
42
  // Delete the package.
43
  CJTxTable::getInstance('package')
65
 
66
  /**
67
  * put your comment there...
68
+ *
69
  * @param mixed $packageName
70
  */
71
  public function exists($packageName) {
79
 
80
  /**
81
  * put your comment there...
82
+ *
83
  */
84
  public function getFileContent() {
85
  // Get package ID.
97
 
98
  /**
99
  * put your comment there...
100
+ *
101
  * @param mixed $name
102
  */
103
  public function getParam($name) {
106
 
107
  /**
108
  * put your comment there...
109
+ *
110
  * @param mixed $package
111
  */
112
  public function save($package) {
115
  ->setData($package)
116
  ->save()->get('id');
117
  }
118
+
119
  /**
120
  * put your comment there...
121
+ *
122
  * @param mixed $name
123
  * @param mixed $value
124
  */
models/parameters.php CHANGED
@@ -1,19 +1,19 @@
1
  <?php
2
  /**
3
- *
4
  */
5
 
6
  /**
7
- *
8
  */
9
  class CJT_Models_Parameters {
10
 
11
  /**
12
  * Delete parameter or group or parameters
13
  * or all parameters associasted to specific block.
14
- *
15
  * Each Key might has only the parameterId or blockId or both of them.
16
- *
17
  * @param array array('blockId' => ID, 'parameterId' => 'ID).
18
  * @return
19
  */
1
  <?php
2
  /**
3
+ *
4
  */
5
 
6
  /**
7
+ *
8
  */
9
  class CJT_Models_Parameters {
10
 
11
  /**
12
  * Delete parameter or group or parameters
13
  * or all parameters associasted to specific block.
14
+ *
15
  * Each Key might has only the parameterId or blockId or both of them.
16
+ *
17
  * @param array array('blockId' => ID, 'parameterId' => 'ID).
18
  * @return
19
  */
models/setup.php CHANGED
@@ -123,7 +123,7 @@ class CJTSetupModel {
123
  $exDef = new SimpleXMLElement(file_get_contents($pluginXMLFile));
124
  # Register XPath namespace
125
  $license = $exDef->license;
126
- $license->registerXPathNamespace('ext', 'http://css-javascript-toolbox.com/extensions/xmldeffile');
127
  # Get types
128
  $typesSrc = $exDef->license->xpath('name');
129
  foreach ($typesSrc as $type) {
123
  $exDef = new SimpleXMLElement(file_get_contents($pluginXMLFile));
124
  # Register XPath namespace
125
  $license = $exDef->license;
126
+ $license->registerXPathNamespace('ext', 'https://css-javascript-toolbox.com/extensions/xmldeffile');
127
  # Get types
128
  $typesSrc = $exDef->license->xpath('name');
129
  foreach ($typesSrc as $type) {
models/statistics-metabox.php CHANGED
@@ -7,81 +7,81 @@
7
  * No direct access.
8
  */
9
  defined('ABSPATH') or die("Access denied");
10
-
11
  /**
12
- *
13
  * @author Ahmed Said
14
  * @version 6
15
  */
16
  class CJTStatisticsMetaboxModel {
17
-
18
  /**
19
- *
20
  */
21
  const CJT_LASTEST_SCRIPT_OPTION_NAME = 'CJTStatisticsMetaboxModel.latestscripts';
22
-
23
  /**
24
- *
25
  */
26
  const LATEST_SCRIPT_EXPIRES = 86400;
27
-
28
  /**
29
  * put your comment there...
30
- *
31
  * @var mixed
32
  */
33
  protected $dbDriver;
34
-
35
  /**
36
  * put your comment there...
37
- *
38
  */
39
  public function __construct() {
40
  $this->dbDriver =& cssJSToolbox::getInstance()->getDBDriver();
41
  }
42
-
43
  /**
44
  * put your comment there...
45
- *
46
  * @param mixed $state
47
  * @param mixed $type
48
  */
49
- public function getBlocksCount($state, $type)
50
  {
51
-
52
- $query = " SELECT count(*) blocksCount
53
- FROM #__cjtoolbox_blocks
54
  WHERE backupId IS NULL AND state = '{$state}' AND type='{$type}';";
55
-
56
  $result = $this->dbDriver->select($query, ARRAY_A);
57
-
58
  $count = $result[0]['blocksCount'];
59
-
60
  return $count;
61
  }
62
-
63
  /**
64
  * put your comment there...
65
- *
66
  */
67
  public function getCodeFilesCount()
68
  {
69
-
70
  $query = ' SELECT count(*) codeFilesCount
71
  FROM #__cjtoolbox_blocks b LEFT JOIN #__cjtoolbox_block_files f
72
  ON b.id = f.blockId
73
  WHERE b.BackupId IS NULL AND b.type != "revision";';
74
-
75
  $result = $this->dbDriver->select($query, ARRAY_A);
76
-
77
  $count = $result[0]['codeFilesCount'];
78
-
79
  return $count;
80
  }
81
-
82
  /**
83
  * put your comment there...
84
- *
85
  */
86
  public function getFeed() {
87
  // Initialize.
@@ -94,7 +94,7 @@ class CJTStatisticsMetaboxModel {
94
  $scriptsFeed = new CJT_Framework_Wordpress_Feed(cssJSToolbox::CJT_WEB_SITE_DOMAIN, 'category/scripts/feed/', $fieldsNames);
95
  $widgetTransitFeed['scripts'] = $scriptsFeed->getLatestItems(7);
96
  # Get latest extensions from feed
97
- $extensionsFeed = new CJT_Framework_Wordpress_Feed(cssJSToolbox::CJT_WEB_SITE_DOMAIN, 'category/extensions/feed/', $fieldsNames);
98
  $widgetTransitFeed['extensions'] = $extensionsFeed->getLatestItems(7);
99
  # Get latest news from news feed.
100
  $newsFeed = new CJT_Framework_Wordpress_Feed(cssJSToolbox::CJT_WEB_SITE_DOMAIN, 'category/news/feed/', $fieldsNames);
@@ -103,7 +103,7 @@ class CJTStatisticsMetaboxModel {
103
  if (!$newsFeed->isError() && !$scriptsFeed->isError() && !$extensionsFeed->isError()) {
104
  # Store cache time.
105
  $widgetTransitFeed['time'] = time();
106
- update_option(self::CJT_LASTEST_SCRIPT_OPTION_NAME, $widgetTransitFeed);
107
  }
108
  }
109
  # For versions 8.0 it will produce PHP notice because extensions item is not being exists in the cache
@@ -118,7 +118,7 @@ class CJTStatisticsMetaboxModel {
118
 
119
  /**
120
  * put your comment there...
121
- *
122
  */
123
  public function getPackagesCount() {
124
  $result = $this->dbDriver->select('SELECT count(*) packagesCount FROM #__cjtoolbox_packages;', ARRAY_A);
@@ -127,11 +127,11 @@ class CJTStatisticsMetaboxModel {
127
 
128
  /**
129
  * put your comment there...
130
- *
131
  */
132
  public function getTemplatesCount() {
133
  $result = $this->dbDriver->select('SELECT count(*) templatesCount FROM #__cjtoolbox_templates WHERE (attributes & 1) = 0;', ARRAY_A);
134
- return $result[0]['templatesCount'];
135
  }
136
 
137
  } // End class.
7
  * No direct access.
8
  */
9
  defined('ABSPATH') or die("Access denied");
10
+
11
  /**
12
+ *
13
  * @author Ahmed Said
14
  * @version 6
15
  */
16
  class CJTStatisticsMetaboxModel {
17
+
18
  /**
19
+ *
20
  */
21
  const CJT_LASTEST_SCRIPT_OPTION_NAME = 'CJTStatisticsMetaboxModel.latestscripts';
22
+
23
  /**
24
+ *
25
  */
26
  const LATEST_SCRIPT_EXPIRES = 86400;
27
+
28
  /**
29
  * put your comment there...
30
+ *
31
  * @var mixed
32
  */
33
  protected $dbDriver;
34
+
35
  /**
36
  * put your comment there...
37
+ *
38
  */
39
  public function __construct() {
40
  $this->dbDriver =& cssJSToolbox::getInstance()->getDBDriver();
41
  }
42
+
43
  /**
44
  * put your comment there...
45
+ *
46
  * @param mixed $state
47
  * @param mixed $type
48
  */
49
+ public function getBlocksCount($state, $type)
50
  {
51
+
52
+ $query = " SELECT count(*) blocksCount
53
+ FROM #__cjtoolbox_blocks
54
  WHERE backupId IS NULL AND state = '{$state}' AND type='{$type}';";
55
+
56
  $result = $this->dbDriver->select($query, ARRAY_A);
57
+
58
  $count = $result[0]['blocksCount'];
59
+
60
  return $count;
61
  }
62
+
63
  /**
64
  * put your comment there...
65
+ *
66
  */
67
  public function getCodeFilesCount()
68
  {
69
+
70
  $query = ' SELECT count(*) codeFilesCount
71
  FROM #__cjtoolbox_blocks b LEFT JOIN #__cjtoolbox_block_files f
72
  ON b.id = f.blockId
73
  WHERE b.BackupId IS NULL AND b.type != "revision";';
74
+
75
  $result = $this->dbDriver->select($query, ARRAY_A);
76
+
77
  $count = $result[0]['codeFilesCount'];
78
+
79
  return $count;
80
  }
81
+
82
  /**
83
  * put your comment there...
84
+ *
85
  */
86
  public function getFeed() {
87
  // Initialize.
94
  $scriptsFeed = new CJT_Framework_Wordpress_Feed(cssJSToolbox::CJT_WEB_SITE_DOMAIN, 'category/scripts/feed/', $fieldsNames);
95
  $widgetTransitFeed['scripts'] = $scriptsFeed->getLatestItems(7);
96
  # Get latest extensions from feed
97
+ $extensionsFeed = new CJT_Framework_Wordpress_Feed(cssJSToolbox::CJT_WEB_SITE_DOMAIN, 'category/extensions/feed/', $fieldsNames);
98
  $widgetTransitFeed['extensions'] = $extensionsFeed->getLatestItems(7);
99
  # Get latest news from news feed.
100
  $newsFeed = new CJT_Framework_Wordpress_Feed(cssJSToolbox::CJT_WEB_SITE_DOMAIN, 'category/news/feed/', $fieldsNames);
103
  if (!$newsFeed->isError() && !$scriptsFeed->isError() && !$extensionsFeed->isError()) {
104
  # Store cache time.
105
  $widgetTransitFeed['time'] = time();
106
+ update_option(self::CJT_LASTEST_SCRIPT_OPTION_NAME, $widgetTransitFeed);
107
  }
108
  }
109
  # For versions 8.0 it will produce PHP notice because extensions item is not being exists in the cache
118
 
119
  /**
120
  * put your comment there...
121
+ *
122
  */
123
  public function getPackagesCount() {
124
  $result = $this->dbDriver->select('SELECT count(*) packagesCount FROM #__cjtoolbox_packages;', ARRAY_A);
127
 
128
  /**
129
  * put your comment there...
130
+ *
131
  */
132
  public function getTemplatesCount() {
133
  $result = $this->dbDriver->select('SELECT count(*) templatesCount FROM #__cjtoolbox_templates WHERE (attributes & 1) = 0;', ARRAY_A);
134
+ return $result[0]['templatesCount'];
135
  }
136
 
137
  } // End class.
models/uninstall.php CHANGED
@@ -7,7 +7,7 @@
7
  defined('ABSPATH') or die("Access denied");
8
 
9
  /**
10
- * Provide uninstall functnios
11
  * required for cleaning up the installation
12
  * process!
13
  *
7
  defined('ABSPATH') or die("Access denied");
8
 
9
  /**
10
+ * Provide uninstall functions
11
  * required for cleaning up the installation
12
  * process!
13
  *
readme.txt CHANGED
@@ -2,13 +2,13 @@
2
  Contributors: wipeoutmedia
3
  Author URL: https://css-javascript-toolbox.com
4
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=EWDWF75JHT9Q6
5
- Tags: CSS, JavaScript, PHP, scripts, Gutenberg, code, code blocks
6
  License: GPLv2 or later
7
  License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
8
- Requires at least: 3.9
9
- Requires PHP: 5.6
10
- Tested up to: 5.2.3
11
- Stable tag: 9.3.1
12
 
13
  Add and manage CSS, JavaScript, HTML and PHP code to unique CJT Code Blocks and assign them anywhere on your website. Compatible with the Gutenberg Editor.
14
 
@@ -144,9 +144,10 @@ Due to the overwhelming amount of emails we get for users requesting support for
144
  21. See Code Block information at a glance (CJT PLUS ONLY)
145
 
146
  == Changelog ==
147
-
148
- = 9.3.1 =
149
- - Added: Promotional banner
 
150
 
151
  = 9.3 =
152
  * Fix: SQL vulnerability for uninstaller.
2
  Contributors: wipeoutmedia
3
  Author URL: https://css-javascript-toolbox.com
4
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=EWDWF75JHT9Q6
5
+ Tags: CSS, JavaScript, PHP, scripts, code, styles, HTML, HTML5, header, footer, widget, sidebar, shortcode, Gutenberg, code blocks
6
  License: GPLv2 or later
7
  License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
8
+ Requires at least: 4.9 or higher
9
+ Requires PHP: 5.6 or higher
10
+ Tested up to: 5.3
11
+ Stable tag: 9.4
12
 
13
  Add and manage CSS, JavaScript, HTML and PHP code to unique CJT Code Blocks and assign them anywhere on your website. Compatible with the Gutenberg Editor.
14
 
144
  21. See Code Block information at a glance (CJT PLUS ONLY)
145
 
146
  == Changelog ==
147
+ = 9.4 =
148
+ * Improved variable security throughout the plugin.
149
+ * Fix: Bugs fixed.
150
+ * Fix: PHP notices and warnings fixed.
151
 
152
  = 9.3 =
153
  * Fix: SQL vulnerability for uninstaller.
views/backups/manager/tmpl/single-backup.html.tmpl CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
- /*
3
- Getting backup row class.
4
- Class can be "alt-backup-row" for odd index row or "backup-row" for even index row.
5
  */
6
  // Deinfe Classes.
7
  $CSSClasses = array(
@@ -9,11 +9,11 @@
9
  1 => 'alt-backup-row',
10
  );
11
  // Select row class based on index.
12
- $rowClassIndex = $rowIndex & 0x01; // $rowIndex passed throught getTemplates $params.
13
  $rowClass = " {$CSSClasses[$rowClassIndex]}";
14
  ?>
15
  <li id="backup-row-<?php echo $this->currentBackup->id ?>" class="backup-row<?php echo $rowClass ?>">
16
- <span class="backup-name"><?php echo $this->currentBackup->name ?></span> <?php echo cssJSToolbox::getText('By') ?> <?php echo $this->currentBackup->owner->display_name ?> @ <?php echo $this->currentBackup->created ?>
17
  <span class="backup-tasks">
18
  <a class="restore" href="#<?php echo $this->currentBackup->id ?>">Restore</a> | <a class="delete" href="#<?php echo $this->currentBackup->id ?>">Delete</a>
19
  </span>
1
  <?php
2
+ /*
3
+ Getting backup row class.
4
+ Class can be "alt-backup-row" for odd index row or "backup-row" for even index row.
5
  */
6
  // Deinfe Classes.
7
  $CSSClasses = array(
9
  1 => 'alt-backup-row',
10
  );
11
  // Select row class based on index.
12
+ $rowClassIndex = $rowIndex & 0x01; // $rowIndex passed through getTemplates $params.
13
  $rowClass = " {$CSSClasses[$rowClassIndex]}";
14
  ?>
15
  <li id="backup-row-<?php echo $this->currentBackup->id ?>" class="backup-row<?php echo $rowClass ?>">
16
+ <span class="backup-name"><?php echo $this->currentBackup->name ?></span> <?php echo cssJSToolbox::getText('By') ?> <?php echo $this->currentBackup->owner->display_name ?> @ <?php echo $this->currentBackup->created ?>
17
  <span class="backup-tasks">
18
  <a class="restore" href="#<?php echo $this->currentBackup->id ?>">Restore</a> | <a class="delete" href="#<?php echo $this->currentBackup->id ?>">Delete</a>
19
  </span>
views/blocks/block/public/js/block/block.js CHANGED
@@ -1,6 +1,6 @@
1
  /**
2
  * @version $ Id; cjtserver.js 21-03-2012 03:22:10 Ahmed Said $
3
- *
4
  * Block model class.
5
  */
6
 
@@ -13,17 +13,17 @@ var CJTBlockBase;
13
  * JQuery wrapper for the CJTBlock class.
14
  */
15
  (function($) {
16
-
17
  /**
18
  * Flags values.
19
  *
20
- * @var object
21
  */
22
  var flags = {
23
  location : ['header', 'footer'],
24
  state : ['active', 'inactive']
25
  };
26
-
27
  /**
28
  * Provide simple access to single block properties.
29
  *
@@ -32,33 +32,33 @@ var CJTBlockBase;
32
  * @param DOMElement Block element.
33
  */
34
  CJTBlockBase = function() {
35
-
36
  /**
37
- *
38
  *
39
  *
40
  */
41
  this.aceEditor = null;
42
-
43
  /**
44
- *
45
  */
46
  this.blockPlugin = null;
47
-
48
  /**
49
  * Block JQuery object.
50
  *
51
  * @var JQuery object.
52
  */
53
  this.box = null;
54
-
55
  /**
56
  * Block id.
57
  *
58
  * @var integer
59
  */
60
  this.id = 0;
61
-
62
  /**
63
  * Blocks property that allowed to be read or write.
64
  *
@@ -73,7 +73,7 @@ var CJTBlockBase;
73
  this.properties = {};
74
 
75
  /**
76
- *
77
  */
78
  this.addProperties = function(properties) {
79
  // Prepare properties, add them to model list.
@@ -102,7 +102,7 @@ var CJTBlockBase;
102
 
103
  /**
104
  * put your comment there...
105
- *
106
  * @param element
107
  */
108
  this.CJTBlockBase = function(blockPlugin, element, properties) {
@@ -118,7 +118,7 @@ var CJTBlockBase;
118
  // Initialize ALL (BASE, DERIVDED) properties.
119
  this.addProperties(properties);
120
  }
121
-
122
  /**
123
  * Get block property cvalue.
124
  *
@@ -127,7 +127,7 @@ var CJTBlockBase;
127
  */
128
  this.get = function(name, _default) {
129
  // Initialize.
130
- var value = null;
131
  var property = this.property(name);
132
  // Check member variables first.
133
  if (this[name] != undefined) {
@@ -139,10 +139,10 @@ var CJTBlockBase;
139
  var cookieName = name + '-' + this.id;
140
  value = $.cookies.get(cookieName);
141
  }
142
- else { // Not cookies, it may be saved throught JS object or inside HTML elements.
143
  // Custom implemetation.
144
  switch (name) {
145
- case 'code': // Code is throught ACE-Editor Object.
146
  value = this.aceEditor.getSession().getValue();
147
  break;
148
  default: // Get property value from html elements.
@@ -157,9 +157,9 @@ var CJTBlockBase;
157
  // Returns
158
  return value;
159
  }
160
-
161
  /**
162
- *
163
  */
164
  this.getDIFields = function() {
165
  // Initialize.
@@ -169,9 +169,9 @@ var CJTBlockBase;
169
  // Returns diFields
170
  return diFields;
171
  }
172
-
173
  /**
174
- *
175
  */
176
  this.getDIProperties = function() {
177
  // Initialize.
@@ -198,18 +198,18 @@ var CJTBlockBase;
198
  * The method call CJTServer.getQueue method with the name parameter
199
  * generated from the operation name and the block id. The result is each block has
200
  * an object for each operation it may process.
201
- *
202
  * @param string Operation name.
203
  * @return CJTBlocksServerQueue Operation queue object.
204
- */
205
  this.getOperationQueue = function(operation) {
206
  var name = (operation + '-operation-' + this.get('id').toString());
207
  var queue = CJTBlocksPage.server.getQueue('Blocks', name, 'blocksPage', 'save_blocks');
208
  return queue;
209
  }
210
-
211
  /**
212
- *
213
  */
214
  this.loadBase = function(properties) {
215
  // Enable ACE Editor.
@@ -241,12 +241,12 @@ var CJTBlockBase;
241
 
242
  /**
243
  * @internal
244
- *
245
  * Prepare property selector object.
246
  *
247
  * @param string Property name.
248
  * @return object Property selector object.
249
- */
250
  this.property = function(name) {
251
  // Get property object from the cache.
252
  var property = this.properties[name];
@@ -254,7 +254,7 @@ var CJTBlockBase;
254
  // get and set property values.
255
  return property;
256
  }
257
-
258
  /**
259
  * Set block property value.
260
  *
@@ -300,29 +300,29 @@ var CJTBlockBase;
300
  }
301
  return promise;
302
  }
303
-
304
  /**
305
  * Send block Ajax queues to the server.
306
  *
307
  * This method calls CJTServerQueue.send method.
308
  * The result is sending all updated properties queue to the server.
309
- *
310
  * Please note: CJTServerQueue.send method will do nothing if the queue is locked.
311
- *
312
  * @return jqxhr
313
  */
314
  this.sync = function(name, data) {
315
  var ajaxPromise = this.getOperationQueue(name).send('post', data);
316
  return ajaxPromise;
317
  }
318
-
319
  /**
320
  * Switch block flag property.
321
  *
322
  * Because flag can represent only two states. This method
323
- * is to simplify changing flag value. It automatically detect
324
- * current flag value and the new value OR simply the value can be
325
- * forced to a specific state throught the newValue parameter.
326
  *
327
  * @param string Flag name.
328
  * @param [mixed] Force flag value to newValue.
@@ -339,12 +339,12 @@ var CJTBlockBase;
339
  // currentIndex(0) XOR 1 = 1
340
  // currentIndex(1) XOR 1 = 0
341
  var newIndex = currentIndex ^ 1;
342
- var newValue = possibleValues[newIndex];
343
  }
344
  promise = this.set(flag, newValue);
345
  return promise;
346
  }
347
-
348
  /**
349
  * Save Direct Interact Fields.
350
  *
@@ -368,7 +368,7 @@ var CJTBlockBase;
368
  }, this)
369
  );
370
  }
371
-
372
  } // End class.
373
-
374
  })(jQuery);
1
  /**
2
  * @version $ Id; cjtserver.js 21-03-2012 03:22:10 Ahmed Said $
3
+ *
4
  * Block model class.
5
  */
6
 
13
  * JQuery wrapper for the CJTBlock class.
14
  */
15
  (function($) {
16
+
17
  /**
18
  * Flags values.
19
  *
20
+ * @var object
21
  */
22
  var flags = {
23
  location : ['header', 'footer'],
24
  state : ['active', 'inactive']
25
  };
26
+
27
  /**
28
  * Provide simple access to single block properties.
29
  *
32
  * @param DOMElement Block element.
33
  */
34
  CJTBlockBase = function() {
35
+
36
  /**
37
+ *
38
  *
39
  *
40
  */
41
  this.aceEditor = null;
42
+
43
  /**
44
+ *
45
  */
46
  this.blockPlugin = null;
47
+
48
  /**
49
  * Block JQuery object.
50
  *
51
  * @var JQuery object.
52
  */
53
  this.box = null;
54
+
55
  /**
56
  * Block id.
57
  *
58
  * @var integer
59
  */
60
  this.id = 0;
61
+
62
  /**
63
  * Blocks property that allowed to be read or write.
64
  *
73
  this.properties = {};
74
 
75
  /**
76
+ *
77
  */
78
  this.addProperties = function(properties) {
79
  // Prepare properties, add them to model list.
102
 
103
  /**
104
  * put your comment there...
105
+ *
106
  * @param element
107
  */
108
  this.CJTBlockBase = function(blockPlugin, element, properties) {
118
  // Initialize ALL (BASE, DERIVDED) properties.
119
  this.addProperties(properties);
120
  }
121
+
122
  /**
123
  * Get block property cvalue.
124
  *
127
  */
128
  this.get = function(name, _default) {
129
  // Initialize.
130
+ var value = null;
131
  var property = this.property(name);
132
  // Check member variables first.
133
  if (this[name] != undefined) {
139
  var cookieName = name + '-' + this.id;
140
  value = $.cookies.get(cookieName);
141
  }
142
+ else { // Not cookies, it may be saved through JS object or inside HTML elements.
143
  // Custom implemetation.
144
  switch (name) {
145
+ case 'code': // Code is through ACE-Editor Object.
146
  value = this.aceEditor.getSession().getValue();
147
  break;
148
  default: // Get property value from html elements.
157
  // Returns
158
  return value;
159
  }
160
+
161
  /**
162
+ *
163
  */
164
  this.getDIFields = function() {
165
  // Initialize.
169
  // Returns diFields
170
  return diFields;
171
  }
172
+
173
  /**
174
+ *
175
  */
176
  this.getDIProperties = function() {
177
  // Initialize.
198
  * The method call CJTServer.getQueue method with the name parameter
199
  * generated from the operation name and the block id. The result is each block has
200
  * an object for each operation it may process.
201
+ *
202
  * @param string Operation name.
203
  * @return CJTBlocksServerQueue Operation queue object.
204
+ */
205
  this.getOperationQueue = function(operation) {
206
  var name = (operation + '-operation-' + this.get('id').toString());
207
  var queue = CJTBlocksPage.server.getQueue('Blocks', name, 'blocksPage', 'save_blocks');
208
  return queue;
209
  }
210
+
211
  /**
212
+ *
213
  */
214
  this.loadBase = function(properties) {
215
  // Enable ACE Editor.
241
 
242
  /**
243
  * @internal
244
+ *
245
  * Prepare property selector object.
246
  *
247
  * @param string Property name.
248
  * @return object Property selector object.
249
+ */
250
  this.property = function(name) {
251
  // Get property object from the cache.
252
  var property = this.properties[name];
254
  // get and set property values.
255
  return property;
256
  }
257
+
258
  /**
259
  * Set block property value.
260
  *
300
  }
301
  return promise;
302
  }
303
+
304
  /**
305
  * Send block Ajax queues to the server.
306
  *
307
  * This method calls CJTServerQueue.send method.
308
  * The result is sending all updated properties queue to the server.
309
+ *
310
  * Please note: CJTServerQueue.send method will do nothing if the queue is locked.
311
+ *
312
  * @return jqxhr
313
  */
314
  this.sync = function(name, data) {
315
  var ajaxPromise = this.getOperationQueue(name).send('post', data);
316
  return ajaxPromise;
317
  }
318
+
319
  /**
320
  * Switch block flag property.
321
  *
322
  * Because flag can represent only two states. This method
323
+ * is to simplify changing flag value. It automatically detect
324
+ * current flag value and the new value OR simply the value can be
325
+ * forced to a specific state through the newValue parameter.
326
  *
327
  * @param string Flag name.
328
  * @param [mixed] Force flag value to newValue.
339
  // currentIndex(0) XOR 1 = 1
340
  // currentIndex(1) XOR 1 = 0
341
  var newIndex = currentIndex ^ 1;
342
+ var newValue = possibleValues[newIndex];
343
  }
344
  promise = this.set(flag, newValue);
345
  return promise;
346
  }
347
+
348
  /**
349
  * Save Direct Interact Fields.
350
  *
368
  }, this)
369
  );
370
  }
371
+
372
  } // End class.
373
+
374
  })(jQuery);
views/blocks/block/public/js/jquery.block/jquery.block.js CHANGED
@@ -181,7 +181,7 @@
181
  /**
182
  * Event handler for cancel edit block name.
183
  *
184
- * Cancel edit name can be done throught two ways.
185
  * - Press Escape inside edit block name input.
186
  * - Click cancel edit name icon.
187
  */
181
  /**
182
  * Event handler for cancel edit block name.
183
  *
184
+ * Cancel edit name can be done through two ways.
185
  * - Press Escape inside edit block name input.
186
  * - Click cancel edit name icon.
187
  */
views/blocks/block/tmpl/content.html.tmpl CHANGED
@@ -6,13 +6,13 @@
6
  // Disallow direct access.
7
  defined('ABSPATH') or die("Access denied");
8
  $block = $this->getBlock($this->block->id, [], ['id', 'name', 'pinPoint', 'links', 'expressions', 'created']);
9
- $inPages = $block->pages ? $block->pages : [];
10
- $inPosts = $block->posts ? $block->posts : [];
11
- $inCats = $block->categories ? $block->categories : [];
12
- $inTags = $block->post_tags ? $block->post_tags : [];
13
  $inAux = [];
14
- $inLinks = !empty($block->links) ? explode("\n", $block->links) : [];
15
- $inExps = !empty($block->expressions) ? explode("\n", $block->expressions) : [];
16
  $allAssignment = array_merge( $inPages, $inPosts, $inCats, $inTags, $inLinks, $inExps );
17
  ?>
18
  <?php
6
  // Disallow direct access.
7
  defined('ABSPATH') or die("Access denied");
8
  $block = $this->getBlock($this->block->id, [], ['id', 'name', 'pinPoint', 'links', 'expressions', 'created']);
9
+ $inPages = isset( $block->pages ) ? $block->pages : [];
10
+ $inPosts = isset( $block->posts ) ? $block->posts : [];
11
+ $inCats = isset( $block->categories ) ? $block->categories : [];
12
+ $inTags = isset( $block->post_tags ) ? $block->post_tags : [];
13
  $inAux = [];
14
+ $inLinks = ! empty( $block->links ) ? explode( "\n", $block->links ) : [];
15
+ $inExps = ! empty( $block->expressions ) ? explode( "\n", $block->expressions ) : [];
16
  $allAssignment = array_merge( $inPages, $inPosts, $inCats, $inTags, $inLinks, $inExps );
17
  ?>
18
  <?php
views/blocks/manager/public/css/blocks.css CHANGED
@@ -6,32 +6,21 @@ body{min-width: 700px;}
6
  #cjt-banner-bar-right {right: 0; position: absolute;top: 2px;}
7
  #cjt-banner-bar-right .cjt-banner-link {margin-bottom: 6px; font-size: 14px}
8
  #cjt-banner-bar-center {
9
- display: flex;
10
  position: absolute;
11
  top: 0px;
12
- left: 35%;
 
 
 
13
  }
14
- #cjt-banner-bar-center img {
15
- width: 170px;
16
- margin-right: 20px;
17
- }
18
- #cjt-banner-bar-center h3 {
19
- text-transform: uppercase;
20
- font-weight: 900;
21
- margin-top: 0;
22
  }
23
  #cjt-banner-bar-center p {
24
- font-weight: 600;
25
- margin: 15px 0;
26
- line-height: 1.2;
27
- }
28
- #cjt-banner-bar-center em {
29
- position: absolute;
30
- bottom: -20px;
31
- font-size: 11px;
32
- text-align: center;
33
- width: 100%;
34
- font-weight: 600;
35
  }
36
  span#support-us {position: absolute;top: 15px;left: 370px;font-size: 13px;color: #aaa;font-weight: bold;}
37
 
@@ -134,7 +123,8 @@ cjt-noblocks-intro h4 {font-weight: bold; font-size: 15px;}
134
  text-indent: 1px;
135
  font-size: 14px;
136
  display: block;
137
- left: 360px;
138
- position: absolute;
139
- bottom: 17px;
 
140
  }
6
  #cjt-banner-bar-right {right: 0; position: absolute;top: 2px;}
7
  #cjt-banner-bar-right .cjt-banner-link {margin-bottom: 6px; font-size: 14px}
8
  #cjt-banner-bar-center {
 
9
  position: absolute;
10
  top: 0px;
11
+ left: 35%;
12
+ border: 3px solid #005EA5;
13
+ padding: 10px 15px 0 15px;
14
+ background-color: #FFF;
15
  }
16
+ #cjt-banner-bar-center p strong {
17
+ color: #005EA5;
 
 
 
 
 
 
18
  }
19
  #cjt-banner-bar-center p {
20
+ font-weight: 500;
21
+ margin: 0 0 15px;
22
+ line-height: 1.5;
23
+ font-size: 12px;
 
 
 
 
 
 
 
24
  }
25
  span#support-us {position: absolute;top: 15px;left: 370px;font-size: 13px;color: #aaa;font-weight: bold;}
26
 
123
  text-indent: 1px;
124
  font-size: 14px;
125
  display: block;
126
+ margin-top: 45px;
127
+ }
128
+ #cjtoolbox-blocks-page-form {
129
+ margin-top: 20px;
130
  }
views/blocks/manager/tmpl/blocks.html.tmpl CHANGED
@@ -15,35 +15,54 @@ defined('ABSPATH') or die("Access denied");
15
  <div id="custom-icon" class="icon32 blocks-icon32"></div>
16
 
17
  <h2 class="cjt-main-title logo"><?php echo htmlentities( cssJSToolbox::getText('CSS & JavaScript Toolbox') ) ?><?php echo apply_filters( 'cjt_after_main_title', '' ) ?>
18
- <?php if ( ! class_exists( 'CJTPlusPluginInterface' ) ) : ?>
19
- <span class="cjt-ver">Version: <?php echo get_plugin_data( CJTOOLBOX_PLUGIN_FILE )['Version']; ?></span>
20
- <?php else:
21
- $reflector = new \ReflectionClass( 'CJTPlus' );
22
- $CJTPlusVersion = get_plugin_data( str_replace( 'plus.class', 'plus', $reflector->getFileName() ) )['Version']; ?>
23
- <span class="cjt-ver">Version: <?php echo $CJTPlusVersion; ?></span>
24
- <?php endif; ?>
 
 
 
 
25
  </h2>
26
 
27
- <?php if ( ! class_exists( 'CJTPlusPluginInterface' ) ) : ?>
28
  <div id="cjt-banner-bar-center">
29
- <img src="<?php echo plugin_dir_url( __FILE__ ); ?>../public/images/damo_head.jpg" alt="CJT PLUS">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
 
31
- <div>
32
- <h3>We Need Your Support</h3>
33
- <p>A purchase of CJT PLUS allows us to continue<br/>developing this solution for you and the<br/> WordPress community.</p>
34
- <p><a href="http://<?php echo cssJSToolbox::CJT_WEB_SITE_DOMAIN ?>/pricing" target="_blank">Click to save 50% on CJT PLUS this month</a></p>
35
- <p>Also, why not consider donating to this<br/> great organization called <a href="https://waterforafrica.com.au" target="_blank">Water for Africa</a></p>
36
- </div>
37
- <em>(NOTE: This promotional image and textual content is removed in CJT PLUS)</em>
38
  </div>
39
  <?php endif; ?>
40
 
41
  <div id="cjt-banner-bar-right">
42
  <span class="cjt-banner-link">
43
- <span><?php echo cssJSToolbox::getText('Learn') ?></span>: <a target="_blank" href="http://<?php echo cssJSToolbox::CJT_WEB_SITE_DOMAIN ?>/documentation"><?php echo cssJSToolbox::getText('Online Help') ?></a>
44
  </span>
45
  </div>
46
- <div id="cjtoolbox-blocks-page-form" method="post" <?php echo ! class_exists( 'CJTPlusPluginInterface' ) ? 'style="margin-top:100px;"' : ''; ?>>
47
  <?php wp_nonce_field('cjtoolbox'); ?>
48
  <?php wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false); ?>
49
  <?php wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false); ?>
15
  <div id="custom-icon" class="icon32 blocks-icon32"></div>
16
 
17
  <h2 class="cjt-main-title logo"><?php echo htmlentities( cssJSToolbox::getText('CSS & JavaScript Toolbox') ) ?><?php echo apply_filters( 'cjt_after_main_title', '' ) ?>
18
+ <?php
19
+ $CJTVersion = get_plugin_data( CJTOOLBOX_PLUGIN_FILE )['Version'];
20
+ $versionText = 'CJT Version: ' . $CJTVersion;
21
+
22
+ if ( class_exists( 'CJTPlusPluginInterface' ) ) :
23
+ $reflector = new \ReflectionClass( 'CJTPlus' );
24
+ $CJTPlusVersion = get_plugin_data( str_replace( 'plus.class', 'plus', $reflector->getFileName() ) )['Version'];
25
+ $versionText .= ' / CJT PLUS Version: ' . $CJTPlusVersion;
26
+ endif; ?>
27
+
28
+ <span class="cjt-ver"><?php echo $versionText; ?></span>
29
  </h2>
30
 
31
+ <?php if ( class_exists( 'CJTPlusPluginInterface' ) && version_compare( $CJTPlusVersion, $CJTVersion, '<' ) ) : ?>
32
  <div id="cjt-banner-bar-center">
33
+ <p style="font-size:16px;font-weight:600"><strong>WARNING:</strong> CJT PLUS is out of date!</p>
34
+ <p class="license-key-alt">We have made a number of security and bug fixes, and stability improvements.<br>
35
+ Please <a href="#">add your license</a> and update CJT PLUS or <a href="https://<?php echo cssJSToolbox::CJT_WEB_SITE_DOMAIN ?>/pricing/" target="_blank">Click for CJT PLUS license renewal</a>.</p>
36
+ </div>
37
+ <script>
38
+ jQuery('.license-key-alt a').click(jQuery.proxy(function() {
39
+ var _req = {
40
+ view: 'setup/activation-form',
41
+ component: {
42
+ pluginBase: "css-javascript-toolbox-plus/css-javascript-toolbox-plus.php",
43
+ title: "CJT PLUS"
44
+ },
45
+ TB_iframe: true,
46
+ height: 380
47
+ }
48
+ var _url = CJTServer.getRequestURL('setup', 'activationFormView', _req);
49
 
50
+ tb_show('CJT Extension License Activation Form', _url)
51
+ }, this))
52
+ </script>
53
+ <?php elseif ( ! class_exists( 'CJTPlusPluginInterface' ) ) : ?>
54
+ <div id="cjt-banner-bar-center">
55
+ <p style="font-size:16px;font-weight:600"><strong>CJT PLUS</strong> - 50% off for a limited time!</p>
56
+ <p>1000's of CJT PLUS customers enjoy the features and benefits of the most powerful<br> scripts, styles and code management plugin for WordPress. <a href="https://<?php echo cssJSToolbox::CJT_WEB_SITE_DOMAIN ?>/pricing/" target="_blank">Click for CJT PLUS</a>.</p>
57
  </div>
58
  <?php endif; ?>
59
 
60
  <div id="cjt-banner-bar-right">
61
  <span class="cjt-banner-link">
62
+ <span><?php echo cssJSToolbox::getText('Learn') ?></span>: <a target="_blank" href="https://<?php echo cssJSToolbox::CJT_WEB_SITE_DOMAIN ?>/documentation"><?php echo cssJSToolbox::getText('Online Help') ?></a>
63
  </span>
64
  </div>
65
+ <div id="cjtoolbox-blocks-page-form" method="post">
66
  <?php wp_nonce_field('cjtoolbox'); ?>
67
  <?php wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false); ?>
68
  <?php wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false); ?>
views/dashboard/metabox/statistics/tmpl/default.html.tmpl CHANGED
@@ -1,12 +1,12 @@
1
  <?php
2
-
3
  $latestNew = $this->feed['news'][0];
4
-
5
-
6
  # Format pubDate: Month day Year
7
  $latestNew['pubDate'] = date_create($latestNew['pubDate']);
8
  $latestNew['pubDate'] = $latestNew['pubDate']->format('M j Y');
9
-
10
  # Add th for day
11
  $latestNew['pubDate'] = explode(' ', $latestNew['pubDate']);
12
  $latestNew['pubDate'][1] = "{$latestNew['pubDate'][1]}th";
@@ -59,10 +59,10 @@
59
  <hr />
60
  <div id="cjt-statcs-metabox-info">
61
  <span class="cjt-support-us-link">
62
- <?php echo cssJSToolbox::getText('Upgrade to') ?>: <a target="_blank" href="http://css-javascript-toolbox.com/pricing/"><?php echo cssJSToolbox::getText('CJT Core and CJT PLUS') ?></a>
63
  </span>
64
  <span class="cjt-support-us-link">
65
- <?php echo cssJSToolbox::getText('Learn with') ?>: <a target="_blank" href="http://css-javascript-toolbox.com/documentation/"><?php echo cssJSToolbox::getText('CJT Online Help') ?></a>
66
  </span>
67
  <div class="cjt-stat-metabox-version">
68
  <span><?php echo cssJSToolbox::getText('Version') ?>:&nbsp;&nbsp;<?php echo CJTPlugin::VERSION; ?></span>
1
  <?php
2
+
3
  $latestNew = $this->feed['news'][0];
4
+
5
+
6
  # Format pubDate: Month day Year
7
  $latestNew['pubDate'] = date_create($latestNew['pubDate']);
8
  $latestNew['pubDate'] = $latestNew['pubDate']->format('M j Y');
9
+
10
  # Add th for day
11
  $latestNew['pubDate'] = explode(' ', $latestNew['pubDate']);
12
  $latestNew['pubDate'][1] = "{$latestNew['pubDate'][1]}th";
59
  <hr />
60
  <div id="cjt-statcs-metabox-info">
61
  <span class="cjt-support-us-link">
62
+ <?php echo cssJSToolbox::getText('Upgrade to') ?>: <a target="_blank" href="https://css-javascript-toolbox.com/pricing/"><?php echo cssJSToolbox::getText('CJT Core and CJT PLUS') ?></a>
63
  </span>
64
  <span class="cjt-support-us-link">
65
+ <?php echo cssJSToolbox::getText('Learn with') ?>: <a target="_blank" href="https://css-javascript-toolbox.com/documentation/"><?php echo cssJSToolbox::getText('CJT Online Help') ?></a>
66
  </span>
67
  <div class="cjt-stat-metabox-version">
68
  <span><?php echo cssJSToolbox::getText('Version') ?>:&nbsp;&nbsp;<?php echo CJTPlugin::VERSION; ?></span>
views/installer/install/tmpl/default.html.tmpl CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- *
4
  */
5
 
6
  // Disallow direct access.
@@ -11,7 +11,7 @@ if ($this->upgrade) {
11
  $installButtonTitle = 'Upgrade';
12
  }
13
  else {
14
- $title = 'Installing CJT Plugin';
15
  $installButtonTitle = 'Install';
16
  }
17
  ?>
@@ -20,17 +20,15 @@ else {
20
  <form name="installation-form" action="">
21
  <input type="hidden" id="cjt-securityToken" value="<?php echo $this->securityToken ?>" />
22
  <h1><?php echo cssJSToolbox::getText($title) ?></h1>
 
23
  <p>
24
- <?php echo cssJSToolbox::getText('In order to start using CJT Plugin you need first to install the Plugin.') ?>
25
- <?php echo cssJSToolbox::getText('The installation process will create CJT database tables, build-it Database records.') ?>
26
- <?php echo cssJSToolbox::getText('Check for previous version and if the upgrade process is needed.') ?>
27
- <?php echo cssJSToolbox::getText('The Plugin is in disable state untill the installation process took place!') ?>
28
- <?php echo cssJSToolbox::getText('To utilize from the CJT functionality you must install the Plugin first!!') ?>
29
  </p>
30
  <h3><?php echo cssJSToolbox::getText('Installing Version ') . CJTPlugin::VERSION ?></h3>
31
- <p><?php echo cssJSToolbox::getText('When you install a new version of CJT for the first time or even upgrading from old versions, a number of processes will happen, which will take approximately 1 to 2 minutes. These processes include') ?></p>
 
32
  <ul class="installation-list install">
33
- <?php
34
  // Print installation operations (to be executed in the same order below).
35
  echo $this->getTemplate('default_operations_list', array(
36
  'type' => 'install',
@@ -38,7 +36,7 @@ else {
38
  'database' => array('text' => cssJSToolbox::getText('Create database tables.')),
39
  'fileSystem' => array('text' => cssJSToolbox::getText('Creating file system directories (e.g wp-content/cjt-content/templates).')),
40
  'builtinAuthors' => array('text' => cssJSToolbox::getText('Add CJT built-in authors used by templates system.')),
41
- 'wordpressTemplates' => array('text' => cssJSToolbox::getText('Add Wordpress built-in scripts and styles as CJT Templates so it can be used throught Templates Lookup form.')),
42
  'finalize' => array('text' => cssJSToolbox::getText('Finalize Installation.')),
43
  ))
44
  );
1
  <?php
2
  /**
3
+ *
4
  */
5
 
6
  // Disallow direct access.
11
  $installButtonTitle = 'Upgrade';
12
  }
13
  else {
14
+ $title = 'CSS JavaScript Toolbox - Installation Procedure';
15
  $installButtonTitle = 'Install';
16
  }
17
  ?>
20
  <form name="installation-form" action="">
21
  <input type="hidden" id="cjt-securityToken" value="<?php echo $this->securityToken ?>" />
22
  <h1><?php echo cssJSToolbox::getText($title) ?></h1>
23
+ <p class="cjt-second-title"><?php echo cssJSToolbox::getText('You must run the install procedure before you can start using the plugin') ?></p>
24
  <p>
25
+ <?php echo cssJSToolbox::getText('This will create the database tables and records, check for previous versions as well as a number of other tasks. CSS JavaScript Toolbox will be in a disabled state until this procedure is complete.') ?>
 
 
 
 
26
  </p>
27
  <h3><?php echo cssJSToolbox::getText('Installing Version ') . CJTPlugin::VERSION ?></h3>
28
+ <p><?php echo cssJSToolbox::getText('When you install a new version of CJT, reinstall, or even upgrade from a previous version, a number of processes will take place. Overall, this should take under a minute so please be patient.  Click the ') ?><a href="#install"><?php echo cssJSToolbox::getText('Install') ?></a> <?php echo cssJSToolbox::getText('button to begin. ') ?></p>
29
+
30
  <ul class="installation-list install">
31
+ <?php
32
  // Print installation operations (to be executed in the same order below).
33
  echo $this->getTemplate('default_operations_list', array(
34
  'type' => 'install',
36
  'database' => array('text' => cssJSToolbox::getText('Create database tables.')),
37
  'fileSystem' => array('text' => cssJSToolbox::getText('Creating file system directories (e.g wp-content/cjt-content/templates).')),
38
  'builtinAuthors' => array('text' => cssJSToolbox::getText('Add CJT built-in authors used by templates system.')),
39
+ 'wordpressTemplates' => array('text' => cssJSToolbox::getText('Add Wordpress built-in scripts and styles as CJT Templates so it can be used via Templates Lookup form.')),
40
  'finalize' => array('text' => cssJSToolbox::getText('Finalize Installation.')),
41
  ))
42
  );
views/installer/install/view.php CHANGED
@@ -1,61 +1,61 @@
1
  <?php
2
  /**
3
- *
4
  */
5
 
6
  // Disallow direct access.
7
  defined('ABSPATH') or die("Access denied");
8
 
9
  /**
10
- *
11
  */
12
  class CJTInstallerInstallView extends CJTView {
13
-
14
  /**
15
  * put your comment there...
16
- *
17
  * @var Exception
18
  */
19
  protected $error;
20
-
21
  /**
22
  * put your comment there...
23
- *
24
  * @var mixed
25
  */
26
  protected $installedDbVersion;
27
-
28
  /**
29
  * put your comment there...
30
- *
31
  * @var mixed
32
  */
33
  protected $installedDbVersionId;
34
-
35
  /**
36
  * put your comment there...
37
- *
38
  * @var mixed
39
  */
40
  protected $operations;
41
-
42
  /**
43
  * put your comment there...
44
- *
45
  * @var mixed
46
  */
47
  protected $securityToken;
48
-
49
  /**
50
  * put your comment there...
51
- *
52
  * @var mixed
53
  */
54
  protected $upgrade;
55
-
56
  /**
57
  * put your comment there...
58
- *
59
  * @param mixed $info
60
  * @return CJTInstallerInstallView
61
  */
@@ -65,10 +65,10 @@ class CJTInstallerInstallView extends CJTView {
65
  self::enququeScripts();
66
  self::enququeStyles();
67
  }
68
-
69
  /**
70
  * put your comment there...
71
- *
72
  * @param mixed $tpl
73
  */
74
  public function display($tpl = null) {
@@ -90,7 +90,7 @@ class CJTInstallerInstallView extends CJTView {
90
 
91
  /**
92
  *
93
- *
94
  * @return void
95
  */
96
  public function enququeScripts() {
@@ -102,18 +102,19 @@ class CJTInstallerInstallView extends CJTView {
102
  'framework:js:{CJTFrameworkInstaller-}installer'
103
  );
104
  }
105
-
106
  /**
107
  *
108
- *
109
  * @return void
110
  */
111
  public function enququeStyles() {
112
  // Use related styles.
113
- self::useStyles(__CLASS__,
114
  'thickbox',
115
- 'views:installer:install:public:css:{CJTInstaller-}default'
 
116
  );
117
  }
118
-
119
  } // End class.
1
  <?php
2
  /**
3
+ *
4
  */
5
 
6
  // Disallow direct access.
7
  defined('ABSPATH') or die("Access denied");
8
 
9
  /**
10
+ *
11
  */
12
  class CJTInstallerInstallView extends CJTView {
13
+
14
  /**
15
  * put your comment there...
16
+ *
17
  * @var Exception
18
  */
19
  protected $error;
20
+
21
  /**
22
  * put your comment there...
23
+ *
24
  * @var mixed
25
  */
26
  protected $installedDbVersion;
27
+
28
  /**
29
  * put your comment there...
30
+ *
31
  * @var mixed
32
  */
33
  protected $installedDbVersionId;
34
+
35
  /**
36
  * put your comment there...
37
+ *
38
  * @var mixed
39
  */
40
  protected $operations;
41
+
42
  /**
43
  * put your comment there...
44
+ *
45
  * @var mixed
46
  */
47
  protected $securityToken;
48
+
49
  /**
50
  * put your comment there...
51
+ *
52
  * @var mixed
53
  */
54
  protected $upgrade;
55
+
56
  /**
57
  * put your comment there...
58
+ *
59
  * @param mixed $info
60
  * @return CJTInstallerInstallView
61
  */
65
  self::enququeScripts();
66
  self::enququeStyles();
67
  }
68
+
69
  /**
70
  * put your comment there...
71
+ *
72
  * @param mixed $tpl
73
  */
74
  public function display($tpl = null) {
90
 
91
  /**
92
  *
93
+ *
94
  * @return void
95
  */
96
  public function enququeScripts() {
102
  'framework:js:{CJTFrameworkInstaller-}installer'
103
  );
104
  }
105
+
106
  /**
107
  *
108
+ *
109
  * @return void
110
  */
111
  public function enququeStyles() {
112
  // Use related styles.
113
+ self::useStyles(__CLASS__,
114
  'thickbox',
115
+ 'views:installer:install:public:css:{CJTInstaller-}default',
116
+ 'framework:css:{CJT-}install-notice'
117
  );
118
  }
119
+
120
  } // End class.
views/installer/notice/tmpl/default.html.tmpl CHANGED
@@ -5,16 +5,14 @@
5
 
6
  // Disallow direct access.
7
  defined('ABSPATH') or die("Access denied");
 
8
  ?>
9
  <div class="cjt-installation-notice updated">
10
  <input type="hidden" id="cjt-securityToken" value="<?php echo cssJSToolbox::getSecurityToken() ?>" />
11
- <p>
12
- <?php echo cssJSToolbox::getText('CJT Plugin has been installed throught Wordpress Plugins manager page. In order for CJT Plugin to work correctly you must install it throught') ?>
13
- <a href="<?php echo admin_url('admin.php?page=cjtoolbox') ?>"><?php echo cssJSToolbox::getText('CJT-Instalaltion page.') ?></a>
14
- </p>
15
- <p>
16
- <?php echo cssJSToolbox::getText('Please or you can go to the installation page directly through the') ?>
17
- <a href="<?php echo admin_url('admin.php?page=cjtoolbox') ?>"><?php echo cssJSToolbox::getText('CSS & JavaScript Toolbox page.') ?></a>
18
- </p>
19
- <a class="dismiss" href="#"><?php echo cssJSToolbox::getText('Dismiss') ?></a>
20
  </div>
5
 
6
  // Disallow direct access.
7
  defined('ABSPATH') or die("Access denied");
8
+ $isPlus = class_exists( 'CJTPlusPluginInterface' ) ? ' PLUS' : '';
9
  ?>
10
  <div class="cjt-installation-notice updated">
11
  <input type="hidden" id="cjt-securityToken" value="<?php echo cssJSToolbox::getSecurityToken() ?>" />
12
+ <h1><?php echo cssJSToolbox::getText('Success!!!') ?></h1>
13
+ <p class="cjt-second-title"><?php echo cssJSToolbox::getText('But before you get excited, we have one more procedure.  :)') ?></p>
14
+ <p><?php echo cssJSToolbox::getText('CSS JavaScript Toolbox'. $isPlus .' has been successfully installed and activated via the WordPress Plugins page, but before you can start using the plugin, another installation procedure needs to run.'); ?></p>
15
+ <p><?php echo cssJSToolbox::getText('To begin the procedure, please click:') ?> <a href="<?php echo admin_url('admin.php?page=' . CJTPlugin::PLUGIN_REQUEST_ID) ?>" class="button button-primary"><?php echo cssJSToolbox::getText('CJT'.$isPlus.' - Installation Procedure'); ?></a></p>
16
+
17
+ <a class="button dismiss" href="#"><?php echo cssJSToolbox::getText('Dismiss') ?></a>
 
 
 
18
  </div>
views/installer/notice/view.php CHANGED
@@ -1,19 +1,19 @@
1
  <?php
2
  /**
3
- *
4
  */
5
 
6
  // Disallow direct access.
7
  defined('ABSPATH') or die("Access denied");
8
 
9
  /**
10
- *
11
  */
12
  class CJTInstallerNoticeView extends CJTView {
13
-
14
  /**
15
  * put your comment there...
16
- *
17
  * @param mixed $info
18
  * @return CJTInstallerNoticeView
19
  */
@@ -22,27 +22,35 @@ class CJTInstallerNoticeView extends CJTView {
22
  parent::__construct($info);
23
  // Enqueue scripts.
24
  self::enqueueScripts();
 
25
  }
26
-
27
  /**
28
  * put your comment there...
29
- *
30
  * @param mixed $tpl
31
  */
32
  public function display($tpl = null) {
33
  echo $this->getTemplate($tpl);
34
  }
35
-
36
  /**
37
  * put your comment there...
38
- *
39
  */
40
  public static function enqueueScripts() {
41
  // Use related scripts.
42
- self::useScripts(__CLASS__,
43
  'framework:js:ajax:{CJT-}cjt-server',
44
  'views:installer:notice:public:js:{CJTInstallerNotice-}default;1'
45
  );
46
  }
47
-
 
 
 
 
 
 
 
48
  } // End class.
1
  <?php
2
  /**
3
+ *
4
  */
5
 
6
  // Disallow direct access.
7
  defined('ABSPATH') or die("Access denied");
8
 
9
  /**
10
+ *
11
  */
12
  class CJTInstallerNoticeView extends CJTView {
13
+
14
  /**
15
  * put your comment there...
16
+ *
17
  * @param mixed $info
18
  * @return CJTInstallerNoticeView
19
  */
22
  parent::__construct($info);
23
  // Enqueue scripts.
24
  self::enqueueScripts();
25
+ self::enqueueStyles();
26
  }
27
+
28
  /**
29
  * put your comment there...
30
+ *
31
  * @param mixed $tpl
32
  */
33
  public function display($tpl = null) {
34
  echo $this->getTemplate($tpl);
35
  }
36
+
37
  /**
38
  * put your comment there...
39
+ *
40
  */
41
  public static function enqueueScripts() {
42
  // Use related scripts.
43
+ self::useScripts(__CLASS__,
44
  'framework:js:ajax:{CJT-}cjt-server',
45
  'views:installer:notice:public:js:{CJTInstallerNotice-}default;1'
46
  );
47
  }
48
+
49
+ public static function enqueueStyles() {
50
+ // Use related scripts.
51
+ self::useStyles(__CLASS__,
52
+ 'framework:css:{CJT-}install-notice'
53
+ );
54
+ }
55
+
56
  } // End class.
views/setup/activation-form/public/css/default.css CHANGED
@@ -1,3 +1,4 @@
 
1
  /* CJT Iframe Common form styles overrides*/
2
  .cjt-form ul li input[type="text"]{min-width: 256px}
3
  #cjt-setup-activation-form-view fieldset strong {background-color: white;}
@@ -13,7 +14,7 @@ ul.fields-list {}
13
  #license-state {width: 16px; height: 18px; display: inline-block; position: relative; top: 3px; visibility: hidden;}
14
  #license-state.activate {background : url('../images/activate.png') no-repeat;}
15
  #license-state.deactivate {background : url('../images/deactivate.png') no-repeat;}
16
- #license-state.valid,
17
  #license-state.inactive,
18
  #license-state.site_inactive {background : url('../images/valid.png') no-repeat;}
19
  #license-state.invalid{background : url('../images/invalid.png') no-repeat;}
@@ -21,4 +22,15 @@ ul.fields-list {}
21
  #license-state.error{background : url('../images/error.png') no-repeat;}
22
 
23
  /* Action buttons */
24
- #action-button {visibility: hidden;}
 
 
 
 
 
 
 
 
 
 
 
1
+ body {font-family: 'Raleway', sans-serif;}
2
  /* CJT Iframe Common form styles overrides*/
3
  .cjt-form ul li input[type="text"]{min-width: 256px}
4
  #cjt-setup-activation-form-view fieldset strong {background-color: white;}
14
  #license-state {width: 16px; height: 18px; display: inline-block; position: relative; top: 3px; visibility: hidden;}
15
  #license-state.activate {background : url('../images/activate.png') no-repeat;}
16
  #license-state.deactivate {background : url('../images/deactivate.png') no-repeat;}
17
+ #license-state.valid,
18
  #license-state.inactive,
19
  #license-state.site_inactive {background : url('../images/valid.png') no-repeat;}
20
  #license-state.invalid{background : url('../images/invalid.png') no-repeat;}
22
  #license-state.error{background : url('../images/error.png') no-repeat;}
23
 
24
  /* Action buttons */
25
+ #action-button {visibility: hidden;}
26
+ .cjt-form ul li input[type=button], .cjt-form ul li input[type=submit] {
27
+ padding: 5px 10px;
28
+ }
29
+ .cjt-form ul li input[type="text"] {
30
+ min-width: 256px;
31
+ }
32
+ .cjt-form ul li input[type=text], .cjt-form ul li select {
33
+ min-width: 230px;
34
+ padding: 5px;
35
+ border: 1px solid #ddd;
36
+ }
views/setup/activation-form/public/js/default/default.localization.php CHANGED
@@ -10,9 +10,9 @@
10
  * Localization text for backups script.
11
  */
12
  return array(
13
- 'confirmactivate' => cssJSToolbox::getText("External request need to be made to to css-javascript-toolbox offical web site! The operation will take an effect once its successed! You can always deactivate license key throught this form!\n
14
  Are you sure would you like to process?"),
15
- 'confirmdeactivate' => cssJSToolbox::getText("External request need to be made to to css-javascript-toolbox offical web site! The operation will take an effect once its successed! You can always activate license key throught this form!\n
16
  Are you sure would you like to process?"),
17
  'confirmreset' => cssJSToolbox::getText('The reset operation will clear the license fields and clear component license cache! This is really great once you need to stop using a previously entered key! This operation help your key to stay secure when you really need that! All cached data would be cleared now! You can reactivate your key anytime later!'),
18
  /* Action button names */
@@ -45,11 +45,11 @@ return array(
45
  'deactivateinvalidRequestMessage' => cssJSToolbox::getText('Could not deactivate the provided license key!'),
46
  'deactivateerrorRequestMessage' => cssJSToolbox::getText('Could not deactivate License Key due to the server error!'),
47
 
48
- 'checkvalidRequestMessage' => cssJSToolbox::getText('The ckeck operation detects that the provided key is a valid key!'),
49
  'checkinvalidRequestMessage' => cssJSToolbox::getText('The check operation detects that the provided key is an invalid key!'),
50
  'checkerrorRequestMessage' => cssJSToolbox::getText('Could not check License Key due to the server error!'),
51
- 'checksite_inactiveRequestMessage' => cssJSToolbox::getText('The ckeck operation detects that the provided key is a valid key! The key is not being activated yet.'),
52
- 'checkinactiveRequestMessage' => cssJSToolbox::getText('The ckeck operation detects that the provided key is a valid key! The license key need to be activated from the CJT Website.'),
53
 
54
  'resetButtonCaption' => cssJSToolbox::getText('Reset'),
55
  /* Validation */
10
  * Localization text for backups script.
11
  */
12
  return array(
13
+ 'confirmactivate' => cssJSToolbox::getText("External request need to be made to to css-javascript-toolbox official web site! The operation will take an effect once its successed! You can always deactivate license key through this form!\n
14
  Are you sure would you like to process?"),
15
+ 'confirmdeactivate' => cssJSToolbox::getText("External request need to be made to to css-javascript-toolbox official web site! The operation will take an effect once its successed! You can always activate license key through this form!\n
16
  Are you sure would you like to process?"),
17
  'confirmreset' => cssJSToolbox::getText('The reset operation will clear the license fields and clear component license cache! This is really great once you need to stop using a previously entered key! This operation help your key to stay secure when you really need that! All cached data would be cleared now! You can reactivate your key anytime later!'),
18
  /* Action button names */
45
  'deactivateinvalidRequestMessage' => cssJSToolbox::getText('Could not deactivate the provided license key!'),
46
  'deactivateerrorRequestMessage' => cssJSToolbox::getText('Could not deactivate License Key due to the server error!'),
47
 
48
+ 'checkvalidRequestMessage' => cssJSToolbox::getText('The check operation detects that the provided key is a valid key!'),
49
  'checkinvalidRequestMessage' => cssJSToolbox::getText('The check operation detects that the provided key is an invalid key!'),
50
  'checkerrorRequestMessage' => cssJSToolbox::getText('Could not check License Key due to the server error!'),
51
+ 'checksite_inactiveRequestMessage' => cssJSToolbox::getText('The check operation detects that the provided key is a valid key! The key is not being activated yet.'),
52
+ 'checkinactiveRequestMessage' => cssJSToolbox::getText('The check operation detects that the provided key is a valid key! The license key need to be activated from the CJT Website.'),
53
 
54
  'resetButtonCaption' => cssJSToolbox::getText('Reset'),
55
  /* Validation */