started redesign of FILES sai module -> server mysql table schemata
This commit is contained in:
parent
d80a84cca3
commit
7639d6aa92
14
dbd/sql/mysql/data/system_api.sql
Normal file
14
dbd/sql/mysql/data/system_api.sql
Normal file
@ -0,0 +1,14 @@
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (0, 0, 0, -1, NULL, 'call', NULL);
|
||||
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (60, 0, 0, 0, NULL, 'action', NULL);
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (61, 0, 2, 60, 'login', 'username', 'STRING');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (62, 0, 2, 60, 'login', 'password_sha', 'STRING');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (63, 0, 2, 60, 'login', 'password_md5', 'STRING');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (64, 0, 2, 60, 'check', 'rightid', 'UINT');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (65, 0, 2, 60, 'create', 'username', 'STRING');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (66, 0, 2, 60, 'create', 'password_sha', 'STRING');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (67, 0, 2, 60, 'create', 'email', 'STRING');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (68, 0, 2, 60, 'create', 'locale', 'LANG');
|
||||
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (100, 0, 2, 0, 'files', 'cat', 'STRING');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (101, 0, 3, 0, 'files', 'id', 'STRING');
|
||||
9
dbd/sql/mysql/schema/system_cache.sql
Normal file
9
dbd/sql/mysql/schema/system_cache.sql
Normal file
@ -0,0 +1,9 @@
|
||||
CREATE TABLE `system_cache` (
|
||||
`ID` INT(10) NOT NULL AUTO_INCREMENT,
|
||||
`CacheID` INT(10) NOT NULL,
|
||||
`Ident` CHAR(255) NOT NULL,
|
||||
`data` BINARY(255) NOT NULL,
|
||||
PRIMARY KEY (`ID`)
|
||||
)
|
||||
COLLATE='utf8_general_ci'
|
||||
ENGINE=MyISAM;
|
||||
16
dbd/sql/mysql/schema/system_todo.sql
Normal file
16
dbd/sql/mysql/schema/system_todo.sql
Normal file
@ -0,0 +1,16 @@
|
||||
CREATE TABLE `system_todo` (
|
||||
`ID` INT(10) NOT NULL AUTO_INCREMENT,
|
||||
`time` DATETIME NOT NULL,
|
||||
`author` INT(11) NOT NULL,
|
||||
`type` INT(11) NOT NULL,
|
||||
`state` INT(11) NOT NULL,
|
||||
`msg_1` TEXT NOT NULL,
|
||||
`msg_2` TEXT NULL,
|
||||
`msg_3` TEXT NULL,
|
||||
`msg_4` TEXT NULL,
|
||||
`msg_5` TEXT NULL,
|
||||
PRIMARY KEY (`ID`)
|
||||
)
|
||||
COLLATE='utf8_general_ci'
|
||||
ENGINE=MyISAM
|
||||
AUTO_INCREMENT=5;
|
||||
@ -1,4 +1,15 @@
|
||||
function init__SYSTEM_SAI_saimod_sys_files() {
|
||||
$('#filestab a').click(function (e) {e.preventDefault(); load_tab($(this).attr('tabname')); $(this).tab('show');});
|
||||
register_controlls();
|
||||
}
|
||||
|
||||
function load_tab(name){
|
||||
$('#tab_'+name).load(SAI_ENDPOINT+'sai_mod=.SYSTEM.SAI.saimod_sys_files&action=tab&name='+name, function(){
|
||||
register_controlls();
|
||||
});
|
||||
}
|
||||
|
||||
function register_controlls(){
|
||||
$(".imgdelbtn").click(function(){
|
||||
$.getJSON(SAI_ENDPOINT+'sai_mod=.SYSTEM.SAI.saimod_sys_files&action=del&cat='+$(this).attr("cat")+'&id='+$(this).attr("id"), function(data){
|
||||
if(data.status){
|
||||
@ -10,7 +21,7 @@ function init__SYSTEM_SAI_saimod_sys_files() {
|
||||
});
|
||||
|
||||
$(".imgrnbtn").click(function(){
|
||||
$.getJSON(SAI_ENDPOINT+'sai_mod=.SYSTEM.SAI.saimod_sys_files&action=rn&cat='+$(this).attr("cat")+'&id='+$(this).attr("id")+'&newid='+$("#renametext_"+$(this).attr("textfield")).val(), function(data){
|
||||
$.getJSON(SAI_ENDPOINT+'sai_mod=.SYSTEM.SAI.saimod_sys_files&action=rn&cat='+$(this).attr("cat")+'&id='+$(this).attr("id")+'&newid='+$($(this).attr("textfield")).val(), function(data){
|
||||
if(data.status){
|
||||
alert("ok");
|
||||
} else{
|
||||
@ -20,4 +31,3 @@ function init__SYSTEM_SAI_saimod_sys_files() {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -23,34 +23,31 @@ class saimod_sys_files extends \SYSTEM\SAI\SaiModule {
|
||||
return \SYSTEM\LOG\JsonResult::ok();
|
||||
}
|
||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_files(){
|
||||
//tt
|
||||
$result = '';
|
||||
$result = array('tabopts' => '', 'tabs' => '');
|
||||
$file_folders = \SYSTEM\FILES\files::get();
|
||||
$i = 0;
|
||||
//$i = 0;
|
||||
$first = true;
|
||||
foreach($file_folders as $name=>$folder){
|
||||
$cat = \SYSTEM\FILES\files::get($name);
|
||||
$result .= "<h3>".$name."</h3>";
|
||||
$result .= '<form action="'.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_BASEURL).'sai_mod=.SYSTEM.SAI.saimod_sys_files&action=upload&cat='.$name.'" method="post" enctype="multipart/form-data">';
|
||||
$result .= //'<input type="hidden" name="MAX_FILE_SIZE" value="3000000" />
|
||||
'<input type="file" name="datei"><br>
|
||||
<input type="submit" class="btn" value="Add">';
|
||||
$result .= "</form>";
|
||||
$result .= "<table><tr><th>Delete</th><th>Name</th><th>new name</th><th>Rename</th></tr>";
|
||||
foreach($cat as $img){
|
||||
//$result .= '<img src="api.php?call=img&cat='.$name.'&id='.$img.'" alt="" />';
|
||||
$result .= '<tr><td><input type="button" class="btn-danger imgdelbtn" style="margin: 1px; margin-right: 3px" value="Delete" cat="'.$name.'" id="'.$img.'"></td><td><a href="api.php?call=files&cat='.$name.'&id='.$img.'">'.$img.'</a></td><td><input type="text" id="renametext_'.$i.'" class="form-control" style="width: 100px; margin:0;" placeholder="new name..."></td><td><input type="submit" class="btn-warning imgrnbtn" style="margin: 1px;;" value="Rename" cat="'.$name.'" id="'.$img.'" textfield="'.$i.'"></td></tr>';
|
||||
$i++;
|
||||
}
|
||||
$result .= "</table>";
|
||||
$result['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_files/saimod_sys_files_tabopt.tpl'),array('name' => $name, 'active' => $first ? 'active' : ''));
|
||||
$result['tabs'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_files/saimod_sys_files_tab.tpl'),array('name' => $name, 'active' => $first ? 'active' : '', 'content' => $first ? self::sai_mod__SYSTEM_SAI_saimod_sys_files_action_tab($name) : ''));
|
||||
$first = false;
|
||||
}
|
||||
return $result;
|
||||
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_files/saimod_sys_files.tpl'),$result);
|
||||
}
|
||||
|
||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_files_action_tab($name){
|
||||
$result = '';
|
||||
$cat = \SYSTEM\FILES\files::get($name);
|
||||
$i = 0;
|
||||
foreach($cat as $file){
|
||||
$result .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_files/saimod_sys_files_tableentry.tpl'), array('i' => $i++, 'cat' => $name, 'name' => $file, 'extension' => substr($file,-3,3), 'url' => 'api.php?call=files&cat='.$name.'&id='.$file));}
|
||||
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_files/saimod_sys_files_tabfull.tpl'), array('content' => $result));}
|
||||
|
||||
public static function html_li_menu(){return '<li><a href="#" saimenu=".SYSTEM.SAI.saimod_sys_files">Files</a></li>';}
|
||||
public static function right_public(){return false;}
|
||||
public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI) && \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_FILES);}
|
||||
|
||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_files_flag_css(){}
|
||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_files_flag_js(){return \SYSTEM\LOG\JsonResult::toString(
|
||||
array( \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_files/sai_sys_files.js')));}
|
||||
array( \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_files/saimod_sys_files.js')));}
|
||||
}
|
||||
8
sai/modules/saimod_sys_files/saimod_sys_files.tpl
Normal file
8
sai/modules/saimod_sys_files/saimod_sys_files.tpl
Normal file
@ -0,0 +1,8 @@
|
||||
<div class="tabbable">
|
||||
<ul class="nav nav-tabs" id="filestab">
|
||||
${tabopts}
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
${tabs}
|
||||
</div>
|
||||
</div>
|
||||
1
sai/modules/saimod_sys_files/saimod_sys_files_tab.tpl
Normal file
1
sai/modules/saimod_sys_files/saimod_sys_files_tab.tpl
Normal file
@ -0,0 +1 @@
|
||||
<div class="tab-pane ${active}" id="tab_${name}">${content}</div>
|
||||
16
sai/modules/saimod_sys_files/saimod_sys_files_tabfull.tpl
Normal file
16
sai/modules/saimod_sys_files/saimod_sys_files_tabfull.tpl
Normal file
@ -0,0 +1,16 @@
|
||||
<table class="table table-hover table-condensed" style="overflow: auto;">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Extension</th>
|
||||
<th>URL</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
${content}
|
||||
<tr>
|
||||
<br>
|
||||
<th><input type="file" name="datei"></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th><input type="submit" class="btn" value="Upload"></th>
|
||||
</tr>
|
||||
</table>
|
||||
12
sai/modules/saimod_sys_files/saimod_sys_files_tableentry.tpl
Normal file
12
sai/modules/saimod_sys_files/saimod_sys_files_tableentry.tpl
Normal file
@ -0,0 +1,12 @@
|
||||
<tr>
|
||||
<td>${name}</td>
|
||||
<td>${extension}</td>
|
||||
<td>
|
||||
<a href="${url}" target="_blank">${url}</a>
|
||||
</td>
|
||||
<td>
|
||||
<input type="button" class="btn-danger imgdelbtn" style="margin: 1px; margin-right: 3px" value="Delete" cat="${cat}" id="${name}">
|
||||
<input type="text" id="renametext_${cat}_${i}" class="form-control" style="width: 100px; margin:0;" placeholder="new name...">
|
||||
<input type="submit" class="btn-warning imgrnbtn" style="margin: 1px;;" value="Rename" cat="${cat}" id="${name}" textfield="#renametext_${cat}_${i}">
|
||||
</td>
|
||||
</tr>
|
||||
1
sai/modules/saimod_sys_files/saimod_sys_files_tabopt.tpl
Normal file
1
sai/modules/saimod_sys_files/saimod_sys_files_tabopt.tpl
Normal file
@ -0,0 +1 @@
|
||||
<li class="${active}"><a href="#tab_${name}" tabname="${name}">${name}</a></li>
|
||||
Loading…
x
Reference in New Issue
Block a user