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

Commit

Permalink
Fix the usability of the image size fields (see #7565).
Browse files Browse the repository at this point in the history
  • Loading branch information
leofeyer committed Apr 27, 2015
1 parent c385afd commit a396a11
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 16 deletions.
2 changes: 1 addition & 1 deletion system/modules/core/languages/en/tl_content.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<source>Here you can enter the image title (&lt;em&gt;title&lt;/em&gt; attribute).</source>
</trans-unit>
<trans-unit id="tl_content.size.0">
<source>Image width and height</source>
<source>Image size</source>
</trans-unit>
<trans-unit id="tl_content.size.1">
<source>Here you can set the image dimensions and the resize mode.</source>
Expand Down
2 changes: 1 addition & 1 deletion system/modules/core/languages/en/tl_module.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@
<source>Open the full-size image in a lightbox or the link in a new browser window.</source>
</trans-unit>
<trans-unit id="tl_module.imgSize.0">
<source>Image width and height</source>
<source>Image size</source>
</trans-unit>
<trans-unit id="tl_module.imgSize.1">
<source>Here you can set the image dimensions and the resize mode.</source>
Expand Down
24 changes: 12 additions & 12 deletions system/modules/core/widgets/ImageSize.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,6 @@ public function generate()
}

$arrFields = array();

for ($i=0; $i<2; $i++)
{
$arrFields[] = sprintf('<input type="text" name="%s[]" id="ctrl_%s" class="tl_text_4 tl_imageSize_%s" value="%s"%s onfocus="Backend.getScrollOffset()">',
$this->strName,
$this->strId.'_'.$i,
$i,
specialchars(@$this->varValue[$i]), // see #4979
$this->getAttributes());
}

$arrOptions = array();

foreach ($this->arrOptions as $strKey=>$arrOption)
Expand Down Expand Up @@ -131,12 +120,23 @@ public function generate()
}
}

$arrFields[] = sprintf('<select name="%s[]" id="ctrl_%s" class="tl_select_interval" onfocus="Backend.getScrollOffset()"%s>%s</select>',
$arrFields[] = sprintf('<select name="%s[2]" id="ctrl_%s" class="tl_select_interval" onfocus="Backend.getScrollOffset()"%s>%s</select>',
$this->strName,
$this->strId.'_3',
$this->getAttribute('disabled'),
implode(' ', $arrOptions));

for ($i=0; $i<2; $i++)
{
$arrFields[] = sprintf('<input type="text" name="%s[%s]" id="ctrl_%s" class="tl_text_4 tl_imageSize_%s" value="%s"%s onfocus="Backend.getScrollOffset()">',
$this->strName,
$i,
$this->strId.'_'.$i,
$i,
specialchars(@$this->varValue[$i]), // see #4979
$this->getAttributes());
}

return sprintf('<div id="ctrl_%s" class="tl_image_size%s">%s</div>%s',
$this->strId,
(($this->strClass != '') ? ' ' . $this->strClass : ''),
Expand Down
2 changes: 1 addition & 1 deletion system/themes/default/basic.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions system/themes/default/src/basic.css
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ fieldset.checkbox_container,fieldset.radio_container {
.tl_text_4 {
width:70px;
}
.tl_imageSize_0.tl_text_4,.tl_imageSize_1.tl_text_4 {
width:71px;
}
.tl_textarea {
width:676px;
height:240px;
Expand Down
Loading

0 comments on commit a396a11

Please sign in to comment.