public function __construct(&$gateway) { parent::__construct($gateway); // update the list of hidden fields we need to use in this form. $this->updateHiddenFields(); // we only want to load this JS if the form is being rendered $this->loadValidateJs(); // validation JS $this->loadApiJs(); // API/Ajax JS $this->loadPlaceholders(); }
public function __construct(&$gateway) { global $wgRequest; parent::__construct($gateway); $form_errors = $this->form_errors; $this->loadValidateJs(); //Not sure if we should be using $wgRequest here. Depends if we want the normalized one or not. $country = $wgRequest->getText('country', ''); // Get error passed via query string $error = $wgRequest->getText('error'); if ($error) { // We escape HTML here since only quotes are escaped later $form_errors['general'][] = htmlspecialchars($error); } if ($country != '') { try { $country_based = $wgRequest->getText('ffname', 'default') . '-' . $country; // set html-escaped filename. $this->set_html_file_path(htmlspecialchars($country_based)); } catch (MWException $mwe) { // country-specific file does not exist, set html-escaped filename. $this->set_html_file_path(htmlspecialchars($wgRequest->getText('ffname', 'default'))); } } else { // set html-escaped filename. $this->set_html_file_path(htmlspecialchars($wgRequest->getText('ffname', 'default'))); } // fix general form error messages so it's not an array of msgs if (is_array($form_errors['general']) && count($form_errors['general'])) { $general_errors = ""; foreach ($form_errors['general'] as $general_error) { $general_errors .= "{$general_error}<br />"; } $form_errors['general'] = $general_errors; } // if this form needs to support squid cacheing, handle the magic $this->handle_cacheability(); }
public function __construct(&$gateway) { parent::__construct($gateway); }