diff --git a/js/saimod_webcraft_gallery.js b/js/saimod_webcraft_gallery.js
index 5dfd867..7b2f7b7 100644
--- a/js/saimod_webcraft_gallery.js
+++ b/js/saimod_webcraft_gallery.js
@@ -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();
}
diff --git a/saimod_webcraft_gallery.php b/saimod_webcraft_gallery.php
index 3d02e34..0728ded 100644
--- a/saimod_webcraft_gallery.php
+++ b/saimod_webcraft_gallery.php
@@ -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()){
diff --git a/sql/mysql/saimod_webcraft_gallery.sql b/sql/mysql/saimod_webcraft_gallery.sql
index e1d822a..82927cc 100644
--- a/sql/mysql/saimod_webcraft_gallery.sql
+++ b/sql/mysql/saimod_webcraft_gallery.sql
@@ -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');
\ No newline at end of file
+REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5035, 42, 3, 5000, 'tab', 'name', 'UINT0');
\ No newline at end of file
diff --git a/sql/mysql/saimod_webcraft_gallery_page.sql b/sql/mysql/saimod_webcraft_gallery_page.sql
index 132045d..0b47a12 100644
--- a/sql/mysql/saimod_webcraft_gallery_page.sql
+++ b/sql/mysql/saimod_webcraft_gallery_page.sql
@@ -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');
\ No newline at end of file
+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');
\ No newline at end of file
diff --git a/tpl/saimod_webcraft_gallery_add.tpl b/tpl/saimod_webcraft_gallery_add.tpl
index 6b4106f..7224bf7 100644
--- a/tpl/saimod_webcraft_gallery_add.tpl
+++ b/tpl/saimod_webcraft_gallery_add.tpl
@@ -24,7 +24,7 @@
-
+
diff --git a/tpl/saimod_webcraft_gallery_show.tpl b/tpl/saimod_webcraft_gallery_show.tpl
index 3a47b86..7724bb6 100644
--- a/tpl/saimod_webcraft_gallery_show.tpl
+++ b/tpl/saimod_webcraft_gallery_show.tpl
@@ -29,7 +29,7 @@
-
+
diff --git a/tpl/saimod_webcraft_gallery_tab.tpl b/tpl/saimod_webcraft_gallery_tab.tpl
index 19bc671..1e7f895 100644
--- a/tpl/saimod_webcraft_gallery_tab.tpl
+++ b/tpl/saimod_webcraft_gallery_tab.tpl
@@ -17,4 +17,5 @@