From 57120700608066762d6cb9fe151c2fb4440239b6 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Wed, 3 Oct 2007 00:51:47 +0000 Subject: [PATCH] - merge admin_list-virtual.tpl into overview.tpl - deleted admin_list-virtual.tpl - admin/list-virtual.php now uses overview.tpl template git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@121 a1433add-5e2c-0410-b055-b7f2511e0802 --- admin/list-virtual.php | 4 +- templates/admin_list-virtual.tpl | 259 ------------------------------- templates/overview.tpl | 126 ++++++++++----- 3 files changed, 90 insertions(+), 299 deletions(-) delete mode 100644 templates/admin_list-virtual.tpl diff --git a/admin/list-virtual.php b/admin/list-virtual.php index 2223ca27..b35fde04 100644 --- a/admin/list-virtual.php +++ b/admin/list-virtual.php @@ -15,7 +15,7 @@ * File: list-virtual.php * List virtual users for a domain. * - * Template File: admin_list-virtual.tpl + * Template File: overview.tpl * * Template Variables: * @@ -160,7 +160,7 @@ if (isset ($limit)) { include ("../templates/header.tpl"); include ("../templates/admin_menu.tpl"); -include ("../templates/admin_list-virtual.tpl"); +include ("../templates/overview.tpl"); include ("../templates/footer.tpl"); /* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */ diff --git a/templates/admin_list-virtual.tpl b/templates/admin_list-virtual.tpl deleted file mode 100644 index 440642f8..00000000 --- a/templates/admin_list-virtual.tpl +++ /dev/null @@ -1,259 +0,0 @@ -
-
- - - -
-

-

-

-
: - -
-
- -\n"; - - -if (sizeof ($tAlias) > 0) -{ - print "\n"; - print " \n"; - print " "; - print " "; - print " \n"; - if ($CONF['show_status'] == 'YES') { print "\n"; } - print " \n"; - print " \n"; - print " \n"; - print " \n"; - print " \n"; - print " \n"; - - for ($i = 0; $i < sizeof ($tAlias); $i++) - { - if ((is_array ($tAlias) and sizeof ($tAlias) > 0)) - { - print " \n"; - if ($CONF['show_status'] == 'YES') - { - print " \n"; - } - - print " \n"; - if ($CONF['alias_goto_limit'] > 0) { - print " \n"; - } else { - print " \n"; - } - print " \n"; - $active = ($tAlias[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO']; - print " \n"; - print " \n"; - print " \n"; - print " \n"; - } - } - print "

" . $PALANG['pOverview_alias_title'] . "

" . $PALANG['pAdminList_virtual_alias_address'] . "" . $PALANG['pAdminList_virtual_alias_goto'] . "" . $PALANG['pAdminList_virtual_alias_modified'] . "" . $PALANG['pAdminList_virtual_alias_active'] . " 
" . gen_show_status($tAlias[$i]['address']) . "" . $tAlias[$i]['address'] . "" . ereg_replace (",", "
", preg_replace('/^(([^,]+,){'.$CONF['alias_goto_limit'].'})[^,]+,.*/','$1[and '. (substr_count ($tAlias[$i]['goto'], ',') - $CONF['alias_goto_limit'] + 1) .' more...]',$tAlias[$i]['goto'])) . "
" . ereg_replace (",", "
", $tAlias[$i]['goto']) . "
" . $tAlias[$i]['modified'] . "" . $active . "" . $PALANG['edit'] . "" . $PALANG['del'] . "
\n"; -} -if($tCanAddAlias) { - print "

" . $PALANG['pMenu_create_alias'] . "\n"; -} - - print "

\n
"; - if ( $limit['mbox_pgindex_count'] ) print "".$PALANG['pOverview_mailbox_title']."  "; - ($tDisplay_back_show == 1) ? $highlight_at = $tDisplay_back / $CONF['page_size'] + 1 : $highlight_at = 0; - for ($i = 0; $i < $limit['mbox_pgindex_count']; $i++) - { - if ( $i == $highlight_at ) - { - print "" . $limit['mbox_pgindex'][$i] . "\n"; - } - else - { - print "" . $limit['mbox_pgindex'][$i] . "\n"; - } - } - print ""; - - -if ($tDisplay_back_show == 1) -{ - print "\""\n"; -} -if ($tDisplay_up_show == 1) -{ - print "\""\n"; -} -if ($tDisplay_next_show == 1) -{ - print "\""\n"; -} -print "
\n"; - - -if (sizeof ($tMailbox) > 0) -{ - print "\n"; - print " \n"; - print " "; - print " "; - print " \n"; - if ($CONF['show_status'] == 'YES') { print "\n"; } - print " \n"; - print " \n"; - if ($CONF['quota'] == 'YES') print " \n"; - print " \n"; - print " \n"; - if ($CONF['alias_control'] == 'YES') - { - print " \n"; - } - else - { - print " \n"; - } - print " \n"; - - for ($i = 0; $i < sizeof ($tMailbox); $i++) - { - if ((is_array ($tMailbox) and sizeof ($tMailbox) > 0)) - { - print " \n"; - - if ($CONF['show_status'] == 'YES') - { - print " \n"; - } - - print " \n"; - print " \n"; - if ($CONF['quota'] == 'YES') - { - print " \n"; - } - print " \n"; - $active = ($tMailbox[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO']; - print " \n"; - - if ($CONF['vacation_control_admin'] == 'YES') - { - $v_active = ($tMailbox[$i]['v_active'] == 1) ? $PALANG['pOverview_vacation_edit'] : $PALANG['pOverview_vacation_option']; - print " \n"; - } - - if ($CONF['alias_control'] == 'YES') - { - print " \n"; - } - print " \n"; - print " \n"; - print " \n"; - } - } - print "

" . $PALANG['pOverview_mailbox_title'] . "

" . $PALANG['pAdminList_virtual_mailbox_username'] . "" . $PALANG['pAdminList_virtual_mailbox_name'] . "" . $PALANG['pAdminList_virtual_mailbox_quota'] . "" . $PALANG['pAdminList_virtual_mailbox_modified'] . "" . $PALANG['pAdminList_virtual_mailbox_active'] . "  
" . gen_show_status($tMailbox[$i]['username']) . "" . $tMailbox[$i]['username'] . "" . $tMailbox[$i]['name'] . ""; - if ($tMailbox[$i]['quota'] == 0) - { - print $PALANG['pOverview_unlimited']; - } - elseif ($tMailbox[$i]['quota'] < 0) - { - print $PALANG['pOverview_disabled']; - } - else - { - print divide_quota ($tMailbox[$i]['quota']); - } - print "" . $tMailbox[$i]['modified'] . "" . $active . "" .$v_active . "" . $PALANG['pOverview_alias_edit'] . "" . $PALANG['edit'] . "" . $PALANG['del'] . "
\n"; - print "
\n"; - if ($tDisplay_back_show == 1) - { - print "\""\n"; - } - if ($tDisplay_up_show == 1) - { - print "\""\n"; - } - if ($tDisplay_next_show == 1) - { - print "\""\n"; - } - print "
\n"; - -} -if($tCanAddMailbox) { - print "

" . $PALANG['pMenu_create_mailbox'] . "\n"; -} - -if ($CONF['show_status'] == 'YES' && $CONF['show_status_key'] == 'YES') -{ - print "

"; - if ($CONF['show_undeliverable'] == 'YES') - { - print " " . $CONF['show_status_text'] . "=" . $PALANG['pStatus_undeliverable'] . "\n"; - } - if ($CONF['show_popimap'] == 'YES') - { - print " " . $CONF['show_status_text'] . "=" . $PALANG['pStatus_popimap'] . "\n"; - } - if ( $CONF['show_custom_count'] > 0 ) - { - for ($i = 0; $i < sizeof ($CONF['show_custom_domains']); $i++) - { - print " " . - $CONF['show_status_text'] . "=" . $PALANG['pStatus_custom'] . - $CONF['show_custom_domains'][$i] . "\n"; - } - } - -} -/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */ -?> diff --git a/templates/overview.tpl b/templates/overview.tpl index 70a22455..c79ec6dc 100644 --- a/templates/overview.tpl +++ b/templates/overview.tpl @@ -1,7 +1,16 @@

-
- - +

-:
- +: +
+\n"; if (sizeof ($tMailbox) > 0) { @@ -156,7 +195,7 @@ if (sizeof ($tMailbox) > 0) if ($CONF['alias_control_admin'] == 'YES') $colspan=$colspan+1; print "\n"; print " \n"; - print " "; + print " "; print " "; print " \n"; if ($CONF['show_status'] == 'YES') { print "\n"; } @@ -174,6 +213,7 @@ if (sizeof ($tMailbox) > 0) if ((is_array ($tMailbox) and sizeof ($tMailbox) > 0)) { print " \n"; + if ($CONF['show_status'] == 'YES') { print " \n"; @@ -201,6 +241,7 @@ if (sizeof ($tMailbox) > 0) print " \n"; $active = ($tMailbox[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO']; print " \n"; + if ($CONF['vacation_control_admin'] == 'YES') { $v_active_int = $tMailbox[$i]['v_active']; @@ -218,12 +259,18 @@ if (sizeof ($tMailbox) > 0) echo "\n"; } } - if ($CONF['alias_control_admin'] == 'YES') + + $edit_aliases=0; + if ( authentication_has_role('global-admin') && $CONF['alias_control_admin'] == 'YES') $edit_aliases = 1; + if ( (! authentication_has_role('global-admin')) && $CONF['alias_control'] == 'YES') $edit_aliases = 1; + + if ($edit_aliases == 1) { print " \n"; } + print " \n"; - print " \n"; + print " \n"; print " \n"; } } @@ -231,19 +278,22 @@ if (sizeof ($tMailbox) > 0) print "
\n"; if ($tDisplay_back_show == 1) { - print "\""\n"; + print "\""\n"; } if ($tDisplay_up_show == 1) { - print "\""\n"; + print "\""\n"; } if ($tDisplay_next_show == 1) { - print "\""\n"; + print "\""\n"; } print "
\n"; + +} +if($tCanAddMailbox) { + print "

" . $PALANG['pMenu_create_mailbox'] . "\n"; } -print "

" . $PALANG['pMenu_create_mailbox'] . "\n"; if ($CONF['show_status'] == 'YES' && $CONF['show_status_key'] == 'YES') { @@ -263,11 +313,11 @@ if ($CONF['show_status'] == 'YES' && $CONF['show_status_key'] == 'YES') for ($i = 0; $i < sizeof ($CONF['show_custom_domains']); $i++) { print " " . - $CONF['show_status_text'] . "=" . $PALANG['pStatus_custom'] . + $CONF['show_status_text'] . "=" . $PALANG['pStatus_custom'] . $CONF['show_custom_domains'][$i] . "\n"; } } } -/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3 ft=php */ +/* vim: set ft=php expandtab softtabstop=3 tabstop=3 shiftwidth=3: */ ?>

".$PALANG['pOverview_mailbox_title']."

" . $PALANG['pOverview_mailbox_title'] . "

" . gen_show_status($tMailbox[$i]['username']) . "" . $tMailbox[$i]['modified'] . "" . $active . "   " . $PALANG['pOverview_alias_edit'] . "" . $PALANG['edit'] . "" . $PALANG['del'] . "" . $PALANG['del'] . "