PluginProbe
CSS & JavaScript Toolbox / 8.0.3
CSS & JavaScript Toolbox v8.0.3
trunk 0.3 0.8 10 10.1 11 11.2 11.3 11.4 11.5 11.6 11.7 11.8 11.9 11.9.1 12 12.0 12.0.1 12.0.3 12.0.4 12.0.5 12.0.6 12.0.7 6.0 6.0.11 All 60 releases
← All changes | views/blocks/block/view.php +31 -6 6.08.0.3 View file →
@@ -25,8 +25,15 @@
25 25 * put your comment there...
26 26 *
27 27 * @var mixed
28 28 */
29 + public $isClosed;
30 +
31 + /**
32 + * put your comment there...
33 + *
34 + * @var mixed
35 + */
29 36 protected $localization;
30 37
31 38 /**
32 39 * put your comment there...
@@ -60,11 +67,11 @@
60 67 /**
61 68 * put your comment there...
62 69 *
63 70 */
64 - public function display() {
71 + public function display($template = null) {
65 72 // Import template.
66 - echo $this->getTemplate($this->templateName);
73 + echo $this->getTemplate($template ? $template : $this->templateName);
67 74 }
68 75
69 76 /**
70 77 * put your comment there...
@@ -72,9 +79,9 @@
72 79 */
73 80 public static function enqueueScripts() {
74 81 // Use related scripts.
75 82 self::useScripts(__CLASS__,
76 - 'jquery',
83 + 'jquery',
77 84 'common',
78 85 'wp-lists',
79 86 'postbox',
80 87 'thickbox',
@@ -85,9 +92,14 @@
85 92 'framework:js:ui:{CJT-}jquery.toolbox',
86 93 'framework:js:ace(loadMethod=Tag, lookFor=ace)',
87 94 'framework:js:ace:{CJT-}pluggable',
88 95 'views:blocks:block:public:js:{CJT-}ajax',
96 + 'views:blocks:block:public:js:{CJT-}blockproperty',
97 + 'views:blocks:block:public:js:optional:{CJT-}revision',
98 + 'views:blocks:block:public:js:{CJT-}codefile-manager',
99 + 'views:blocks:block:public:js:{CJT-}codefile',
89 100 'views:blocks:block:public:js:{CJT-}block',
101 + 'views:blocks:block:public:js:plugins:{CJT-}_dockmodule',
90 102 'views:blocks:block:public:js:{CJT-}jquery.block'
91 103 );
92 104 }
93 105
@@ -95,13 +107,21 @@
95 107 * put your comment there...
96 108 *
97 109 */
98 110 public static function enqueueStyles() {
99 - // Use related styles.
100 - self::useStyles(__CLASS__,
111 + // Initialize style.
112 + $styles = array(
101 113 'thickbox',
102 - 'views:blocks:block:public:css:{CJT-}block'
114 + 'views:blocks:block:public:css:{CJT-}block',
115 + 'views:blocks:block:public:css:{CJT-}codefile'
103 116 );
117 + // IF WP < 3.8 add compatibility CSS file.
118 + $wpVersion = new CJT_Framework_Wordpress_Currentversion();
119 + if ($wpVersion->isLess('3.8')) {
120 + $styles[] = 'views:blocks:block:public:css:{CJT-}block-wp-lt-3.8';
121 + }
122 + // Include styles.
123 + self::useStyles(__CLASS__, $styles);
104 124 }
105 125
106 126 /**
107 127 * put your comment there...
@@ -142,9 +162,14 @@
142 162 *
143 163 *
144 164 */
145 165 public function setBlock($block) {
166 + // Set block.
146 167 $this->block = $block;
168 + // Get block state (opened/closes)
169 + $closedBlockId = "cjtoolbox-{$this->block->id}";
170 + $closedMetaboxes = get_user_meta(get_current_user_id(), 'closedpostboxes_cjtoolbox', true);
171 + $this->isClosed = in_array($closedBlockId, ((array) $closedMetaboxes));
147 172 }
148 173
149 174 /**
150 175 * put your comment there...