Public Member Functions | |
getTargetURL () | |
getMessage () | |
getRedirectOutput () | |
getJsRedirect () | |
getHtmlFormRedirect () | |
isHtmlFormRedirect () | |
getFormId () | |
getFormMethod () | |
getFormFields () | |
Protected Member Functions | |
_getFormFields () | |
Protected Attributes | |
$_formFields = array() |
Definition at line 35 of file Redirect.php.
_getFormFields | ( | ) | [protected] |
Optimized getFormFields() method
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)
Definition at line 146 of file Redirect.php.
00147 { 00148 return array(); 00149 }
getFormId | ( | ) |
getFormMethod | ( | ) |
getHtmlFormRedirect | ( | ) |
Redirect via HTML form submission
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
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
Reimplemented in Mage_GoogleCheckout_Block_Redirect.
Definition at line 58 of file Redirect.php.
getRedirectOutput | ( | ) |
Client-side redirect engine output
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
Reimplemented in Mage_GoogleCheckout_Block_Redirect.
Definition at line 48 of file Redirect.php.
isHtmlFormRedirect | ( | ) |
HTML form or JS redirect
Definition at line 116 of file Redirect.php.
00117 { 00118 return is_array($this->_getFormFields()) && count($this->_getFormFields()) > 0; 00119 }
$_formFields = array() [protected] |
HTML form hidden fields
Definition at line 41 of file Redirect.php.