Skip to content

Commit fa282ce

Browse files
author
Tim Bezhashvyly
committed
Change namespace
1 parent cf686db commit fa282ce

File tree

12 files changed

+740
-51
lines changed

12 files changed

+740
-51
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

LICENSE.md

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

composer.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "firegento/gridcontrol",
3+
"license": ["GPL-3.0"],
4+
"type": "magento-module",
5+
"description": "Full control over your admin grids with xml.",
6+
"homepage": "https://github.com/firegento/firegento-gridcontrol",
7+
"require": {
8+
"magento-hackathon/magento-composer-installer": "*"
9+
},
10+
"repositories": [
11+
{
12+
"type": "composer",
13+
"url": "http://packages.firegento.com"
14+
}
15+
]
16+
}

modman

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
src/app/code/community/Hackathon/GridControl app/code/community/Hackathon/GridControl
2-
src/app/etc/modules/Hackathon_GridControl.xml app/etc/modules/Hackathon_GridControl.xml
1+
src/app/code/community/FireGento/GridControl app/code/community/FireGento/GridControl
2+
src/app/etc/modules/FireGento_GridControl.xml app/etc/modules/FireGento_GridControl.xml
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php
2+
3+
class FireGento_GridControl_Helper_Data extends Mage_Core_Helper_Abstract
4+
{
5+
6+
}

src/app/code/community/Hackathon/GridControl/Model/Config.php renamed to src/app/code/community/Firegento/GridControl/Model/Config.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* loads gridcontrol.xml configuration and stores collection updates
44
*/
5-
class Hackathon_GridControl_Model_Config extends Varien_Object
5+
class FireGento_GridControl_Model_Config extends Varien_Object
66
{
77
/**
88
* @var null|Varien_Simplexml_Config $_config
@@ -22,7 +22,7 @@ class Hackathon_GridControl_Model_Config extends Varien_Object
2222
* @param string $type
2323
* @param string $block
2424
* @param string $value
25-
* @return Hackathon_GridControl_Model_Config
25+
* @return FireGento_GridControl_Model_Config
2626
*/
2727
public function addCollectionUpdate($type, $block, $value)
2828
{

src/app/code/community/Hackathon/GridControl/Model/Observer.php renamed to src/app/code/community/Firegento/GridControl/Model/Observer.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* eav_collection_abstract_load_before:
99
* checks if current blockid is set to add joints and attributes to grid collection
1010
*/
11-
class Hackathon_GridControl_Model_Observer
11+
class FireGento_GridControl_Model_Observer
1212
{
1313
/**
1414
* observe adminhtml_block_html_before
@@ -20,8 +20,8 @@ public function adminhtmlBlockHtmlBefore(Varien_Event_Observer $event)
2020
{
2121
$block = $event->getBlock();
2222

23-
if (in_array($block->getId(), Mage::getSingleton('hackathon_gridcontrol/config')->getGridList())) {
24-
Mage::getModel('hackathon_gridcontrol/processor')->processBlock($block);
23+
if (in_array($block->getId(), Mage::getSingleton('firegento_gridcontrol/config')->getGridList())) {
24+
Mage::getModel('firegento_gridcontrol/processor')->processBlock($block);
2525
}
2626
}
2727

@@ -35,23 +35,23 @@ public function eavCollectionAbstractLoadBefore(Varien_Event_Observer $event)
3535
{
3636
$columnJoinField = array();
3737

38-
if (Mage::registry('hackathon_gridcontrol_current_block')) {
39-
$blockId = Mage::registry('hackathon_gridcontrol_current_block')->getId();
38+
if (Mage::registry('firegento_gridcontrol_current_block')) {
39+
$blockId = Mage::registry('firegento_gridcontrol_current_block')->getId();
4040

4141
/**
42-
* @var Hackathon_GridControl_Model_Config $config
42+
* @var FireGento_GridControl_Model_Config $config
4343
*/
44-
$config = Mage::getSingleton('hackathon_gridcontrol/config');
44+
$config = Mage::getSingleton('firegento_gridcontrol/config');
4545

4646
// add attributes to eav collection
4747
if ($event->getCollection() instanceof Mage_Eav_Model_Entity_Collection_Abstract){
48-
foreach ($config->getCollectionUpdates(Hackathon_GridControl_Model_Config::TYPE_ADD_ATTRIBUTE, $blockId) as $entry) {
48+
foreach ($config->getCollectionUpdates(FireGento_GridControl_Model_Config::TYPE_ADD_ATTRIBUTE, $blockId) as $entry) {
4949
$event->getCollection()->addAttributeToSelect($entry);
5050
}
5151
}
5252

5353
// join attributes to collection
54-
foreach ($config->getCollectionUpdates(Hackathon_GridControl_Model_Config::TYPE_JOIN_ATTRIBUTE, $blockId) as $attribute) {
54+
foreach ($config->getCollectionUpdates(FireGento_GridControl_Model_Config::TYPE_JOIN_ATTRIBUTE, $blockId) as $attribute) {
5555
$attribute = explode('|', $attribute);
5656
// 5 parameters needed for joinAttribute()
5757
if (count($attribute) < 5) {
@@ -69,7 +69,7 @@ public function eavCollectionAbstractLoadBefore(Varien_Event_Observer $event)
6969
}
7070

7171
// join fields to collection
72-
foreach ($config->getCollectionUpdates(Hackathon_GridControl_Model_Config::TYPE_JOIN_FIELD, $blockId) as $field) {
72+
foreach ($config->getCollectionUpdates(FireGento_GridControl_Model_Config::TYPE_JOIN_FIELD, $blockId) as $field) {
7373
$field = explode('|', $field);
7474
// 6 parameters needed for joinField()
7575
if (count($field) < 6) {
@@ -88,7 +88,7 @@ public function eavCollectionAbstractLoadBefore(Varien_Event_Observer $event)
8888
}
8989

9090
// joins to collection
91-
foreach ($config->getCollectionUpdates(Hackathon_GridControl_Model_Config::TYPE_JOIN, $blockId) as $field) {
91+
foreach ($config->getCollectionUpdates(FireGento_GridControl_Model_Config::TYPE_JOIN, $blockId) as $field) {
9292
try {
9393
$event->getCollection()->join(
9494
$field['table'],
@@ -100,7 +100,7 @@ public function eavCollectionAbstractLoadBefore(Varien_Event_Observer $event)
100100
}
101101

102102
// update index from join_index (needed for joins)
103-
foreach (Mage::registry('hackathon_gridcontrol_current_block')->getColumns() as $column) {
103+
foreach (Mage::registry('firegento_gridcontrol_current_block')->getColumns() as $column) {
104104
if (isset($columnJoinField[$column->getId()])) {
105105
$column->setIndex($columnJoinField[$column->getId()]);
106106
}

src/app/code/community/Hackathon/GridControl/Model/Processor.php renamed to src/app/code/community/Firegento/GridControl/Model/Processor.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @todo check for remove and add on one column entity
66
* @todo find a better way to call _prepareCollection (without reflection)
77
*/
8-
class Hackathon_GridControl_Model_Processor
8+
class FireGento_GridControl_Model_Processor
99
{
1010
/**
1111
* processes the grid block, checks gridcontrol configuration for updates on this block and calls column actions
@@ -14,7 +14,7 @@ class Hackathon_GridControl_Model_Processor
1414
*/
1515
public function processBlock($block)
1616
{
17-
$config = Mage::getSingleton('hackathon_gridcontrol/config')->getConfig();
17+
$config = Mage::getSingleton('firegento_gridcontrol/config')->getConfig();
1818

1919
$blockConfig = $config->getNode('grids/' . $block->getId());
2020

@@ -42,12 +42,12 @@ public function processBlock($block)
4242
// resort columns
4343
$block->sortColumnsByOrder();
4444

45-
// register current block, needed to extend the collection in Hackathon_GridControl_Model_Observer
46-
Mage::register('hackathon_gridcontrol_current_block', $block);
45+
// register current block, needed to extend the collection in FireGento_GridControl_Model_Observer
46+
Mage::register('firegento_gridcontrol_current_block', $block);
4747
// call _prepareCollection to reload the collection and apply column filters
4848
$this->_callProtectedMethod($block, '_prepareCollection');
4949
// remove current block to prevent race conditions in later collection loads
50-
Mage::unregister('hackathon_gridcontrol_current_block');
50+
Mage::unregister('firegento_gridcontrol_current_block');
5151
}
5252

5353
/**
@@ -80,22 +80,22 @@ protected function _addAction($params)
8080
$columnConfig = array();
8181
$blockId = $params->getBlock()->getId();
8282
/**
83-
* @var Hackathon_GridControl_Model_Config $config
83+
* @var FireGento_GridControl_Model_Config $config
8484
*/
85-
$config = Mage::getSingleton('hackathon_gridcontrol/config');
85+
$config = Mage::getSingleton('firegento_gridcontrol/config');
8686

8787
foreach ($params->getAction()->children() as $attribute) {
8888
// 4 special cases
8989
if ($attribute->getName() == 'index') {
90-
$config->addCollectionUpdate(Hackathon_GridControl_Model_Config::TYPE_ADD_ATTRIBUTE, $blockId, (string) $attribute);
90+
$config->addCollectionUpdate(FireGento_GridControl_Model_Config::TYPE_ADD_ATTRIBUTE, $blockId, (string) $attribute);
9191
} else if ($attribute->getName() == 'joinAttribute') {
92-
$config->addCollectionUpdate(Hackathon_GridControl_Model_Config::TYPE_JOIN_ATTRIBUTE, $blockId, (string) $attribute);
92+
$config->addCollectionUpdate(FireGento_GridControl_Model_Config::TYPE_JOIN_ATTRIBUTE, $blockId, (string) $attribute);
9393
continue;
9494
} else if ($attribute->getName() == 'joinField') {
95-
$config->addCollectionUpdate(Hackathon_GridControl_Model_Config::TYPE_JOIN_FIELD, $blockId, (string) $attribute);
95+
$config->addCollectionUpdate(FireGento_GridControl_Model_Config::TYPE_JOIN_FIELD, $blockId, (string) $attribute);
9696
continue;
9797
} else if ($attribute->getName() == 'join') {
98-
$config->addCollectionUpdate(Hackathon_GridControl_Model_Config::TYPE_JOIN, $blockId, array(
98+
$config->addCollectionUpdate(FireGento_GridControl_Model_Config::TYPE_JOIN, $blockId, array(
9999
'table' => (string) $attribute['table'],
100100
'condition' => (string) $attribute['condition'],
101101
'field' => (string) $attribute['field'],

src/app/code/community/Hackathon/GridControl/etc/config.xml renamed to src/app/code/community/Firegento/GridControl/etc/config.xml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,46 @@
22
<config>
33
<global>
44
<models>
5-
<hackathon_gridcontrol>
6-
<class>Hackathon_GridControl_Model</class>
7-
</hackathon_gridcontrol>
5+
<firegento_gridcontrol>
6+
<class>FireGento_GridControl_Model</class>
7+
</firegento_gridcontrol>
88
</models>
99

1010
<helpers>
11-
<hackathon_gridcontrol>
12-
<class>Hackathon_GridControl_Helper</class>
13-
</hackathon_gridcontrol>
11+
<firegento_gridcontrol>
12+
<class>FireGento_GridControl_Helper</class>
13+
</firegento_gridcontrol>
1414
</helpers>
1515
</global>
1616

1717
<adminhtml>
1818
<events>
1919
<adminhtml_block_html_before>
2020
<observers>
21-
<hackathon_gridcontrol>
21+
<firegento_gridcontrol>
2222
<type>singleton</type>
23-
<class>hackathon_gridcontrol/observer</class>
23+
<class>firegento_gridcontrol/observer</class>
2424
<method>adminhtmlBlockHtmlBefore</method>
25-
</hackathon_gridcontrol>
25+
</firegento_gridcontrol>
2626
</observers>
2727
</adminhtml_block_html_before>
2828

2929
<core_collection_abstract_load_before>
3030
<observers>
31-
<hackathon_gridcontrol>
31+
<firegento_gridcontrol>
3232
<type>singleton</type>
33-
<class>hackathon_gridcontrol/observer</class>
33+
<class>firegento_gridcontrol/observer</class>
3434
<method>eavCollectionAbstractLoadBefore</method>
35-
</hackathon_gridcontrol>
35+
</firegento_gridcontrol>
3636
</observers>
3737
</core_collection_abstract_load_before>
3838
<eav_collection_abstract_load_before>
3939
<observers>
40-
<hackathon_gridcontrol>
40+
<firegento_gridcontrol>
4141
<type>singleton</type>
42-
<class>hackathon_gridcontrol/observer</class>
42+
<class>firegento_gridcontrol/observer</class>
4343
<method>eavCollectionAbstractLoadBefore</method>
44-
</hackathon_gridcontrol>
44+
</firegento_gridcontrol>
4545
</observers>
4646
</eav_collection_abstract_load_before>
4747
</events>

src/app/code/community/Hackathon/GridControl/etc/gridcontrol.xml renamed to src/app/code/community/Firegento/GridControl/etc/gridcontrol.xml

File renamed without changes.

0 commit comments

Comments
 (0)