From 186daaf35d79c2e396a2665aeed2765f01c38884 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Tue, 16 Dec 2008 16:52:20 +0000 Subject: [PATCH] changed layout --- lam/templates/profedit/profilemain.php | 139 ++++++++++++------------- 1 file changed, 65 insertions(+), 74 deletions(-) diff --git a/lam/templates/profedit/profilemain.php b/lam/templates/profedit/profilemain.php index 1e86fa8d..69a32b7f 100644 --- a/lam/templates/profedit/profilemain.php +++ b/lam/templates/profedit/profilemain.php @@ -3,7 +3,7 @@ $Id$ This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam) - Copyright (C) 2003 - 2006 Roland Gruber + Copyright (C) 2003 - 2008 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 @@ -61,33 +61,26 @@ if (!$_SESSION['ldap'] || !$_SESSION['ldap']->server()) { exit; } -// on abort go back to main page -if (isset($_POST['abort'])) { - metaRefresh("../tools.php"); +// check if new profile should be created +elseif (isset($_POST['createProfileButton'])) { + metaRefresh("profilepage.php?type=" . $_POST['createProfile']); exit; } -// check if user has pressed submit button -elseif (isset($_POST['submit'])) { - // forward to other profile pages - if ($_POST['submit']) { - for ($i = 0; $i < sizeof($profileClasses); $i++) { - // create new profile - if ($_POST['profile'] == ("new" . $profileClasses[$i]['scope'])) { - metaRefresh("profilepage.php?type=" . $profileClasses[$i]['scope']); - } - // edit profile - elseif($_POST['profile'] == ("edit" . $profileClasses[$i]['scope'])) { - metaRefresh("profilepage.php?type=" . $profileClasses[$i]['scope'] . - "&edit=" . $_POST['e_' . $profileClasses[$i]['scope']]); - } - // delete profile - elseif($_POST['profile'] == ("del" . $profileClasses[$i]['scope'])) { - metaRefresh("profiledelete.php?type=" . $profileClasses[$i]['scope'] . - "&del=" . $_POST['d_' . $profileClasses[$i]['scope']]); - } - } +// check if a profile should be edited +for ($i = 0; $i < sizeof($profileClasses); $i++) { + if (isset($_POST['editProfile_' . $profileClasses[$i]['scope']]) || isset($_POST['editProfile_' . $profileClasses[$i]['scope'] . '_x'])) { + metaRefresh("profilepage.php?type=" . $profileClasses[$i]['scope'] . + "&edit=" . $_POST['profile_' . $profileClasses[$i]['scope']]); + exit; + } +} +// check if a profile should be deleted +for ($i = 0; $i < sizeof($profileClasses); $i++) { + if (isset($_POST['deleteProfile_' . $profileClasses[$i]['scope']]) || isset($_POST['deleteProfile_' . $profileClasses[$i]['scope'] . '_x'])) { + metaRefresh("profiledelete.php?type=" . $profileClasses[$i]['scope'] . + "&del=" . $_POST['profile_' . $profileClasses[$i]['scope']]); + exit; } - exit; } // get list of profiles for each account type @@ -111,63 +104,61 @@ for ($i = 0; $i < sizeof($profileClasses); $i++) { echo "\n"; echo "\n"; +echo "
\n"; +echo "

" . _('Profile editor') . "

\n"; echo "
\n"; echo "
\n"; +// new profile +echo "
\n"; +echo "\n"; +echo "" . _('Create a new profile') . "\n"; +echo "\n"; +echo "
\n"; + echo "\n"; + echo "\n"; +echo "
\n"; + echo "\n"; + echo "\n"; + echo ""; + echo "
\n"; +echo "
\n"; +echo "
\n"; + +// existing profiles +echo "
\n"; +echo "\n"; +echo "" . _('Manage existing profiles') . "\n"; +echo "\n"; +echo "
\n"; for ($i = 0; $i < sizeof($profileClasses); $i++) { - - echo "
\n"; - echo "\n"; - echo "" . $profileClasses[$i]['title'] . "\n"; - echo "\n"; - echo "
\n"; - - // new profile echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; - - // edit profile - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - // delete profile - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "" . _("Create a new profile") . ""; + echo "\"" \n"; + echo $profileClasses[$i]['title']; + echo " "; + echo "\n"; + echo " "; + echo ""; + echo " "; + echo ""; + echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "" . _("Edit profile") . "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "" . _("Delete profile") . "
\n"; - echo "
\n"; - - echo "
\n"; - } - - -echo "

\n"; -echo "\n"; -echo "\n"; -echo "

\n"; +echo "\n"; +echo "\n"; +echo "
\n"; echo "
\n"; echo "\n";