updated saistart module
This commit is contained in:
parent
60d127dc1e
commit
a851698284
16
sai/modules/saistart_sys_sai/content.tpl
Normal file
16
sai/modules/saistart_sys_sai/content.tpl
Normal file
@ -0,0 +1,16 @@
|
||||
Welcome to the SYSTEM Admin Interface - short SAI.</br>
|
||||
From here you can control and manage your Website.
|
||||
|
||||
<div id="myCarousel" class="carousel slide" style="margin-right: 300px;">
|
||||
<div class="carousel-inner">
|
||||
<div class="item active">
|
||||
<img class="carousel-img" src="http://mojotrollz.eu/web/system/sai/modules/saistart_sys_sai/img/saimod_log_stats.png" alt="">
|
||||
<div class="carousel-caption">
|
||||
<h4>System Log</h4>
|
||||
<p>Showing Statistics</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a class="carousel-control left" href="#myCarousel" data-slide="prev">‹</a>
|
||||
<a class="carousel-control right" href="#myCarousel" data-slide="next">›</a>
|
||||
</div>
|
||||
BIN
sai/modules/saistart_sys_sai/img/saimod_log_stats.png
Normal file
BIN
sai/modules/saistart_sys_sai/img/saimod_log_stats.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 216 KiB |
30
sai/modules/saistart_sys_sai/login.tpl
Normal file
30
sai/modules/saistart_sys_sai/login.tpl
Normal file
@ -0,0 +1,30 @@
|
||||
<h2 class="muted">Login</h2>
|
||||
<form class="textbox" style="" id="login_form">
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<input type="text"
|
||||
size="30"
|
||||
style="margin-bottom: 15px;"
|
||||
id="bt_login_user"
|
||||
placeholder="${sai_mod_login_username}"
|
||||
minlength="3" data-validation-minlength-message="${sai_error_mod_login_username_too_short}"
|
||||
maxlength="16" data-validation-maxlength-message="${sai_error_mod_login_username_too_long}"
|
||||
required data-validation-required-message="${sai_error_mod_login_username_required}"/>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<input type="password"
|
||||
size="30"
|
||||
style="margin-bottom: 15px;"
|
||||
id="bt_login_password"
|
||||
placeholder="${sai_mod_login_password}"
|
||||
minlength="5" data-validation-minlength-message="${sai_error_mod_login_password_too_short}"
|
||||
maxlength="16" data-validation-maxlength-message="${sai_error_mod_login_password_too_long}"
|
||||
required data-validation-required-message="${sai_error_mod_login_password_required}"/>
|
||||
</div>
|
||||
<div class="help-block"></div>
|
||||
<input type="hidden" />
|
||||
<button class="btn btn-primary" style="clear: left; height: 32px; font-size: 13px;"
|
||||
type="submit"
|
||||
id="login_submit">${sai_mod_login_login}</button>
|
||||
</div>
|
||||
</form>
|
||||
8
sai/modules/saistart_sys_sai/logout.tpl
Normal file
8
sai/modules/saistart_sys_sai/logout.tpl
Normal file
@ -0,0 +1,8 @@
|
||||
<h2 class="muted">Logout</h2>
|
||||
<form class="textbox" style="" id="logout_form">
|
||||
<div class="control-group">
|
||||
<div class="help-block"></div>
|
||||
<input type="hidden" />
|
||||
<button class="btn btn-primary" style="clear: left; height: 32px; font-size: 13px;" type="submit" id="logout_submit">${logout}</button>
|
||||
</div>
|
||||
</form>
|
||||
7
sai/modules/saistart_sys_sai/saistart.tpl
Normal file
7
sai/modules/saistart_sys_sai/saistart.tpl
Normal file
@ -0,0 +1,7 @@
|
||||
<div class="masthead">
|
||||
<h3 class="muted">Design. Simple. Fast. Reliable. Innovative.</h3>
|
||||
<h4 class="text-info">We write awesome code and we use <a href="https://github.com/ulfgebhardt/system">SYSTEM</a> and <a href="http://getbootstrap.com/">Twitter Bootstrap.</a></h4>
|
||||
</div>
|
||||
<div id="content" style="float:left; width: auto;">${content}</div>
|
||||
<div class="well" id="login" style="position: fixed; top: 80px; right: 20px; width:220px;">${login}</div>
|
||||
<div style="clear:both;"></div>
|
||||
35
sai/modules/saistart_sys_sai/saistart_sys_sai.js
Normal file
35
sai/modules/saistart_sys_sai/saistart_sys_sai.js
Normal file
@ -0,0 +1,35 @@
|
||||
function init__SYSTEM_SAI_saistart_sys_sai() {
|
||||
//jqBootstrapValidation
|
||||
$("#login_form input").not("[type=submit]").jqBootstrapValidation({
|
||||
preventSubmit: true,
|
||||
submitError: function($form, event, errors) {},
|
||||
submitSuccess: function($form, event){
|
||||
$.get(SAI_ENDPOINT+'sai_mod=.SYSTEM.SAI.saimod_sys_login&action=login&username='+$('#bt_login_user').val()+'&password_sha='+$.sha1($('#bt_login_password').val())+'&password_md5='+$.md5($('#bt_login_password').val()), function (data) {
|
||||
if(data == 1){
|
||||
$('.help-block').html("Login successfull.</br>");
|
||||
location.reload(true);
|
||||
} else {
|
||||
$('.help-block').html("Login not successfull.</br> User & Password combination wrong.")
|
||||
}
|
||||
});
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
$("#logout_form input").not("[type=submit]").jqBootstrapValidation({
|
||||
preventSubmit: true,
|
||||
submitError: function($form, event, errors) {},
|
||||
submitSuccess: function($form, event){
|
||||
$.get(SAI_ENDPOINT+'sai_mod=.SYSTEM.SAI.saimod_sys_login&action=logout', function (data) {
|
||||
if(data == 1){
|
||||
$('.help-block').html("Logout successfull.</br>");
|
||||
location.reload(true);
|
||||
} else {
|
||||
$('.help-block').html("Logout not successfull.</br>")
|
||||
}
|
||||
});
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
@ -2,11 +2,25 @@
|
||||
namespace SYSTEM\SAI;
|
||||
|
||||
class saistart_sys_sai extends \SYSTEM\SAI\SaiModule {
|
||||
public static function sai_mod__SYSTEM_SAI_saistart_sys_sai(){return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saistart_sys_sai/carousel.tpl'), array());}
|
||||
public static function sai_mod__SYSTEM_SAI_saistart_sys_sai(){
|
||||
return \SYSTEM\PAGE\replace::replaceFile( \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saistart_sys_sai/saistart.tpl'),
|
||||
array('content' => self::html_content(), 'login' => self::html_login()));}
|
||||
public static function html_li_menu(){return '<li class="active"><a href="#" saimenu=".SYSTEM.SAI.saistart_sys_sai">'.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_TITLE).'</a></li>';}
|
||||
public static function right_public(){return true;}
|
||||
public static function right_right(){return true;}
|
||||
|
||||
public static function sai_mod__SYSTEM_SAI_saistart_sys_sai_flag_css(){}
|
||||
public static function sai_mod__SYSTEM_SAI_saistart_sys_sai_flag_js(){}
|
||||
public static function sai_mod__SYSTEM_SAI_saistart_sys_sai_flag_js(){
|
||||
return \SYSTEM\LOG\JsonResult::toString(
|
||||
array( \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'js/jqBootstrapValidation.js'),
|
||||
\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saistart_sys_sai/saistart_sys_sai.js'),
|
||||
\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'js/crypto/jquery.md5.js'),
|
||||
\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'js/crypto/jquery.sha1.js')
|
||||
));}
|
||||
|
||||
protected static function html_content(){
|
||||
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saistart_sys_sai/content.tpl'), array());}
|
||||
|
||||
protected static function html_login(){
|
||||
return \SYSTEM\SECURITY\Security::isLoggedIn() ? \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saistart_sys_sai/logout.tpl'), array()) : \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saistart_sys_sai/login.tpl'), array());}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user