02-22-2012, 02:22 AM
Hello,
I think opendocman can be a very good opensource. But, I do not understand why all web pages are not in smarty template. The advantage of smarty is that all user can define his template, if he know HTML. I start to modify the index.php to put the login page in the smarty concept. I make a quickly example.
The first think is to extract the php code of the login page, initialize the requiered variables and create a login.tpl file.
For exemple, I modify the lines of index.php (107-153) to put :
if(isset($_REQUEST['redirection']))
{
$GLOBALS['smarty']->assign('redirection', $_REQUEST['redirection']);
}
else
{
$GLOBALS['smarty']->assign('redirection', false);
}
$GLOBALS['smarty']->assign('allow_password_reset',$GLOBALS['CONFIG']['allow_password_reset']);
$GLOBALS['smarty']->assign('allow_signup',$GLOBALS['CONFIG']['allow_signup']);
$GLOBALS['smarty']->display('logon.tpl');
I created an logon.tpl file :
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Untitled Page</title>
<meta name="generator" content="WYSIWYG Web Builder 8 - <!-- m --><a class="postlink" href="http://www.wysiwygwebbuilder.com">http://www.wysiwygwebbuilder.com</a><!-- m -->">
<link rel="stylesheet" type="text/css" href="addon/css/login_style.css" />
<script src="addon/js/validform.js" type="text/javascript"></script>
</head>
<body>
<div id="wb_Image2" style="position:absolute;left:32px;top:7px;width:226px;height:151px;z-index:12;padding:0;">
<img src="images/altimirambitecnia.jpg" id="Image2" alt="" border="0" style="width:226px;height:151px;"></div>
<div id="wb_Text4" style="position:absolute;left:146px;top:167px;width:737px;height:62px;z-index:13;">
<span style="color:#00008B;font-family:Arial;font-size:53px;"><strong>Accès al vostre espai client</strong></span></div>
<div id="wb_Form1" style="position:absolute;left:261px;top:259px;width:387px;height:209px;z-index:10;">
<form name="Form1" method="post" action="index.php" id="Form1" onsubmit="return ValidateForm1(this)">
<input type="text" id="Editbox1" style="position:absolute;left:153px;top:94px;width:221px;height:19px;line-height:19px;z-index:0;" name="frmuser" value="">
<input type="password" id="Editbox2" style="position:absolute;left:153px;top:119px;width:221px;height:19px;line-height:19px;z-index:1;" name="frmpass" value="">
<div id="wb_Text1" style="position:absolute;left:21px;top:101px;width:50px;height:16px;z-index:2;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Usuari</span></div>
<div id="wb_Text2" style="position:absolute;left:21px;top:122px;width:82px;height:16px;z-index:3;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Mot clau</span></div>
<div id="wb_Image1" style="position:absolute;left:14px;top:5px;width:88px;height:87px;z-index:4;padding:0;">
<img src="images/login.jpg" id="Image1" alt="" border="0" style="width:88px;height:87px;"></div>
<div id="wb_Text3" style="position:absolute;left:112px;top:11px;width:260px;height:34px;z-index:5;">
<span style="color:#00008B;font-family:Arial;font-size:29px;"><strong>Altimir</strong></span><span style="color:#000000;font-family:Arial;font-size:29px;"><strong> </strong></span><span style="color:#00008B;font-family:Arial;font-size:29px;"><strong>Ambi</strong></span><span style="color:#005500;font-family:Arial;font-size:29px;"><strong>tècnia</strong></span></div>
<input type="submit" id="Button1" name="login" value="Submit" style="position:absolute;left:275px;top:170px;width:96px;height:25px;z-index:6;">
{if $redirection}
<input type="hidden" id="Editbox3" style="position:absolute;left:154px;top:68px;width:94px;height:19px;line-height:19px;z-index:7;" ame="redirection" value="{$redirection}">
{/if}
{if $allow_password_reset == 'True' }
<div id="wb_Text5" style="position:absolute;left:20px;top:154px;width:250px;height:16px;z-index:8;">
<a href="$g_base_url/forgot_password.php">"$g_lang_forgotpassword"</a>
{/if}
{if $allow_signup == 'True'}
<div id="wb_Text6" style="position:absolute;left:20px;top:173px;width:250px;height:16px;z-index:9;">
<a href="$g_base_url/signup.php">$g_lang_signup}</a>;
{/if}
</form>
</div>
And it is all.
Now I will modify my logon.tpl to put css style.
See you early.
Bye
I think opendocman can be a very good opensource. But, I do not understand why all web pages are not in smarty template. The advantage of smarty is that all user can define his template, if he know HTML. I start to modify the index.php to put the login page in the smarty concept. I make a quickly example.
The first think is to extract the php code of the login page, initialize the requiered variables and create a login.tpl file.
For exemple, I modify the lines of index.php (107-153) to put :
if(isset($_REQUEST['redirection']))
{
$GLOBALS['smarty']->assign('redirection', $_REQUEST['redirection']);
}
else
{
$GLOBALS['smarty']->assign('redirection', false);
}
$GLOBALS['smarty']->assign('allow_password_reset',$GLOBALS['CONFIG']['allow_password_reset']);
$GLOBALS['smarty']->assign('allow_signup',$GLOBALS['CONFIG']['allow_signup']);
$GLOBALS['smarty']->display('logon.tpl');
I created an logon.tpl file :
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Untitled Page</title>
<meta name="generator" content="WYSIWYG Web Builder 8 - <!-- m --><a class="postlink" href="http://www.wysiwygwebbuilder.com">http://www.wysiwygwebbuilder.com</a><!-- m -->">
<link rel="stylesheet" type="text/css" href="addon/css/login_style.css" />
<script src="addon/js/validform.js" type="text/javascript"></script>
</head>
<body>
<div id="wb_Image2" style="position:absolute;left:32px;top:7px;width:226px;height:151px;z-index:12;padding:0;">
<img src="images/altimirambitecnia.jpg" id="Image2" alt="" border="0" style="width:226px;height:151px;"></div>
<div id="wb_Text4" style="position:absolute;left:146px;top:167px;width:737px;height:62px;z-index:13;">
<span style="color:#00008B;font-family:Arial;font-size:53px;"><strong>Accès al vostre espai client</strong></span></div>
<div id="wb_Form1" style="position:absolute;left:261px;top:259px;width:387px;height:209px;z-index:10;">
<form name="Form1" method="post" action="index.php" id="Form1" onsubmit="return ValidateForm1(this)">
<input type="text" id="Editbox1" style="position:absolute;left:153px;top:94px;width:221px;height:19px;line-height:19px;z-index:0;" name="frmuser" value="">
<input type="password" id="Editbox2" style="position:absolute;left:153px;top:119px;width:221px;height:19px;line-height:19px;z-index:1;" name="frmpass" value="">
<div id="wb_Text1" style="position:absolute;left:21px;top:101px;width:50px;height:16px;z-index:2;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Usuari</span></div>
<div id="wb_Text2" style="position:absolute;left:21px;top:122px;width:82px;height:16px;z-index:3;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Mot clau</span></div>
<div id="wb_Image1" style="position:absolute;left:14px;top:5px;width:88px;height:87px;z-index:4;padding:0;">
<img src="images/login.jpg" id="Image1" alt="" border="0" style="width:88px;height:87px;"></div>
<div id="wb_Text3" style="position:absolute;left:112px;top:11px;width:260px;height:34px;z-index:5;">
<span style="color:#00008B;font-family:Arial;font-size:29px;"><strong>Altimir</strong></span><span style="color:#000000;font-family:Arial;font-size:29px;"><strong> </strong></span><span style="color:#00008B;font-family:Arial;font-size:29px;"><strong>Ambi</strong></span><span style="color:#005500;font-family:Arial;font-size:29px;"><strong>tècnia</strong></span></div>
<input type="submit" id="Button1" name="login" value="Submit" style="position:absolute;left:275px;top:170px;width:96px;height:25px;z-index:6;">
{if $redirection}
<input type="hidden" id="Editbox3" style="position:absolute;left:154px;top:68px;width:94px;height:19px;line-height:19px;z-index:7;" ame="redirection" value="{$redirection}">
{/if}
{if $allow_password_reset == 'True' }
<div id="wb_Text5" style="position:absolute;left:20px;top:154px;width:250px;height:16px;z-index:8;">
<a href="$g_base_url/forgot_password.php">"$g_lang_forgotpassword"</a>
{/if}
{if $allow_signup == 'True'}
<div id="wb_Text6" style="position:absolute;left:20px;top:173px;width:250px;height:16px;z-index:9;">
<a href="$g_base_url/signup.php">$g_lang_signup}</a>;
{/if}
</form>
</div>
And it is all.
Now I will modify my logon.tpl to put css style.
See you early.
Bye