PluginProbe
CSS & JavaScript Toolbox / 7.1
CSS & JavaScript Toolbox v7.1
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 +43 -80 117.1 View file →
@@ -9,57 +9,50 @@
9 9 /**
10 10 * Blocks view
11 11 */
12 12 class CJTBlocksBlockView extends CJTView {
13 -
13 +
14 14 /** */
15 15 const META_BOX_PREFIX = 'cjtoolbox';
16 -
16 +
17 17 /**
18 18 * put your comment there...
19 - *
19 + *
20 20 * @var mixed
21 21 */
22 22 public $block = null;
23 -
23 +
24 24 /**
25 25 * put your comment there...
26 - *
26 + *
27 27 * @var mixed
28 28 */
29 29 public $isClosed;
30 -
30 +
31 31 /**
32 32 * put your comment there...
33 - *
33 + *
34 34 * @var mixed
35 35 */
36 36 protected $localization;
37 -
38 - /**
39 - * put your comment there...
40 - *
41 - * @var mixed
42 - */
43 - protected $ontoolbox = array('parameters' => array('block'));
44 -
37 +
45 38 /**
46 39 * put your comment there...
47 - *
40 + *
48 41 * @var mixed
49 42 */
50 43 protected $params = array();
51 -
44 +
52 45 /**
53 46 * put your comment there...
54 - *
47 + *
55 48 * @var mixed
56 49 */
57 50 public $templateName = 'edit';
58 -
51 +
59 52 /**
60 53 * put your comment there...
61 - *
54 + *
62 55 */
63 56 public function __construct($viewInfo) {
64 57 parent::__construct($viewInfo);
65 58 // Enqueue Styles & Scripts.
@@ -69,29 +62,30 @@
69 62 $this->params = (object) $this->params;
70 63 // Load localization text.
71 64 $this->localization = require($this->getPath('public/js/jquery.block/jquery.block.localization.php'));
72 65 }
73 -
66 +
74 67 /**
75 68 * put your comment there...
76 - *
69 + *
77 70 */
78 71 public function display($template = null) {
79 72 // Import template.
80 73 echo $this->getTemplate($template ? $template : $this->templateName);
81 74 }
82 -
75 +
83 76 /**
84 77 * put your comment there...
85 - *
78 + *
86 79 */
87 80 public static function enqueueScripts() {
88 81 // Use related scripts.
89 82 self::useScripts(__CLASS__,
90 83 'jquery',
91 - 'common',
92 - 'wp-lists',
93 - 'postbox',
84 + 'jquery-ui-menu',
85 + 'common',
86 + 'wp-lists',
87 + 'postbox',
94 88 'thickbox',
95 89 'framework:js:hash:{CJT-}md5',
96 90 'framework:js:cookies:{CJT-}jquery.cookies.2.2.0',
97 91 'framework:js:ajax:{CJT-}cjt-server',
@@ -101,19 +95,20 @@
101 95 'framework:js:ace:{CJT-}pluggable',
102 96 'views:blocks:block:public:js:{CJT-}ajax',
103 97 'views:blocks:block:public:js:{CJT-}blockproperty',
104 98 'views:blocks:block:public:js:optional:{CJT-}revision',
99 + 'views:blocks:block:public:js:{CJT-}menu',
100 + 'views:blocks:block:public:js:menu:{CJT-}_block',
105 101 'views:blocks:block:public:js:{CJT-}codefile-manager',
106 102 'views:blocks:block:public:js:{CJT-}codefile',
107 103 'views:blocks:block:public:js:{CJT-}block',
108 - 'views:blocks:block:public:js:plugins:{CJT-}_dockmodule',
109 - 'views:blocks:block:public:js:{CJT-}jquery.block'
104 + 'views:blocks:block:public:js:{CJT-}jquery.block'
110 105 );
111 106 }
112 -
107 +
113 108 /**
114 109 * put your comment there...
115 - *
110 + *
116 111 */
117 112 public static function enqueueStyles() {
118 113 // Initialize style.
119 114 $styles = array(
@@ -118,8 +113,9 @@
118 113 // Initialize style.
119 114 $styles = array(
120 115 'thickbox',
121 116 'views:blocks:block:public:css:{CJT-}block',
117 + 'views:blocks:block:public:css:{CJT-}menu',
122 118 'views:blocks:block:public:css:{CJT-}codefile'
123 119 );
124 120 // IF WP < 3.8 add compatibility CSS file.
125 121 $wpVersion = new CJT_Framework_Wordpress_Currentversion();
@@ -128,80 +124,47 @@
128 124 }
129 125 // Include styles.
130 126 self::useStyles(__CLASS__, $styles);
131 127 }
132 -
133 - /**
134 - * put your comment there...
135 - *
136 - * @param mixed $block
137 - */
138 - public function getAllAssignments() {
139 -
140 - return CJTBlocksModel::getAllAssignments($this->block);
141 - }
142 -
128 +
143 129 /**
144 130 * put your comment there...
145 - *
131 + *
146 132 */
147 133 public function getBlock() {
148 - return $this->block;
134 + return $this->block;
149 135 }
150 -
151 - /**
152 - * put your comment there...
153 - *
154 - */
155 - public function getHookStatus() {
156 -
157 - $hooksAttacher =& CJTBlocksCouplingController::theInstance()->getHooksAttacher();
158 -
159 - $locationText = $hooksAttacher->getHookText($this->block->location);
160 - $locationTitle = $hooksAttacher->getHookText($this->block->location, 'title');
161 - $badLocationClass = '';
162 -
163 - if(!$locationText) {
164 -
165 - $badLocationClass = 'bad-location-specified';
166 - $locationText = cssJSToolbox::getText('Hook is not supported, it might be assigned by some kind of CJT hooks extensions. You either need to re-enable/re-install that extension or change the hook value to one of the supported hooks');
167 - }
168 -
169 - $text = compact('badLocationClass', 'locationText', 'locationTitle');
170 -
171 - return $text;
172 - }
173 -
136 +
174 137 /**
175 138 * put your comment there...
176 - *
139 + *
177 140 */
178 141 public function getMetaboxName() {
179 142 $tip = cssJSToolbox::getText('Click to update Block name');
180 - return "<input name='cjtoolbox[{$this->block->id}][name]' type='text' class='block-name' value='{$this->block->name}' title='{$tip}' maxlength='50' />";
143 + return "<span class='block-name' title='{$tip}'>{$this->block->name}</span>";
181 144 }
182 -
145 +
183 146 /**
184 147 * put your comment there...
185 - *
148 + *
186 149 * @param mixed $id
187 150 */
188 151 public function getMetaboxId() {
189 152 return self::META_BOX_PREFIX ."-{$this->block->id}";
190 153 }
191 -
154 +
192 155 /**
193 156 * put your comment there...
194 - *
157 + *
195 158 * @param mixed $name
196 159 */
197 160 public function getOption($name) {
198 161 return $this->params->{$name};
199 162 }
200 -
163 +
201 164 /**
202 - *
203 - *
165 + *
166 + *
204 167 */
205 168 public function setBlock($block) {
206 169 // Set block.
207 170 $this->block = $block;
@@ -209,12 +172,12 @@
209 172 $closedBlockId = "cjtoolbox-{$this->block->id}";
210 173 $closedMetaboxes = get_user_meta(get_current_user_id(), 'closedpostboxes_cjtoolbox', true);
211 174 $this->isClosed = in_array($closedBlockId, ((array) $closedMetaboxes));
212 175 }
213 -
176 +
214 177 /**
215 178 * put your comment there...
216 - *
179 + *
217 180 * @param mixed $name
218 181 * @param mixed $value
219 182 */
220 183 public function setOption($name, $value) {
@@ -221,9 +184,9 @@
221 184 $this->params->{$name} = $value;
222 185 // Chains!
223 186 return $this;
224 187 }
225 -
188 +
226 189 } // End class.
227 190
228 191 // Hookable!
229 192 CJTBlocksBlockView::define('CJTBlocksBlockView');