Skip to content

Commit 2610bf7

Browse files
committed
Initial Commit
0 parents  commit 2610bf7

File tree

251 files changed

+5488
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

251 files changed

+5488
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
![Magento Admin Theme](http://i.imgur.com/ELDeA.png)
2+
3+
## Installation on Magento 1.7.x
4+
5+
Install with [modgit](https://github.com/jreinke/modgit):
6+
7+
$ cd /path/to/magento
8+
$ modgit init
9+
$ modgit clone admin-theme https://github.com/jreinke/magento-admin-theme.git
10+
11+
or download package manually:
12+
13+
* Download latest version [here](https://github.com/jreinke/magento-admin-theme/archive/master.zip)
14+
* Unzip in Magento root folder
15+
* Clear cache
16+
17+
## Installation on Magento 1.6.x
18+
19+
Please refer to [branch 1.6](https://github.com/jreinke/magento-admin-theme/tree/1.6)
20+
21+
Full overview available [here](http://www.bubblecode.net/en/2012/05/02/give-your-magento-admin-panel-a-facelift/).
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
class Bubble_AdminTheme_Block_Adminhtml_System_Config_Fieldset_Hint
4+
extends Mage_Adminhtml_Block_Abstract
5+
implements Varien_Data_Form_Element_Renderer_Interface
6+
{
7+
protected $_template = 'bubble/admintheme/system/config/fieldset/hint.phtml';
8+
9+
public function render(Varien_Data_Form_Element_Abstract $element)
10+
{
11+
return $this->toHtml();
12+
}
13+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
class Bubble_AdminTheme_Block_Adminhtml_Themes_Select extends Mage_Adminhtml_Block_Html_Select
4+
{
5+
protected function _construct()
6+
{
7+
$this->setName('theme')
8+
->setId('interface_theme')
9+
->setTitle($this->helper('bubble_admintheme')->__('Current Admin Theme'))
10+
->setValue(Mage::getStoreConfig('bubble_admintheme/config/theme'))
11+
->setOptions($this->_getSelectOptions());
12+
}
13+
14+
protected function _getSelectOptions()
15+
{
16+
return Mage::getModel('bubble_admintheme/adminhtml_system_config_source_themes')->toOptionArray();
17+
}
18+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
class Bubble_AdminTheme_Helper_Data extends Mage_Core_Helper_Abstract
4+
{
5+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
class Bubble_AdminTheme_Model_Adminhtml_Observer
4+
{
5+
public function setTheme()
6+
{
7+
$theme = Mage::getStoreConfig('bubble_admintheme/config/theme');
8+
Mage::getDesign()->setTheme($theme);
9+
foreach (array('layout', 'template', 'skin', 'locale') as $type) {
10+
Mage::getDesign()->setTheme($type, $theme);
11+
}
12+
}
13+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
class Bubble_AdminTheme_Model_Adminhtml_System_Config_Source_Themes extends Mage_Core_Model_Abstract
4+
{
5+
public function toOptionArray()
6+
{
7+
$themes = Mage::getConfig()->getNode('adminhtml/themes');
8+
$options = array();
9+
foreach ($themes->children() as $key => $node) {
10+
$module = $node->getAttribute('module') ? $node->getAttribute('module') : 'adminhtml';
11+
$label = Mage::helper($module)->__((string) $node->label);
12+
$options[] = array(
13+
'value' => $key,
14+
'label' => $label,
15+
);
16+
}
17+
18+
return $options;
19+
}
20+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
class Bubble_AdminTheme_Adminhtml_ThemeController extends Mage_Adminhtml_Controller_Action
4+
{
5+
public function changeAction()
6+
{
7+
$theme = $this->getRequest()->getParam('theme');
8+
if ($theme) {
9+
Mage::getConfig()->saveConfig('bubble_admintheme/config/theme', $theme);
10+
Mage::app()->getCacheInstance()->cleanType('config');
11+
}
12+
$this->_redirectReferer();
13+
}
14+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0"?>
2+
<config>
3+
<acl>
4+
<resources>
5+
<admin>
6+
<children>
7+
<system>
8+
<children>
9+
<config>
10+
<children>
11+
<bubble_admintheme>
12+
<title>Bubble AdminTheme</title>
13+
</bubble_admintheme>
14+
</children>
15+
</config>
16+
</children>
17+
</system>
18+
</children>
19+
</admin>
20+
</resources>
21+
</acl>
22+
</config>
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<?xml version="1.0"?>
2+
<config>
3+
<modules>
4+
<Bubble_AdminTheme>
5+
<version>0.2.0</version>
6+
</Bubble_AdminTheme>
7+
</modules>
8+
<global>
9+
<blocks>
10+
<bubble_admintheme>
11+
<class>Bubble_AdminTheme_Block</class>
12+
</bubble_admintheme>
13+
</blocks>
14+
<helpers>
15+
<bubble_admintheme>
16+
<class>Bubble_AdminTheme_Helper</class>
17+
</bubble_admintheme>
18+
</helpers>
19+
<models>
20+
<bubble_admintheme>
21+
<class>Bubble_AdminTheme_Model</class>
22+
</bubble_admintheme>
23+
</models>
24+
<events>
25+
<adminhtml_controller_action_predispatch_start>
26+
<observers>
27+
<bubble_admintheme_admin_predispatch>
28+
<class>Bubble_AdminTheme_Model_Adminhtml_Observer</class>
29+
<method>setTheme</method>
30+
</bubble_admintheme_admin_predispatch>
31+
</observers>
32+
</adminhtml_controller_action_predispatch_start>
33+
</events>
34+
</global>
35+
<admin>
36+
<routers>
37+
<adminhtml>
38+
<args>
39+
<modules>
40+
<bubble_admintheme before="Mage_Adminhtml">Bubble_AdminTheme_Adminhtml</bubble_admintheme>
41+
</modules>
42+
</args>
43+
</adminhtml>
44+
</routers>
45+
</admin>
46+
<adminhtml>
47+
<layout>
48+
<updates>
49+
<bubble_admintheme>
50+
<file>bubble/admintheme.xml</file>
51+
</bubble_admintheme>
52+
</updates>
53+
</layout>
54+
<translate>
55+
<modules>
56+
<Bubble_AdminTheme>
57+
<files>
58+
<default>Bubble_AdminTheme.csv</default>
59+
</files>
60+
</Bubble_AdminTheme>
61+
</modules>
62+
</translate>
63+
<themes>
64+
<default module="bubble_admintheme">
65+
<label>Default</label>
66+
</default>
67+
<go module="bubble_admintheme">
68+
<label>Magento Go</label>
69+
</go>
70+
</themes>
71+
</adminhtml>
72+
<default>
73+
<bubble_admintheme>
74+
<config>
75+
<theme>go</theme>
76+
</config>
77+
</bubble_admintheme>
78+
</default>
79+
</config>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?xml version="1.0"?>
2+
<config>
3+
<tabs>
4+
<bubble translate="label">
5+
<label><![CDATA[<div><img src="http://i.imgur.com/nkD1M9R.png" alt="BubbleCode" title="BubbleCode" width="108" height="23" style="display:block;" /></div>]]></label>
6+
<sort_order>1000</sort_order>
7+
</bubble>
8+
</tabs>
9+
<sections>
10+
<bubble_admintheme translate="label" module="bubble_admintheme">
11+
<label>Bubble AdminTheme</label>
12+
<tab>bubble</tab>
13+
<sort_order>1000</sort_order>
14+
<show_in_default>1</show_in_default>
15+
<show_in_website>1</show_in_website>
16+
<show_in_store>1</show_in_store>
17+
<groups>
18+
<hint>
19+
<frontend_model>bubble_admintheme/adminhtml_system_config_fieldset_hint</frontend_model>
20+
<sort_order>0</sort_order>
21+
<show_in_default>1</show_in_default>
22+
<show_in_website>1</show_in_website>
23+
<show_in_store>1</show_in_store>
24+
</hint>
25+
<config translate="label">
26+
<label>Admin Theme Settings</label>
27+
<sort_order>10</sort_order>
28+
<show_in_default>1</show_in_default>
29+
<show_in_website>0</show_in_website>
30+
<show_in_store>0</show_in_store>
31+
<fields>
32+
<theme translate="label">
33+
<label>Current Admin Theme</label>
34+
<frontend_type>select</frontend_type>
35+
<source_model>bubble_admintheme/adminhtml_system_config_source_themes</source_model>
36+
<sort_order>10</sort_order>
37+
<show_in_default>1</show_in_default>
38+
<show_in_website>0</show_in_website>
39+
<show_in_store>0</show_in_store>
40+
</theme>
41+
</fields>
42+
</config>
43+
</groups>
44+
</bubble_admintheme>
45+
</sections>
46+
</config>

0 commit comments

Comments
 (0)