[interchange-cvs] interchange - heins modified 6 files

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Wed Jul 21 01:46:56 EDT 2004


User:      heins
Date:      2004-07-21 05:46:56 GMT
Modified:  code/Widget imagedir.widget
Modified:  dist/lib/UI/pages/admin meta_editor.html
Modified:  lib/Vend Config.pm Form.pm
Modified:  lib/Vend/Table Editor.pm
Added:     code/UI_Tag widget_meta.coretag
Log:
* Add ExtraMeta capability to UserTags.

  If you put an ExtraMeta setting in the CodeDef for the widget, it
  works the same as a meta record of _widget::type, i.e. it is a structure
  like this one for the "imagedir" widget:

    CodeDef imagedir ExtraMeta <<EOM
    {
        _order => [ qw/ follow_symlinks / ],
        follow_symlinks => {
            widget => 'yesno',
            label => 'Follow Symlinks',
            help => 'Set to yes if you want to list all files, \
                    even following symbolic links',
        },
    }
    EOM

  This adds a "Special for imagedir widget" tab in the meta_editor,
  which allows special settings for the widget.

  Can be done in catalog.cfg widgets and global widgets. The actual
  ExtraMeta is a string value which is runtime-interpolated to a
  hash.

  Can be set in Vend::Form native widgets by setting %Vend::Form::ExtraMeta,
  i.e.:

      $Vend::Form::ExtraMeta{text} = {
        _order => [ 'maxlen' },
        maxlen => {
            widget => 'text_4',
            label => 'Maximum length for value',
        }
      };

  Not that it will do any good until the settings are honored by the
  widget. Should be set to an actual reference.

  There is an illustration for the "imagedir" widget as above.

* Add back in the nascent display_filter edit in meta_editor, and
  give help/setting for restrict_allow.

Revision  Changes    Path
1.1                  interchange/code/UI_Tag/widget_meta.coretag


rev 1.1, prev_rev 1.0
Index: widget_meta.coretag
===================================================================
UserTag widget-meta Order type
UserTag widget-meta addAttr
UserTag widget-meta MapRoutine Vend::Table::Editor::widget_meta



1.4       +12 -1     interchange/code/Widget/imagedir.widget


rev 1.4, prev_rev 1.3
Index: imagedir.widget
===================================================================
RCS file: /var/cvs/interchange/code/Widget/imagedir.widget,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- imagedir.widget	17 Apr 2004 03:37:42 -0000	1.3
+++ imagedir.widget	21 Jul 2004 05:46:55 -0000	1.4
@@ -1,4 +1,15 @@
 CodeDef imagedir Widget 1
+CodeDef imagedir ExtraMeta <<EOM
+{
+	_order => [ qw/ follow_symlinks / ],
+	follow_symlinks => {
+		widget => 'yesno',
+		label => 'Follow Symlinks',
+		help => 'Set to yes if you want to list all files, even following symbolic links',
+	},
+}
+EOM
+
 CodeDef imagedir Routine <<EOR
 use File::Find;
 sub {
@@ -28,7 +39,7 @@
 					$n =~ s:^$dir/?::;
 					push(@names, $n);
 				};
-	find($wanted, $dir);
+	find({ wanted => $wanted, follow => $opt->{follow_symlinks} }, $dir);
 	$opt->{passed} = [ '=None', sort @names ];
 	$opt->{type} = delete $opt->{variant} || 'combo';
 	return Vend::Form::display($opt);



2.13      +8 -2      interchange/dist/lib/UI/pages/admin/meta_editor.html


rev 2.13, prev_rev 2.12
Index: meta_editor.html
===================================================================
RCS file: /var/cvs/interchange/dist/lib/UI/pages/admin/meta_editor.html,v
retrieving revision 2.12
retrieving revision 2.13
diff -u -r2.12 -r2.13
--- meta_editor.html	3 Jun 2004 06:31:19 -0000	2.12
+++ meta_editor.html	21 Jul 2004 05:46:55 -0000	2.13
@@ -72,7 +72,7 @@
 	my $sneak_type = $Tag->data($CGI->{mv_data_table}, 'type', $CGI->{item_id});
 	my $extra_meta;
 	if($sneak_type) {
-		$extra_meta = $Tag->meta_record("_widget::$sneak_type", undef, undef, 1);
+		$extra_meta = $Tag->widget_meta($sneak_type);
 	}
 
 	%me_opt = (
@@ -134,8 +134,10 @@
 
 	   outboard
 	   pre_filter
+	   display_filter
 	   prepend
 	   append
+	   extended.restrict_allow
 	   __UI_META_ADDITIONAL__
 	},
 
@@ -180,6 +182,8 @@
 		'extended.blank_default' => 'Default value',
 		'extended.size_to' => 'Field to store uploadblob size in',
 		'extended.name_to' => 'Field to store uploadblob file name in',
+		'extended.restrict_allow' => 'Allow these ITL tags',
+		'display_filter' => 'Display filter',
 	},
 	help => {
 		'extended.fs_data_calc' => 'Current record passed as $item',
@@ -189,6 +193,8 @@
 		'extended.check' => 'Standard IC mv_profile checks -- required, postcode, etc.',
 		'extended.size_to' => 'if any -- must be in fields of table editor',
 		'extended.name_to' => 'if any -- must be in fields of table editor',
+		'extended.restrict_allow' => 'in append/prepend/lookup_query',
+		'display_filter' => 'Only used for hidden_text type',
 	},
 	widget => {
 		extended => "textarea_5_50",
@@ -278,4 +284,4 @@
 	][/table-editor]
 
 @_UI_STD_FOOTER_@
-<!-- page: @@MV_PAGE@@ version: $Revision: 2.12 $ -->
+<!-- page: @@MV_PAGE@@ version: $Revision: 2.13 $ -->



2.144     +3 -2      interchange/lib/Vend/Config.pm


rev 2.144, prev_rev 2.143
Index: Config.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Config.pm,v
retrieving revision 2.143
retrieving revision 2.144
diff -u -r2.143 -r2.144
--- Config.pm	19 Jul 2004 22:26:00 -0000	2.143
+++ Config.pm	21 Jul 2004 05:46:55 -0000	2.144
@@ -1,6 +1,6 @@
 # Vend::Config - Configure Interchange
 #
-# $Id: Config.pm,v 2.143 2004/07/19 22:26:00 mheins Exp $
+# $Id: Config.pm,v 2.144 2004/07/21 05:46:55 mheins Exp $
 #
 # Copyright (C) 2002-2003 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -48,7 +48,7 @@
 use Vend::File;
 use Vend::Data;
 
-$VERSION = substr(q$Revision: 2.143 $, 10);
+$VERSION = substr(q$Revision: 2.144 $, 10);
 
 my %CDname;
 my %CPname;
@@ -3680,6 +3680,7 @@
 	cannest			canNest
 	description  	Description
 	documentation	Documentation
+	extrameta		ExtraMeta
 	gobble			Gobble
 	hasendtag		hasEndTag
 	implicit		Implicit



2.47      +3 -3      interchange/lib/Vend/Form.pm


rev 2.47, prev_rev 2.46
Index: Form.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Form.pm,v
retrieving revision 2.46
retrieving revision 2.47
diff -u -r2.46 -r2.47
--- Form.pm	4 Jul 2004 13:11:50 -0000	2.46
+++ Form.pm	21 Jul 2004 05:46:55 -0000	2.47
@@ -1,6 +1,6 @@
 # Vend::Form - Generate Form widgets
 # 
-# $Id: Form.pm,v 2.46 2004/07/04 13:11:50 racke Exp $
+# $Id: Form.pm,v 2.47 2004/07/21 05:46:55 mheins Exp $
 #
 # Copyright (C) 2002-2003 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -33,12 +33,12 @@
 use strict;
 use POSIX qw{strftime};
 
-use vars qw/@ISA @EXPORT @EXPORT_OK $VERSION %Template/;
+use vars qw/@ISA @EXPORT @EXPORT_OK $VERSION %Template %ExtraMeta/;
 
 require Exporter;
 @ISA = qw(Exporter);
 
-$VERSION = substr(q$Revision: 2.46 $, 10);
+$VERSION = substr(q$Revision: 2.47 $, 10);
 
 @EXPORT = qw (
 	display



1.61      +23 -2     interchange/lib/Vend/Table/Editor.pm


rev 1.61, prev_rev 1.60
Index: Editor.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Table/Editor.pm,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -r1.60 -r1.61
--- Editor.pm	23 Jun 2004 16:21:58 -0000	1.60
+++ Editor.pm	21 Jul 2004 05:46:55 -0000	1.61
@@ -1,6 +1,6 @@
 # Vend::Table::Editor - Swiss-army-knife table editor for Interchange
 #
-# $Id: Editor.pm,v 1.60 2004/06/23 16:21:58 mheins Exp $
+# $Id: Editor.pm,v 1.61 2004/07/21 05:46:55 mheins Exp $
 #
 # Copyright (C) 2002-2003 Interchange Development Group
 # Copyright (C) 2002 Mike Heins <mike at perusion.net>
@@ -26,7 +26,7 @@
 package Vend::Table::Editor;
 
 use vars qw($VERSION);
-$VERSION = substr(q$Revision: 1.60 $, 10);
+$VERSION = substr(q$Revision: 1.61 $, 10);
 
 use Vend::Util;
 use Vend::Interpolate;
@@ -154,6 +154,27 @@
 	unshift @out, "=--add--" unless $opt->{no_add};
 	$opt->{joiner} = Vend::Interpolate::get_joiner($opt->{joiner}, ",\n");
 	return join $opt->{joiner}, @out;
+}
+
+sub widget_meta {
+	my ($type,$opt) = @_;
+	my $meta = meta_record("_widget::$type", $opt->{view}, $opt->{meta_table}, 1);
+	return $meta if $meta;
+	my $w = $Vend::Cfg->{CodeDef}{Widget};
+	if($w and $w->{Widget}{$type}) {
+		my $string;
+		return undef unless $string = $w->{ExtraMeta}{$type};
+		return get_option_hash($string);
+	}
+
+	$w = $Global::CodeDef->{Widget};
+	if($w and $w->{Widget}{$type}) {
+		my $string;
+		return undef unless $string = $w->{ExtraMeta}{$type};
+		return get_option_hash($string);
+	}
+
+	return $Vend::Form::ExtraMeta{$type};
 }
 
 sub meta_record {








More information about the interchange-cvs mailing list