Skip to content

Instantly share code, notes, and snippets.

@xcommerce-gists
xcommerce-gists / Image.php
Created January 25, 2014 15:49
Sample Magento administrative image edit tab page
<?php
/**
* News List admin edit form image tab
*
* @author Magento
*/
class Magentostudy_News_Block_Adminhtml_News_Edit_Tab_Image
extends Mage_Adminhtml_Block_Widget_Form
implements Mage_Adminhtml_Block_Widget_Tab_Interface
{
@xcommerce-gists
xcommerce-gists / Content.php
Created January 25, 2014 15:46
Sample Magento administrative edit form content tab page
<?php
/**
* News List admin edit form content tab
*
* @author Magento
*/
class Magentostudy_News_Block_Adminhtml_News_Edit_Tab_Content
extends Mage_Adminhtml_Block_Widget_Form
implements Mage_Adminhtml_Block_Widget_Tab_Interface
{
@xcommerce-gists
xcommerce-gists / Image.php
Created January 25, 2014 15:42
Sample Magento administrative image-only form element
<?php
/**
* Custom image form element that generates correct thumbnail image URL
*
* @author Magento
*/
class Magentostudy_News_Block_Adminhtml_News_Edit_Form_Element_Image extends Varien_Data_Form_Element_Image
{
/**
* Get image preview url
@xcommerce-gists
xcommerce-gists / Tabs.php
Created January 25, 2014 15:40
Sample Magento administrative form tab page
<?php
/**
* News List admin edit form tabs block
*
* @author Magento
*/
class Magentostudy_News_Block_Adminhtml_News_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
{
/**
* Initialize tabs and define tabs block settings
@xcommerce-gists
xcommerce-gists / Form.php
Created January 25, 2014 15:37
Sample Magento administrative edit form block
<?php
/**
* News List admin edit form block
*
* @author Magento
*/
class Magentostudy_News_Block_Adminhtml_News_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
{
/**
* Prepare form action
@xcommerce-gists
xcommerce-gists / Edit.php
Created January 25, 2014 00:01
Sample Magento administrative edit form container
<?php
/**
* News List admin edit form container
*
* @author Magento
*/
class Magentostudy_News_Block_Adminhtml_News_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
{
/**
* Initialize edit form container
@xcommerce-gists
xcommerce-gists / Grid.php
Created January 24, 2014 23:55
Sample Magento administrative grid
<?php
/**
* News List admin grid
*
* @author Magento
*/
class Magentostudy_News_Block_Adminhtml_News_Grid extends Mage_Adminhtml_Block_Widget_Grid
{
/**
* Init Grid default properties
@xcommerce-gists
xcommerce-gists / News.php
Created January 24, 2014 23:46
Sample Magento administrative block/grid
<?php
/**
* News List admin grid container
*
* @author Magento
*/
class Magentostudy_News_Block_Adminhtml_News extends Mage_Adminhtml_Block_Widget_Grid_Container
{
/**
* Block constructor
@xcommerce-gists
xcommerce-gists / magentostudy_news.xml
Created January 24, 2014 23:06
Sample Magento administrative layout
<?xml version="1.0"?>
<!--
/**
* Magento backend layout
*
* @author Magento
*/
-->
<layout>
<adminhtml_news_index>
@xcommerce-gists
xcommerce-gists / NewsController.php
Created January 24, 2014 22:48
Sample Magento administrative controller
<?php
/**
* News controller
*
* @author Magento
*/
class Magentostudy_News_Adminhtml_NewsController extends Mage_Adminhtml_Controller_Action
{
/**
* Init actions