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

Commit

Permalink
Revert "Fix the usability of the image size fields (see #7565)."
Browse files Browse the repository at this point in the history
This reverts commit a806ec0.
  • Loading branch information
leofeyer committed Apr 27, 2015
1 parent 5d9c00e commit 9e580c2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
4 changes: 0 additions & 4 deletions src/Resources/contao/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -356,10 +356,6 @@
(
'proportional', 'box'
),
'image_sizes' => array
(
// placeholder
),
'exact' => array
(
'crop',
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/contao/dca/tl_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
'inputType' => 'imageSize',
'options' => System::getImageSizes(),
'reference' => &$GLOBALS['TL_LANG']['MSC'],
'eval' => array('rgxp'=>'natural', 'nospace'=>true, 'helpwizard'=>true, 'tl_class'=>'w50'),
'eval' => array('rgxp'=>'natural', 'includeBlankOption'=>true, 'nospace'=>true, 'helpwizard'=>true, 'tl_class'=>'w50'),
'sql' => "varchar(64) NOT NULL default ''"
),
'imagemargin' => array
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/contao/dca/tl_module.php
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@
'inputType' => 'imageSize',
'options' => System::getImageSizes(),
'reference' => &$GLOBALS['TL_LANG']['MSC'],
'eval' => array('rgxp'=>'natural', 'nospace'=>true, 'helpwizard'=>true, 'tl_class'=>'w50'),
'eval' => array('rgxp'=>'natural', 'includeBlankOption'=>true, 'nospace'=>true, 'helpwizard'=>true, 'tl_class'=>'w50'),
'sql' => "varchar(64) NOT NULL default ''"
),
'useCaption' => array
Expand Down
13 changes: 9 additions & 4 deletions src/Resources/contao/library/Contao/System.php
Original file line number Diff line number Diff line change
Expand Up @@ -500,16 +500,21 @@ public static function getImageSizes()
{
try
{
$sizes = array();
$imageSize = \Database::getInstance()->query("SELECT id, name, width, height FROM tl_image_size ORDER BY pid, name");

while ($imageSize->next())
{
$GLOBALS['TL_CROP']['image_sizes'][$imageSize->id] = $imageSize->name . ' (' . $imageSize->width . 'x' . $imageSize->height . ')';
$sizes[$imageSize->id] = $imageSize->name;
$sizes[$imageSize->id] .= ' (' . $imageSize->width . 'x' . $imageSize->height . ')';
}
}
catch (\Exception $e) {}

static::$arrImageSizes = $GLOBALS['TL_CROP'];
static::$arrImageSizes = array_merge(array('image_sizes' => $sizes), $GLOBALS['TL_CROP']);
}
catch (\Exception $e)
{
static::$arrImageSizes = $GLOBALS['TL_CROP'];
}
}

return static::$arrImageSizes;
Expand Down

0 comments on commit 9e580c2

Please sign in to comment.