reworked gallery to new system

This commit is contained in:
Ulf Gebhardt 2024-11-21 02:51:48 +01:00
parent 73752f117e
commit 2ca382a73a
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9
9 changed files with 44 additions and 37 deletions

View File

@ -1,5 +1,10 @@
function init_saimod_webcraft_gallery() {
$('#gallerytab a').click(function (e) {e.preventDefault(); load_tab($(this).attr('gallery')); $(this).tab('show');});
// $('#gallerytab a').click(function (e) {e.preventDefault(); load_tab($(this).attr('gallery')); $(this).tab('show');});
$('#tabs_gallery a').click(function (e) {
$('#tabs_gallery li a').each(function(){
$(this).removeClass('active');});
$(this).addClass('active');
});
register_controlls();
}

View File

@ -59,14 +59,14 @@ class saimod_webcraft_gallery extends \SYSTEM\SAI\sai_module {
$first = true;
while($gallery = $galleries->next()){
$gallery['active'] = $first ? 'active' : '';
if($first){$vars['firsttab'] = self::sai_mod_saimod_webcraft_gallery_action_tab($gallery['gallery']);}
// if($first){$vars['firsttab'] = self::sai_mod_saimod_webcraft_gallery_action_tab($gallery['gallery']);}
$first = false;
$vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile((new PSAI('saimod_webcraft_gallery/tpl/saimod_webcraft_gallery_tabopt.tpl'))->SERVERPATH(), $gallery);}
return \SYSTEM\PAGE\replace::replaceFile((new PSAI('saimod_webcraft_gallery/tpl/saimod_webcraft_gallery_tabs.tpl'))->SERVERPATH(),$vars);
}
public static function sai_mod_saimod_webcraft_gallery_action_tab($name){
public static function sai_mod_saimod_webcraft_gallery_action_tab($name = 1){
$gallery = \SQL\SAIMOD_WEBCRAFT_GALLERY_GALLERY_ID::QQ(array($name));
$content = '';
while($entry = $gallery->next()){

View File

@ -1,26 +1,26 @@
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5000, 42, 0, 0, 'saimod_webcraft_gallery', 'action', NULL);
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5000, 42, 0, 0, 'saimod_webcraft_gallery', 'action', NULL);
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5001, 42, 2, 5000, 'showgalleryitem', 'gallery', 'UINT0');
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5002, 42, 2, 5000, 'showgalleryitem', 'id', 'UINT0');
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5001, 42, 2, 5000, 'showgalleryitem', 'gallery', 'UINT0');
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5002, 42, 2, 5000, 'showgalleryitem', 'id', 'UINT0');
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5005, 42, 2, 5000, 'addgalleryitem', 'gallery', 'UINT0');
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5006, 42, 2, 5000, 'addgalleryitem', 'position', 'UINT0');
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5007, 42, 2, 5000, 'addgalleryitem', 'heading', 'STRING');
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5008, 42, 2, 5000, 'addgalleryitem', 'description', 'STRING');
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5009, 42, 2, 5000, 'addgalleryitem', 'file_cat', 'STRING');
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5010, 42, 2, 5000, 'addgalleryitem', 'file_id', 'STRING');
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5005, 42, 2, 5000, 'addgalleryitem', 'gallery', 'UINT0');
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5006, 42, 2, 5000, 'addgalleryitem', 'position', 'UINT0');
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5007, 42, 2, 5000, 'addgalleryitem', 'heading', 'STRING');
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5008, 42, 2, 5000, 'addgalleryitem', 'description', 'STRING');
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5009, 42, 2, 5000, 'addgalleryitem', 'file_cat', 'STRING');
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5010, 42, 2, 5000, 'addgalleryitem', 'file_id', 'STRING');
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5015, 42, 2, 5000, 'delgalleryitem', 'id', 'UINT0');
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5015, 42, 2, 5000, 'delgalleryitem', 'id', 'UINT0');
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5020, 42, 2, 5000, 'select_options_id', 'cat', 'STRING');
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5021, 42, 3, 5000, 'select_options_id', 'id', 'STRING');
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5020, 42, 2, 5000, 'select_options_id', 'cat', 'STRING');
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5021, 42, 3, 5000, 'select_options_id', 'id', 'STRING');
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5025, 42, 2, 5000, 'chggalleryitem', 'id', 'UINT0');
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5026, 42, 2, 5000, 'chggalleryitem', 'gallery', 'UINT0');
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5027, 42, 2, 5000, 'chggalleryitem', 'position', 'UINT0');
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5028, 42, 2, 5000, 'chggalleryitem', 'heading', 'STRING');
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5029, 42, 2, 5000, 'chggalleryitem', 'description', 'STRING');
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5030, 42, 2, 5000, 'chggalleryitem', 'file_cat', 'STRING');
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5031, 42, 2, 5000, 'chggalleryitem', 'file_id', 'STRING');
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5025, 42, 2, 5000, 'chggalleryitem', 'id', 'UINT0');
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5026, 42, 2, 5000, 'chggalleryitem', 'gallery', 'UINT0');
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5027, 42, 2, 5000, 'chggalleryitem', 'position', 'UINT0');
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5028, 42, 2, 5000, 'chggalleryitem', 'heading', 'STRING');
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5029, 42, 2, 5000, 'chggalleryitem', 'description', 'STRING');
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5030, 42, 2, 5000, 'chggalleryitem', 'file_cat', 'STRING');
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5031, 42, 2, 5000, 'chggalleryitem', 'file_id', 'STRING');
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5035, 42, 2, 5000, 'tab', 'name', 'UINT0');
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5035, 42, 3, 5000, 'tab', 'name', 'UINT0');

View File

@ -1 +1,2 @@
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (1300, 42, 'gallery', 'gallery', -1, 0, 0, '#content', './sai.php?sai_mod=saimod_webcraft_gallery', 'init_saimod_webcraft_gallery', 'saimod_webcraft_gallery');
REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (1300, 42, 'gallery', 'gallery', -1, 0, 0, '#content', './sai.php?sai_mod=saimod_webcraft_gallery', 'init_saimod_webcraft_gallery', 'saimod_webcraft_gallery');
REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (1301, 42, 'tab', 'gallery', 1300, 0, 0, '#tab_gallery', './sai.php?sai_mod=saimod_webcraft_gallery&action=tab&name=${name}', 'init_saimod_webcraft_gallery', 'saimod_webcraft_gallery');

View File

@ -24,7 +24,7 @@
</td>
</tr>
</table>
<img id="img_preview" src="./api.php?call=files&cat=&id="/>
<img id="img_preview" src="./api.php?call=files&cat=&id=" style="max-width: 100%"/>
</br>
</br>
<input type="button" class="btn btn-success" id="btn_add" value="Add"/>

View File

@ -29,7 +29,7 @@
</td>
</tr>
</table>
<img id="img_preview" src="./api.php?call=files&cat=${file_cat}&id=${file_id}"/>
<img id="img_preview" src="./api.php?call=files&cat=${file_cat}&id=${file_id}" style="max-width: 100%"/>
</br>
</br>
<input type="button" class="btn btn-success" id="btn_chg" galleryid="${ID}"value="Change"/>

View File

@ -17,4 +17,5 @@
<th>File</th>
</tr>
${content}
</table>
</table>
<input type="button" class="btn btn-success galleryadd" value="Add"/>

View File

@ -1 +1 @@
<li class="${active}"><a href="#tab_gallery" gallery="${gallery}">Gallery ${gallery}</a></li>
<li class="nav-item"><a class="nav-link ${active}" href="#!gallery;name.${gallery}">Gallery ${gallery}</a></li>

View File

@ -1,11 +1,11 @@
<h4>Gallery</h4>
<hr>
<div class="tabbable">
<ul class="nav nav-tabs" id="gallerytab">
${tabopts}
<input type="button" class="btn btn-success galleryadd" value="Add"/>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tab_gallery">${firsttab}</div>
<div class="row">
<div class="col-12 sai_padding_10 bg-primary">
<h4 class="sai_margin_off">&nbsp;<span class="fas fa-image" aria-hidden="true"></span>&nbsp;&nbsp;Gallery</h4>
</div>
<div class="col-md-2 sai_padding_off">
<ul class="nav bg-light flex-column" id="tabs_gallery">
${tabopts}
</ul>
</div>
<div class="col-md-10 sai_padding_off sai_border_left" id="tab_gallery"></div>
</div>