Example #1
0
 /**
  * Returns the view of the form.
  *
  * @return string (X)HTML.
  *
  * @global string The script name.
  * @global string The current page URL.
  * @global array  The configuration of the plugins.
  * @global array  The localization of the plugins.
  */
 public function render()
 {
     global $sn, $su, $plugin_cf, $plugin_tx;
     $ptx = $plugin_tx['advancedform'];
     $pcf = $plugin_cf['advancedform'];
     $o = '';
     $o .= '<div class="advfrm-mailform">' . PHP_EOL . '<form name="' . $this->form->getName() . '" action="' . $sn . '?' . $su . '" method="post"' . ' enctype="multipart/form-data" accept-charset="UTF-8">' . PHP_EOL . tag('input type="hidden" name="advfrm" value="' . $this->form->getName() . '"') . PHP_EOL . '<div class="required">' . sprintf($ptx['message_required_fields'], sprintf($pcf['required_field_mark'], $ptx['message_required_field'])) . '</div>' . PHP_EOL;
     if (file_exists(Data::folder() . $this->form->getName() . '.tpl')) {
         $o .= $this->renderTemplate();
     } else {
         $o .= $this->renderDefault();
     }
     if ($this->form->hasCaptcha()) {
         $o .= call_user_func($pcf['captcha_plugin'] . '_captcha_display');
     }
     $o .= '<div class="buttons">' . tag('input type="submit" class="submit" value="' . $ptx['button_send'] . '"') . '&nbsp;' . tag('input type="reset" class="submit" value="' . $ptx['button_reset'] . '"') . '</div>' . PHP_EOL;
     $o .= '</form>' . PHP_EOL . '</div>' . PHP_EOL;
     return $o;
 }