Index: trunk/CHANGELOG
===================================================================
--- trunk/CHANGELOG	(revision 676)
+++ trunk/CHANGELOG	(revision 677)
@@ -10,7 +10,9 @@
 # = Bugfix
 ! = Update/Change
 
-------------------------------------- 2.7.0 -------------------------------------
+------------------------------------- 2.7.0 -------------------------------------
+09-Feb-2008
+!	jsadmin: added latest changes from swen, fixes most (or all?) issues.
 08-Feb-2008 Matthias Gallas
 +	added kewyword id to all new files
 08-Feb-2008 Christian Sommer
Index: trunk/wb/modules/jsadmin/uninstall.php
===================================================================
--- trunk/wb/modules/jsadmin/uninstall.php	(revision 676)
+++ trunk/wb/modules/jsadmin/uninstall.php	(revision 677)
@@ -32,14 +32,6 @@
 // prevent this file from being accessed directly
 if(!defined('WB_PATH')) { exit('Cannot access this file directly'); }
 
-// delete the rows from the addons table
-$table = TABLE_PREFIX .'addons';
-$database->query("DELETE FROM `".$table."` WHERE `".$table."`.`name` ='Javascript Admin' LIMIT 1 ");
-
-// delete the rows from the settings table
-$table = TABLE_PREFIX .'settings';
-$database->query("DELETE FROM `".$table."` WHERE `".$table."`.`name` ='mod_jsadmin_persist_order' LIMIT 1 ");
-$database->query("DELETE FROM `".$table."` WHERE `".$table."`.`name` ='mod_jsadmin_ajax_order_pages' LIMIT 1 ");
-$database->query("DELETE FROM `".$table."` WHERE `".$table."`.`name` ='mod_jsadmin_ajax_order_sections' LIMIT 1 ");
-
+$table = TABLE_PREFIX ."mod_jsadmin";
+$database->query("DROP TABLE `$table`");
 ?>
\ No newline at end of file
Index: trunk/wb/modules/jsadmin/info.php
===================================================================
--- trunk/wb/modules/jsadmin/info.php	(revision 676)
+++ trunk/wb/modules/jsadmin/info.php	(revision 677)
@@ -65,8 +65,8 @@
 $module_directory 		= 'jsadmin';
 $module_name 				= 'Javascript Admin';
 $module_function 			= 'tool';
-$module_version 			= '1.2';
-$module_platform 			= '2.7';
+$module_version 			= '1.2.1';
+$module_platform 			= 'WB 2.7.x';
 $module_author 			= 'Stepan Riha, Swen Uth';
 $module_license 			= 'BSD License';
 $module_description 		= 'This module adds Javascript functionality to the Website Baker Admin to improve some of the UI interactions. Uses the YahooUI library.';
Index: trunk/wb/modules/jsadmin/jsadmin_backend_include.php
===================================================================
--- trunk/wb/modules/jsadmin/jsadmin_backend_include.php	(revision 676)
+++ trunk/wb/modules/jsadmin/jsadmin_backend_include.php	(revision 677)
@@ -66,7 +66,9 @@
 	} elseif($page_type == 'sections') {
 		if(get_setting('mod_jsadmin_ajax_order_sections', '1')) {
 			$js_scripts[] = 'dragdrop.js';
-			$js_buttonCell= 4; // This ist the Cell where the Button "Up" is , by Swen Uth
+			if(SECTION_BLOCKS) {
+			$js_buttonCell= 4;}
+      else{ $js_buttonCell= 3;} // This ist the Cell where the Button "Up" is , by Swen Uth
 		}
 	} elseif($page_type == 'config') {
 		$js_scripts[] = 'tool.js';
Index: trunk/wb/modules/jsadmin/jsadmin.php
===================================================================
--- trunk/wb/modules/jsadmin/jsadmin.php	(revision 676)
+++ trunk/wb/modules/jsadmin/jsadmin.php	(revision 677)
@@ -31,7 +31,7 @@
 
 function get_setting($name, $default = '') {
 	global $database;
-	$rs = $database->query("SELECT value FROM ".TABLE_PREFIX."settings WHERE name = '".$name."'");
+	$rs = $database->query("SELECT value FROM ".TABLE_PREFIX."mod_jsadmin WHERE name = '".$name."'");
 	if($row = $rs->fetchRow())
 		return $row['value'];
 	return
@@ -44,9 +44,9 @@
 	$prev_value = get_setting($name, false);
 
 	if($prev_value === false) {
-		$database->query("INSERT INTO ".TABLE_PREFIX."settings (name,value) VALUES ('$name','$value')");
+		$database->query("INSERT INTO ".TABLE_PREFIX."mod_jsadmin (name,value) VALUES ('$name','$value')");
 	} else {
-		$database->query("UPDATE ".TABLE_PREFIX."settings SET value = '$value' WHERE name = '$name'");
+		$database->query("UPDATE ".TABLE_PREFIX."mod_jsadmin SET value = '$value' WHERE name = '$name'");
 	}
 }
 
Index: trunk/wb/modules/jsadmin/install.php
===================================================================
--- trunk/wb/modules/jsadmin/install.php	(revision 676)
+++ trunk/wb/modules/jsadmin/install.php	(revision 677)
@@ -33,9 +33,22 @@
 if(!defined('WB_PATH')) { exit('Cannot access this file directly'); }
 
 // add new rows to table "settings"
+
+$table = TABLE_PREFIX ."mod_jsadmin";
+$database->query("DROP TABLE IF EXISTS `$table`");
+
+$database->query("
+	CREATE TABLE `$table` (
+    `id` INT(11) NOT NULL DEFAULT '0',
+		`name` VARCHAR(255) NOT NULL DEFAULT '0',
+		`value` INT(11) NOT NULL DEFAULT '0',
+   	PRIMARY KEY (`id`)
+	)
+");
+
 global $database;
-$database->query("INSERT INTO ".TABLE_PREFIX."settings (name,value) VALUES ('mod_jsadmin_persist_order','0')");
-$database->query("INSERT INTO ".TABLE_PREFIX."settings (name,value) VALUES ('mod_jsadmin_ajax_order_pages','0')");
-$database->query("INSERT INTO ".TABLE_PREFIX."settings (name,value) VALUES ('mod_jsadmin_ajax_order_sections','0')");
+$database->query("INSERT INTO ".$table." (id,name,value) VALUES ('1','mod_jsadmin_persist_order','0')");
+$database->query("INSERT INTO ".$table." (id,name,value) VALUES ('2','mod_jsadmin_ajax_order_pages','0')");
+$database->query("INSERT INTO ".$table." (id,name,value) VALUES ('3','mod_jsadmin_ajax_order_sections','0')");
 
 ?>
\ No newline at end of file
Index: trunk/wb/modules/jsadmin/move_to.php
===================================================================
--- trunk/wb/modules/jsadmin/move_to.php	(revision 676)
+++ trunk/wb/modules/jsadmin/move_to.php	(revision 677)
@@ -29,9 +29,11 @@
 
 */
 
+// prevent this file from being accessed directly
+if(!defined('WB_PATH')) { exit('Cannot access this file directly'); }
 require('../../config.php');
 
-if(isset($_GET['page_id']) AND is_numeric($_GET['page_id']) AND is_numeric(@$_GET['position'])) {
+ if(isset($_GET['page_id']) AND is_numeric($_GET['page_id']) AND is_numeric(@$_GET['position'])) {
 	$position = $_GET['position'];
 
 	// Get common fields
