From 974238724ae66e7e609d40c0128e41caa7884643 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sat, 2 Jan 2010 13:49:56 +0000 Subject: [PATCH] moved resizing function to list.js --- lam/lib/types/user.inc | 37 +++++++------------------------------ lam/templates/lib/list.js | 17 ++++++++++++++++- 2 files changed, 23 insertions(+), 31 deletions(-) diff --git a/lam/lib/types/user.inc b/lam/lib/types/user.inc index de96a423..6b176505 100644 --- a/lam/lib/types/user.inc +++ b/lam/lib/types/user.inc @@ -3,7 +3,7 @@ $Id$ This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) - Copyright (C) 2005 - 2009 Roland Gruber + Copyright (C) 2005 - 2010 Roland Gruber This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -208,7 +208,8 @@ class lamUserList extends lamList { } } } - $jpeg_filename = 'jpg' . $_SESSION['ldap']->new_rand() . '.jpg'; + $imgNumber = $_SESSION['ldap']->new_rand(); + $jpeg_filename = 'jpg' . $imgNumber . '.jpg'; $outjpeg = @fopen($_SESSION['lampath'] . 'tmp/' . $jpeg_filename, "wb"); fwrite($outjpeg, $entry[$attribute][0]); fclose ($outjpeg); @@ -219,7 +220,10 @@ class lamUserList extends lamList { $minSize = $imgSize[0]; } $imgTitle = _('Click to switch between thumbnail and original size.'); - echo "\"""; + echo "\"""; + echo ''; } elseif (($attribute == 'mail') || ($attribute == 'rfc822Mailbox')) { if (isset($entry[$attribute][0]) && ($entry[$attribute][0] != '')) { @@ -270,33 +274,6 @@ class lamUserList extends lamList { $this->trans_primary = $tpOption->isSelected(); } - /** - * @see lamList::listPrintHeader() - */ - protected function listPrintHeader() { - parent::listPrintHeader(); - // add code to animate images - ?> - - \ No newline at end of file diff --git a/lam/templates/lib/list.js b/lam/templates/lib/list.js index d63f14c1..67c910c1 100644 --- a/lam/templates/lib/list.js +++ b/lam/templates/lib/list.js @@ -3,7 +3,7 @@ $Id$ This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) - Copyright (C) 2003 - 2007 Roland Gruber + Copyright (C) 2003 - 2010 Roland Gruber This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -63,3 +63,18 @@ function SubmitForm(id, e) { return false; } } + +function addResizeHandler(item, min, max) { + jQuery(item).toggle( + function(){ + jQuery(item).animate({ + height: max + }); + }, + function(){ + jQuery(item).animate({ + height: min + }); + } + ); +}