Location: PHPKode > projects > EXtensible Production Suite (XPS) > xpsdev/core/templates/mod_login.tpl
<!--BREADCRUMBS-->
<div class="breadcrumb_container">{$breadcrumbs}</div>

<!--CONTENT-->
<br />
<div align="center" id="login_content">
	
{literal}
<script>
var simple = new Ext.FormPanel({
        labelWidth: 75,
        url: 'index.php',
        baseParams: {f:'login_user', module_id:'SignInPanel'},
        frame: true,
        title: '{/literal}{API->get_label label_id='lbl_login_panel'}{literal}',
        bodyStyle:'padding:5px 5px 0',
        width: 350,
        defaults: {width: 230},
        defaultType: 'textfield',
        items: [{
                fieldLabel: 'Username',
                name: 'username',
                value: '',
                allowBlank:false,
                type: 'text'
            },{
                fieldLabel: 'Password',
                name: 'password',
                value: '',
                allowBlank:false,
                type: 'password'
            }
        ],
        buttons: [{
            text: 'Submit',
            handler: function(){
				simple.form.submit({
					clientValidation: true,
					waitTitle:'Signing In',
					waitMsg: 'Please wait...',
					success:function(form, action){
                        Ext.MessageBox.wait('Loading user content. Please wait...', 'Sign In Successful');
						pageRefresh();
                    },
                    failure: function(form, action) {
						if(action.result)
						{
							Ext.MessageBox.alert(action.result.error.name, action.result.error.description);
						}
						else
						{
							Ext.MessageBox.alert('Login Error', 'Please complete the required fields.');
						}
                    }
				});
			}
        },{
            text: 'Cancel',
            handler: function(){launchCoreModule('Home','');}
        }]
    });

    simple.render('login_content');
</script>
{/literal}

{*<!--OLD FORM-->

	<!--CONTENT-->
	<form id="xps_login" action="index.php" method="POST" name="login_form">
		<table align="center" cellpadding="0" cellspacing="1" border="0">
			<tbody>
	            <tr>
	                <td colspan="2"  style="color:#303030;text-align:left;">
	                    <i>{API->get_label label_id='lbl_sign_in'}</i>
	                </td>
	            </tr>
	            <tr>
					<td rowspan="3">
	                    <img src="themes/{API->get_theme}/images/login.gif" border="0" alt="login" style="margin-right:2px;" />
	                </td>
				</tr>
				<tr>
					<td style="font-size:9pt;">
						{API->get_label label_id='lbl_username'}
					</td>
					<td style="padding-left:3px;">
						<input id="xps_login_username" name="username" value="" type="text" />
					</td>
				</tr>
				<tr>
					<td style="font-size:9pt;">
						{API->get_label label_id='lbl_password'}
					</td>
					<td style="padding-left:3px;">
						<input id="xps_login_password" name="password" value="" type="password" />
					</td>
				</tr>
				<tr>
					<td colspan="3" style="text-align:center; padding-top:10px;">
						<input id="xps_login_submit" class="button" type="button" name="save" value="{API->get_label label_id='lbl_login'}" />
						<input class="button" type="button" name="cancel" value="{API->get_label label_id='lbl_cancel'}" onclick="javascript:launchCoreModule('Home','');" />
					</td>
				</tr>
	        </tbody>
		</table>
		<input type="hidden" name="f" value="login_user" />
	    <input type="hidden" name="module_id" value="SignInPanel" />
	</form>
	<br />

	{literal}
	<script>
		Ext.onReady(function(){
			
			var usrname = new Ext.form.TextField({
				allowBlank: false,
				applyTo: 'xps_login_username'
			});
			usrname.focus();
			
			var usrpass = new Ext.form.TextField({
				allowBlank: false,
				applyTo: 'xps_login_password'
			});
			
			Ext.get("xps_login_submit").on('click', function(){
				var usr = Ext.get('xps_login_username');
				var pas = Ext.get('xps_login_password');
				if(usr.isValid() && pas.isValid())
				{
					Ext.get('xps_login').dom.submit();
				}
				return false;
			});
		});
	</script>
	{/literal}
*}
Return current item: EXtensible Production Suite (XPS)