r96020 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96019‎ | r96020 | r96021 >
Date:18:11, 1 September 2011
Author:awjrichards
Status:ok
Tags:
Comment:
Added token that maps to wgScriptPath for RapidHtml system
Modified paths:
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/RapidHtml.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/RapidHtml.php
@@ -52,6 +52,9 @@
5353 '@gateway', // => 'payflowpro', // this may need to become dynamic in the future
5454 '@owa_session', // => $wgRequest->getText( 'owa_session', null ),
5555 '@owa_ref', // => $owa_ref,
 56+ // Not actually data tokens, but available to you in html form:
 57+ // @captcha -> the captcha form
 58+ // @script_path -> maps to $wgScriptPath
5659 );
5760
5861 /**
@@ -77,7 +80,6 @@
7881
7982 public function __construct( &$form_data, &$form_errors ) {
8083 global $wgRequest;
81 -
8284 parent::__construct( $form_data, $form_errors );
8385
8486 $this->loadValidateJs();
@@ -118,6 +120,8 @@
119121 * @return string The HTML form with real data in it
120122 */
121123 public function add_data( $html ) {
 124+ global $wgScriptPath;
 125+
122126 // replace data
123127 $form = str_replace( $this->data_tokens, $this->form_data, $html );
124128
@@ -127,6 +131,9 @@
128132 // handle captcha
129133 $form = str_replace( "@captcha", $this->getCaptchaHtml(), $form );
130134
 135+ // handle script path
 136+ $form = str_replace( "@script_path", $wgScriptPath, $form );
 137+
131138 $form = $this->fix_dropdowns( $form );
132139
133140 return $form;

Status & tagging log