From 7d68a61681f3d985220b20a20b1d8004b4c762f3 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sat, 25 Oct 2014 13:13:44 +0000 Subject: [PATCH] max height+width for photos --- lam/lib/html.inc | 6 +++++- lam/lib/modules/inetOrgPerson.inc | 8 ++++++-- lam/style/500_layout.css | 5 +++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/lam/lib/html.inc b/lam/lib/html.inc index 12f0eebd..9e8a8815 100644 --- a/lam/lib/html.inc +++ b/lam/lib/html.inc @@ -2360,7 +2360,11 @@ class htmlImage extends htmlElement { $height = ' height="' . $this->height . '"'; } $alt = ' alt="' . $this->alt . '"'; - echo '\n"; + $classes = ''; + if (!empty($this->cssClasses)) { + $classes = 'class="' . implode(' ', $this->cssClasses) . '"'; + } + echo '\n"; return array(); } diff --git a/lam/lib/modules/inetOrgPerson.inc b/lam/lib/modules/inetOrgPerson.inc index b515eea9..7ac73192 100644 --- a/lam/lib/modules/inetOrgPerson.inc +++ b/lam/lib/modules/inetOrgPerson.inc @@ -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)); diff --git a/lam/style/500_layout.css b/lam/style/500_layout.css index ddc21612..04b07717 100644 --- a/lam/style/500_layout.css +++ b/lam/style/500_layout.css @@ -438,6 +438,11 @@ td.help { font-size: 10pt; } +img.photo { + max-width: 200px; + max-height: 400px; +} + /* schema browser */