
interchange-cvs at icdevgroup
May 10, 2008, 7:07 AM
Post #2 of 2
(18 views)
Permalink
|
User: heins Date: 2008-05-10 14:07:40 GMT Modified: dist/lib/UI/pages/admin meta_editor.html Modified: dist/standard/products mv_metadata.asc Modified: lib/Vend/Table Editor.pm Log: * Add type_empty parameter to table editor. This allows the selection of a different widget type if the length of the data is zero. Found on the extended page of the meta editor for the field. An example of use would be a "created" field in a table, which is a DATETIME type. If the value of the field is the empty string or NULL, set type_empty to "datetime" to put a date widget in. Make the normal widget type be "value", which allows you to just display the data when the value is already set. Revision Changes Path 2.19 interchange/dist/lib/UI/pages/admin/meta_editor.html rev 2.19, prev_rev 2.18 Index: meta_editor.html =================================================================== RCS file: /var/cvs/interchange/dist/lib/UI/pages/admin/meta_editor.html,v retrieving revision 2.18 retrieving revision 2.19 diff -u -r2.18 -r2.19 --- meta_editor.html 16 May 2005 05:21:49 -0000 2.18 +++ meta_editor.html 10 May 2008 14:07:40 -0000 2.19 @@ -132,6 +132,7 @@ pre_filter display_filter prepend + extended.type_empty append extended.restrict_allow __UI_META_ADDITIONAL__ @@ -179,6 +180,7 @@ 'extended.js_check' => 'JavascriptCheck', 'extended.blank_default' => 'Default value', 'extended.restrict_allow' => 'Allow these ITL tags', + 'extended.type_empty' => 'Alternate widget if no data length', 'display_filter' => 'Display filter', }, @@ -197,7 +199,9 @@ }, widget => { type => 'movecombo_replace', + type => 'movecombo_replace', extended => 'textarea_5_50', + 'extended.type_empty' => 'movecombo_replace', 'extended.ui_more_alpha' => 'yesno', 'extended.ui_sort_option' => 'select', 'extended.fs_no_group' => 'yesno', @@ -212,6 +216,7 @@ if($Variable->{UI_WIDGET_TYPES}) { #Debug("Found UI_WIDGET_TYPES"); $me_opt{options}{type} = $Variable->{UI_WIDGET_TYPES}; + $me_opt{options}{type_empty} = $Variable->{UI_WIDGET_TYPES}; #Debug("me_opt{options}=" . uneval($me_opt{options})); } @@ -287,4 +292,4 @@ ][/table-editor] @_UI_STD_FOOTER_@ -<!-- page: @@MV_PAGE@@ version: $Revision: 2.18 $ --> +<!-- page: @@MV_PAGE@@ version: $Revision: 2.19 $ --> 1.16 interchange/dist/standard/products/mv_metadata.asc rev 1.16, prev_rev 1.15 Index: mv_metadata.asc =================================================================== RCS file: /var/cvs/interchange/dist/standard/products/mv_metadata.asc,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- mv_metadata.asc 6 May 2008 17:14:42 -0000 1.15 +++ mv_metadata.asc 10 May 2008 14:07:40 -0000 1.16 @@ -111,6 +111,7 @@ mv_metadata::outboard text 30 Directory Select directory for image listing widget. mv_metadata::prepend textarea 60 5 Prepend HTML <SMALL>HTML to be prepended to the widget. Will substitute in the macros _UI_TABLE_, _UI_COLUMN_, _UI_KEY, and _UI_VALUE_, and will resolve relative links with absolute links.</SMALL> mv_metadata::type select text=Text entry*, textarea=Textarea, select=Select box, yesno=Yes/No (Yes=1), noyes=No/Yes (No=1), yesno radio=Yes/No (radio), noyes radio=No/Yes (radio), multiple=Multiple Select, combo=Combo Select, reverse_combo=Reverse Combo, move_combo=Combo move, display=Text of option, hidden_text=Hidden (show text), radio=Radio box, radio_nbsp=Radio (nbsp), checkbox=Checkbox, check_nbsp=Checkbox (nbsp), imagedir=Image listing, imagehelper=Image upload, uploadblob=File upload to BLOB, date=Date selector, value=Value, option_format=Option formatter, show=Show all options,gpg_keys=GPG key selector Widget type Select the basic display type for the field. +mv_metadata::extended.type_empty select text=Text entry*, textarea=Textarea, select=Select box, yesno=Yes/No (Yes=1), noyes=No/Yes (No=1), yesno radio=Yes/No (radio), noyes radio=No/Yes (radio), multiple=Multiple Select, combo=Combo Select, reverse_combo=Reverse Combo, move_combo=Combo move, display=Text of option, hidden_text=Hidden (show text), radio=Radio box, radio_nbsp=Radio (nbsp), checkbox=Checkbox, check_nbsp=Checkbox (nbsp), imagedir=Image listing, imagehelper=Image upload, uploadblob=File upload to BLOB, date=Date selector, value=Value, option_format=Option formatter, show=Show all options,gpg_keys=GPG key selector Widget type Select the basic display type for the field. mv_metadata::width text 4 Width SIZE for TEXT<BR> COLS for TEXTAREA<BR> Label limit for SELECT digits optadd::mv_metadata::options textarea 20 8 Options Options in the format:<P> <blockquote> value=label*</blockquote> option_format options table code sku o_group o_master description(30) price Product Options options 1.92 interchange/lib/Vend/Table/Editor.pm rev 1.92, prev_rev 1.91 Index: Editor.pm =================================================================== RCS file: /var/cvs/interchange/lib/Vend/Table/Editor.pm,v retrieving revision 1.91 retrieving revision 1.92 diff -u -r1.91 -r1.92 --- Editor.pm 25 Mar 2008 17:13:21 -0000 1.91 +++ Editor.pm 10 May 2008 14:07:40 -0000 1.92 @@ -1,6 +1,6 @@ # Vend::Table::Editor - Swiss-army-knife table editor for Interchange # -# $Id: Editor.pm,v 1.91 2008-03-25 17:13:21 jon Exp $ +# $Id: Editor.pm,v 1.92 2008-05-10 14:07:40 mheins Exp $ # # Copyright (C) 2002-2008 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.91 $, 10); +$VERSION = substr(q$Revision: 1.92 $, 10); use Vend::Util; use Vend::Interpolate; @@ -843,6 +843,7 @@ prepend table type + type_empty width /; for(@override) { @@ -852,7 +853,12 @@ } } - $record->{type} ||= $opt->{default_widget}; + if($record->{type_empty} and length($opt->{value}) == 0) { + $record->{type} = $record->{type_empty}; + } + else { + $record->{type} ||= $opt->{default_widget}; + } $record->{name} ||= $column; #::logDebug("record now=" . ::uneval($record)); _______________________________________________ interchange-cvs mailing list interchange-cvs[at]icdevgroup.org http://www.icdevgroup.org/mailman/listinfo/interchange-cvs
|