#352 initial commit - basic layout and saimod functionality
This commit is contained in:
parent
610d58bc53
commit
e83d1cc9c5
4
autoload.inc
Normal file
4
autoload.inc
Normal file
@ -0,0 +1,4 @@
|
||||
<?php
|
||||
require_once dirname(__FILE__).'/sql/autoload.inc';
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'SAI');
|
||||
\SYSTEM\SAI\sai::register('\SAI\saimod_webcraft_updates');
|
||||
76
js/saimod_webcraft_updates.js
Normal file
76
js/saimod_webcraft_updates.js
Normal file
@ -0,0 +1,76 @@
|
||||
function init_saimod_mojotrollz_vote() {
|
||||
register_server_edit();
|
||||
register_server_visible();
|
||||
register_server_del();
|
||||
register_server_save();
|
||||
};
|
||||
|
||||
function register_server_edit(){
|
||||
$('.btn_server_edit').click(function(){
|
||||
$('#input_id').val($(this).attr('_id'));
|
||||
$('#input_name').val($(this).attr('_name'));
|
||||
$('#input_url').val($(this).attr('_url'));
|
||||
$('#input_version').val($(this).attr('_version'));
|
||||
$('#input_description').val($(this).attr('_description'));
|
||||
$("#btn_server_save").focus();
|
||||
});
|
||||
}
|
||||
|
||||
function register_server_visible(){
|
||||
$('.btn_server_visible').click(function(){
|
||||
$.ajax({ type :'GET',
|
||||
url : './sai.php?sai_mod=.SAI.saimod_mojotrollz_vote&action=visible'+
|
||||
'&id='+$(this).attr('_id')+
|
||||
'&visible='+$('#select_visible_'+$(this).attr('_i')).val(),
|
||||
success : function(data) {
|
||||
if(data.status){
|
||||
system.reload();
|
||||
}else{
|
||||
alert('Problem: '+data);}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function register_server_del(){
|
||||
$('.btn_server_del').click(function(){
|
||||
if (confirm("Delete Server Permanently?") === true) {
|
||||
$.ajax({ type :'GET',
|
||||
url : './sai.php?sai_mod=.SAI.saimod_mojotrollz_vote&action=del'+
|
||||
'&id='+$(this).attr('_id'),
|
||||
success : function(data) {
|
||||
if(data.status){
|
||||
system.reload();
|
||||
}else{
|
||||
alert('Problem: '+data);}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function register_server_save(){
|
||||
$('#btn_server_save').click(function() {
|
||||
var id = $('#input_id').val();
|
||||
var name = $('#input_name').val();
|
||||
var url = $('#input_url').val();
|
||||
var version = $('#input_version').val();
|
||||
var description = $('#input_description').val();
|
||||
$.ajax({url: './sai.php',
|
||||
data: { sai_mod: '.SAI.saimod_mojotrollz_vote',
|
||||
action: 'save',
|
||||
id: id,
|
||||
name: name,
|
||||
url: url,
|
||||
version: version,
|
||||
description: description},
|
||||
type: 'GET',
|
||||
success: function(data) {
|
||||
if(data.status){
|
||||
system.reload();
|
||||
}else{
|
||||
alert('Problem: '+data);}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
15
saimod_webcraft_updates.php
Normal file
15
saimod_webcraft_updates.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
namespace SAI;
|
||||
class saimod_webcraft_updates extends \SYSTEM\SAI\SaiModule {
|
||||
public static function sai_mod__SAI_saimod_webcraft_updates(){
|
||||
$vars = array();
|
||||
return \SYSTEM\PAGE\replace::replaceFile((new \PSAI('saimod_webcraft_updates/tpl/saimod_webcraft_updates.tpl'))->SERVERPATH(),$vars);}
|
||||
public static function html_li_menu(){return '<li id="menu_updates"><a data-toggle="tooltip" data-placement="left" title="Vote Servers" href="#!updates"><span class="glyphicon glyphicon-check" aria-hidden="true"></span> Updates</a></li>';}
|
||||
public static function right_public(){return false;}
|
||||
public static function right_right(){return \SYSTEM\SECURITY\security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI);}
|
||||
|
||||
/*public static function css(){
|
||||
return array((new \SYSTEM\PSAI('modules/saistart_sys_sai/css/saistart_sys_sai.css'));}*/
|
||||
public static function js(){
|
||||
return array(new \PSAI('saimod_webcraft_updates/js/saimod_webcraft_updates.js'));}
|
||||
}
|
||||
9
sql/DATA_SAIMOD_WEBCRAFT_UPDATES.php
Normal file
9
sql/DATA_SAIMOD_WEBCRAFT_UPDATES.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
class DATA_SAIMOD_WEBCRAFT_UPDATES extends \SYSTEM\DB\QI {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function files_mysql(){
|
||||
return array( (new \PSAI('/saimod_webcraft_updates/sql/mysql/system_page.sql'))->SERVERPATH(),
|
||||
(new \PSAI('/saimod_webcraft_updates/sql/mysql/system_api.sql'))->SERVERPATH());
|
||||
}
|
||||
}
|
||||
4
sql/autoload.inc
Normal file
4
sql/autoload.inc
Normal file
@ -0,0 +1,4 @@
|
||||
<?php
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'SQL');
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/qq/','SQL');
|
||||
\SYSTEM\SQL\setup::register('SQL\\DATA_SAIMOD_WEBCRAFT_UPDATES');
|
||||
9
sql/mysql/system_api.sql
Normal file
9
sql/mysql/system_api.sql
Normal file
@ -0,0 +1,9 @@
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5011, 42, 2, 5000, 'visible', 'visible', 'INT');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5010, 42, 2, 5000, 'visible', 'id', 'INT');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5008, 42, 2, 5000, 'del', 'id', 'INT');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5005, 42, 2, 5000, 'save', 'description', 'STRING');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5004, 42, 2, 5000, 'save', 'version', 'INT');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5003, 42, 2, 5000, 'save', 'url', 'STRING');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5002, 42, 2, 5000, 'save', 'name', 'STRING');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5001, 42, 2, 5000, 'save', 'id', 'INT');
|
||||
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5000, 42, 0, 0, '_SAI_saimod_mojotrollz_vote', 'action', NULL);
|
||||
1
sql/mysql/system_page.sql
Normal file
1
sql/mysql/system_page.sql
Normal file
@ -0,0 +1 @@
|
||||
REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (600, 42, 'updates', 'updates', -1, 0, 0, '#content', './sai.php?sai_mod=.SAI.saimod_webcraft_updates', 'init_saimod_webcraft_updates', '\\SAI\\saimod_webcraft_updates');
|
||||
8
sql/qq/MOJOTROLLZ_SERVER_LIST_ALL.php
Normal file
8
sql/qq/MOJOTROLLZ_SERVER_LIST_ALL.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
class MOJOTROLLZ_SERVER_LIST_ALL extends \SYSTEM\DB\QQ {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'SELECT mojotrollz_server.* FROM mojotrollz_server';
|
||||
}
|
||||
}
|
||||
8
sql/qq/SAIMOD_MOJOTROLLZ_DEL.php
Normal file
8
sql/qq/SAIMOD_MOJOTROLLZ_DEL.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
class SAIMOD_MOJOTROLLZ_DEL extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'DELETE FROM mojotrollz_server WHERE id = ?;';
|
||||
}
|
||||
}
|
||||
8
sql/qq/SAIMOD_MOJOTROLLZ_SAVE.php
Normal file
8
sql/qq/SAIMOD_MOJOTROLLZ_SAVE.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
class SAIMOD_MOJOTROLLZ_SAVE extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'REPLACE INTO mojotrollz_server (id,name,url,version,description) VALUES(?,?,?,?,?);';
|
||||
}
|
||||
}
|
||||
8
sql/qq/SAIMOD_MOJOTROLLZ_VISIBLE.php
Normal file
8
sql/qq/SAIMOD_MOJOTROLLZ_VISIBLE.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
class SAIMOD_MOJOTROLLZ_VISIBLE extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'UPDATE mojotrollz_server SET visible = ? WHERE `id` = ?;';
|
||||
}
|
||||
}
|
||||
59
tpl/saimod_webcraft_updates.tpl
Normal file
59
tpl/saimod_webcraft_updates.tpl
Normal file
@ -0,0 +1,59 @@
|
||||
<div class="row-fluid">
|
||||
<div class="col-md-12 sai_padding_off">
|
||||
<h4> <span class="glyphicon glyphicon-check" aria-hidden="true"></span> <b>Webcraft Updates</b></h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<div class="col-md-12 sai_padding_off">
|
||||
<hr>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<div class="col-md-12">
|
||||
<h3>Updates</h3>
|
||||
<table style="width: 100%" class="sai_table">
|
||||
<tr>
|
||||
<th>time</th>
|
||||
<th>commit</th>
|
||||
<th>commit_last</th>
|
||||
<th>complete</th>
|
||||
</tr>
|
||||
${updates}
|
||||
</table>
|
||||
<hr>
|
||||
<h4 style="word-break: break-all;">Commits of Update ${update}</h4>
|
||||
<table style="width: 100%;" class="sai_table">
|
||||
<tr>
|
||||
<th>time</th>
|
||||
<th>author</th>
|
||||
<th>log</th>
|
||||
<th>commit</th>
|
||||
</tr>
|
||||
${update_commits}
|
||||
</table>
|
||||
<hr>
|
||||
<h4 style="word-break: break-all;">Projects of Update ${update}</h4>
|
||||
<table style="width: 100%;" class="sai_table">
|
||||
<tr>
|
||||
<th>time</th>
|
||||
<!--<th>update</th>-->
|
||||
<th>path</th>
|
||||
<th>git</th>
|
||||
<!--<th>commit</th>-->
|
||||
<!--<th>commit_last</th>-->
|
||||
</tr>
|
||||
${projects}
|
||||
</table>
|
||||
<hr>
|
||||
<h4 style="word-break: break-all;">Commits of Project ${project}</h4>
|
||||
<table style="width: 100%;" class="sai_table">
|
||||
<tr>
|
||||
<th>time</th>
|
||||
<th>author</th>
|
||||
<th>log</th>
|
||||
<th>commit</th>
|
||||
</tr>
|
||||
${commits}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
Loading…
x
Reference in New Issue
Block a user