[interchange-cvs] interchange - heins modified 2 files

interchange-core@icdevgroup.org interchange-core@icdevgroup.org
Sat Aug 3 02:01:02 2002


User:      heins
Date:      2002-08-03 06:00:16 GMT
Modified:  dist/lib/UI/pages/admin menu_editor.html
Modified:  dist/lib/UI/pages/include/menus Quicklinks.txt
Log:
* Continuing evolution of menu editor.

* If you have already tested with other menus and saved them, they
  will be wrong. Add &remap=3D1 to the load URL and try again to
  partially recover.

* More coming.

Revision  Changes    Path
2.2       +271 -185  interchange/dist/lib/UI/pages/admin/menu_editor.html


rev 2.2, prev_rev 2.1
Index: menu_editor.html
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /anon_cvs/repository/interchange/dist/lib/UI/pages/admin/menu_edi=
tor.html,v
retrieving revision 2.1
retrieving revision 2.2
diff -u -r2.1 -r2.2
--- menu_editor.html	2 Aug 2002 06:14:33 -0000	2.1
+++ menu_editor.html	3 Aug 2002 06:00:16 -0000	2.2
@@ -22,6 +22,11 @@
=20
 	$Tag->tmp('qmenu_fdata');
 	$Tag->tmp('qmenu_data');
+	%menuinit =3D (
+				code =3D> 0,
+				inactive =3D> 0,
+				msort =3D> "'x'",
+				);
=20
 	if($CGI->{qmenu_text}) {
 		my $menufile;
@@ -46,31 +51,34 @@
 			$text =3D~ s/\r\n/\n/g;
 			$Tag->backup_file($menufile);
 			if($Tag->write_relative_file($menufile, $text) ) {
-				$Scratch->{qmessage} =3D errmsg(
-											"Menu '%s' saved to file %s.",
-											$menuname,
-											$menufile,
-										);
+				$Tag->warnings( errmsg(
+									"Menu '%s' saved to file %s.",
+									$menuname,
+									$menufile,
+								));
 			}
 			else {
-				$Scratch->{qmessage} =3D errmsg(
-											"Failed to save menu '%s' to file %s.",
-											$Tag->filter('unescape', $menuname),
-											$menufile,
-										);
+				$Tag->error({ name =3D> 'Save menu',
+							  set =3D> errmsg(
+										"Failed to save menu '%s' to file %s.",
+										$Tag->filter('unescape', $menuname),
+										$menufile,
+									),
+								});
 			}
 			my $tab =3D $Variable->{MV_TREE_TABLE} || 'tree';
 			if($CGI->{qmenu_tree} && $CGI->{qmenu_write_tree} and $Db{$tab}) {
 			  TREEWRITE: {
 				my $db =3D $Db{$tab}
 					or do {
-						$Scratch->{qerror} .=3D "<br>" if $Scratch->{qerror};
-						$Scratch->{qerror} .=3D errmsg(
-												"%s database %s for tree write: %s",
-												'open',
-												$tab,
-												'non-existent',
-											);
+						$Tag->error({
+								set =3D>  errmsg(
+											"%s database %s for tree write: %s",
+											'open',
+											$tab,
+											'non-existent',
+										),
+								});
 						last TREEWRITE;
=20
 					};
@@ -117,11 +125,18 @@
 #Debug("values to set: " . uneval(\@row));
 					$parent[$lev + 1] =3D $key;
 				}
+				$Tag->warnings( errmsg(
+									"Successfully wrote %s lines to tree %s.",
+									scalar(@lines),
+									$menuname,
+								) );
 			  }
 			}
 		}
 		else {
-			$Scratch->{qmessage} =3D "No menu name to write.";
+			$Tag->error({	name =3D> 'qmenu_name/qmenu_new',
+							set =3D> "No menu name to write.",
+						});
 		}
 	}
 	elsif ($CGI->{qmenu_products}) {
@@ -129,22 +144,22 @@
 			my $tab =3D $CGI->{qmenu_products};
 			my $db =3D $Db{$tab}
 				or do {
-					$Scratch->{qerror} .=3D '<br>' if $Scratch->{qerror};
-					$Scratch->{qerror} .=3D errmsg(
-								"Failed to open products table %s.",
-								$tab,
-								);
+					$Tag->error({ set =3D> errmsg(
+										"Failed to open products table %s.",
+										$tab,
+										),
+									});
 					last PRODBUILD;
 				};
 #Debug("LARGE=3D" . $db->config('LARGE'));
 			if(! $CGI->{qmenu_even_large} and $db->config('LARGE')) {
-				$Scratch->{qerror} .=3D "<br>" if $Scratch->{qerror};
-				$Scratch->{qerror} .=3D errmsg(
+				$Tag->error({ set =3D> errmsg(
 										"%s database %s for tree write: %s",
 										'check',
 										$tab,
 										'too large, must override',
-									);
+									),
+								});
 				last PRODBUILD;
 			}
 			my @somefields =3D qw/mgroup page name description/;
@@ -155,11 +170,12 @@
 						};
 			my $ary =3D $db->query($q)
 							or do {
-								$Scratch->{qerror} .=3D '<br>' if $Scratch->{qerror};
-								$Scratch->{qerror} .=3D errmsg(
-									"No results from products table %s.",
-									$tab,
-								);
+								$Tag->error({
+										set =3D> errmsg(
+											"No results from products table %s.",
+											$tab,
+										),
+									});
 					last PRODBUILD;
 				};
 			my $prev_area =3D '';
@@ -168,11 +184,6 @@
 			my @rows;
 			my $base_search =3D "scan/co=3Dyes/fi=3D$tab";
=20=09=09=09=09
-			my %init =3D (
-						code =3D> 0,
-						inactive =3D> 0,
-						msort =3D> 0,
-						);
=20
 			for(@$ary) {
 				my($sku, $area, $cat, $desc) =3D @$_;
@@ -190,8 +201,8 @@
 								"tf=3Dcategory,description",
 								;
 					push @rows, {
-							%init,
-							mgroup =3D> 0,
+							%menuinit,
+							msort =3D> 0,
 							page	=3D> $url,
 							inactive =3D> 0,
 							name =3D> $area,
@@ -211,16 +222,16 @@
 								;
=20
 					push @rows, {
-							%init,
-							mgroup =3D> 1,
+							%menuinit,
+							msort =3D> 1,
 							page	=3D> $url,
 							inactive =3D> 0,
 							name =3D> $cat,
 							};
 				}
 				push @rows, {
-					%init,
-					mgroup =3D> 2,
+					%menuinit,
+					msort =3D> 2,
 					name =3D> $desc,
 					inactive =3D> 0,
 					page =3D> $sku,
@@ -302,6 +313,47 @@
 		$Scratch->{qmenu_data} =3D $filedata;
 		$Scratch->{qmenu_name} =3D $mn;
 	}
+
+	my %illegal;
+	my @illegal  =3D qw/check msg code/;
+	my %required;
+	my %suggested =3D qw/
+                        extended 1
+                        inactive 1
+					/;
+	my @required =3D qw/
+                        description
+                        form
+                        mgroup
+                        msort
+                        name
+                        page
+					/;
+	@required{@required} =3D @required;
+	@illegal{@illegal} =3D @illegal;
+	my $illegal =3D 0;
+	for(my $i =3D 1; $i < @menufields; $i++) {
+		my $f =3D lc $menufields[$i];
+		$menu_fh{$f} =3D $i;
+		delete $required{$f};
+		delete $suggested{$f};
+		if($illegal{$f}) {
+			$Tag->error({
+						name =3D> 'Illegal field name',
+						set =3D> errmsg( "Name reserved: %s.", $f),
+					});
+			$illegal++;
+		}
+	}
+	@required =3D keys %required;
+	@suggested =3D keys %suggested;
+	for(@required) {
+			$Tag->error({
+						set =3D> errmsg( "Required field '%s' missing.", $_),
+					});
+			$illegal++;
+	}
+	delete $Scratch->{qmenu_data} if $illegal;
 	return;
 [/perl]
=20
@@ -326,19 +378,13 @@
 [/if]
 	</td>
 	<td width=3D"40%">
-	[if scratch qmessage]
-		<span class=3Dcmessage>[scratchd qmessage]</span>
-		<br>
-	[/if]
-	[if scratch qerror]
-		<span class=3Dcerror>[scratchd qerror]</span>
-		<br>
-	[/if]
-		<br>
-		[page href=3D"__UI_BASE__/file_transfer"
-				form=3D"
-					initial_dir=3Dinclude/menus
-				"]Delete/Manage files</A>
+	[page href=3D"__UI_BASE__/file_transfer"
+			form=3D"
+				initial_dir=3Dinclude/menus
+			"]Delete/Manage files</A>
+	<br>
+	<span class=3Dcmessage>[warnings auto=3D1]</span>
+	[error all=3D1 text=3D"<ul class=3Dcerror><li>%s</ul>" joiner=3D"<li>"]
 	</td>
 	<td width=3D"30%">
 		<form action=3D"[process href=3D@@MV_PAGE@@]">
@@ -369,7 +415,11 @@
 [calc]
 	my @out;
 	for(my $i =3D 1; $i < @menufields; $i++) {
-		push @out, "	\U$menufields[$i]\E =3D $i;";
+		push @out, "    var \U$menufields[$i]\E =3D $i;";
+	}
+
+	for (@suggested) {
+		push @out, "    var \U$_;";
 	}
=20
 	$i =3D scalar(@menufields);
@@ -391,6 +441,13 @@
 		push @$row, '';
 	}
=20
+	if($CGI->{remap}) {
+		my $tmp =3D $row->[$menu_fh{mgroup}];
+		$row->[$menu_fh{mgroup}] =3D $row->[$menu_fh{msort}];
+		$row->[$menu_fh{msort}] =3D $tmp;
+	}
+
+	my $i =3D 0;
 	for(@$row) {
 		my $foundit =3D '';
 		if($_ eq '0') {
@@ -399,6 +456,9 @@
 		elsif(/^[1-9](\d*\.)?\d*$/) {
 			# Do nothing
 		}
+		elsif(! length($_) and exists $menuinit{$menufields[$i]}) {
+			$_ =3D $menuinit{$menufields[$i]};
+		}
 		elsif($_ !~ /'/) {
 			s/\r/\\r/g;
 			$_ =3D "'$_'";
@@ -422,6 +482,7 @@
 			}
 			$_ =3D qq{'$_'};
 		}
+		$i++;
 	}
 	my $line =3D "$loopname\[" . $loopinc  . "] =3D [" . join(", ", @$row) . =
"];";
 #Debug("Final line=3D$line");
@@ -443,6 +504,7 @@
=20
 	var is_form_changed =3D 0;
 	var checkcur =3D 0;
+	var form;
=20
 	function form_changed (is) {
 		if(is =3D=3D undefined)=20
@@ -455,7 +517,6 @@
=20
 	function check_change (wid) {
=20
-		var form =3D document.qmenuform;
 		form.cancelsubmit.value =3D wid =3D=3D undefined ? 0 : 1;
=20
 		if(form_changed() =3D=3D 0) {
@@ -597,6 +658,25 @@
 	var page_rep =3D '';
 	var params_rep =3D '';
 	var name_rep =3D '';
+	var showlevel =3D 1;
+=09
+	function toggleShowlevel () {
+	    if(showlevel !=3D 1) {
+			showlevel =3D 1;
+		}
+		else {
+			showlevel =3D 0;
+		}
+
+		if(tree_mode =3D=3D 1) {
+			for(var i =3D 1; i < lines.length; i++)
+				rewrite_tree(i);
+		}
+		else {
+			showlevel =3D 0;
+		}
+		form.showlevel.checked =3D showlevel;
+	}
=20=09
 	function toggleName (form,val) {
 		if(val !=3D undefined) {
@@ -660,7 +740,6 @@
 	}
=20
 	function find_extended () {
-		var form =3D document.qmenuform;
 		var el;
 		extended =3D new Array;
 		emodes =3D new Array;
@@ -702,12 +781,14 @@
 // alert("change mode, el=3D" + el);
 		if(mode =3D=3D 'tree') {
 			tree_mode =3D 1;
+			lines[1][MSORT] =3D 0;
 			el.value =3D "Set simple mode";
 			ch.checked =3D 1;
 			tel.style.visibility =3D 'Visible';
 		}
 		else {
 			tree_mode =3D 0;
+			lines[1][MSORT] =3D 'x';
 			el.value =3D "Set tree mode";
 			ch.checked =3D 0;
 			tel.style.visibility =3D 'Hidden';
@@ -716,6 +797,7 @@
 		for(i =3D 1; i < lines.length; i++) {
 			rewrite(i);
 		}
+		setOutput();
 		return;
 	}
=20
@@ -734,10 +816,10 @@
 				out =3D out + 'src=3D"__UI_IMG__box_empty.gif" ';
 			}
=20
-			var grp =3D l[MGROUP] + '';
+			var grp =3D l[MSORT] + '';
 // alert("rewrite grp=3D" + grp);
 			if(! grp.match(/^\d+$/) ) {
-				l[MGROUP] =3D 0;
+				l[MSORT] =3D 0;
 			}
 			out =3D out + 'border=3D0 align=3Dabsbottom ' +
 					'id=3D"img' + idx + '"></A>' + "\n" +
@@ -747,10 +829,10 @@
 					'"><img src=3D"__UI_IMG__right.gif" border=3D0 align=3Dabsbottom></A>=
' + "\n" +
 					'<a href=3D"javascript:loadForm(' + idx + ");void(0)" +
 					'"><img src=3D"/icons/small/forward.gif" border=3D0 align=3Dabsbottom=
></A>' + "\n";
-			for(i =3D 0; i < l[MGROUP]; i++)
+			for(i =3D 0; i < l[MSORT]; i++)
 				out =3D out + '&nbsp;&nbsp;&nbsp;';=20
-			if(l[MGROUP] > 0) {
-				out =3D out + l[MGROUP] + '&nbsp;'
+			if(showlevel =3D=3D 1 && l[MSORT] > 0) {
+				out =3D out + l[MSORT] + '&nbsp;'
 			}
 			if(l[PAGE]) {
 				var i;
@@ -877,10 +959,16 @@
 		var last =3D len - 2;
=20
 		if(tree_mode =3D=3D 1) {
-			var save =3D no_alert;
-			no_alert =3D 1;
-			motion(idx, 'left');
-			no_alert =3D save;
+			var d =3D lines[idx + 1];
+			if(l[MSORT] =3D=3D 0 && d !=3D undefined && d[MSORT] > 0) {
+				motion(idx + 1, 'left');
+			}
+			else {
+				var save =3D no_alert;
+				no_alert =3D 1;
+				motion(idx, 'left');
+				no_alert =3D save;
+			}
 		}
=20
 		for( i =3D idx; i <=3D last; i++) {
@@ -901,7 +989,6 @@
 		if( ! check_change() )
 			return;
=20
-		var form =3D document.qmenuform;
 		if(idx =3D=3D undefined || idx < 1) {
 			idx =3D checkcur;
 			if (idx > 0)
@@ -931,10 +1018,10 @@
=20
 		if(tree_mode =3D=3D 1) {
 			if(lines[idx - 1] !=3D undefined) {
-				lines[idx][MGROUP] =3D lines[idx-1][MGROUP];
+				lines[idx][MSORT] =3D lines[idx-1][MSORT];
 			}
 			else {
-				lines[idx][MGROUP] =3D 0;
+				lines[idx][MSORT] =3D 0;
 			}
 		}
=20
@@ -965,8 +1052,6 @@
 		if( ! check_change() )
 			return;
=20
-		var form =3D document.qmenuform;
-
 		if(idx =3D=3D undefined || idx <=3D 0) {
 			idx =3D checkcur;
 			if (idx <=3D 0) return;
@@ -974,70 +1059,70 @@
 		}
=20
 		if(msg =3D=3D undefined)
-			msg =3D 'loaded';
-
+			msg =3D 'loaded';=20
+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20
 		if(zeromsg =3D=3D undefined)
 			zeromsg =3D 'loaded';
=20
 		var l =3D lines[idx];
 		// alert("idx=3D" + idx + "\nl=3D" + l + "\nform=3D" + form);
=20
-		page_rep =3D form.page.value =3D l[PAGE];
-		params_rep =3D form.params.value =3D unescapeParams(l[FORM]);
-		name_rep =3D form.name.value =3D l[NAME];
-		form.description.value =3D l[DESCRIPTION];
-		form.extended.value =3D l[EXTENDED];
+		form.name.value      =3D name_rep   =3D l[NAME];
+		form.page.value      =3D page_rep   =3D l[PAGE];
+		form.params.value    =3D params_rep =3D unescapeParams(l[FORM]);
+		form.description.value            =3D l[DESCRIPTION];
+		form.mgroup.value                 =3D l[MGROUP];
=20
-		if(extended.length > 0) {
-			var j;
-			var hash =3D l[EXTENDED];
-			if(hash =3D=3D undefined || ! hash.match(/=3D>/)) {
-				hash =3D '[]';
-			}
-			else {
-				hash =3D hash.replace(/^{\s*/, '[');
-				hash =3D hash.replace(/,?\s*}\s*$/, ']');
-				// hash =3D hash.replace(/\\'/g, "-_ESC_QUOTE_-");
-				hash =3D hash.replace(/\s*(\w+)\s+=3D>\s+/g, "  '$1', ");
-				hash =3D hash.replace(/\s=3D>\s/g, ", ");
-				hash =3D hash.replace(/\r/g, "\\r");
-			}
-			var ary =3D eval(hash);
-			for(j =3D 0; j < extended.length; j++) {
-				var el =3D extended[j];
-				var nm =3D extended_name(el.name);
+		if( EXTENDED !=3D undefined ) {
+			form.extended.value =3D l[EXTENDED];
=20
-				if(nm =3D=3D '')
-					continue;
-				var val;
-				for(j =3D 0; j < ary.length; j =3D j + 2) {
-					if( ary[j] =3D=3D nm ) {
-						val =3D ary[j + 1];
-						break;
-					}
+			if(extended.length > 0) {
+				var j;
+				var hash =3D l[EXTENDED];
+				if(hash =3D=3D undefined || ! hash.match(/=3D>/)) {
+					hash =3D '[]';
+				}
+				else {
+					hash =3D hash.replace(/^{\s*/, '[');
+					hash =3D hash.replace(/,?\s*}\s*$/, ']');
+					// hash =3D hash.replace(/\\'/g, "-_ESC_QUOTE_-");
+					hash =3D hash.replace(/\s*(\w+)\s+=3D>\s+/g, "  '$1', ");
+					hash =3D hash.replace(/\s=3D>\s/g, ", ");
+					hash =3D hash.replace(/\r/g, "\\r");
 				}
+				var ary =3D eval(hash);
+				for(j =3D 0; j < extended.length; j++) {
+					var el =3D extended[j];
+					var nm =3D extended_name(el.name);
+
+					if(nm =3D=3D '')
+						continue;
+					var val;
+					for(j =3D 0; j < ary.length; j =3D j + 2) {
+						if( ary[j] =3D=3D nm ) {
+							val =3D ary[j + 1];
+							break;
+						}
+					}
=20
-				if(val =3D=3D undefined)
-					val =3D '';
+					if(val =3D=3D undefined)
+						val =3D '';
=20
-				if(el.type =3D=3D 'select') {
-					for(j =3D 0; j < el.length; j++) {
-						if(val =3D=3D el.options[j].value) {
-							el.selectedIndex =3D j;
-							break;
+					if(el.type =3D=3D 'select') {
+						for(j =3D 0; j < el.length; j++) {
+							if(val =3D=3D el.options[j].value) {
+								el.selectedIndex =3D j;
+								break;
+							}
 						}
 					}
-				}
-				else {
-					el.value =3D val;
+					else {
+						el.value =3D val;
+					}
 				}
 			}
 		}
=20
-		form.full.disabled =3D tree_mode;
-		if(tree_mode !=3D 1) {
-			form.full.checked =3D l[MGROUP] !=3D '' ? 1 : 0;
-		}
 		if(INACTIVE !=3D undefined) {
 			form.inactive.disabled =3D 0;
 			form.inactive.checked =3D l[INACTIVE] =3D=3D 1 ? 1 : 0;
@@ -1081,14 +1166,14 @@
 		form.params.value =3D '';
 		form.name.value =3D '';
 		form.description.value =3D '';
-		form.extended.value =3D '';
+		form.mgroup.value =3D '';
+		if(EXTENDED !=3D undefined)
+			form.extended.value =3D '';
=20
-		form.full.checked =3D 0;
-		form.full.disabled =3D tree_mode;
 		form.breakline.checked =3D 0;
 		form.label.checked =3D 0;
 		form.lineidx.value =3D 0;
-=09=09
+
 		if(extended.length > 0) {
 			for(j =3D 0; j < extended.length; j++) {
 				var el =3D extended[j];
@@ -1111,8 +1196,6 @@
=20
 	function saveForm (idx, msg, zeromsg) {
=20
-		var form =3D document.qmenuform;
-
 		if(idx =3D=3D undefined || idx < 1)
 			idx =3D form.lineidx.value;
=20
@@ -1134,44 +1217,38 @@
 		l[PAGE] =3D form.page.value;
 		l[FORM] =3D escapeParams(form.params.value);
 		l[NAME] =3D form.name.value;
+		l[MGROUP] =3D form.mgroup.value;
=20
 		var ttt =3D form.description.value;
 		ttt =3D ttt.replace(/\r\n/g, "\r");
 		l[DESCRIPTION] =3D ttt.replace(/\n/g, "\r");
=20
-		if(extended.length > 0) {
-			ttt =3D "{\r";
-			var j;
-			for(j =3D 0; j < extended.length; j++) {
-				var el =3D extended[j];
-				var nm =3D extended_name(el.name);
-				if(nm =3D=3D '')
-					continue;
-				var val;
-				if(el.type =3D=3D 'select') {
-					val =3D el.options[el.selectedIndex].value;
-				}
-				else {
-					val =3D el.value;
+		if(EXTENDED !=3D undefined) {
+			if(extended.length > 0) {
+				ttt =3D "{\r";
+				var j;
+				for(j =3D 0; j < extended.length; j++) {
+					var el =3D extended[j];
+					var nm =3D extended_name(el.name);
+					if(nm =3D=3D '')
+						continue;
+					var val;
+					if(el.type =3D=3D 'select') {
+						val =3D el.options[el.selectedIndex].value;
+					}
+					else {
+						val =3D el.value;
+					}
+					val =3D val.replace(/'/g, "\\'");
+					ttt =3D ttt + "  " + nm + " =3D> '" + val + "',\n";
 				}
-				val =3D val.replace(/'/g, "\\'");
-				ttt =3D ttt + "  " + nm + " =3D> '" + val + "',\n";
-			}
-			ttt =3D ttt + "}";
-		}
-		else {
-			ttt =3D form.extended.value;
-		}
-		ttt =3D ttt.replace(/\r\n/g, "\r");
-		l[EXTENDED] =3D ttt.replace(/\n/g, "\r");
-
-		if(tree_mode !=3D 1) {
-			if(form.full.checked) {
-				l[MGROUP] =3D 'full';
+				ttt =3D ttt + "}";
 			}
 			else {
-				l[MGROUP] =3D '';
+				ttt =3D form.extended.value;
 			}
+			ttt =3D ttt.replace(/\r\n/g, "\r");
+			l[EXTENDED] =3D ttt.replace(/\n/g, "\r");
 		}
=20
 		if(INACTIVE !=3D undefined) {
@@ -1205,7 +1282,6 @@
 			var ttt =3D "" + i;
 			while( ttt.length < 3 )
 				ttt =3D '0' + ttt;
-			lines[i][0] =3D lines[i][MSORT] =3D ttt;
 			var tl =3D new Array;
 			var j;
 			for( j =3D 0; j < linelen; j++) {
@@ -1214,7 +1290,8 @@
 					tl[j] =3D '';
 			}
 			tl[DESCRIPTION] =3D tl[DESCRIPTION].replace(/\r/g, "\\r");
-			tl[EXTENDED] =3D tl[EXTENDED].replace(/\r/g, "\\r");
+			if(EXTENDED !=3D undefined)=20
+				tl[EXTENDED] =3D tl[EXTENDED].replace(/\r/g, "\\r");
 			output[i] =3D tl.join("\t");
 		}
 		document.qmenuform.qmenu_text.value =3D output.join("\n") + "\n";
@@ -1276,42 +1353,42 @@
 			var l =3D lines[x];
 			var u =3D lines[up];
 			var d =3D lines[dn];
-			u[MGROUP] *=3D 1;
-			l[MGROUP] *=3D 1;
-			if(isNaN(u[MGROUP])) {
-				u[MGROUP] =3D 0;
+			u[MSORT] *=3D 1;
+			l[MSORT] *=3D 1;
+			if(isNaN(u[MSORT])) {
+				u[MSORT] =3D 0;
 			}
=20
-			if(isNaN(l[MGROUP])) {
-				l[MGROUP] =3D 0;
+			if(isNaN(l[MSORT])) {
+				l[MSORT] =3D 0;
 			}
=20
 			if(motion =3D=3D 'left') {
-				if(l[MGROUP] =3D=3D 0) {
+				if(l[MSORT] =3D=3D 0) {
 					if(x =3D=3D idx) {
 						do_alert("Already at top level.");
 						break;
 					}
 				}
 				else {
-					l[MGROUP] -=3D 1;
+					l[MSORT] -=3D 1;
 				}
-				while (x >=3D end && d !=3D undefined && d[MGROUP] - 1 > l[MGROUP]) {
-					d[MGROUP] -=3D 1;
+				while (x >=3D end && d !=3D undefined && d[MSORT] - 1 > l[MSORT]) {
+					d[MSORT] -=3D 1;
 					rewrite_tree(dn);
 					dn++;
 					d =3D lines[dn];
 				}
 			}
 			else {
-				if(l[MGROUP] > u[MGROUP]) {
+				if(l[MSORT] > u[MSORT]) {
 					if(x =3D=3D idx) {
 						do_alert("Already at farthest right, need parent at same level or hi=
gher.");
 						break;
 					}
 				}
 				else {
-					l[MGROUP] +=3D 1;
+					l[MSORT] +=3D 1;
 				}
 			}
 			dn++;
@@ -1425,7 +1502,7 @@
 		<div id=3Dtreebox>
 		<input type=3Dcheckbox name=3Dqmenu_tree value=3D1> Tree mode
 		<input type=3Dcheckbox name=3Dqmenu_write_tree value=3D1> Write tree to =
DB
-		<input type=3Dcheckbox name=3Dshowlevel value=3D1> Show numerical level
+		<input type=3Dcheckbox name=3Dshowlevel value=3D1 onClick=3D"toggleShowl=
evel()" CHECKED=3D1> Show numerical level
 		</div>
 <br>
 		<input type=3Dbutton
@@ -1501,9 +1578,9 @@
 				Options
 			</td>
 			<td class=3Dcdata>
-				<input name=3Dfull  type=3Dcheckbox value=3D1 onChange=3D"form_changed=
(1);">Only on full menu
+				Menu Group <input name=3Dmgroup  type=3Dtext onChange=3D"form_changed(=
1);">
 				&nbsp;&nbsp;
-				<input name=3Dinactive  type=3Dcheckbox value=3D1 onChange=3D"form_cha=
nged(1);" disabled=3D0>Inactive entry<br>
+				<input name=3Dinactive  type=3Dcheckbox value=3D1 onChange=3D"form_cha=
nged(1);">Inactive entry<br>
 				<input name=3Dlabel type=3Dcheckbox value=3D1 onChange=3D"form_changed=
(1);toggleName(this.form)">Label only<br>
 				<input name=3Dbreakline type=3Dcheckbox value=3D1 onChange=3D"form_cha=
nged(1);toggleBreak(this.form)">Break line
 			</td>
@@ -1538,25 +1615,13 @@
 				value=3D"Cancel">
 			</td>
 		</tr>
-		<tr>
-			<td class=3Dclabel>
-				Extended Parameters (advanced)
-			</td>
-			<td class=3Dcdata>
-				<textarea cols=3D50 rows=3D4 name=3Dextended onChange=3D"form_changed(=
1);"></textarea>
-			</td>
-		</tr>
-		</table>
-	</td>
-</tr>
-</table>
-</form>
 <script>
+		form =3D document.qmenuform;
 		var i ;
 		var tm =3D 1;
=20
 		for(i =3D 1; i < lines.length; i++) {
-			if( isNaN(lines[i][MGROUP] * 1)  ) {
+			if( isNaN(lines[i][MSORT] * 1)  ) {
 					tm=3D0;
 					break;
 			}
@@ -1574,9 +1639,30 @@
=20
 		set_checked_buttons();
 		set_save_buttons();
+		if(INACTIVE =3D=3D undefined) {
+			document.qmenuform.inactive.disabled =3D 1;
+		}
 		initialized =3D 1;
 		find_extended();
+		if(EXTENDED !=3D undefined) {
+			document.write("<tr>" +
+'			<td class=3Dclabel>' +
+'				Extended Parameters (advanced)' +
+'			</td>' +
+'			<td class=3Dcdata>' +
+'				<textarea cols=3D50 rows=3D4 name=3Dextended onChange=3D"form_changed=
(1);"></textarea>' +
+'			</td>' +
+'		</tr>');
+		}
+
 </script>
+		</table>
+	</td>
+</tr>
+</table>
+<a href=3D"javascript:document.qmenuform.inactive.disabled =3D 1; void(0)"=
>Disable</A>
+<a href=3D"javascript:document.qmenuform.inactive.disabled =3D 0; void(0)"=
>Enable</A>
+</form>
 <!-- ----- END REAL STUFF ----- -->
 @_UI_STD_FOOTER_@
 <!-- page: @@MV_PAGE@@ -->



1.2       +42 -42    interchange/dist/lib/UI/pages/include/menus/Quicklinks=
txt


rev 1.2, prev_rev 1.1
Index: Quicklinks.txt
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /anon_cvs/repository/interchange/dist/lib/UI/pages/include/menus/=
Quicklinks.txt,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Quicklinks.txt	2 Aug 2002 06:14:35 -0000	1.1
+++ Quicklinks.txt	3 Aug 2002 06:00:16 -0000	1.2
@@ -1,43 +1,43 @@
 code	mgroup	msort	inactive	page	form	name	description	extended
-001		001				Store Admin=09=09
-002		002		admin/order		Orders=09=09
-003	full	003		admin/entry		Order entry=09=09
-004		004=09=09=09=09=09=09
-005	full	005		admin/orderstats		Order stats=09=09
-006	full	006		admin/trafficstats		Traffic stats=09=09
-007	full	007		admin/affiliates		Affiliates=09=09
-008	full	008=09=09=09=09=09=09
-009		009		admin/item		Items=09=09
-010		010				<hr noshade size=3D1>=09=09
-011		011				Site Design=09=09
-012		012		admin/layout		Site Layout=09=09
-013		013		admin/page		Page Edit=09=09
-014		014		admin/regenerate		Generate static=09=09
-015		015		admin/build_related		Build related=09=09
-016		016		admin/search_wizard		Search Builder=09=09
-017		017		admin/button_builder		Button Builder=09=09
-018		018		admin/menu_editor		Menu Builder	Create and edit quick menus with=
 a graphical UI=09
-019		019				<hr noshade size=3D1>=09=09
-020		020				Technical Admin=09=09
-021		021		admin/tax		Tax=09=09
-022		022		admin/ship		Shipping=09=09
-023		023		admin/payment		Payment=09=09
-024		024=09=09=09=09=09=09
-025		025		admin/file_transfer		File transfer=09=09
-026		026		admin/auto_wizard		Wizard=09=09
-027		027=09=09=09=09=09=09
-028		028		admin/gentable		Direct Table Edit=09=09
-029		029		admin/import_table		Table import=09=09
-030		030		admin/export_table		Table export=09=09
-031		031=09=09=09=09=09=09
-032		032		admin/access		Administrators=09=09
-033	full	033		admin/group		Admin Groups=09=09
-034	full	034		admin/access_permissions		Permissions=09=09
-035		035=09=09=09=09=09=09
-036		036		admin/env_vars		Environment=09=09
-037		037		admin/preferences		Preferences=09=09
-038	full	038		admin/flex_select	mv_data_table=3Dvariable&page_title=3DKnar=
%20editor&ui_meta_specific=3D1&help_name=3Dknar.main	Knar editor=09=09
-039		039				<hr noshade size=3D1>=09=09
-040		040		index		<b>Go to catalog</b>=09=09
-041		041		admin/login		<b>Logout</b>=09=09
-042		042		admin/reconfig		<b>Apply Changes</b>=09=09
+001		x	0			Store Admin=09=09
+002		0	0	admin/order		Orders=09=09
+003	full	0	0	admin/entry		Order entry=09=09
+004		0	0=09=09=09=09=09
+005	full	0	0	admin/orderstats		Order stats=09=09
+006	full	0	0	admin/trafficstats		Traffic stats=09=09
+007	full	0	0	admin/affiliates		Affiliates=09=09
+008	full	0	0=09=09=09=09=09
+009		0	0	admin/item		Items=09=09
+010		0	0			<hr noshade size=3D1>=09=09
+011		0	0			Site Design=09=09
+012		0	0	admin/layout		Site Layout=09=09
+013		0	0	admin/page		Page Edit=09=09
+014		0	0	admin/regenerate		Generate static=09=09
+015		0	0	admin/build_related		Build related=09=09
+016		0	0	admin/search_wizard		Search Builder=09=09
+017		0	0	admin/button_builder		Button Builder=09=09
+018		0	0	admin/menu_editor		Menu Builder	Create and edit quick menus with =
a graphical UI=09
+019		0	0			<hr noshade size=3D1>=09=09
+020		0	0			Technical Admin=09=09
+021		0	0	admin/tax		Tax=09=09
+022		0	0	admin/ship		Shipping=09=09
+023		0	0	admin/payment		Payment=09=09
+024		0	0=09=09=09=09=09
+025		0	0	admin/file_transfer		File transfer=09=09
+026		0	0	admin/auto_wizard		Wizard=09=09
+027		0	0=09=09=09=09=09
+028		0	0	admin/gentable		Direct Table Edit=09=09
+029		0	0	admin/import_table		Table import=09=09
+030		0	0	admin/export_table		Table export=09=09
+031		0	0=09=09=09=09=09
+032		0	0	admin/access		Administrators=09=09
+033	full	0	0	admin/group		Admin Groups=09=09
+034	full	0	0	admin/access_permissions		Permissions=09=09
+035		0	0=09=09=09=09=09
+036		0	0	admin/env_vars		Environment=09=09
+037		0	0	admin/preferences		Preferences=09=09
+038	full	0	0	admin/flex_select	mv_data_table=3Dvariable&page_title=3DKnar%=
20editor&ui_meta_specific=3D1&help_name=3Dknar.main	Knar editor=09=09
+039		0	0			<hr noshade size=3D1>=09=09
+040		0	0	index		<b>Go to catalog</b>=09=09
+041		0	0	admin/login		<b>Logout</b>=09=09
+042		0	0	admin/reconfig		<b>Apply Changes</b>=09=09