Qual: Using divs instead of tables

This commit is contained in:
Laurent Destailleur 2013-02-25 10:31:47 +01:00
parent ae322ba17f
commit e748f07806
2 changed files with 48 additions and 33 deletions

View File

@ -46,8 +46,7 @@ if (isset($conf->modules_parts['css']))
// cssfile is a relative path // cssfile is a relative path
print '<link rel="stylesheet" type="text/css" title="default" href="'.dol_buildpath($cssfile,1); print '<link rel="stylesheet" type="text/css" title="default" href="'.dol_buildpath($cssfile,1);
// We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters, so browser cache is not used. // We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters, so browser cache is not used.
if (!preg_match('/\.css$/i',$cssfile) && ! empty($themeparam)) if (!preg_match('/\.css$/i',$cssfile) && ! empty($themeparam)) print $themeparam;
print $themeparam;
print '"><!-- Added by module '.$modcss. '-->'."\n"; print '"><!-- Added by module '.$modcss. '-->'."\n";
} }
} }
@ -78,7 +77,6 @@ $(document).ready(function () {
<center> <center>
<form id="login" name="login" method="post" action="<?php echo $php_self; ?>"> <form id="login" name="login" method="post" action="<?php echo $php_self; ?>">
<input type="hidden" name="mainmenu" value="home" />
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" /> <input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
<input type="hidden" name="loginfunction" value="loginfunction" /> <input type="hidden" name="loginfunction" value="loginfunction" />
<!-- Add fields to send local user information --> <!-- Add fields to send local user information -->
@ -99,7 +97,6 @@ $(document).ready(function () {
<div class="login_table"> <div class="login_table">
<!-- <tr><td colspan="2" valign="middle"> -->
<div id="login_line1"> <div id="login_line1">
<div id="login_left"> <div id="login_left">

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2009-2010 Regis Houssin <regis.houssin@capnetworks.com> /* Copyright (C) 2009-2010 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2011-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -46,7 +46,7 @@ if (isset($conf->modules_parts['css']))
// cssfile is a relative path // cssfile is a relative path
print '<link rel="stylesheet" type="text/css" title="default" href="'.dol_buildpath($cssfile,1); print '<link rel="stylesheet" type="text/css" title="default" href="'.dol_buildpath($cssfile,1);
// We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters, so browser cache is not used. // We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters, so browser cache is not used.
if (!preg_match('/\.css$/i',$cssfile)) print $themeparam; if (!preg_match('/\.css$/i',$cssfile) && ! empty($themeparam)) print $themeparam;
print '"><!-- Added by module '.$modcss. '-->'."\n"; print '"><!-- Added by module '.$modcss. '-->'."\n";
} }
} }
@ -56,6 +56,7 @@ $ext='.js';
print '<!-- Includes JS for JQuery -->'."\n"; print '<!-- Includes JS for JQuery -->'."\n";
if (constant('JS_JQUERY')) print '<script type="text/javascript" src="'.JS_JQUERY.'jquery.min.js"></script>'."\n"; if (constant('JS_JQUERY')) print '<script type="text/javascript" src="'.JS_JQUERY.'jquery.min.js"></script>'."\n";
else print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-latest.min'.$ext.'"></script>'."\n"; else print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-latest.min'.$ext.'"></script>'."\n";
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/core/js/dst.js"></script>'."\n";
print '<link rel="stylesheet" type="text/css" href="'.dol_escape_htmltag($conf_css).'" />'."\n"; print '<link rel="stylesheet" type="text/css" href="'.dol_escape_htmltag($conf_css).'" />'."\n";
if (! empty($conf->global->MAIN_HTML_HEADER)) print $conf->global->MAIN_HTML_HEADER; if (! empty($conf->global->MAIN_HTML_HEADER)) print $conf->global->MAIN_HTML_HEADER;
print '<!-- HTTP_USER_AGENT = '.$_SERVER['HTTP_USER_AGENT'].' --> print '<!-- HTTP_USER_AGENT = '.$_SERVER['HTTP_USER_AGENT'].' -->
@ -65,25 +66,39 @@ print '<!-- HTTP_USER_AGENT = '.$_SERVER['HTTP_USER_AGENT'].' -->
<body class="body"> <body class="body">
<!-- Javascript code on logon page only to detect user tz, dst_observed, dst_first, dst_second -->
<script type="text/javascript">
$(document).ready(function () {
// Set focus on correct field
<?php if ($focus_element) { ?>$('#<?php echo $focus_element; ?>').focus(); <?php } ?> // Warning to use this only on visible element
});
</script>
<center>
<form id="login" name="login" method="post" action="<?php echo $php_self; ?>"> <form id="login" name="login" method="post" action="<?php echo $php_self; ?>">
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>"> <input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>">
<input type="hidden" name="action" value="buildnewpassword"> <input type="hidden" name="action" value="buildnewpassword">
<table class="login_table_title" summary="<?php echo $title; ?>" cellpadding="0" cellspacing="0" border="0" align="center"> <table class="login_table_title" summary="<?php echo dol_escape_htmltag($title); ?>" cellpadding="0" cellspacing="0" border="0" align="center">
<tr class="vmenu"><td align="center"><?php echo $title; ?></td></tr> <tr class="vmenu"><td align="center"><?php echo $title; ?></td></tr>
</table> </table>
<br> <br>
<table class="login_table" summary="Login area" cellpadding="2" align="center"> <div class="login_table">
<tr><td colspan="2" valign="middle"> <div id="login_line1">
<table class="none" summary="Login pass" cellpadding="2" align="center">
<div id="login_left">
<table class="left" summary="Login pass" cellpadding="2">
<!-- Login --> <!-- Login -->
<tr> <tr>
<td valign="bottom"> &nbsp; <b><?php echo $langs->trans('Login'); ?></b> &nbsp; </td> <td valign="bottom"> &nbsp; <strong><label for="username"><?php echo $langs->trans('Login'); ?></label></strong> &nbsp; </td>
<td valign="bottom" nowrap="nowrap"> <td valign="bottom" nowrap="nowrap">
<input type="text" <?php echo $disabled; ?> id="username" name="username" class="flat" size="15" maxlength="25" value="<?php echo $login; ?>" tabindex="1" /></td> <input type="text" <?php echo $disabled; ?> id="username" name="username" class="flat" size="15" maxlength="40" value="<?php echo dol_escape_htmltag($login); ?>" tabindex="1" />
</td>
</tr> </tr>
<?php <?php
@ -99,12 +114,13 @@ if (! empty($hookmanager->resArray['options'])) {
?> ?>
<?php if ($captcha) { ?> <?php if ($captcha) { ?>
<!-- Captcha -->
<tr><td valign="middle" nowrap="nowrap"> &nbsp; <b><?php echo $langs->trans('SecurityCode'); ?></b></td> <tr><td valign="middle" nowrap="nowrap"> &nbsp; <b><?php echo $langs->trans('SecurityCode'); ?></b></td>
<td valign="middle" nowrap="nowrap" align="left" class="none"> <td valign="top" nowrap="nowrap" align="left" class="none">
<table class="login_table_securitycode" style="width: 100px;"><tr> <table class="login_table_securitycode" style="width: 100px;"><tr>
<td><input id="securitycode" class="flat" type="text" size="6" maxlength="5" name="code" tabindex="3"></td> <td><input id="securitycode" class="flat" type="text" size="6" maxlength="5" name="code" tabindex="4" /></td>
<td><img src="<?php echo $dol_url_root.'/core/antispamimage.php'; ?>" border="0" width="80" height="32" id="img_securitycode"></td> <td><img src="<?php echo DOL_URL_ROOT ?>/core/antispamimage.php" border="0" width="80" height="32" id="img_securitycode" /></td>
<td><a href="<?php echo $php_self; ?>"><?php echo $captcha_refresh; ?></a></td> <td><a href="<?php echo $php_self; ?>"><?php echo $captcha_refresh; ?></a></td>
</tr></table> </tr></table>
@ -112,32 +128,36 @@ if (! empty($hookmanager->resArray['options'])) {
<?php } ?> <?php } ?>
</table> </table>
</td>
<td align="center" valign="top"> </div> <!-- end div left -->
<div id="login_right">
<img alt="Logo" title="" src="<?php echo $urllogo; ?>" id="img_logo" /> <img alt="Logo" title="" src="<?php echo $urllogo; ?>" id="img_logo" />
</td>
</tr> </div>
</div>
<div id="login_line2" style="clear: both">
<!-- Button Send password --> <!-- Button Send password -->
<tr><td colspan="3" style="text-align:center;"><br> <br><input id="password" type="submit" <?php echo $disabled; ?> class="button" name="password" value="<?php echo $langs->trans('SendNewPassword'); ?>" tabindex="4" />
<input id="password" type="submit" <?php echo $disabled; ?> class="button" name="password" value="<?php echo $langs->trans('SendNewPassword'); ?>" tabindex="4" />
</td></tr>
<tr><td colspan="3" align="center"> <br>
<div align="center" style="margin-top: 4px;">
<a style="color: #888888; font-size: 10px" href="<?php echo $dol_url_root; ?>/"> <a style="color: #888888; font-size: 10px" href="<?php echo $dol_url_root; ?>/">
<?php echo '('.$langs->trans('BackToLoginPage').')'; ?> <?php echo '('.$langs->trans('BackToLoginPage').')'; ?>
</a> </a>
</td></tr> </div>
</table> </div>
</div>
</form> </form>
<center>
<table width="90%"><tr><td align="center">
<center><div align="center" style="max-width: 680px; margin-left: 10px; margin-right: 10px;">
<?php if ($mode == 'dolibarr' || ! $disabled) { ?> <?php if ($mode == 'dolibarr' || ! $disabled) { ?>
<font style="font-size: 12px;"> <font style="font-size: 12px;">
<?php echo $langs->trans('SendNewPasswordDesc'); ?> <?php echo $langs->trans('SendNewPasswordDesc'); ?>
@ -147,21 +167,19 @@ if (! empty($hookmanager->resArray['options'])) {
<?php echo $langs->trans('AuthenticationDoesNotAllowSendNewPassword', $mode); ?> <?php echo $langs->trans('AuthenticationDoesNotAllowSendNewPassword', $mode); ?>
</div> </div>
<?php } ?> <?php } ?>
</div></center>
</td></tr>
</table>
<br> <br>
<?php if ($message) { ?> <?php if ($message) { ?>
<table width="90%"><tr><td align="center" style="font-size: 12px;"> <center><div align="center" style="max-width: 680px; margin-left: 10px; margin-right: 10px;"><div class="error">
<?php echo $message; ?> <?php echo $message; ?>
</td></tr></table><br> </div></div></center>
<?php } ?> <?php } ?>
</center> </center> <!-- end of center -->
<br>
<br> <br>
</body> </body>