max height+width for photos

This commit is contained in:
Roland Gruber 2014-10-25 13:13:44 +00:00
parent 260a8dbf02
commit 7d68a61681
3 changed files with 16 additions and 3 deletions

View File

@ -2360,7 +2360,11 @@ class htmlImage extends htmlElement {
$height = ' height="' . $this->height . '"';
}
$alt = ' alt="' . $this->alt . '"';
echo '<img' . $path . $width . $height . $alt . ">\n";
$classes = '';
if (!empty($this->cssClasses)) {
$classes = 'class="' . implode(' ', $this->cssClasses) . '"';
}
echo '<img' . $path . $width . $height . $alt . $classes . ">\n";
return array();
}

View File

@ -1612,7 +1612,9 @@ class inetOrgPerson extends baseModule implements passwordService {
$photoFile = '../../tmp/' . $jpeg_filename;
$noPhoto = false;
}
$imageContainer->addElement(new htmlImage($photoFile), true);
$img = new htmlImage($photoFile);
$img->setCSSClasses(array('photo'));
$imageContainer->addElement($img, true);
if (!$this->isAdminReadOnly('jpegPhoto')) {
if ($noPhoto) {
$imageContainer->addElement(new htmlAccountPageButton(get_class($this), 'photo', 'open', _('Add photo')));
@ -2699,7 +2701,9 @@ class inetOrgPerson extends baseModule implements passwordService {
fclose ($outjpeg);
$photoFile = '../../tmp/' . $jpeg_filename;
$photoSub = new htmlTable();
$photoSub->addElement(new htmlImage($photoFile), true);
$img = new htmlImage($photoFile);
$img->setCSSClasses(array('photo'));
$photoSub->addElement($img, true);
if (!in_array('jpegPhoto', $readOnlyFields)) {
$photoSubSub = new htmlTable();
$photoSubSub->addElement(new htmlTableExtendedInputCheckbox('removeReplacePhoto', false, _('Remove/replace photo'), null, false));

View File

@ -438,6 +438,11 @@ td.help {
font-size: 10pt;
}
img.photo {
max-width: 200px;
max-height: 400px;
}
/* schema browser */