HM_DeveloperToolbar - Version 1.0

Version Notes

Compatible with magento 1.2.x - 1.3.x

Download this release

Release Info

Developer Magento Core Team
Extension HM_DeveloperToolbar
Version 1.0
Comparing to
See all releases


Version 1.0

app/code/community/HM/DeveloperToolbar/controllers/IndexController.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class HM_DeveloperToolbar_IndexController extends Mage_Core_Controller_Front_Action
4
+ {
5
+ public function hintsAction()
6
+ {
7
+ $enabled = $this->getRequest()->getParam('enabled');
8
+ $type = $this->getRequest()->getParam('type');
9
+
10
+ $scope = $type === 'front' ? 'stores' : 'default';
11
+ $scope_id = $type === 'front' ? Mage::app()->getStore()->getStoreId() : '0';
12
+ Mage::getConfig()->saveConfig('dev/debug/template_hints', $enabled, $scope, $scope_id);
13
+ Mage::getConfig()->saveConfig('dev/debug/template_hints_blocks', $enabled, $scope, $scope_id);
14
+
15
+ $this->_redirectReferer();
16
+ }
17
+
18
+ public function logAction()
19
+ {
20
+ $scope = 'stores';
21
+ $scope_id = Mage::app()->getStore()->getStoreId();
22
+ $enabled = $this->getRequest()->getParam('enabled');
23
+ Mage::getConfig()->saveConfig('dev/log/active', $enabled, $scope, $scope_id);
24
+ $this->_redirectReferer();
25
+ }
26
+
27
+ public function jsAction()
28
+ {
29
+ $scope = 'stores';
30
+ $scope_id = Mage::app()->getStore()->getStoreId();
31
+ $enabled = $this->getRequest()->getParam('enabled');
32
+ Mage::getConfig()->saveConfig('dev/js/merge_files', $enabled, $scope, $scope_id);
33
+ $this->_redirectReferer();
34
+ }
35
+
36
+ public function urlAction()
37
+ {
38
+ $enabled = $this->getRequest()->getParam('enabled');
39
+ Mage::getConfig()->saveConfig('web/url/use_store', $enabled);
40
+ $this->_redirectReferer();
41
+ }
42
+
43
+ public function seoAction()
44
+ {
45
+ $enabled = $this->getRequest()->getParam('enabled');
46
+ Mage::getConfig()->saveConfig('web/seo/use_rewrites', $enabled);
47
+ $this->_redirectReferer();
48
+ }
49
+
50
+ public function translateAction()
51
+ {
52
+ $scope = 'stores';
53
+ $scope_id = Mage::app()->getStore()->getStoreId();
54
+ $enabled = $this->getRequest()->getParam('enabled');
55
+ Mage::getConfig()->saveConfig('dev/translate_inline/active', $enabled, $scope, $scope_id);
56
+ $this->_redirectReferer();
57
+ }
58
+
59
+ public function cacheAction()
60
+ {
61
+ Mage::app()->cleanCache();
62
+ $cacheTypes = array_keys(Mage::helper('core')->getCacheTypes());
63
+ $enable = array();
64
+ foreach ($cacheTypes as $type) {
65
+ $enable[$type] = 0;
66
+ }
67
+ Mage::app()->saveUseCache($enable);
68
+ $this->_redirectReferer();
69
+ }
70
+ }
71
+ ?>
app/code/community/HM/DeveloperToolbar/etc/config.xml ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <config>
4
+ <modules>
5
+ <HM_DeveloperToolbar>
6
+ <version>1.0.0</version>
7
+ </HM_DeveloperToolbar>
8
+ </modules>
9
+ <frontend>
10
+ <routers>
11
+ <developertoolbar>
12
+ <use>standard</use>
13
+ <args>
14
+ <module>HM_DeveloperToolbar</module>
15
+ <frontName>developertoolbar</frontName>
16
+ </args>
17
+ </developertoolbar>
18
+ </routers>
19
+ <layout>
20
+ <updates>
21
+ <developertoolbar>
22
+ <file>developertoolbar.xml</file>
23
+ </developertoolbar>
24
+ </updates>
25
+ </layout>
26
+ </frontend>
27
+
28
+ <default>
29
+ <dev>
30
+ <developertoolbar>
31
+ <enabled>1</enabled>
32
+ </developertoolbar>
33
+ </dev>
34
+ </default>
35
+ </config>
app/code/community/HM/DeveloperToolbar/etc/system.xml ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category Mage
23
+ * @package Mage_Contacts
24
+ * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+ <config>
29
+ <sections>
30
+ <dev translate="label" module="core">
31
+ <label>Developer</label>
32
+ <tab>advanced</tab>
33
+ <frontend_type>text</frontend_type>
34
+ <sort_order>920</sort_order>
35
+ <show_in_default>1</show_in_default>
36
+ <show_in_website>1</show_in_website>
37
+ <show_in_store>1</show_in_store>
38
+ <groups>
39
+ <developertoolbar translate="label">
40
+ <label>Developer Toolbar</label>
41
+ <frontend_type>text</frontend_type>
42
+ <sort_order>1000</sort_order>
43
+ <show_in_default>1</show_in_default>
44
+ <show_in_website>1</show_in_website>
45
+ <show_in_store>1</show_in_store>
46
+ <fields>
47
+ <enabled translate="label">
48
+ <label>Enabled</label>
49
+ <frontend_type>select</frontend_type>
50
+ <source_model>adminhtml/system_config_source_yesno</source_model>
51
+ <sort_order>20</sort_order>
52
+ <show_in_default>1</show_in_default>
53
+ <show_in_website>1</show_in_website>
54
+ <show_in_store>1</show_in_store>
55
+ </enabled>
56
+ </fields>
57
+ </developertoolbar>
58
+ </groups>
59
+ </dev>
60
+ </sections>
61
+ </config>
app/design/frontend/default/default/layout/developertoolbar.xml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+
4
+ <default>
5
+ <reference name="before_body_end">
6
+ <block type="core/template" template="developertoolbar/toolbar.phtml">
7
+ </block>
8
+ </reference>
9
+ </default>
10
+
11
+ </layout>
app/design/frontend/default/default/template/developertoolbar/toolbar.phtml ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if(Mage::getStoreConfig('dev/developertoolbar/enabled')): ?>
2
+ <style>
3
+ .developertoolbar {
4
+ position: fixed;
5
+ left: 0px;
6
+ bottom: 0px;
7
+ width: 100%;
8
+ text-align: center;
9
+ background: #0A263C;
10
+ border-top: 1px solid #415966;
11
+ z-index: 10000;
12
+ }
13
+ .developertoolbar a {
14
+ color: #FF822F;
15
+ font-weight:bold;
16
+ font-size:11px;
17
+ text-decoration: none;
18
+ padding-left: 8px;
19
+ padding-right: 8px;
20
+ }
21
+
22
+ .developertoolbar a:hover {
23
+ color: #A7C6DD;
24
+ }
25
+
26
+ .developertoolbar .bar_name {
27
+ color: #D96708;
28
+ font-size: 10px;
29
+ font-weight:bold;
30
+ float: left;
31
+ cursor:pointer;
32
+ padding-left: 3px;
33
+ }
34
+
35
+ .developertoolbar .hide_me {
36
+ color: #D96708;
37
+ font-size: 9px;
38
+ font-weight:bold;
39
+ padding-right: 3px;
40
+ }
41
+
42
+ .developertoolbar .seperate {
43
+ width: 1px;
44
+ border-right: 1px solid #415966;
45
+ }
46
+
47
+ .developertoolbar .disabled {
48
+ color: #666;
49
+ }
50
+ </style>
51
+
52
+ <script language="javascript">
53
+ function hide_developer_toolbar(){
54
+ if (document.getElementById('bar_content').style.display == 'none') {
55
+ document.getElementById('bar_content').style.display = "inline";
56
+ document.getElementById('developertoolbar').style.width = "100%";
57
+ } else {
58
+ document.getElementById('bar_content').style.display = "none";
59
+ document.getElementById('developertoolbar').style.width = "100px";
60
+ }
61
+ }
62
+ </script>
63
+ <div class="developertoolbar" id="developertoolbar">
64
+ <a href="" onclick="hide_developer_toolbar(); return false;"><span class="bar_name">Developer Toolbar</span></a>
65
+
66
+
67
+ <span id="bar_content">
68
+ <a <?php if (Mage::getStoreConfig('dev/debug/template_hints') != '1') echo ' class="disabled "'; ?> href="<?php echo $this->getUrl('developertoolbar/index/hints/enabled/'.(Mage::getStoreConfig('dev/debug/template_hints')!='1'?1:0).'/type/front') ?>">Frontend Hints</a>
69
+
70
+ <span class="seperate"></span>
71
+ <a <?php if (Mage::getStoreConfig('dev/debug/template_hints', 0) != '1') echo ' class="disabled "'; ?> href="<?php echo $this->getUrl('developertoolbar/index/hints/enabled/'.(Mage::getStoreConfig('dev/debug/template_hints', 0)!='1'?1:0).'/type/back') ?>">Backend Hints</a>
72
+
73
+ <span class="seperate"></span>
74
+ <a <?php if (Mage::getStoreConfig('dev/log/active') != '1') echo ' class="disabled "'; ?> href="<?php echo $this->getUrl('developertoolbar/index/log/enabled/'.(Mage::getStoreConfig('dev/log/active')!='1'?1:0)) ?>">Logs</a>
75
+
76
+ <span class="seperate"></span>
77
+ <a <?php if (Mage::getStoreConfig('dev/js/merge_files') != '1') echo ' class="disabled "'; ?> href="<?php echo $this->getUrl('developertoolbar/index/js/enabled/'.(Mage::getStoreConfig('dev/js/merge_files')!='1'?1:0)) ?>">Merge JS</a>
78
+
79
+ <span class="seperate"></span>
80
+ <a <?php if (Mage::getStoreConfig('web/url/use_store') != '1') echo ' class="disabled "'; ?> href="<?php echo $this->getUrl('developertoolbar/index/url/enabled/'.(Mage::getStoreConfig('web/url/use_store')!='1'?1:0)) ?>">Store Code in Urls</a>
81
+
82
+ <span class="seperate"></span>
83
+ <a <?php if (Mage::getStoreConfig('web/seo/use_rewrites') != '1') echo ' class="disabled "'; ?> href="<?php echo $this->getUrl('developertoolbar/index/seo/enabled/'.(Mage::getStoreConfig('web/seo/use_rewrites')!='1'?1:0)) ?>">SEO Rewrites</a>
84
+
85
+ <span class="seperate"></span>
86
+ <a <?php if (Mage::getStoreConfig('dev/translate_inline/active') != '1') echo ' class="disabled "'; ?> href="<?php echo $this->getUrl('developertoolbar/index/translate/enabled/'.(Mage::getStoreConfig('dev/translate_inline/active')!='1'?1:0)) ?>">Translate Inline</a>
87
+
88
+ <span class="seperate"></span>
89
+ <a style="color:#FF0000;" href="<?php echo $this->getUrl('developertoolbar/index/cache/') ?>">Clean & Disable All Cache</a>
90
+ </span>
91
+ </div>
92
+ <?php endif; ?>
app/etc/modules/HM_DeveloperToolbar.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <HM_DeveloperToolbar>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </HM_DeveloperToolbar>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>HM_DeveloperToolbar</name>
4
+ <version>1.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>DeveloperToolbar</summary>
10
+ <description>DeveloperToolbar is useful extension that allow the developers to access some common configuration quickly and easily without logging in to admin panel.</description>
11
+ <notes>Compatible with magento 1.2.x - 1.3.x</notes>
12
+ <authors><author><name>Hai NGUYEN</name><user>auto-converted</user><email>haint@hello-magento.com</email></author></authors>
13
+ <date>2009-11-05</date>
14
+ <time>02:55:46</time>
15
+ <contents><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="developertoolbar.xml" hash="04e3440fab602230c373870eed65d2da"/></dir><dir name="template"><dir name="developertoolbar"><file name="toolbar.phtml" hash="28bb1b032cc255e17beb0cd6c1cc79f6"/></dir></dir></dir></dir></dir></target><target name="magecommunity"><dir name="HM"><dir name="DeveloperToolbar"><dir name="controllers"><file name="IndexController.php" hash="9b51ca0d357576b3ba0c892c39cab231"/></dir><dir name="etc"><file name="config.xml" hash="88dccd6de1a371868366e88d2b46e457"/><file name="system.xml" hash="d3a464b2dafd444f734c948f4c8e43b8"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="HM_DeveloperToolbar.xml" hash="08f56679bb2ba0892395f48520b0c09a"/></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies/>
18
+ </package>