Mage_Adminhtml_Block_System_Email_Template_Edit Class Reference

Inheritance diagram for Mage_Adminhtml_Block_System_Email_Template_Edit:

Mage_Adminhtml_Block_Widget Mage_Adminhtml_Block_Template Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 __construct ()
 getBackButtonHtml ()
 getToggleButtonHtml ()
 getResetButtonHtml ()
 getToPlainButtonHtml ()
 getToHtmlButtonHtml ()
 getSaveButtonHtml ()
 getPreviewButtonHtml ()
 getDeleteButtonHtml ()
 getLoadButtonHtml ()
 getEditMode ()
 getHeaderText ()
 getFormHtml ()
 getSaveUrl ()
 getPreviewUrl ()
 isTextType ()
 getDeleteUrl ()
 getEmailTemplate ()
 getLocaleOptions ()
 getTemplateOptions ()
 getCurrentLocale ()
 getLoadUrl ()

Protected Member Functions

 _prepareLayout ()


Detailed Description

Definition at line 35 of file Edit.php.


Constructor & Destructor Documentation

__construct (  ) 

Constructor

By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes

Reimplemented from Varien_Object.

Definition at line 39 of file Edit.php.

00040     {
00041         parent::__construct();
00042         $this->setTemplate('system/email/template/edit.phtml');
00043         Mage::register('email_template', Mage::getModel('core/email_template'));
00044         if ($templateId = (int) $this->getRequest()->getParam('id')) {
00045             $this->getEmailTemplate()->load($templateId);
00046         }
00047     }


Member Function Documentation

_prepareLayout (  )  [protected]

Preparing global layout

You can redefine this method in child classes for changin layout

Returns:
Mage_Core_Block_Abstract

Reimplemented from Mage_Core_Block_Abstract.

Definition at line 49 of file Edit.php.

00050     {
00051         $this->setChild('back_button',
00052             $this->getLayout()->createBlock('adminhtml/widget_button')
00053                 ->setData(
00054                     array(
00055                         'label'   => Mage::helper('adminhtml')->__('Back'),
00056                         'onclick' => "window.location.href = '" . $this->getUrl('*/*') . "'",
00057                         'class'   => 'back'
00058                     )
00059                 )
00060         );
00061 
00062 
00063         $this->setChild('reset_button',
00064             $this->getLayout()->createBlock('adminhtml/widget_button')
00065                 ->setData(
00066                     array(
00067                         'label'   => Mage::helper('adminhtml')->__('Reset'),
00068                         'onclick' => 'window.location.href = window.location.href'
00069                     )
00070                 )
00071         );
00072 
00073 
00074         $this->setChild('delete_button',
00075             $this->getLayout()->createBlock('adminhtml/widget_button')
00076                 ->setData(
00077                     array(
00078                         'label'   => Mage::helper('adminhtml')->__('Delete Template'),
00079                         'onclick' => 'templateControl.deleteTemplate();',
00080                         'class'   => 'delete'
00081                     )
00082                 )
00083         );
00084 
00085         $this->setChild('to_plain_button',
00086             $this->getLayout()->createBlock('adminhtml/widget_button')
00087                 ->setData(
00088                     array(
00089                         'label'   => Mage::helper('adminhtml')->__('Convert to Plain Text'),
00090                         'onclick' => 'templateControl.stripTags();',
00091                         'id'      => 'convert_button'
00092                     )
00093                 )
00094         );
00095 
00096 
00097         $this->setChild('to_html_button',
00098             $this->getLayout()->createBlock('adminhtml/widget_button')
00099                 ->setData(
00100                     array(
00101                         'label'   => Mage::helper('adminhtml')->__('Return Html Version'),
00102                         'onclick' => 'templateControl.unStripTags();',
00103                         'id'      => 'convert_button_back',
00104                         'style'   => 'display:none'
00105                     )
00106                 )
00107         );
00108 
00109         $this->setChild('toggle_button',
00110             $this->getLayout()->createBlock('adminhtml/widget_button')
00111                 ->setData(
00112                     array(
00113                         'label'   => Mage::helper('adminhtml')->__('Toggle Editor'),
00114                         'onclick' => 'templateControl.toggleEditor();',
00115                         'id'      => 'toggle_button'
00116                     )
00117                 )
00118         );
00119 
00120 
00121         $this->setChild('preview_button',
00122             $this->getLayout()->createBlock('adminhtml/widget_button')
00123                 ->setData(
00124                     array(
00125                         'label'   => Mage::helper('adminhtml')->__('Preview Template'),
00126                         'onclick' => 'templateControl.preview();'
00127                     )
00128                 )
00129         );
00130 
00131         $this->setChild('save_button',
00132             $this->getLayout()->createBlock('adminhtml/widget_button')
00133                 ->setData(
00134                     array(
00135                         'label'   => Mage::helper('adminhtml')->__('Save Template'),
00136                         'onclick' => 'templateControl.save();',
00137                         'class'   => 'save'
00138                     )
00139                 )
00140         );
00141 
00142         $this->setChild('load_button',
00143             $this->getLayout()->createBlock('adminhtml/widget_button')
00144                 ->setData(
00145                     array(
00146                         'label'   => Mage::helper('adminhtml')->__('Load Template'),
00147                         'onclick' => 'templateControl.load();',
00148                         'type'    => 'button',
00149                         'class'   => 'save'
00150                     )
00151                 )
00152         );
00153 
00154 
00155         $this->setChild('form',
00156             $this->getLayout()->createBlock('adminhtml/system_email_template_edit_form')
00157         );
00158         return parent::_prepareLayout();
00159     }

getBackButtonHtml (  ) 

Definition at line 161 of file Edit.php.

00162     {
00163         return $this->getChildHtml('back_button');
00164     }

getCurrentLocale (  ) 

Definition at line 297 of file Edit.php.

00298     {
00299         return Mage::app()->getLocale()->getLocaleCode();
00300     }

getDeleteButtonHtml (  ) 

Definition at line 197 of file Edit.php.

00198     {
00199         return $this->getChildHtml('delete_button');
00200     }

getDeleteUrl (  ) 

Return delete url for customer group

Returns:
string

Definition at line 272 of file Edit.php.

00273     {
00274         return $this->getUrl('*/*/delete', array('_current' => true));
00275     }

getEditMode (  ) 

Return edit flag for block

Returns:
boolean

Definition at line 212 of file Edit.php.

00213     {
00214         return $this->getEmailTemplate()->getId();
00215     }

getEmailTemplate (  ) 

Retrive email template model

Returns:
Mage_Core_Model_Email_Template

Definition at line 282 of file Edit.php.

00283     {
00284         return Mage::registry('email_template');
00285     }

getFormHtml (  ) 

Return form block HTML

Returns:
string

Definition at line 237 of file Edit.php.

00238     {
00239         return $this->getChildHtml('form');
00240     }

getHeaderText (  ) 

Return header text for form

Returns:
string

Definition at line 222 of file Edit.php.

00223     {
00224         if($this->getEditMode()) {
00225           return Mage::helper('adminhtml')->__('Edit Email Template');
00226         }
00227 
00228         return  Mage::helper('adminhtml')->__('New Email Template');
00229     }

getLoadButtonHtml (  ) 

Definition at line 202 of file Edit.php.

00203     {
00204         return $this->getChildHtml('load_button');
00205     }

getLoadUrl (  ) 

Load template url

Returns:
string

Definition at line 307 of file Edit.php.

00308     {
00309         return $this->getUrl('*/*/defaultTemplate');
00310     }

getLocaleOptions (  ) 

Definition at line 287 of file Edit.php.

00288     {
00289         return Mage::app()->getLocale()->getOptionLocales();
00290     }

getPreviewButtonHtml (  ) 

Definition at line 192 of file Edit.php.

00193     {
00194         return $this->getChildHtml('preview_button');
00195     }

getPreviewUrl (  ) 

Return preview action url for form

Returns:
string

Definition at line 257 of file Edit.php.

00258     {
00259         return $this->getUrl('*/*/preview');
00260     }

getResetButtonHtml (  ) 

Definition at line 172 of file Edit.php.

00173     {
00174         return $this->getChildHtml('reset_button');
00175     }

getSaveButtonHtml (  ) 

Definition at line 187 of file Edit.php.

00188     {
00189         return $this->getChildHtml('save_button');
00190     }

getSaveUrl (  ) 

Return action url for form

Returns:
string

Definition at line 247 of file Edit.php.

00248     {
00249         return $this->getUrl('*/*/save', array('_current' => true));
00250     }

getTemplateOptions (  ) 

Definition at line 292 of file Edit.php.

getToggleButtonHtml (  ) 

Definition at line 166 of file Edit.php.

00167     {
00168         return $this->getChildHtml('toggle_button');
00169     }

getToHtmlButtonHtml (  ) 

Definition at line 182 of file Edit.php.

00183     {
00184         return $this->getChildHtml('to_html_button');
00185     }

getToPlainButtonHtml (  ) 

Definition at line 177 of file Edit.php.

00178     {
00179         return $this->getChildHtml('to_plain_button');
00180     }

isTextType (  ) 

Definition at line 262 of file Edit.php.

00263     {
00264         return $this->getEmailTemplate()->isPlain();
00265     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:23:04 2009 for Magento by  doxygen 1.5.8