implemented state system for user
This commit is contained in:
parent
18579eeba9
commit
d738cc30df
@ -2,24 +2,3 @@ var sys = null;
|
|||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
sys = new SYSTEM('./api.php',2,'user_start');
|
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();}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
17
mojotrollz/page/user_menu/js/user_menu.js
Normal file
17
mojotrollz/page/user_menu/js/user_menu.js
Normal 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();}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
@ -1,6 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class user_menu extends SYSTEM\PAGE\Page {
|
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(){
|
public function html(){
|
||||||
$vars = array();
|
$vars = array();
|
||||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_menu/user_menu.tpl'), $vars);
|
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_menu/user_menu.tpl'), $vars);
|
||||||
|
|||||||
1
mojotrollz/page/user_start/js/user_start.js
Normal file
1
mojotrollz/page/user_start/js/user_start.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
function init_user_start(){}
|
||||||
@ -1,5 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
class user_start extends SYSTEM\PAGE\Page {
|
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(){
|
public static function get_char_statistics(){
|
||||||
$result = '';
|
$result = '';
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user