');
+ });
+ } else {
+ growl_end_error("An Error Occurred while calculating Diferences: "+data.result.message);
+ }
+ $('#output_log').append(data.result.log);
+ }
+
+ });
+ });
+
+ $('#btn_clear').click(function(){
+ $('#output_log').html('');
+ $('#table_changes').html('');
+ });
+}
+
+function revert_file(path,submodule){
+ growl_start("Reverting path "+path);
+ $.ajax({ type :'GET',
+ url : './sai.php',
+ data : { sai_mod: 'saimod_webcraft_powertool',
+ action: 'revert',
+ path: path,
+ submodule: submodule},
+ success : function(data) {
+ if(data.status){
+ growl_end_success("Reverted path "+path);
+ } else {
+ growl_end_error("An Error Occurred while reverting: "+data.result.message);
+ }
+ $('#output_log').append(data.result.log);
+ }
+
+ });
+}
+
+function remove_file(path,submodule){
+ growl_start("Removing file "+path);
+ $.ajax({ type :'GET',
+ url : './sai.php',
+ data : { sai_mod: 'saimod_webcraft_powertool',
+ action: 'remove',
+ path: path,
+ submodule: submodule},
+ success : function(data) {
+ if(data.status){
+ growl_end_success("Removed file "+path);
+ } else {
+ growl_end_error("An Error Occurred while removing file: "+data.result.message);
+ }
+ $('#output_log').append(data.result.log);
+ }
+
+ });
+}
+
+function growl_start(message){
+ $.bootstrapGrowl(message, {
+ ele: 'body', // which element to append to
+ type: 'info', // (null, 'info', 'danger', 'success')
+ offset: {from: 'top', amount: 50}, // 'top', or 'bottom'
+ align: 'right', // ('left', 'right', or 'center')
+ width: 250, // (integer, or 'auto')
+ delay: 7000, // Time while the message will be displayed. It's not equivalent to the *demo* timeOut!
+ allow_dismiss: true, // If true then will display a cross to close the popup.
+ stackup_spacing: 10 // spacing between consecutively stacked growls.
+ });
+}
+
+function growl_end_success(message){
+ $.bootstrapGrowl(message, {
+ ele: 'body', // which element to append to
+ type: 'success', // (null, 'info', 'danger', 'success')
+ offset: {from: 'top', amount: 50}, // 'top', or 'bottom'
+ align: 'right', // ('left', 'right', or 'center')
+ width: 250, // (integer, or 'auto')
+ delay: 4500, // Time while the message will be displayed. It's not equivalent to the *demo* timeOut!
+ allow_dismiss: true, // If true then will display a cross to close the popup.
+ stackup_spacing: 10 // spacing between consecutively stacked growls.
+ });
+}
+
+function growl_end_error(message){
+ $.bootstrapGrowl(message, {
+ ele: 'body', // which element to append to
+ type: 'danger', // (null, 'info', 'danger', 'success')
+ offset: {from: 'top', amount: 50}, // 'top', or 'bottom'
+ align: 'right', // ('left', 'right', or 'center')
+ width: 250, // (integer, or 'auto')
+ delay: 4500, // Time while the message will be displayed. It's not equivalent to the *demo* timeOut!
+ allow_dismiss: true, // If true then will display a cross to close the popup.
+ stackup_spacing: 10 // spacing between consecutively stacked growls.
+ });
+}
diff --git a/mojotrollz/sai/saimod_mojotrollz_server_handling/saimod_mojotrollz_server_handling.php b/mojotrollz/sai/saimod_mojotrollz_server_handling/saimod_mojotrollz_server_handling.php
new file mode 100644
index 0000000..08b83ee
--- /dev/null
+++ b/mojotrollz/sai/saimod_mojotrollz_server_handling/saimod_mojotrollz_server_handling.php
@@ -0,0 +1,106 @@
+ Mojotrollz Server';}
+ 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 js(){return array(
+ \SYSTEM\WEBPATH(new \PSAI(),'saimod_mojotrollz_server_handling/js/saimod_mojotrollz_server_handling.js'));}
+ //public static function css(){}
+ public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_update(){
+ \LIB\lib_git::php();
+ $log = '';
+ try {
+ $repo = \GIT\Git::open('/home/mojotrolls/mojo');
+ $log .= $repo->run('fetch --all');
+ $log .= $repo->pull('origin','master');
+ $log .= $repo->run('submodule update --init --recursive');
+ $log .= chmod('/home/mojotrolls/mojo/'.'compile',0755) ? "rights apply: yes\r\n" : "rights apply: no\r\n";
+ $log .= chmod('/home/mojotrolls/mojo/'.'run',0755) ? "rights apply: yes\r\n" : "rights apply: no\r\n";
+ $log .= chmod('/home/mojotrolls/mojo/'.'db',0755) ? "rights apply: yes\r\n" : "rights apply: no\r\n";
+ $log .= chmod('/home/mojotrolls/mojo/'.'classic/compile',0755) ? "rights apply: yes\r\n" : "rights apply: no\r\n";
+ $log .= chmod('/home/mojotrolls/mojo/'.'classic/run',0755) ? "rights apply: yes\r\n" : "rights apply: no\r\n";
+ $log .= chmod('/home/mojotrolls/mojo/'.'classic/world',0755) ? "rights apply: yes\r\n" : "rights apply: no\r\n";
+ $log .= chmod('/home/mojotrolls/mojo/'.'classic/realm',0755) ? "rights apply: yes\r\n" : "rights apply: no\r\n";
+ $log .= chmod('/home/mojotrolls/mojo/'.'classic/db',0755) ? "rights apply: yes\r\n" : "rights apply: no\r\n";
+ $log .= chmod('/home/mojotrolls/mojo/'.'tbc/compile',0755) ? "rights apply: yes\r\n" : "rights apply: no\r\n";
+ $log .= chmod('/home/mojotrolls/mojo/'.'tbc/run',0755) ? "rights apply: yes\r\n" : "rights apply: no\r\n";
+ $log .= chmod('/home/mojotrolls/mojo/'.'tbc/world',0755) ? "rights apply: yes\r\n" : "rights apply: no\r\n";
+ $log .= chmod('/home/mojotrolls/mojo/'.'tbc/world_test',0755) ? "rights apply: yes\r\n" : "rights apply: no\r\n";
+ $log .= chmod('/home/mojotrolls/mojo/'.'tbc/realm',0755) ? "rights apply: yes\r\n" : "rights apply: no\r\n";
+ $log .= chmod('/home/mojotrolls/mojo/'.'tbc/db',0755) ? "rights apply: yes\r\n" : "rights apply: no\r\n";
+ } catch (\Exception $e){
+ $log .= 'Error: '.$e->getMessage();
+ }
+ return $log;
+ }
+
+ public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_changes(){
+ \LIB\lib_git::php();
+ $result = array('log' => '', 'revert' => array(), 'remove' => array());
+ try {
+ $repo = \GIT\Git::open('/home/mojotrolls/mojo');
+
+ //Find Changes
+ $log = $repo->run('diff --name-only');
+ $sub_reverts = explode("\n", $log);
+ foreach($sub_reverts as $sub){
+ $result['revert'][] = array($sub,'');
+ }
+ \array_pop($result['revert']);
+ $result['log'] .= $log;
+
+ $log = $repo->run('submodule foreach --recursive git diff --name-only');
+ $sub_reverts = explode("\n", $log);
+ $last_path = '';
+ foreach($sub_reverts as $sub){
+ if(substr($sub,0,8) == 'Entering'){
+ $last_path = explode('\'',substr($sub,10))[0].'/';
+ } else {
+ $result['revert'][] = array($sub,$last_path);
+ }
+ }
+ \array_pop($result['revert']);
+ $result['log'] .= $log;
+
+ //Find Untracked Files
+ $log = $repo->run('ls-files --others --exclude-standard');
+ $sub_removes = explode("\n", $log);
+ foreach($sub_removes as $sub){
+ $result['remove'][] = array($sub,'');
+ }
+ \array_pop($result['remove']);
+ $result['log'] .= $log;
+
+ $log = $repo->run('submodule foreach --recursive git ls-files --others --exclude-standard');
+ $sub_removes = explode("\n", $log);
+ $last_path = '';
+ foreach($sub_removes as $sub){
+ if(substr($sub,0,8) == 'Entering'){
+ $last_path = explode('\'',substr($sub,10))[0].'/';
+ } else {
+ $result['remove'][] = array($sub,$last_path);
+ }
+ }
+ \array_pop($result['remove']);
+ $result['log'] .= $log;
+ } catch (\Exception $e){
+ $result['log'] .= 'Error: '.$e->getMessage();
+ }
+ return \SYSTEM\LOG\JsonResult::toString($result);
+ }
+
+ /* programms: run, db, update, compile
+ * run classic/tbc world/realm/world_test start/stop/status
+ * db classic/tbc realm live
+ * db classic/tbc chars/world live/test
+ * compile classic/tbc live/test
+ * update
+ * dif
+ */
+}
\ No newline at end of file
diff --git a/mojotrollz/sai/saimod_mojotrollz_server_handling/sql/DATA_SAIMOD_MOJOTROLLZ_SERVER_HANDLING.php b/mojotrollz/sai/saimod_mojotrollz_server_handling/sql/DATA_SAIMOD_MOJOTROLLZ_SERVER_HANDLING.php
new file mode 100644
index 0000000..7530770
--- /dev/null
+++ b/mojotrollz/sai/saimod_mojotrollz_server_handling/sql/DATA_SAIMOD_MOJOTROLLZ_SERVER_HANDLING.php
@@ -0,0 +1,9 @@
+
+
Mojotrollz Server
+
+
+
+
+
+
+
+
+
Classic
+
+ Status:
+
+
+
+
compile
+
+
+
+
live
+
compile
+
+
+
test
+
compile
+
+
+
+
+
+
db
+
+
+
+
world
+
deploy live
+
deploy test
+
+
+
realm
+
deploy live
+
+
+
+
chars
+
deploy live
+
deploy test
+
+
+
+
+
+
run
+
+
+
+
world
+
start
+
stop
+
status
+
+
+
realm
+
start
+
stop
+
status
+
+
+
world_test
+
start
+
stop
+
status
+
+
+
+
+
+
+
+
TBC
+
+ Status:
+
+
+
+
compile
+
+
+
+
live
+
compile
+
+
+
test
+
compile
+
+
+
+
+
+
db
+
+
+
+
world
+
deploy live
+
deploy test
+
+
+
realm
+
deploy live
+
+
+
+
chars
+
deploy live
+
deploy test
+
+
+
+
+
+
run
+
+
+
+
world
+
start
+
stop
+
status
+
+
+
realm
+
start
+
stop
+
status
+
+
+
world_test
+
start
+
stop
+
status
+
+
+
+
+
+
+
+
Output
+
+
+
+
+
${table_path}
+
${table_submodule}
+
${table_action}
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mojotrollz/sai/saimod_mojotrollz_servers/autoload.inc b/mojotrollz/sai/saimod_mojotrollz_servers/autoload.inc
index 6409c48..1453147 100644
--- a/mojotrollz/sai/saimod_mojotrollz_servers/autoload.inc
+++ b/mojotrollz/sai/saimod_mojotrollz_servers/autoload.inc
@@ -1,4 +1,5 @@
Servers';}
+ public static function html_li_menu(){return '
';}
public static function right_public(){return false;}
public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI);}
diff --git a/mojotrollz/sai/saimod_mojotrollz_servers/sql/DATA_SAIMOD_MOJOTROLLZ_SERVERS.php b/mojotrollz/sai/saimod_mojotrollz_servers/sql/DATA_SAIMOD_MOJOTROLLZ_SERVERS.php
new file mode 100644
index 0000000..5b76660
--- /dev/null
+++ b/mojotrollz/sai/saimod_mojotrollz_servers/sql/DATA_SAIMOD_MOJOTROLLZ_SERVERS.php
@@ -0,0 +1,9 @@
+