r97122 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97121‎ | r97122 | r97123 >
Date:00:00, 15 September 2011
Author:awjrichards
Status:ok
Tags:
Comment:
Adding DonationInterface API js to RapidHtml forms when _cache_=true in the request.
Modified paths:
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/RapidHtml.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/RapidHtml.php
@@ -96,6 +96,9 @@
9797 }
9898 $form_errors[ 'general' ] = $general_errors;
9999 }
 100+
 101+ // if this form needs to support squid cacheing, handle the magic
 102+ $this->handle_cacheability();
100103 }
101104
102105 /**
@@ -249,4 +252,14 @@
250253
251254 $this->html_file_path = $full_path;
252255 }
 256+
 257+ /**
 258+ * Load API js if this form needs to support cacheing
 259+ */
 260+ public function handle_cacheability() {
 261+ global $wgRequest;
 262+ if ( $wgRequest->getText( '_cache_', false )) {
 263+ $this->loadApiJs();
 264+ }
 265+ }
253266 }

Status & tagging log