openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit ff543602f86c0bc6aca66b7a84a3541ed4873172
parent 72fa73bdb8ebb132a25283ad41fa4ae7be1a766b
Author: Jan Dankert <devnull@localhost>
Date:   Sat,  2 Dec 2017 02:01:42 +0100

Ausgabe des Formular-HTMLs verschoenert.

Diffstat:
themes/default/include/html/form/Form.class.php | 83++++++++++++++++++++++++++++++++++++++++---------------------------------------
1 file changed, 42 insertions(+), 41 deletions(-)

diff --git a/themes/default/include/html/form/Form.class.php b/themes/default/include/html/form/Form.class.php @@ -4,69 +4,69 @@ class FormComponent extends Component { public $method = 'POST'; + public $name = ''; + public $action = '<?php echo OR_ACTION ?>'; + public $subaction = '<?php echo OR_METHOD ?>'; + public $id = '<?php echo OR_ID ?>'; + public $label; + public $cancel = false; + public $visible = false; + public $target = '_self'; + public $enctype = 'application/x-www-form-urlencoded'; + public $async = false; + public $autosave = false; + public $type = ''; private $submitFunction = 'formSubmit( $(this) ); return false;'; - - - + protected function begin() { - if ( empty($this->label) ) + if (empty($this->label)) $this->label = lang('BUTTON_OK'); - if ( empty($this->id) ) - $this->id = '<?php echo OR_ID ?>'; - - if ( $this->type == 'upload') + if ($this->type == 'upload') $this->submitFunction = ''; - echo <<<HTML -<form name="{$this->name}" - target="{$this->target}" - action="{$this->action}" - data-method="{$this->subaction}" - data-action="{$this->action}" - data-id="{$this->id}" - method="{$this->subaction}" - enctype="{$this->enctype}" - class="{$this->action}" - data-async="{$this->async}" - data-autosave="{$this->autosave}" - onSubmit="{$this->submitFunction}"><input type="submit" class="invisible" /> - -<input type="hidden" name="<?php echo REQ_PARAM_TOKEN ?>" value="<?php echo token() ?>" /> -<input type="hidden" name="<?php echo REQ_PARAM_ACTION ?>" value="{$this->action}" /> -<input type="hidden" name="<?php echo REQ_PARAM_SUBACTION ?>" value="{$this->subaction}" /> -<input type="hidden" name="<?php echo REQ_PARAM_ID ?>" value="{$this->id}" /> - -HTML; - echo <<<'HTML' -<?php - if ( $conf['interface']['url_sessionid'] ) - echo '<input type="hidden" name="'.session_name().'" value="'.session_id().'" />'."\n"; -?> - -HTML; + echo '<form'; + echo ' name="' . $this->htmlvalue($this->name) . '"'; + + echo ' target="' . $this->htmlvalue($this->target) . '"'; + echo ' action="' . $this->htmlvalue($this->action) . '"'; + echo ' data-method="' . $this->htmlvalue($this->subaction) . '"'; + echo ' data-action="' . $this->htmlvalue($this->action) . '"'; + echo ' data-id="' . $this->htmlvalue($this->id) . '"'; + echo ' method="' . $this->htmlvalue($this->subaction) . '"'; + echo ' enctype="' . $this->htmlvalue($this->enctype) . '"'; + echo ' class="' . $this->htmlvalue($this->action) . '"'; + echo ' data-async="' . $this->htmlvalue($this->async) . '"'; + echo ' data-autosave="' . $this->htmlvalue($this->autosave) . '"'; + echo ' onSubmit="' . $this->htmlvalue($this->submitFunction) . '">'; + + echo '<input type="submit" class="invisible" />'; // why this? + + echo '<input type="hidden" name="<?php echo REQ_PARAM_TOKEN ?>" value="<?php echo token() ?>" />'; + echo '<input type="hidden" name="<?php echo REQ_PARAM_ACTION ?>" value="' . $this->htmlvalue($this->action) . '" />'; + echo '<input type="hidden" name="<?php echo REQ_PARAM_SUBACTION ?>" value="' . $this->htmlvalue($this->subaction) . '" />'; + echo '<input type="hidden" name="<?php echo REQ_PARAM_ID ?>" value="' . $this->htmlvalue($this->id) . '" />'; } - - - protected function end() { $label = $this->htmlvalue($this->label); + + // Fällt demnächst weg: echo <<<HTML <div class="bottom"> @@ -76,9 +76,10 @@ HTML; <!-- Cancel-Button nicht anzeigen, wenn cancel==false. --> HTML; - if ($this->cancel) { - echo '<input type="button" class="submit cancel" value="<?php echo lang("CANCEL") ?>" onclick="'."$(div#dialog').hide(); $('div#filler').fadeOut(500); $(this).closest('div.panel').find('ul.views > li.active').click();".'" />'; - } + if ($this->cancel) + { + echo '<input type="button" class="submit cancel" value="<?php echo lang("CANCEL") ?>" onclick="' . "$(div#dialog').hide(); $('div#filler').fadeOut(500); $(this).closest('div.panel').find('ul.views > li.active').click();" . '" />'; + } echo <<<HTML </div> </div>