So, I am trying to override a Gallery module I've downloaded and add some fields to the admin form, which would help me to include more options to the frontend.
The module I've downloaded is Image Gallery with categories or SAG_Gallery to be precise.
One of the files I am currently interested with is located in /app/code/community/Sag/Gallery/Block/Adminhtml/Category/Edit/Tab/Form.php
.
So I created a sample module and added it to /etc/modules
named AcmeDemo
, so now I have /etc/modules/AcmeDemo.xml
.
In there I've added the following code:
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<Acme_Demo>
<active>true</active>
<codePool>local</codePool>
<depend>
<Sag_Gallery />
</depend>
</Acme_Demo>
</modules>
</config>
I've also created the path, as follows: /app/code/local/Acme/Demo
. The module is loaded succesfully as I was able to confirm it by looking at my admin panel in "Advanced" options, it's there.
Then I created few directories to mimic the original path, as follows:
/app/code/local/Acme/Demo/Block/Adminhtml/Category/Edit/Tab
and in there I've created the file Form.php
with the following code (it's an example, I'm trying to "kill" the form, to ensure my code works)
class Bogara_Gallery_Block_Adminhtml_Category_Edit_Tab_Form extends Sag_Gallery_Block_Adminhtml_Category_Edit_Tab_Form {
protected function _prepareForm() {
exit;
}
}
I've added the following configuration in /app/code/local/Acme/Demo/etc/config.xml
:
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<Acme_Demo>
<version>0.0.1</version>
</Acme_Demo>
</modules>
<global>
<blocks>
<acme_demo>
<class>Acme_Demo_Block</class>
</acme_demo>
<adminhtml>
<rewrite>
<category_edit_tab_form>Acme_Demo_Block_Adminhtml_Category_Edit_Tab_Form</category_edit_tab_form>
</rewrite>
</adminhtml>
</blocks>
</global>
</config>
which appears to be wrong, since the original Form.php
is still being executed. Probably is some silly mistake, or something that I've missed.
Any kind of advice/help will be really appreciated. Thanks.