[interchange-cvs] interchange - heins modified 2 files
interchange-core@icdevgroup.org
interchange-core@icdevgroup.org
Mon Sep 23 16:39:01 2002
User: heins
Date: 2002-09-23 20:38:39 GMT
Modified: lib/Vend Interpolate.pm
Modified: lib/Vend/Table Editor.pm
Log:
* Starting baby steps on "save all config to meta" which will allow
dynamic field configuration and then save of a view.
* Allow starting with a particular tab open in a tabbed display.
* Export tag_attr_list routine from Interpolate.pm.
Revision Changes Path
2.113 +3 -2 interchange/lib/Vend/Interpolate.pm
rev 2.113, prev_rev 2.112
Index: Interpolate.pm
=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/lib/Vend/Interpolate.pm,v
retrieving revision 2.112
retrieving revision 2.113
diff -u -r2.112 -r2.113
--- Interpolate.pm 19 Sep 2002 03:25:47 -0000 2.112
+++ Interpolate.pm 23 Sep 2002 20:38:39 -0000 2.113
@@ -1,6 +1,6 @@
# Vend::Interpolate - Interpret Interchange tags
#=20
-# $Id: Interpolate.pm,v 2.112 2002/09/19 03:25:47 mheins Exp $
+# $Id: Interpolate.pm,v 2.113 2002/09/23 20:38:39 mheins Exp $
#
# Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
#
@@ -27,7 +27,7 @@
require Exporter;
@ISA =3D qw(Exporter);
=20
-$VERSION =3D substr(q$Revision: 2.112 $, 10);
+$VERSION =3D substr(q$Revision: 2.113 $, 10);
=20
@EXPORT =3D qw (
=20
@@ -35,6 +35,7 @@
interpolate_html
subtotal
tag_data
+tag_attr_list
$Tag
$CGI
$Session
1.5 +49 -20 interchange/lib/Vend/Table/Editor.pm
rev 1.5, prev_rev 1.4
Index: Editor.pm
=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/lib/Vend/Table/Editor.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Editor.pm 23 Sep 2002 17:57:18 -0000 1.4
+++ Editor.pm 23 Sep 2002 20:38:39 -0000 1.5
@@ -1,6 +1,6 @@
# Vend::Table::Editor - Swiss-army-knife table editor for Interchange
#
-# $Id: Editor.pm,v 1.4 2002/09/23 17:57:18 mheins Exp $
+# $Id: Editor.pm,v 1.5 2002/09/23 20:38:39 mheins Exp $
#
# Copyright (C) 2002 ICDEVGROUP <interchange@icdevgroup.org>
# Copyright (C) 2002 Mike Heins <mike@perusion.net>
@@ -26,7 +26,7 @@
package Vend::Table::Editor;
=20
use vars qw($VERSION);
-$VERSION =3D substr(q$Revision: 1.4 $, 10);
+$VERSION =3D substr(q$Revision: 1.5 $, 10);
=20
use Vend::Util;
use Vend::Interpolate;
@@ -767,6 +767,9 @@
</LAYER>
EOF
}
+
+ my $start_index =3D $opt->{start_at_index} || 0;
+ $start_index +=3D 0;
return <<EOF;
$out
<div style=3D"
@@ -776,7 +779,7 @@
">
$s1
<script>
- selectTab(0);
+ selectTab($start_index);
</script>
</div>
EOF
@@ -971,24 +974,42 @@
=20
# First we see if something has created a big options munge
# for us
- if(ref($opt->{all_opts}) eq 'HASH') {
-#Debug("all_opts being brought in...");
- my $o =3D $opt->{all_opts};
- for (keys %$o ) {
- $opt->{$_} =3D $o->{$_};
- }
-#Debug("options now=3D" . ::uneval($opt));
- }
- elsif ($opt->{all_opts}) {
- logError("%s: improper option %s, must be %s, was %s.",
- 'table_editor',
- 'all_opts',
- 'hash',
- ref $opt->{all_opts},
- );
+ if($opt->{all_opts}) {
+#::logDebug("all_opts being brought in...=3D$opt->{all_opts}");
+ if(ref($opt->{all_opts}) eq 'HASH') {
+#::logDebug("all_opts being brought in...");
+ my $o =3D $opt->{all_opts};
+ for (keys %$o ) {
+ $opt->{$_} =3D $o->{$_};
+ }
+ }
+ else {
+ my $o =3D meta_record($opt->{all_opts});
+#::logDebug("all_opts being brought in, o=3D$o");
+ if($o) {
+ for (keys %$o ) {
+ $opt->{$_} =3D $o->{$_};
+ }
+ }
+ else {
+ logError("%s: improper option %s, must be %s, was %s.",
+ 'table_editor',
+ 'all_opts',
+ 'hash',
+ ref $opt->{all_opts},
+ );
+ }
+ }
+#::logDebug("options now=3D" . ::uneval($opt));
}
=20
- my $tmeta =3D meta_record($table, $opt->{ui_meta_view}) || {};
+ my $tmeta;
+ if($opt->{no_table_meta}) {
+ $tmeta =3D {};
+ }
+ else {
+ $tmeta =3D meta_record($table, $opt->{ui_meta_view}) || {};
+ }
=20
# This section checks the passed options and converts them from
# strings to refs if necessary
@@ -1005,6 +1026,7 @@
filter
height
help
+ help_url
label
lookup
lookup_query
@@ -1086,6 +1108,8 @@
ui_new_item
ui_delete_box
mv_update_empty
+ bottom_buttons
+ top_buttons
/;
=20
for(grep defined $tmeta->{$_}, @mapdirect) {
@@ -1286,11 +1310,13 @@
$opt->{mv_data_table} =3D $table if $table;
$opt->{item_id} =3D $key if $key;
$opt->{table} =3D $opt->{mv_data_table};
-#::logDebug("key before resolve_options: $key");
=20
resolve_options($opt);
$table =3D $opt->{table};
$key =3D $opt->{item_id};
+ if($opt->{save_meta}) {
+ $::Scratch->{$opt->{save_meta}} =3D uneval($opt);
+ }
#::logDebug("key after resolve_options: $key");
=20
my $rowdiv =3D $opt->{across} || 1;
@@ -2725,6 +2751,9 @@
}
}
$ctl_index++ if $update_ctl;
+ if($opt->{start_at} and $opt->{start_at} eq $namecol) {
+ $opt->{start_at_index} =3D $ctl_index;
+ }
#::logDebug("control index now=3D$ctl_index");
col_chunk $c, $display;
}