Mage_Page_Block_Redirect Class Reference

Inheritance diagram for Mage_Page_Block_Redirect:

Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object Mage_GoogleCheckout_Block_Redirect

List of all members.

Public Member Functions

 getTargetURL ()
 getMessage ()
 getRedirectOutput ()
 getJsRedirect ()
 getHtmlFormRedirect ()
 isHtmlFormRedirect ()
 getFormId ()
 getFormMethod ()
 getFormFields ()

Protected Member Functions

 _getFormFields ()

Protected Attributes

 $_formFields = array()


Detailed Description

Definition at line 35 of file Redirect.php.


Member Function Documentation

_getFormFields (  )  [protected]

Optimized getFormFields() method

Returns:
array

Definition at line 156 of file Redirect.php.

00157     {
00158         if (!is_array($this->_formFields) || count($this->_formFields) == 0) {
00159             $this->_formFields = $this->getFormFields();
00160         }
00161         return $this->_formFields;
00162     }

getFormFields (  ) 

Array of hidden form fields (name => value)

Returns:
array

Definition at line 146 of file Redirect.php.

00147     {
00148         return array();
00149     }

getFormId (  ) 

HTML form id/name attributes

Returns:
string Id/name

Definition at line 126 of file Redirect.php.

00127     {
00128         return '';
00129     }

getFormMethod (  ) 

HTML form method attribute

Returns:
string Method

Definition at line 136 of file Redirect.php.

00137     {
00138         return 'POST';
00139     }

getHtmlFormRedirect (  ) 

Redirect via HTML form submission

Returns:
string

Definition at line 95 of file Redirect.php.

00096     {
00097         $form = new Varien_Data_Form();
00098         $form->setAction($this->getTargetURL())
00099             ->setId($this->getFormId())
00100             ->setName($this->getFormId())
00101             ->setMethod($this->getMethod())
00102             ->setUseContainer(true);
00103         foreach ($this->_getFormFields() as $field => $value) {
00104             $form->addField($field, 'hidden', array('name' => $field, 'value' => $value));
00105         }
00106         $html = $form->toHtml();
00107         $html.= '<script type="text/javascript">document.getElementById("' . $this->getFormId() . '").submit();</script>';
00108         return $html;
00109     }

getJsRedirect (  ) 

Redirect via JS location

Returns:
string

Definition at line 82 of file Redirect.php.

00083     {
00084         $js  = '<script type="text/javascript">';
00085         $js .= 'document.location.href="' . $this->getTargetURL() . '";';
00086         $js .= '</script>';
00087         return $js;
00088     }

getMessage (  ) 

Additional custom message

Returns:
string Output message

Reimplemented in Mage_GoogleCheckout_Block_Redirect.

Definition at line 58 of file Redirect.php.

00059     {
00060         return '';
00061     }

getRedirectOutput (  ) 

Client-side redirect engine output

Returns:
string

Definition at line 68 of file Redirect.php.

00069     {
00070         if ($this->isHtmlFormRedirect()) {
00071             return $this->getHtmlFormRedirect();
00072         } else {
00073             return $this->getJsRedirect();
00074         }
00075     }

getTargetURL (  ) 

URL for redirect location

Returns:
string URL

Reimplemented in Mage_GoogleCheckout_Block_Redirect.

Definition at line 48 of file Redirect.php.

00049     {
00050         return '';
00051     }

isHtmlFormRedirect (  ) 

HTML form or JS redirect

Returns:
boolean

Definition at line 116 of file Redirect.php.

00117     {
00118         return is_array($this->_getFormFields()) && count($this->_getFormFields()) > 0;
00119     }


Member Data Documentation

$_formFields = array() [protected]

HTML form hidden fields

Definition at line 41 of file Redirect.php.


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

Generated on Sat Jul 4 17:24:30 2009 for Magento by  doxygen 1.5.8