Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
Fix the markup of the form submit button (see #7396)
Browse files Browse the repository at this point in the history
  • Loading branch information
leofeyer committed Oct 23, 2014
1 parent 29822dd commit 660d4b9
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 35 deletions.
5 changes: 0 additions & 5 deletions contao/forms/FormSubmit.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,6 @@ public function validate()
*/
public function parse($arrAttributes=null)
{
if ($this->tableless)
{
$this->strClass = trim('submit_container ' . $this->strClass);
}

if ($this->imageSubmit && $this->singleSRC != '')
{
$objModel = \FilesModel::findByUuid($this->singleSRC);
Expand Down
41 changes: 26 additions & 15 deletions contao/templates/forms/form_submit.html5
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
<?php $this->extend('form_row'); ?>

<?php $this->block('field'); ?>
<?php if (!$this->tableless): ?>
<div class="submit_container">
<?php endif; ?>
<?php if ($this->src): ?>
<input type="image" src="<?php echo $this->src; ?>" id="ctrl_<?php echo $this->id; ?>" class="submit<?php if ($this->class) echo ' ' . $this->class; ?>" title="<?php echo specialchars($this->slabel); ?>" alt="<?php echo specialchars($this->slabel); ?>"<?php echo $this->getAttributes(); ?>>
<?php else: ?>
<input type="submit" id="ctrl_<?php echo $this->id; ?>" class="submit<?php if ($this->class) echo ' ' . $this->class; ?>" value="<?php echo specialchars($this->slabel); ?>"<?php echo $this->getAttributes(); ?>>
<?php endif; ?>
<?php if (!$this->tableless): ?>
</div>
<?php endif; ?>
<?php $this->endblock(); ?>
<?php if ($this->tableless): ?>

<div class="submit_container<?php if ($this->class) echo ' ' . $this->class; ?>">
<?php if ($this->src): ?>
<input type="image" src="<?php echo $this->src; ?>" id="ctrl_<?php echo $this->id; ?>" class="submit<?php if ($this->class) echo ' ' . $this->class; ?>" title="<?php echo specialchars($this->slabel); ?>" alt="<?php echo specialchars($this->slabel); ?>"<?php echo $this->getAttributes(); ?>>
<?php else: ?>
<input type="submit" id="ctrl_<?php echo $this->id; ?>" class="submit<?php if ($this->class) echo ' ' . $this->class; ?>" value="<?php echo specialchars($this->slabel); ?>"<?php echo $this->getAttributes(); ?>>
<?php endif; ?>
</div>

<?php else: ?>

<tr class="<?php echo $this->rowClass; ?>">
<td class="col_0 col_first">&nbsp;</td>
<td class="col_1 col_last">
<div class="submit_container">
<?php if ($this->src): ?>
<input type="image" src="<?php echo $this->src; ?>" id="ctrl_<?php echo $this->id; ?>" class="submit<?php if ($this->class) echo ' ' . $this->class; ?>" title="<?php echo specialchars($this->slabel); ?>" alt="<?php echo specialchars($this->slabel); ?>"<?php echo $this->getAttributes(); ?>>
<?php else: ?>
<input type="submit" id="ctrl_<?php echo $this->id; ?>" class="submit<?php if ($this->class) echo ' ' . $this->class; ?>" value="<?php echo specialchars($this->slabel); ?>"<?php echo $this->getAttributes(); ?>>
<?php endif; ?>
</div>
</td>
</tr>

<?php endif; ?>
41 changes: 26 additions & 15 deletions contao/templates/forms/form_submit.xhtml
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
<?php $this->extend('form_row'); ?>

<?php $this->block('field'); ?>
<?php if (!$this->tableless): ?>
<div class="submit_container">
<?php endif; ?>
<?php if ($this->src): ?>
<input type="image" src="<?php echo $this->src; ?>" id="ctrl_<?php echo $this->id; ?>" class="submit<?php if ($this->class) echo ' ' . $this->class; ?>" title="<?php echo specialchars($this->slabel); ?>" alt="<?php echo specialchars($this->slabel); ?>"<?php echo $this->getAttributes(); ?> />
<?php else: ?>
<input type="submit" id="ctrl_<?php echo $this->id; ?>" class="submit<?php if ($this->class) echo ' ' . $this->class; ?>" value="<?php echo specialchars($this->slabel); ?>"<?php echo $this->getAttributes(); ?> />
<?php endif; ?>
<?php if (!$this->tableless): ?>
</div>
<?php endif; ?>
<?php $this->endblock(); ?>
<?php if ($this->tableless): ?>

<div class="submit_container<?php if ($this->class) echo ' ' . $this->class; ?>">
<?php if ($this->src): ?>
<input type="image" src="<?php echo $this->src; ?>" id="ctrl_<?php echo $this->id; ?>" class="submit<?php if ($this->class) echo ' ' . $this->class; ?>" title="<?php echo specialchars($this->slabel); ?>" alt="<?php echo specialchars($this->slabel); ?>"<?php echo $this->getAttributes(); ?> />
<?php else: ?>
<input type="submit" id="ctrl_<?php echo $this->id; ?>" class="submit<?php if ($this->class) echo ' ' . $this->class; ?>" value="<?php echo specialchars($this->slabel); ?>"<?php echo $this->getAttributes(); ?> />
<?php endif; ?>
</div>

<?php else: ?>

<tr class="<?php echo $this->rowClass; ?>">
<td class="col_0 col_first">&nbsp;</td>
<td class="col_1 col_last">
<div class="submit_container">
<?php if ($this->src): ?>
<input type="image" src="<?php echo $this->src; ?>" id="ctrl_<?php echo $this->id; ?>" class="submit<?php if ($this->class) echo ' ' . $this->class; ?>" title="<?php echo specialchars($this->slabel); ?>" alt="<?php echo specialchars($this->slabel); ?>"<?php echo $this->getAttributes(); ?> />
<?php else: ?>
<input type="submit" id="ctrl_<?php echo $this->id; ?>" class="submit<?php if ($this->class) echo ' ' . $this->class; ?>" value="<?php echo specialchars($this->slabel); ?>"<?php echo $this->getAttributes(); ?> />
<?php endif; ?>
</div>
</td>
</tr>

<?php endif; ?>

0 comments on commit 660d4b9

Please sign in to comment.