CSS & JavaScript Toolbox - Version 8.1

Version Description

  • Compaibility with Wordpress 4.3.1
  • Core Upgrades/Enhancements
Download this release

Release Info

Developer xpointer
Plugin Icon 128x128 CSS & JavaScript Toolbox
Version 8.1
Comparing to
See all releases

Code changes from version 8.0.4 to 8.1

Files changed (81) hide show
  1. access.points/main.accesspoint.php +0 -32
  2. access.points/main/8.0.4-AdminNotice.html +0 -67
  3. access.points/tinymce.accesspoint.php +0 -52
  4. controllers/block-ajax.php +7 -3
  5. controllers/blocks-ajax.php +32 -14
  6. controllers/blocks-coupling.php +215 -65
  7. controllers/tinymce-blocks.php +0 -144
  8. css-js-toolbox.php +8 -3
  9. framework/PluggableHelper.abstract.php +36 -0
  10. framework/ServicesFW/Ajax.Service.class.php +144 -0
  11. framework/ServicesFW/Controller.class.php +224 -0
  12. framework/ServicesFW/Dashboard.Service.class.php +171 -0
  13. framework/ServicesFW/EntityModel.class.php +65 -0
  14. framework/ServicesFW/Form.class.php +292 -0
  15. framework/ServicesFW/HTTPRequestRouter.class.php +58 -0
  16. framework/ServicesFW/Installer.abstract.php +157 -0
  17. framework/ServicesFW/Model.abstract.php +181 -0
  18. framework/ServicesFW/PluginBase.class.php +166 -0
  19. framework/ServicesFW/PluginBase.interface.php +16 -0
  20. framework/ServicesFW/Shortcode.service.class.php +102 -0
  21. framework/ServicesFW/Storage.abstract.php +69 -0
  22. framework/ServicesFW/View.class.php +290 -0
  23. framework/ServicesFW/ViewJson.class.php +30 -0
  24. framework/ServicesFW/ViewTemplates/MessagesList.html +15 -0
  25. framework/ServicesFW/Wordpress.service.abstract.php +71 -0
  26. framework/db/mysql/sql-view.inc.php +32 -13
  27. framework/mvc/view.inc.php +9 -3
  28. locals/languages/css-javascript-toolbox-en_US.mo +0 -0
  29. locals/languages/css-javascript-toolbox-en_US.po +36 -1170
  30. models/block.php +181 -69
  31. models/blocks.php +84 -15
  32. models/coupling.php +32 -9
  33. models/tinymce-blocks.php +1 -1
  34. readme.txt +26 -51
  35. tables/pins-blocks-view.php +137 -39
  36. vendor/autoload.php +1 -1
  37. vendor/composer/autoload_classmap.php +16 -0
  38. vendor/composer/autoload_real.php +4 -4
  39. views/blocks/block/public/css/block.css +0 -2
  40. views/blocks/block/public/css/codefile.css +1 -1
  41. views/blocks/block/public/images/toolbox/link-external.png +0 -0
  42. views/blocks/block/public/images/toolbox/revisions.png +0 -0
  43. views/blocks/block/public/js/codefile-manager/codefile-manager.js +2 -18
  44. views/blocks/block/public/js/jquery.block/jquery.block.js +21 -37
  45. views/blocks/block/public/js/jquery.block/jquery.block.localization.php +0 -2
  46. views/blocks/block/tmpl/codefile/codefile.html.tmpl +3 -1
  47. views/blocks/block/tmpl/templates/toolbox.html.tmpl +0 -3
  48. views/blocks/cjt-block/public/css/block.css +3 -2
  49. views/blocks/cjt-block/public/js/jquery.assignpanel/jquery.assignpanel.js +58 -152
  50. views/blocks/cjt-block/public/js/jquery.block/jquery.block.js +3 -0
  51. views/blocks/cjt-block/public/js/optional/revision/revision.js +5 -6
  52. views/blocks/cjt-block/tmpl/templates/assign-panel/default.html.tmpl +3 -0
  53. views/blocks/cjt-block/tmpl/templates/assign-panel/templates/custom-posts.html.tmpl +4 -21
  54. views/blocks/cjt-block/tmpl/templates/assign-panel/templates/tab.html.tmpl +3 -4
  55. views/blocks/info/tmpl/default.html.tmpl +1 -5
  56. views/blocks/manager/public/css/blocks.css +2 -11
  57. views/blocks/manager/public/images/toolbox/activate-all.png +0 -0
  58. views/blocks/manager/public/images/toolbox/close-all.png +0 -0
  59. views/blocks/manager/public/images/toolbox/deactivate-all.png +0 -0
  60. views/blocks/manager/public/images/toolbox/delete-all.png +0 -0
  61. views/blocks/manager/public/images/toolbox/delete-empty.png +0 -0
  62. views/blocks/manager/public/images/toolbox/footer-all.png +0 -0
  63. views/blocks/manager/public/images/toolbox/header-all.png +0 -0
  64. views/blocks/manager/public/images/toolbox/open-all.png +0 -0
  65. views/blocks/manager/public/images/toolbox/revert-state.png +0 -0
  66. views/blocks/manager/public/js/blocks-page/blocks-page.js +9 -107
  67. views/blocks/manager/public/js/blocks-page/blocks-page.localization.php +0 -4
  68. views/blocks/manager/tmpl/blocks.html.tmpl +1 -1
  69. views/blocks/manager/tmpl/toolbox.html.tmpl +8 -22
  70. views/blocks/metabox/public/js/metabox/metabox.js +12 -2
  71. views/blocks/metabox/tmpl/metabox.html.tmpl +1 -1
  72. views/tinymce/params/public/css/style.css +0 -22
  73. views/tinymce/params/public/js/form/form.js +0 -86
  74. views/tinymce/params/tmpl/default.html.tmpl +0 -54
  75. views/tinymce/params/view.php +0 -112
  76. views/tinymce/shortcodes/public/plugins/shortcode/css/shortcode.css +0 -8
  77. views/tinymce/shortcodes/public/plugins/shortcode/images/blocks.png +0 -0
  78. views/tinymce/shortcodes/public/plugins/shortcode/langs/en.js +0 -8
  79. views/tinymce/shortcodes/public/plugins/shortcode/shortcode.js +0 -103
  80. views/tinymce/shortcodes/tmpl/default.html.tmpl +0 -25
  81. views/tinymce/shortcodes/view.php +0 -86
access.points/main.accesspoint.php CHANGED
@@ -31,36 +31,6 @@ class CJTMainAccessPoint extends CJTAccessPoint {
31
  self::$instance = $this;
32
  }
33
 
34
- /**
35
- * put your comment there...
36
- *
37
- */
38
- public function _adminNotice() {
39
- # Initialize
40
- static $displayed = 0;
41
-
42
- # Display only for admins
43
- if ( ! current_user_can( 'administrator' ) ) {
44
- return;
45
- }
46
-
47
- # Dismiss if dimisssed
48
- if( isset( $_GET[ 'cjtgp-dismiss-803-notice' ] ) ) {
49
- update_user_meta( get_current_user_id(), 'cjtgp-dismiss-803-notice', true );
50
- }
51
- # Exit if dismissed
52
- if ( get_user_meta( get_current_user_id(), 'cjtgp-dismiss-803-notice' ) ) {
53
- return;
54
- }
55
- # Admin notices might run twice!!
56
- if( ! $displayed ) {
57
- # Don't display again
58
- $displayed = true;
59
- # Display notice
60
- require __DIR__ . DIRECTORY_SEPARATOR . 'main' . DIRECTORY_SEPARATOR . '8.0.4-AdminNotice.html';
61
- }
62
- }
63
-
64
  /**
65
  * put your comment there...
66
  *
@@ -74,8 +44,6 @@ class CJTMainAccessPoint extends CJTAccessPoint {
74
  // If not in uninstall state then plugins_loaded hook
75
  // used to run the plugin!
76
  add_action('plugins_loaded', array(&$this, 'main'));
77
- # Admin NOTICE
78
- add_action( 'admin_notices', array( $this, '_adminNotice' ) );
79
  }
80
 
81
  /**
31
  self::$instance = $this;
32
  }
33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  /**
35
  * put your comment there...
36
  *
44
  // If not in uninstall state then plugins_loaded hook
45
  // used to run the plugin!
46
  add_action('plugins_loaded', array(&$this, 'main'));
 
 
47
  }
48
 
49
  /**
access.points/main/8.0.4-AdminNotice.html DELETED
@@ -1,67 +0,0 @@
1
- <style type="text/css">
2
- .cjt-notice strong {
3
- font-size: 18px;
4
- color: black;
5
- display: inline-block;
6
- padding: 12px 0;
7
- }
8
- .cjt-notice {
9
- background-color: rgba(250, 242, 234, 0.6);
10
- padding-bottom: 14px;
11
- -webkit-box-shadow: 0px 0px 0px 3px #D07B32;
12
- -moz-box-shadow: 0px 0px 0px 3px #D07B32;
13
- box-shadow: 0px 0px 0px 3px #D07B32;
14
- width: 97%;
15
- margin-top: 35px;
16
- padding: 0 10px 10px;
17
- position: relative;
18
- }
19
- .cjt-notice p {
20
- margin: 0 0 0 0 !important;
21
- padding: 0 !important;
22
- }
23
- .cjt-notice #cjtgp-dismiss {
24
- width: 16px;
25
- height: 16px;
26
- display: inline-block;
27
- position: absolute;
28
- right: 40px;
29
- top: 5px;
30
- text-decoration: underline;
31
- color: #8B2F09;
32
- font-size: 12px;
33
- font-weight: bold;
34
- }
35
-
36
- .cjt-notice #cjtgp-dismiss:hover {
37
- color: black;
38
- }
39
-
40
- .cjt-notice a {
41
- color:#D07B32;
42
- }
43
- </style>
44
- <div class='cjt-notice'>
45
- <strong>CSS & JavaScript Toolbox - Important Notice!!!</strong>
46
- <a id="cjtgp-dismiss" href="javascript:void(cjtDismiss803Notice())">Close</a>
47
- <p>
48
- For the next update (not this one), we will be removing features from CSS & JavaScript Toolbox Free including: Custom Posts, Categories, Auxiliary assignments (e.g. entire website,
49
- website backend, etc), Advanced assignments (i.e. URLs and Expressions), Code Files, Code Templates, Template Lookup System, and Script Packages.
50
- Unfortunately we will not be providing any support or solutions to help you get things to work. You will either need to get <a target='_blank' href='http://css-javascript-toolbox.com/css-javascript-toolbox-plus/'>CSS & JavaScript Toolbox PLUS</a> or revert back to the previous
51
- version of CJT Free (v8.0.3 or less).
52
- </p>
53
- <br />
54
- <p>IF you want to retain these features and a lot more, consider purchasing <a target='_blank' href='http://css-javascript-toolbox.com/css-javascript-toolbox-plus/'>CSS & JavaScript Toolbox PLUS</a></p>
55
- </div>
56
- <script type="text/javascript">
57
- function cjtDismiss803Notice() {
58
- // Refresh the page with new parameter added
59
- var url = window.location.href;
60
- // Use ? if no query string in current url or use & instead
61
- url += ( url.indexOf( '?' ) != -1 ) ? '&' : '?';
62
- // Add query string parameter
63
- url += 'cjtgp-dismiss-803-notice=true';
64
- // Refresh
65
- window.location.href = url;
66
- }
67
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
access.points/tinymce.accesspoint.php DELETED
@@ -1,52 +0,0 @@
1
- <?php
2
- /**
3
- *
4
- */
5
-
6
- /**
7
- *
8
- */
9
- class CJTTinymceAccessPoint extends CJTAccessPoint {
10
-
11
- /**
12
- * put your comment there...
13
- *
14
- */
15
- public function __construct() {
16
- // initialize base!
17
- parent::__construct();
18
- // Set name!
19
- $this->name = 'tinymce';
20
- }
21
-
22
- /**
23
- * put your comment there...
24
- *
25
- */
26
- protected function doListen() {
27
- // Only if installed!
28
- if (CJTPlugin::getInstance()->isInstalled()) {
29
- // Don't bother doing this stuff if the current user lacks permissions
30
- if ((current_user_can('edit_posts') || current_user_can('edit_pages')) && (get_user_option('rich_editing') == 'true')) {
31
- add_filter('mce_external_plugins', array($this, 'registerButton'));
32
- }
33
- }
34
- }
35
-
36
- /**
37
- * put your comment there...
38
- *
39
- * @param mixed $plugins
40
- */
41
- public function registerButton($plugins) {
42
- // Load tinymce/shortcodes view through default controller!
43
- $this->controllerName = 'default';
44
- $this->route(null, array('view' => 'tinymce/shortcodes'))
45
- // Display
46
- ->setAction('display')
47
- ->_doAction();
48
- // Don't register anything, we just use this filter as Action.
49
- return $plugins;
50
- }
51
-
52
- } // End class
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
controllers/block-ajax.php CHANGED
@@ -109,9 +109,13 @@ class CJTBlockAjaxController extends CJTAjaxController {
109
  ->load()
110
  ->getData()->code;
111
  // Discard Pins.
112
- $revision->pages = false;
113
- $revision->posts = false;
114
- $revision->categories = false;
 
 
 
 
115
  // Return revision.
116
  $this->response = $revision;
117
  }
109
  ->load()
110
  ->getData()->code;
111
  // Discard Pins.
112
+ $customPins = array_keys( CJTBlockModel::getCustomPins() );
113
+
114
+ foreach ( $customPins as $customPinName )
115
+ {
116
+ $revision->{$customPinName} = false;
117
+ }
118
+
119
  // Return revision.
120
  $this->response = $revision;
121
  }
controllers/blocks-ajax.php CHANGED
@@ -185,40 +185,58 @@ class CJTBlocksAjaxController extends CJTAjaxController {
185
  * put your comment there...
186
  *
187
  */
188
- public function saveBlocksAction() {
 
189
  $response = array();
 
190
  // Blocks are sent ins single array list.
191
- $blocksToSave = filter_input(INPUT_POST, 'blocks', FILTER_UNSAFE_RAW, FILTER_REQUIRE_ARRAY);
192
- $calculatePinPoint = (bool) filter_input(INPUT_POST, 'calculatePinPoint', FILTER_SANITIZE_NUMBER_INT);
193
- $createRevision = (bool) filter_input(INPUT_POST, 'createRevision', FILTER_SANITIZE_NUMBER_INT);
 
194
  // For any reason that cause Client/Javascript to send empty blocks,
195
  // make sure we're save.
196
- if (is_array($blocksToSave) && !empty($blocksToSave)) {
197
- foreach ($blocksToSave as $id => $postedblockPartialData) {
 
 
 
198
  // Push block id into block data.
199
- $blockData = (object) $postedblockPartialData;
200
  $blockData->id = $id;
 
201
  // Recalculate pinPoint field value.
202
- !$calculatePinPoint or (CJTBlockModel::arrangePins($blockData) && CJTBlockModel::calculateBlockPinPoint($blockData));
 
203
  // Create block revision.
204
- !$createRevision or $this->model->addRevision($id, $blockData->activeFileId);
 
205
  // Set lastModified field to current time.
206
- $blockData->lastModified = current_time('mysql');
 
207
  // Update database.
208
- $this->model->update($blockData, $calculatePinPoint);
209
  $this->model->save();
 
210
  // Send the changes properties back to client.
211
- foreach ($postedblockPartialData as $property => $value) {
212
- $response[$id][$property]['value'] = $value;
 
213
  }
 
214
  }
 
215
  }
 
216
  // Delete other blocks.
217
- empty($_POST['deletedBlocks']) or $this->model->delete($_POST['deletedBlocks']);
 
218
  // Save changes.
219
  $this->model->save();
 
220
  // Set response.
221
  $this->response = $response;
 
222
  }
223
 
224
  /**
185
  * put your comment there...
186
  *
187
  */
188
+ public function saveBlocksAction()
189
+ {
190
  $response = array();
191
+
192
  // Blocks are sent ins single array list.
193
+ $blocksToSave = filter_input( INPUT_POST, 'blocks', FILTER_UNSAFE_RAW, FILTER_REQUIRE_ARRAY );
194
+ $calculatePinPoint = ( bool ) filter_input( INPUT_POST, 'calculatePinPoint', FILTER_SANITIZE_NUMBER_INT );
195
+ $createRevision = ( bool ) filter_input( INPUT_POST, 'createRevision', FILTER_SANITIZE_NUMBER_INT );
196
+
197
  // For any reason that cause Client/Javascript to send empty blocks,
198
  // make sure we're save.
199
+ if ( is_array( $blocksToSave ) && ! empty( $blocksToSave ) )
200
+ {
201
+
202
+ foreach ( $blocksToSave as $id => $postedblockPartialData )
203
+ {
204
  // Push block id into block data.
205
+ $blockData = ( object ) $postedblockPartialData;
206
  $blockData->id = $id;
207
+
208
  // Recalculate pinPoint field value.
209
+ ! $calculatePinPoint or ( CJTBlockModel::arrangePins( $blockData ) && CJTBlockModel::calculateBlockPinPoint( $blockData ) );
210
+
211
  // Create block revision.
212
+ ! $createRevision or $this->model->addRevision( $id, $blockData->activeFileId );
213
+
214
  // Set lastModified field to current time.
215
+ $blockData->lastModified = current_time( 'mysql' );
216
+
217
  // Update database.
218
+ $this->model->update( $blockData, $calculatePinPoint );
219
  $this->model->save();
220
+
221
  // Send the changes properties back to client.
222
+ foreach ( $postedblockPartialData as $property => $value )
223
+ {
224
+ $response[ $id ][ $property ][ 'value' ] = $value;
225
  }
226
+
227
  }
228
+
229
  }
230
+
231
  // Delete other blocks.
232
+ empty( $_POST[ 'deletedBlocks' ] ) or $this->model->delete( $_POST[ 'deletedBlocks' ] );
233
+
234
  // Save changes.
235
  $this->model->save();
236
+
237
  // Set response.
238
  $this->response = $response;
239
+
240
  }
241
 
242
  /**
controllers/blocks-coupling.php CHANGED
@@ -106,6 +106,13 @@ class CJTBlocksCouplingController extends CJTController {
106
  */
107
  protected $onblocksorder = array('parameters' => array('order'));
108
 
 
 
 
 
 
 
 
109
  /**
110
  * put your comment there...
111
  *
@@ -264,48 +271,81 @@ class CJTBlocksCouplingController extends CJTController {
264
  * put your comment there...
265
  *
266
  */
267
- public function getBlocks() {
 
268
  // Set request view filters used for querying database.
269
  $this->setRequestFilters();
 
270
  // Get blocks order. NOTE: This is all blocks order not only the queried/target blocks.
271
  $blocksOrder = array();
272
- $metaBoxesOrder = $this->onblocksorder($this->model->getOrder());
 
273
  // Get ORDER-INDEX <TO> BLOCK-ID mapping.
274
- preg_match_all('/cjtoolbox-(\d+)/', $metaBoxesOrder['normal'], $blocksOrder, PREG_SET_ORDER);
 
275
  /**
276
  * append more to orders produced by CJTBlocksCouplingController::setRequestFilter().
277
  * More to orders may allow other blocks to bein the output (e.g metaboxe blocks).
278
  */
279
- $blocksOrder = array_merge($blocksOrder, $this->getFilters()->moreToOrder);
 
280
  // Prepare request URL to match against Links & Expressions.
281
  $linksRequestURL = self::getRequestURL();
282
  $expressionsRequestURL = "{$linksRequestURL}?{$_SERVER['QUERY_STRING']}";
283
- extract($this->onmatchingurls(compact('linksRequestURL', 'expressionsRequestURL')));
 
 
284
  // Get all blocks including (Links & Expressions Blocks).
285
- $blocks = $this->ongetblocks($this->model->getPinsBlocks(CJTBlockModel::PINS_LINK_EXPRESSION,
286
- $this->getFilters()->pinPoint,
287
- $this->getFilters()->customPins));
288
- if (empty($blocks)) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
289
  $this->onnoblocks();
 
290
  return false;
 
291
  }
 
292
  // Import related libraries.
293
- cssJSToolbox::import('framework:php:evaluator:evaluator.inc.php');
 
294
  /**
295
  * Iterator over all blocks by using they order.
296
  * For each block get code and scripts.
297
  */
298
  $this->onprocess();
299
- foreach ($blocksOrder as $blockOrder) {
 
 
300
  $blockId = (int) $blockOrder[1];
 
301
  // As mentioned above. Orders is for all blocks not just those queried from db.
302
- if (isset($blocks[$blockId])) {
303
- $block = $this->onprocessblock($blocks[$blockId]);
 
 
 
304
  /**
305
  * Process Links & Expressions blocks.
306
  * For better performace check only those with links and expressions flags.
307
  */
308
- if ($block->blocksGroup & CJTBlockModel::PINS_LINK_EXPRESSION) {
 
309
  /**
310
  * Initiliaze $matchedLink and $matchedExpression inside IF statment.
311
  * Those variables need to refresh state at each block.
@@ -313,54 +353,84 @@ class CJTBlocksCouplingController extends CJTController {
313
  * Otherwise they'll get the correct value inside each statement.
314
  */
315
  /// Check if there is a matched link.
316
- if ($matchedLink = ($block->blocksGroup & CJTBlockModel::PINS_LINKS)) {
317
- $links = explode("\n", trim($block->links));
318
- $matchedLink = in_array($linksRequestURL, $links);
 
319
  }
 
320
  /// Check if there is a matched expression.
321
- if ($matchedExpression = ($block->blocksGroup & CJTBlockModel::PINS_EXPRESSIONS)) {
 
322
  $expressions = explode("\n", $block->expressions);
323
- foreach ($expressions as $expression) {
 
 
324
  /// @TODO: Matches may be used later to evaulate variables inside code block.
325
- if($matchedExpression = @preg_match("/{$expression}/", $expressionsRequestURL)) {
 
326
  break;
327
  }
 
328
  }
 
329
  }
 
330
  /**
331
  * Exclude Links & Expressions Blocks that doesn't has a match.
332
  * If there is no matched link or expression then exclude block.
333
  */
334
- if ($this->oncancelmatching(!($matchedExpression || $matchedLink))) {
 
335
  continue;
336
  }
 
337
  }
338
  // Allow extensions to control to prevent block from being in the output
339
- if ($block = $this->onblockmatched($block)) {
 
340
  // Retrieve block code-files.
341
- $block->code = $this->model->getBlockCode($block->id);
 
342
  // Import Executable (PHP and HTML) templates.
343
- $block->code = $block->code . $this->model->getExecTemplatesCode($block->id);
 
344
  // For every location store blocks code into single string
345
- $evaluatedCode = CJTPHPCodeEvaluator::getInstance($block)->exec()->getOutput();
 
 
 
 
 
346
  /** @todo Include Debuging info only if we're in debuging mode! */
347
- if (1) {
348
  $evaluatedCode = "\n<!-- Block ({$blockId}) START-->\n{$evaluatedCode}\n<!-- Block ({$blockId}) END -->\n";
349
  }
350
- $this->blocks['code'][$block->location] .= $this->onappendcode($evaluatedCode);
 
 
351
  // Store all used Ids in the CORRECT ORDER.
352
- $this->addOnActionIds($blockId);
353
  }
 
354
  }
 
355
  }
356
- $templates = $this->onActionIds ? $this->model->getLinkedTemplates($this->onActionIds) : array();
 
 
 
 
357
  // Classisfy as we process Scripts and Styles separatly (different hooks!).
358
- foreach ($this->onlinkedtemplates($templates) as $id => $template) {
 
359
  // Filer template!
360
- extract($this->onlinktemplate(compact('template', 'id')));
361
- $this->templates[$template->type][$id] = $template;
 
362
  }
363
- // Return true if there is at least 1 block return within the set.
 
364
  return true;
365
  }
366
 
@@ -533,56 +603,101 @@ class CJTBlocksCouplingController extends CJTController {
533
  * put your comment there...
534
  *
535
  */
536
- protected function setRequestFilters() {
 
537
  // Get request blocks.
538
- $filters = $this->ondefaultfilters((object) array(
 
 
539
  'pinPoint' => 0x00000000,
 
540
  'customPins' => array(),
 
541
  'moreToOrder' => array(),
542
- ));
543
- if (is_admin()) {
 
 
 
 
 
 
 
 
 
544
  // Include all backend blocks.
545
  $filters->pinPoint |= CJTBlockModel::PINS_BACKEND;
546
  }
547
- else {
 
548
  $filters->pinPoint |= CJTBlockModel::PINS_FRONTEND;
 
549
  // Pages.
550
- if (is_page()) {
 
551
  // Blocks with ALL PAGES selected.
552
  $filters->pinPoint |= CJTBlockModel::PINS_PAGES_ALL_PAGES;
 
 
 
 
553
  // Blocks with PAGE-ID selected.
554
- $filters->customPins[] = array(
 
555
  'pin' => 'pages',
556
- 'pins' => array($GLOBALS['post']->ID),
 
 
557
  'flag' => CJTBlockModel::PINS_PAGES_CUSTOM_PAGE,
 
558
  );
 
559
  // Blocks with FRONT-PAGE selected.
560
- if (is_front_page()) {
 
561
  $filters->pinPoint |= CJTBlockModel::PINS_PAGES_FRONT_PAGE;
562
  }
 
563
  /**
564
  * In order for metabox block to get in the output we need
565
  * to add metabox order for it.
566
  * @see CJTBlocksCouplingController::getBlocks.
567
  */
568
- $metabox = CJTModel::create('metabox', array($GLOBALS['post']->ID));
569
- $filters->moreToOrder[][1] = $metabox->getMetaboxId();
 
 
570
  } // End is_page()
571
- else if (is_attachment()) {
 
 
572
  $filters->pinPoint |= CJTBlockModel::PINS_ATTACHMENT;
573
  }
574
  // Posts.
575
- else if (is_single()) {
 
576
  // Blocks with ALL POSTS & ALL CATEGORIES selected.
577
  $filters->pinPoint |= CJTBlockModel::PINS_POSTS_ALL_POSTS | CJTBlockModel::PINS_CATEGORIES_ALL_CATEGORIES;
 
 
 
 
578
  // Blocks with POST-ID selected.
579
- $filters->customPins[] = array(
 
 
 
580
  'pin' => 'posts',
581
- 'pins' => array($GLOBALS['post']->ID),
 
 
582
  'flag' => CJTBlockModel::PINS_POSTS_CUSTOM_POST,
 
583
  );
 
584
  // Include POST PARENT CATRGORIES blocks.
585
- $parentCategoriesIds = wp_get_post_categories($GLOBALS['post']->ID, array('fields' => 'ids'));
 
586
  /**
587
  * Custom-Posts just added "ON THE RUN/FLY"
588
  * Need simple fix by confirming that the post is belong to
@@ -590,61 +705,96 @@ class CJTBlocksCouplingController extends CJTController {
590
  * Custom posts NOW unlike Posts, it doesn't inherit parent
591
  * taxonomis Code Blocks!!
592
  */
593
- if (!empty($parentCategoriesIds)) {
594
- $filters->customPins[] = array(
 
 
 
 
 
 
 
595
  'pin' => 'categories',
 
596
  'pins' => $parentCategoriesIds,
 
597
  'flag' => CJTBlockModel::PINS_CATEGORIES_CUSTOM_CATEGORY,
 
598
  );
 
599
  }
 
600
  /**
601
  * In order for metabox block to get in the output we need
602
  * to add metabox order for it.
603
  * @see CJTBlocksCouplingController::getBlocks.
604
  */
605
- $metabox = CJTModel::create('metabox', array($GLOBALS['post']->ID));
606
- $filters->moreToOrder[][1] = $metabox->getMetaboxId();
 
 
607
  /**
608
  * @TODO check for recent posts Based on user configuration.
609
  * Recent posts should be detcted by comparing
610
  * user condifguration with post date.
611
  */
612
- if (0) {
613
 
614
  }
615
  } // End is_single()
 
616
  // Categories.
617
- else if(is_category()) {
 
618
  // Blocks with ALL CATEGORIES selected.
619
  $filters->pinPoint |= CJTBlockModel::PINS_CATEGORIES_ALL_CATEGORIES;
 
 
 
 
620
  // Blocks with CATEGORY-ID selected.
621
- $filters->customPins[] = array(
 
622
  'pin' => 'categories',
623
- 'pins' => array(get_queried_object()->term_id),
 
 
624
  'flag' => CJTBlockModel::PINS_CATEGORIES_CUSTOM_CATEGORY,
625
- );
 
 
626
  } // End is_category()
 
627
  // Blocks with BLOG-INDEX selected.
628
- else if (is_home()) {
 
629
  $filters->pinPoint |= CJTBlockModel::PINS_POSTS_BLOG_INDEX;
630
  }
631
- else if (is_search()) {
 
632
  $filters->pinPoint |= CJTBlockModel::PINS_SEARCH;
633
  }
634
- else if (is_tag()) {
 
635
  $filters->pinPoint |= CJTBlockModel::PINS_TAG;
636
  }
637
- else if (is_author()) {
 
638
  $filters->pinPoint |= CJTBlockModel::PINS_AUTHOR;
639
  }
640
- else if (is_archive()) {
 
641
  $filters->pinPoint |= CJTBlockModel::PINS_ARCHIVE;
642
  }
643
- else if (is_404()) {
 
644
  $filters->pinPoint |= CJTBlockModel::PINS_404_ERROR;
645
  }
 
646
  }
647
- $this->filters = $this->onsetfilters($filters);
 
 
648
  }
649
 
650
  /**
106
  */
107
  protected $onblocksorder = array('parameters' => array('order'));
108
 
109
+ /**
110
+ * put your comment there...
111
+ *
112
+ * @var mixed
113
+ */
114
+ protected $onevalcodeblock = array( 'parameters' => array( 'keep', 'block' ) );
115
+
116
  /**
117
  * put your comment there...
118
  *
271
  * put your comment there...
272
  *
273
  */
274
+ public function getBlocks()
275
+ {
276
  // Set request view filters used for querying database.
277
  $this->setRequestFilters();
278
+
279
  // Get blocks order. NOTE: This is all blocks order not only the queried/target blocks.
280
  $blocksOrder = array();
281
+ $metaBoxesOrder = $this->onblocksorder( $this->model->getOrder() );
282
+
283
  // Get ORDER-INDEX <TO> BLOCK-ID mapping.
284
+ preg_match_all( '/cjtoolbox-(\d+)/', $metaBoxesOrder[ 'normal' ], $blocksOrder, PREG_SET_ORDER );
285
+
286
  /**
287
  * append more to orders produced by CJTBlocksCouplingController::setRequestFilter().
288
  * More to orders may allow other blocks to bein the output (e.g metaboxe blocks).
289
  */
290
+ $blocksOrder = array_merge( $blocksOrder, $this->getFilters()->moreToOrder );
291
+
292
  // Prepare request URL to match against Links & Expressions.
293
  $linksRequestURL = self::getRequestURL();
294
  $expressionsRequestURL = "{$linksRequestURL}?{$_SERVER['QUERY_STRING']}";
295
+
296
+ extract( $this->onmatchingurls( compact( 'linksRequestURL', 'expressionsRequestURL' ) ) );
297
+
298
  // Get all blocks including (Links & Expressions Blocks).
299
+ $blocks = $this->ongetblocks(
300
+
301
+ $this->model->getPinsBlocks(
302
+
303
+ CJTBlockModel::PINS_LINK_EXPRESSION,
304
+
305
+ $this->getFilters()->pinPoint,
306
+
307
+ $this->getFilters()->customPins,
308
+
309
+ $this->getFilters()
310
+
311
+ )
312
+
313
+ );
314
+
315
+
316
+ if ( empty( $blocks ) )
317
+ {
318
  $this->onnoblocks();
319
+
320
  return false;
321
+
322
  }
323
+
324
  // Import related libraries.
325
+ cssJSToolbox::import( 'framework:php:evaluator:evaluator.inc.php' );
326
+
327
  /**
328
  * Iterator over all blocks by using they order.
329
  * For each block get code and scripts.
330
  */
331
  $this->onprocess();
332
+
333
+ foreach ( $blocksOrder as $blockOrder )
334
+ {
335
  $blockId = (int) $blockOrder[1];
336
+
337
  // As mentioned above. Orders is for all blocks not just those queried from db.
338
+ if ( isset($blocks[ $blockId ] ) )
339
+ {
340
+
341
+ $block = $this->onprocessblock( $blocks[ $blockId ] );
342
+
343
  /**
344
  * Process Links & Expressions blocks.
345
  * For better performace check only those with links and expressions flags.
346
  */
347
+ if ( $block->blocksGroup & CJTBlockModel::PINS_LINK_EXPRESSION )
348
+ {
349
  /**
350
  * Initiliaze $matchedLink and $matchedExpression inside IF statment.
351
  * Those variables need to refresh state at each block.
353
  * Otherwise they'll get the correct value inside each statement.
354
  */
355
  /// Check if there is a matched link.
356
+ if ( $matchedLink = ( $block->blocksGroup & CJTBlockModel::PINS_LINKS ) )
357
+ {
358
+ $links = explode( "\n", trim( $block->links ) );
359
+ $matchedLink = in_array( $linksRequestURL, $links );
360
  }
361
+
362
  /// Check if there is a matched expression.
363
+ if ( $matchedExpression = ( $block->blocksGroup & CJTBlockModel::PINS_EXPRESSIONS ) )
364
+ {
365
  $expressions = explode("\n", $block->expressions);
366
+
367
+ foreach ( $expressions as $expression )
368
+ {
369
  /// @TODO: Matches may be used later to evaulate variables inside code block.
370
+ if( $matchedExpression = @ preg_match( "/{$expression}/", $expressionsRequestURL ) )
371
+ {
372
  break;
373
  }
374
+
375
  }
376
+
377
  }
378
+
379
  /**
380
  * Exclude Links & Expressions Blocks that doesn't has a match.
381
  * If there is no matched link or expression then exclude block.
382
  */
383
+ if ( $this->oncancelmatching( ! ( $matchedExpression || $matchedLink ) ) )
384
+ {
385
  continue;
386
  }
387
+
388
  }
389
  // Allow extensions to control to prevent block from being in the output
390
+ if ( $block = $this->onblockmatched( $block ) )
391
+ {
392
  // Retrieve block code-files.
393
+ $block->code = $this->model->getBlockCode( $block->id );
394
+
395
  // Import Executable (PHP and HTML) templates.
396
+ $block->code = $block->code . $this->model->getExecTemplatesCode( $block->id );
397
+
398
  // For every location store blocks code into single string
399
+
400
+ if ( ! $evaluatedCode = $this->onevalcodeblock( false, $block ) )
401
+ {
402
+ $evaluatedCode = CJTPHPCodeEvaluator::getInstance( $block )->exec()->getOutput();
403
+ }
404
+
405
  /** @todo Include Debuging info only if we're in debuging mode! */
406
+ if ( 1 ) {
407
  $evaluatedCode = "\n<!-- Block ({$blockId}) START-->\n{$evaluatedCode}\n<!-- Block ({$blockId}) END -->\n";
408
  }
409
+
410
+ $this->blocks[ 'code' ][ $block->location ] .= $this->onappendcode( $evaluatedCode );
411
+
412
  // Store all used Ids in the CORRECT ORDER.
413
+ $this->addOnActionIds( $blockId );
414
  }
415
+
416
  }
417
+
418
  }
419
+
420
+ $templates = $this->onActionIds ?
421
+ $this->model->getLinkedTemplates( $this->onActionIds ) :
422
+ array();
423
+
424
  // Classisfy as we process Scripts and Styles separatly (different hooks!).
425
+ foreach ( $this->onlinkedtemplates( $templates ) as $id => $template )
426
+ {
427
  // Filer template!
428
+ extract( $this->onlinktemplate( compact( 'template', 'id' ) ) );
429
+
430
+ $this->templates[ $template->type ][ $id ] = $template;
431
  }
432
+
433
+
434
  return true;
435
  }
436
 
603
  * put your comment there...
604
  *
605
  */
606
+ protected function setRequestFilters()
607
+ {
608
  // Get request blocks.
609
+ $filters = $this->ondefaultfilters( ( object ) array
610
+ (
611
+
612
  'pinPoint' => 0x00000000,
613
+
614
  'customPins' => array(),
615
+
616
  'moreToOrder' => array(),
617
+
618
+ 'currentObject' => null,
619
+
620
+ 'currentCustomPin' => 0,
621
+
622
+ 'params' => array(),
623
+
624
+ ) );
625
+
626
+ if ( is_admin() )
627
+ {
628
  // Include all backend blocks.
629
  $filters->pinPoint |= CJTBlockModel::PINS_BACKEND;
630
  }
631
+ else
632
+ {
633
  $filters->pinPoint |= CJTBlockModel::PINS_FRONTEND;
634
+
635
  // Pages.
636
+ if ( is_page() )
637
+ {
638
  // Blocks with ALL PAGES selected.
639
  $filters->pinPoint |= CJTBlockModel::PINS_PAGES_ALL_PAGES;
640
+
641
+ $filters->currentObject = $GLOBALS[ 'post' ];
642
+ $filters->currentCustomPin = CJTBlockModel::PINS_PAGES_CUSTOM_PAGE;
643
+
644
  // Blocks with PAGE-ID selected.
645
+ $filters->customPins[ ] = array
646
+ (
647
  'pin' => 'pages',
648
+
649
+ 'pins' => array( $filters->currentObject->ID ),
650
+
651
  'flag' => CJTBlockModel::PINS_PAGES_CUSTOM_PAGE,
652
+
653
  );
654
+
655
  // Blocks with FRONT-PAGE selected.
656
+ if ( is_front_page() )
657
+ {
658
  $filters->pinPoint |= CJTBlockModel::PINS_PAGES_FRONT_PAGE;
659
  }
660
+
661
  /**
662
  * In order for metabox block to get in the output we need
663
  * to add metabox order for it.
664
  * @see CJTBlocksCouplingController::getBlocks.
665
  */
666
+ $metabox = CJTModel::create( 'metabox', array( $filters->currentObject->ID ) );
667
+
668
+ $filters->moreToOrder[ ][ 1 ] = $metabox->getMetaboxId();
669
+
670
  } // End is_page()
671
+
672
+ else if ( is_attachment() )
673
+ {
674
  $filters->pinPoint |= CJTBlockModel::PINS_ATTACHMENT;
675
  }
676
  // Posts.
677
+ else if ( is_single() )
678
+ {
679
  // Blocks with ALL POSTS & ALL CATEGORIES selected.
680
  $filters->pinPoint |= CJTBlockModel::PINS_POSTS_ALL_POSTS | CJTBlockModel::PINS_CATEGORIES_ALL_CATEGORIES;
681
+
682
+ $filters->currentObject = $GLOBALS[ 'post' ];
683
+ $filters->currentCustomPin = CJTBlockModel::PINS_POSTS_CUSTOM_POST;
684
+
685
  // Blocks with POST-ID selected.
686
+
687
+ $filters->customPins[ ] = array
688
+ (
689
+
690
  'pin' => 'posts',
691
+
692
+ 'pins' => array( $filters->currentObject->ID ),
693
+
694
  'flag' => CJTBlockModel::PINS_POSTS_CUSTOM_POST,
695
+
696
  );
697
+
698
  // Include POST PARENT CATRGORIES blocks.
699
+ $parentCategoriesIds = wp_get_post_categories( $filters->currentObject->ID, array( 'fields' => 'ids' ) );
700
+
701
  /**
702
  * Custom-Posts just added "ON THE RUN/FLY"
703
  * Need simple fix by confirming that the post is belong to
705
  * Custom posts NOW unlike Posts, it doesn't inherit parent
706
  * taxonomis Code Blocks!!
707
  */
708
+ if ( ! empty( $parentCategoriesIds ) )
709
+ {
710
+
711
+ $filters->params[ 'hasCategories' ] = true;
712
+ $filters->params[ 'parentCategories' ] = $parentCategoriesIds;
713
+
714
+ $filters->customPins[ ] = array
715
+ (
716
+
717
  'pin' => 'categories',
718
+
719
  'pins' => $parentCategoriesIds,
720
+
721
  'flag' => CJTBlockModel::PINS_CATEGORIES_CUSTOM_CATEGORY,
722
+
723
  );
724
+
725
  }
726
+
727
  /**
728
  * In order for metabox block to get in the output we need
729
  * to add metabox order for it.
730
  * @see CJTBlocksCouplingController::getBlocks.
731
  */
732
+ $metabox = CJTModel::create( 'metabox', array( $filters->currentObject->ID ) );
733
+
734
+ $filters->moreToOrder[][ 1 ] = $metabox->getMetaboxId();
735
+
736
  /**
737
  * @TODO check for recent posts Based on user configuration.
738
  * Recent posts should be detcted by comparing
739
  * user condifguration with post date.
740
  */
741
+ if ( 0 ) {
742
 
743
  }
744
  } // End is_single()
745
+
746
  // Categories.
747
+ else if( is_category() )
748
+ {
749
  // Blocks with ALL CATEGORIES selected.
750
  $filters->pinPoint |= CJTBlockModel::PINS_CATEGORIES_ALL_CATEGORIES;
751
+
752
+ $filters->currentObject = get_queried_object();
753
+ $filters->currentCustomPin = CJTBlockModel::PINS_CATEGORIES_CUSTOM_CATEGORY;
754
+
755
  // Blocks with CATEGORY-ID selected.
756
+ $filters->customPins[] = array
757
+ (
758
  'pin' => 'categories',
759
+
760
+ 'pins' => array( $filters->currentObject->term_id ),
761
+
762
  'flag' => CJTBlockModel::PINS_CATEGORIES_CUSTOM_CATEGORY,
763
+
764
+ );
765
+
766
  } // End is_category()
767
+
768
  // Blocks with BLOG-INDEX selected.
769
+ else if ( is_home() )
770
+ {
771
  $filters->pinPoint |= CJTBlockModel::PINS_POSTS_BLOG_INDEX;
772
  }
773
+ else if ( is_search() )
774
+ {
775
  $filters->pinPoint |= CJTBlockModel::PINS_SEARCH;
776
  }
777
+ else if ( is_tag() )
778
+ {
779
  $filters->pinPoint |= CJTBlockModel::PINS_TAG;
780
  }
781
+ else if ( is_author() )
782
+ {
783
  $filters->pinPoint |= CJTBlockModel::PINS_AUTHOR;
784
  }
785
+ else if ( is_archive() )
786
+ {
787
  $filters->pinPoint |= CJTBlockModel::PINS_ARCHIVE;
788
  }
789
+ else if ( is_404() )
790
+ {
791
  $filters->pinPoint |= CJTBlockModel::PINS_404_ERROR;
792
  }
793
+
794
  }
795
+
796
+ $this->filters = $this->onsetfilters( $filters );
797
+
798
  }
799
 
800
  /**
controllers/tinymce-blocks.php DELETED
@@ -1,144 +0,0 @@
1
- <?php
2
- /**
3
- *
4
- */
5
-
6
- // No direct access.
7
- defined('ABSPATH') or die('Access denied');
8
-
9
- // Import dependencies.
10
- cssJSToolbox::import('framework:mvc:controller-ajax.inc.php');
11
-
12
- /**
13
- *
14
- */
15
- class CJTTinymceBlocksController extends CJTAjaxController {
16
-
17
- /**
18
- * put your comment there...
19
- *
20
- * @var mixed
21
- */
22
- protected $controllerInfo = array('model' => 'tinymce-blocks');
23
-
24
- /**
25
- * put your comment there...
26
- *
27
- */
28
- public function __construct($hasView = null, $request = null) {
29
- // Initialize parent!
30
- parent::__construct($hasView, $request);
31
- // Register actions!
32
- $this->registryAction('getBlocksList');
33
- $this->registryAction('getShortcode');
34
- $this->registryAction('getBlockParametersForm');
35
- // @TODO: $this->defaultCapability is risky if there is any admin actions added later, please remove!
36
- $this->defaultCapability = array('edit_posts', 'edit_pages');
37
- }
38
-
39
- /**
40
- * put your comment there...
41
- *
42
- */
43
- protected function getBlockParametersFormAction() {
44
- // Get block id.
45
- $blockId = (int) $_REQUEST['blockId'];
46
- // Get block form!
47
- $form = CJTxTable::getInstance('form')
48
- ->setTableKey(array('blockId'))
49
- ->setData(array('blockId' => $blockId))
50
- ->load();
51
- // Set HTTP header
52
- $this->httpContentType = 'text/html';
53
- // Display form view.
54
- if ($form->get('blockId')) {
55
- // Load parameters form.
56
- $groups = new CJT_Models_Block_Parameters_Form_Groups($blockId);
57
- $params = new CJT_Models_Block_Parameters_Form_Parameters($blockId);
58
- $blockParams = new CJT_Framework_View_Block_Parameter_Parameters($params);
59
- // Return view content!
60
- $paramsView = CJTView::getInstance('tinymce/params', array(
61
- 'groups' => $groups,
62
- 'params' => $blockParams->getParams(),
63
- 'form' => $form->getData(),
64
- 'blockId' => $blockId
65
- )
66
- );
67
- // Return paramters form content!
68
- $this->response = $paramsView->getTemplate('default');
69
- }
70
- else { // Error loading form!
71
- $this->response = cssJSToolbox::getText('The requested Block doesnt has parameters form!');
72
- }
73
- }
74
-
75
- /**
76
- * put your comment there...
77
- *
78
- */
79
- protected function getBlocksListAction() {
80
- // Read all blocks!
81
- $blocks = $this->model->getItems();
82
- // retreive owener name!
83
- foreach ($blocks as $id => $block) {
84
- $user = get_userdata($block->owner);
85
- $block->owner = !$user ? 'N/A' : $user->display_name;
86
- $this->response['list'][$id] = $block;
87
- }
88
- $this->response['count'] = count($this->response['list']);
89
- }
90
-
91
- /**
92
- * put your comment there...
93
- *
94
- */
95
- protected function getShortcodeAction() {
96
- // Get block id.
97
- $blockId = $_REQUEST['blockId'];
98
- // Load block
99
- $block = CJTxTable::getInstance('block')
100
- ->setTableKey(array('id'))
101
- ->setData(array('id' => $blockId))
102
- ->load()
103
- ->getData();
104
- $blockForm = (array) CJTxTable::getInstance('form')
105
- ->setTableKey(array('blockId'))
106
- ->setData(array('blockId' => $blockId))
107
- ->load()
108
- ->getData();
109
- // Load block parameters.
110
- $parameters = new CJT_Models_Block_Parameters_Parameters($blockId);
111
- $blockParams = new CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Parameters($parameters);
112
- // The the block has FORM associated
113
- if (isset($blockForm['blockId'])) {
114
- // If the data is submitted then load the parameters object with the post data!
115
- if ($_SERVER['REQUEST_METHOD'] == 'POST') {
116
- // Get RAW data from the data submitted (avoid magic_quotes, Why called MAGIC!!!!)!
117
- $rawPostData = filter_input(INPUT_POST, 'form-data', FILTER_UNSAFE_RAW, FILTER_REQUIRE_ARRAY);
118
- // Fill the form by the posted data
119
- $blockParams->setValue($rawPostData);
120
- // Validate the submitted data against their parameters.
121
- if ($blockParams->validate()) {
122
- // Generate and Return Shortcode string!
123
- $this->response['state'] = 'shortcode-notation';
124
- $this->response['content'] = $blockParams->shortcode($block->name);
125
- }
126
- else {
127
- $this->response['state'] = 'invalid';
128
- $this->response['content'] = $blockParams->getMessages();
129
- }
130
- }
131
- // Redirect to the parameters form view!
132
- else {
133
- $this->response['state'] = 'show-form';
134
- }
135
- }
136
- else {
137
- // If block doesn't has a parameters defined return
138
- // the Shortcode code string from the parameters loader.
139
- $this->response['state'] = 'shortcode-notation';
140
- $this->response['content'] = $blockParams->shortcode($block->name);
141
- }
142
- }
143
-
144
- } // End class.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css-js-toolbox.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: CSS & JavaScript Toolbox
4
  Plugin URI: http://css-javascript-toolbox.com/
5
  Description: CJT Plugin for WordPress to easily add custom CSS and JavaScript to individual pages
6
- Version: 8.0.4
7
  Author: Wipeout Media
8
  Author URI: http://css-javascript-toolbox.com
9
  License:
@@ -89,7 +89,7 @@ class CJTPlugin extends CJTHookableClass {
89
  /**
90
  *
91
  */
92
- const VERSION = '8.0.3' ;
93
 
94
  /**
95
  *
@@ -303,11 +303,16 @@ class CJTPlugin extends CJTHookableClass {
303
  *
304
  * @return boolean TRUE.
305
  */
306
- public function onconnected($observer, $state) {
 
307
  // In all cases that we'll process the request load the localization file.
308
  load_plugin_textdomain(CJTOOLBOX_TEXT_DOMAIN, false, CJTOOLBOX_LANGUAGES);
 
 
 
309
  // Always connet the access point!
310
  return $state;
 
311
  }
312
 
313
  }// End Class
3
  Plugin Name: CSS & JavaScript Toolbox
4
  Plugin URI: http://css-javascript-toolbox.com/
5
  Description: CJT Plugin for WordPress to easily add custom CSS and JavaScript to individual pages
6
+ Version: 8.1
7
  Author: Wipeout Media
8
  Author URI: http://css-javascript-toolbox.com
9
  License:
89
  /**
90
  *
91
  */
92
+ const VERSION = '8.1' ;
93
 
94
  /**
95
  *
303
  *
304
  * @return boolean TRUE.
305
  */
306
+ public function onconnected($observer, $state)
307
+ {
308
  // In all cases that we'll process the request load the localization file.
309
  load_plugin_textdomain(CJTOOLBOX_TEXT_DOMAIN, false, CJTOOLBOX_LANGUAGES);
310
+
311
+ do_action( CJTPluggableHelper::ACTION_CJT_TEXT_DOMAIN_LOADED );
312
+
313
  // Always connet the access point!
314
  return $state;
315
+
316
  }
317
 
318
  }// End Class
framework/PluggableHelper.abstract.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ /**
7
+ *
8
+ */
9
+ abstract class CJTPluggableHelper
10
+ {
11
+
12
+ const ACTION_CJT_TEXT_DOMAIN_LOADED = 'cjt-text-domain-loaded';
13
+
14
+ const ACTION_BLOCK_QUERY_BLOCKS = 'cjt-block-query-blocks';
15
+
16
+ const FILTER_BLOCK_ASSIGN_PANEL_TABS = 'cjt-block-assign-panel-tabs';
17
+
18
+ const FILTER_BLOCK_MODEL_CUSTOM_PINS = 'cjt-block-model-custom-pins';
19
+ const FILTER_BLOCK_MODEL_PROPERTIES_META = 'cjt-block-model-properties-meta';
20
+ const FILTER_BLOCK_MODEL_PRE_UPDATE_BLOCK = 'cjt-block-model-pre-update-block';
21
+ const FILTER_BLOCK_MODEL_PRE_UPDATE_BLOCK_PINS = 'cjt-block-model-pre-update-block-pins';
22
+
23
+ const FILTER_BLOCKS_COUPLING_MODEL_BLOCKS_QUEUE = 'cjt-blocks-coupling-model-blocks-queue';
24
+
25
+ const ACTION_BLOCK_CUSTOM_POST_TYPES = 'cjt-block-custom-post-types';
26
+
27
+ const ACTION_BLOCKS_MANAGER_TOOLBOX_LEFT_BUTTONS = 'cjt-blocks-manager-toolbox-left-buttons';
28
+ const ACTION_BLOCKS_MANAGER_TOOLBOX_ADMIN_TOOLS_TOP = 'cjt-blocks-manager-toolbox-tools-top';
29
+ const ACTION_BLOCKS_MANAGER_TOOLBOX_RIGHT_BUTTONS = 'cjt-blocks-manager-toolbox-right-buttons';
30
+
31
+ const ACTION_BLOCK_SCREEN_INFO_TOP = 'cjt-block-screen-info-top';
32
+
33
+ const ACTION_BLOCK_ASSIGN_PANEL_TAB_BOTTOM = 'cjt-block-assign-panel-tab-bottom';
34
+
35
+ const ACTION_BLOCK_CODE_FILE_TEMPLATE_CREATE_NEW_FILE = 'cjt-block-code-file-template-create-bew-file';
36
+ }
framework/ServicesFW/Ajax.Service.class.php ADDED
@@ -0,0 +1,144 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ /**
7
+ *
8
+ */
9
+ abstract class CJTServicesAjaxService {
10
+
11
+ /**
12
+ * put your comment there...
13
+ *
14
+ * @var mixed
15
+ */
16
+ private $ajaxEndPoints;
17
+
18
+ /**
19
+ * put your comment there...
20
+ *
21
+ * @var mixed
22
+ */
23
+ private $config;
24
+
25
+ /**
26
+ * put your comment there...
27
+ *
28
+ * @var mixed
29
+ */
30
+ private $controller;
31
+
32
+ /**
33
+ * put your comment there...
34
+ *
35
+ * @var mixed
36
+ */
37
+ private $controllerFactory;
38
+
39
+ /**
40
+ * put your comment there...
41
+ *
42
+ * @var mixed
43
+ */
44
+ private $endPointsConfig;
45
+
46
+ /**
47
+ * put your comment there...
48
+ *
49
+ */
50
+ public function __construct() {}
51
+
52
+ /**
53
+ * put your comment there...
54
+ *
55
+ */
56
+ public function _definePoints() {
57
+ # Allow child classes to deifne points
58
+ $this->defineEndPoints();
59
+ # Hook points
60
+ foreach ( $this->ajaxEndPoints as $point ) {
61
+ # Add Ajax action
62
+ add_action( "wp_ajax_{$point[ 'name' ]}", array( $this, '_pointDelegated' ) );
63
+ }
64
+ }
65
+
66
+ /**
67
+ * put your comment there...
68
+ *
69
+ */
70
+ public function _pointDelegated() {
71
+ # Get ajax action
72
+ $ajaxAction = current_filter();
73
+ # Remove wordpress ajax action prefix added to the hook name
74
+ $name = substr( $ajaxAction, strlen( 'wp_ajax_' ) );
75
+ # Get endpoint config
76
+ $endPointConfig =& $this->endPointsConfig[ $name ];
77
+ # Route
78
+ $router = new CJTServicesHTTPRequestRouter( $this->config[ 'requestParams' ] );
79
+ $router->getRoute( $endPointConfig[ 'route' ] );
80
+ # Get Controller
81
+ $this->controller =& $this->getControllerFactory()->getController( array_merge( $this->config, $endPointConfig ) );
82
+ # Dispatch
83
+ $this->controller->dispatch( $endPointConfig[ 'route' ][ 'action' ] );
84
+ # Output
85
+ echo $this->controller->getResponse();
86
+ # Exit
87
+ die();
88
+ }
89
+
90
+ /**
91
+ * put your comment there...
92
+ *
93
+ * @param mixed $name
94
+ */
95
+ public function addEndPoint($name) {
96
+ # Add point
97
+ $this->ajaxEndPoints[] = array( 'name' => $name );
98
+ # Chain
99
+ return $this;
100
+ }
101
+
102
+ /**
103
+ * put your comment there...
104
+ *
105
+ * @param mixed $controllerFactory
106
+ * @param mixed $config
107
+ * @param mixed $endPointsConfig
108
+ * @return CJTServicesAjaxService
109
+ */
110
+ public function attach(& $controllerFactory, $config, $endPointsConfig) {
111
+ # Attach
112
+ $this->controllerFactory =& $controllerFactory;
113
+ $this->config = $config;
114
+ $this->endPointsConfig = $endPointsConfig;
115
+ # Chain
116
+ return $this;
117
+ }
118
+
119
+ /**
120
+ * put your comment there...
121
+ *
122
+ */
123
+ protected abstract function defineEndPoints();
124
+
125
+ /**
126
+ * put your comment there...
127
+ *
128
+ */
129
+ public function & getControllerFactory() {
130
+ return $this->controllerFactory;
131
+ }
132
+
133
+ /**
134
+ * put your comment there...
135
+ *
136
+ */
137
+ public function & start() {
138
+ # Hook points
139
+ add_action( 'admin_init', array( $this, '_definePoints' ) );
140
+ # Chain
141
+ return $this;
142
+ }
143
+
144
+ }
framework/ServicesFW/Controller.class.php ADDED
@@ -0,0 +1,224 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ /**
7
+ *
8
+ */
9
+ abstract class CJTServicesMVCController {
10
+
11
+ /**
12
+ * put your comment there...
13
+ *
14
+ * @var mixed
15
+ */
16
+ private $config;
17
+
18
+ /**
19
+ * put your comment there...
20
+ *
21
+ * @var mixed
22
+ */
23
+ private $models = array();
24
+
25
+ /**
26
+ * put your comment there...
27
+ *
28
+ * @var mixed
29
+ */
30
+ private $redirect;
31
+
32
+ /**
33
+ * put your comment there...
34
+ *
35
+ * @var mixed
36
+ */
37
+ private $result;
38
+
39
+ /**
40
+ * put your comment there...
41
+ *
42
+ * @var mixed
43
+ */
44
+ private $route;
45
+
46
+ /**
47
+ * put your comment there...
48
+ *
49
+ * @var mixed
50
+ */
51
+ private $view;
52
+
53
+ /**
54
+ * put your comment there...
55
+ *
56
+ * @param mixed $config
57
+ * @param mixed $route
58
+ * @return CJTServicesMVCController
59
+ */
60
+ public function __construct($config, $route) {
61
+ # Initialize
62
+ $this->config = $config;
63
+ $this->route = $route;
64
+ # Create View
65
+ $viewClass = isset( $this->route[ 'viewClass' ] ) ? $this->route[ 'viewClass' ] : $this->config[ 'defaultViewClass' ];
66
+ $this->view = new $viewClass( $this );
67
+ }
68
+
69
+ /**
70
+ * put your comment there...
71
+ *
72
+ * @param mixed $action
73
+ */
74
+ public function & dispatch($action) {
75
+ # Get action method
76
+ $methodName = lcfirst( $action ) . "Action";
77
+ if ( method_exists( $this, $methodName ) ) {
78
+ # Call method, hold result
79
+ $this->result = $this->$methodName();
80
+ # Redirect if redirected
81
+ if ( $this->redirect ) {
82
+ # Redirect
83
+ wp_redirect( $this->redirect[ 'location' ] );
84
+ # Save Models state
85
+ $this->saveState();
86
+ # Terminate
87
+ die();
88
+ }
89
+ # Result expected to be Array-Like iterator from which
90
+ # we will copy all members to the view class
91
+ $result = $this->result ? $this->result : array();
92
+ foreach ( $result as $name => $value ) {
93
+ $this->view->$name = $value;
94
+ }
95
+ # Signal/Notify view so it can start work on the action result
96
+ $this->view->dispatch();
97
+ }
98
+ else {
99
+ throw new Exception( 'Bad Request!!' );
100
+ }
101
+ return $this;
102
+ }
103
+
104
+ /**
105
+ * put your comment there...
106
+ *
107
+ */
108
+ public function getConfig() {
109
+ return $this->config;
110
+ }
111
+
112
+ /**
113
+ * put your comment there...
114
+ *
115
+ * @param mixed $name
116
+ */
117
+ public function & getForm($name) {}
118
+
119
+ /**
120
+ * put your comment there...
121
+ *
122
+ * @param mixed $config
123
+ * @param mixed $route
124
+ */
125
+ public static function & getInstance($config, $route) {
126
+ # Get controller name or use default controller if controller is not supplied
127
+ $controllerName = isset( $route[ 'controller' ] ) ? $route[ 'controller' ] : $config[ 'defaultController' ];
128
+ $controllerName = ucwords( $controllerName );
129
+ $controllerClass = "{$config[ 'namespace' ]}{$controllerName}Controller";
130
+ # Create controller
131
+ $controller = new $controllerClass( $config, $route );
132
+ # Return controller
133
+ return $controller;
134
+ }
135
+
136
+ /**
137
+ * put your comment there...
138
+ *
139
+ * @param mixed $name
140
+ */
141
+ public function & getModel($name = null) {
142
+ # Use controller name if name is nit supplied
143
+ if ( ! $name ) {
144
+ preg_match( '/' . preg_quote( $this->config[ 'namespace' ] ) . '(.+)Controller/',
145
+ get_class( $this ),
146
+ $controllerClassInfo );
147
+ $name = $controllerClassInfo[ 1 ];
148
+ }
149
+ # Create model if not yet created
150
+ if ( ! isset( $this->models[ $name ] ) ) {
151
+ # Get model class
152
+ $modelClass = "{$this->config[ 'namespace' ]}{$name}Model";
153
+ # Instantiate model
154
+ $this->models[ $name ] = new $modelClass();
155
+ }
156
+ return $this->models[ $name ];
157
+ }
158
+
159
+ /**
160
+ * put your comment there...
161
+ *
162
+ */
163
+ public function & getResponse() {
164
+ return $this->view;
165
+ }
166
+
167
+ /**
168
+ * put your comment there...
169
+ *
170
+ */
171
+ public function & getResult() {
172
+ return $this->result;
173
+ }
174
+
175
+ /**
176
+ * put your comment there...
177
+ *
178
+ */
179
+ public function getRoute() {
180
+ return $this->route;
181
+ }
182
+
183
+ /**
184
+ * put your comment there...
185
+ *
186
+ * @param mixed $name
187
+ */
188
+ public function getServiceParameter($name) {
189
+
190
+ return isset( $this->config[ 'parameters' ][ $name ] ) ? $this->config[ 'parameters' ][ $name ] : null;
191
+ }
192
+
193
+ /**
194
+ * put your comment there...
195
+ *
196
+ * @param mixed $name
197
+ */
198
+ public function & getTable($name) {}
199
+
200
+ /**
201
+ * put your comment there...
202
+ *
203
+ * @param mixed $location
204
+ */
205
+ protected function redirect($location) {
206
+ # Save redirect
207
+ $this->redirect = compact( 'location' );
208
+ # Chain
209
+ return $this;
210
+ }
211
+
212
+ /**
213
+ * put your comment there...
214
+ *
215
+ */
216
+ public function & saveState() {
217
+ # Saving model states
218
+ foreach ( $this->models as $model ) {
219
+ $model->saveState();
220
+ }
221
+ # chain
222
+ return $this;
223
+ }
224
+ }
framework/ServicesFW/Dashboard.Service.class.php ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ /**
7
+ *
8
+ */
9
+ abstract class CJTServicesDashboardPageService {
10
+
11
+ /**
12
+ * put your comment there...
13
+ *
14
+ * @var mixed
15
+ */
16
+ private $config;
17
+
18
+ /**
19
+ * put your comment there...
20
+ *
21
+ * @var mixed
22
+ */
23
+ private $controller;
24
+
25
+ /**
26
+ * put your comment there...
27
+ *
28
+ * @var mixed
29
+ */
30
+ private $controllerFactory;
31
+
32
+ /**
33
+ * put your comment there...
34
+ *
35
+ * @var mixed
36
+ */
37
+ private $dashboardsConfig;
38
+
39
+ /**
40
+ * put your comment there...
41
+ *
42
+ * @var mixed
43
+ */
44
+ protected $menuFilterName = 'admin_menu';
45
+
46
+ /**
47
+ * put your comment there...
48
+ *
49
+ * @var mixed
50
+ */
51
+ protected $menus;
52
+
53
+ /**
54
+ * put your comment there...
55
+ *
56
+ */
57
+ public function __construct() {}
58
+
59
+ /**
60
+ * put your comment there...
61
+ *
62
+ */
63
+ public function _adminMenuHook() {
64
+ # Define menus
65
+ $callback = array( $this, '_display' );
66
+ $this->defineMenus( $callback );
67
+ # Bind to menus load event and map it to for load callback
68
+ foreach ( $this->menus as $hookSlug => $menu ) {
69
+ # Bind load event
70
+ add_action( "load-{$hookSlug}", array( & $this, '_pageLoad' ) );
71
+ }
72
+ }
73
+
74
+ /**
75
+ * put your comment there...
76
+ *
77
+ */
78
+ public function _display() {
79
+
80
+ # Save state
81
+ $this->controller->saveState();
82
+
83
+ # Output
84
+ echo $this->controller->getResponse();
85
+
86
+ }
87
+
88
+ /**
89
+ * put your comment there...
90
+ *
91
+ */
92
+ public function _pageLoad() {
93
+ # Get current hook slug
94
+ $hookSlug = substr( current_filter(), strlen( 'load-' ) ) ;
95
+ # Get menu associated to current request hook slug
96
+ $menu =& $this->menus[ $hookSlug ];
97
+ $menuConfig =& $menu[ 'config' ];
98
+ # Get request route
99
+ $router = new CJTServicesHTTPRequestRouter( $this->config[ 'requestParams' ] );
100
+ $router->getRoute( $menuConfig[ 'route' ] );
101
+ # Get controller
102
+ $this->controller =& $this->getControllerFactory()->getController( array_merge( $this->config, $menuConfig ) );
103
+ # Dispatch call
104
+ $this->controller->dispatch( $menuConfig[ 'route' ][ 'action' ] );
105
+ }
106
+
107
+ /**
108
+ * put your comment there...
109
+ *
110
+ * @param mixed $slug
111
+ * @param mixed $hookSlug
112
+ * @return CJTServicesDashboardPageService
113
+ */
114
+ protected function addMenu($slug, $hookSlug) {
115
+ # Add menu and hold its configuration reference
116
+ $this->menus[ $hookSlug ] = array( 'slug' => $slug, 'config' => & $this->dashboardsConfig[ $slug ] );
117
+ # Chain
118
+ return $this;
119
+ }
120
+
121
+ /**
122
+ * put your comment there...
123
+ *
124
+ * @param mixed $dispatchController
125
+ * @param mixed $config
126
+ * @param mixed $dashboardConfigs
127
+ * @return CJTServicesDashboardPageService
128
+ */
129
+ public function & attach(& $controllerFactory, $config, $dashboardConfigs) {
130
+ # Set
131
+ $this->controllerFactory =& $controllerFactory;
132
+ $this->config =& $config;
133
+ $this->dashboardsConfig =& $dashboardConfigs;
134
+ # Chain
135
+ return $this;
136
+ }
137
+
138
+ /**
139
+ * put your comment there...
140
+ *
141
+ */
142
+ protected abstract function defineMenus(& $callback);
143
+
144
+ /**
145
+ * put your comment there...
146
+ *
147
+ */
148
+ public function getDashboardsConfig() {
149
+ return $this->dashboardsConfig;
150
+ }
151
+
152
+ /**
153
+ * put your comment there...
154
+ *
155
+ */
156
+ public function & getControllerFactory() {
157
+ return $this->controllerFactory;
158
+ }
159
+
160
+ /**
161
+ * put your comment there...
162
+ *
163
+ */
164
+ public function & start() {
165
+ # Define menus when admin menu hooks is fired
166
+ add_action( $this->menuFilterName, array( $this, '_adminMenuHook' ) );
167
+ # Chain
168
+ return $this;
169
+ }
170
+
171
+ }
framework/ServicesFW/EntityModel.class.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ /**
7
+ *
8
+ */
9
+ abstract class CJTServicesEntityModel {
10
+
11
+ /**
12
+ * put your comment there...
13
+ *
14
+ * @param mixed $data
15
+ * @return CJTServicesItemModel
16
+ */
17
+ public function __construct($data = null) {
18
+ # Make sure data is array
19
+ if( ! $data ) {
20
+ $data = array();
21
+ }
22
+ # Fill with data
23
+ $this->exchangeArray( $data );
24
+ }
25
+
26
+ /**
27
+ * put your comment there...
28
+ *
29
+ * @param mixed $data
30
+ */
31
+ public function exchangeArray($data) {
32
+ # Fetch properties for all model members
33
+ foreach ( get_object_vars( $this ) as $name => $value ) {
34
+ $this->$name = isset( $data[ $name ] ) ? $data[ $name ] : null;
35
+ }
36
+ # Chain
37
+ return $this;
38
+ }
39
+
40
+ /**
41
+ * put your comment there...
42
+ *
43
+ */
44
+ public function getArray() {
45
+ # Gett all vars
46
+ $vars = get_object_vars( $this );
47
+ # Exclude NULL values
48
+ foreach ( $vars as $name => $value ) {
49
+ if ( $value === null ) {
50
+ unset( $vars[ $name ] );
51
+ }
52
+ }
53
+ return $vars;
54
+ }
55
+
56
+ /**
57
+ * put your comment there...
58
+ *
59
+ * @param CJTServicesEntityModel $model
60
+ * @return CJTServicesEntityModel
61
+ */
62
+ public function isEqual(CJTServicesEntityModel & $model) {
63
+ return md5( print_r( get_object_vars( $this ), true ) ) == md5( print_r( get_object_vars( $model ), true ) );
64
+ }
65
+ }
framework/ServicesFW/Form.class.php ADDED
@@ -0,0 +1,292 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+
7
+ /**
8
+ *
9
+ */
10
+ class CJTServicesForm
11
+ {
12
+
13
+ /**
14
+ * put your comment there...
15
+ *
16
+ * @var mixed
17
+ */
18
+ protected $data = array();
19
+
20
+ /**
21
+ * put your comment there...
22
+ *
23
+ * @var mixed
24
+ */
25
+ protected $definition = array();
26
+
27
+ /**
28
+ * put your comment there...
29
+ *
30
+ * @var mixed
31
+ */
32
+ protected $name;
33
+
34
+ /**
35
+ * put your comment there...
36
+ *
37
+ * @param mixed $name
38
+ * @param mixed $data
39
+ * @return CJTServicesForm
40
+ */
41
+ public function __construct( $name, $data = null )
42
+ {
43
+
44
+ $this->name = $name;
45
+
46
+ if ( is_array( $data ) )
47
+ {
48
+ $this->setArray( $data );
49
+ }
50
+
51
+ }
52
+
53
+ /**
54
+ * put your comment there...
55
+ *
56
+ * @param mixed $value
57
+ */
58
+ private function _type_array( $value )
59
+ {
60
+ if ( ! is_array( $value ) )
61
+ {
62
+ $value = array();
63
+ }
64
+
65
+ return $value;
66
+ }
67
+
68
+ /**
69
+ * put your comment there...
70
+ *
71
+ * @param mixed $value
72
+ */
73
+ private function _type_boolean( $value )
74
+ {
75
+ return ( bool ) $value;
76
+ }
77
+
78
+ /**
79
+ * put your comment there...
80
+ *
81
+ * @param mixed $value
82
+ */
83
+ private function _type_float( $value )
84
+ {
85
+ return ( float ) $value;
86
+ }
87
+
88
+ /**
89
+ * put your comment there...
90
+ *
91
+ * @param mixed $value
92
+ */
93
+ private function _type_integer( $value )
94
+ {
95
+ return intval( $value );
96
+ }
97
+
98
+ /**
99
+ * put your comment there...
100
+ *
101
+ * @param mixed $value
102
+ */
103
+ private function _type_string( $value )
104
+ {
105
+ return strval( $value );
106
+ }
107
+
108
+ /**
109
+ * put your comment there...
110
+ *
111
+ */
112
+ protected function apply()
113
+ {
114
+
115
+ $definitionsGroups = array_chunk( $this->definition, 2 );
116
+
117
+ foreach ( $definitionsGroups as $groupDef )
118
+ {
119
+
120
+ $groupDefName = $groupDef[ 0 ];
121
+
122
+ foreach ( $groupDef[ 1 ] as $name => $definition )
123
+ {
124
+
125
+ # Set containers/groups if not set
126
+ $groupNames = explode( '.', $groupDefName );
127
+
128
+
129
+ $dataCopy = $this->data;
130
+ $pointer =& $dataCopy;
131
+
132
+ foreach ( $groupNames as $groupName )
133
+ {
134
+ # For now lets use array for any doesnt exists container
135
+ if ( ! isset( $pointer[ $groupName ] ) )
136
+ {
137
+ $pointer[ $groupName ] = array();
138
+ }
139
+
140
+ $pointer =& $pointer[ $groupName ];
141
+
142
+ }
143
+
144
+ # Set cast value
145
+ $typeHandler = "_type_{$definition[ 'type' ]}";
146
+ $value = $this->getValue( "{$groupDefName}.{$name}" );
147
+
148
+ $pointer[ $name ] = $this->$typeHandler( $value );
149
+
150
+ $this->data = $dataCopy;
151
+ }
152
+
153
+ }
154
+ return $this;
155
+ }
156
+
157
+ /**
158
+ * put your comment there...
159
+ *
160
+ * @param mixed $definition
161
+ */
162
+ public function & define( $definitions )
163
+ {
164
+
165
+ $this->definition = func_get_args();
166
+
167
+ return $this;
168
+ }
169
+
170
+ /**
171
+ * put your comment there...
172
+ *
173
+ */
174
+ public function getArray()
175
+ {
176
+ return $this->data;
177
+ }
178
+
179
+ /**
180
+ * put your comment there...
181
+ *
182
+ * @param mixed $name
183
+ */
184
+ protected function & getElement( $path )
185
+ {
186
+ $pointer =& $this->data;
187
+
188
+ $names = explode( '.', $path );
189
+
190
+ foreach ( $names as $name )
191
+ {
192
+
193
+ if ( ! isset( $pointer[ $name ] ) )
194
+ {
195
+ $pointer = null;
196
+
197
+ return $pointer;
198
+ }
199
+
200
+ $pointer =& $pointer[ $name ];
201
+ }
202
+
203
+ return $pointer;
204
+ }
205
+
206
+ /**
207
+ * put your comment there...
208
+ *
209
+ * @param mixed $path
210
+ */
211
+ public function getElementId( $path )
212
+ {
213
+
214
+ $elementId = "{$this->name}-" . str_replace( '.', '-', $path );
215
+
216
+ return $elementId;
217
+ }
218
+
219
+ /**
220
+ * put your comment there...
221
+ *
222
+ * @param mixed $path
223
+ */
224
+ public function getElementName( $path )
225
+ {
226
+
227
+ $elementName = "{$this->name}[" . str_replace( '.', '][', $path ) . ']';
228
+
229
+ return $elementName;
230
+ }
231
+
232
+ /**
233
+ * put your comment there...
234
+ *
235
+ */
236
+ public function getName()
237
+ {
238
+ return $this->name;
239
+ }
240
+
241
+ /**
242
+ * put your comment there...
243
+ *
244
+ * @param mixed $path
245
+ */
246
+ public function getValue( $path )
247
+ {
248
+ return $this->getElement( $path );
249
+ }
250
+
251
+ /**
252
+ * put your comment there...
253
+ *
254
+ * @param mixed $data
255
+ */
256
+ public function & setArray( $data )
257
+ {
258
+
259
+ $this->data = $data;
260
+
261
+ # Apply definition ( e.g cast values if needed )
262
+ $this->apply();
263
+
264
+ return $this;
265
+ }
266
+
267
+ /**
268
+ * put your comment there...
269
+ *
270
+ * @param mixed $path
271
+ * @param mixed $data
272
+ */
273
+ public function & setValue( $path, $value )
274
+ {
275
+
276
+ $element =& $this->getElement( $path );
277
+
278
+ $element = $value;
279
+
280
+ return $this;
281
+ }
282
+
283
+ /**
284
+ * put your comment there...
285
+ *
286
+ */
287
+ public function & validate()
288
+ {
289
+ return true;
290
+ }
291
+
292
+ }
framework/ServicesFW/HTTPRequestRouter.class.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ /**
7
+ *
8
+ */
9
+ class CJTServicesHTTPRequestRouter {
10
+
11
+ /**
12
+ * put your comment there...
13
+ *
14
+ * @var mixed
15
+ */
16
+ private $map;
17
+
18
+ /**
19
+ * put your comment there...
20
+ *
21
+ * @var mixed
22
+ */
23
+ private $methodData;
24
+
25
+ /**
26
+ * put your comment there...
27
+ *
28
+ * @param mixed $defaults
29
+ * @param mixed $method
30
+ * @return CJTServicesRequestRouter
31
+ */
32
+ public function __construct($map, $method = 'request') {
33
+ # Initiaize
34
+ $this->map = $map;
35
+ $this->methodData =& $GLOBALS[ '_' . strtoupper( $method ) ];
36
+ }
37
+
38
+ /**
39
+ * put your comment there...
40
+ *
41
+ * @param mixed $route
42
+ * @return CJTServicesRequestRouter
43
+ */
44
+ public function getRoute(& $route) {
45
+ # Initialize
46
+ $newRoute = array();
47
+ # Overwrite defauls values if submitted
48
+ foreach ( $this->map as $name => $paramName ) {
49
+ $newRoute[ $name ] = isset( $this->methodData[ $paramName ] ) ?
50
+ $this->methodData[ $paramName ] :
51
+ ( isset( $route[ $name ] ) ? $route[ $name ] : null );
52
+ }
53
+ # Set new route
54
+ $route = array_merge( $route, $newRoute );
55
+ # Chain
56
+ return $this;
57
+ }
58
+ }
framework/ServicesFW/Installer.abstract.php ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ /**
7
+ *
8
+ */
9
+ abstract class CJTServicesInstaller extends CJTServicesModel {
10
+
11
+ // INSTALLER STATES
12
+ const STATE_DOWNGRADE = -1;
13
+ const STATE_FRESH_INSTALL = 2;
14
+ const STATE_INSTALLED = 0;
15
+ const STATE_UPGRADE = 1;
16
+
17
+ /**
18
+ * put your comment there...
19
+ *
20
+ * @var mixed
21
+ */
22
+ protected $_currentVersion;
23
+
24
+ /**
25
+ * put your comment there...
26
+ *
27
+ * @var mixed
28
+ */
29
+ protected $_upgraders = array();
30
+
31
+ /**
32
+ * put your comment there...
33
+ *
34
+ * @var mixed
35
+ */
36
+ protected $installedVersion = null;
37
+
38
+ /**
39
+ * put your comment there...
40
+ *
41
+ */
42
+ public function __construct( )
43
+ {
44
+
45
+ parent::__construct();
46
+
47
+ // Current version is the latest version on the upgraders array
48
+ $this->_currentVersion = end( $this->_upgraders );
49
+
50
+ }
51
+
52
+ /**
53
+ * put your comment there...
54
+ *
55
+ */
56
+ public function getInstalledVersion()
57
+ {
58
+ return $this->installedVersion;
59
+ }
60
+
61
+ /**
62
+ * put your comment there...
63
+ *
64
+ */
65
+ public function getState()
66
+ {
67
+
68
+ $installedVersion = $this->getInstalledVersion();
69
+
70
+ return ! $installedVersion ?
71
+ self::STATE_FRESH_INSTALL : // Never installed
72
+ version_compare( $this->_currentVersion, $installedVersion ); // Upgrade, Installed, Downgrade
73
+ }
74
+
75
+ /**
76
+ * put your comment there...
77
+ *
78
+ * @param mixed $version
79
+ */
80
+ public function getUpgraderIndex( $version )
81
+ {
82
+ return array_search( $version, $this->_upgraders );
83
+ }
84
+
85
+ /**
86
+ * put your comment there...
87
+ *
88
+ * @param mixed $version
89
+ */
90
+ public function getUpgraderName( $version )
91
+ {
92
+ return str_replace( array( '.', '-' ), '', $version );
93
+ }
94
+
95
+ /**
96
+ * put your comment there...
97
+ *
98
+ */
99
+ public function install()
100
+ {
101
+ return $this->processUpgraders( 0 );
102
+ }
103
+
104
+ /**
105
+ * put your comment there...
106
+ *
107
+ * @param mixed $version
108
+ */
109
+ public function processUpgraders( $upgraderIndex )
110
+ {
111
+
112
+ # Call all exists upgraders start from $version upgrader
113
+ # to the end of tehe upgraders array
114
+ for ( ; $upgraderIndex < count( $this->_upgraders ); $upgraderIndex ++ )
115
+ {
116
+
117
+ $upgraderName = $this->getUpgraderName( $this->_upgraders[ $upgraderIndex ] );
118
+
119
+ $upgraderMethodName = "_upgrade{$upgraderName}";
120
+
121
+ if ( method_exists( $this, $upgraderMethodName ) )
122
+ {
123
+ if ( ! $this->$upgraderMethodName() )
124
+ {
125
+ return false;
126
+ }
127
+
128
+ }
129
+
130
+ }
131
+
132
+ $this->installedVersion = $this->_currentVersion;
133
+
134
+ $this->saveState();
135
+
136
+ return true;
137
+ }
138
+
139
+ /**
140
+ * put your comment there...
141
+ *
142
+ */
143
+ public function upgrade()
144
+ {
145
+
146
+ $upgraderIndex = $this->getUpgraderIndex( $this->_currentVersion );
147
+
148
+ if ( $upgraderIndex === FALSE )
149
+ {
150
+ throw new Exception( "Upgrader does not exists!!!" );
151
+ }
152
+
153
+ return $this->processUpgraders( $upgraderIndex );
154
+
155
+ }
156
+
157
+ }
framework/ServicesFW/Model.abstract.php ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ /**
7
+ *
8
+ */
9
+ abstract class CJTServicesModel {
10
+
11
+ /**
12
+ *
13
+ */
14
+ const MESSAGE_ERROR = 'error';
15
+
16
+ /**
17
+ *
18
+ */
19
+ const MESSAGE_NOTICE = 'notice';
20
+
21
+ /**
22
+ *
23
+ */
24
+ const MESSAGE_WARNING = 'warning';
25
+
26
+ /**
27
+ * put your comment there...
28
+ *
29
+ * @var mixed
30
+ */
31
+ private $_storage;
32
+
33
+ /**
34
+ * put your comment there...
35
+ *
36
+ * @var mixed
37
+ */
38
+ private $messsages = array();
39
+
40
+ /**
41
+ * put your comment there...
42
+ *
43
+ */
44
+ public function __construct() {
45
+ # Create Model Storage
46
+ $this->_storage = new CJTServicesStorage( get_class( $this ), array() );
47
+ # Load state
48
+ $this->readState();
49
+ }
50
+
51
+ /**
52
+ * put your comment there...
53
+ *
54
+ */
55
+ public function clearMessages() {
56
+ # Clear
57
+ $this->messsages = array();
58
+ # CHain
59
+ return $this;
60
+ }
61
+
62
+ /**
63
+ * put your comment there...
64
+ *
65
+ */
66
+ public function & getStorage() {
67
+ return $this->_storage;
68
+ }
69
+
70
+ /**
71
+ * put your comment there...
72
+ *
73
+ */
74
+ public function pullMessages() {
75
+ # Get messages copy
76
+ $messages = $this->messsages;
77
+ # CLean messages
78
+ $this->clearMessages();
79
+ # Return copied messages
80
+ return $messages;
81
+ }
82
+
83
+ /**
84
+ * put your comment there...
85
+ *
86
+ */
87
+ protected function readState() {
88
+ # Read database state
89
+ $values = $this->getStorage()->getValue();
90
+ # For every found first lever property set object variable
91
+ foreach( $values as $name => $value ) {
92
+ # Set object property value
93
+ $this->$name = $value;
94
+ }
95
+ }
96
+
97
+ /**
98
+ * put your comment there...
99
+ *
100
+ * @param mixed $message
101
+ */
102
+ public function & setInformation($message) {
103
+ return $this->setMessage( self::MESSAGE_NOTICE, $message );
104
+ }
105
+
106
+ /**
107
+ * put your comment there...
108
+ *
109
+ * @param mixed $message
110
+ */
111
+ public function & setError($message) {
112
+ return $this->setMessage( self::MESSAGE_ERROR, $message );
113
+ }
114
+
115
+ /**
116
+ * put your comment there...
117
+ *
118
+ * @param mixed $type
119
+ * @param mixed $message
120
+ */
121
+ public function & setMessage($type, $message) {
122
+ # Queue message
123
+ $this->messsages[ $type ][] = $message;
124
+
125
+ return $this;
126
+ }
127
+
128
+ /**
129
+ * put your comment there...
130
+ *
131
+ * @param mixed $message
132
+ */
133
+ public function & setNotice($message) {
134
+ return $this->setMessage( self::MESSAGE_NOTICE, $message );
135
+ }
136
+
137
+ /**
138
+ * put your comment there...
139
+ *
140
+ * @param mixed $message
141
+ */
142
+ public function & setWarning($message) {
143
+ return $this->setMessage( self::MESSAGE_WARNING, $message );
144
+ }
145
+
146
+ /**
147
+ * put your comment there...
148
+ *
149
+ * @param mixed $location
150
+ */
151
+ public function redirect($location) {
152
+ # Redirect
153
+ wp_redirect( $location );
154
+ # Save state
155
+ $this->saveState();
156
+ # Temrinate
157
+ die();
158
+ }
159
+
160
+ /**
161
+ * put your comment there...
162
+ *
163
+ */
164
+ public function & saveState() {
165
+ # Initialize
166
+ $values = array();
167
+ # Save all not underscored vars value to database storage
168
+ $props = get_object_vars( $this );
169
+ foreach( $props as $name => $value ) {
170
+ # Save variable if there is no _ at the begining of the string
171
+ if ( strpos( $name, '_' ) !== 0 ) {
172
+ $values[ $name ] = $value;
173
+ }
174
+ }
175
+ # Set new value and save to database
176
+ $this->getStorage()->setValue( $values )->update();
177
+ # Chaining
178
+ return $this;
179
+ }
180
+
181
+ }
framework/ServicesFW/PluginBase.class.php ADDED
@@ -0,0 +1,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ /**
7
+ *
8
+ */
9
+ abstract class CJTServicesPluginBase implements CJTServicesIPluginBase
10
+ {
11
+
12
+ /**
13
+ * put your comment there...
14
+ *
15
+ * @var mixed
16
+ */
17
+ private $config;
18
+
19
+ /**
20
+ * put your comment there...
21
+ *
22
+ * @var mixed
23
+ */
24
+ private $dir;
25
+
26
+ /**
27
+ * put your comment there...
28
+ *
29
+ * @var mixed
30
+ */
31
+ private $file;
32
+
33
+ /**
34
+ * put your comment there...
35
+ *
36
+ * @var mixed
37
+ */
38
+ private $services;
39
+
40
+ /**
41
+ * put your comment there...
42
+ *
43
+ * @var mixed
44
+ */
45
+ private $url;
46
+
47
+ /**
48
+ * put your comment there...
49
+ *
50
+ * @param mixed $file
51
+ * @param mixed $config
52
+ */
53
+ protected function __construct( $file, $config )
54
+ {
55
+
56
+ $this->file = $file;
57
+ $this->dir = dirname( $file );
58
+ $this->url = plugin_dir_url( $file );
59
+ $this->config = $config;
60
+
61
+ }
62
+
63
+ /**
64
+ * put your comment there...
65
+ *
66
+ * @param mixed $item
67
+ */
68
+ public function getConfig( $configNames )
69
+ {
70
+
71
+ $configs = array();
72
+
73
+ # Each passed parameter is configuration to be merged to former one
74
+ foreach ( func_get_args() as $configName )
75
+ {
76
+ # Generaly target config point to all configs
77
+ # below loop is to point to the correct item
78
+ $targetConfig =& $this->config;
79
+
80
+ # Explode name and get array element recusively
81
+ foreach ( explode( '.', $configName ) as $itemName )
82
+ {
83
+
84
+ if ( ! isset( $targetConfig[ $itemName ] ) )
85
+ {
86
+ throw new Exception( "Config: {$itemName} doesn't exists in {$configName}!!!" );
87
+ }
88
+
89
+ # Go deeper as requested
90
+ $targetConfig =& $targetConfig[ $itemName ];
91
+ }
92
+
93
+ $configs = array_merge( $configs, $targetConfig );
94
+ }
95
+
96
+ return $configs;
97
+ }
98
+
99
+ /**
100
+ * put your comment there...
101
+ *
102
+ * @param mixed $serviceConfig
103
+ */
104
+ public function & getController( $serviceConfig )
105
+ {
106
+
107
+ return CJTServicesMVCController::getInstance( $serviceConfig, $serviceConfig[ 'route' ] );
108
+ }
109
+
110
+ /**
111
+ * put your comment there...
112
+ *
113
+ */
114
+ public function getDir()
115
+ {
116
+ return $this->dir;
117
+ }
118
+
119
+ /**
120
+ * put your comment there...
121
+ *
122
+ */
123
+ public function getFile()
124
+ {
125
+ return $this->file;
126
+ }
127
+
128
+ /**
129
+ * put your comment there...
130
+ *
131
+ */
132
+ public function getName()
133
+ {
134
+ return basename( $this->dir );
135
+ }
136
+
137
+ /**
138
+ * put your comment there...
139
+ *
140
+ */
141
+ public function getUrl()
142
+ {
143
+ return $this->url;
144
+ }
145
+
146
+ /**
147
+ * put your comment there...
148
+ *
149
+ * @param mixed $list
150
+ */
151
+ protected function & loadServices( $list )
152
+ {
153
+
154
+ foreach ( func_get_args() as $service )
155
+ {
156
+
157
+ $this->services[ get_class( $service ) ] =& $service;
158
+
159
+ # Start
160
+ $service->start();
161
+ }
162
+
163
+ return $this;
164
+ }
165
+
166
+ }
framework/ServicesFW/PluginBase.interface.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ /**
7
+ *
8
+ */
9
+ interface CJTServicesIPluginBase {
10
+
11
+ /**
12
+ *
13
+ */
14
+ public function & getController($serviceConfig);
15
+
16
+ }
framework/ServicesFW/Shortcode.service.class.php ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ /**
7
+ *
8
+ */
9
+ abstract class CJTServicesShortcodeService extends CJTServicesWPService {
10
+
11
+ /**
12
+ * put your comment there...
13
+ *
14
+ * @var mixed
15
+ */
16
+ private $callback;
17
+
18
+ /**
19
+ * put your comment there...
20
+ *
21
+ * @var mixed
22
+ */
23
+ private $shortcodes = array();
24
+
25
+ /**
26
+ * put your comment there...
27
+ *
28
+ */
29
+ public function __construct() {
30
+
31
+ $this->callback = array( $this, '_doShortcode' );
32
+ }
33
+
34
+ /**
35
+ * put your comment there...
36
+ *
37
+ * @param mixed $attrs
38
+ * @param mixed $content
39
+ * @param mixed $tag
40
+ */
41
+ public function _doShortcode($attrs, $content, $tag) {
42
+
43
+ # Get requested Shortcode config
44
+ $shortcode =& $this->shortcodes[ $tag ];
45
+ $shortcodeConfig =& $shortcode[ 'config' ];
46
+
47
+ # Push Shortcode parameters
48
+ $shortcodeConfig['parameters'] = array( 'attrs' => & $attrs, 'content' => & $content, 'tag' => & $tag );
49
+
50
+ # Get Controller
51
+ $this->controller =& $this->getControllerFactory()->getController( array_merge( $this->config, $shortcodeConfig ) );
52
+
53
+ # Dispatch action
54
+ $this->controller->dispatch( $shortcodeConfig[ 'route' ][ 'action' ] );
55
+
56
+ # Save models state
57
+ $this->controller->saveState();
58
+
59
+ # Return shortcoee replacement
60
+ return $this->controller->getResponse();
61
+ }
62
+
63
+ /**
64
+ * put your comment there...
65
+ *
66
+ * @param mixed $name
67
+ */
68
+ public function & addShortcode($name) {
69
+
70
+ # Create shortcode structure, add it to list
71
+ $this->shortcodes[ $name ] = array( 'name' => $name, 'config' => & $this->serviceConfig[ $name ] );
72
+
73
+ return $this;
74
+ }
75
+
76
+ /**
77
+ * put your comment there...
78
+ *
79
+ */
80
+ protected abstract function defineShortcodes();
81
+
82
+ /**
83
+ * put your comment there...
84
+ *
85
+ */
86
+ public function & start() {
87
+
88
+ # Let Model class define Shortcodes
89
+ $this->defineShortcodes();
90
+
91
+ # Add shortcodes at the correct hook
92
+ foreach ( $this->shortcodes as $shortcode ) {
93
+
94
+ # Register Wordpress shortcode
95
+ add_shortcode( $shortcode[ 'name' ], $this->callback );
96
+
97
+ }
98
+
99
+ return $this;
100
+ }
101
+
102
+ }
framework/ServicesFW/Storage.abstract.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ /**
7
+ *
8
+ */
9
+ class CJTServicesStorage {
10
+
11
+ /**
12
+ * put your comment there...
13
+ *
14
+ * @var mixed
15
+ */
16
+ private $storageVarName;
17
+
18
+ /**
19
+ * put your comment there...
20
+ *
21
+ * @var mixed
22
+ */
23
+ private $value;
24
+
25
+ /**
26
+ * put your comment there...
27
+ *
28
+ * @param mixed $name
29
+ * @param mixed $default
30
+ */
31
+ public function __construct($name, $default = null) {
32
+ # Storage Wordpress option name
33
+ $this->storageVarName = strtolower( $name );
34
+ # Read
35
+ $this->value = get_option( $this->storageVarName, $default );
36
+ }
37
+
38
+ /**
39
+ * put your comment there...
40
+ *
41
+ */
42
+ public function & getValue() {
43
+ return $this->value;
44
+ }
45
+
46
+ /**
47
+ * put your comment there...
48
+ *
49
+ * @param mixed $value
50
+ */
51
+ public function & setValue($value) {
52
+ # Set value
53
+ $this->value =& $value;
54
+ # chain
55
+ return $this;
56
+ }
57
+
58
+ /**
59
+ * put your comment there...
60
+ *
61
+ */
62
+ public function & update() {
63
+ # Update DB Value
64
+ update_option( $this->storageVarName, $this->value );
65
+ # Chain
66
+ return $this;
67
+ }
68
+
69
+ }
framework/ServicesFW/View.class.php ADDED
@@ -0,0 +1,290 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ /**
7
+ *
8
+ */
9
+ class CJTServicesMVCView {
10
+
11
+ /**
12
+ * put your comment there...
13
+ *
14
+ * @var mixed
15
+ */
16
+ private $controller;
17
+
18
+ /**
19
+ * put your comment there...
20
+ *
21
+ * @var mixed
22
+ */
23
+ private $path;
24
+
25
+ /**
26
+ * put your comment there...
27
+ *
28
+ * @var mixed
29
+ */
30
+ private $scripts = array();
31
+
32
+ /**
33
+ * put your comment there...
34
+ *
35
+ * @var mixed
36
+ */
37
+ private $styles = array();
38
+
39
+ /**
40
+ * put your comment there...
41
+ *
42
+ * @var mixed
43
+ */
44
+ private $output;
45
+
46
+ /**
47
+ * put your comment there...
48
+ *
49
+ * @var mixed
50
+ */
51
+ private $url;
52
+
53
+ /**.
54
+ * put your comment there...
55
+ *
56
+ * @param CJTServicesMVCController $controller
57
+ * @return {CJTServicesView|CJTServicesMVCController}
58
+ */
59
+ public function __construct(CJTServicesMVCController & $controller) {
60
+ # Initialize
61
+ $this->controller =& $controller;
62
+ # Enqueue styles and script hooks
63
+ if( is_admin() ) {
64
+ add_action( 'admin_print_styles', array( $this, '_enqueueStyles' ) );
65
+ add_action( 'admin_print_scripts', array( $this, '_enqueueScripts' ) );
66
+ }
67
+ # Cache View Path and Urls
68
+ $config = $this->controller->getConfig();
69
+ $route = $this->controller->getRoute();
70
+ $viewConfig = $config[ 'views' ][ $route[ 'view' ] ];
71
+ $this->path = $config[ 'path' ] . DIRECTORY_SEPARATOR .
72
+ 'Views' . DIRECTORY_SEPARATOR .
73
+ str_replace( '/', DIRECTORY_SEPARATOR, $viewConfig[ 'path' ] );
74
+ $this->url = "{$config[ 'url' ]}/Views/{$viewConfig[ 'path' ]}/";
75
+ }
76
+
77
+ /**
78
+ * put your comment there...
79
+ *
80
+ */
81
+ public function __toString() {
82
+ # Render
83
+ return $this->output;
84
+ }
85
+
86
+ /**
87
+ * put your comment there...
88
+ *
89
+ */
90
+ public function _enqueueScripts()
91
+ {
92
+
93
+ foreach ( $this->scripts as $script )
94
+ {
95
+ // Enqueue script
96
+ wp_enqueue_script( $script[ 'handle' ],
97
+ $script[ 'src' ],
98
+ $script[ 'dep' ],
99
+ $script[ 'version' ],
100
+ $script[ 'footer' ]
101
+ );
102
+
103
+ // Pluggable script queue
104
+ foreach ( $script[ 'plugs' ] as $scriptPlug )
105
+ {
106
+ call_user_func( $scriptPlug, $script );
107
+ }
108
+ }
109
+
110
+ }
111
+
112
+ /**
113
+ * put your comment there...
114
+ *
115
+ */
116
+ public function _enqueueStyles() {
117
+ foreach ( $this->styles as $style ) {
118
+ wp_enqueue_style( $style[ 'handle' ],
119
+ $style[ 'src' ],
120
+ $style[ 'dep' ],
121
+ $style[ 'version' ],
122
+ $style[ 'media' ]
123
+ );
124
+ }
125
+ }
126
+
127
+ /**
128
+ * put your comment there...
129
+ *
130
+ * @param mixed $script
131
+ */
132
+ public function _localizeJS( $script )
133
+ {
134
+
135
+ $l10n =& $script[ 'l10n' ];
136
+
137
+ wp_localize_script( $script[ 'handle' ], $l10n[ 'jsName' ], $l10n[ 'strings' ] );
138
+
139
+ }
140
+
141
+ /***
142
+ * put your comment there...
143
+ *
144
+ * @param mixed $name
145
+ * @param mixed $url
146
+ * @param mixed $version
147
+ * @param mixed $footer
148
+ */
149
+ public function enqueueScript( $handle, $src = null, $dep = null, $version = null, $footer = null )
150
+ {
151
+
152
+ $plugs = array();
153
+
154
+ $this->scripts[ $handle ] = compact( 'handle', 'src', 'dep', 'version', 'footer', 'plugs' );
155
+
156
+ return $this;
157
+ }
158
+
159
+ /***
160
+ * put your comment there...
161
+ *
162
+ * @param mixed $name
163
+ * @param mixed $url
164
+ * @param mixed $version
165
+ * @param mixed $media
166
+ */
167
+ public function enqueueStyle($handle, $src = null, $dep = null, $version = null, $media = null) {
168
+ # Add style
169
+ $this->styles[] = compact( 'handle', 'src', 'dep', 'version', 'media' );
170
+ # Chain
171
+ return $this;
172
+ }
173
+
174
+ /**
175
+ * put your comment there...
176
+ *
177
+ */
178
+ public function dispatch() {
179
+ # Get early output so its possible to use Wordpress hooks before they
180
+ # are elapced
181
+ $route = $this->controller->getRoute();
182
+ $this->output = $this->getTemplate( isset( $route[ 'template' ] ) ? $route[ 'template' ] : $route[ 'action' ] );
183
+ }
184
+
185
+ /**
186
+ * put your comment there...
187
+ *
188
+ */
189
+ public function getPath() {
190
+ return $this->path;
191
+ }
192
+
193
+ /**
194
+ *
195
+ *
196
+ * @param mixed $name
197
+ */
198
+ public function getResName($name)
199
+ {
200
+
201
+ $name = strtolower( $name );
202
+
203
+ $name = str_replace( array( '.' ), '-', $name );
204
+
205
+ $resName = strtolower( get_class( $this ) ) . "-{$name}";
206
+
207
+ return $resName;
208
+ }
209
+
210
+ /**
211
+ * put your comment there...
212
+ *
213
+ * @param mixed $name
214
+ */
215
+ public function getResUrl($name) {
216
+ return "{$this->url}/{$name}";
217
+ }
218
+
219
+ /**
220
+ * put your comment there...
221
+ *
222
+ * @param mixed $name
223
+ */
224
+ public function getScriptUrl($name) {
225
+ return $this->getResUrl( "{$name}.js" );
226
+ }
227
+
228
+ /**
229
+ * put your comment there...
230
+ *
231
+ * @param mixed $name
232
+ */
233
+ public function getStyleUrl($name) {
234
+ return $this->getResUrl( "{$name}.css" );
235
+ }
236
+
237
+ /**
238
+ * put your comment there...
239
+ *
240
+ * @param mixed $name
241
+ */
242
+ protected function getTemplate($name) {
243
+ # Get view path
244
+ $config = $this->controller->getConfig();
245
+ $viewPath = $this->getPath();
246
+ # Template Extension/Format
247
+ $extension = isset( $viewConfig[ 'format' ] ) ? $viewConfig[ 'format' ] : $config[ 'defaultFormat' ];
248
+ # Template file
249
+ $templateFile = $viewPath . DIRECTORY_SEPARATOR . "{$name}.{$extension}.php";
250
+ # Execute tempate file
251
+ ob_start();
252
+ require $templateFile;
253
+ $result = ob_get_clean();
254
+ # Returns
255
+ return $result;
256
+ }
257
+
258
+ /**
259
+ * put your comment there...
260
+ *
261
+ * @param mixed $handle
262
+ * @param mixed $jsName
263
+ * @param mixed $strings
264
+ */
265
+ public function localizeJS( $handle, $jsName, $strings )
266
+ {
267
+
268
+ $script =& $this->scripts[ $handle ];
269
+
270
+ $script[ 'l10n' ] = compact( 'jsName', 'strings' );
271
+
272
+ $script[ 'plugs' ][ ] = array( $this, '_localizeJS' );
273
+
274
+ return $this;
275
+ }
276
+
277
+ /**
278
+ * put your comment there...
279
+ *
280
+ */
281
+ protected function messagesList()
282
+ {
283
+ ob_start();
284
+
285
+ require __DIR__ . DIRECTORY_SEPARATOR . 'ViewTemplates' . DIRECTORY_SEPARATOR . 'MessagesList.html';
286
+
287
+ return ob_get_clean();
288
+ }
289
+
290
+ }
framework/ServicesFW/ViewJson.class.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /***
3
+ *
4
+ */
5
+
6
+ /**
7
+ *
8
+ */
9
+ class CJTServicesMVCViewJson
10
+ {
11
+
12
+ /**
13
+ * put your comment there...
14
+ *
15
+ */
16
+ public function dispatch() {}
17
+
18
+ /**
19
+ * put your comment there...
20
+ *
21
+ */
22
+ public function __toString()
23
+ {
24
+
25
+ $data = get_object_vars( $this );
26
+
27
+ return json_encode( $data );
28
+ }
29
+
30
+ }
framework/ServicesFW/ViewTemplates/MessagesList.html ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="<?php $this->getResName( 'messages-list' ) ?>">
2
+ <?php
3
+ # Gettting model
4
+ $model =& $this->controller->getModel();
5
+ # Get all messages and displat them based on the type
6
+ $messages = $model->pullMessages();
7
+ foreach( $messages as $type => $typeMsgs ) :
8
+ ?>
9
+ <div class="<?php echo $type ?>">
10
+ <?php foreach( $typeMsgs as $message ) : ?>
11
+ <p><?php echo $message; ?></p>
12
+ <?php endforeach; ?>
13
+ </div>
14
+ <?php endforeach; ?>
15
+ </div>
framework/ServicesFW/Wordpress.service.abstract.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ */
5
+
6
+ /**
7
+ *
8
+ */
9
+ abstract class CJTServicesWPService {
10
+
11
+ /**
12
+ * put your comment there...
13
+ *
14
+ * @var mixed
15
+ */
16
+ protected $controller;
17
+
18
+ /**
19
+ * put your comment there...
20
+ *
21
+ * @var mixed
22
+ */
23
+ protected $controllerFactory;
24
+
25
+ /**
26
+ * put your comment there...
27
+ *
28
+ * @var mixed
29
+ */
30
+ protected $config;
31
+
32
+ /**
33
+ * put your comment there...
34
+ *
35
+ * @var mixed
36
+ */
37
+ protected $serviceConfig;
38
+
39
+ /**
40
+ * put your comment there...
41
+ *
42
+ * @param mixed $controllerFactory
43
+ * @param mixed $config
44
+ * @param mixed $serviceConfig
45
+ */
46
+ public function & attach(& $controllerFactory, $config, $serviceConfig) {
47
+
48
+ $this->controllerFactory =& $controllerFactory;
49
+ $this->config = $config;
50
+ $this->serviceConfig = $serviceConfig;
51
+
52
+ return $this;
53
+ }
54
+
55
+ /**
56
+ * put your comment there...
57
+ *
58
+ */
59
+ public function & getController() {
60
+ return $this->controller;
61
+ }
62
+
63
+ /**
64
+ * put your comment there...
65
+ *
66
+ */
67
+ public function & getControllerFactory() {
68
+ return $this->controllerFactory;
69
+ }
70
+
71
+ }
framework/db/mysql/sql-view.inc.php CHANGED
@@ -61,27 +61,46 @@ abstract class CJTSQLView {
61
  * @param mixed $from
62
  * @param mixed $filter
63
  */
64
- protected function buildQuery($from, $filter) {
 
 
65
  $query = $this->query;
66
- $sql = array('columns' => null, 'from' => null,'filter' => null,'orderBy' => null,'limits' => null);
67
- // Columns.
68
- $sql['columns'] = implode(',', $query->columns);
 
 
 
 
 
 
 
 
 
69
  // From.
70
- $sql['from'] = " FROM {$from}";
 
71
  // Where clause.
72
- if (!empty($filter)) {
73
- $sql['filter'] = " WHERE {$filter}";
 
74
  }
 
75
  // Order By.
76
- if (!empty($query->orderBy)) {
77
- $sql['orderBy'] = ' ORDER BY ' . implode(',', $order);
 
78
  }
 
79
  // Limits.
80
- if (!empty($query->limits)) {
81
- $sql['limits'] = " LIMIT {$limits[0]}" . (isset($limits[1]) ? ",{$limits}" : '');
 
82
  }
83
- // Combine all into one statment.
84
- $sql = "SELECT {$sql['columns']}{$sql['from']}{$sql['filter']}{$sql['orderBy']}{$sql['limits']};";
 
 
85
  return $sql;
86
  }
87
 
61
  * @param mixed $from
62
  * @param mixed $filter
63
  */
64
+ protected function buildQuery($from, $filter)
65
+ {
66
+
67
  $query = $this->query;
68
+
69
+ $sql = array
70
+ (
71
+ 'columns' => null,
72
+ 'from' => null,
73
+ 'filter' => null,
74
+ 'orderBy' => null,
75
+ 'limits' => null
76
+ );
77
+
78
+ $sql[ 'columns' ] = implode( ', ', $query->columns );
79
+
80
  // From.
81
+ $sql[ 'from' ] = " FROM {$from}";
82
+
83
  // Where clause.
84
+ if ( ! empty( $filter ) )
85
+ {
86
+ $sql[ 'filter' ] = " WHERE {$filter}";
87
  }
88
+
89
  // Order By.
90
+ if ( ! empty( $query->orderBy ) )
91
+ {
92
+ $sql[ 'orderBy' ] = ' ORDER BY ' . implode( ',', $order );
93
  }
94
+
95
  // Limits.
96
+ if ( ! empty( $query->limits ) )
97
+ {
98
+ $sql[ 'limits' ] = " LIMIT {$limits[0]}" . ( isset( $limits[ 1 ] ) ? ",{$limits}" : '' );
99
  }
100
+
101
+ // Buile query
102
+ $sql = "SELECT {$sql['columns']}\n\n{$sql['from']}\n\n{$sql['filter']}{$sql['orderBy']}{$sql['limits']};";
103
+
104
  return $sql;
105
  }
106
 
framework/mvc/view.inc.php CHANGED
@@ -71,8 +71,14 @@ abstract class CJTView extends CJTHookableClass {
71
  *
72
  * @var mixed
73
  */
74
- protected $onloadtemplate = array(
75
- 'parameters' => array('content', 'file'),
 
 
 
 
 
 
76
  );
77
 
78
  /**
@@ -243,7 +249,7 @@ abstract class CJTView extends CJTHookableClass {
243
  // Get template content into variable.
244
  ob_start();
245
  require $this->onimporttemplate($templateFile);
246
- $template = $this->onloadtemplate(ob_get_clean(), $name);
247
  return $template;
248
  }
249
 
71
  *
72
  * @var mixed
73
  */
74
+ protected $onloadtemplate = array
75
+ (
76
+ 'parameters' => array
77
+ (
78
+ 'content',
79
+ 'file',
80
+ 'dir',
81
+ ),
82
  );
83
 
84
  /**
249
  // Get template content into variable.
250
  ob_start();
251
  require $this->onimporttemplate($templateFile);
252
+ $template = $this->onloadtemplate( ob_get_clean(), $name, "{$dir}/{$name}" );
253
  return $template;
254
  }
255
 
locals/languages/css-javascript-toolbox-en_US.mo CHANGED
Binary file
locals/languages/css-javascript-toolbox-en_US.po CHANGED
@@ -1,9 +1,9 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: CSS & Javascript Toolbox V6\n"
4
- "POT-Creation-Date: 2014-03-07 21:20+0200\n"
5
- "PO-Revision-Date: 2014-03-07 21:21+0200\n"
6
- "Last-Translator: \n"
7
  "Language-Team: CJT <development@css-javascript-toolbox.com>\n"
8
  "Language: English\n"
9
  "MIME-Version: 1.0\n"
@@ -15,16 +15,16 @@ msgstr ""
15
  "X-Poedit-SourceCharset: UTF-8\n"
16
  "X-Poedit-SearchPath-0: "
17
 
18
- #: /access.points/extensions.accesspoint.php:53
19
- msgid "Extensions"
20
- msgstr ""
21
-
22
  #: /access.points/manage.accesspoint.php:44
23
  #: /access.points/manage.accesspoint.php:45
24
- #: /views/setup/activation-form/tmpl/default.html.tmpl:28
25
  msgid "CSS & Javascript Toolbox"
26
  msgstr ""
27
 
 
 
 
 
28
  #: /access.points/packages.accesspoint.php:45
29
  msgid "CJT Manage - Packages"
30
  msgstr ""
@@ -33,15 +33,6 @@ msgstr ""
33
  msgid "Packages"
34
  msgstr ""
35
 
36
- #: /access.points/setup.accesspoint.php:45
37
- msgid "CSS & Javascript Toolbox - Setup"
38
- msgstr ""
39
-
40
- #: /access.points/setup.accesspoint.php:46
41
- #: /views/extensions/plugins-list/tmpl/default_setup_action.html.tmpl:10
42
- msgid "Setup"
43
- msgstr ""
44
-
45
  #: /controllers/metabox.php:57
46
  #, php-format
47
  msgid "CJT Block - Post #%d"
@@ -53,14 +44,11 @@ msgid "CJT Block"
53
  msgstr ""
54
 
55
  #: /controllers/templates-lookup.php:81
56
- #: /views/templates/lookup/tmpl/default.html.tmpl:40
57
  msgid "Unlink"
58
  msgstr ""
59
 
60
  #: /controllers/templates-lookup.php:99
61
  #: /controllers/templates-lookup.php:115
62
- #: /views/blocks/manager/tmpl/help/intro.html.tmpl:25
63
- #: /views/templates/lookup/tmpl/default.html.tmpl:42
64
  msgid "Link"
65
  msgstr ""
66
 
@@ -83,16 +71,31 @@ msgid ""
83
  "Invalid Shortcode parameter(s) has been passed! Please check parameters name."
84
  msgstr ""
85
 
86
- #: /framework/extensions/extensions.class.php:305
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  msgid ""
88
- "CJT detects incompatible installed extensions and must be updated. "
89
- "Extensions are listed below.\n"
90
- "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tPlease upgrade those extensions from "
91
- "Wordpress Plugins or update page.\n"
92
- "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tThose extensions are now stopped until "
93
- "the upgrade is done.\n"
94
- "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tIf you've any problem upgrading them "
95
- "please visit CJT website by clicking extension links below."
96
  msgstr ""
97
 
98
  #: /framework/js/ajax/cjt-server/cjt-server.localization.php:13
@@ -176,7 +179,6 @@ msgstr "Revision"
176
 
177
  #: /locals/strings.inc.php:21
178
  #: /models/fields/template-types.php:21
179
- #: /views/blocks/block/tmpl/templates/toolbox.html.tmpl:23
180
  msgid "javascript"
181
  msgstr "Javascript"
182
 
@@ -195,10 +197,6 @@ msgstr "HTML"
195
  msgid "php"
196
  msgstr "PHP"
197
 
198
- #: /models/package-file.php:47
199
- msgid "The uploaded package is already installed!"
200
- msgstr ""
201
-
202
  #: /models/block/assignmentpanel/helpers/auxiliary.php:25
203
  msgid "Blog Index"
204
  msgstr ""
@@ -259,7 +257,7 @@ msgstr ""
259
  msgid "Would you like to delete \"{BACKUP-NAME}\" backup?"
260
  msgstr ""
261
 
262
- #: /views/blocks/block/view.php:142
263
  msgid "Click to update Block name"
264
  msgstr ""
265
 
@@ -314,163 +312,19 @@ msgid "Invalid block name"
314
  msgstr ""
315
 
316
  #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:21
317
- msgid "Revert code editor to default mode"
318
- msgstr ""
319
-
320
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:22
321
- msgid "Switch code editor to fullscreen mode"
322
- msgstr ""
323
-
324
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:23
325
  msgid ""
326
  "Please enter a list of the external URLs you want to link separated by comma!"
327
  msgstr ""
328
 
329
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:24
330
  msgid "Couldn't link the externals URI you requested!! Reason:"
331
  msgstr ""
332
 
333
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:25
334
  msgid "Loading"
335
  msgstr ""
336
 
337
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:27
338
- msgid "Ambiance"
339
- msgstr ""
340
-
341
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:28
342
- msgid "Chaos"
343
- msgstr ""
344
-
345
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:29
346
- msgid "Chrome"
347
- msgstr ""
348
-
349
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:30
350
- msgid "Clouds"
351
- msgstr ""
352
-
353
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:31
354
- msgid "Clouds Midnight"
355
- msgstr ""
356
-
357
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:32
358
- msgid "Cobalt"
359
- msgstr ""
360
-
361
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:33
362
- msgid "Crimson Editor"
363
- msgstr ""
364
-
365
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:34
366
- msgid "Dawn"
367
- msgstr ""
368
-
369
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:35
370
- msgid "Dreamweaver"
371
- msgstr ""
372
-
373
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:36
374
- msgid "Eclipse"
375
- msgstr ""
376
-
377
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:37
378
- msgid "Github"
379
- msgstr ""
380
-
381
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:38
382
- msgid "Idle Fingers"
383
- msgstr ""
384
-
385
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:39
386
- msgid "Katzenmilch"
387
- msgstr ""
388
-
389
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:40
390
- msgid "Kr"
391
- msgstr ""
392
-
393
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:41
394
- msgid "Kuroir"
395
- msgstr ""
396
-
397
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:42
398
- msgid "Merbivore"
399
- msgstr ""
400
-
401
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:43
402
- msgid "Merbivore Soft"
403
- msgstr ""
404
-
405
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:44
406
- msgid "Mono Industrial"
407
- msgstr ""
408
-
409
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:45
410
- msgid "Monokai"
411
- msgstr ""
412
-
413
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:46
414
- msgid "Pastel On Dark"
415
- msgstr ""
416
-
417
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:47
418
- msgid "Solarized dark"
419
- msgstr ""
420
-
421
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:48
422
- msgid "Solarized Light"
423
- msgstr ""
424
-
425
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:49
426
- msgid "Terminal"
427
- msgstr ""
428
-
429
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:50
430
- msgid "Textmate"
431
- msgstr ""
432
-
433
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:51
434
- msgid "Tomorrow"
435
- msgstr ""
436
-
437
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:52
438
- msgid "Tomorrow Night"
439
- msgstr ""
440
-
441
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:53
442
- msgid "Tomorrow Night Blue"
443
- msgstr ""
444
-
445
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:54
446
- msgid "Tomorrow Night Bright"
447
- msgstr ""
448
-
449
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:55
450
- msgid "Tomorrow Night Eighties"
451
- msgstr ""
452
-
453
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:56
454
- msgid "Twilight"
455
- msgstr ""
456
-
457
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:57
458
- msgid "Vibrant Ink"
459
- msgstr ""
460
-
461
- #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:58
462
- msgid "XCode"
463
- msgstr ""
464
-
465
  #: /views/blocks/cjt-block/public/js/jquery.block/jquery.block.localization.php:13
466
- msgid "Switch code editor to fullwidth mode (hides assignment panel)"
467
- msgstr ""
468
-
469
- #: /views/blocks/cjt-block/public/js/jquery.block/jquery.block.localization.php:14
470
- msgid "Revert code editor to default mode (show assignment panel)"
471
- msgstr ""
472
-
473
- #: /views/blocks/cjt-block/public/js/jquery.block/jquery.block.localization.php:15
474
  msgid ""
475
  "Changes has been made to the assignment objects. Switching display mode "
476
  "would reset all those changes as it never made. Would you like to discard "
@@ -490,7 +344,6 @@ msgid "General settings"
490
  msgstr ""
491
 
492
  #: /views/blocks/manager/public/js/blocks-page/blocks-page.localization.php:15
493
- #: /views/blocks/manager/tmpl/toolbox.html.tmpl:35
494
  msgid "Backups"
495
  msgstr ""
496
 
@@ -511,26 +364,9 @@ msgid "Templates Manager"
511
  msgstr ""
512
 
513
  #: /views/blocks/manager/public/js/blocks-page/blocks-page.localization.php:19
514
- #, php-format
515
- msgid "You're about to delete %d code block(s)."
516
- msgstr ""
517
-
518
- #: /views/blocks/manager/public/js/blocks-page/blocks-page.localization.php:20
519
- msgid "Are you sure you want to delete all code blocks?"
520
- msgstr ""
521
-
522
- #: /views/blocks/manager/public/js/blocks-page/blocks-page.localization.php:21
523
- msgid "Are you sure you want to delete all the empty code blocks?"
524
- msgstr ""
525
-
526
- #: /views/blocks/manager/public/js/blocks-page/blocks-page.localization.php:22
527
  msgid "The changes you made will be lost if you navigate away from this page."
528
  msgstr ""
529
 
530
- #: /views/blocks/manager/public/js/blocks-page/blocks-page.localization.php:23
531
- msgid "There is no blocks to delete!"
532
- msgstr ""
533
-
534
  #: /views/blocks/metabox/public/js/jquery.block/jquery.block.localization.php:12
535
  msgid "Preview Post/Page in a new window"
536
  msgstr ""
@@ -590,13 +426,10 @@ msgstr ""
590
  #: /views/packages/manager/helpers/wp-list-table.inc.php:79
591
  #: /views/templates/manager/helpers/wp-list-table.inc.php:59
592
  #: /views/templates/manager/helpers/wp-list-table.inc.php:131
593
- #: /views/blocks/block/tmpl/codefile/codefile.html.tmpl:3
594
- #: /views/blocks/block/tmpl/menu/menu.html.tmpl:12
595
  msgid "Delete"
596
  msgstr ""
597
 
598
  #: /views/packages/manager/helpers/wp-list-table.inc.php:59
599
- #: /views/blocks/block/tmpl/menu/menu.html.tmpl:46
600
  msgid "View"
601
  msgstr ""
602
 
@@ -607,18 +440,11 @@ msgstr ""
607
 
608
  #: /views/packages/manager/helpers/wp-list-table.inc.php:98
609
  #: /views/templates/manager/helpers/wp-list-table.inc.php:153
610
- #: /views/blocks/block/tmpl/codefile/codefile.html.tmpl:11
611
- #: /views/blocks/info/tmpl/default.html.tmpl:4
612
- #: /views/blocks/new/tmpl/default.html.tmpl:24
613
- #: /views/templates/info/tmpl/default.html.tmpl:6
614
- #: /views/templates/template/tmpl/default.html.tmpl:44
615
  msgid "Name"
616
  msgstr ""
617
 
618
  #: /views/packages/manager/helpers/wp-list-table.inc.php:99
619
  #: /views/templates/manager/helpers/wp-list-table.inc.php:157
620
- #: /views/blocks/info/tmpl/default.html.tmpl:5
621
- #: /views/templates/info/tmpl/default.html.tmpl:17
622
  msgid "Author"
623
  msgstr ""
624
 
@@ -635,8 +461,6 @@ msgid "Readme"
635
  msgstr ""
636
 
637
  #: /views/packages/manager/helpers/wp-list-table.inc.php:103
638
- #: /views/blocks/info/tmpl/default.html.tmpl:3
639
- #: /views/templates/info/tmpl/default.html.tmpl:5
640
  msgid "ID"
641
  msgstr ""
642
 
@@ -691,7 +515,6 @@ msgid ""
691
  msgstr ""
692
 
693
  #: /views/setup/activation-form/public/js/default/default.localization.php:19
694
- #: /views/blocks/new/tmpl/default.html.tmpl:28
695
  msgid "Activate"
696
  msgstr ""
697
 
@@ -816,7 +639,7 @@ msgid "Invalid License key!"
816
  msgstr ""
817
 
818
  #: /views/setup/activation-form/public/js/default/default.localization.php:58
819
- msgid "Component name is absolute!!! Invalid Request Specified!!!"
820
  msgstr ""
821
 
822
  #: /views/templates/lookup/public/js/lookup/lookup.localization.php:15
@@ -832,27 +655,18 @@ msgid "Lookup Quick Template Edit Form"
832
  msgstr ""
833
 
834
  #: /views/templates/manager/helpers/wp-list-table.inc.php:55
835
- #: /views/templates/info/tmpl/default.html.tmpl:3
836
  msgid "Info"
837
  msgstr ""
838
 
839
  #: /views/templates/manager/helpers/wp-list-table.inc.php:56
840
- #: /views/blocks/block/tmpl/codefile/codefile.html.tmpl:44
841
- #: /views/blocks/block/tmpl/menu/menu.html.tmpl:16
842
- #: /views/templates/lookup/tmpl/default.html.tmpl:45
843
  msgid "Edit"
844
  msgstr ""
845
 
846
  #: /views/templates/manager/helpers/wp-list-table.inc.php:154
847
- #: /views/blocks/block/tmpl/codefile/codefile.html.tmpl:13
848
- #: /views/templates/info/tmpl/default.html.tmpl:7
849
  msgid "Type"
850
  msgstr ""
851
 
852
  #: /views/templates/manager/helpers/wp-list-table.inc.php:155
853
- #: /views/templates/info/tmpl/default.html.tmpl:16
854
- #: /views/templates/template/tmpl/default.html.tmpl:39
855
- #: /views/templates/template/tmpl/default.html.tmpl:73
856
  msgid "Version"
857
  msgstr ""
858
 
@@ -861,18 +675,14 @@ msgid "Release"
861
  msgstr ""
862
 
863
  #: /views/templates/manager/helpers/wp-list-table.inc.php:158
864
- #: /views/blocks/info/tmpl/default.html.tmpl:6
865
  msgid "Date Created"
866
  msgstr ""
867
 
868
  #: /views/templates/manager/helpers/wp-list-table.inc.php:159
869
- #: /views/blocks/info/tmpl/default.html.tmpl:7
870
- #: /views/templates/info/tmpl/default.html.tmpl:9
871
  msgid "Last Modified"
872
  msgstr ""
873
 
874
  #: /views/templates/manager/helpers/wp-list-table.inc.php:160
875
- #: /views/templates/template/tmpl/default.html.tmpl:75
876
  msgid "State"
877
  msgstr ""
878
 
@@ -914,947 +724,3 @@ msgid ""
914
  "You won't be able to revert the type name once its set! Are you sure would "
915
  "you like to use the selected type?"
916
  msgstr ""
917
-
918
- #: /views/backups/manager/tmpl/form.html.tmpl:6
919
- msgid ""
920
- "Write backup name and click Backup button to create backup from current "
921
- "blocks"
922
- msgstr ""
923
-
924
- #: /views/backups/manager/tmpl/list.html.tmpl:3
925
- msgid ""
926
- "There is no backups available! You can start creating new backups from the "
927
- "form above."
928
- msgstr ""
929
-
930
- #: /views/backups/manager/tmpl/single-backup.html.tmpl:16
931
- #: /views/tinymce/params/tmpl/default.html.tmpl:34
932
- msgid "By"
933
- msgstr ""
934
-
935
- #: /views/blocks/block/tmpl/edit.html.tmpl:12
936
- msgid "Cancel editing code block title"
937
- msgstr ""
938
-
939
- #: /views/blocks/block/tmpl/edit.html.tmpl:13
940
- msgid "Save code block title"
941
- msgstr ""
942
-
943
- #: /views/blocks/block/tmpl/codefile/codefile.html.tmpl:3
944
- msgid "Delete all selected Code Files"
945
- msgstr ""
946
-
947
- #: /views/blocks/block/tmpl/codefile/codefile.html.tmpl:4
948
- msgid "Close Code Files Manager Dialog"
949
- msgstr ""
950
-
951
- #: /views/blocks/block/tmpl/codefile/codefile.html.tmpl:4
952
- #: /views/blocks/block/tmpl/codefile/codefile.html.tmpl:35
953
- #: /views/templates/template/tmpl/default.html.tmpl:11
954
- #: /views/tinymce/params/tmpl/default.html.tmpl:29
955
- msgid "Close"
956
- msgstr ""
957
-
958
- #: /views/blocks/block/tmpl/codefile/codefile.html.tmpl:11
959
- msgid ""
960
- "Code File Name should be unique for each Block. Use simple names that "
961
- "describe fow what Code File is used for."
962
- msgstr ""
963
-
964
- #: /views/blocks/block/tmpl/codefile/codefile.html.tmpl:13
965
- msgid ""
966
- "Type tells CJT how to handle applying the Code File to the Associated "
967
- "Request. It also automatically switch Code Editor language for you."
968
- msgstr ""
969
-
970
- #: /views/blocks/block/tmpl/codefile/codefile.html.tmpl:26
971
- msgid ""
972
- "Its automatically generated when the Type is changed. In most cases you "
973
- "won't need to modify it manually, only change it when you know how to works. "
974
- "Please point out to CJT Web site documentation for more details about TAG "
975
- "field."
976
- msgstr ""
977
-
978
- #: /views/blocks/block/tmpl/codefile/codefile.html.tmpl:26
979
- msgid "Tag"
980
- msgstr ""
981
-
982
- #: /views/blocks/block/tmpl/codefile/codefile.html.tmpl:30
983
- msgid "Optionally Code File notes."
984
- msgstr ""
985
-
986
- #: /views/blocks/block/tmpl/codefile/codefile.html.tmpl:30
987
- #: /views/templates/info/tmpl/default.html.tmpl:15
988
- #: /views/templates/template/tmpl/default.html.tmpl:38
989
- #: /views/templates/template/tmpl/default.html.tmpl:65
990
- msgid "Description"
991
- msgstr ""
992
-
993
- #: /views/blocks/block/tmpl/codefile/codefile.html.tmpl:34
994
- #: /views/blocks/block/tmpl/menu/menu.html.tmpl:9
995
- #: /views/blocks/block/tmpl/templates/toolbox.html.tmpl:35
996
- #: /views/templates/template/tmpl/default.html.tmpl:12
997
- msgid "Save"
998
- msgstr ""
999
-
1000
- #: /views/blocks/block/tmpl/codefile/codefile.html.tmpl:40
1001
- msgid "Create File"
1002
- msgstr ""
1003
-
1004
- #: /views/blocks/block/tmpl/menu/menu.html.tmpl:3
1005
- msgid "File"
1006
- msgstr ""
1007
-
1008
- #: /views/blocks/block/tmpl/menu/menu.html.tmpl:5
1009
- msgid "ReLoad"
1010
- msgstr ""
1011
-
1012
- #: /views/blocks/block/tmpl/menu/menu.html.tmpl:6
1013
- msgid "Load Local"
1014
- msgstr ""
1015
-
1016
- #: /views/blocks/block/tmpl/menu/menu.html.tmpl:7
1017
- msgid "Load Url"
1018
- msgstr ""
1019
-
1020
- #: /views/blocks/block/tmpl/menu/menu.html.tmpl:10
1021
- msgid "Save File"
1022
- msgstr ""
1023
-
1024
- #: /views/blocks/block/tmpl/menu/menu.html.tmpl:18
1025
- msgid "Undo"
1026
- msgstr ""
1027
-
1028
- #: /views/blocks/block/tmpl/menu/menu.html.tmpl:19
1029
- msgid "Redo"
1030
- msgstr ""
1031
-
1032
- #: /views/blocks/block/tmpl/menu/menu.html.tmpl:21
1033
- msgid "Find"
1034
- msgstr ""
1035
-
1036
- #: /views/blocks/block/tmpl/menu/menu.html.tmpl:22
1037
- msgid "Find Next"
1038
- msgstr ""
1039
-
1040
- #: /views/blocks/block/tmpl/menu/menu.html.tmpl:23
1041
- msgid "Find Previous"
1042
- msgstr ""
1043
-
1044
- #: /views/blocks/block/tmpl/menu/menu.html.tmpl:25
1045
- msgid "Replace"
1046
- msgstr ""
1047
-
1048
- #: /views/blocks/block/tmpl/menu/menu.html.tmpl:27
1049
- msgid "Go To Line"
1050
- msgstr ""
1051
-
1052
- #: /views/blocks/block/tmpl/menu/menu.html.tmpl:28
1053
- msgid "Go Line Up"
1054
- msgstr ""
1055
-
1056
- #: /views/blocks/block/tmpl/menu/menu.html.tmpl:29
1057
- msgid "Go Line down"
1058
- msgstr ""
1059
-
1060
- #: /views/blocks/block/tmpl/menu/menu.html.tmpl:31
1061
- msgid "Go To Next Error"
1062
- msgstr ""
1063
-
1064
- #: /views/blocks/block/tmpl/menu/menu.html.tmpl:32
1065
- msgid "Go To Previous Error"
1066
- msgstr ""
1067
-
1068
- #: /views/blocks/block/tmpl/menu/menu.html.tmpl:34
1069
- msgid "Fold"
1070
- msgstr ""
1071
-
1072
- #: /views/blocks/block/tmpl/menu/menu.html.tmpl:35
1073
- msgid "Fold All"
1074
- msgstr ""
1075
-
1076
- #: /views/blocks/block/tmpl/menu/menu.html.tmpl:36
1077
- msgid "UnFold"
1078
- msgstr ""
1079
-
1080
- #: /views/blocks/block/tmpl/menu/menu.html.tmpl:37
1081
- msgid "UnFold All"
1082
- msgstr ""
1083
-
1084
- #: /views/blocks/block/tmpl/menu/menu.html.tmpl:39
1085
- msgid "To Lower Case"
1086
- msgstr ""
1087
-
1088
- #: /views/blocks/block/tmpl/menu/menu.html.tmpl:40
1089
- msgid "To Upper Case"
1090
- msgstr ""
1091
-
1092
- #: /views/blocks/block/tmpl/menu/menu.html.tmpl:42
1093
- msgid "Settings"
1094
- msgstr ""
1095
-
1096
- #: /views/blocks/block/tmpl/menu/menu.html.tmpl:48
1097
- msgid "Status Bar"
1098
- msgstr ""
1099
-
1100
- #: /views/blocks/block/tmpl/templates/editor-toolbox.html.tmpl:12
1101
- msgid "Switch Editor Theme"
1102
- msgstr ""
1103
-
1104
- #: /views/blocks/block/tmpl/templates/editor-toolbox.html.tmpl:13
1105
- msgid "Increase font size in code editor"
1106
- msgstr ""
1107
-
1108
- #: /views/blocks/block/tmpl/templates/editor-toolbox.html.tmpl:14
1109
- msgid "Decrease font size in code editor"
1110
- msgstr ""
1111
-
1112
- #: /views/blocks/block/tmpl/templates/editor-toolbox.html.tmpl:15
1113
- msgid "Reset font size in code editor"
1114
- msgstr ""
1115
-
1116
- #: /views/blocks/block/tmpl/templates/editor-toolbox.html.tmpl:16
1117
- msgid ""
1118
- "Clear all text in code editor. To undo, click Command-Z for Mac or Ctrl-Z "
1119
- "for Windows. Click Save to permanently take affect"
1120
- msgstr ""
1121
-
1122
- #: /views/blocks/block/tmpl/templates/toolbox.html.tmpl:12
1123
- msgid "Template Lookup - Embed or link templates to code blocks"
1124
- msgstr ""
1125
-
1126
- #: /views/blocks/block/tmpl/templates/toolbox.html.tmpl:15
1127
- msgid "Link external"
1128
- msgstr ""
1129
-
1130
- #: /views/blocks/block/tmpl/templates/toolbox.html.tmpl:17
1131
- msgid "Show code block information"
1132
- msgstr ""
1133
-
1134
- #: /views/blocks/block/tmpl/templates/toolbox.html.tmpl:19
1135
- msgid "Set editing language for syntax highlighting"
1136
- msgstr ""
1137
-
1138
- #: /views/blocks/block/tmpl/templates/toolbox.html.tmpl:21
1139
- msgid "Set editing language to CSS"
1140
- msgstr ""
1141
-
1142
- #: /views/blocks/block/tmpl/templates/toolbox.html.tmpl:21
1143
- msgid "Cascading Style Sheets"
1144
- msgstr ""
1145
-
1146
- #: /views/blocks/block/tmpl/templates/toolbox.html.tmpl:22
1147
- msgid "Set editing language to HTML"
1148
- msgstr ""
1149
-
1150
- #: /views/blocks/block/tmpl/templates/toolbox.html.tmpl:22
1151
- msgid "Hyper Text Markup Language"
1152
- msgstr ""
1153
-
1154
- #: /views/blocks/block/tmpl/templates/toolbox.html.tmpl:23
1155
- msgid "Set editing language to JavaScript"
1156
- msgstr ""
1157
-
1158
- #: /views/blocks/block/tmpl/templates/toolbox.html.tmpl:24
1159
- msgid "Set editing language to PHP"
1160
- msgstr ""
1161
-
1162
- #: /views/blocks/block/tmpl/templates/toolbox.html.tmpl:24
1163
- msgid "PHP: Hypertext Preprocessor"
1164
- msgstr ""
1165
-
1166
- #: /views/blocks/block/tmpl/templates/toolbox.html.tmpl:27
1167
- msgid "Edit code block title. Click Save to take affect"
1168
- msgstr ""
1169
-
1170
- #: /views/blocks/block/tmpl/templates/toolbox.html.tmpl:28
1171
- msgid "View and restore code block revisions"
1172
- msgstr ""
1173
-
1174
- #: /views/blocks/block/tmpl/templates/toolbox.html.tmpl:29
1175
- msgid "Delete code block"
1176
- msgstr ""
1177
-
1178
- #: /views/blocks/block/tmpl/templates/toolbox.html.tmpl:35
1179
- msgid "Save changes to code block"
1180
- msgstr ""
1181
-
1182
- #: /views/blocks/cjt-block/tmpl/templates/assign-panel/default.html.tmpl:7
1183
- msgid "Pages"
1184
- msgstr ""
1185
-
1186
- #: /views/blocks/cjt-block/tmpl/templates/assign-panel/default.html.tmpl:14
1187
- msgid "Posts"
1188
- msgstr ""
1189
-
1190
- #: /views/blocks/cjt-block/tmpl/templates/assign-panel/default.html.tmpl:21
1191
- msgid "Custom Posts"
1192
- msgstr ""
1193
-
1194
- #: /views/blocks/cjt-block/tmpl/templates/assign-panel/default.html.tmpl:25
1195
- msgid "Categories"
1196
- msgstr ""
1197
-
1198
- #: /views/blocks/cjt-block/tmpl/templates/assign-panel/default.html.tmpl:32
1199
- msgid "Auxiliary"
1200
- msgstr ""
1201
-
1202
- #: /views/blocks/cjt-block/tmpl/templates/assign-panel/default.html.tmpl:39
1203
- msgid "Advanced"
1204
- msgstr ""
1205
-
1206
- #: /views/blocks/cjt-block/tmpl/templates/assign-panel/templates/advanced.html.tmpl:2
1207
- msgid "One URL per line"
1208
- msgstr ""
1209
-
1210
- #: /views/blocks/cjt-block/tmpl/templates/assign-panel/templates/advanced.html.tmpl:2
1211
- msgid "URLs"
1212
- msgstr ""
1213
-
1214
- #: /views/blocks/cjt-block/tmpl/templates/assign-panel/templates/advanced.html.tmpl:6
1215
- msgid "One Expression per line"
1216
- msgstr ""
1217
-
1218
- #: /views/blocks/cjt-block/tmpl/templates/assign-panel/templates/advanced.html.tmpl:6
1219
- msgid "Expressions"
1220
- msgstr ""
1221
-
1222
- #: /views/blocks/cjt-block/tmpl/templates/assign-panel/templates/auxiliarity.html.tmpl:6
1223
- msgid "Front Page"
1224
- msgstr ""
1225
-
1226
- #: /views/blocks/cjt-block/tmpl/templates/assign-panel/templates/custom-posts.html.tmpl:49
1227
- msgid "There are no Custom Posts Defined yet!"
1228
- msgstr ""
1229
-
1230
- #: /views/blocks/cjt-block/tmpl/templates/assign-panel/templates/tab.html.tmpl:34
1231
- msgid "Assigned"
1232
- msgstr ""
1233
-
1234
- #: /views/blocks/cjt-block/tmpl/templates/assign-panel/templates/tab.html.tmpl:35
1235
- #: /views/templates/lookup/tmpl/default.html.tmpl:65
1236
- msgid "All"
1237
- msgstr ""
1238
-
1239
- #: /views/blocks/create-metabox/tmpl/create.html.tmpl:22
1240
- msgid "Would you like to create a new CJT block for this post?"
1241
- msgstr ""
1242
-
1243
- #: /views/blocks/create-metabox/tmpl/create.html.tmpl:23
1244
- msgid ""
1245
- "In order to increase performance while navigating the post pages and for "
1246
- "saving database records we're not creating CJT code block for any post until "
1247
- "you really need to do!"
1248
- msgstr ""
1249
-
1250
- #: /views/blocks/create-metabox/tmpl/create.html.tmpl:24
1251
- msgid "Click"
1252
- msgstr ""
1253
-
1254
- #: /views/blocks/create-metabox/tmpl/create.html.tmpl:24
1255
- #: /views/blocks/new/tmpl/default.html.tmpl:67
1256
- msgid "Create"
1257
- msgstr ""
1258
-
1259
- #: /views/blocks/create-metabox/tmpl/create.html.tmpl:24
1260
- msgid ""
1261
- "to create CJT code block for current post and utilize from all features "
1262
- "found in the CJT management page!"
1263
- msgstr ""
1264
-
1265
- #: /views/blocks/info/tmpl/default.html.tmpl:8
1266
- msgid "Shortcode"
1267
- msgstr ""
1268
-
1269
- #: /views/blocks/manager/tmpl/blocks.html.tmpl:13
1270
- msgid "CSS & Javascript Toolbox Pro"
1271
- msgstr ""
1272
-
1273
- #: /views/blocks/manager/tmpl/blocks.html.tmpl:16
1274
- msgid "Support Forum"
1275
- msgstr ""
1276
-
1277
- #: /views/blocks/manager/tmpl/blocks.html.tmpl:17
1278
- msgid "Online Documentation"
1279
- msgstr ""
1280
-
1281
- #: /views/blocks/manager/tmpl/blocks.html.tmpl:29
1282
- msgid ""
1283
- "You have now restored the code blocks from the current backup. Nothing is "
1284
- "saved until you click \"Restore\" button. To revert back to the previous "
1285
- "code blocks and discard this action, simply click the \"Cancel Restore\" "
1286
- "button."
1287
- msgstr ""
1288
-
1289
- #: /views/blocks/manager/tmpl/toolbox.html.tmpl:3
1290
- msgid "Add new code block"
1291
- msgstr ""
1292
-
1293
- #: /views/blocks/manager/tmpl/toolbox.html.tmpl:3
1294
- msgid "New Code Block"
1295
- msgstr ""
1296
-
1297
- #: /views/blocks/manager/tmpl/toolbox.html.tmpl:4
1298
- msgid "Save changes to all code blocks"
1299
- msgstr ""
1300
-
1301
- #: /views/blocks/manager/tmpl/toolbox.html.tmpl:4
1302
- msgid "Save All Changes"
1303
- msgstr ""
1304
-
1305
- #: /views/blocks/manager/tmpl/toolbox.html.tmpl:5
1306
- msgid "Cancel backup restoring"
1307
- msgstr ""
1308
-
1309
- #: /views/blocks/manager/tmpl/toolbox.html.tmpl:5
1310
- msgid "Cancel Restore"
1311
- msgstr ""
1312
-
1313
- #: /views/blocks/manager/tmpl/toolbox.html.tmpl:6
1314
- msgid "Save restored Backup"
1315
- msgstr ""
1316
-
1317
- #: /views/blocks/manager/tmpl/toolbox.html.tmpl:6
1318
- #: /views/blocks/revisions/tmpl/default.html.tmpl:27
1319
- msgid "Restore"
1320
- msgstr ""
1321
-
1322
- #: /views/blocks/manager/tmpl/toolbox.html.tmpl:9
1323
- msgid "Tools for block state (batch)"
1324
- msgstr ""
1325
-
1326
- #: /views/blocks/manager/tmpl/toolbox.html.tmpl:11
1327
- msgid "Activate (turn on) all code blocks"
1328
- msgstr ""
1329
-
1330
- #: /views/blocks/manager/tmpl/toolbox.html.tmpl:11
1331
- msgid "Activate All"
1332
- msgstr ""
1333
-
1334
- #: /views/blocks/manager/tmpl/toolbox.html.tmpl:13
1335
- msgid "Deactivate (turn off) all code blocks"
1336
- msgstr ""
1337
-
1338
- #: /views/blocks/manager/tmpl/toolbox.html.tmpl:13
1339
- msgid "Deactivate All"
1340
- msgstr ""
1341
-
1342
- #: /views/blocks/manager/tmpl/toolbox.html.tmpl:15
1343
- msgid "Switch current state for all code blocks"
1344
- msgstr ""
1345
-
1346
- #: /views/blocks/manager/tmpl/toolbox.html.tmpl:15
1347
- msgid "Revert State"
1348
- msgstr ""
1349
-
1350
- #: /views/blocks/manager/tmpl/toolbox.html.tmpl:18
1351
- msgid "Tools for location hook (batch)"
1352
- msgstr ""
1353
-
1354
- #: /views/blocks/manager/tmpl/toolbox.html.tmpl:20
1355
- msgid "Set output location hook to footer for all code blocks"
1356
- msgstr ""
1357
-
1358
- #: /views/blocks/manager/tmpl/toolbox.html.tmpl:20
1359
- msgid "Footer all"
1360
- msgstr ""
1361
-
1362
- #: /views/blocks/manager/tmpl/toolbox.html.tmpl:22
1363
- msgid "Set output location hook to header for all code blocks"
1364
- msgstr ""
1365
-
1366
- #: /views/blocks/manager/tmpl/toolbox.html.tmpl:22
1367
- msgid "Header all"
1368
- msgstr ""
1369
-
1370
- #: /views/blocks/manager/tmpl/toolbox.html.tmpl:26
1371
- msgid "Code Template Manager"
1372
- msgstr ""
1373
-
1374
- #: /views/blocks/manager/tmpl/toolbox.html.tmpl:29
1375
- msgid "Tools for block cleanup and backup"
1376
- msgstr ""
1377
-
1378
- #: /views/blocks/manager/tmpl/toolbox.html.tmpl:31
1379
- msgid "Delete all code blocks"
1380
- msgstr ""
1381
-
1382
- #: /views/blocks/manager/tmpl/toolbox.html.tmpl:31
1383
- msgid "Delete all"
1384
- msgstr ""
1385
-
1386
- #: /views/blocks/manager/tmpl/toolbox.html.tmpl:33
1387
- msgid "Delete only empty code blocks"
1388
- msgstr ""
1389
-
1390
- #: /views/blocks/manager/tmpl/toolbox.html.tmpl:33
1391
- msgid "Delete Empty"
1392
- msgstr ""
1393
-
1394
- #: /views/blocks/manager/tmpl/toolbox.html.tmpl:35
1395
- msgid "Backup Manager - Create, restore, or delete backups"
1396
- msgstr ""
1397
-
1398
- #: /views/blocks/manager/tmpl/toolbox.html.tmpl:38
1399
- msgid "General plugin settings"
1400
- msgstr ""
1401
-
1402
- #: /views/blocks/manager/tmpl/toolbox.html.tmpl:40
1403
- msgid "Maximise all code blocks"
1404
- msgstr ""
1405
-
1406
- #: /views/blocks/manager/tmpl/toolbox.html.tmpl:41
1407
- msgid "Minimise all code blocks"
1408
- msgstr ""
1409
-
1410
- #: /views/blocks/manager/tmpl/help/intro.html.tmpl:10
1411
- msgid "Welcome to the CSS & JavaScript Toolbox dashboard"
1412
- msgstr ""
1413
-
1414
- #: /views/blocks/manager/tmpl/help/intro.html.tmpl:11
1415
- msgid ""
1416
- "Since you do not have any code blocks active, you can either: create a new "
1417
- "code block or create a new code template."
1418
- msgstr ""
1419
-
1420
- #: /views/blocks/manager/tmpl/help/intro.html.tmpl:12
1421
- msgid "Create a new Code Block"
1422
- msgstr ""
1423
-
1424
- #: /views/blocks/manager/tmpl/help/intro.html.tmpl:13
1425
- msgid ""
1426
- "You can add a new code block by clicking the New Code Block button. Once "
1427
- "your code block has been added, simply choose the editor you wish to work "
1428
- "with and write your code. You can then select if you want your code to run "
1429
- "in the header or the footer of the webpage. Now it's just a matter of "
1430
- "selecting the webpage where you want the code to run on, by using the "
1431
- "Assignment Panel. This panel lets you assign your code block to Pages, "
1432
- "Posts, Categories, URLs, and much more, and you can select as many as you "
1433
- "need. Once you have saved your code block by clicking the Save button (or "
1434
- "Save All Changes button), you can see it in action by refreshing the "
1435
- "assigned webpage."
1436
- msgstr ""
1437
-
1438
- #: /views/blocks/manager/tmpl/help/intro.html.tmpl:14
1439
- msgid "Create a new Code Template"
1440
- msgstr ""
1441
-
1442
- #: /views/blocks/manager/tmpl/help/intro.html.tmpl:15
1443
- msgid ""
1444
- "You can create code templates when you click into the Code Template "
1445
- "Manager. To find this, hover over the icon showing a small cog over pages, "
1446
- "and a tooltip should say Code Template Manager. Press this and if you have "
1447
- "chosen to install the Template Samples, you will notice them sitting in "
1448
- "there ready to be used. If you want to create a code template from scratch, "
1449
- "click the Create Template button. Here you can choose a name for your code "
1450
- "template, select a code language type (i.e. CSS, JavaScript, HTML, PHP), "
1451
- "choose whether the template is in Draft or Published state, and then write "
1452
- "your code. You have other tabs that allow you to write a Description, add "
1453
- "Keywords and Version number, etc. Once you are happy with your code "
1454
- "template, you can click the Save button"
1455
- msgstr ""
1456
-
1457
- #: /views/blocks/manager/tmpl/help/intro.html.tmpl:16
1458
- msgid "Embedding or Linking a Code Templates"
1459
- msgstr ""
1460
-
1461
- #: /views/blocks/manager/tmpl/help/intro.html.tmpl:17
1462
- msgid ""
1463
- "Code Templates can be either embedded or linked into your code blocks. To "
1464
- "see all your code templates, you have to click the Template Lookup icon by "
1465
- "hovering over the icon with the open/closed angled brackets. A popup will "
1466
- "appear showing you code templates in the form of users and they are:"
1467
- msgstr ""
1468
-
1469
- #: /views/blocks/manager/tmpl/help/intro.html.tmpl:19
1470
- msgid "WordPress: default code templates that are packaged with WordPress"
1471
- msgstr ""
1472
-
1473
- #: /views/blocks/manager/tmpl/help/intro.html.tmpl:20
1474
- msgid ""
1475
- "Sample Templates: CJT Sample Templates (depending if Sample Templates were "
1476
- "selected during install)"
1477
- msgstr ""
1478
-
1479
- #: /views/blocks/manager/tmpl/help/intro.html.tmpl:21
1480
- msgid ""
1481
- "Users: code templates created by actual WordPress users and administrators"
1482
- msgstr ""
1483
-
1484
- #: /views/blocks/manager/tmpl/help/intro.html.tmpl:23
1485
- msgid ""
1486
- "You can click on any of the 3 types of users to see all of their code "
1487
- "templates, and you can either embed or link these to code blocks."
1488
- msgstr ""
1489
-
1490
- #: /views/blocks/manager/tmpl/help/intro.html.tmpl:24
1491
- #: /views/templates/lookup/tmpl/default.html.tmpl:38
1492
- msgid "Embed"
1493
- msgstr ""
1494
-
1495
- #: /views/blocks/manager/tmpl/help/intro.html.tmpl:24
1496
- msgid ""
1497
- "embedding a code template will paste the entire template contents into the "
1498
- "code block editor. This can be ideal if you want to do further enhancements "
1499
- "and customisations to the code without permanently changing the base "
1500
- "template."
1501
- msgstr ""
1502
-
1503
- #: /views/blocks/manager/tmpl/help/intro.html.tmpl:25
1504
- msgid ""
1505
- "linking the code template does not actually paste the template into the code "
1506
- "block editor but instead links to it. This is more ideal if you want to "
1507
- "link many code templates to the one code block. There is no need to create "
1508
- "individual code blocks for each."
1509
- msgstr ""
1510
-
1511
- #: /views/blocks/new/tmpl/default.html.tmpl:24
1512
- msgid "Name or title of code block (must be unique and cannot be left blank)"
1513
- msgstr ""
1514
-
1515
- #: /views/blocks/new/tmpl/default.html.tmpl:28
1516
- msgid "Tick the checkbox to Activate (turn on) code block"
1517
- msgstr ""
1518
-
1519
- #: /views/blocks/new/tmpl/default.html.tmpl:32
1520
- msgid "Set location hook for code block output to: Header or Footer"
1521
- msgstr ""
1522
-
1523
- #: /views/blocks/new/tmpl/default.html.tmpl:32
1524
- msgid "Location Hook"
1525
- msgstr ""
1526
-
1527
- #: /views/blocks/new/tmpl/default.html.tmpl:36
1528
- msgid "Header"
1529
- msgstr ""
1530
-
1531
- #: /views/blocks/new/tmpl/default.html.tmpl:37
1532
- msgid "Footer"
1533
- msgstr ""
1534
-
1535
- #: /views/blocks/new/tmpl/default.html.tmpl:48
1536
- msgid "Set initial code block position to: First Block or Last Block"
1537
- msgstr ""
1538
-
1539
- #: /views/blocks/new/tmpl/default.html.tmpl:48
1540
- msgid "Initial Block Position"
1541
- msgstr ""
1542
-
1543
- #: /views/blocks/new/tmpl/default.html.tmpl:53
1544
- msgid "First Block"
1545
- msgstr ""
1546
-
1547
- #: /views/blocks/new/tmpl/default.html.tmpl:54
1548
- msgid "Last Block"
1549
- msgstr ""
1550
-
1551
- #: /views/blocks/new/tmpl/default.html.tmpl:66
1552
- #: /views/templates/template/tmpl/default.html.tmpl:15
1553
- msgid "Cancel"
1554
- msgstr ""
1555
-
1556
- #: /views/blocks/revisions/tmpl/default.html.tmpl:19
1557
- msgid "No revisions!"
1558
- msgstr ""
1559
-
1560
- #: /views/blocks/revisions/tmpl/default.html.tmpl:26
1561
- msgid "by"
1562
- msgstr ""
1563
-
1564
- #: /views/installer/install/tmpl/default.html.tmpl:24
1565
- msgid ""
1566
- "In order to start using CJT Plugin you need first to install the Plugin."
1567
- msgstr ""
1568
-
1569
- #: /views/installer/install/tmpl/default.html.tmpl:25
1570
- msgid ""
1571
- "The installation process will create CJT database tables, build-it Database "
1572
- "records."
1573
- msgstr ""
1574
-
1575
- #: /views/installer/install/tmpl/default.html.tmpl:26
1576
- msgid "Check for previous version and if the upgrade process is needed."
1577
- msgstr ""
1578
-
1579
- #: /views/installer/install/tmpl/default.html.tmpl:27
1580
- msgid ""
1581
- "The Plugin is in disable state untill the installation process took place!"
1582
- msgstr ""
1583
-
1584
- #: /views/installer/install/tmpl/default.html.tmpl:28
1585
- msgid ""
1586
- "To utilize from the CJT functionality you must install the Plugin first!!"
1587
- msgstr ""
1588
-
1589
- #: /views/installer/install/tmpl/default.html.tmpl:30
1590
- msgid "Installing Version "
1591
- msgstr ""
1592
-
1593
- #: /views/installer/install/tmpl/default.html.tmpl:31
1594
- msgid ""
1595
- "When you install a new version of CJT for the first time or even upgrading "
1596
- "from old versions, a number of processes will happen, which will take "
1597
- "approximately 1 to 2 minutes. These processes include"
1598
- msgstr ""
1599
-
1600
- #: /views/installer/install/tmpl/default.html.tmpl:38
1601
- msgid "Create database tables."
1602
- msgstr ""
1603
-
1604
- #: /views/installer/install/tmpl/default.html.tmpl:39
1605
- msgid ""
1606
- "Creating file system directories (e.g wp-content/cjt-content/templates)."
1607
- msgstr ""
1608
-
1609
- #: /views/installer/install/tmpl/default.html.tmpl:40
1610
- msgid "Add CJT built-in authors used by templates system."
1611
- msgstr ""
1612
-
1613
- #: /views/installer/install/tmpl/default.html.tmpl:41
1614
- msgid ""
1615
- "Add Wordpress built-in scripts and styles as CJT Templates so it can be used "
1616
- "throught Templates Lookup form."
1617
- msgstr ""
1618
-
1619
- #: /views/installer/install/tmpl/default.html.tmpl:42
1620
- msgid "Finalize Installation."
1621
- msgstr ""
1622
-
1623
- #: /views/installer/install/tmpl/upgrade.html.tmpl:13
1624
- msgid "Upgrading CJT Plugin"
1625
- msgstr ""
1626
-
1627
- #: /views/installer/install/tmpl/upgrade.html.tmpl:14
1628
- msgid ""
1629
- "Please wait while we upgrading CJT Plugin installation! This process would "
1630
- "take only a few seconds!"
1631
- msgstr ""
1632
-
1633
- #: /views/installer/install/tmpl/upgrade.html.tmpl:15
1634
- msgid ""
1635
- "Its highly recommended to Backup your database before processing upgrade."
1636
- msgstr ""
1637
-
1638
- #: /views/installer/install/tmpl/upgrade.html.tmpl:17
1639
- msgid "Upgrade"
1640
- msgstr ""
1641
-
1642
- #: /views/installer/install/tmpl/upgrades/upgrade.html.tmpl:10
1643
- msgid "Upgrading Plugin"
1644
- msgstr ""
1645
-
1646
- #: /views/installer/install/tmpl/upgrades/upgrade.html.tmpl:11
1647
- msgid ""
1648
- "The upgrade process time estimation cannot be preditected because its based "
1649
- "on the amount of data (blocks + other data) you've created."
1650
- msgstr ""
1651
-
1652
- #: /views/installer/install/tmpl/upgrades/upgrade.html.tmpl:12
1653
- msgid ""
1654
- "Important Note: It is highly recommended to upgrade the plugin using the "
1655
- "same administrator or user that was used to manage the code blocks. This "
1656
- "allows the upgrade system to obtain the code blocks 'ORDER' from the current "
1657
- "logged in administrators or users' meta data."
1658
- msgstr ""
1659
-
1660
- #: /views/installer/install/tmpl/upgrades/upgrade.html.tmpl:20
1661
- msgid "Finalize Upgrade."
1662
- msgstr ""
1663
-
1664
- #: /views/installer/notice/tmpl/default.html.tmpl:12
1665
- msgid ""
1666
- "CJT Plugin has been installed throught Wordpress Plugins manager page. In "
1667
- "order for CJT Plugin to work correctly you must install it throught"
1668
- msgstr ""
1669
-
1670
- #: /views/installer/notice/tmpl/default.html.tmpl:13
1671
- msgid "CJT-Instalaltion page."
1672
- msgstr ""
1673
-
1674
- #: /views/installer/notice/tmpl/default.html.tmpl:16
1675
- msgid "Please or you can go to the installation page directly through the"
1676
- msgstr ""
1677
-
1678
- #: /views/installer/notice/tmpl/default.html.tmpl:17
1679
- msgid "CSS & Javascript Toolbox page."
1680
- msgstr ""
1681
-
1682
- #: /views/installer/notice/tmpl/default.html.tmpl:19
1683
- msgid "Dismiss"
1684
- msgstr ""
1685
-
1686
- #: /views/packages/install/tmpl/default.html.tmpl:24
1687
- msgid "Package File"
1688
- msgstr ""
1689
-
1690
- #: /views/packages/install/tmpl/default.html.tmpl:28
1691
- msgid "Install"
1692
- msgstr ""
1693
-
1694
- #: /views/packages/manager/tmpl/default.html.tmpl:15
1695
- msgid "Install Package"
1696
- msgstr ""
1697
-
1698
- #: /views/packages/raw-file/tmpl/default.html.tmpl:11
1699
- msgid "Package file - Raw Viewer"
1700
- msgstr ""
1701
-
1702
- #: /views/settings/manager/tmpl/pages/metabox.html.tmpl:12
1703
- msgid "Registered Post Types"
1704
- msgstr ""
1705
-
1706
- #: /views/settings/manager/tmpl/pages/uninstall.html.tmpl:7
1707
- msgid "Wipe out data!"
1708
- msgstr ""
1709
-
1710
- #: /views/setup/activation-form/tmpl/default.html.tmpl:25
1711
- msgid "License Key"
1712
- msgstr ""
1713
-
1714
- #: /views/setup/activation-form/tmpl/default.html.tmpl:27
1715
- msgid ""
1716
- "In order to get the benefits from the premium services we provide you've to "
1717
- "obtain your license key from"
1718
- msgstr ""
1719
-
1720
- #: /views/setup/activation-form/tmpl/default.html.tmpl:28
1721
- msgid "web site"
1722
- msgstr ""
1723
-
1724
- #: /views/setup/activation-form/tmpl/default.html.tmpl:32
1725
- msgid "Your Name"
1726
- msgstr ""
1727
-
1728
- #: /views/setup/activation-form/tmpl/default.html.tmpl:37
1729
- msgid "Key"
1730
- msgstr ""
1731
-
1732
- #: /views/setup/activation-form/tmpl/default.html.tmpl:46
1733
- msgid "Check"
1734
- msgstr ""
1735
-
1736
- #: /views/templates/info/tmpl/default.html.tmpl:8
1737
- msgid "Creation Date"
1738
- msgstr ""
1739
-
1740
- #: /views/templates/info/tmpl/default.html.tmpl:10
1741
- msgid "Last Revision Comment"
1742
- msgstr ""
1743
-
1744
- #: /views/templates/info/tmpl/default.html.tmpl:13
1745
- msgid "About"
1746
- msgstr ""
1747
-
1748
- #: /views/templates/info/tmpl/default.html.tmpl:18
1749
- #: /views/templates/template/tmpl/default.html.tmpl:66
1750
- msgid "Keywords"
1751
- msgstr ""
1752
-
1753
- #: /views/templates/lookup/tmpl/default.html.tmpl:32
1754
- msgid "User"
1755
- msgstr ""
1756
-
1757
- #: /views/templates/lookup/tmpl/default.html.tmpl:61
1758
- msgid "Show"
1759
- msgstr ""
1760
-
1761
- #: /views/templates/lookup/tmpl/default.html.tmpl:63
1762
- msgid "Linked"
1763
- msgstr ""
1764
-
1765
- #: /views/templates/lookup/tmpl/default.html.tmpl:64
1766
- msgid "Unlinked"
1767
- msgstr ""
1768
-
1769
- #: /views/templates/lookup/tmpl/default.html.tmpl:69
1770
- msgid "Unlink All"
1771
- msgstr ""
1772
-
1773
- #: /views/templates/manager/tmpl/default.html.tmpl:25
1774
- msgid "Create Template"
1775
- msgstr ""
1776
-
1777
- #: /views/templates/template/tmpl/default.html.tmpl:16
1778
- msgid "Update"
1779
- msgstr ""
1780
-
1781
- #: /views/templates/template/tmpl/default.html.tmpl:37
1782
- msgid "Main"
1783
- msgstr ""
1784
-
1785
- #: /views/templates/template/tmpl/default.html.tmpl:44
1786
- msgid "Name or title of template (must be unique and cannot be left blank)"
1787
- msgstr ""
1788
-
1789
- #: /views/templates/template/tmpl/default.html.tmpl:46
1790
- msgid ""
1791
- "Set the code language to: CSS, JavaScript, HTML, or PHP (selection must be "
1792
- "made)"
1793
- msgstr ""
1794
-
1795
- #: /views/templates/template/tmpl/default.html.tmpl:46
1796
- msgid "Language"
1797
- msgstr ""
1798
-
1799
- #: /views/templates/template/tmpl/default.html.tmpl:47
1800
- msgid "< Select Type >"
1801
- msgstr ""
1802
-
1803
- #: /views/templates/template/tmpl/default.html.tmpl:50
1804
- msgid ""
1805
- "Set the template state to: Published, Draft, or Trash (selection must be "
1806
- "made)"
1807
- msgstr ""
1808
-
1809
- #: /views/templates/template/tmpl/default.html.tmpl:50
1810
- msgid "Template State"
1811
- msgstr ""
1812
-
1813
- #: /views/templates/template/tmpl/default.html.tmpl:51
1814
- #: /views/templates/template/tmpl/default.html.tmpl:76
1815
- msgid "< Select State >"
1816
- msgstr ""
1817
-
1818
- #: /views/templates/template/tmpl/default.html.tmpl:54
1819
- msgid ""
1820
- "Enter code for the template in the large text field and click Save when done"
1821
- msgstr ""
1822
-
1823
- #: /views/templates/template/tmpl/default.html.tmpl:54
1824
- msgid "Code"
1825
- msgstr ""
1826
-
1827
- #: /views/templates/template/tmpl/default.html.tmpl:65
1828
- msgid ""
1829
- "Enter a descriptive write-up for the template describing what it is, and how "
1830
- "it works, etc "
1831
- msgstr ""
1832
-
1833
- #: /views/templates/template/tmpl/default.html.tmpl:66
1834
- msgid ""
1835
- "Enter strong keywords for the template - each being separated by a comma"
1836
- msgstr ""
1837
-
1838
- #: /views/templates/template/tmpl/default.html.tmpl:73
1839
- msgid "Enter the specific version for the template (e.g. 1.0)"
1840
- msgstr ""
1841
-
1842
- #: /views/templates/template/tmpl/default.html.tmpl:75
1843
- msgid ""
1844
- "Set the release state to: Release, Beta, Alpha, Release Candidate, or "
1845
- "Revision"
1846
- msgstr ""
1847
-
1848
- #: /views/templates/template/tmpl/default.html.tmpl:78
1849
- msgid ""
1850
- "Add any notes such as stability issues, bug fixes, or anything that can be "
1851
- "useful for future development"
1852
- msgstr ""
1853
-
1854
- #: /views/templates/template/tmpl/default.html.tmpl:78
1855
- msgid "Revision note"
1856
- msgstr ""
1857
-
1858
- #: /views/tinymce/params/tmpl/default.html.tmpl:30
1859
- msgid "Done"
1860
- msgstr ""
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: CSS & Javascript Toolbox V6\n"
4
+ "POT-Creation-Date: 2015-11-19 20:53+0200\n"
5
+ "PO-Revision-Date: 2015-11-19 20:53+0200\n"
6
+ "Last-Translator: CJT Team <support@css-javascript-toolbox.com>\n"
7
  "Language-Team: CJT <development@css-javascript-toolbox.com>\n"
8
  "Language: English\n"
9
  "MIME-Version: 1.0\n"
15
  "X-Poedit-SourceCharset: UTF-8\n"
16
  "X-Poedit-SearchPath-0: "
17
 
18
+ #: /access.points/dashboardmetabox.accesspoint.php:31
 
 
 
19
  #: /access.points/manage.accesspoint.php:44
20
  #: /access.points/manage.accesspoint.php:45
 
21
  msgid "CSS & Javascript Toolbox"
22
  msgstr ""
23
 
24
+ #: /access.points/extensions.accesspoint.php:53
25
+ msgid "Extensions"
26
+ msgstr ""
27
+
28
  #: /access.points/packages.accesspoint.php:45
29
  msgid "CJT Manage - Packages"
30
  msgstr ""
33
  msgid "Packages"
34
  msgstr ""
35
 
 
 
 
 
 
 
 
 
 
36
  #: /controllers/metabox.php:57
37
  #, php-format
38
  msgid "CJT Block - Post #%d"
44
  msgstr ""
45
 
46
  #: /controllers/templates-lookup.php:81
 
47
  msgid "Unlink"
48
  msgstr ""
49
 
50
  #: /controllers/templates-lookup.php:99
51
  #: /controllers/templates-lookup.php:115
 
 
52
  msgid "Link"
53
  msgstr ""
54
 
71
  "Invalid Shortcode parameter(s) has been passed! Please check parameters name."
72
  msgstr ""
73
 
74
+ #: /framework/extensions/extensions.class.php:290
75
+ msgid ""
76
+ "Extension is required CJT Framework Version higher than currently installed, "
77
+ "CJT need to get updated!!!"
78
+ msgstr ""
79
+
80
+ #: /framework/extensions/extensions.class.php:291
81
+ msgid "Aborted"
82
+ msgstr ""
83
+
84
+ #: /framework/extensions/extensions.class.php:298
85
+ msgid ""
86
+ "Extension is required old CJT Framework Version than the installed. This "
87
+ "extension might need to get update. Please check if this extension is "
88
+ "currently behaving correctly!!!"
89
+ msgstr ""
90
+
91
+ #: /framework/extensions/extensions.class.php:299
92
+ msgid "Ignored"
93
+ msgstr ""
94
+
95
+ #: /framework/extensions/extensions.class.php:366
96
  msgid ""
97
+ "CJT detects incompatible installed extensions, listed below with status "
98
+ "message for every extension:"
 
 
 
 
 
 
99
  msgstr ""
100
 
101
  #: /framework/js/ajax/cjt-server/cjt-server.localization.php:13
179
 
180
  #: /locals/strings.inc.php:21
181
  #: /models/fields/template-types.php:21
 
182
  msgid "javascript"
183
  msgstr "Javascript"
184
 
197
  msgid "php"
198
  msgstr "PHP"
199
 
 
 
 
 
200
  #: /models/block/assignmentpanel/helpers/auxiliary.php:25
201
  msgid "Blog Index"
202
  msgstr ""
257
  msgid "Would you like to delete \"{BACKUP-NAME}\" backup?"
258
  msgstr ""
259
 
260
+ #: /views/blocks/block/view.php:139
261
  msgid "Click to update Block name"
262
  msgstr ""
263
 
312
  msgstr ""
313
 
314
  #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:21
 
 
 
 
 
 
 
 
315
  msgid ""
316
  "Please enter a list of the external URLs you want to link separated by comma!"
317
  msgstr ""
318
 
319
+ #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:22
320
  msgid "Couldn't link the externals URI you requested!! Reason:"
321
  msgstr ""
322
 
323
+ #: /views/blocks/block/public/js/jquery.block/jquery.block.localization.php:23
324
  msgid "Loading"
325
  msgstr ""
326
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
327
  #: /views/blocks/cjt-block/public/js/jquery.block/jquery.block.localization.php:13
 
 
 
 
 
 
 
 
328
  msgid ""
329
  "Changes has been made to the assignment objects. Switching display mode "
330
  "would reset all those changes as it never made. Would you like to discard "
344
  msgstr ""
345
 
346
  #: /views/blocks/manager/public/js/blocks-page/blocks-page.localization.php:15
 
347
  msgid "Backups"
348
  msgstr ""
349
 
364
  msgstr ""
365
 
366
  #: /views/blocks/manager/public/js/blocks-page/blocks-page.localization.php:19
 
 
 
 
 
 
 
 
 
 
 
 
 
367
  msgid "The changes you made will be lost if you navigate away from this page."
368
  msgstr ""
369
 
 
 
 
 
370
  #: /views/blocks/metabox/public/js/jquery.block/jquery.block.localization.php:12
371
  msgid "Preview Post/Page in a new window"
372
  msgstr ""
426
  #: /views/packages/manager/helpers/wp-list-table.inc.php:79
427
  #: /views/templates/manager/helpers/wp-list-table.inc.php:59
428
  #: /views/templates/manager/helpers/wp-list-table.inc.php:131
 
 
429
  msgid "Delete"
430
  msgstr ""
431
 
432
  #: /views/packages/manager/helpers/wp-list-table.inc.php:59
 
433
  msgid "View"
434
  msgstr ""
435
 
440
 
441
  #: /views/packages/manager/helpers/wp-list-table.inc.php:98
442
  #: /views/templates/manager/helpers/wp-list-table.inc.php:153
 
 
 
 
 
443
  msgid "Name"
444
  msgstr ""
445
 
446
  #: /views/packages/manager/helpers/wp-list-table.inc.php:99
447
  #: /views/templates/manager/helpers/wp-list-table.inc.php:157
 
 
448
  msgid "Author"
449
  msgstr ""
450
 
461
  msgstr ""
462
 
463
  #: /views/packages/manager/helpers/wp-list-table.inc.php:103
 
 
464
  msgid "ID"
465
  msgstr ""
466
 
515
  msgstr ""
516
 
517
  #: /views/setup/activation-form/public/js/default/default.localization.php:19
 
518
  msgid "Activate"
519
  msgstr ""
520
 
639
  msgstr ""
640
 
641
  #: /views/setup/activation-form/public/js/default/default.localization.php:58
642
+ msgid "Component name is absolute!"
643
  msgstr ""
644
 
645
  #: /views/templates/lookup/public/js/lookup/lookup.localization.php:15
655
  msgstr ""
656
 
657
  #: /views/templates/manager/helpers/wp-list-table.inc.php:55
 
658
  msgid "Info"
659
  msgstr ""
660
 
661
  #: /views/templates/manager/helpers/wp-list-table.inc.php:56
 
 
 
662
  msgid "Edit"
663
  msgstr ""
664
 
665
  #: /views/templates/manager/helpers/wp-list-table.inc.php:154
 
 
666
  msgid "Type"
667
  msgstr ""
668
 
669
  #: /views/templates/manager/helpers/wp-list-table.inc.php:155
 
 
 
670
  msgid "Version"
671
  msgstr ""
672
 
675
  msgstr ""
676
 
677
  #: /views/templates/manager/helpers/wp-list-table.inc.php:158
 
678
  msgid "Date Created"
679
  msgstr ""
680
 
681
  #: /views/templates/manager/helpers/wp-list-table.inc.php:159
 
 
682
  msgid "Last Modified"
683
  msgstr ""
684
 
685
  #: /views/templates/manager/helpers/wp-list-table.inc.php:160
 
686
  msgid "State"
687
  msgstr ""
688
 
724
  "You won't be able to revert the type name once its set! Are you sure would "
725
  "you like to use the selected type?"
726
  msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/block.php CHANGED
@@ -71,6 +71,30 @@ class CJTBlockModel extends CJTModel {
71
  */
72
  const PINS_LINK_EXPRESSION = 0x3000000;
73
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  /**
75
  * Create block object.
76
  *
@@ -78,22 +102,29 @@ class CJTBlockModel extends CJTModel {
78
  * @param array Block data array or null to use default data.
79
  * @return void
80
  */
81
- public function __construct($values = array()) {
82
- $this->properties = array(
83
- 'name' => null,
84
- 'pinPoint' => null,
85
- 'state' => null,
86
- 'location' => null,
87
- 'code' => null,
88
- 'pages' => null,
89
- 'posts' => null,
90
- 'categories' => null,
91
- 'links' => null,
92
- 'expressions' => null,
93
- 'id' => null,
94
- );
 
 
 
 
 
 
 
95
  // Set block properties.
96
- $this->setValues($values);
97
  }
98
 
99
  /**
@@ -102,18 +133,16 @@ class CJTBlockModel extends CJTModel {
102
  * @param string Property name.
103
  * @return mixed Property value.
104
  */
105
- public function __get($property) {
106
- switch ($property) {
107
- case 'pages':
108
- case 'posts':
109
- case 'categories':
110
- $value = ($this->properties[$property] !== null) ? $this->properties[$property] : array();
111
- break;
112
-
113
- default:
114
- $value = $this->properties[$property];
115
- break;
116
- }
117
  return $value;
118
  }
119
 
@@ -124,18 +153,25 @@ class CJTBlockModel extends CJTModel {
124
  * @param mixed Property value.
125
  * @return void
126
  */
127
- public function __set($property, $value) {
128
- switch ($property) {
 
 
129
  case 'code':
 
130
  case 'links':
 
131
  case 'expressions':
 
132
  // New lines submitted to server as CRLF but displayed in browser as LF.
133
  // PHP script and JS work on two different versions of texts.
134
  // Replace CRLF with LF just as displayed in browsers.
135
- $value = preg_replace("/\x0D\x0A/", "\x0A", $value);
 
136
  break;
137
  }
138
- $this->properties[$property] = $value;
 
139
  }
140
 
141
  /**
@@ -143,54 +179,67 @@ class CJTBlockModel extends CJTModel {
143
  *
144
  * @param mixed $blockData
145
  */
146
- public static function arrangePins(& $blockData) {
147
- // Initialize
148
- $pinsGroupNames = array_flip(array('pages', 'posts', 'categories', 'pinPoint'));
 
149
  $dbDriver = cssJSToolbox::getInstance()->getDBDriver();
150
  $mdlBlock = new CJTBlocksModel();
151
- $block = $mdlBlock->getBlock($blockData->id, array(), array('id', 'pinPoint'));
152
- $submittedPins = array_intersect_key(((array) $blockData), $pinsGroupNames);
153
- $assignedPins = array_intersect_key(((array) $block), $pinsGroupNames);
 
154
  // Transfer assigned PinPoint from "FLAGGED INTEGER" TO "ARRAY" like
155
  // the other pins.
156
- $assignedPins['pinPoint'] = array_keys(CJT_Models_Block_Assignmentpanel_Helpers_Auxiliary
157
  ::getInstance()
158
- ->getPinsArray($assignedPins['pinPoint']));
 
159
  // Walk through all assigned pins.
160
  // Unassigned any item with 'value=false'.
161
  // Whenever an item is found on the submitted
162
  // pins it should be removed from the submitted list
163
- foreach ($submittedPins as $groupName => $submittedGroup) {
 
164
  // Get assigned pins group if found
165
- if (!isset($assignedPins[$groupName])) {
 
166
  // Initialize new assigned group array.
167
- $assignedPins[$groupName] = array();
168
  }
169
- // Get assigned group array reference.
170
- $assignedGroup =& $assignedPins[$groupName];
 
171
  // For every submitted item there is three types.
172
  // 1. Already assigned :WHEN: (sync == true and value == true)
173
  // 2. Unassigned :WHEN: (value == false)
174
  // 3. Newly assigned :WHEN: (sync = false).
175
- foreach ($submittedGroup as $submittedPinId => $submittedPin) {
 
176
  // Unassigned pin
177
- if (!$submittedPin['value']) {
 
178
  // Find the submittedPinId AssignedPins index.
179
- $assignedIndex = array_search($submittedPinId, $assignedGroup);
180
  // Unassigned it :REMOVE FROM ARRAY:
181
- unset($assignedGroup[$assignedIndex]);
182
  }
183
- else if (!$submittedPin['sync']) {
 
184
  // Add newly assigned item.
185
  $assignedGroup[] = $submittedPinId;
186
  }
 
187
  }
 
188
  }
 
189
  // Copy all assigned pins back to the block object.
190
- foreach ($assignedPins as $groupName => $finalGroupAssigns) {
191
- // Copy the group back to the block object.
192
  $blockData->{$groupName} = $finalGroupAssigns;
193
  }
 
194
  // Important for caller short-circle condition.
195
  return true;
196
  }
@@ -200,36 +249,55 @@ class CJTBlockModel extends CJTModel {
200
  *
201
  * @deprecated Use calculatePinpoint
202
  */
203
- public static function calculateBlockPinPoint(& $block) {
 
 
204
  // Generate PinPoint Value.
205
- if (isset($block->pinPoint) && is_array($block->pinPoint)) {
 
206
  $pinPoint = 0;
 
207
  // Each item is a bit flag.
208
- foreach ($block->pinPoint as $pin) {
 
209
  $pinPoint |= hexdec($pin);
210
  }
 
211
  }
212
- else {
 
213
  // Provided as integer or not even provided!
214
- if (!isset($block->pinPoint)) {
 
215
  $block->pinPoint = 0;
216
  }
 
217
  $pinPoint = (int) $block->pinPoint;
218
  }
 
219
  // Pin should be set only for not empty properties.
220
- // This help us retreiving only needed blocks when outputing blocks code.
221
- $pins = array(
222
- self::PINS_PAGES_CUSTOM_PAGE => 'pages',
223
- self::PINS_POSTS_CUSTOM_POST => 'posts',
224
- self::PINS_CATEGORIES_CUSTOM_CATEGORY => 'categories',
225
  self::PINS_LINKS => 'links',
226
  self::PINS_EXPRESSIONS => 'expressions',
227
  );
228
- foreach ($pins as $flag => $pin) {
229
- $pinPoint |= abs((int) (!empty($block->{$pin}))) * $flag;
 
 
 
 
 
 
 
 
 
 
230
  }
231
- // Set new pin point.
232
- $block->pinPoint = $pinPoint;
 
233
  return $block;
234
  }
235
 
@@ -239,12 +307,56 @@ class CJTBlockModel extends CJTModel {
239
  * @param mixed $block
240
  * @param mixed $pins
241
  */
242
- public static function calculatePinPoint($block, $pins) {
 
243
  // Add pins to Block object so that calculateBlockPinPoint can calculate PinPoint value!
244
- $block = (object) array_merge($block, $pins);
245
- $pinPoint = self::calculateBlockPinPoint($block)->pinPoint;
246
- // Return only pinPoint.
 
247
  return $pinPoint;
248
  }
249
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
250
  } // End class.
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
87
+ (
88
+ 'name' => array(),
89
+ 'pinPoint' => array(),
90
+ 'state' => array(),
91
+ 'location' => array(),
92
+ 'code' => array(),
93
+ 'links' => array(),
94
+ 'expressions' => array(),
95
+ 'id' => array(),
96
+ );
97
+
98
  /**
99
  * Create block object.
100
  *
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
  /**
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
 
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
  /**
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' ) ) );
186
  $dbDriver = cssJSToolbox::getInstance()->getDBDriver();
187
  $mdlBlock = new CJTBlocksModel();
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
  }
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
281
+ (
 
 
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
 
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.
models/blocks.php CHANGED
@@ -271,6 +271,59 @@ class CJTBlocksModel {
271
  return $this->getAuthorBlockActiveFileId($blockId, get_current_user_id());
272
  }
273
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
274
  /**
275
  * put your comment there...
276
  *
@@ -324,29 +377,45 @@ class CJTBlocksModel {
324
  *
325
  * @param mixed $block
326
  */
327
- public function update($block, $updatePins) {
328
- // To be used by array_intersect_key.
329
- $block = (array) $block;
330
- // Create Tables objects.
331
- $blocks = new CJTBlocksTable($this->dbDriver);
332
- $pins = new CJTBlockPinsTable($this->dbDriver);
 
 
333
  // Update block pins if requested.
334
- if ($updatePins) {
 
335
  // Isolate block pins freom native block data.
336
- $pinsData = array_intersect_key($block, array_flip(array('pages', 'posts', 'categories')));
337
- $pins->update($block['id'], $pinsData);
 
 
 
 
338
  }
 
339
  // Update code file
340
- if (isset($block['activeFileId'])) {
341
- $codeFile = new CJTBlockFilesTable($this->dbDriver);
342
- $codeFile->set('blockId', $block['id'])
343
- ->set('id', $block['activeFileId'])
344
- ->set('code', $block['code'])
 
 
 
345
  ->save();
346
  }
 
347
  // Isolate block fields.
348
  $blockData = array_intersect_key($block, $blocks->getFields());
349
- $blocks->update($blockData);
 
 
 
 
350
  }
351
 
352
  } // End class.
271
  return $this->getAuthorBlockActiveFileId($blockId, get_current_user_id());
272
  }
273
 
274
+ /**
275
+ * put your comment there...
276
+ *
277
+ */
278
+ public static function getCustomPostTypes()
279
+ {
280
+
281
+ static $postTypes = null;
282
+
283
+ if ( $postTypes !== null )
284
+ {
285
+ return $postTypes;
286
+ }
287
+
288
+
289
+ $postTypes = array();
290
+
291
+ // Create tabs for every custom post under the custom posts tab.
292
+ // Get all registered custom posts.
293
+ $customPosts = get_post_types( array( 'public' => 1, 'show_ui' => true, '_builtin' => false ), 'objects' );
294
+
295
+ // Add tab for every custom post
296
+ // Exclude 'Empty' Custom Post Types.
297
+ foreach ( $customPosts as $typeName => $customPost )
298
+ {
299
+ // Check if has posts.
300
+ $hasPosts = count( get_posts( array( 'post_type' => $typeName, 'offset' => 0, 'numberposts' => 1 ) ) );
301
+
302
+ // Add only types with at least one post exists.
303
+ if ( $hasPosts )
304
+ {
305
+ $postTypes[ $typeName ] = array
306
+ (
307
+ 'title' => $customPost->labels->name,
308
+ 'renderer' => 'objects-list',
309
+ 'type' => array
310
+ (
311
+ 'type' => $typeName,
312
+ 'group' => 'posts',
313
+ 'targetType' => 'post'
314
+ )
315
+
316
+ );
317
+
318
+ }
319
+
320
+ }
321
+
322
+ do_action( CJTPluggableHelper::ACTION_BLOCK_CUSTOM_POST_TYPES, $postTypes );
323
+
324
+ return $postTypes;
325
+ }
326
+
327
  /**
328
  * put your comment there...
329
  *
377
  *
378
  * @param mixed $block
379
  */
380
+ public function update( $block, $updatePins )
381
+ {
382
+
383
+ $block = ( array ) $block;
384
+
385
+ $blocks = new CJTBlocksTable( $this->dbDriver );
386
+ $pins = new CJTBlockPinsTable( $this->dbDriver );
387
+
388
  // Update block pins if requested.
389
+ if ( $updatePins )
390
+ {
391
  // Isolate block pins freom native block data.
392
+ $pinsData = array_intersect_key( $block, array_flip( array_keys( CJTBlockModel::getCustomPins() ) ) );
393
+
394
+ do_action( CJTPluggableHelper::FILTER_BLOCK_MODEL_PRE_UPDATE_BLOCK_PINS, $block, $pinsData );
395
+
396
+ $pins->update( $block[ 'id' ], $pinsData );
397
+
398
  }
399
+
400
  // Update code file
401
+ if ( isset( $block[ 'activeFileId' ] ) )
402
+ {
403
+
404
+ $codeFile = new CJTBlockFilesTable( $this->dbDriver );
405
+
406
+ $codeFile->set( 'blockId', $block[ 'id' ] )
407
+ ->set( 'id', $block[ 'activeFileId'] )
408
+ ->set( 'code', $block[ 'code'] )
409
  ->save();
410
  }
411
+
412
  // Isolate block fields.
413
  $blockData = array_intersect_key($block, $blocks->getFields());
414
+
415
+ do_action( CJTPluggableHelper::FILTER_BLOCK_MODEL_PRE_UPDATE_BLOCK, $updatePins, $blockData );
416
+
417
+ $blocks->update( $blockData );
418
+
419
  }
420
 
421
  } // End class.
models/coupling.php CHANGED
@@ -113,31 +113,54 @@ class CJTCouplingModel extends CJTHookableClass {
113
  public function getOrder() {
114
  return $this->ongetorder(get_option('meta-box-order_cjtoolbox'));
115
  }
116
-
117
  /**
118
  * put your comment there...
119
  *
120
  * @param mixed $linksExpressionFlag
121
  * @param mixed $pinPoint
122
  * @param mixed $customPins
 
123
  */
124
- public function getPinsBlocks($linksExpressionFlag, $pinPoint, $customPins) {
 
125
  // Extendable!
126
- extract($this->onpinsblockfilters(compact('linksExpressionFlag', 'pinPoint', 'customPins')));
 
127
  // Import required libraries for CJTPinsBlockSQLView.
128
  require_once CJTOOLBOX_TABLES_PATH . '/pins-blocks-view.php';
 
129
  // Initialize new CJTPinsBlockSQLView view object.
130
- $dbDriver = new CJTMYSQLQueueDriver($GLOBALS['wpdb']);
131
- $view = new CJTPinsBlockSQLView($dbDriver);
 
132
  // Apply filter to view.
133
- $view->filters($pinPoint, $customPins);
 
 
 
 
 
 
 
 
 
 
 
 
134
  // retreiving blocks data associated with current request.
135
- $blocks = $this->onrequestblocks($view->exec());
 
 
 
 
136
  // Get links & expressions Blocks.
137
  // NOTE: We need only blocks not presented in $blocks var -- exclude their id.
138
- $view->filters($linksExpressionFlag, array(), 'active', array_keys($blocks));
 
139
  // We'll process all blocks inside single loop.
140
- $blocks = $blocks + $this->onexpressionsandlinkedblocks($view->exec());
 
141
  return $blocks;
142
  }
143
 
113
  public function getOrder() {
114
  return $this->ongetorder(get_option('meta-box-order_cjtoolbox'));
115
  }
116
+
117
  /**
118
  * put your comment there...
119
  *
120
  * @param mixed $linksExpressionFlag
121
  * @param mixed $pinPoint
122
  * @param mixed $customPins
123
+ * @param mixed $hookParams
124
  */
125
+ public function getPinsBlocks( $linksExpressionFlag, $pinPoint, $customPins, $hookParams )
126
+ {
127
  // Extendable!
128
+ extract( $this->onpinsblockfilters( compact( 'linksExpressionFlag', 'pinPoint', 'customPins' ) ) );
129
+
130
  // Import required libraries for CJTPinsBlockSQLView.
131
  require_once CJTOOLBOX_TABLES_PATH . '/pins-blocks-view.php';
132
+
133
  // Initialize new CJTPinsBlockSQLView view object.
134
+ $dbDriver = new CJTMYSQLQueueDriver( $GLOBALS[ 'wpdb' ] );
135
+ $view = new CJTPinsBlockSQLView( $dbDriver );
136
+
137
  // Apply filter to view.
138
+ $view->filters( $pinPoint, $customPins );
139
+
140
+ # Allow Plugins/Extensions to change block core query
141
+ do_action(
142
+
143
+ CJTPluggableHelper::ACTION_BLOCK_QUERY_BLOCKS,
144
+
145
+ $view,
146
+
147
+ $hookParams
148
+
149
+ );
150
+
151
  // retreiving blocks data associated with current request.
152
+ $blocks = $this->onrequestblocks( $view->exec() );
153
+
154
+ # Filter queue blocks
155
+ $blocks = apply_filters( CJTPluggableHelper::FILTER_BLOCKS_COUPLING_MODEL_BLOCKS_QUEUE, $blocks, $hookParams );
156
+
157
  // Get links & expressions Blocks.
158
  // NOTE: We need only blocks not presented in $blocks var -- exclude their id.
159
+ $view->filters( $linksExpressionFlag, array(), 'active', array_keys( $blocks ) );
160
+
161
  // We'll process all blocks inside single loop.
162
+ $blocks = $blocks + $this->onexpressionsandlinkedblocks( $view->exec() );
163
+
164
  return $blocks;
165
  }
166
 
models/tinymce-blocks.php CHANGED
@@ -9,7 +9,7 @@ defined('ABSPATH') or die('Access denied');
9
  /**
10
  *
11
  */
12
- class CJTTinymceBlocksModel {
13
 
14
  /**
15
  * put your comment there...
9
  /**
10
  *
11
  */
12
+ class CJTTinymceBlocksModel_DEPRECATED {
13
 
14
  /**
15
  * put your comment there...
readme.txt CHANGED
@@ -6,66 +6,38 @@ Tags: post, posts, admin, sidebar, page, pages, widget, image, shortcode, plugin
6
  License: GPLv2 or later
7
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
  Requires at least: 3.9
9
- Tested up to: 4.3
10
- Stable tag: 8.0.4
11
 
12
  Easily add custom CSS, JavaScript, HTML and PHP code to unique CJT code blocks and assign them wherever you want.
13
 
14
  == Description ==
15
- = Update Notice =
16
- After a long hiatus in development, we have decided to focus our entire efforts on our new premium extension plugin called [CSS & JavaScript Toolbox PLUS](http://css-javascript-toolbox.com/css-javascript-toolbox-plus/), which is designed to work with and UPGRADE the free version. Unfortunately we will be moving many features from the free version into the premium.
17
-
18
- = What does this mean? =
19
- For the next update (not this one), we will be removing features from CSS & JavaScript Toolbox Free including:
20
- - Custom Posts
21
- - Categories
22
- - Auxiliary assignments (e.g. entire website, website backend, etc)
23
- - Advanced assignments (i.e. URLs and Expressions)
24
- - Code Files
25
- - Code Templates
26
- - Template Lookup System
27
- - Packages
28
-
29
- If you rely on the features above, then you can do one of two things:
30
 
31
- 1) Stay on [CSS & JavaScript Toolbox Free v8.0.3](https://downloads.wordpress.org/plugin/css-javascript-toolbox.8.0.3.zip), and when the next update arrives, DO NOT UPDATE!!!
 
32
 
33
- OR
 
34
 
35
- 2) Purchase our premium extension plugin: [CSS & JavaScript Toolbox PLUS](http://css-javascript-toolbox.com/css-javascript-toolbox-plus/)
 
36
 
37
- Of course if you have already updated, you can use FTP to rollback to the earlier version by manually overwriting the css-javascript-toolbox folder with: [CSS & JavaScript Toolbox Free v8.0.3](https://downloads.wordpress.org/plugin/css-javascript-toolbox.8.0.3.zip)
38
 
39
- = Why purchase PLUS? =
40
- [CSS & JavaScript Toolbox PLUS](http://css-javascript-toolbox.com/css-javascript-toolbox-plus/) is our new premium plugin, which will now take up all our time and efforts. It will also contain all of the above features - PLUS these features below:
 
 
41
  - Editor Themes
42
  - Editor Toolbox
43
  - Editor Menu Tools
44
  - Code Auto Completion (CAC)
45
  - Import Export Tool
46
  - Block Widget Linker
47
- - PLUS more
48
-
49
- We intend to give PLUS a complete makeover, including:
50
  - code optimisation and bug fixes
51
  - 100% compatibility with the the latest WordPress
52
- - a faster and more powerful core
53
- - full codebase documentation
54
- - and eventually a brand new flat responsive user interface
55
-
56
- = About the CSS & JavaScript Toolbox Plugin =
57
- CSS & JavaScript Toolbox (or CJT) is a powerful code management plugin that gives you the tools to easily and safely modify or extend the functionality and appearance of your WordPress-powered website.
58
-
59
- = Perfect for WordPress website development =
60
- Whether it be adding free/premium scripts, creating and testing new scripts, streamlining development work, making front-end customisations, or even teaching and learning WordPress – CJT is extremely flexible and versatile.
61
-
62
- = How does it work? =
63
- Since CJT was designed to be easy, adding scripts and styles can be done in as little as two steps.
64
-
65
- - adding your code directly into unique CJT code blocks
66
- - assigning where these code blocks go
67
-
68
- CJT code blocks can be assigned to pages, posts, custom posts, categories, URLs, expressions, and practically anywhere you want on your website. Code block shortcodes can also provide you with further placement accuracy.
69
 
70
  = Support Us =
71
  The CSS & JavaScript Toolbox project is 100% developed and maintained by only two people since the very beginnings in August 2011. We have plenty of feature ideas that we want to introduce and this can only be possible with funding.
@@ -131,7 +103,6 @@ Hook location feature gives you control over the location of outputting the CSS/
131
  Due to the overwhelming amount of emails we get for users requesting support for our CJT plugins, we cannot provide support for the CJT Free plugin (hosted here on WordPress.org) at this stage unfortunately. If you wish to receive priority support, please visit our CJT website and [purchase a license for any of our products](http://css-javascript-toolbox.com/pricing).
132
 
133
  == Screenshots ==
134
-
135
  1. Add your code, then assign where it goes
136
  2. Create New Code Block dialog box
137
  3. Master Admin Toolbar at top, and minimised Code Blocks below
@@ -142,19 +113,23 @@ Due to the overwhelming amount of emails we get for users requesting support for
142
  8. Assigning Categories and sub-categories
143
  9. Auxiliary Assignments
144
  10. Advanced Assignments (URLs and Regular Expressions)
145
- 11. Change State batch tools
146
- 12. Change Location/Hook batch tools
147
  13. Delete and Backup Tools
148
- 14. Code-Files management form (within each Code Block)
149
- 15. Templates Manager form to store all of your Code Templates
150
  16. Templates Lookup form to embed or link Code Templates to Code Blocks
151
- 17. Insert Code Block shortcodes via TinyMCE button
152
  18. Metabox Code Block at the Edit Page/Post level
153
  19. Create backups of all your existing Code Blocks
154
- 20. Create/Restore Code Block revisions
155
- 21. See Code Block information at a glance
156
 
157
  == Changelog ==
 
 
 
 
158
  = 8.0.4 =
159
  * Check Wordpress 4.3 compatibility
160
  * List future deprecated features
6
  License: GPLv2 or later
7
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
  Requires at least: 3.9
9
+ Tested up to: 4.3.1
10
+ Stable tag: 8.1
11
 
12
  Easily add custom CSS, JavaScript, HTML and PHP code to unique CJT code blocks and assign them wherever you want.
13
 
14
  == Description ==
15
+ CSS & JavaScript Toolbox (or CJT) is a powerful code management plugin that gives you the tools to easily and safely modify or extend the functionality and appearance of your WordPress-powered website.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
 
17
+ = Perfect for WordPress website development =
18
+ Whether it be adding free/premium scripts, creating and testing new scripts, streamlining development work, making front-end customisations, or even teaching and learning WordPress – CJT is extremely flexible and versatile.
19
 
20
+ = How does it work? =
21
+ Since CJT was designed to be easy, adding scripts and styles can be done in as little as two steps.
22
 
23
+ - adding your code directly into unique CJT code blocks
24
+ - assigning where these code blocks go
25
 
26
+ CJT code blocks can be assigned to pages, posts, custom posts, categories, URLs, expressions, and practically anywhere you want on your website. Code block shortcodes can also provide you with further placement accuracy.
27
 
28
+ = Why purchase CSS & JavaScript Toolbox PLUS? =
29
+ [CSS & JavaScript Toolbox PLUS](http://css-javascript-toolbox.com/css-javascript-toolbox-plus/) is our new premium plugin, featuring a faster and more powerful core, PLUS these features below:
30
+ - Inverted Assignments (NEW FEATURE)
31
+ - Support for Post Tags (NEW FEATURE)
32
  - Editor Themes
33
  - Editor Toolbox
34
  - Editor Menu Tools
35
  - Code Auto Completion (CAC)
36
  - Import Export Tool
37
  - Block Widget Linker
 
 
 
38
  - code optimisation and bug fixes
39
  - 100% compatibility with the the latest WordPress
40
+ - PLUS more!!!
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
 
42
  = Support Us =
43
  The CSS & JavaScript Toolbox project is 100% developed and maintained by only two people since the very beginnings in August 2011. We have plenty of feature ideas that we want to introduce and this can only be possible with funding.
103
  Due to the overwhelming amount of emails we get for users requesting support for our CJT plugins, we cannot provide support for the CJT Free plugin (hosted here on WordPress.org) at this stage unfortunately. If you wish to receive priority support, please visit our CJT website and [purchase a license for any of our products](http://css-javascript-toolbox.com/pricing).
104
 
105
  == Screenshots ==
 
106
  1. Add your code, then assign where it goes
107
  2. Create New Code Block dialog box
108
  3. Master Admin Toolbar at top, and minimised Code Blocks below
113
  8. Assigning Categories and sub-categories
114
  9. Auxiliary Assignments
115
  10. Advanced Assignments (URLs and Regular Expressions)
116
+ 11. Change State batch tools (CJT PLUS ONLY)
117
+ 12. Change Location/Hook batch tools (CJT PLUS ONLY)
118
  13. Delete and Backup Tools
119
+ 14. Code-Files management within each Code Block (CJT PLUS ONLY)
120
+ 15. Templates Manager form to store all of your Code Templates
121
  16. Templates Lookup form to embed or link Code Templates to Code Blocks
122
+ 17. Insert Code Block shortcodes via TinyMCE button (CJT PLUS ONLY)
123
  18. Metabox Code Block at the Edit Page/Post level
124
  19. Create backups of all your existing Code Blocks
125
+ 20. Create/Restore Code Block revisions (CJT PLUS ONLY)
126
+ 21. See Code Block information at a glance (CJT PLUS ONLY)
127
 
128
  == Changelog ==
129
+ = 8.1 =
130
+ * Compaibility with Wordpress 4.3.1
131
+ * Core Upgrades/Enhancements
132
+
133
  = 8.0.4 =
134
  * Check Wordpress 4.3 compatibility
135
  * List future deprecated features
tables/pins-blocks-view.php CHANGED
@@ -16,7 +16,22 @@ require_once CJTOOLBOX_INCLUDE_PATH . '/db/mysql/sql-view.inc.php';
16
  /**
17
  *
18
  */
19
- class CJTPinsBlockSQLView extends CJTSQLView {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
  /**
22
  * put your comment there...
@@ -24,57 +39,52 @@ class CJTPinsBlockSQLView extends CJTSQLView {
24
  * @param mixed $dbDriver
25
  * @return CJTPinsBlockView
26
  */
27
- public function __construct($driver) {
 
28
  // Initialize SQLView Parent.
29
- parent::__construct($driver);
 
30
  // Set default columns.
31
- $this->query->columns = array(
 
32
  'blocks.id',
 
33
  'blocks.name',
34
  'blocks.pinPoint',
35
  'blocks.location',
36
  'blocks.links',
37
  'blocks.expressions'
38
  );
 
39
  }
40
 
41
  /**
42
  * put your comment there...
43
  *
44
  */
45
- public function __toString() {
46
- // Prepare tables name.
47
- $blocksTable = $this->driver->getTableName(cssJSToolbox::$config->database->tables->blocks);
48
- $pinsTable = $this->driver->getTableName(cssJSToolbox::$config->database->tables->blockPins);
49
  $filters = $this->query->filter;
50
- // build custom pins filter.
51
- $customPins = array();
52
- foreach ($filters->customPins as $pinFilter) {
53
- $pinFilter = (object) $pinFilter;
54
- $pins = implode(',', $pinFilter->pins);
55
- $customPins[] = "((blocks.`pinPoint` & {$pinFilter->flag}) AND (pins.pin = '{$pinFilter->pin}') AND (pins.`value` IN ({$pins})))";
56
- }
57
- $customPins = implode(' OR ', $customPins);
58
- if (!empty($customPins)) {
59
  $customPins = " OR {$customPins}";
60
  }
 
61
  // Exclude blocks ids.
62
- $excludes = implode(',', $filters->excludes);
63
- $excludes = !empty($excludes) ? " AND `id` NOT IN ({$excludes})" : '';
64
- /**
65
- * @todo Allow backup ids to passed as filter.
66
- * @todo Allow block types to be passed as filter.
67
- */
68
- // Add moe re columns.
69
- $this->query->columns['blocksGroup'] = "(blocks.pinPoint & {$filters->pinPoint}) blocksGroup";
70
- // Build final query.
71
- $query['from'] = "`{$blocksTable}` blocks
72
- LEFT JOIN `{$pinsTable}` pins
73
- ON blocks.`id` = pins.`blockId`";
74
- $query['where'] = "(((`backupId` IS NULL) AND (`state` = '{$filters->state}'){$excludes}) AND
75
- ((blocks.`pinPoint` & {$filters->pinPoint}){$customPins}))";
76
- // Combine all into one statement.
77
- $query = $this->buildQuery($query['from'], $query['where']);
78
  return $query;
79
  }
80
 
@@ -82,24 +92,112 @@ class CJTPinsBlockSQLView extends CJTSQLView {
82
  * put your comment there...
83
  *
84
  */
85
- public function exec() {
86
- return $this->driver->select($this, OBJECT_K);
 
 
 
 
 
87
  }
88
-
89
  /**
90
  * put your comment there...
91
  *
92
  * @param mixed $pinPoint
93
  * @param mixed $customPins
 
 
94
  */
95
- public function filters($pinPoint, $customPins, $state = 'active', $excludes = array()) {
96
- $filters = array(
 
 
 
97
  'state' => $state,
98
  'pinPoint' => $pinPoint,
99
  'customPins' => $customPins,
100
  'excludes' => $excludes,
101
  );
102
- $this->query->filter = (object) $filters;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  }
104
 
105
  } // End class.
16
  /**
17
  *
18
  */
19
+ class CJTPinsBlockSQLView extends CJTSQLView
20
+ {
21
+
22
+ /**
23
+ * put your comment there...
24
+ *
25
+ * @var mixed
26
+ */
27
+ protected $blocksQuery;
28
+
29
+ /**
30
+ * put your comment there...
31
+ *
32
+ * @var mixed
33
+ */
34
+ protected $customPins;
35
 
36
  /**
37
  * put your comment there...
39
  * @param mixed $dbDriver
40
  * @return CJTPinsBlockView
41
  */
42
+ public function __construct( $driver )
43
+ {
44
  // Initialize SQLView Parent.
45
+ parent::__construct( $driver );
46
+
47
  // Set default columns.
48
+ $this->query->columns = array
49
+ (
50
  'blocks.id',
51
+ 'blocks.owner',
52
  'blocks.name',
53
  'blocks.pinPoint',
54
  'blocks.location',
55
  'blocks.links',
56
  'blocks.expressions'
57
  );
58
+
59
  }
60
 
61
  /**
62
  * put your comment there...
63
  *
64
  */
65
+ public function __toString()
66
+ {
67
+
 
68
  $filters = $this->query->filter;
69
+ $customPins = $this->customPins;
70
+
71
+ $customPins = implode( ' OR ', $customPins );
72
+
73
+ if ( ! empty( $customPins ) )
74
+ {
 
 
 
75
  $customPins = " OR {$customPins}";
76
  }
77
+
78
  // Exclude blocks ids.
79
+ $excludes = implode( ',', $filters->excludes );
80
+ $excludes = ! empty( $excludes ) ? " AND `id` NOT IN ( {$excludes} )" : '';
81
+
82
+ # Build where clause
83
+ $this->blocksQuery[ 'where' ] = "( ( ( `backupId` IS NULL ) AND ( `state` = '{$filters->state}' ){$excludes} ) AND ( ( blocks.`pinPoint` & {$filters->pinPoint} ){$customPins} ) )";
84
+
85
+ # Build final query
86
+ $query = $this->buildQuery( $this->blocksQuery[ 'from' ], $this->blocksQuery[ 'where' ] );
87
+
 
 
 
 
 
 
 
88
  return $query;
89
  }
90
 
92
  * put your comment there...
93
  *
94
  */
95
+ public function exec()
96
+ {
97
+
98
+ # Note: OBJECT_K get unique blocks as they will override each others
99
+ $blocks = $this->driver->select( $this, OBJECT_K );
100
+
101
+ return $blocks;
102
  }
103
+
104
  /**
105
  * put your comment there...
106
  *
107
  * @param mixed $pinPoint
108
  * @param mixed $customPins
109
+ * @param mixed $state
110
+ * @param mixed $excludes
111
  */
112
+ public function & filters( $pinPoint, $customPins, $state = 'active', $excludes = array() )
113
+ {
114
+
115
+ $filters = array
116
+ (
117
  'state' => $state,
118
  'pinPoint' => $pinPoint,
119
  'customPins' => $customPins,
120
  'excludes' => $excludes,
121
  );
122
+
123
+ $this->query->filter = ( object ) $filters;
124
+
125
+ # make query
126
+ $this->makeBlocksQuery();
127
+
128
+ return $this;
129
+ }
130
+
131
+ /**
132
+ * put your comment there...
133
+ *
134
+ */
135
+ public function & getBlocksQuery()
136
+ {
137
+ return $this->blocksQuery;
138
+ }
139
+
140
+ /**
141
+ * put your comment there...
142
+ *
143
+ */
144
+ public function & getCustomPins()
145
+ {
146
+ return $this->customPins;
147
+ }
148
+
149
+ /**
150
+ * put your comment there...
151
+ *
152
+ */
153
+ private function & makeBlocksQuery()
154
+ {
155
+
156
+ $blocksTable = $this->driver->getTableName( cssJSToolbox::$config->database->tables->blocks );
157
+ $pinsTable = $this->driver->getTableName( cssJSToolbox::$config->database->tables->blockPins );
158
+ $filters = $this->query->filter;
159
+
160
+ // build custom pins filter.
161
+ $customPins = array();
162
+
163
+ foreach ( $filters->customPins as $pinFilter )
164
+ {
165
+ $pinFilter = (object) $pinFilter;
166
+ $pins = implode( ',', $pinFilter->pins );
167
+ $customPins[ ] = "( ( blocks.`pinPoint` & {$pinFilter->flag} ) AND ( pins.pin = '{$pinFilter->pin}' ) AND ( pins.`value` IN ( {$pins} ) ) )";
168
+ }
169
+
170
+ $this->customPins = $customPins;
171
+
172
+ /**
173
+ * @todo Allow backup ids to passed as filter.
174
+ * @todo Allow block types to be passed as filter.
175
+ */
176
+ // Add moe re columns.
177
+ $this->query->columns[ 'blocksGroup' ] = "(blocks.pinPoint & {$filters->pinPoint}) blocksGroup";
178
+
179
+ # This method allowed to run multiple time with diffeent parameters on the same instance
180
+ $this->blocksQuery = array();
181
+
182
+ // Build final query.
183
+ $this->blocksQuery[ 'from' ] = "`{$blocksTable}` blocks LEFT JOIN `{$pinsTable}` pins ON blocks.`id` = pins.`blockId`";
184
+
185
+ // WHERE CLAUSE WILL BE BUILD LATE IN __toString() method
186
+
187
+ return $this;
188
+ }
189
+
190
+ /**
191
+ * put your comment there...
192
+ *
193
+ * @param mixed $query
194
+ */
195
+ public function setBlocksQuery( $query )
196
+ {
197
+
198
+ $this->blocksQuery = $query;
199
+
200
+ return $this;
201
  }
202
 
203
  } // End class.
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit4fa452c8944c65a2d19d46ecd72a469f::getLoader();
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit9d35e2a877717aab14142e845cf84233::getLoader();
vendor/composer/autoload_classmap.php CHANGED
@@ -36,11 +36,27 @@ return array(
36
  'CJTPHPCodeEvaluator' => $baseDir . '/framework/php/evaluator/evaluator.inc.php',
37
  'CJTPackageFile' => $baseDir . '/framework/packages/package.class.php',
38
  'CJTPageAccessPoint' => $baseDir . '/framework/access-points/page.class.php',
 
39
  'CJTPropertyNotFoundException' => $baseDir . '/framework/exceptions.inc.php',
40
  'CJTSQLView' => $baseDir . '/framework/db/mysql/sql-view.inc.php',
41
  'CJTServicesAPICallException' => $baseDir . '/framework/ServicesAPI/Exceptions.class.php',
 
42
  'CJTServicesClient' => $baseDir . '/framework/ServicesAPI/Services.class.php',
43
  'CJTServicesClientModule' => $baseDir . '/framework/ServicesAPI/Module.class.php',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  'CJTSettingsPage' => $baseDir . '/framework/settings/page.inc.php',
45
  'CJTStore' => $baseDir . '/framework/ServicesAPI/Store.php',
46
  'CJTStoreUpdate' => $baseDir . '/framework/CJTStoreUpdate.class.php',
36
  'CJTPHPCodeEvaluator' => $baseDir . '/framework/php/evaluator/evaluator.inc.php',
37
  'CJTPackageFile' => $baseDir . '/framework/packages/package.class.php',
38
  'CJTPageAccessPoint' => $baseDir . '/framework/access-points/page.class.php',
39
+ 'CJTPluggableHelper' => $baseDir . '/framework/PluggableHelper.abstract.php',
40
  'CJTPropertyNotFoundException' => $baseDir . '/framework/exceptions.inc.php',
41
  'CJTSQLView' => $baseDir . '/framework/db/mysql/sql-view.inc.php',
42
  'CJTServicesAPICallException' => $baseDir . '/framework/ServicesAPI/Exceptions.class.php',
43
+ 'CJTServicesAjaxService' => $baseDir . '/framework/ServicesFW/Ajax.Service.class.php',
44
  'CJTServicesClient' => $baseDir . '/framework/ServicesAPI/Services.class.php',
45
  'CJTServicesClientModule' => $baseDir . '/framework/ServicesAPI/Module.class.php',
46
+ 'CJTServicesDashboardPageService' => $baseDir . '/framework/ServicesFW/Dashboard.Service.class.php',
47
+ 'CJTServicesEntityModel' => $baseDir . '/framework/ServicesFW/EntityModel.class.php',
48
+ 'CJTServicesForm' => $baseDir . '/framework/ServicesFW/Form.class.php',
49
+ 'CJTServicesHTTPRequestRouter' => $baseDir . '/framework/ServicesFW/HTTPRequestRouter.class.php',
50
+ 'CJTServicesIPluginBase' => $baseDir . '/framework/ServicesFW/PluginBase.interface.php',
51
+ 'CJTServicesInstaller' => $baseDir . '/framework/ServicesFW/Installer.abstract.php',
52
+ 'CJTServicesMVCController' => $baseDir . '/framework/ServicesFW/Controller.class.php',
53
+ 'CJTServicesMVCView' => $baseDir . '/framework/ServicesFW/View.class.php',
54
+ 'CJTServicesMVCViewJson' => $baseDir . '/framework/ServicesFW/ViewJson.class.php',
55
+ 'CJTServicesModel' => $baseDir . '/framework/ServicesFW/Model.abstract.php',
56
+ 'CJTServicesPluginBase' => $baseDir . '/framework/ServicesFW/PluginBase.class.php',
57
+ 'CJTServicesShortcodeService' => $baseDir . '/framework/ServicesFW/Shortcode.service.class.php',
58
+ 'CJTServicesStorage' => $baseDir . '/framework/ServicesFW/Storage.abstract.php',
59
+ 'CJTServicesWPService' => $baseDir . '/framework/ServicesFW/Wordpress.service.abstract.php',
60
  'CJTSettingsPage' => $baseDir . '/framework/settings/page.inc.php',
61
  'CJTStore' => $baseDir . '/framework/ServicesAPI/Store.php',
62
  'CJTStoreUpdate' => $baseDir . '/framework/CJTStoreUpdate.class.php',
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit4fa452c8944c65a2d19d46ecd72a469f
6
  {
7
  private static $loader;
8
 
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit4fa452c8944c65a2d19d46ecd72a469f
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit4fa452c8944c65a2d19d46ecd72a469f', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit4fa452c8944c65a2d19d46ecd72a469f', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
@@ -44,7 +44,7 @@ class ComposerAutoloaderInit4fa452c8944c65a2d19d46ecd72a469f
44
  }
45
  }
46
 
47
- function composerRequire4fa452c8944c65a2d19d46ecd72a469f($file)
48
  {
49
  require $file;
50
  }
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit9d35e2a877717aab14142e845cf84233
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit9d35e2a877717aab14142e845cf84233', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit9d35e2a877717aab14142e845cf84233', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
44
  }
45
  }
46
 
47
+ function composerRequire9d35e2a877717aab14142e845cf84233($file)
48
  {
49
  require $file;
50
  }
views/blocks/block/public/css/block.css CHANGED
@@ -138,7 +138,6 @@
138
  }
139
 
140
  .block-toolbox a.cjttbl-save.cjttbs-disabled {background: url(../images/toolbox/save-inactive.png); }
141
- .block-toolbox a.cjttbl-revisions { background-image: url(../images/toolbox/revisions.png); }
142
  .block-toolbox a.cjttbl-delete { background-image: url(../images/toolbox/delete.png); }
143
  .block-toolbox a.location-header { background-image: url(../images/toolbox/header-hook.png); }
144
  .block-toolbox a.location-footer { background-image: url(../images/toolbox/footer-hook.png); }
@@ -146,7 +145,6 @@
146
  .block-toolbox a.cjttbl-edit-name { background-image: url(../images/toolbox/edit-name.png); }
147
  .block-toolbox a.cjttbl-info { background-image: url(../images/toolbox/info.png); }
148
  .block-toolbox a.cjttbl-templates-lookup { background-image: url(../images/toolbox/templates-lookup.png); }
149
- .block-toolbox a.cjttbl-link-external { background-image: url(../images/toolbox/link-external.png); }
150
 
151
  /** Editor Toolbox */
152
  .cjt-toolbox.editor-toolbox {
138
  }
139
 
140
  .block-toolbox a.cjttbl-save.cjttbs-disabled {background: url(../images/toolbox/save-inactive.png); }
 
141
  .block-toolbox a.cjttbl-delete { background-image: url(../images/toolbox/delete.png); }
142
  .block-toolbox a.location-header { background-image: url(../images/toolbox/header-hook.png); }
143
  .block-toolbox a.location-footer { background-image: url(../images/toolbox/footer-hook.png); }
145
  .block-toolbox a.cjttbl-edit-name { background-image: url(../images/toolbox/edit-name.png); }
146
  .block-toolbox a.cjttbl-info { background-image: url(../images/toolbox/info.png); }
147
  .block-toolbox a.cjttbl-templates-lookup { background-image: url(../images/toolbox/templates-lookup.png); }
 
148
 
149
  /** Editor Toolbox */
150
  .cjt-toolbox.editor-toolbox {
views/blocks/block/public/css/codefile.css CHANGED
@@ -90,6 +90,6 @@ input.show-selection {
90
  display: none;
91
  }
92
 
93
- li.code-file-item.create-file-row {padding-bottom: 3px;}
94
  #code-files-manager > li.codeFile {padding-top: 0px;margin-bottom: 1px;}
95
  li.code-file-item.create-file-row > a {font-size: 16px !important;}
90
  display: none;
91
  }
92
 
93
+ li.code-file-item.create-file-row {padding-bottom: 16px !important;}
94
  #code-files-manager > li.codeFile {padding-top: 0px;margin-bottom: 1px;}
95
  li.code-file-item.create-file-row > a {font-size: 16px !important;}
views/blocks/block/public/images/toolbox/link-external.png DELETED
Binary file
views/blocks/block/public/images/toolbox/revisions.png DELETED
Binary file
views/blocks/block/public/js/codefile-manager/codefile-manager.js CHANGED
@@ -21,7 +21,7 @@
21
  /**
22
  *
23
  */
24
- this.filesManager;
25
 
26
  /**
27
  *
@@ -142,23 +142,7 @@
142
  return false;
143
  }, this )
144
  );
145
- // Create File.
146
- this.filesManager.find('.create-file').click($.proxy(
147
- function(event) {
148
- // New Code file default data.
149
- var newCodeFile = {name : '', type : '', tag : '', description : '', id : 0};
150
- // Display form.
151
- this.editCodeFileDialog.display($(event.target).parent(), newCodeFile).done($.proxy(
152
- function(rCodeFile) {
153
- // Add newly added code file.
154
- this.listCodeFile(rCodeFile);;
155
- // Close the form.
156
- this.editCodeFileDialog.close();
157
- }, this)
158
- );
159
- return false;
160
- }, this )
161
- );
162
  };
163
 
164
  /**
21
  /**
22
  *
23
  */
24
+ this.filesManager;
25
 
26
  /**
27
  *
142
  return false;
143
  }, this )
144
  );
145
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
  };
147
 
148
  /**
views/blocks/block/public/js/jquery.block/jquery.block.js CHANGED
@@ -354,38 +354,8 @@
354
  };
355
  var url = CJTBlocksPage.server.getRequestURL('block', 'get_info_view', requestData);
356
  tb_show(CJTJqueryBlockI18N.blockInfoTitle, url);
357
- }
358
-
359
- /**
360
- * Quickely link external resource (CSS, JS, HTML or PHP)!
361
- *
362
- * The method is to fetch external content and add it as CJT template.
363
- */
364
- this._onlinkexternal = function() {
365
- // Read URLs from user inputs.
366
- var externals = prompt(CJTJqueryBlockI18N.linkExternalMessage);
367
- var linkExternalButton = this.toolbox.buttons['link-external'];
368
- if (externals) {
369
- // Show progress.
370
- linkExternalButton.loading(true);
371
- // Request server to link the external resources.
372
- var request = {externals : externals, blockId : this.block.get('id')};
373
- CJTBlocksPage.server.send('templatesManager', 'linkExternal', request)
374
- .success($.proxy(
375
- function(state) {
376
- if (state.code) {
377
- alert(CJTJqueryBlockI18N.couldNotLinkExternals + state.message);
378
- }
379
- }, this)
380
- ).complete($.proxy(
381
- function() {
382
- // Stop progress.
383
- linkExternalButton.loading(false);
384
- }, this)
385
- );
386
- }
387
- }
388
-
389
  /**
390
  *
391
  */
@@ -641,7 +611,7 @@
641
  */
642
  this.initCJTPluginBase = function(node, args) {
643
  // Initialize object properties!
644
- var model = this.block = new CJTBlock(this, node)
645
  this.features = $.extend(defaultOptions, args);
646
  // Initialize Events.
647
  this.onBlockSaved = function() {};
@@ -698,7 +668,6 @@
698
  'editor-language-php' : {callback : this._onswitcheditorlang, params : {lang : 'php'}},
699
  'state-switch' : {callback : this._onswitchflag, params : {flag : 'state'}},
700
  'save' : {callback : this._onsavechanges, params : {enable : false}},
701
- 'revisions' : {callback : this._ondisplayrevisions},
702
  'delete' : {callback : this._ondelete},
703
  'location-switch' : {callback : this._onswitchflag, params : {flag : 'location'}},
704
  'get-shortcode' : {callback : this._ongetshortcode},
@@ -744,11 +713,17 @@
744
  /**
745
  *
746
  */
747
- this.load = function() {
748
- // Initialize.
 
749
  var model = this.block;
 
 
 
 
750
  // LOAD MODEL.
751
  model.load();
 
752
  // Editor default options.
753
  this.block.aceEditor.setOptions({showPrintMargin : false});
754
  // Initialize editor toolbox.
@@ -759,7 +734,6 @@
759
  // Default to DOCK!!
760
  this.defaultDocks = [{element : this.block.aceEditor.container, pixels : 7}];
761
  // Show hidden toolbox buttons.
762
- this.toolbox.buttons['revisions'].jButton.removeClass('waitingToLoad');
763
  this.toolbox.buttons['switch-editor-language'].jButton.removeClass('waitingToLoad');
764
  this.toolbox.buttons['link-external'].jButton.removeClass('waitingToLoad');
765
  this.toolbox.buttons['templates-lookup'].jButton.removeClass('waitingToLoad');
@@ -775,10 +749,12 @@
775
  this.theme = {};
776
  this.theme.backgroundColor = 'white';
777
  this.theme.color = 'black';
 
778
  // LOAD EVENT.
779
  if (this.onLoad !== undefined) {
780
  this.onLoad();
781
  }
 
782
  // Block Code File.
783
  this.codeFile = new CJTBlockFile(this);
784
  }
@@ -812,6 +788,14 @@
812
  this.revisionControl.display();
813
  }
814
 
 
 
 
 
 
 
 
 
815
  /*
816
  *
817
  *
354
  };
355
  var url = CJTBlocksPage.server.getRequestURL('block', 'get_info_view', requestData);
356
  tb_show(CJTJqueryBlockI18N.blockInfoTitle, url);
357
+ };
358
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
359
  /**
360
  *
361
  */
611
  */
612
  this.initCJTPluginBase = function(node, args) {
613
  // Initialize object properties!
614
+ var model = this.block = new CJTBlock(this, node);
615
  this.features = $.extend(defaultOptions, args);
616
  // Initialize Events.
617
  this.onBlockSaved = function() {};
668
  'editor-language-php' : {callback : this._onswitcheditorlang, params : {lang : 'php'}},
669
  'state-switch' : {callback : this._onswitchflag, params : {flag : 'state'}},
670
  'save' : {callback : this._onsavechanges, params : {enable : false}},
 
671
  'delete' : {callback : this._ondelete},
672
  'location-switch' : {callback : this._onswitchflag, params : {flag : 'location'}},
673
  'get-shortcode' : {callback : this._ongetshortcode},
713
  /**
714
  *
715
  */
716
+ this.load = function()
717
+ {
718
+
719
  var model = this.block;
720
+
721
+ // Broadcast block event
722
+ this.block.box.trigger( 'cjtBlockLoaded', [ this ] );
723
+
724
  // LOAD MODEL.
725
  model.load();
726
+
727
  // Editor default options.
728
  this.block.aceEditor.setOptions({showPrintMargin : false});
729
  // Initialize editor toolbox.
734
  // Default to DOCK!!
735
  this.defaultDocks = [{element : this.block.aceEditor.container, pixels : 7}];
736
  // Show hidden toolbox buttons.
 
737
  this.toolbox.buttons['switch-editor-language'].jButton.removeClass('waitingToLoad');
738
  this.toolbox.buttons['link-external'].jButton.removeClass('waitingToLoad');
739
  this.toolbox.buttons['templates-lookup'].jButton.removeClass('waitingToLoad');
749
  this.theme = {};
750
  this.theme.backgroundColor = 'white';
751
  this.theme.color = 'black';
752
+
753
  // LOAD EVENT.
754
  if (this.onLoad !== undefined) {
755
  this.onLoad();
756
  }
757
+
758
  // Block Code File.
759
  this.codeFile = new CJTBlockFile(this);
760
  }
788
  this.revisionControl.display();
789
  }
790
 
791
+ /**
792
+ *
793
+ */
794
+ this.setFeatures = function( features )
795
+ {
796
+ this.features = features;
797
+ };
798
+
799
  /*
800
  *
801
  *
views/blocks/block/public/js/jquery.block/jquery.block.localization.php CHANGED
@@ -18,7 +18,5 @@ return array(
18
  'location_headerTitle' => cssJSToolbox::getText('Set output location hook to footer'),
19
  'location_footerTitle' => cssJSToolbox::getText('Set output location hook to header'),
20
  'invalidBlockName' => cssJSToolbox::getText('Invalid block name'),
21
- 'linkExternalMessage' => cssJSToolbox::getText('Please enter a list of the external URLs you want to link separated by comma!'),
22
- 'couldNotLinkExternals' => cssJSToolbox::getText('Couldn\'t link the externals URI you requested!! Reason:'),
23
  'loadingBlock' => cssJSToolbox::getText('Loading'),
24
  );
18
  'location_headerTitle' => cssJSToolbox::getText('Set output location hook to footer'),
19
  'location_footerTitle' => cssJSToolbox::getText('Set output location hook to header'),
20
  'invalidBlockName' => cssJSToolbox::getText('Invalid block name'),
 
 
21
  'loadingBlock' => cssJSToolbox::getText('Loading'),
22
  );
views/blocks/block/tmpl/codefile/codefile.html.tmpl CHANGED
@@ -37,7 +37,9 @@
37
  </ul>
38
  </fieldset>
39
  </li>
40
- <li class="code-file-item create-file-row"><a class="create-file" href="#"><?php echo cssJSToolbox::getText('Create File') ?> ...</a></li>
 
 
41
  <li class="separator"></li>
42
  <li class="quick-toolbar">
43
  <input type="checkbox" class="select-code-file" /> |
37
  </ul>
38
  </fieldset>
39
  </li>
40
+ <li class="code-file-item create-file-row">
41
+ <?php do_action( CJTPluggableHelper::ACTION_BLOCK_CODE_FILE_TEMPLATE_CREATE_NEW_FILE ); ?>
42
+ </li>
43
  <li class="separator"></li>
44
  <li class="quick-toolbar">
45
  <input type="checkbox" class="select-code-file" /> |
views/blocks/block/tmpl/templates/toolbox.html.tmpl CHANGED
@@ -12,8 +12,6 @@
12
  <a href="#" class="cjt-tb-link waitingToLoad cjttbl-templates-lookup" title="<?php echo cssJSToolbox::getText('Template Lookup - Embed or link templates to code blocks') ?>"></a>
13
  <iframe src="" class="popup-menu templates-lookup" NOBORDER="1" style="display:none"></iframe>
14
 
15
- <a href="#" class="cjt-tb-link waitingToLoad cjttbl-link-external" title="<?php echo cssJSToolbox::getText('Link external') ?>"></a>
16
-
17
  <a href="#" class="cjt-tb-link cjttbl-info" title="<?php echo cssJSToolbox::getText('Show code block information') ?>"></a>
18
 
19
  <a href="#" class="cjt-tb-link waitingToLoad cjttbl-switch-editor-language" title="<?php echo cssJSToolbox::getText('Set editing language for syntax highlighting') ?>"></a>
@@ -25,7 +23,6 @@
25
  </div>
26
 
27
  <a href="#" class="cjt-tb-link cjttbl-edit-name" title="<?php echo cssJSToolbox::getText('Edit code block title. Click Save to take affect') ?>"></a>
28
- <a href="#" class="cjt-tb-link waitingToLoad cjttbl-revisions" title="<?php echo cssJSToolbox::getText('View and restore code block revisions') ?>"></a>
29
  <a href="#" class="cjt-tb-link cjttbl-delete" title="<?php echo cssJSToolbox::getText('Delete code block') ?>"></a>
30
  </div>
31
 
12
  <a href="#" class="cjt-tb-link waitingToLoad cjttbl-templates-lookup" title="<?php echo cssJSToolbox::getText('Template Lookup - Embed or link templates to code blocks') ?>"></a>
13
  <iframe src="" class="popup-menu templates-lookup" NOBORDER="1" style="display:none"></iframe>
14
 
 
 
15
  <a href="#" class="cjt-tb-link cjttbl-info" title="<?php echo cssJSToolbox::getText('Show code block information') ?>"></a>
16
 
17
  <a href="#" class="cjt-tb-link waitingToLoad cjttbl-switch-editor-language" title="<?php echo cssJSToolbox::getText('Set editing language for syntax highlighting') ?>"></a>
23
  </div>
24
 
25
  <a href="#" class="cjt-tb-link cjttbl-edit-name" title="<?php echo cssJSToolbox::getText('Edit code block title. Click Save to take affect') ?>"></a>
 
26
  <a href="#" class="cjt-tb-link cjttbl-delete" title="<?php echo cssJSToolbox::getText('Delete code block') ?>"></a>
27
  </div>
28
 
views/blocks/cjt-block/public/css/block.css CHANGED
@@ -16,22 +16,23 @@
16
  margin-top: 8px;
17
  }
18
  /* Wrap long text */
19
- .select-childs {
20
  position: relative;
21
  left: -1px;
22
  top: -1px;
23
  margin-left: -12px !important;
24
  margin-right: 1px !important;
25
  margin-top: 0px !important;
 
26
  }
27
  .select-childs-checkbox-overlay {
28
  background-color: #bb5300;
29
  position: relative;
30
  width: 16px;
31
  height: 16px;
 
32
  opacity: 0.3;
33
  filter: alpha(opacity = 30);
34
- display: inline-block;
35
  top: 4px;
36
  z-index: 1;
37
  left: 3px;
16
  margin-top: 8px;
17
  }
18
  /* Wrap long text */
19
+ input[type="checkbox"].select-childs {
20
  position: relative;
21
  left: -1px;
22
  top: -1px;
23
  margin-left: -12px !important;
24
  margin-right: 1px !important;
25
  margin-top: 0px !important;
26
+ display: none;
27
  }
28
  .select-childs-checkbox-overlay {
29
  background-color: #bb5300;
30
  position: relative;
31
  width: 16px;
32
  height: 16px;
33
+ display: none;
34
  opacity: 0.3;
35
  filter: alpha(opacity = 30);
 
36
  top: 4px;
37
  z-index: 1;
38
  left: 3px;
views/blocks/cjt-block/public/js/jquery.assignpanel/jquery.assignpanel.js CHANGED
@@ -6,148 +6,6 @@
6
  *
7
  */
8
  (function($) {
9
-
10
- /**
11
- * put your comment there...
12
- *
13
- * @type T_JS_FUNCTION
14
- */
15
- var Buttons = new function() {
16
-
17
- /**
18
- *
19
- */
20
- this.AssignOnlySwitcher = function(assignPanel) {
21
- // initialize.
22
- var isRunning = false;
23
- var anchors = {};
24
- var switchers = [{name : 'assignOnly', state : true, 'otherSwitcher' : 'all'}, {name : 'all', state : false, 'otherSwitcher' : 'assignOnly'}];
25
- var model = assignPanel.block.block;
26
- var jElement = $(model.box.find('.listing-options'));
27
-
28
- /**
29
- * put your comment there...
30
- *
31
- * @param event
32
- */
33
- var _onswitch = function(event) {
34
- // Don't run while in process.
35
- if (isRunning) {
36
- return false;
37
- }
38
- // Get switcher associated to the anchor.
39
- var switcher = $(event.target).data('switcher');
40
- // Check for changes.
41
- // If would be treated as changed when
42
- // there is a changed detected and the
43
- // the change is really made to the assign panel fields.
44
- // Get changes copy and remove CODE field.
45
- var changes = $.extend({}, assignPanel.block.changes);
46
- var codeFieldID = model.aceEditor.cjtBlockFieldId;
47
- delete changes[codeFieldID];
48
- // CHeck if there is any changes regardless the CODE field.
49
- if (CJTBlocksPage.blocks.hasChanges(changes)) {
50
- var confirmed = confirm(CJT_CJT_BLOCKJqueryBlockI18N.changesDetectedConfirmMessage);
51
- // If not confirmed returns.
52
- if (!confirmed) {
53
- return false;
54
- }
55
- else {
56
- // Reset all changes except code.
57
- assignPanel.block.changes = {codeFieldID : assignPanel.block.changes[assignPanel.block.changes]};
58
- // HasChanges!
59
- var hasChanges = CJTBlocksPage.blocks.hasChanges(assignPanel.block.changes);
60
- // Based on the hasChanges value reflect user interface
61
- // components for CJTPages and the Block unit.
62
- CJTBlocksPage.blockContentChanged(model.get('id'), hasChanges);
63
- assignPanel.block.toolbox.buttons['save'].enable(hasChanges);
64
- }
65
- }
66
- // Enter running mode.
67
- isRunning = true;
68
- // Reset assignment panel
69
- // Process all LISTING properties.
70
- var properties = $.merge([], assignPanel.block.features.restoreRevision.fields);
71
- delete properties[properties.indexOf('code')];
72
- delete properties[properties.indexOf('links')];
73
- delete properties[properties.indexOf('expressions')];
74
- $.each(properties, $.proxy(
75
- function(index, propertyName) {
76
- if (propertyName) {
77
- // Get property om
78
- pom = model.property(propertyName).om;
79
- // Reset values.
80
- pom.setValue(null);
81
- pom.reset();
82
- }
83
- }, this)
84
- );
85
- // Save property.
86
- model.set('assignOnlyModeSwitcher', switcher.name);
87
- // Switch state.
88
- this.switchState();
89
- // Activate ADVANCED TAB.
90
- // Activate previously activated tab.
91
- var currentActiveTAB = assignPanel.jElement.tabs('option', 'active');
92
- assignPanel.activateTab('advanced');
93
- assignPanel.jElement.tabs('option', 'active', currentActiveTAB);
94
- // Exsit running mode.
95
- isRunning = false;
96
- // Inactive
97
- return false;
98
- };
99
-
100
- /**
101
- * put your comment there...
102
- *
103
- */
104
- var getBlockSwitcherName = function() {
105
- return model.get('assignOnlyModeSwitcher', 'all');
106
- };
107
-
108
- /**
109
- * put your comment there...
110
- *
111
- */
112
- this.jElement = function() {
113
- return jElement;
114
- };
115
-
116
- /**
117
- * put your comment there...
118
- *
119
- */
120
- this.switchState = function() {
121
- // Get block switcher.
122
- var anchor = anchors[getBlockSwitcherName()];
123
- var switcher = anchor.data('switcher');
124
- // Change anchor state.
125
- anchor.addClass('active');
126
- // Reset the other anchor state.
127
- anchors[switcher.otherSwitcher].removeClass('active');
128
- // Change state.
129
- assignPanel.loadAssignedOnlyMode = switcher.state;
130
- assignPanel.checkboxDisabled = false;
131
- };
132
-
133
- // Initialize null p
134
- // Find links, bind events.
135
- $.each(switchers, $.proxy(
136
- function(index, switcher) {
137
- // Find Anchor
138
- anchors[switcher.name] = model.box.find('.listing-options-' + switcher.name)
139
- // Handle click
140
- .click($.proxy(_onswitch, this))
141
- // Store switcher name.
142
- .data('switcher', switcher);
143
- }, this)
144
- );
145
-
146
- // Switch to default state.
147
- this.switchState();
148
- };
149
-
150
- };
151
 
152
  /**
153
  * Hold the items per page to load
@@ -173,6 +31,22 @@
173
  // Define assigment panel plugin.
174
  assigmentPanelElement.CJTBlockAssignmentPanel = new function() {
175
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
176
  /**
177
  * put your comment there...
178
  *
@@ -183,7 +57,21 @@
183
  /**
184
  *
185
  */
186
- this.buttons = {pages : [], posts : [], categories : [], pinPoint : []};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
187
 
188
  /**
189
  *
@@ -213,7 +101,21 @@
213
  *
214
  * @type Object
215
  */
216
- var map = {pages : {}, posts : {}, categories : {}, pinPoint : {}};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
217
 
218
  /**
219
  * put your comment there...
@@ -684,18 +586,23 @@
684
  }, this)
685
  );
686
 
687
- // Buttons.
688
- this.assignedOnlySwitcher = new Buttons.AssignOnlySwitcher(this);
689
-
690
  // Initialize Assigment Panel tab.
691
- this.jElement.tabs({
692
- activate : function(event, ui) {
 
 
693
  // Set ui.item to TAB reference.
694
  ui.item = ui.newTab;
695
  // Trigger real event handler.
696
  _onobjectlistactivate(event, ui);
697
  }
698
- });
 
 
 
699
 
700
  // Create custom posts toggle widget.
701
  var cpContainer = this.jElement.find('#custom-posts-container-' + blockId);
@@ -726,8 +633,7 @@
726
  header: '.acc-header'
727
  }
728
  );
729
- // Activate the AUX tab by default.
730
- this.jElement.find('li.type-advanced>a').trigger('click');
731
  // Syncronize assign panel map when block saved.
732
  options.block.onBlockSaved = onBlockSaved;
733
  }
6
  *
7
  */
8
  (function($) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
  /**
11
  * Hold the items per page to load
31
  // Define assigment panel plugin.
32
  assigmentPanelElement.CJTBlockAssignmentPanel = new function() {
33
 
34
+ /**
35
+ * Assigment panel jQuery pLugin reference
36
+ *
37
+ */
38
+ var apjp = this;
39
+
40
+ /**
41
+ * put your comment there...
42
+ *
43
+ * @type Array
44
+ */
45
+ this.objectsList = [ 'pages', 'posts', 'categories', 'pinPoint' ];
46
+
47
+ // Allow Pluggable buttons
48
+ $( assigmentPanelElement ).trigger( 'cjtblockassigninitobjectslist', [ this ] );
49
+
50
  /**
51
  * put your comment there...
52
  *
57
  /**
58
  *
59
  */
60
+ this.buttons = ( function() {
61
+
62
+ var buttons = {};
63
+
64
+ $.each( apjp.objectsList,
65
+
66
+ function( index, name )
67
+ {
68
+ buttons[ name ] = [];
69
+ }
70
+ );
71
+
72
+ return buttons;
73
+
74
+ } )();
75
 
76
  /**
77
  *
101
  *
102
  * @type Object
103
  */
104
+ var map = ( function() {
105
+
106
+ var map = {};
107
+
108
+ $.each( apjp.objectsList,
109
+
110
+ function( index, name )
111
+ {
112
+ map[ name ] = { };
113
+ }
114
+ );
115
+
116
+ return map;
117
+
118
+ } )();;
119
 
120
  /**
121
  * put your comment there...
586
  }, this)
587
  );
588
 
589
+ // Initialize assign panel attachec components
590
+ $( assigmentPanelElement ).trigger( 'cjtassignpanelattachedcomponents', [ assignPanel ] );
591
+
592
  // Initialize Assigment Panel tab.
593
+ this.jElement.tabs(
594
+ {
595
+ activate : function(event, ui)
596
+ {
597
  // Set ui.item to TAB reference.
598
  ui.item = ui.newTab;
599
  // Trigger real event handler.
600
  _onobjectlistactivate(event, ui);
601
  }
602
+
603
+ } );
604
+
605
+ this.jElement.tabs( 'option', 'active', this.jElement.find( '>.ui-tabs-panel' ).length - 1 );
606
 
607
  // Create custom posts toggle widget.
608
  var cpContainer = this.jElement.find('#custom-posts-container-' + blockId);
633
  header: '.acc-header'
634
  }
635
  );
636
+
 
637
  // Syncronize assign panel map when block saved.
638
  options.block.onBlockSaved = onBlockSaved;
639
  }
views/blocks/cjt-block/public/js/jquery.block/jquery.block.js CHANGED
@@ -40,6 +40,8 @@
40
  {element : assigmentPanelElement.find('.advanced-accordion .ui-accordion-content'), pixels : 172},
41
  {element : assigmentPanelElement.find('.advanced-accordion .ui-accordion-content textarea'), pixels : 182}
42
  ];
 
 
43
  };
44
 
45
  // Load block only when loaded by parent model.
@@ -48,6 +50,7 @@
48
  /// Initialize parent class.
49
  // Add assigment panel fields to the restoreRevision args.
50
  args.restoreRevision = {fields : ['code', 'pages', 'posts', 'categories', 'pinPoint', 'links', 'expressions']};
 
51
  this.initCJTPluginBase(node, args);
52
 
53
  } // End class.
40
  {element : assigmentPanelElement.find('.advanced-accordion .ui-accordion-content'), pixels : 172},
41
  {element : assigmentPanelElement.find('.advanced-accordion .ui-accordion-content textarea'), pixels : 182}
42
  ];
43
+
44
+ this.block.box.trigger( 'cjtassignableblockloaded', [ this ] );
45
  };
46
 
47
  // Load block only when loaded by parent model.
50
  /// Initialize parent class.
51
  // Add assigment panel fields to the restoreRevision args.
52
  args.restoreRevision = {fields : ['code', 'pages', 'posts', 'categories', 'pinPoint', 'links', 'expressions']};
53
+
54
  this.initCJTPluginBase(node, args);
55
 
56
  } // End class.
views/blocks/cjt-block/public/js/optional/revision/revision.js CHANGED
@@ -64,18 +64,17 @@ var CJTBlockOptionalRevision = null;
64
  // Force assignment panel revision mode.
65
  this.assignPanel.loadAssignedOnlyMode = true;
66
  this.assignPanel.checkboxDisabled = true;
67
- // Hide AssignedOnly switcher.
68
- this.assignPanel.assignedOnlySwitcher.jElement().css({visibility : 'hidden'});
69
  break;
70
  default : // Revert back to normal state.
71
  // Reset alternate block Id.
72
  this.assignPanel.modeBlockId = null;
73
- // Switch
74
- this.assignPanel.assignedOnlySwitcher.switchState();
75
- // Show assigned only switcher.
76
- this.assignPanel.assignedOnlySwitcher.jElement().css({visibility : 'visible'});
77
  break;
78
  }
 
 
 
 
 
79
  // Reset assignpanel selected TAB.
80
  this.assignPanel.activateTab('advanced');
81
  }
64
  // Force assignment panel revision mode.
65
  this.assignPanel.loadAssignedOnlyMode = true;
66
  this.assignPanel.checkboxDisabled = true;
 
 
67
  break;
68
  default : // Revert back to normal state.
69
  // Reset alternate block Id.
70
  this.assignPanel.modeBlockId = null;
 
 
 
 
71
  break;
72
  }
73
+
74
+ block = this.assignPanel.block;
75
+
76
+ block.block.box.trigger( 'cjtblockrevisionswitchstate', [ block, this.state ] );
77
+
78
  // Reset assignpanel selected TAB.
79
  this.assignPanel.activateTab('advanced');
80
  }
views/blocks/cjt-block/tmpl/templates/assign-panel/default.html.tmpl CHANGED
@@ -41,6 +41,9 @@ $tabs = array(
41
  ),
42
  )
43
  );
 
 
 
44
  ?>
45
  <div class="cjpageblock">
46
  <?php
41
  ),
42
  )
43
  );
44
+
45
+ $tabs[ 'tabs' ] = apply_filters( CJTPluggableHelper::FILTER_BLOCK_ASSIGN_PANEL_TABS, $tabs[ 'tabs' ] );
46
+
47
  ?>
48
  <div class="cjpageblock">
49
  <?php
views/blocks/cjt-block/tmpl/templates/assign-panel/templates/custom-posts.html.tmpl CHANGED
@@ -1,25 +1,8 @@
1
  <?php
2
- // Create tabs for every custom post under the custom posts tab.
3
- // Get all registered custom posts.
4
- $customPosts = get_post_types(array('public' => 1, 'show_ui' => true, '_builtin' => false), 'objects');
5
- // Get refernce to custom posts tab.
6
- $items = array();
7
- // Add tab for every custom post
8
- // Exclude 'Empty' Custom Post Types.
9
- foreach ($customPosts as $typeName => $customPost) {
10
- // Check if has posts.
11
- $hasPosts = count(get_posts(array('post_type' => $typeName, 'offset' => 0, 'numberposts' => 1)));
12
- // Add only types with at least one post exists.
13
- if ($hasPosts) {
14
- $items[$typeName] = array(
15
- 'title' => $customPost->labels->name,
16
- 'renderer' => 'objects-list',
17
- 'type' => array('type' => $typeName,
18
- 'group' => 'posts',
19
- 'targetType' => 'post')
20
- );
21
- }
22
- }
23
  ?>
24
  <div id="custom-posts-container-<?php echo $block->id ?>" class="custom-posts-container">
25
  <?php
1
  <?php
2
+
3
+ // Get custom post types
4
+ $items = CJTBlocksModel::getCustomPostTypes();
5
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  ?>
7
  <div id="custom-posts-container-<?php echo $block->id ?>" class="custom-posts-container">
8
  <?php
views/blocks/cjt-block/tmpl/templates/assign-panel/templates/tab.html.tmpl CHANGED
@@ -30,8 +30,7 @@
30
  ?>
31
  </div>
32
  <?php endforeach; ?>
33
- <span class="listing-options">
34
- <a href="#" class="cjt-link listing-options-assignOnly"><?php echo cssJSToolbox::getText('Assigned') ?></a> |
35
- <a href="#" class="cjt-link listing-options-all"><?php echo cssJSToolbox::getText('All') ?></a>
36
- </span>
37
  </div>
30
  ?>
31
  </div>
32
  <?php endforeach; ?>
33
+
34
+ <?php do_action( CJTPluggableHelper::ACTION_BLOCK_ASSIGN_PANEL_TAB_BOTTOM ); ?>
35
+
 
36
  </div>
views/blocks/info/tmpl/default.html.tmpl CHANGED
@@ -1,10 +1,6 @@
1
  <div class="block-info">
2
  <ul>
3
- <li><span style="font-weight:bold"><?php echo cssJSToolbox::getText('ID') ?>:</span> #<?php echo $this->info->id ?></li>
4
- <li><span style="font-weight:bold"><?php echo cssJSToolbox::getText('Name') ?>:</span> <?php echo $this->info->name ?></li>
5
- <li><span style="font-weight:bold"><?php echo cssJSToolbox::getText('Author') ?>:</span> <?php echo $this->info->owner->display_name ?></li>
6
- <li><span style="font-weight:bold"><?php echo cssJSToolbox::getText('Date Created') ?>:</span> <?php echo $this->info->created ?></li>
7
- <li><span style="font-weight:bold"><?php echo cssJSToolbox::getText('Last Modified') ?>:</span> <?php echo $this->info->lastModified ?></li>
8
  <li style="background-color:#EFEFEF"><span style="font-weight:bold"><?php echo cssJSToolbox::getText('Shortcode') ?>: </span><?php echo $this->info->shortcode ?></li>
9
  </ul>
10
  </div>
1
  <div class="block-info">
2
  <ul>
3
+ <?php do_action( CJTPluggableHelper::ACTION_BLOCK_SCREEN_INFO_TOP, $this->info ); ?>
 
 
 
 
4
  <li style="background-color:#EFEFEF"><span style="font-weight:bold"><?php echo cssJSToolbox::getText('Shortcode') ?>: </span><?php echo $this->info->shortcode ?></li>
5
  </ul>
6
  </div>
views/blocks/manager/public/css/blocks.css CHANGED
@@ -60,8 +60,6 @@ span#support-us {position: absolute;top: 15px;left: 370px;font-size: 13px;color:
60
  position: relative;
61
  }
62
  /* Links */
63
- .cjt-toolbox-blocks a.cjttbl-state-tools {width: 28px !important; background: url(../images/toolbox/activate-all.png) no-repeat;}
64
- .cjt-toolbox-blocks a.cjttbl-location-tools { background: url(../images/toolbox/header-all.png) no-repeat; }
65
  .cjt-toolbox-blocks a.cjttbl-admin-tools { background: url(../images/toolbox/admin-tools.png) no-repeat; }
66
  .cjt-toolbox-blocks a.cjttbl-templates-manager { background: url(../images/toolbox/templates-manager.png) no-repeat; }
67
  .cjt-toolbox-blocks a.cjttbl-global-settings { background: url(../images/toolbox/settings.png) no-repeat; }
@@ -81,16 +79,9 @@ span#support-us {position: absolute;top: 15px;left: 370px;font-size: 13px;color:
81
  margin-left: 40px;
82
  top: 2px;
83
  }
84
- .cjt-toolbox-blocks a.cjttbl-delete-all { background: url(../images/toolbox/delete-all.png) no-repeat; }
85
- .cjt-toolbox-blocks a.cjttbl-delete-empty { background: url(../images/toolbox/delete-empty.png) no-repeat; }
86
  .cjt-toolbox-blocks a.cjttbl-manage-backups { background: url(../images/toolbox/backup.png) no-repeat; }
87
- .cjt-toolbox-blocks a.cjttbl-footer-all { background: url(../images/toolbox/footer-all.png) no-repeat; }
88
- .cjt-toolbox-blocks a.cjttbl-header-all { background: url(../images/toolbox/header-all.png) no-repeat; }
89
- .cjt-toolbox-blocks a.cjttbl-activate-all { background: url(../images/toolbox/activate-all.png) no-repeat; }
90
- .cjt-toolbox-blocks a.cjttbl-deactivate-all { background: url(../images/toolbox/deactivate-all.png) no-repeat; }
91
- .cjt-toolbox-blocks a.cjttbl-revert-state { background: url(../images/toolbox/revert-state.png) no-repeat; }
92
- .cjt-toolbox-blocks a.cjttbl-close-all { background: url(../images/toolbox/close-all.png) no-repeat; }
93
- .cjt-toolbox-blocks a.cjttbl-open-all { background: url(../images/toolbox/open-all.png) no-repeat; }
94
 
95
  #templates-lookup-form {height: 330px;}
96
 
60
  position: relative;
61
  }
62
  /* Links */
 
 
63
  .cjt-toolbox-blocks a.cjttbl-admin-tools { background: url(../images/toolbox/admin-tools.png) no-repeat; }
64
  .cjt-toolbox-blocks a.cjttbl-templates-manager { background: url(../images/toolbox/templates-manager.png) no-repeat; }
65
  .cjt-toolbox-blocks a.cjttbl-global-settings { background: url(../images/toolbox/settings.png) no-repeat; }
79
  margin-left: 40px;
80
  top: 2px;
81
  }
 
 
82
  .cjt-toolbox-blocks a.cjttbl-manage-backups { background: url(../images/toolbox/backup.png) no-repeat; }
83
+
84
+
 
 
 
 
 
85
 
86
  #templates-lookup-form {height: 330px;}
87
 
views/blocks/manager/public/images/toolbox/activate-all.png DELETED
Binary file
views/blocks/manager/public/images/toolbox/close-all.png DELETED
Binary file
views/blocks/manager/public/images/toolbox/deactivate-all.png DELETED
Binary file
views/blocks/manager/public/images/toolbox/delete-all.png DELETED
Binary file
views/blocks/manager/public/images/toolbox/delete-empty.png DELETED
Binary file
views/blocks/manager/public/images/toolbox/footer-all.png DELETED
Binary file
views/blocks/manager/public/images/toolbox/header-all.png DELETED
Binary file
views/blocks/manager/public/images/toolbox/open-all.png DELETED
Binary file
views/blocks/manager/public/images/toolbox/revert-state.png DELETED
Binary file
views/blocks/manager/public/js/blocks-page/blocks-page.js CHANGED
@@ -240,63 +240,6 @@ var CJTBlocksPage;
240
  window.location.href = window.location.href.replace(/&backupId=\d+/, '');
241
  },
242
 
243
- /**
244
- *
245
- *
246
- *
247
- *
248
- */
249
- _ondeleteall : function() {
250
- // Confimation message!
251
- var blocksCount = CJTBlocksPage.blocks.getBlocks().length;
252
- var confirmMessage = CJTBlocksPageI18N.commonDeleteMessage.replace('%d', blocksCount)
253
- + "\n\n"
254
- + CJTBlocksPage.blocks.toArray('name').join("\n")
255
- + "\n\n"
256
- + CJTBlocksPageI18N.confirmDeleteAll;
257
- // Confirm deletion.
258
- if (confirm(confirmMessage)) {
259
- CJTBlocksPage.deleteBlocks(CJTBlocksPage.blocks.getBlocks());
260
- }
261
- },
262
-
263
- /**
264
- *
265
- *
266
- *
267
- *
268
- */
269
- _ondeleteempty : function() {
270
- // initialize blocks.
271
- var blocks = CJTBlocksPage.blocks.getBlocks();
272
- var emptyBlocks = [];
273
- // For every block check if there is code content.
274
- blocks.each(
275
- function(index, block) {
276
- var code = block.CJTBlock.block.get('code');
277
- if (code == '') {
278
- emptyBlocks.push(this);
279
- }
280
- }
281
- );
282
- // If there is at least one empty block to delete just confirm
283
- // otherwise show error!
284
- if (emptyBlocks.length) {
285
- // Confimation message!
286
- var confirmMessage = CJTBlocksPageI18N.commonDeleteMessage.replace('%d', emptyBlocks.length)
287
- + "\n\n"
288
- + CJTBlocksPage.blocks.toArray('name', emptyBlocks).join("\n")
289
- + "\n\n"
290
- + CJTBlocksPageI18N.confirmDeleteEmpty;
291
- if (confirm(confirmMessage)) {
292
- CJTBlocksPage.deleteBlocks(emptyBlocks);
293
- }
294
- }
295
- else {
296
- alert(CJTBlocksPageI18N.noBlocksToDelete)
297
- }
298
- },
299
-
300
  /**
301
  * put your comment there...
302
  *
@@ -414,46 +357,6 @@ var CJTBlocksPage;
414
  )
415
  },
416
 
417
- /**
418
- *
419
- *
420
- *
421
- *
422
- */
423
- _onswitchflag : function(event, params) {
424
- var multiOperationServer = CJTBlocksPage.server.multiOperation;
425
- var eventName = 'switch' + params.flag.ucFirst();
426
- // First queue blocks flag.
427
- multiOperationServer.trigger(eventName, params)
428
- // Second send all queued stack to sgerver.
429
- .send('post');
430
- },
431
-
432
- /**
433
- *
434
- *
435
- *
436
- *
437
- */
438
- _ontoggle : function(event, params) {
439
- // Show or Hide blocks.
440
- var blocks = CJTBlocksPage.blocks.getBlocks();
441
- switch (params.state) {
442
- case false:
443
- // Close postboxes.
444
- blocks.addClass('closed');
445
- break;
446
- case true:
447
- // Open postboxes.
448
- blocks.removeClass('closed');
449
- // Notify postbox opened.
450
- blocks.each(function() {this.CJTBlock._onpostboxopened();});
451
- break;
452
- }
453
- // Save (batch) state.
454
- postboxes.save_state('cjtoolbox');
455
- },
456
-
457
  /**
458
  * put your comment there...
459
  *
@@ -623,23 +526,22 @@ var CJTBlocksPage;
623
  'add-block' : {callback : CJTBlocksPage._onaddnew},
624
  'restore' : {callback : CJTBlocksPage._onrestore},
625
  'cancel-restore' : {callback : CJTBlocksPage._oncancelrestore},
626
- 'delete-all' : {callback : CJTBlocksPage._ondeleteall},
627
- 'delete-empty' : {callback : CJTBlocksPage._ondeleteempty},
628
  'reset-order' : {callback : CJTBlocksPage._onresetorder},
629
  'manage-backups' : {callback : CJTBlocksPage._onmanagebackups},
630
- 'footer-all' : {callback : CJTBlocksPage._onswitchflag, params : {flag : 'location', newValue : 'footer'}},
631
- 'header-all' : {callback : CJTBlocksPage._onswitchflag, params : {flag : 'location', newValue : 'header'}},
632
- 'activate-all' : {callback : CJTBlocksPage._onswitchflag, params : {flag : 'state', newValue : 'active'}},
633
- 'deactivate-all' : {callback : CJTBlocksPage._onswitchflag, params : {flag : 'state', newValue : 'inactive'}},
634
- 'revert-state' : {callback : CJTBlocksPage._onswitchflag, params : {flag : 'state'}},
635
  'templates-manager' : {callback : CJTBlocksPage._onmanagetemplates},
636
  'global-settings' : {callback : CJTBlocksPage._onmanagesettings},
637
- 'close-all' : {callback : CJTBlocksPage._ontoggle, params : {state: false}},
638
- 'open-all' : {callback : CJTBlocksPage._ontoggle, params : {state : true}}
639
  }
640
  });
 
 
 
 
 
 
 
641
  // Activate blocks.
642
- CJTBlocksPage.blocks.getBlocks().CJTBlock({state : CJTBlocksPage.getStateName()});
 
643
  // Hide loading image. #cjt-blocks-loader will be used for other loading later.
644
  CJTBlocksPage.loadingImage = CJTBlocksPage.blocksForm.find('#cjt-blocks-loader');
645
  CJTBlocksPage.loadingImage.find('.loading-text').remove();
240
  window.location.href = window.location.href.replace(/&backupId=\d+/, '');
241
  },
242
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
243
  /**
244
  * put your comment there...
245
  *
357
  )
358
  },
359
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
360
  /**
361
  * put your comment there...
362
  *
526
  'add-block' : {callback : CJTBlocksPage._onaddnew},
527
  'restore' : {callback : CJTBlocksPage._onrestore},
528
  'cancel-restore' : {callback : CJTBlocksPage._oncancelrestore},
 
 
529
  'reset-order' : {callback : CJTBlocksPage._onresetorder},
530
  'manage-backups' : {callback : CJTBlocksPage._onmanagebackups},
 
 
 
 
 
531
  'templates-manager' : {callback : CJTBlocksPage._onmanagetemplates},
532
  'global-settings' : {callback : CJTBlocksPage._onmanagesettings},
 
 
533
  }
534
  });
535
+
536
+ $( document ).trigger( 'cjtmanagertoolboxloaded', [ CJTBlocksPage ] );
537
+
538
+ var jBlocks = CJTBlocksPage.blocks.getBlocks();
539
+
540
+ $( document ).trigger( 'cjtmanagerpreloadblocks', [ CJTBlocksPage.blocksForm, jBlocks ] );
541
+
542
  // Activate blocks.
543
+ jBlocks.CJTBlock({state : CJTBlocksPage.getStateName()});
544
+
545
  // Hide loading image. #cjt-blocks-loader will be used for other loading later.
546
  CJTBlocksPage.loadingImage = CJTBlocksPage.blocksForm.find('#cjt-blocks-loader');
547
  CJTBlocksPage.loadingImage.find('.loading-text').remove();
views/blocks/manager/public/js/blocks-page/blocks-page.localization.php CHANGED
@@ -16,9 +16,5 @@ return array(
16
  'confirmRestoreBlocks' => cssJSToolbox::getText('Restoring blocks backup will result in losing all the current blocks.')."\n\n".cssJSToolbox::getText('Are you sure, you\'d like to continue?'),
17
  'unableToRestoreBackup' => cssJSToolbox::getText('Backup could not be restored'),
18
  'manageTemplatesFormTitle' => cssJSToolbox::getText('Templates Manager'),
19
- 'commonDeleteMessage' => cssJSToolbox::getText('You\'re about to delete %d code block(s).'),
20
- 'confirmDeleteAll' => cssJSToolbox::getText('Are you sure you want to delete all code blocks?'),
21
- 'confirmDeleteEmpty' => cssJSToolbox::getText('Are you sure you want to delete all the empty code blocks?'),
22
  'confirmNotSavedChanges' => cssJSToolbox::getText('The changes you made will be lost if you navigate away from this page.'),
23
- 'noBlocksToDelete' => cssJSToolbox::getText('There is no blocks to delete!'),
24
  );
16
  'confirmRestoreBlocks' => cssJSToolbox::getText('Restoring blocks backup will result in losing all the current blocks.')."\n\n".cssJSToolbox::getText('Are you sure, you\'d like to continue?'),
17
  'unableToRestoreBackup' => cssJSToolbox::getText('Backup could not be restored'),
18
  'manageTemplatesFormTitle' => cssJSToolbox::getText('Templates Manager'),
 
 
 
19
  'confirmNotSavedChanges' => cssJSToolbox::getText('The changes you made will be lost if you navigate away from this page.'),
 
20
  );
views/blocks/manager/tmpl/blocks.html.tmpl CHANGED
@@ -9,7 +9,7 @@ defined('ABSPATH') or die("Access denied");
9
  <div id="cjtoolbox-admin" class="wrap">
10
  <?php
11
  $content = '';
12
- echo CJTBlocksManagerView::trigger('CJTBlocksManagerView.loadglobalcomponents', $content);
13
  ?>
14
  <?php require CJTOOLBOX_VIEWS_PATH . '/blocks/block/tmpl/codefile/codefile.html.tmpl' ?>
15
  <div id="custom-icon" class="icon32 blocks-icon32"></div>
9
  <div id="cjtoolbox-admin" class="wrap">
10
  <?php
11
  $content = '';
12
+ echo CJTBlocksManagerView::trigger( 'CJTBlocksManagerView.loadglobalcomponents', $content );
13
  ?>
14
  <?php require CJTOOLBOX_VIEWS_PATH . '/blocks/block/tmpl/codefile/codefile.html.tmpl' ?>
15
  <div id="custom-icon" class="icon32 blocks-icon32"></div>
views/blocks/manager/tmpl/toolbox.html.tmpl CHANGED
@@ -6,21 +6,8 @@
6
  <a class="cjt-tb-link l-127x23 textButton cjttbl-restore" title="<?php echo cssJSToolbox::getText('Save restored Backup') ?>"><?php echo cssJSToolbox::getText('Restore') ?></a>
7
  </div>
8
  <div class="icons-group tools-menu">
9
- <a class="cjt-tb-link cjttbl-state-tools" title="<?php echo cssJSToolbox::getText('Tools for block state (batch)') ?>"></a>
10
- <div class="popup-menu state-tools" style="display:none">
11
- <a class="cjt-tb-link cjt-tb-text-link cjttbl-activate-all" title="<?php echo cssJSToolbox::getText('Activate (turn on) all code blocks') ?>"><?php echo cssJSToolbox::getText('Activate All') ?></a>
12
- <br />
13
- <a class="cjt-tb-link cjt-tb-text-link cjttbl-deactivate-all" title="<?php echo cssJSToolbox::getText('Deactivate (turn off) all code blocks') ?>"><?php echo cssJSToolbox::getText('Deactivate All') ?></a>
14
- <br />
15
- <a class="cjt-tb-link cjt-tb-text-link cjttbl-revert-state" title="<?php echo cssJSToolbox::getText('Switch current state for all code blocks') ?>"><?php echo cssJSToolbox::getText('Revert State') ?></a>
16
- </div>
17
-
18
- <a class="cjt-tb-link cjttbl-location-tools" title="<?php echo cssJSToolbox::getText('Tools for location hook (batch)') ?>"></a>
19
- <div class="popup-menu location-tools" style="display:none">
20
- <a class="cjt-tb-link cjt-tb-text-link cjttbl-footer-all" title="<?php echo cssJSToolbox::getText('Set output location hook to footer for all code blocks') ?>"><?php echo cssJSToolbox::getText('Footer all') ?></a>
21
- <br />
22
- <a class="cjt-tb-link cjt-tb-text-link cjttbl-header-all" title="<?php echo cssJSToolbox::getText('Set output location hook to header for all code blocks') ?>"><?php echo cssJSToolbox::getText('Header all') ?></a>
23
- </div>
24
 
25
  <div class="divider"></div>
26
  <a class="cjt-tb-link cjttbl-templates-manager" title="<?php echo cssJSToolbox::getText('Code Template Manager') ?>"></a>
@@ -28,16 +15,15 @@
28
  <div class="divider"></div>
29
  <a class="cjt-tb-link cjttbl-admin-tools" title="<?php echo cssJSToolbox::getText('Tools for block cleanup and backup') ?>"></a>
30
  <div class="popup-menu admin-tools" style="display:none">
31
- <a class="cjt-tb-link cjt-tb-text-link cjttbl-delete-all" title="<?php echo cssJSToolbox::getText('Delete all code blocks') ?>"><?php echo cssJSToolbox::getText('Delete all') ?></a>
32
- <br />
33
- <a class="cjt-tb-link cjt-tb-text-link cjttbl-delete-empty" title="<?php echo cssJSToolbox::getText('Delete only empty code blocks') ?>"><?php echo cssJSToolbox::getText('Delete Empty') ?></a>
34
- <br />
35
  <a class="cjt-tb-link cjt-tb-text-link cjttbl-manage-backups" title="<?php echo cssJSToolbox::getText('Backup Manager - Create, restore, or delete backups') ?>"><?php echo cssJSToolbox::getText('Backups') ?></a>
 
36
  </div>
37
 
38
  <a class="cjt-tb-link cjttbl-global-settings" title="<?php echo cssJSToolbox::getText('General plugin settings') ?>"></a>
39
- <div class="divider"></div>
40
- <a class="cjt-tb-link cjttbl-open-all" title="<?php echo cssJSToolbox::getText('Maximise all code blocks') ?>"></a>
41
- <a class="cjt-tb-link cjttbl-close-all" title="<?php echo cssJSToolbox::getText('Minimise all code blocks') ?>"></a>
42
  </div>
43
  </div>
6
  <a class="cjt-tb-link l-127x23 textButton cjttbl-restore" title="<?php echo cssJSToolbox::getText('Save restored Backup') ?>"><?php echo cssJSToolbox::getText('Restore') ?></a>
7
  </div>
8
  <div class="icons-group tools-menu">
9
+
10
+ <?php do_action( CJTPluggableHelper::ACTION_BLOCKS_MANAGER_TOOLBOX_LEFT_BUTTONS ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
11
 
12
  <div class="divider"></div>
13
  <a class="cjt-tb-link cjttbl-templates-manager" title="<?php echo cssJSToolbox::getText('Code Template Manager') ?>"></a>
15
  <div class="divider"></div>
16
  <a class="cjt-tb-link cjttbl-admin-tools" title="<?php echo cssJSToolbox::getText('Tools for block cleanup and backup') ?>"></a>
17
  <div class="popup-menu admin-tools" style="display:none">
18
+
19
+ <?php do_action( CJTPluggableHelper::ACTION_BLOCKS_MANAGER_TOOLBOX_ADMIN_TOOLS_TOP ); ?>
20
+
 
21
  <a class="cjt-tb-link cjt-tb-text-link cjttbl-manage-backups" title="<?php echo cssJSToolbox::getText('Backup Manager - Create, restore, or delete backups') ?>"><?php echo cssJSToolbox::getText('Backups') ?></a>
22
+
23
  </div>
24
 
25
  <a class="cjt-tb-link cjttbl-global-settings" title="<?php echo cssJSToolbox::getText('General plugin settings') ?>"></a>
26
+ <?php do_action( CJTPluggableHelper::ACTION_BLOCKS_MANAGER_TOOLBOX_RIGHT_BUTTONS ); ?>
27
+
 
28
  </div>
29
  </div>
views/blocks/metabox/public/js/metabox/metabox.js CHANGED
@@ -179,22 +179,32 @@ var CJTBlocksPage;
179
  * put your comment there...
180
  *
181
  */
182
- init : function() {
 
183
  // Initialize vars.
184
  this.blocksForm = $('form[name="post"]');
 
185
  // Use plural getBlocks() and dont worry, we've only one block metabox.
186
  this.blocks = new CJTBlocks();
187
  this.server = CJTServer;
 
188
  // Initilize Global-Blocks Conponents.
189
  CJTBlockCodeFileView.initialize();
 
 
 
190
  // Put CJT code block into actions!
191
  var blocks = this.blocks.getBlocks().CJTBlock({calculatePinPoint : 0});
 
192
  // Fix thickbox issue caused by media-upload.js script.
193
  this.metaboxBlockToolbox = blocks.get(0).CJTBlock.toolbox;
 
194
  this.metaboxBlockToolbox.buttons['info'].callback = $.proxy(this._onshowthickbox, {event : '_ongetinfo'});
195
- this.metaboxBlockToolbox.buttons['revisions'].callback = $.proxy(this._onshowthickbox, {event : '_ondisplayrevisions'});
196
  // Notify saving changes.
197
  this.wpAutoSave.timer = window.setInterval($.proxy(this.detectWordpressAutoSaveAlertEvent, this), 100);
 
 
198
  }
199
 
200
  };
179
  * put your comment there...
180
  *
181
  */
182
+ init : function()
183
+ {
184
  // Initialize vars.
185
  this.blocksForm = $('form[name="post"]');
186
+
187
  // Use plural getBlocks() and dont worry, we've only one block metabox.
188
  this.blocks = new CJTBlocks();
189
  this.server = CJTServer;
190
+
191
  // Initilize Global-Blocks Conponents.
192
  CJTBlockCodeFileView.initialize();
193
+
194
+ $( document ).trigger( 'cjtmanagerpreloadblocks', [ this.blocksForm, this.blocks.getBlocks() ] );
195
+
196
  // Put CJT code block into actions!
197
  var blocks = this.blocks.getBlocks().CJTBlock({calculatePinPoint : 0});
198
+
199
  // Fix thickbox issue caused by media-upload.js script.
200
  this.metaboxBlockToolbox = blocks.get(0).CJTBlock.toolbox;
201
+
202
  this.metaboxBlockToolbox.buttons['info'].callback = $.proxy(this._onshowthickbox, {event : '_ongetinfo'});
203
+
204
  // Notify saving changes.
205
  this.wpAutoSave.timer = window.setInterval($.proxy(this.detectWordpressAutoSaveAlertEvent, this), 100);
206
+
207
+ this.blocksForm.trigger( 'cjtblocksinitmetaboxpage', [ this, blocks.get(0).CJTBlock ] );
208
  }
209
 
210
  };
views/blocks/metabox/tmpl/metabox.html.tmpl CHANGED
@@ -8,7 +8,7 @@ defined('ABSPATH') or die("Access denied");
8
 
9
  // Global Comonents eent
10
  $content = '';
11
- echo CJTBlocksMetaBoxView::trigger('CJTBlocksMetaBoxView.loadglobalcomponents', $content);
12
 
13
  // Block Templates.
14
  require CJTOOLBOX_VIEWS_PATH . '/blocks/block/tmpl/codefile/codefile.html.tmpl';
8
 
9
  // Global Comonents eent
10
  $content = '';
11
+ echo CJTBlocksMetaBoxView::trigger( 'CJTBlocksMetaBoxView.loadglobalcomponents', $content );
12
 
13
  // Block Templates.
14
  require CJTOOLBOX_VIEWS_PATH . '/blocks/block/tmpl/codefile/codefile.html.tmpl';
views/tinymce/params/public/css/style.css DELETED
@@ -1,22 +0,0 @@
1
- body {font-size: 11px;}
2
- ul {list-style-type: none; padding: 0; margin: 0;}
3
- fieldset {border: 1px solid #EFEFEF !important; position: relative;}
4
- .cjt-form ul li {margin-bottom: 9px;}
5
-
6
- .cjt-shortcode-parameters-form-helpText {
7
- font-size: 10px;
8
- font-family: arial;
9
- color: gray;
10
- position: absolute;
11
- height: 30px;
12
- margin: 2px 8px 0px 10px;
13
- display: inline-block;
14
- }
15
- .cjt-shortcode-parameters-form-helpText .helpText {
16
- overflow: auto;
17
- max-height: 26px;
18
- }
19
-
20
- #shortcode-params-form fieldset {margin-left: -10px;}
21
- #shortcode-params-form label {width: 200px; color: #505050 !important;}
22
- #shortcode-params-form input {margin-left: 0px;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/tinymce/params/public/js/form/form.js DELETED
@@ -1,86 +0,0 @@
1
- /**
2
- *
3
- */
4
-
5
- /**
6
- *
7
- */
8
- (function($) {
9
- /**
10
- *
11
- */
12
- var CJTTinymceParamsView = {
13
-
14
- /**
15
- * put your comment there...
16
- *
17
- */
18
- tb_position : parent.tb_position,
19
-
20
- /**
21
- *
22
- */
23
- _onclose : function() {
24
- // Close Thickbox!
25
- parent.tb_remove();
26
- },
27
-
28
- /**
29
- *
30
- */
31
- _ondone : function() {
32
- parent.CJTServer.send('tinymceBlocks', 'getShortcode', this.form.serializeObject(), 'post')
33
- .success($.proxy(
34
- function(response) {
35
- switch (response.state) {
36
- case 'invalid':
37
- // Show invalid messages
38
- // @TODO Use Simple Error dialog.
39
- alert(response.content);
40
- break;
41
- case 'shortcode-notation':
42
- // @TODO :Wrap Shortcode content string with a span element for later references when updating is in need. Generate dynamic ID for the span too.
43
- var shortcodeInstance = response.content;
44
- // Get CJT editor instance.
45
- var editor = parent.CJT.codeEditor;
46
- // Place Shortcode string.
47
- editor.selection.setContent(shortcodeInstance);
48
- editor.focus();
49
- // End me!
50
- this._onclose();
51
- break;
52
- }
53
- }, this)
54
- );
55
- },
56
-
57
- /**
58
- * put your comment there...
59
- *
60
- */
61
- _onunload : function() {
62
- // Restore tb_position.
63
- parent.tb_position = this.tb_position;
64
- },
65
-
66
- /**
67
- * put your comment there...
68
- *
69
- */
70
- init : function() {
71
- // Initialize.
72
- this.form = $('#shortcode-params-form');
73
- // Bind events!
74
- $('#btn-close').click($.proxy(this._onclose, this));
75
- $('#btn-done').click($.proxy(this._ondone, this));
76
- // Don't allow form resizing!
77
- parent.tb_position = function() {};
78
- // Restore tb_position whe unload
79
- window.addEventListener('unload', $.proxy(this._onunload, this));
80
- }
81
-
82
- } // End view class.
83
-
84
- // Load.
85
- $($.proxy(CJTTinymceParamsView.init, CJTTinymceParamsView));
86
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/tinymce/params/tmpl/default.html.tmpl DELETED
@@ -1,54 +0,0 @@
1
- <?php
2
- /**
3
- *
4
- */
5
-
6
- // Disallow direct access.
7
- defined('ABSPATH') or die("Access denied");
8
-
9
- // Allow view to enqueue scripts and styles.
10
- CJTTinymceParamsView::enqueueScripts();
11
- CJTTinymceParamsView::enqueueStyles();
12
- $this->suppressPrintScriptsHook();
13
-
14
- // Initialize.
15
- $blockId = $this->getParam('blockId');
16
-
17
- // Block Package info.
18
- $packageInfo = new CJT_Models_Package_Block($blockId);
19
- $packageInfo = $packageInfo->getPackageInfo();
20
- ?>
21
- <html xmlns="http://www.w3.org/1999/xhtml">
22
- <head>
23
- <?php wp_print_head_scripts() ?>
24
- <?php wp_print_styles() ?>
25
- </head>
26
- <body>
27
- <div id="cjtoolbox_popup">
28
- <form id="shortcode-params-form" class="cjt-form">
29
- <?php echo $this->grouper ?>
30
- <input type="button" id="btn-close" value="<?php echo cssJSToolbox::getText('Close') ?>">
31
- <input type="button" id="btn-done" value="<?php echo cssJSToolbox::getText('Done') ?>">
32
- <input type="hidden" name="blockId" value="<?php echo $blockId ?>">
33
- <?php if ($packageInfo) : ?>
34
- <span class="packag-info">
35
- <?php echo cssJSToolbox::getText('By') ?>: <a target="_blank" href="<?php echo $packageInfo['webSite'] ?>"><?php echo $packageInfo['author'] ?></a>
36
- </span>
37
- <?php endif; ?>
38
- </form>
39
- <?php print_footer_scripts() ?>
40
- </div>
41
- <script type="text/javascript">
42
- // Apply TABs Plugin!
43
- jQuery(function($) {
44
- // Force form size.
45
- var size = {'width' : '670px', 'height' : '600px'};
46
- parent.jQuery('#TB_window').css(size);
47
- size.height -= 10;
48
- parent.jQuery('#TB_iframeContent').css(size);
49
- // Tab size.
50
- $('#cjt-grouper-tab-navigator').tabs().css({height: '527px'});
51
- });
52
- </script>
53
- </body>
54
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/tinymce/params/view.php DELETED
@@ -1,112 +0,0 @@
1
- <?php
2
- /**
3
- *
4
- */
5
-
6
- /**
7
- *
8
- */
9
- class CJTTinymceParamsView extends CJTView {
10
-
11
- /**
12
- * put your comment there...
13
- *
14
- * @var mixed
15
- */
16
- protected $grouper = null;
17
-
18
- /**
19
- * put your comment there...
20
- *
21
- * @var mixed
22
- */
23
- protected $groups = null;
24
-
25
- /**
26
- * put your comment there...
27
- *
28
- * @var mixed
29
- */
30
- protected $packageInfo = null;
31
-
32
- /**
33
- * put your comment there...
34
- *
35
- * @param mixed $viewInfo
36
- * @return CJTTinymceParamsView
37
- */
38
- public function __construct($viewInfo, $params) {
39
- // Parent procedure!
40
- parent::__construct($viewInfo, $params);
41
- // Prepare groups array.
42
- foreach ($params['groups'] as $group) {
43
- // Initialize group info array.
44
- $group['params'] = array();
45
- // Group Key.
46
- $group['key'] = strtolower(str_replace(array(' '), '-', $group['name']));
47
- // Get group data cxopy.
48
- $this->groups[$group['id']] = $group;
49
- }
50
- // Put the Group woth the loest ID first,
51
- // Display in the same order they're added!
52
- ksort($this->groups);
53
- // Prepare groups from the passed parameters.
54
- foreach ($params['params'] as $param) {
55
- // Add parameter under its group!
56
- $this->groups[$param->getDefinition()->getGroupId()]['params'][] = $param;
57
- }
58
- // Instantiate grouper.
59
- // Only tab grouper is supported for now!
60
- $grouperFactory = new CJT_Framework_View_Block_Parameter_Grouper_Factory();
61
- $this->grouper = $grouperFactory->create(
62
- $params['form']->groupType,
63
- $this->groups
64
- );
65
- }
66
-
67
- /**
68
- * Output Javascript files requirred to Add-New-Block view to run.
69
- *
70
- * @return void
71
- */
72
- public function enqueueScripts() {
73
- // Scripts required by the form to run.
74
- $scripts = array(
75
- 'jquery',
76
- 'jquery-serialize-object',
77
- 'views:tinymce:params:public:js:{CJT_TINYMCE_PARAMS-}form',
78
- 'framework:js:misc:{CJT-}simple-error-dialog'
79
- );
80
- // Scripts required by the grouper.
81
- $scripts = array_merge($scripts, $this->getGrouper()->enqueueScripts());
82
- // Use related scripts.
83
- self::useScripts(__CLASS__, $scripts);
84
- }
85
-
86
- /**
87
- * Output CSS files required to Add-New-Block view.
88
- *
89
- * @return void
90
- */
91
- public function enqueueStyles() {
92
- // Styles required by the params form.
93
- $styles = array(
94
- 'framework:css:{CJT-}forms',
95
- 'framework:css:{CJT-}error-dialog',
96
- 'views:tinymce:params:public:css:{CJT_TINY_MCE_PARAMS_FORM-}style'
97
- );
98
- // Groupe styles.
99
- $styles = array_merge($styles, $this->getGrouper()->enqueueStyles());
100
- // Use related styles.
101
- self::useStyles(__CLASS__, $styles);
102
- }
103
-
104
- /**
105
- * put your comment there...
106
- *
107
- */
108
- public function getGrouper() {
109
- return $this->grouper;
110
- }
111
-
112
- } // End class.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/tinymce/shortcodes/public/plugins/shortcode/css/shortcode.css DELETED
@@ -1,8 +0,0 @@
1
- .mce-i-cjt-blocks-list-tinymce-button {
2
- background-image: url('../images/blocks.png') !important;
3
- opacity: 0.6; filter:alpha(opacity = 60%)
4
- }
5
- .mce-i-cjt-blocks-list-tinymce-button.cjt-loading {
6
- background-image: url('../../../../../../../framework/css/images/loading.gif') !important;
7
- }
8
- .mce-i-cjt-blocks-list-tinymce-button:hover {opacity: 1; filter:alpha(opacity = 100%)}
 
 
 
 
 
 
 
 
views/tinymce/shortcodes/public/plugins/shortcode/images/blocks.png DELETED
Binary file
views/tinymce/shortcodes/public/plugins/shortcode/langs/en.js DELETED
@@ -1,8 +0,0 @@
1
- /**
2
- *
3
- */
4
-
5
- /**
6
- *
7
- */
8
- var CJTBlockShortcode = {title : 'Insert CJT Block Shortcode'};
 
 
 
 
 
 
 
 
views/tinymce/shortcodes/public/plugins/shortcode/shortcode.js DELETED
@@ -1,103 +0,0 @@
1
- /**
2
- *
3
- */
4
-
5
- if (CJT === undefined) {
6
- var CJT = {};
7
- }
8
-
9
- /**
10
- * TinyMCE Plugin for inserting CJT Block Shortcode
11
- * into Wordpress TinyMCE Editor!
12
- *
13
- */
14
- (function($) {
15
-
16
- // Create Plugin.
17
- tinyMCE.PluginManager.add('CJTShortcodes', function(editor, url) {
18
-
19
- // Load CSS!
20
- tinymce.DOM.loadCSS(url + '/css/shortcode.css');
21
-
22
- // Cache Editor
23
- CJT.codeEditor = editor;
24
-
25
- /**
26
- * put your comment there...
27
- *
28
- */
29
- var _onselectblock = function() {
30
- // Read selected block!
31
- var block = this;
32
- var requestStruct = {blockId : block._id};
33
- // Request Shortcode from server!
34
- CJTServer.send('tinymceBlocks', 'getShortcode', requestStruct)
35
- .success($.proxy(
36
- function(response) {
37
- switch (response.state) {
38
- case 'shortcode-notation':
39
- // Insert shortcode at current cursor position.
40
- editor.selection.setContent(response.content);
41
- editor.focus();
42
- break;
43
- case 'show-form':
44
- // Show in IFRAME window!
45
- requestStruct.width = 700;
46
- requestStruct.height = 600;
47
- requestStruct.TB_iframe = true;
48
- // @TODO: Localize Form Title!
49
- tb_show(block.formTitle, CJTServer.getRequestURL('tinymceBlocks', 'getBlockParametersForm', requestStruct))
50
- break;
51
- }
52
- }, this)
53
- );
54
- };
55
-
56
- // Create Shortcodes list button
57
- editor.addButton('CJTBlockShortcode', {
58
- type : 'menubutton',
59
- title : CJTBlockShortcode.title,
60
- icon : 'cjt-blocks-list-tinymce-button',
61
- menu : {style : 'overflow:true;max-height:356px;width:280px'},
62
- onCreateMenu : function() {
63
- // Get Menu Object created by tinyMCE behind the sense.
64
- var menu = editor.controlManager.buttons.CJTBlockShortcode.menu;
65
- // Start progress/loading image!
66
- var tinyMCEButton = $('.mce-i-cjt-blocks-list-tinymce-button')
67
- .addClass('cjt-loading');
68
- // Read blocks from server!
69
- CJTServer.send('tinymceBlocks', 'getBlocksList')
70
- .success($.proxy(
71
- function(blocks) {
72
- // If not blocks do nothing!
73
- if (!blocks.count) {
74
- blocks.list = [];
75
- }
76
- // Add blocks as menu item!
77
- $.each(blocks.list, $.proxy(
78
- function(id, block) {
79
- // Bind to select event!
80
- block.onclick = _onselectblock;
81
- // Get a copy of block original name.
82
- block.name = block.title;
83
- // Prepend ID to block title!
84
- block.text = '#' + id + ': ' + block.title;
85
- // Add item!
86
- menu.add(block);
87
- }, this)
88
- )
89
- }, this)
90
- ).complete($.proxy(
91
- function() {
92
- // Refresh / Render new added items.
93
- menu.renderNew();
94
- // Stop progress/loading image!
95
- tinyMCEButton.removeClass('cjt-loading');
96
- }, this)
97
- );
98
- }
99
- });
100
-
101
- }); // End TinyMCE Plugin!
102
-
103
- })(jQuery); // End TinyMCE Plugin namespace!
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/tinymce/shortcodes/tmpl/default.html.tmpl DELETED
@@ -1,25 +0,0 @@
1
- <?php
2
- /**
3
- *
4
- */
5
-
6
- // No direct access.
7
- defined('ABSPATH') or die('Access denied');
8
-
9
- // We need a security token in case thatt he tinymce
10
- // is running on a page dosn't has metabox or create-metabox
11
- // views embedded to it!
12
- ?>
13
- <script type="text/javascript">
14
- (function($) {
15
- // If CJTServer is not running yet then
16
- // pass a seucritt token as it run on footer!
17
- // runs of footer mean there is no Block metabox for current post type
18
- // and therefore there is no security token generated!
19
- $(function() {
20
- if (!CJTServer.securityToken) {
21
- CJTServer.securityToken = '<?php echo cssJSToolbox::getSecurityToken() ?>';
22
- }
23
- });
24
- })(jQuery);
25
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/tinymce/shortcodes/view.php DELETED
@@ -1,86 +0,0 @@
1
- <?php
2
- /**
3
- *
4
- */
5
-
6
- // No direct access.
7
- defined('ABSPATH') or die('Access denied');
8
-
9
- /**
10
- *
11
- */
12
- class CJTTinymceShortcodesView extends CJTView {
13
-
14
- /**
15
- * put your comment there...
16
- *
17
- * @param mixed $info
18
- * @return CJTTinymceShortcodesView
19
- */
20
- public function __construct($info) {
21
- // Initialize parent!
22
- parent::__construct($info);
23
- // Register TinyMCE Plugin with Wordpress!
24
- add_filter('mce_external_plugins', array($this, 'registerPlugin'), 1, 11);
25
- // Add TinyMCE button for adding shortcode!
26
- add_filter('mce_buttons', array($this, 'addButton'));
27
- // Enqueue dependencies scripts.
28
- self::enqueueScripts();
29
- self::enqueueStyles();
30
- }
31
-
32
- /**
33
- * put your comment there...
34
- *
35
- * @param mixed $buttons
36
- */
37
- public function addButton($buttons) {
38
- // Add Blocks Shortcode button!
39
- array_push($buttons, 'separator', 'CJTBlockShortcode');
40
- return $buttons;
41
- }
42
-
43
- /**
44
- * put your comment there...
45
- *
46
- * @param mixed $tpl
47
- */
48
- public function display($tpl = null) {
49
- // Output view!
50
- echo $this->getTemplate($tpl);
51
- }
52
-
53
- /**
54
- * put your comment there...
55
- *
56
- */
57
- public function enqueueScripts() {
58
- // Please thos scripts below should be already loaded
59
- // by the metabox views If the tinymce is loaded inside the editbox
60
- // IN OTHER CASES!!! what is the other cases! we load it!
61
- self::useScripts(__CLASS__,
62
- 'thickbox',
63
- 'framework:js:ajax:{CJT-}cjt-server'
64
- );
65
- }
66
-
67
- /**
68
- * put your comment there...
69
- *
70
- */
71
- public function enqueueStyles() {
72
- self::useStyles(__CLASS__, 'thickbox');
73
- }
74
-
75
- /**
76
- * put your comment there...
77
- *
78
- * @param mixed $plugins
79
- */
80
- public function registerPlugin($plugins) {
81
- // Register shortcode TinyMCE button Plugin.
82
- $plugins['CJTShortcodes'] = $this->getURI('plugins/shortcode/shortcode.js');
83
- return $plugins;
84
- }
85
-
86
- } // End class.