PluginProbe
CSS & JavaScript Toolbox / 7.1.2
CSS & JavaScript Toolbox v7.1.2
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 7.1.2, at views/blocks/metabox/view.php

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