[interchange-cvs] interchange - heins modified dist/lib/UI/pages/admin/menu_editor.html

interchange-core@icdevgroup.org interchange-core@icdevgroup.org
Sat Aug 3 17:24:00 2002


User:      heins
Date:      2002-08-03 21:23:33 GMT
Modified:  dist/lib/UI/pages/admin menu_editor.html
Log:
* Fix tree write routines.
* Rename jsquote tag to jsq (still aliased).

Revision  Changes    Path
2.4       +16 -12    interchange/dist/lib/UI/pages/admin/menu_editor.html


rev 2.4, prev_rev 2.3
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: /var/cvs/interchange/dist/lib/UI/pages/admin/menu_editor.html,v
retrieving revision 2.3
retrieving revision 2.4
diff -u -r2.3 -r2.4
--- menu_editor.html	3 Aug 2002 19:30:43 -0000	2.3
+++ menu_editor.html	3 Aug 2002 21:23:32 -0000	2.4
@@ -94,12 +94,16 @@
 				my @fields =3D split /\t/, shift(@lines);
 				my $pfield =3D $Variable->{MV_TREE_PARENT_FIELD} || 'parent_fld';
 				my $gfield =3D $Variable->{MV_TREE_GROUP_FIELD} || 'mgroup';
+				my $sfield =3D $Variable->{MV_TREE_SORT_FIELD} || 'msort';
=20
 				my $gptr;
+				my $sptr;
 				for(my $i =3D 1; $i < @fields; $i++) {
 					if($fields[$i] eq $gfield) {
 						$gptr =3D $i;
-						last;
+					}
+					elsif($fields[$i] eq $sfield) {
+						$sptr =3D $i;
 					}
 				}
=20
@@ -110,7 +114,7 @@
 				push @fields, $pfield;
 				shift(@fields);
=20
-				my @parent =3D ($menuname);;
+				my @parent =3D ($menuname);
 				my $plev =3D 0;
=20
 				my $query =3D qq{delete from $tab where $gfield =3D '$menuname'};
@@ -120,7 +124,7 @@
 					my @row =3D split /\t/, $_, $num;
 					my @f =3D @fields;
 					$#row =3D $last;
-					my $lev =3D $row[$gptr];
+					my $lev =3D $row[$sptr];
 #Debug("menu level=3D$lev");
 					$row[$gptr] =3D $menuname;
 					$row[$pptr] =3D $parent[$lev];
@@ -438,7 +442,7 @@
 			my $mrecord =3D $Tag->meta_record($metaname)
 				or last DOMETA;
 			if(my $lab =3D $mrecord->{label}) {
-				push @out, "    label[$i] =3D " . $Tag->jsquote($lab) . ';';
+				push @out, "    label[$i] =3D " . $Tag->jsq($lab) . ';';
 			}
 			if(my $type =3D $mrecord->{type}) {
 				$mrecord->{name} =3D "ext_$_";
@@ -448,7 +452,7 @@
 										override =3D> 1,
 										default =3D> '',
 										} );
-				push @out, "    widget[$i] =3D " . $Tag->jsquote($wid) . ';';
+				push @out, "    widget[$i] =3D " . $Tag->jsq($wid) . ';';
 			}
 		}
 		$i++;
@@ -1631,10 +1635,10 @@
 			if(! fn.match(reserved) ) {
 				var nn =3D 'ext_' + fn;
 				var un =3D fn.toUpperCase();
-// alert([jsquote]fn=3D$fn nn=3D$nn un=3D$un[/jsquote]);
+// alert([jsq]fn=3D$fn nn=3D$nn un=3D$un[/jsq]);
 				var eidx;
 				eval('eidx =3D ' + un);
-// alert([jsquote]fn=3D$fn un=3D$un nn=3D$nn eidx=3D$eidx[/jsquote]);
+// alert([jsq]fn=3D$fn un=3D$un nn=3D$nn eidx=3D$eidx[/jsq]);
 				var nidx =3D extra.length;
 				extra.length +=3D 1;
 				extra[nidx] =3D fn;
@@ -1647,9 +1651,9 @@
 					wid =3D widget[eidx];
 				}
 				else {
-					wid =3D [jsquote]<input type=3Dtext name=3D"$nn" onChange=3D"form_cha=
nged(1);">[/jsquote];
+					wid =3D [jsq]<input type=3Dtext name=3D"$nn" onChange=3D"form_changed=
(1);">[/jsq];
 				}
-				document.write([jsquote]
+				document.write([jsq]
 		<tr>
 			<td class=3Dclabel>
 				$lab
@@ -1658,14 +1662,14 @@
 				$wid
 			</td>
 		</tr>
-			[/jsquote]);
+			[/jsq]);
=20
 			}
=20
 		}
=20=09=09
 		if(EXTENDED !=3D undefined) {
-			document.write([jsquote]
+			document.write([jsq]
 		<tr>
 			<td class=3Dclabel>
 				Extended Parameters (advanced)
@@ -1674,7 +1678,7 @@
 				<textarea cols=3D50 rows=3D4 name=3Dextended onChange=3D"form_changed(=
1);"></textarea>
 			</td>
 		</tr>
-			[/jsquote]);
+			[/jsq]);
 		}
=20
 </script>