Mage_Adminhtml_Block_Newsletter_Template_Edit Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Newsletter_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 ()
 getModel ()
 getBackButtonHtml ()
 getToggleButtonHtml ()
 getResetButtonHtml ()
 getToPlainButtonHtml ()
 getToHtmlButtonHtml ()
 getSaveButtonHtml ()
 getPreviewButtonHtml ()
 getDeleteButtonHtml ()
 getSaveAsButtonHtml ()
 setEditMode ($value=true)
 getEditMode ()
 getHeaderText ()
 getForm ()
 getJsTemplateName ()
 getSaveUrl ()
 getPreviewUrl ()
 isTextType ()
 getDeleteUrl ()
 getSaveAsFlag ()

Protected Member Functions

 _prepareLayout ()

Protected Attributes

 $_editMode = false


Detailed Description

Definition at line 35 of file Edit.php.


Constructor & Destructor Documentation

__construct (  ) 

Define Edit template

Reimplemented from Varien_Object.

Definition at line 48 of file Edit.php.

00049     {
00050         parent::__construct();
00051         $this->setTemplate('newsletter/template/edit.phtml');
00052     }


Member Function Documentation

_prepareLayout (  )  [protected]

Preparing block layout

Returns:
Mage_Adminhtml_Block_Newsletter_Template_Edit

Reimplemented from Mage_Core_Block_Abstract.

Definition at line 69 of file Edit.php.

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

getBackButtonHtml (  ) 

Retrieve Back Button HTML

Returns:
string

Definition at line 163 of file Edit.php.

00164     {
00165         return $this->getChildHtml('back_button');
00166     }

getDeleteButtonHtml (  ) 

Retrieve Delete Button HTML

Returns:
string

Definition at line 233 of file Edit.php.

00234     {
00235         return $this->getChildHtml('delete_button');
00236     }

getDeleteUrl (  ) 

Return delete url for customer group

Returns:
string

Definition at line 341 of file Edit.php.

00342     {
00343         return $this->getUrl('*/*/delete', array('id' => $this->getRequest()->getParam('id')));
00344     }

getEditMode (  ) 

Return edit flag for block

Returns:
boolean

Definition at line 265 of file Edit.php.

00266     {
00267         return $this->_editMode;
00268     }

getForm (  ) 

Return form block HTML

Returns:
string

Definition at line 289 of file Edit.php.

00290     {
00291         return $this->getLayout()
00292             ->createBlock('adminhtml/newsletter_template_edit_form')
00293             ->toHtml();
00294     }

getHeaderText (  ) 

Return header text for form

Returns:
string

Definition at line 275 of file Edit.php.

00276     {
00277         if ($this->getEditMode()) {
00278             return Mage::helper('newsletter')->__('Edit Newsletter Template');
00279         }
00280 
00281         return  Mage::helper('newsletter')->__('New Newsletter Template');
00282     }

getJsTemplateName (  ) 

Return return template name for JS

Returns:
string

Definition at line 301 of file Edit.php.

00302     {
00303         return addcslashes($this->getModel()->getTemplateCode(), "\"\r\n\\");
00304     }

getModel (  ) 

Retrieve template object

Returns:
Mage_Newsletter_Model_Template

Definition at line 59 of file Edit.php.

00060     {
00061         return Mage::registry('_current_template');
00062     }

getPreviewButtonHtml (  ) 

Retrieve Preview Button HTML

Returns:
string

Definition at line 223 of file Edit.php.

00224     {
00225         return $this->getChildHtml('preview_button');
00226     }

getPreviewUrl (  ) 

Return preview action url for form

Returns:
string

Definition at line 321 of file Edit.php.

00322     {
00323         return $this->getUrl('*/*/preview');
00324     }

getResetButtonHtml (  ) 

Retrieve Reset Button HTML

Returns:
string

Definition at line 183 of file Edit.php.

00184     {
00185         return $this->getChildHtml('reset_button');
00186     }

getSaveAsButtonHtml (  ) 

Retrieve Save as Button HTML

Returns:
string

Definition at line 243 of file Edit.php.

00244     {
00245         return $this->getChildHtml('save_as_button');
00246     }

getSaveAsFlag (  ) 

Retrieve Save As Flag

Returns:
int

Definition at line 351 of file Edit.php.

00352     {
00353         return $this->getRequest()->getParam('_save_as_flag') ? '1' : '';
00354     }

getSaveButtonHtml (  ) 

Retrieve Save Button HTML

Returns:
string

Definition at line 213 of file Edit.php.

00214     {
00215         return $this->getChildHtml('save_button');
00216     }

getSaveUrl (  ) 

Return action url for form

Returns:
string

Definition at line 311 of file Edit.php.

00312     {
00313         return $this->getUrl('*/*/save');
00314     }

getToggleButtonHtml (  ) 

Retrieve Toggle Button HTML

Returns:
string

Definition at line 173 of file Edit.php.

00174     {
00175         return $this->getChildHtml('toggle_button');
00176     }

getToHtmlButtonHtml (  ) 

Retrieve Convert to HTML Button HTML

Returns:
string

Definition at line 203 of file Edit.php.

00204     {
00205         return $this->getChildHtml('to_html_button');
00206     }

getToPlainButtonHtml (  ) 

Retrieve Convert To Plain Button HTML

Returns:
string

Definition at line 193 of file Edit.php.

00194     {
00195         return $this->getChildHtml('to_plain_button');
00196     }

isTextType (  ) 

Check Template Type is Plain Text

Returns:
bool

Definition at line 331 of file Edit.php.

00332     {
00333         return $this->getModel()->isPlain();
00334     }

setEditMode ( value = true  ) 

Set edit flag for block

Parameters:
boolean $value
Returns:
Mage_Adminhtml_Block_Newsletter_Template_Edit

Definition at line 254 of file Edit.php.

00255     {
00256         $this->_editMode = (bool)$value;
00257         return $this;
00258     }


Member Data Documentation

$_editMode = false [protected]

Definition at line 42 of file Edit.php.


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

Generated on Sat Jul 4 17:22:52 2009 for Magento by  doxygen 1.5.8