PluginProbe
CSS & JavaScript Toolbox / 12.0.6
CSS & JavaScript Toolbox v12.0.6
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
css-javascript-toolbox / views / blocks / metabox / view.php

view.php in CSS & JavaScript Toolbox 12.0.6, at views/blocks/metabox/view.php

196 lines 4.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 *
4 */
5
6 /**
7 *
8 */
9 class CJTBlocksMetaBoxView extends CJTView {
10
11 /**
12 * put your comment there...
13 *
14 * @var mixed
15 */
16 protected $blockView = null;
17
18 /**
19 * put your comment there...
20 *
21 * @var mixed
22 */
23 protected static $onloadglobalcomponents = array(
24 'hookType' => CJTWordpressEvents::HOOK_FILTER,
25 'parameters' => array('content')
26 );
27
28 /**
29 * put your comment there...
30 *
31 * @var mixed
32 */
33 protected $options = null;
34
35 /**
36 * put your comment there...
37 *
38 * @var mixed
39 */
40 protected $securityToken = null;
41
42 /**
43 * put your comment there...
44 *
45 * @param mixed $viewInfo
46 * @return CJTBlockMetaBoxView
47 */
48 public function __construct($viewInfo) {
49 parent::__construct($viewInfo);
50 // Initialize vars.
51 $this->options = (object) array();
52 // Add scripts ands styles actions.
53 add_action('admin_print_scripts', array(__CLASS__, 'enqueueScripts'));
54 add_action('admin_print_styles', array(__CLASS__, 'enqueueStyles'));
55 // Create block view.
56 $this->blockView = self::create('blocks/block');
57 }
58
59 /**
60 * put your comment there...
61 *
62 */
63 public function display() {
64 // Display content.
65 echo $this->getTemplate('metabox');
66 }
67
68 /**
69 * put your comment there...
70 *
71 */
72 public static function enqueueScripts() {
73 // Regular block scripts.
74 CJTBlocksBlockView::enqueueScripts();
75 // Use related scripts.
76 self::useScripts(__CLASS__,
77 'views:blocks:metabox:public:js:{CJT-}metabox',
78 'views:blocks:manager:public:js:{CJT-}blocks',
79 'views:blocks:metabox:public:js:optional:{CJT_CJT_BLOCK-}revision',
80 'views:blocks:metabox:public:js:{CJT_METABOX_BLOCK-}block',
81 'views:blocks:metabox:public:js:{CJT_METABOX_BLOCK-}jquery.block',
82 'framework:js:ajax:{CJT-}cjt-server',
83 'framework:js:ajax:{CJT-}scripts-loader',
84 'framework:js:ajax:{CJT-}styles-loader',
85 'framework:js:wordpress:{CJT-}script-localizer'
86 );
87 /*
88 * Link Thickbox to header instead of footer.
89 * media-upload script linked directly after thickbox script.
90 * media-upload script override tb_position function to show
91 * thickbox popup forms in fixed position and size!
92 * To overcome this problem we need to get a copy from original tb_position
93 * just after thickbox is loaded and just before media-upload is
94 * not override tb_position yet.
95 * metabox.js now is between thickbox and media-upload, have fun!
96 */
97 $GLOBALS['wp_scripts']->registered['thickbox']->args = 0;
98 }
99
100 /**
101 * put your comment there...
102 *
103 */
104 public static function enqueueStyles() {
105 // Regular block styles.
106 CJTBlocksBlockView::enqueueStyles();
107 // Import related styles.
108 self::useStyles(__CLASS__,
109 'framework:css:{CJT-}toolbox',
110 'views:blocks:metabox:public:css:{CJT-}metabox'
111 );
112 }
113
114 /**
115 * put your comment there...
116 *
117 */
118 public function getBlock() {
119 return $this->blockView->block;
120 }
121
122 /**
123 * put your comment there...
124 *
125 */
126 public function getBlockView() {
127 return $this->blockView;
128 }
129
130 /**
131 * put your comment there...
132 *
133 */
134 public function getMetaboxName() {
135 return $this->blockView->getMetaboxName();
136 }
137
138 /**
139 * put your comment there...
140 *
141 * @param mixed $id
142 */
143 public function getMetaboxId() {
144 return $this->blockView->getMetaboxId();
145 }
146
147 /**
148 * put your comment there...
149 *
150 */
151 public function getOption($name) {
152 return isset($this->options->{$name}) ? $this->options->{$name} : null;
153 }
154
155 /**
156 * put your comment there...
157 *
158 * @param mixed $name
159 * @param mixed $value
160 */
161 public function setOption($name, $value) {
162 $this->options->{$name} = $value;
163 // Chaining!
164 return $this;
165 }
166
167 /**
168 * put your comment there...
169 *
170 */
171 public function getSecurityToken() {
172 return $this->securityToken;
173 }
174
175 /**
176 * put your comment there...
177 *
178 * @param mixed $block
179 */
180 public function setBlock($block) {
181 $this->blockView->block = $block;
182 }
183
184 /**
185 * put your comment there...
186 *
187 * @param mixed $token
188 */
189 public function setSecurityToken($token) {
190 $this->securityToken = $token;
191 }
192
193 } // End class.
194
195 // Hookable!!
196 CJTBlocksMetaBoxView::define('CJTBlocksMetaBoxView');