Version Notes
Cleaning code.
Download this release
Release Info
Developer | Razvan Mocanu |
Extension | RazvanMocanu_Devtools |
Version | 1.0.2 |
Comparing to | |
See all releases |
Code changes from version 1.0.1 to 1.0.2
- app/code/community/RazvanMocanu/Devtools/Helper/Data.php +74 -13
- app/code/community/RazvanMocanu/Devtools/Model/Observer.php +50 -72
- app/code/community/RazvanMocanu/Devtools/Model/Tagselect.php +0 -13
- app/code/community/RazvanMocanu/Devtools/changes.txt +0 -27
- app/code/community/RazvanMocanu/Devtools/etc/config.xml +17 -1
- app/code/community/RazvanMocanu/Devtools/etc/system.xml +22 -11
- app/etc/modules/RazvanMocanu_Devtools.xml +1 -0
- package.xml +21 -17
app/code/community/RazvanMocanu/Devtools/Helper/Data.php
CHANGED
@@ -1,17 +1,4 @@
|
|
1 |
<?php
|
2 |
-
/**
|
3 |
-
* Development Tools
|
4 |
-
*
|
5 |
-
* PHP version 5.5
|
6 |
-
*
|
7 |
-
* @category RazvanMocanu
|
8 |
-
* @package RazvanMocanu_Devtools
|
9 |
-
* @author Razvan Mocanu <razvan@mocanu.biz>
|
10 |
-
* @copyright 2015 Razvan Mocanu (http://mocanu.biz)
|
11 |
-
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
12 |
-
* @link http://mocanu.biz
|
13 |
-
*/
|
14 |
-
|
15 |
/**
|
16 |
* Devtools helper class
|
17 |
*
|
@@ -46,4 +33,78 @@ class RazvanMocanu_Devtools_Helper_Data extends Mage_Core_Helper_Abstract
|
|
46 |
return "";
|
47 |
}
|
48 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
}
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
/**
|
3 |
* Devtools helper class
|
4 |
*
|
33 |
return "";
|
34 |
}
|
35 |
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Checks if highlighting is applied in Frontend.
|
39 |
+
*
|
40 |
+
* @return boolean
|
41 |
+
*/
|
42 |
+
public function highlightFrontend()
|
43 |
+
{
|
44 |
+
return (
|
45 |
+
(Mage::getDesign()->getArea() == 'frontend')
|
46 |
+
&& (Mage::getStoreConfig('devtools_options/block_info_settings/block_info_enabled'))
|
47 |
+
);
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Checks if highlighting is applied in Admin.
|
52 |
+
*
|
53 |
+
* @return boolean
|
54 |
+
*/
|
55 |
+
public function highlightAdmin()
|
56 |
+
{
|
57 |
+
return (
|
58 |
+
(Mage::getDesign()->getArea() == 'adminhtml')
|
59 |
+
&& (Mage::getStoreConfig('devtools_options/block_info_settings/block_info_enabled_admin'))
|
60 |
+
);
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Get the wrapper tag from config
|
65 |
+
*
|
66 |
+
* @param Mage_Core_Block_Abstract $theBlock (The actual block extends the core block)
|
67 |
+
*
|
68 |
+
* @return string
|
69 |
+
*/
|
70 |
+
public function getWrapperTag($theBlock)
|
71 |
+
{
|
72 |
+
$wrapperTag = Mage::getStoreConfig('devtools_options/block_info_settings/tag_select');
|
73 |
+
|
74 |
+
// Set wrapper tag to comment if the block is root, head or contained in head.
|
75 |
+
// In this cases no other tag can be used.
|
76 |
+
if ($this->isSpecialBlock($theBlock)) {
|
77 |
+
$wrapperTag = 'comment';
|
78 |
+
}
|
79 |
+
return $wrapperTag ? $wrapperTag : 'empty';
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Check if block is root, head or contained in head.
|
84 |
+
*
|
85 |
+
* @param Mage_Core_Block_Abstract $theBlock (The actual block extends the core block)
|
86 |
+
*
|
87 |
+
* @return bool
|
88 |
+
*/
|
89 |
+
private function isSpecialBlock($theBlock)
|
90 |
+
{
|
91 |
+
$specialBlocks = array('root','head');
|
92 |
+
|
93 |
+
return (in_array($theBlock, $specialBlocks) ||
|
94 |
+
($theBlock->getParentBlock() === null ? false : ($theBlock->getParentBlock()->getNameInLayout() == 'head'))
|
95 |
+
);
|
96 |
+
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Check if CMS data is to be displayed.
|
100 |
+
*
|
101 |
+
* @param Mage_Core_Block_Abstract $theBlock (The actual block extends the core block)
|
102 |
+
*
|
103 |
+
* @return bool
|
104 |
+
*/
|
105 |
+
public function hasShowCMSInfo($theBlock)
|
106 |
+
{
|
107 |
+
return (Mage::getStoreConfig('devtools_options/block_info_settings/show_cms_data')
|
108 |
+
&& in_array($theBlock->getType(), ["cms/block","cms/page"]));
|
109 |
+
}
|
110 |
}
|
app/code/community/RazvanMocanu/Devtools/Model/Observer.php
CHANGED
@@ -24,14 +24,17 @@
|
|
24 |
class RazvanMocanu_Devtools_Model_Observer extends Varien_Event_Observer
|
25 |
{
|
26 |
|
27 |
-
|
|
|
|
|
|
|
28 |
|
29 |
/**
|
30 |
* Constructor
|
31 |
*/
|
32 |
public function __construct()
|
33 |
{
|
34 |
-
$this->
|
35 |
}
|
36 |
|
37 |
/**
|
@@ -43,9 +46,9 @@ class RazvanMocanu_Devtools_Model_Observer extends Varien_Event_Observer
|
|
43 |
*/
|
44 |
public function highlightBlocks($observer)
|
45 |
{
|
46 |
-
if (
|
47 |
-
|
48 |
-
$observer->getTransport()->setHtml($this->
|
49 |
}
|
50 |
}
|
51 |
|
@@ -56,18 +59,18 @@ class RazvanMocanu_Devtools_Model_Observer extends Varien_Event_Observer
|
|
56 |
*
|
57 |
* @return string
|
58 |
*/
|
59 |
-
private function
|
60 |
{
|
61 |
|
62 |
-
$blockDetails = $this->
|
63 |
|
64 |
-
$
|
65 |
|
66 |
-
if ((!$
|
67 |
$blockDetails['wrapperTag'] = "empty";
|
68 |
}
|
69 |
|
70 |
-
return $this->
|
71 |
}
|
72 |
|
73 |
/**
|
@@ -77,45 +80,22 @@ class RazvanMocanu_Devtools_Model_Observer extends Varien_Event_Observer
|
|
77 |
*
|
78 |
* @return array
|
79 |
*/
|
80 |
-
private function
|
81 |
{
|
82 |
|
83 |
-
$
|
84 |
-
|
85 |
-
$_blockDetails = array();
|
86 |
-
$_blockDetails['wrapperTag'] = $this->_getWrapperTag($_currentBlock)? $this->_getWrapperTag($_currentBlock) : 'empty';
|
87 |
-
$_blockDetails['isRoot'] = $this->_getBlockIsRoot($_currentBlock);
|
88 |
-
$_blockDetails['blockName'] = $this->_getBlockNameContent($_currentBlock);
|
89 |
-
$_blockDetails['blockTemplate'] = $this->_getBlockTemplateContent($_currentBlock);
|
90 |
-
$_blockDetails['CMSData'] = $this->_getBlockCMSInfoContent($_currentBlock);
|
91 |
-
$_blockDetails['blockData'] = $this->_getBlockDataContent($_currentBlock);
|
92 |
-
$_blockDetails['blockHover'] = $this->_getBlockHoverContent($_currentBlock);
|
93 |
-
$_blockDetails['blockInitialContent'] = $observer->getTransport()->getHtml();
|
94 |
-
|
95 |
-
return $_blockDetails;
|
96 |
-
}
|
97 |
-
|
98 |
-
/**
|
99 |
-
* Get the wrapper tag from config
|
100 |
-
*
|
101 |
-
* @param Mage_Core_Block_Abstract $theBlock (The actual block extends the core block)
|
102 |
-
*
|
103 |
-
* @return string
|
104 |
-
*/
|
105 |
-
private function _getWrapperTag($theBlock)
|
106 |
-
{
|
107 |
-
$_wrapperTag = Mage::getStoreConfig('devtools_options/block_info_settings/tag_select');
|
108 |
-
// Set wrapper tag to comment if the block is root, head or contained in head.
|
109 |
-
// In this cases no other tag can be used.
|
110 |
|
111 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
|
113 |
-
|
114 |
-
($theBlock->getParentBlock() === null ? false : ($theBlock->getParentBlock()->getNameInLayout() == 'head'))
|
115 |
-
) {
|
116 |
-
$_wrapperTag = 'comment';
|
117 |
-
}
|
118 |
-
return $_wrapperTag;
|
119 |
}
|
120 |
|
121 |
/**
|
@@ -125,7 +105,7 @@ class RazvanMocanu_Devtools_Model_Observer extends Varien_Event_Observer
|
|
125 |
*
|
126 |
* @return bool
|
127 |
*/
|
128 |
-
private function
|
129 |
{
|
130 |
return ($theBlock->getNameInLayout() == 'root');
|
131 |
}
|
@@ -135,7 +115,7 @@ class RazvanMocanu_Devtools_Model_Observer extends Varien_Event_Observer
|
|
135 |
*
|
136 |
* @return string
|
137 |
*/
|
138 |
-
private function
|
139 |
{
|
140 |
if (Mage::getStoreConfig('devtools_options/block_info_settings/show_layout_handles')) {
|
141 |
return "<!-- \n"
|
@@ -154,9 +134,9 @@ class RazvanMocanu_Devtools_Model_Observer extends Varien_Event_Observer
|
|
154 |
*
|
155 |
* @return string
|
156 |
*/
|
157 |
-
private function
|
158 |
{
|
159 |
-
return $this->
|
160 |
Mage::getStoreConfig('devtools_options/block_info_settings/show_block_name'),
|
161 |
'BlockName',
|
162 |
$theBlock->getNameInLayout()
|
@@ -170,9 +150,9 @@ class RazvanMocanu_Devtools_Model_Observer extends Varien_Event_Observer
|
|
170 |
*
|
171 |
* @return string
|
172 |
*/
|
173 |
-
private function
|
174 |
{
|
175 |
-
return $this->
|
176 |
Mage::getStoreConfig('devtools_options/block_info_settings/show_block_template'),
|
177 |
'BlockTemplate',
|
178 |
$theBlock->getTemplateFile()
|
@@ -186,12 +166,12 @@ class RazvanMocanu_Devtools_Model_Observer extends Varien_Event_Observer
|
|
186 |
*
|
187 |
* @return string
|
188 |
*/
|
189 |
-
private function
|
190 |
{
|
191 |
-
return $this->
|
192 |
Mage::getStoreConfig('devtools_options/block_info_settings/show_block_data'),
|
193 |
'Data',
|
194 |
-
$this->
|
195 |
);
|
196 |
}
|
197 |
|
@@ -202,24 +182,24 @@ class RazvanMocanu_Devtools_Model_Observer extends Varien_Event_Observer
|
|
202 |
*
|
203 |
* @return string
|
204 |
*/
|
205 |
-
private function
|
206 |
{
|
207 |
|
208 |
-
$
|
209 |
|
210 |
//get first level of data in array
|
211 |
//if the value is array it will not be parsed
|
212 |
foreach ($theBlock->debug() as $key => $value) {
|
213 |
if ($key != "text") {
|
214 |
if (!is_array($value)) {
|
215 |
-
$
|
216 |
} else {
|
217 |
-
$
|
218 |
}
|
219 |
}
|
220 |
}
|
221 |
|
222 |
-
return $
|
223 |
}
|
224 |
|
225 |
/**
|
@@ -229,7 +209,7 @@ class RazvanMocanu_Devtools_Model_Observer extends Varien_Event_Observer
|
|
229 |
*
|
230 |
* @return string
|
231 |
*/
|
232 |
-
private function
|
233 |
{
|
234 |
|
235 |
if (Mage::getStoreConfig('devtools_options/block_info_settings/show_on_hover')) {
|
@@ -246,25 +226,23 @@ class RazvanMocanu_Devtools_Model_Observer extends Varien_Event_Observer
|
|
246 |
*
|
247 |
* @return string
|
248 |
*/
|
249 |
-
private function
|
250 |
{
|
251 |
|
252 |
-
if (
|
253 |
-
&& in_array($theBlock->getType(), ["cms/block","cms/page"])
|
254 |
-
) {
|
255 |
|
256 |
switch($theBlock->getType()){
|
257 |
case 'cms/block':
|
258 |
-
$
|
259 |
break;
|
260 |
case 'cms/page':
|
261 |
-
$
|
262 |
break;
|
263 |
default:
|
264 |
-
$
|
265 |
}
|
266 |
|
267 |
-
return "\n" . 'CMSData="' . $
|
268 |
} else {
|
269 |
return "";
|
270 |
}
|
@@ -277,7 +255,7 @@ class RazvanMocanu_Devtools_Model_Observer extends Varien_Event_Observer
|
|
277 |
*
|
278 |
* @return string
|
279 |
*/
|
280 |
-
private function
|
281 |
{
|
282 |
|
283 |
return 'CMSBlockId: ' . $theBlock->getBlockId();
|
@@ -290,7 +268,7 @@ class RazvanMocanu_Devtools_Model_Observer extends Varien_Event_Observer
|
|
290 |
*
|
291 |
* @return string
|
292 |
*/
|
293 |
-
private function
|
294 |
{
|
295 |
|
296 |
$currentPage = $theBlock->getPage();
|
@@ -305,7 +283,7 @@ class RazvanMocanu_Devtools_Model_Observer extends Varien_Event_Observer
|
|
305 |
*
|
306 |
* @return string
|
307 |
*/
|
308 |
-
private function
|
309 |
{
|
310 |
$content = $blockDetails['blockName']
|
311 |
. $blockDetails['blockTemplate']
|
@@ -338,7 +316,7 @@ class RazvanMocanu_Devtools_Model_Observer extends Varien_Event_Observer
|
|
338 |
if ($pos !== false) {
|
339 |
return substr_replace(
|
340 |
$blockDetails['blockInitialContent'],
|
341 |
-
$this->
|
342 |
$pos,
|
343 |
5
|
344 |
) . $end;
|
24 |
class RazvanMocanu_Devtools_Model_Observer extends Varien_Event_Observer
|
25 |
{
|
26 |
|
27 |
+
/**
|
28 |
+
* @var RazvanMocanu_Devtools_Helper_Data $helper
|
29 |
+
*/
|
30 |
+
private $helper;
|
31 |
|
32 |
/**
|
33 |
* Constructor
|
34 |
*/
|
35 |
public function __construct()
|
36 |
{
|
37 |
+
$this->helper = Mage::helper('devtools');
|
38 |
}
|
39 |
|
40 |
/**
|
46 |
*/
|
47 |
public function highlightBlocks($observer)
|
48 |
{
|
49 |
+
if ($this->helper->highlightFrontend() || $this->helper->highlightAdmin())
|
50 |
+
{
|
51 |
+
$observer->getTransport()->setHtml($this->updateContent($observer));
|
52 |
}
|
53 |
}
|
54 |
|
59 |
*
|
60 |
* @return string
|
61 |
*/
|
62 |
+
private function updateContent($observer)
|
63 |
{
|
64 |
|
65 |
+
$blockDetails = $this->prepareContentData($observer);
|
66 |
|
67 |
+
$showEmptyBlocks = Mage::getStoreConfig('devtools_options/block_info_settings/show_empty_blocks');
|
68 |
|
69 |
+
if ((!$showEmptyBlocks && !$blockDetails['blockInitialContent'])) {
|
70 |
$blockDetails['wrapperTag'] = "empty";
|
71 |
}
|
72 |
|
73 |
+
return $this->prepareContent($blockDetails, $blockDetails['wrapperTag']);
|
74 |
}
|
75 |
|
76 |
/**
|
80 |
*
|
81 |
* @return array
|
82 |
*/
|
83 |
+
private function prepareContentData($observer)
|
84 |
{
|
85 |
|
86 |
+
$currentBlock = $observer->getBlock();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
|
88 |
+
$blockDetails = array();
|
89 |
+
$blockDetails['wrapperTag'] = $this->helper->getWrapperTag($currentBlock);
|
90 |
+
$blockDetails['isRoot'] = $this->isBlockRoot($currentBlock);
|
91 |
+
$blockDetails['blockName'] = $this->getBlockNameContent($currentBlock);
|
92 |
+
$blockDetails['blockTemplate'] = $this->getBlockTemplateContent($currentBlock);
|
93 |
+
$blockDetails['CMSData'] = $this->getBlockCMSInfoContent($currentBlock);
|
94 |
+
$blockDetails['blockData'] = $this->getBlockDataContent($currentBlock);
|
95 |
+
$blockDetails['blockHover'] = $this->getBlockHoverContent($currentBlock);
|
96 |
+
$blockDetails['blockInitialContent'] = $observer->getTransport()->getHtml();
|
97 |
|
98 |
+
return $blockDetails;
|
|
|
|
|
|
|
|
|
|
|
99 |
}
|
100 |
|
101 |
/**
|
105 |
*
|
106 |
* @return bool
|
107 |
*/
|
108 |
+
private function isBlockRoot($theBlock)
|
109 |
{
|
110 |
return ($theBlock->getNameInLayout() == 'root');
|
111 |
}
|
115 |
*
|
116 |
* @return string
|
117 |
*/
|
118 |
+
private function getLayoutHandles()
|
119 |
{
|
120 |
if (Mage::getStoreConfig('devtools_options/block_info_settings/show_layout_handles')) {
|
121 |
return "<!-- \n"
|
134 |
*
|
135 |
* @return string
|
136 |
*/
|
137 |
+
private function getBlockNameContent($theBlock)
|
138 |
{
|
139 |
+
return $this->helper->makeAttribute(
|
140 |
Mage::getStoreConfig('devtools_options/block_info_settings/show_block_name'),
|
141 |
'BlockName',
|
142 |
$theBlock->getNameInLayout()
|
150 |
*
|
151 |
* @return string
|
152 |
*/
|
153 |
+
private function getBlockTemplateContent($theBlock)
|
154 |
{
|
155 |
+
return $this->helper->makeAttribute(
|
156 |
Mage::getStoreConfig('devtools_options/block_info_settings/show_block_template'),
|
157 |
'BlockTemplate',
|
158 |
$theBlock->getTemplateFile()
|
166 |
*
|
167 |
* @return string
|
168 |
*/
|
169 |
+
private function getBlockDataContent($theBlock)
|
170 |
{
|
171 |
+
return $this->helper->makeAttribute(
|
172 |
Mage::getStoreConfig('devtools_options/block_info_settings/show_block_data'),
|
173 |
'Data',
|
174 |
+
$this->prepareDataContent($theBlock)
|
175 |
);
|
176 |
}
|
177 |
|
182 |
*
|
183 |
* @return string
|
184 |
*/
|
185 |
+
private function prepareDataContent($theBlock)
|
186 |
{
|
187 |
|
188 |
+
$currentData = '';
|
189 |
|
190 |
//get first level of data in array
|
191 |
//if the value is array it will not be parsed
|
192 |
foreach ($theBlock->debug() as $key => $value) {
|
193 |
if ($key != "text") {
|
194 |
if (!is_array($value)) {
|
195 |
+
$currentData .= $key . ':' . $value . '; ';
|
196 |
} else {
|
197 |
+
$currentData .= $key . ':' . 'ARRAY' . '; ';
|
198 |
}
|
199 |
}
|
200 |
}
|
201 |
|
202 |
+
return $currentData;
|
203 |
}
|
204 |
|
205 |
/**
|
209 |
*
|
210 |
* @return string
|
211 |
*/
|
212 |
+
private function getBlockHoverContent($theBlock)
|
213 |
{
|
214 |
|
215 |
if (Mage::getStoreConfig('devtools_options/block_info_settings/show_on_hover')) {
|
226 |
*
|
227 |
* @return string
|
228 |
*/
|
229 |
+
private function getBlockCMSInfoContent($theBlock)
|
230 |
{
|
231 |
|
232 |
+
if ($this->helper->hasShowCMSInfo($theBlock)) {
|
|
|
|
|
233 |
|
234 |
switch($theBlock->getType()){
|
235 |
case 'cms/block':
|
236 |
+
$cmsInfo = $this->getBlockCMSBlockInfo($theBlock);
|
237 |
break;
|
238 |
case 'cms/page':
|
239 |
+
$cmsInfo = $this->getBlockCMSPageInfo($theBlock);
|
240 |
break;
|
241 |
default:
|
242 |
+
$cmsInfo = '';
|
243 |
}
|
244 |
|
245 |
+
return "\n" . 'CMSData="' . $cmsInfo . '"';
|
246 |
} else {
|
247 |
return "";
|
248 |
}
|
255 |
*
|
256 |
* @return string
|
257 |
*/
|
258 |
+
private function getBlockCMSBlockInfo($theBlock)
|
259 |
{
|
260 |
|
261 |
return 'CMSBlockId: ' . $theBlock->getBlockId();
|
268 |
*
|
269 |
* @return string
|
270 |
*/
|
271 |
+
private function getBlockCMSPageInfo($theBlock)
|
272 |
{
|
273 |
|
274 |
$currentPage = $theBlock->getPage();
|
283 |
*
|
284 |
* @return string
|
285 |
*/
|
286 |
+
private function prepareContent($blockDetails, $contentType)
|
287 |
{
|
288 |
$content = $blockDetails['blockName']
|
289 |
. $blockDetails['blockTemplate']
|
316 |
if ($pos !== false) {
|
317 |
return substr_replace(
|
318 |
$blockDetails['blockInitialContent'],
|
319 |
+
$this->getLayoutHandles() . $begin . "\n" . '<html',
|
320 |
$pos,
|
321 |
5
|
322 |
) . $end;
|
app/code/community/RazvanMocanu/Devtools/Model/Tagselect.php
CHANGED
@@ -1,17 +1,4 @@
|
|
1 |
<?php
|
2 |
-
/**
|
3 |
-
* Development Tools
|
4 |
-
*
|
5 |
-
* PHP version 5.5
|
6 |
-
*
|
7 |
-
* @category RazvanMocanu
|
8 |
-
* @package RazvanMocanu_Devtools
|
9 |
-
* @author Razvan Mocanu <razvan@mocanu.biz>
|
10 |
-
* @copyright 2015 Razvan Mocanu (http://mocanu.biz)
|
11 |
-
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
12 |
-
* @link http://mocanu.biz
|
13 |
-
*/
|
14 |
-
|
15 |
/**
|
16 |
* Devtools tag selector model
|
17 |
*
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
/**
|
3 |
* Devtools tag selector model
|
4 |
*
|
app/code/community/RazvanMocanu/Devtools/changes.txt
DELETED
@@ -1,27 +0,0 @@
|
|
1 |
-
0.0.2
|
2 |
-
|
3 |
-
- template includes package and theme
|
4 |
-
- option to add the template file name as div title so it will be displayed on hover
|
5 |
-
|
6 |
-
0.0.3
|
7 |
-
|
8 |
-
- option to not encapsulate empty blocks
|
9 |
-
|
10 |
-
0.0.4
|
11 |
-
|
12 |
-
- support PHP 5.6
|
13 |
-
|
14 |
-
0.0.5
|
15 |
-
|
16 |
-
- code reformat
|
17 |
-
|
18 |
-
0.0.6
|
19 |
-
|
20 |
-
- CMS block/page info
|
21 |
-
- repositioning root block info after the <!DOCTYPE HTML>
|
22 |
-
- layout update handles list
|
23 |
-
- some php doc added
|
24 |
-
|
25 |
-
1.0.1
|
26 |
-
|
27 |
-
- refactoring some methods
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/RazvanMocanu/Devtools/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<RazvanMocanu_Devtools>
|
5 |
-
<version>1.0.
|
6 |
</RazvanMocanu_Devtools>
|
7 |
</modules>
|
8 |
<global>
|
@@ -49,4 +49,20 @@
|
|
49 |
</resources>
|
50 |
</acl>
|
51 |
</adminhtml>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
</config>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<RazvanMocanu_Devtools>
|
5 |
+
<version>1.0.2</version>
|
6 |
</RazvanMocanu_Devtools>
|
7 |
</modules>
|
8 |
<global>
|
49 |
</resources>
|
50 |
</acl>
|
51 |
</adminhtml>
|
52 |
+
<default>
|
53 |
+
<devtools_options>
|
54 |
+
<block_info_settings>
|
55 |
+
<block_info_enabled>1</block_info_enabled>
|
56 |
+
<block_info_enabled_admin>0</block_info_enabled_admin>
|
57 |
+
<tag_select>comment</tag_select>
|
58 |
+
<show_block_name>1</show_block_name>
|
59 |
+
<show_block_template>1</show_block_template>
|
60 |
+
<show_block_data>0</show_block_data>
|
61 |
+
<show_cms_data>1</show_cms_data>
|
62 |
+
<show_on_hover>0</show_on_hover>
|
63 |
+
<show_empty_blocks>1</show_empty_blocks>
|
64 |
+
<show_layout_handles>1</show_layout_handles>
|
65 |
+
</block_info_settings>
|
66 |
+
</devtools_options>
|
67 |
+
</default>
|
68 |
</config>
|
app/code/community/RazvanMocanu/Devtools/etc/system.xml
CHANGED
@@ -2,13 +2,13 @@
|
|
2 |
<config>
|
3 |
<tabs>
|
4 |
<razvanmocanu translate="label" module="devtools">
|
5 |
-
<label>Razvan Mocanu
|
6 |
<sort_order>150</sort_order>
|
7 |
</razvanmocanu>
|
8 |
</tabs>
|
9 |
<sections>
|
10 |
<devtools_options translate="label" module="devtools">
|
11 |
-
<label>Devtools
|
12 |
<tab>razvanmocanu</tab>
|
13 |
<frontend_type>text</frontend_type>
|
14 |
<sort_order>1000</sort_order>
|
@@ -25,7 +25,7 @@
|
|
25 |
<show_in_store>1</show_in_store>
|
26 |
<fields>
|
27 |
<block_info_enabled>
|
28 |
-
<label>Enable Block Info</label>
|
29 |
<frontend_type>select</frontend_type>
|
30 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
31 |
<comment>If enabled this will add information about each block in the HTML source. Below you
|
@@ -36,6 +36,17 @@
|
|
36 |
<show_in_website>1</show_in_website>
|
37 |
<show_in_store>1</show_in_store>
|
38 |
</block_info_enabled>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
<tag_select>
|
40 |
<label>Tag to use</label>
|
41 |
<frontend_type>select</frontend_type>
|
@@ -43,7 +54,7 @@
|
|
43 |
<comment>This tag will encapsulate the block. The root block, head block and children of
|
44 |
head block will be encapsulated in comments regardless of this selection.
|
45 |
</comment>
|
46 |
-
<sort_order>
|
47 |
<show_in_default>1</show_in_default>
|
48 |
<show_in_website>1</show_in_website>
|
49 |
<show_in_store>1</show_in_store>
|
@@ -54,7 +65,7 @@
|
|
54 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
55 |
<comment>If enabled the block name will be included as attribute in the encapsulating tag.
|
56 |
</comment>
|
57 |
-
<sort_order>
|
58 |
<show_in_default>1</show_in_default>
|
59 |
<show_in_website>1</show_in_website>
|
60 |
<show_in_store>1</show_in_store>
|
@@ -66,7 +77,7 @@
|
|
66 |
<comment>If enabled the block template will be included as attribute in the encapsulating
|
67 |
tag.
|
68 |
</comment>
|
69 |
-
<sort_order>
|
70 |
<show_in_default>1</show_in_default>
|
71 |
<show_in_website>1</show_in_website>
|
72 |
<show_in_store>1</show_in_store>
|
@@ -77,7 +88,7 @@
|
|
77 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
78 |
<comment>If enabled the block data will be included as attribute in the encapsulating tag.
|
79 |
</comment>
|
80 |
-
<sort_order>
|
81 |
<show_in_default>1</show_in_default>
|
82 |
<show_in_website>1</show_in_website>
|
83 |
<show_in_store>1</show_in_store>
|
@@ -88,7 +99,7 @@
|
|
88 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
89 |
<comment>If enabled and the block is of CMS type, the ID will be included as attribute in the encapsulating tag.
|
90 |
</comment>
|
91 |
-
<sort_order>
|
92 |
<show_in_default>1</show_in_default>
|
93 |
<show_in_website>1</show_in_website>
|
94 |
<show_in_store>1</show_in_store>
|
@@ -100,7 +111,7 @@
|
|
100 |
<comment>If enabled and div used as encapsulating tag, this will ad the title attribute to
|
101 |
the encapsulating div so it will display the template file on hover.
|
102 |
</comment>
|
103 |
-
<sort_order>
|
104 |
<show_in_default>1</show_in_default>
|
105 |
<show_in_website>1</show_in_website>
|
106 |
<show_in_store>1</show_in_store>
|
@@ -110,7 +121,7 @@
|
|
110 |
<frontend_type>select</frontend_type>
|
111 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
112 |
<comment>If enabled the block will be encapsulated even if it is empty.</comment>
|
113 |
-
<sort_order>
|
114 |
<show_in_default>1</show_in_default>
|
115 |
<show_in_website>1</show_in_website>
|
116 |
<show_in_store>1</show_in_store>
|
@@ -120,7 +131,7 @@
|
|
120 |
<frontend_type>select</frontend_type>
|
121 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
122 |
<comment>If enabled, a comment with the list of handles will be added at the beginning of the page.</comment>
|
123 |
-
<sort_order>
|
124 |
<show_in_default>1</show_in_default>
|
125 |
<show_in_website>1</show_in_website>
|
126 |
<show_in_store>1</show_in_store>
|
2 |
<config>
|
3 |
<tabs>
|
4 |
<razvanmocanu translate="label" module="devtools">
|
5 |
+
<label>Razvan Mocanu</label>
|
6 |
<sort_order>150</sort_order>
|
7 |
</razvanmocanu>
|
8 |
</tabs>
|
9 |
<sections>
|
10 |
<devtools_options translate="label" module="devtools">
|
11 |
+
<label>Devtools</label>
|
12 |
<tab>razvanmocanu</tab>
|
13 |
<frontend_type>text</frontend_type>
|
14 |
<sort_order>1000</sort_order>
|
25 |
<show_in_store>1</show_in_store>
|
26 |
<fields>
|
27 |
<block_info_enabled>
|
28 |
+
<label>Enable Block Info For Frontend</label>
|
29 |
<frontend_type>select</frontend_type>
|
30 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
31 |
<comment>If enabled this will add information about each block in the HTML source. Below you
|
36 |
<show_in_website>1</show_in_website>
|
37 |
<show_in_store>1</show_in_store>
|
38 |
</block_info_enabled>
|
39 |
+
<block_info_enabled_admin>
|
40 |
+
<label>Enable Block Info For Admin</label>
|
41 |
+
<frontend_type>select</frontend_type>
|
42 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
43 |
+
<comment>Same as above but for admin.
|
44 |
+
</comment>
|
45 |
+
<sort_order>2</sort_order>
|
46 |
+
<show_in_default>1</show_in_default>
|
47 |
+
<show_in_website>1</show_in_website>
|
48 |
+
<show_in_store>1</show_in_store>
|
49 |
+
</block_info_enabled_admin>
|
50 |
<tag_select>
|
51 |
<label>Tag to use</label>
|
52 |
<frontend_type>select</frontend_type>
|
54 |
<comment>This tag will encapsulate the block. The root block, head block and children of
|
55 |
head block will be encapsulated in comments regardless of this selection.
|
56 |
</comment>
|
57 |
+
<sort_order>3</sort_order>
|
58 |
<show_in_default>1</show_in_default>
|
59 |
<show_in_website>1</show_in_website>
|
60 |
<show_in_store>1</show_in_store>
|
65 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
66 |
<comment>If enabled the block name will be included as attribute in the encapsulating tag.
|
67 |
</comment>
|
68 |
+
<sort_order>4</sort_order>
|
69 |
<show_in_default>1</show_in_default>
|
70 |
<show_in_website>1</show_in_website>
|
71 |
<show_in_store>1</show_in_store>
|
77 |
<comment>If enabled the block template will be included as attribute in the encapsulating
|
78 |
tag.
|
79 |
</comment>
|
80 |
+
<sort_order>5</sort_order>
|
81 |
<show_in_default>1</show_in_default>
|
82 |
<show_in_website>1</show_in_website>
|
83 |
<show_in_store>1</show_in_store>
|
88 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
89 |
<comment>If enabled the block data will be included as attribute in the encapsulating tag.
|
90 |
</comment>
|
91 |
+
<sort_order>6</sort_order>
|
92 |
<show_in_default>1</show_in_default>
|
93 |
<show_in_website>1</show_in_website>
|
94 |
<show_in_store>1</show_in_store>
|
99 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
100 |
<comment>If enabled and the block is of CMS type, the ID will be included as attribute in the encapsulating tag.
|
101 |
</comment>
|
102 |
+
<sort_order>7</sort_order>
|
103 |
<show_in_default>1</show_in_default>
|
104 |
<show_in_website>1</show_in_website>
|
105 |
<show_in_store>1</show_in_store>
|
111 |
<comment>If enabled and div used as encapsulating tag, this will ad the title attribute to
|
112 |
the encapsulating div so it will display the template file on hover.
|
113 |
</comment>
|
114 |
+
<sort_order>8</sort_order>
|
115 |
<show_in_default>1</show_in_default>
|
116 |
<show_in_website>1</show_in_website>
|
117 |
<show_in_store>1</show_in_store>
|
121 |
<frontend_type>select</frontend_type>
|
122 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
123 |
<comment>If enabled the block will be encapsulated even if it is empty.</comment>
|
124 |
+
<sort_order>9</sort_order>
|
125 |
<show_in_default>1</show_in_default>
|
126 |
<show_in_website>1</show_in_website>
|
127 |
<show_in_store>1</show_in_store>
|
131 |
<frontend_type>select</frontend_type>
|
132 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
133 |
<comment>If enabled, a comment with the list of handles will be added at the beginning of the page.</comment>
|
134 |
+
<sort_order>10</sort_order>
|
135 |
<show_in_default>1</show_in_default>
|
136 |
<show_in_website>1</show_in_website>
|
137 |
<show_in_store>1</show_in_store>
|
app/etc/modules/RazvanMocanu_Devtools.xml
CHANGED
@@ -7,3 +7,4 @@
|
|
7 |
</RazvanMocanu_Devtools>
|
8 |
</modules>
|
9 |
</config>
|
|
7 |
</RazvanMocanu_Devtools>
|
8 |
</modules>
|
9 |
</config>
|
10 |
+
|
package.xml
CHANGED
@@ -1,27 +1,31 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>RazvanMocanu_Devtools</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
-
<license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
-
<summary
|
10 |
-
|
|
|
|
|
|
|
11 |
- Shows the list of layout update handles for the current page
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
|
|
21 |
<authors><author><name>Razvan Mocanu</name><user>razvan_mocanu</user><email>razvan_mocanu@yahoo.com</email></author></authors>
|
22 |
-
<date>2015-
|
23 |
-
<time>
|
24 |
-
<contents><target name="magecommunity"><dir name="RazvanMocanu"><dir name="Devtools"><dir name="Helper"><file name="Data.php" hash="
|
25 |
<compatible/>
|
26 |
-
<dependencies><required><php><min>5.
|
27 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>RazvanMocanu_Devtools</name>
|
4 |
+
<version>1.0.2</version>
|
5 |
<stability>stable</stability>
|
6 |
+
<license>OSL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
+
<summary>Inserts information about blocks and page inside the HTML source.
|
10 |
+
Works with C.E. and E.E..</summary>
|
11 |
+
<description><p>
|
12 |
+
- This module wraps each block in comment tags containing information about the block.<br /> 
|
13 |
+
- Shows block info in page source: block name, block template file, specific CMS block data, other data<br />
|
14 |
- Shows the list of layout update handles for the current page
|
15 |
+
</p>
|
16 |
+
<p>
|
17 |
+
This allows the developer to quickly identify blocks and find the associated templates and data. It doesn&apos;t work as the template hints. All the information is contained inside the HTML which you can inspect with the browser. If you are using Firebug, don't forget to set it to show comments. See screenshots.
|
18 |
+
</p>
|
19 |
+
<p>
|
20 |
+
It works with C.E. and E.E.
|
21 |
+
</p>
|
22 |
+
<p />
|
23 |
+
<a href="http://mce.dev.thedt.com/">Demo here: http://mce.dev.thedt.com/</a> (see page source).</description>
|
24 |
+
<notes>Cleaning code.</notes>
|
25 |
<authors><author><name>Razvan Mocanu</name><user>razvan_mocanu</user><email>razvan_mocanu@yahoo.com</email></author></authors>
|
26 |
+
<date>2015-12-11</date>
|
27 |
+
<time>20:43:57</time>
|
28 |
+
<contents><target name="magecommunity"><dir name="RazvanMocanu"><dir name="Devtools"><dir name="Helper"><file name="Data.php" hash="8efe0f1e23bf9b499f8e11b32637679a"/></dir><dir name="Model"><file name="Observer.php" hash="1ddadf12771afffd28f1134d5e31b3c3"/><file name="Tagselect.php" hash="ddf576f5a4bbaf9d885900df961b7585"/></dir><dir name="etc"><file name="config.xml" hash="043bbe963772f23e93f85f9562ca2e56"/><file name="system.xml" hash="235ed04fa76e2655565e820485e753ca"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="RazvanMocanu_Devtools.xml" hash="3783857e4466d4624dd48ab676943356"/></dir></target></contents>
|
29 |
<compatible/>
|
30 |
+
<dependencies><required><php><min>5.4.0</min><max>7.0.0</max></php></required></dependencies>
|
31 |
</package>
|