Eke_Staticblock - Version 0.1.0

Version Notes

Initial release.

Download this release

Release Info

Developer Eke Digital
Extension Eke_Staticblock
Version 0.1.0
Comparing to
See all releases


Version 0.1.0

app/code/community/Eke/Staticblock/Block/Adminhtml/About.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Eke_Staticblock_Block_Adminhtml_About
4
+ extends Mage_Adminhtml_Block_Abstract
5
+ implements Varien_Data_Form_Element_Renderer_Interface
6
+ {
7
+
8
+
9
+ public function render(Varien_Data_Form_Element_Abstract $element)
10
+ {
11
+ $logo = "//www.ekedigital.com/assets/eke_logo_modules.png";
12
+ $html = <<<HTML
13
+
14
+ <div style="background:url('$logo') no-repeat scroll 15px 15px #e7efef; border:1px solid #ccc; min-height:60px; margin:5px 0; padding:15px 15px 15px 140px;">
15
+ <p><strong>Static Block / CMS Filter v0.1.0</strong> by <a href="https://www.ekedigital.com/?utm_source=Magento_Extension&utm_medium=Extension_Settings&utm_campaign=CMS_Filter" target="_blank">Eke Digital</a>
16
+ <br /> Quickly filter CMS Pages and Static Blocks to locate which one is being used by your store.
17
+ </p>For questions or support requests please email us at <a href="mailto:support@ekedigital.com">support@ekedigital.com</a>.</p>
18
+ </div>
19
+
20
+ HTML;
21
+ return $html;
22
+ }
23
+ }
app/code/community/Eke/Staticblock/Block/Adminhtml/Cms/Block/Grid.php ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ class Eke_Staticblock_Block_Adminhtml_Cms_Block_Grid extends Mage_Adminhtml_Block_Widget_Grid
5
+ {
6
+
7
+ public function __construct()
8
+ {
9
+ parent::__construct();
10
+ $this->setId('cmsBlockGrid');
11
+ $this->setDefaultSort('block_identifier');
12
+ $this->setDefaultDir('ASC');
13
+ }
14
+
15
+ protected function _prepareCollection()
16
+ {
17
+ $collection = Mage::getModel('cms/block')->getCollection();
18
+ /* @var $collection Mage_Cms_Model_Mysql4_Block_Collection */
19
+ $this->setCollection($collection);
20
+ return parent::_prepareCollection();
21
+ }
22
+
23
+ protected function _prepareColumns()
24
+ {
25
+ $baseUrl = $this->getUrl();
26
+
27
+ $this->addColumn('title', array(
28
+ 'header' => Mage::helper('cms')->__('Title'),
29
+ 'align' => 'left',
30
+ 'index' => 'title',
31
+ ));
32
+
33
+ $this->addColumn('identifier', array(
34
+ 'header' => Mage::helper('cms')->__('Identifier'),
35
+ 'align' => 'left',
36
+ 'index' => 'identifier'
37
+ ));
38
+ $helper = Mage::helper("eke_staticblock");
39
+ if ($helper->isSaticEnabled()) {
40
+ $this->addColumn('content', array(
41
+ 'header' => Mage::helper('cms')->__('Block Content'),
42
+ 'align' => 'left',
43
+ 'column_css_class' => 'cmsFilter',
44
+ 'type' => 'text',
45
+ 'truncate' => 250,
46
+ 'index' => 'content',
47
+ 'escape' => true,
48
+ ));
49
+ }
50
+
51
+ if (!Mage::app()->isSingleStoreMode()) {
52
+ $this->addColumn('store_id', array(
53
+ 'header' => Mage::helper('cms')->__('Store View'),
54
+ 'index' => 'store_id',
55
+ 'type' => 'store',
56
+ 'store_all' => true,
57
+ 'store_view' => true,
58
+ 'sortable' => false,
59
+ 'filter_condition_callback'
60
+ => array($this, '_filterStoreCondition'),
61
+ ));
62
+ }
63
+
64
+ $this->addColumn('is_active', array(
65
+ 'header' => Mage::helper('cms')->__('Status'),
66
+ 'index' => 'is_active',
67
+ 'type' => 'options',
68
+ 'options' => array(
69
+ 0 => Mage::helper('cms')->__('Disabled'),
70
+ 1 => Mage::helper('cms')->__('Enabled')
71
+ ),
72
+ ));
73
+
74
+ $this->addColumn('creation_time', array(
75
+ 'header' => Mage::helper('cms')->__('Date Created'),
76
+ 'index' => 'creation_time',
77
+ 'type' => 'datetime',
78
+ ));
79
+
80
+ $this->addColumn('update_time', array(
81
+ 'header' => Mage::helper('cms')->__('Last Modified'),
82
+ 'index' => 'update_time',
83
+ 'type' => 'datetime',
84
+ ));
85
+
86
+ return parent::_prepareColumns();
87
+ }
88
+
89
+ protected function _afterLoadCollection()
90
+ {
91
+ $this->getCollection()->walk('afterLoad');
92
+ parent::_afterLoadCollection();
93
+ }
94
+
95
+ protected function _filterStoreCondition($collection, $column)
96
+ {
97
+ if (!$value = $column->getFilter()->getValue()) {
98
+ return;
99
+ }
100
+
101
+ $this->getCollection()->addStoreFilter($value);
102
+ }
103
+
104
+ /**
105
+ * Row click url
106
+ *
107
+ * @return string
108
+ */
109
+ public function getRowUrl($row)
110
+ {
111
+ return $this->getUrl('*/*/edit', array('block_id' => $row->getId()));
112
+ }
113
+
114
+ }
app/code/community/Eke/Staticblock/Block/Adminhtml/Cms/Page/Grid.php ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Eke_Staticblock_Block_Adminhtml_Cms_Page_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
+ {
5
+
6
+ public function __construct()
7
+ {
8
+ parent::__construct();
9
+ $this->setId('cmsPageGrid');
10
+ $this->setDefaultSort('identifier');
11
+ $this->setDefaultDir('ASC');
12
+ }
13
+
14
+ protected function _prepareCollection()
15
+ {
16
+ $collection = Mage::getModel('cms/page')->getCollection();
17
+ $collection->setFirstStoreFlag(true);
18
+ $this->setCollection($collection);
19
+
20
+ return parent::_prepareCollection();
21
+ }
22
+
23
+ protected function _prepareColumns()
24
+ {
25
+ $baseUrl = $this->getUrl();
26
+
27
+ $this->addColumn('title', array(
28
+ 'header' => Mage::helper('cms')->__('Title'),
29
+ 'align' => 'left',
30
+ 'index' => 'title',
31
+ ));
32
+
33
+ $this->addColumn('identifier', array(
34
+ 'header' => Mage::helper('cms')->__('URL Key'),
35
+ 'align' => 'left',
36
+ 'index' => 'identifier'
37
+ ));
38
+
39
+ $helper = Mage::helper("eke_staticblock");
40
+ if ($helper->isSaticEnabled()) {
41
+ $this->addColumn('content', array(
42
+ 'header' => Mage::helper('cms')->__('Page Content'),
43
+ 'align' => 'left',
44
+ 'column_css_class' => 'cmsFilter',
45
+ 'type' => 'text',
46
+ 'truncate' => 250,
47
+ 'index' => 'content',
48
+ 'escape' => true,
49
+ ));
50
+ }
51
+
52
+
53
+ $this->addColumn('root_template', array(
54
+ 'header' => Mage::helper('cms')->__('Layout'),
55
+ 'index' => 'root_template',
56
+ 'type' => 'options',
57
+ 'options' => Mage::getSingleton('page/source_layout')->getOptions(),
58
+ ));
59
+
60
+ /**
61
+ * Check is single store mode
62
+ */
63
+ if (!Mage::app()->isSingleStoreMode()) {
64
+ $this->addColumn('store_id', array(
65
+ 'header' => Mage::helper('cms')->__('Store View'),
66
+ 'index' => 'store_id',
67
+ 'type' => 'store',
68
+ 'store_all' => true,
69
+ 'store_view' => true,
70
+ 'sortable' => false,
71
+ 'filter_condition_callback'
72
+ => array($this, '_filterStoreCondition'),
73
+ ));
74
+ }
75
+
76
+ $this->addColumn('is_active', array(
77
+ 'header' => Mage::helper('cms')->__('Status'),
78
+ 'index' => 'is_active',
79
+ 'type' => 'options',
80
+ 'options' => Mage::getSingleton('cms/page')->getAvailableStatuses()
81
+ ));
82
+
83
+ $this->addColumn('creation_time', array(
84
+ 'header' => Mage::helper('cms')->__('Date Created'),
85
+ 'index' => 'creation_time',
86
+ 'type' => 'datetime',
87
+ ));
88
+
89
+ $this->addColumn('update_time', array(
90
+ 'header' => Mage::helper('cms')->__('Last Modified'),
91
+ 'index' => 'update_time',
92
+ 'type' => 'datetime',
93
+ ));
94
+
95
+ $this->addColumn('page_actions', array(
96
+ 'header' => Mage::helper('cms')->__('Action'),
97
+ 'width' => 10,
98
+ 'sortable' => false,
99
+ 'filter' => false,
100
+ 'renderer' => 'adminhtml/cms_page_grid_renderer_action',
101
+ ));
102
+
103
+ return parent::_prepareColumns();
104
+ }
105
+
106
+ protected function _afterLoadCollection()
107
+ {
108
+ $this->getCollection()->walk('afterLoad');
109
+ parent::_afterLoadCollection();
110
+ }
111
+
112
+ protected function _filterStoreCondition($collection, $column)
113
+ {
114
+ if (!$value = $column->getFilter()->getValue()) {
115
+ return;
116
+ }
117
+
118
+ $this->getCollection()->addStoreFilter($value);
119
+ }
120
+
121
+ /**
122
+ * Row click url
123
+ *
124
+ * @return string
125
+ */
126
+ public function getRowUrl($row)
127
+ {
128
+ return $this->getUrl('*/*/edit', array('page_id' => $row->getId()));
129
+ }
130
+ }
app/code/community/Eke/Staticblock/Helper/Data.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Eke_Staticblock_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+ public function isSaticEnabled()
5
+ {
6
+ return Mage::getStoreConfig("eke_staticblock/static/enabled");
7
+ }
8
+
9
+
10
+ }
app/code/community/Eke/Staticblock/etc/adminhtml.xml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <admin>
6
+ <children>
7
+ <system>
8
+ <children>
9
+ <config>
10
+ <children>
11
+ <eke_staticblock>
12
+ <title>Eke Digital Block / CMS Filter</title>
13
+ <sort_order>990</sort_order>
14
+ </eke_staticblock>
15
+ </children>
16
+ </config>
17
+ </children>
18
+ </system>
19
+ </children>
20
+ </admin>
21
+ </resources>
22
+ </acl>
23
+ </config>
app/code/community/Eke/Staticblock/etc/config.xml ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Eke_Staticblock>
5
+ <version>0.1.0</version>
6
+ </Eke_Staticblock>
7
+ </modules>
8
+ <global>
9
+ <models>
10
+ <eke_staticblock>
11
+ <class>Eke_Staticblock_Model</class>
12
+ <resourceModel>eke_staticblock_resource</resourceModel>
13
+ </eke_staticblock>
14
+ <eke_staticblock_resource>
15
+ <class>Eke_Staticblock_Model_Resource</class>
16
+ </eke_staticblock_resource>
17
+ </models>
18
+ <blocks>
19
+ <eke_staticblock>
20
+ <class>Eke_Staticblock_Block</class>
21
+ </eke_staticblock>
22
+ <adminhtml>
23
+ <rewrite>
24
+ <cms_page_grid>Eke_Staticblock_Block_Adminhtml_Cms_Page_Grid</cms_page_grid>
25
+ <cms_block_grid>Eke_Staticblock_Block_Adminhtml_Cms_Block_Grid</cms_block_grid>
26
+ </rewrite>
27
+ </adminhtml>
28
+ </blocks>
29
+ <helpers>
30
+ <eke_staticblock>
31
+ <class>Eke_Staticblock_Helper</class>
32
+ </eke_staticblock>
33
+ </helpers>
34
+ </global>
35
+ <adminhtml>
36
+ <layout>
37
+ <updates>
38
+ <eke_staticblock>
39
+ <file>eke_staticblock.xml</file>
40
+ </eke_staticblock>
41
+ </updates>
42
+ </layout>
43
+ </adminhtml>
44
+ <default>
45
+ <eke_staticblock>
46
+ <static>
47
+ <enabled>0</enabled>
48
+ </static>
49
+ </eke_staticblock>
50
+ </default>
51
+ </config>
app/code/community/Eke/Staticblock/etc/system.xml ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <eke>
5
+ <label>EKE DIGITAL</label>
6
+ <sort_order>100</sort_order>
7
+ </eke>
8
+ </tabs>
9
+ <sections>
10
+ <eke_staticblock translate="label">
11
+ <label>Static Block / CMS Filter</label>
12
+ <tab>eke</tab>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>100</sort_order>
15
+ <show_in_default>1</show_in_default>
16
+ <show_in_website>1</show_in_website>
17
+ <show_in_store>1</show_in_store>
18
+ <groups>
19
+ <about>
20
+ <frontend_model>eke_staticblock/adminhtml_about</frontend_model>
21
+ <sort_order>1</sort_order>
22
+ <show_in_default>1</show_in_default>
23
+ <show_in_website>1</show_in_website>
24
+ <show_in_store>1</show_in_store>
25
+ </about>
26
+ <static translate="label">
27
+ <label>Configuration</label>
28
+ <show_in_default>1</show_in_default>
29
+ <show_in_website>1</show_in_website>
30
+ <show_in_store>1</show_in_store>
31
+ <sort_order>2</sort_order>
32
+ <fields>
33
+ <enabled translate="label" module="eke_staticblock">
34
+ <label>Enable</label>
35
+ <frontend_type>select</frontend_type>
36
+ <source_model>adminhtml/system_config_source_enabledisable</source_model>
37
+ <sort_order>10</sort_order>
38
+ <show_in_default>1</show_in_default>
39
+ <show_in_website>1</show_in_website>
40
+ <show_in_store>1</show_in_store>
41
+ </enabled>
42
+ </fields>
43
+ </static>
44
+ </groups>
45
+ </eke_staticblock>
46
+ </sections>
47
+ </config>
app/design/adminhtml/default/default/layout/eke_staticblock.xml ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout>
3
+
4
+ <adminhtml_system_config_edit>
5
+ <reference name="head">
6
+ <action method="addItem" ifconfig="eke_staticblock/static/enabled">
7
+ <type>skin_css</type>
8
+ <name>css/eke/staticblock.css</name>
9
+ </action>
10
+ </reference>
11
+ </adminhtml_system_config_edit>
12
+
13
+ <adminhtml_cms_page_index>
14
+ <reference name="head">
15
+ <action method="addItem" ifconfig="eke_staticblock/static/enabled">
16
+ <type>skin_css</type>
17
+ <name>css/eke/staticblock.css</name>
18
+ </action>
19
+ </reference>
20
+ </adminhtml_cms_page_index>
21
+
22
+ <adminhtml_cms_block_index>
23
+ <reference name="head">
24
+ <action method="addItem" ifconfig="eke_staticblock/static/enabled">
25
+ <type>skin_css</type>
26
+ <name>css/eke/staticblock.css</name>
27
+ </action>
28
+ </reference>
29
+ </adminhtml_cms_block_index>
30
+
31
+ </layout>
app/etc/modules/Eke_Staticblock.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Eke_Staticblock>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </Eke_Staticblock>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Eke_Staticblock</name>
4
+ <version>0.1.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Quickly filter CMS Pages and Static Blocks by content to locate which one is being used by your store.</summary>
10
+ <description>This module adds a new column to the CMS Static Block and CMS Pages grid allowing you to see and filter by content.</description>
11
+ <notes>Initial release.</notes>
12
+ <authors><author><name>Dane Del Valle</name><user>ekedigital</user><email>dane@ekedigital.com</email></author></authors>
13
+ <date>2016-09-28</date>
14
+ <time>01:27:29</time>
15
+ <contents><target name="magecommunity"><dir name="Eke"><dir name="Staticblock"><dir name="Block"><dir name="Adminhtml"><file name="About.php" hash="b329ad42f60c49a141afb6ca54d8b242"/><dir name="Cms"><dir name="Block"><file name="Grid.php" hash="6a058358b5dc0600a8d39ddae45a7e0c"/></dir><dir name="Page"><file name="Grid.php" hash="39f5141949a8bd6e5f32f41e69473998"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="c532c611ec8c7e37a0715c067f6c3d20"/></dir><dir name="etc"><file name="adminhtml.xml" hash="68e9b90b113768e0ade0e20da721859b"/><file name="config.xml" hash="b6c14184a8999971ed2afb1b3717d2e8"/><file name="system.xml" hash="28b37dee5f63e894c7d31526491f8e65"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Eke_Staticblock.xml" hash="009bdd81f472c1c7f72b92c73be232be"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="eke_staticblock.xml" hash="78c4429465bbcbd8878b8c987b26fd93"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="css"><dir name="eke"><file name="staticblock.css" hash="fbeddada843c32f499b87e042d43a39f"/></dir></dir></dir></dir></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><package><name>Mage_Core_Helper_Abstract</name><channel>community</channel><min>1.6</min><max>1.9</max></package></required></dependencies>
18
+ </package>
skin/adminhtml/default/default/css/eke/staticblock.css ADDED
@@ -0,0 +1 @@
 
1
+ .cmsFilter {max-width:350px}