mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-08-05 03:08:22 +00:00
place all javascript into js() function
This commit is contained in:
parent
d283c24979
commit
4e46531edf
|
@ -31,26 +31,14 @@ require_once("class.Bootstrap.php");
|
||||||
*/
|
*/
|
||||||
class SeedDMS_View_Login extends SeedDMS_Bootstrap_Style {
|
class SeedDMS_View_Login extends SeedDMS_Bootstrap_Style {
|
||||||
|
|
||||||
function show() { /* {{{ */
|
function js() { /* {{{ */
|
||||||
$enableguestlogin = $this->params['enableguestlogin'];
|
|
||||||
$enablepasswordforgotten = $this->params['enablepasswordforgotten'];
|
|
||||||
$refer = $this->params['referrer'];
|
|
||||||
$themes = $this->params['themes'];
|
|
||||||
$languages = $this->params['languages'];
|
|
||||||
$enableLanguageSelector = $this->params['enablelanguageselector'];
|
|
||||||
$enableThemeSelector = $this->params['enablethemeselector'];
|
|
||||||
|
|
||||||
$this->htmlStartPage(getMLText("sign_in"), "login");
|
|
||||||
$this->globalBanner();
|
|
||||||
$this->contentStart();
|
|
||||||
$this->pageNavigation(getMLText("sign_in"));
|
|
||||||
?>
|
?>
|
||||||
<script language="JavaScript">
|
document.form1.login.focus();
|
||||||
function checkForm()
|
function checkForm()
|
||||||
{
|
{
|
||||||
msg = new Array()
|
msg = new Array()
|
||||||
if (document.form1.login.value == "") msg.push("<?php printMLText("js_no_login");?>");
|
if($("#login").val() == "") msg.push("<?php printMLText("js_no_login");?>");
|
||||||
if (document.form1.pwd.value == "") msg.push("<?php printMLText("js_no_pwd");?>");
|
if($("#pwd").val() == "") msg.push("<?php printMLText("js_no_pwd");?>");
|
||||||
if (msg != "") {
|
if (msg != "") {
|
||||||
noty({
|
noty({
|
||||||
text: msg.join('<br />'),
|
text: msg.join('<br />'),
|
||||||
|
@ -80,10 +68,35 @@ function guestLogin()
|
||||||
}
|
}
|
||||||
document.location.href = url;
|
document.location.href = url;
|
||||||
}
|
}
|
||||||
|
$(document).ready( function() {
|
||||||
|
$('body').on('submit', '#form', function(ev){
|
||||||
|
if(checkForm()) return;
|
||||||
|
ev.preventDefault();
|
||||||
|
});
|
||||||
|
$('body').on('click', '#guestlogin', function(ev){
|
||||||
|
ev.preventDefault();
|
||||||
|
guestLogin();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
<?php
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
</script>
|
function show() { /* {{{ */
|
||||||
|
$enableguestlogin = $this->params['enableguestlogin'];
|
||||||
|
$enablepasswordforgotten = $this->params['enablepasswordforgotten'];
|
||||||
|
$refer = $this->params['referrer'];
|
||||||
|
$themes = $this->params['themes'];
|
||||||
|
$languages = $this->params['languages'];
|
||||||
|
$enableLanguageSelector = $this->params['enablelanguageselector'];
|
||||||
|
$enableThemeSelector = $this->params['enablethemeselector'];
|
||||||
|
|
||||||
|
$this->htmlStartPage(getMLText("sign_in"), "login");
|
||||||
|
$this->globalBanner();
|
||||||
|
$this->contentStart();
|
||||||
|
$this->pageNavigation(getMLText("sign_in"));
|
||||||
|
?>
|
||||||
<?php $this->contentContainerStart(); ?>
|
<?php $this->contentContainerStart(); ?>
|
||||||
<form class="form-horizontal" action="../op/op.Login.php" method="post" name="form1" onsubmit="return checkForm();">
|
<form class="form-horizontal" action="../op/op.Login.php" method="post" name="form1" id="form">
|
||||||
<?php
|
<?php
|
||||||
if ($refer) {
|
if ($refer) {
|
||||||
echo "<input type='hidden' name='referuri' value='".sanitizeString($refer)."'/>";
|
echo "<input type='hidden' name='referuri' value='".sanitizeString($refer)."'/>";
|
||||||
|
@ -147,7 +160,7 @@ function guestLogin()
|
||||||
$this->contentContainerEnd();
|
$this->contentContainerEnd();
|
||||||
$tmpfoot = array();
|
$tmpfoot = array();
|
||||||
if ($enableguestlogin)
|
if ($enableguestlogin)
|
||||||
$tmpfoot[] = "<a href=\"javascript:guestLogin()\">" . getMLText("guest_login") . "</a>\n";
|
$tmpfoot[] = "<a href=\"\" id=\"guestlogin\">" . getMLText("guest_login") . "</a>\n";
|
||||||
if ($enablepasswordforgotten)
|
if ($enablepasswordforgotten)
|
||||||
$tmpfoot[] = "<a href=\"../out/out.PasswordForgotten.php\">" . getMLText("password_forgotten") . "</a>\n";
|
$tmpfoot[] = "<a href=\"../out/out.PasswordForgotten.php\">" . getMLText("password_forgotten") . "</a>\n";
|
||||||
if($tmpfoot) {
|
if($tmpfoot) {
|
||||||
|
@ -155,9 +168,7 @@ function guestLogin()
|
||||||
print implode(' | ', $tmpfoot);
|
print implode(' | ', $tmpfoot);
|
||||||
print "</p>\n";
|
print "</p>\n";
|
||||||
}
|
}
|
||||||
?>
|
$this->contentEnd();
|
||||||
<script language="JavaScript">document.form1.login.focus();</script>
|
|
||||||
<?php
|
|
||||||
$this->htmlEndPage();
|
$this->htmlEndPage();
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user