implemented state system for user

This commit is contained in:
Ulf Gebhardt 2014-11-07 18:45:54 +01:00
parent 18579eeba9
commit d738cc30df
5 changed files with 31 additions and 23 deletions

View File

@ -1,25 +1,4 @@
var sys = null;
$(document).ready(function() {
sys = new SYSTEM('./api.php',2,'user_start');
});
function init_user_start(){}
function init_user_menu(){
register_logout();
$("#btn_news").click(function(){
sys.load('user_news');
});
$("#btn_db").click(function(){
sys.load('user_database');
});
}
function register_logout(){
$("#btn_logout").click(function(){
$.get('./api.php?call=account&action=logout', function (data) {
if(data == 1){
window.location.reload();}
});
});
}
});

View File

@ -0,0 +1,17 @@
function init_user_menu(){
register_logout();
$("#btn_news").click(function(){
sys.load('user_news');
});
$("#btn_db").click(function(){
sys.load('user_database');
});
}
function register_logout(){
$("#btn_logout").click(function(){
$.get('./api.php?call=account&action=logout', function (data) {
if(data == 1){
window.location.reload();}
});
});
}

View File

@ -1,6 +1,12 @@
<?php
class user_menu extends SYSTEM\PAGE\Page {
public static function js(){
return array( \SYSTEM\WEBPATH(new PPAGE(),'user_menu/js/user_menu.js'));}
public static function css (){
return array();}
public function html(){
$vars = array();
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_menu/user_menu.tpl'), $vars);

View File

@ -0,0 +1 @@
function init_user_start(){}

View File

@ -1,6 +1,11 @@
<?php
class user_start extends SYSTEM\PAGE\Page {
public static function js(){
return array( \SYSTEM\WEBPATH(new PPAGE(),'user_start/js/user_start.js'));}
public static function css (){
return array();}
public static function get_char_statistics(){
$result = '';
$chars = \DBD\CHAR_STATS::QA();