[interchange-cvs] interchange - heins modified 11 files
interchange-core@icdevgroup.org
interchange-core@icdevgroup.org
Mon Aug 5 00:06:02 2002
User: heins
Date: 2002-08-05 04:05:40 GMT
Modified: . MANIFEST WHATSNEW
Modified: code/SystemTag attr_list.coretag
Modified: dist/foundation/templates/components product_tree
Modified: dist/lib/UI/pages/admin menu_editor.html quicklinks.html
Modified: lib/Vend Interpolate.pm
Added: code/SystemTag image.tag menu.coretag
Added: lib/Vend Menu.pm
Removed: code/UserTag image.tag
Log:
* More on new menu editor and menu system. It is based around Vend::Menu
and the new tag [menu ...], which builds various types of DHTMl and
standard HTML menus based on browser type. Two types, "tree" and
"simple" are included -- will be adding at least two more, "checklist"
and "ui". Also possible is "hover".
The menu editor will be able to edit any of the menus. Eventually
all UI menus will use this, and a simple menu component (i.e. a link list)
can be placed in the public-facing catalog.
There is a "product_tree" component to illustrate this, along with menus
for the Quicklinks and Accounting menus. The major UI menus will be moved
over next.
* Move [image] tag into core since it is used by Vend::Menu.
* Create variation of attr_list tag which is case-insensitive, allowing
UPPERCASE attributes with lowercase rows (easier to read when combined wi=
th
HTML in lower case).
* Allow iterator for list-based tags to be a passed subroutine reference.
Revision Changes Path
2.49 +20 -2 interchange/MANIFEST
rev 2.49, prev_rev 2.48
Index: MANIFEST
=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/MANIFEST,v
retrieving revision 2.48
retrieving revision 2.49
diff -u -r2.48 -r2.49
--- MANIFEST 24 Jul 2002 00:04:20 -0000 2.48
+++ MANIFEST 5 Aug 2002 04:05:39 -0000 2.49
@@ -1,5 +1,5 @@
LICENSE
-MANIFEST
+MANIFEST This list of files
MANIFEST.SKIP
Makefile.PL
README
@@ -49,6 +49,7 @@
code/SystemTag/handling.coretag
code/SystemTag/harness.coretag
code/SystemTag/html_table.coretag
+code/SystemTag/image.tag
code/SystemTag/import.coretag
code/SystemTag/include.coretag
code/SystemTag/index.coretag
@@ -59,6 +60,7 @@
code/SystemTag/log.coretag
code/SystemTag/loop.coretag
code/SystemTag/mail.coretag
+code/SystemTag/menu.coretag
code/SystemTag/msg.coretag
code/SystemTag/mvasp.coretag
code/SystemTag/nitems.coretag
@@ -138,6 +140,7 @@
code/UI_Tag/if_sql.coretag
code/UI_Tag/image_collate.coretag
code/UI_Tag/import_fields.coretag
+code/UI_Tag/jsq.coretag
code/UI_Tag/list_databases.coretag
code/UI_Tag/list_glob.coretag
code/UI_Tag/list_keys.coretag
@@ -188,7 +191,6 @@
code/UserTag/fortune.tag
code/UserTag/get_url.tag
code/UserTag/history_scan.tag
-code/UserTag/image.tag
code/UserTag/load_cart.tag
code/UserTag/loc.tag
code/UserTag/rand.tag
@@ -280,6 +282,7 @@
dist/foundation/dbconf/default_db/products.dbm
dist/foundation/dbconf/default_db/state.dbm
dist/foundation/dbconf/default_db/transactions.dbm
+dist/foundation/dbconf/default_db/tree.dbm
dist/foundation/dbconf/default_db/userdb.dbm
dist/foundation/dbconf/default_db/variable.dbm
dist/foundation/dbconf/mysql/2ndDayAir.dbm
@@ -304,6 +307,7 @@
dist/foundation/dbconf/mysql/products.mysql
dist/foundation/dbconf/mysql/state.mysql
dist/foundation/dbconf/mysql/transactions.mysql
+dist/foundation/dbconf/mysql/tree.mysql
dist/foundation/dbconf/mysql/userdb.mysql
dist/foundation/dbconf/mysql/variable.dbm
dist/foundation/dbconf/oracle/2ndDayAir.dbm
@@ -328,6 +332,7 @@
dist/foundation/dbconf/oracle/products.ora
dist/foundation/dbconf/oracle/state.ora
dist/foundation/dbconf/oracle/transactions.ora
+dist/foundation/dbconf/oracle/tree.ora
dist/foundation/dbconf/oracle/userdb.ora
dist/foundation/dbconf/oracle/variable.dbm
dist/foundation/dbconf/pgsql/2ndDayAir.dbm
@@ -352,6 +357,7 @@
dist/foundation/dbconf/pgsql/products.pgsql
dist/foundation/dbconf/pgsql/state.pgsql
dist/foundation/dbconf/pgsql/transactions.pgsql
+dist/foundation/dbconf/pgsql/tree.pgsql
dist/foundation/dbconf/pgsql/userdb.pgsql
dist/foundation/dbconf/pgsql/variable.dbm
dist/foundation/etc/area.recordnumber
@@ -374,6 +380,8 @@
dist/foundation/images/computer.xls
dist/foundation/images/construct.xls
dist/foundation/images/download.png
+dist/foundation/images/fc.gif
+dist/foundation/images/fo.gif
dist/foundation/images/foundation/about.gif
dist/foundation/images/foundation/buynow.gif
dist/foundation/images/foundation/cart.gif
@@ -473,6 +481,7 @@
dist/foundation/products/shipping.asc
dist/foundation/products/state.txt
dist/foundation/products/transactions.txt
+dist/foundation/products/tree.txt
dist/foundation/products/userdb.txt
dist/foundation/products/variable.txt
dist/foundation/special_pages/badsearch.html
@@ -502,6 +511,7 @@
dist/foundation/templates/components/cross
dist/foundation/templates/components/fortune
dist/foundation/templates/components/none
+dist/foundation/templates/components/product_tree
dist/foundation/templates/components/promo
dist/foundation/templates/components/random
dist/foundation/templates/components/saved_carts_list_small
@@ -658,6 +668,8 @@
dist/lib/UI/pages/admin/.autoload
dist/lib/UI/pages/admin/access.html
dist/lib/UI/pages/admin/access_permissions.html
+dist/lib/UI/pages/admin/accounting/index.html
+dist/lib/UI/pages/admin/accounting/return.html
dist/lib/UI/pages/admin/add_meta_option.html
dist/lib/UI/pages/admin/advanced.html
dist/lib/UI/pages/admin/affiliates.html
@@ -724,6 +736,7 @@
dist/lib/UI/pages/admin/layout.html
dist/lib/UI/pages/admin/layout_auto.html
dist/lib/UI/pages/admin/login.html
+dist/lib/UI/pages/admin/menu_editor.html
dist/lib/UI/pages/admin/merchandising.html
dist/lib/UI/pages/admin/meta_editor.html
dist/lib/UI/pages/admin/misc_order_number.html
@@ -813,6 +826,8 @@
dist/lib/UI/pages/include/item_option_matrix
dist/lib/UI/pages/include/item_option_modular
dist/lib/UI/pages/include/item_option_simple
+dist/lib/UI/pages/include/menus/Accounting.txt
+dist/lib/UI/pages/include/menus/Quicklinks.txt
dist/lib/UI/pages/include/order_delete_archive
dist/lib/UI/pages/include/page_editor
dist/lib/UI/pages/include/table_populator
@@ -913,6 +928,7 @@
lib/Vend/Imagemap.pm
lib/Vend/Interpolate.pm
lib/Vend/MakeCat.pm
+lib/Vend/Menu.pm
lib/Vend/ModPerl.pm
lib/Vend/Order.pm
lib/Vend/Page.pm
@@ -923,8 +939,10 @@
lib/Vend/Payment/BoA.pm
lib/Vend/Payment/CCVS.pm
lib/Vend/Payment/CyberCash.pm
+lib/Vend/Payment/MCVE.pm
lib/Vend/Payment/Signio.pm
lib/Vend/Payment/Skipjack.pm
+lib/Vend/Payment/TCLink.pm
lib/Vend/Payment/WellsFargo.pm
lib/Vend/Payment/iTransact.pm
lib/Vend/RefSearch.pm
2.31 +8 -0 interchange/WHATSNEW
rev 2.31, prev_rev 2.30
Index: WHATSNEW
=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/WHATSNEW,v
retrieving revision 2.30
retrieving revision 2.31
diff -u -r2.30 -r2.31
--- WHATSNEW 1 Aug 2002 04:30:56 -0000 2.30
+++ WHATSNEW 5 Aug 2002 04:05:39 -0000 2.31
@@ -36,6 +36,14 @@
* Add First and Last links to more-list, with ability to customize via
[first-anchor] and [last-anchor] containers.
=20
+* Add new menu editor and menu system. It is based around Vend::Menu
+ and the new tag [menu ...], which builds various types of DHTMl and
+ standard HTML menus based on browser type.
+
+ The menu editor can edit simple menus or tree-based menus. Eventually
+ all UI menus will use this, and a simple menu component (i.e. a link lis=
t)
+ can be placed in the public-facing catalog.
+
* New support for database-native sequences for MySQL, PostgreSQL, and Ora=
cle:
=20
- To do a minimal sequenced table, all you need to do is:
1.4 +14 -0 interchange/code/SystemTag/attr_list.coretag
rev 1.4, prev_rev 1.3
Index: attr_list.coretag
=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/code/SystemTag/attr_list.coretag,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- attr_list.coretag 18 Feb 2002 01:00:21 -0000 1.3
+++ attr_list.coretag 5 Aug 2002 04:05:40 -0000 1.4
@@ -11,3 +11,17 @@
return Vend::Interpolate::tag_attr_list($body, $opt);
}
EOR
+
+UserTag uc-attr-list addAttr
+UserTag uc-attr-list hasEndTag
+UserTag uc-attr-list PosNumber 0
+UserTag uc-attr-list noRearrange
+UserTag uc-attr-list Routine <<EOR
+sub {
+ my ($opt, $body) =3D @_;
+ if( ref $opt->{hash} ) {
+ $opt =3D $opt->{hash};
+ }
+ return Vend::Interpolate::tag_attr_list($body, $opt, 1);
+}
+EOR
1.1 interchange/code/SystemTag/image.tag
rev 1.1, prev_rev 1.0
Index: image.tag
=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
UserTag image Version 0.03
UserTag image Order src
UserTag image AddAttr
UserTag image Documentation <<EOD
=3Dhead2 image
This is a general-purpose tag for inserting HTML <img> tags based on
various settings, with the ability to test whether an image exists,
predetermine its pixel dimensions, retrieve the image name from the
product database field B<image> for that sku, automatically pull product
descriptions from the database for use in the B<alt> and B<title>
attributes, and access http/secure and storefront/admin UI image
directory names.
A convenient use is for displaying product images, for example on the
flypage:
[image [item-code]]
Given sku os29000 in the Foundation demo, and assuming the products
database specifies os29000.gif in the B<image> field for os29000,
the tag returns HTML code something like this:
<img src=3D"/foundation/images/os29000.gif" width=3D120 height=3D150
alt=3D"3' Step Ladder" title=3D"3' Step Ladder">
If file os29000.gif hadn't existed, or the products database B<image>
field were empty, the tag would check for files called "(sku).jpg",
"(sku).gif", etc. and use the first one it found.
You can also specify a particular image filename, but also give the
sku to look up the description in the database:
[image sku=3D"[item-code]" src=3D"/foundation/silly/putty.jpg"]
You can force the use of an image filename even if the file doesn't
exist (for example, if it is on a different server). Any absolute URL
(http://... or https://...) is always accepted without checking, and
the B<force> attribute overrides checking on any filename.
One peculiar use is with the B<dir_only> parameter to return the correct
prefix for images (normal or secure), primarily for adding to image names
found in e.g. JavaScript code (rollovers, etc.) that we can't hope to
have Interchange parse on its own as it does for plain HTML by default.
Parameters for this tag are:
=3Dover 4
=3Ditem alt
Text to use for the <img alt=3D"..."> attribute. By default, this will
be filled with the B<description> from the product database if a sku (not
a filename) is provided.
=3Ditem default
Set this attribute to an image filename or relative or absolute URL
to use if the file named in the B<src> attribute or the filename
found in the product table B<image> field are not found.
Defaults to scratch mv_defaultimage if set.
=3Ditem descriptionfields
A whitespace-separated list of fields in the product database from which
to draw the description, used as the default in alt and title attributes.
Catalog variable DESCRIPTIONFIELDS is a fallback if this option is not
passed in.
=3Ditem dir_only
Set this attribute to 1 to return only the text of configuration
variable ImageDir or ImageDirSecure, depending on whether the page is
being delivered through the web server by http or https.
=3Ditem exists_only
Set this attribute to 1 if you want to check only whether an appropriate
image file exists. The tag will return '1' if an image exists, and nothing
if not.
=3Ditem force
Skip checking for existence of image file.
=3Ditem getsize
Use the Perl Image::Size module, if available, to determine the image's
width and height in pixels, and pass them as arguments to the <img> tag.
This is the default behavior; pass B<getsize=3D0> to disable.
=3Ditem imagesubdir
Look for any image filenames in the named subdirectory of the ImageDir,
rather than directly in the ImageDir.
For example, with the Foundation demo, the individual product images are
in the subdirectory B<items/>, so you would set B<imagesubdir=3Ditems>. This
is better than passing in B<src=3D"items/os28009.gif"> because the tag
knows the sku and can do products database lookups based on it.
Defaults to scratch mv_imagesubdir if set.
=3Ditem secure
This attribute forces using either secure or insecure image directories,
regardless of the actual current delivery method. Set to 1 to force
secure, 0 to force insecure. Note that this is not a quick way to force
using a secure B<URL> -- just a secure directory path.
=3Ditem sku
Specify a sku explicitly if you want to first try an arbitrarily-named
image in B<src>, then if it does not exist, fall back to sku-derived
image filenames.
=3Ditem src
Image filename to use. May also be a plain sku, or an image basename
which will be tried with various image suffixes (.jpg, .gif, .png, etc.)
=3Ditem title
Text to use for the <img title=3D"..."> attribute, used by more recent
browsers for e.g. rollover tip text display. This attribute defaults the
same text as the B<alt> attribute.
=3Ditem ui
Set this attribute to 1 to use admin UI image URL prefixes in catalog or
global variables UI_IMAGE_DIR and UI_IMAGE_DIR_SECURE instead of regular
catalog image prefixes from ImageDir and ImageDirSecure.
=3Dback
EOD
UserTag image Routine <<EOR
sub {
my ($src, $opt) =3D @_;
my ($image, $path, $secure, $sku);
my ($imagedircurrent, $imagedir, $imagedirsecure);
my @descriptionfields =3D grep /\S/, split /\s+/,
$opt->{descriptionfields} || $::Variable->{DESCRIPTIONFIELDS};
@descriptionfields =3D qw( description ) if ! @descriptionfields;
my @imagefields =3D qw( image );
my @imagesuffixes =3D qw( jpg gif png jpeg );
my $filere =3D qr/\.\w{2,4}$/;
my $absurlre =3D qr/^(?i:https?)/;
if ($opt->{ui}) {
# unless no image dir specified, add locale string
my $locale =3D $Scratch->{mv_locale} ? $Scratch->{mv_locale} : 'en_US';
$imagedir =3D $::Variable->{UI_IMAGE_DIR}
|| $Global::Variable->{UI_IMAGE_DIR};
$imagedirsecure =3D $::Variable->{UI_IMAGE_DIR}
|| $Global::Variable->{UI_IMAGE_DIR};
for ($imagedir, $imagedirsecure) {
if ($_) {
$_ .=3D '/' if substr($_, -1, 1) ne '/';
$_ .=3D $locale . '/';
}
}
} else {
$imagedir =3D $Vend::Cfg->{ImageDir};
$imagedirsecure =3D $Vend::Cfg->{ImageDirSecure};
}
# make sure there's a trailing slash on directories
for ($imagedir, $imagedirsecure) {
$_ .=3D '/' if $_ and substr($_, -1, 1) ne '/';
}
if (defined $opt->{secure}) {
$secure =3D $opt->{secure} ? 1 : 0;
} else {
$secure =3D $CGI::secure;
}
$imagedircurrent =3D $secure ? $imagedirsecure : $imagedir;
return $imagedircurrent if $opt->{dir_only};
$opt->{getsize} =3D 1 unless defined $opt->{getsize};
$opt->{imagesubdir} ||=3D $::Scratch->{mv_imagesubdir}
if defined $::Scratch->{mv_imagesubdir};
$opt->{default} ||=3D $::Scratch->{mv_imagedefault}
if defined $::Scratch->{mv_imagedefault};
if ($opt->{sku}) {
$sku =3D $opt->{sku};
} else {
# assume src option is a sku if it doesn't look like a filename
if ($src !~ /$filere/) {
$sku =3D $src;
undef $src;
}
}
if($opt->{name_only} and $src) {
return $src =3D~ /$absurlre/ ? $src : "$imagedircurrent$src";
}
if ($src =3D~ /$absurlre/) {
# we have no way to check validity of full URLs,
# so we just assume they're good
$image =3D $src;
} else {
my @srclist;
push @srclist, $src if $src;
if ($sku) {
# check all products tables for image fields
for ( @{$Vend::Cfg->{ProductFiles}} ) {
my $db =3D Vend::Data::database_exists_ref($_)
or die "Bad database $_?";
$db =3D $db->ref();
my $view =3D $db->row_hash($sku)
if $db->record_exists($sku);
if (ref $view eq 'HASH') {
for (@imagefields) {
push @srclist, $view->{$_} if $view->{$_};
}
# grab product description for alt attribute
unless (defined $opt->{alt}) {
for (@descriptionfields) {
($opt->{alt} =3D $view->{$_}, last)
if $view->{$_};
}
}
}
}
}
push @srclist, $sku if $sku;
push @srclist, $opt->{default} if $opt->{default};
if ($opt->{imagesubdir}) {
$opt->{imagesubdir} .=3D '/' unless $opt->{imagesubdir} =3D~ m:/$:;
}
my $dr =3D $::Variable->{DOCROOT};
my $id =3D $imagedircurrent;
$id =3D~ s:/+$::;
$id =3D~ s:/~[^/]+::;
IMAGE_EXISTS:
for my $try (@srclist) {
($image =3D $try, last) if $try =3D~ /$absurlre/;
$try =3D $opt->{imagesubdir} . $try;
my @trylist;
if ($try and $try !~ /$filere/) {
@trylist =3D map { "$try.$_" } @imagesuffixes;
} else {
@trylist =3D ($try);
}
for (@trylist) {
if ($id and m{^[^/]}) {
if ($opt->{force} or ($dr and -f "$dr$id/$_")) {
$image =3D $_;
$path =3D "$dr$id/$_";
}
} elsif (m{^/}) {
if ($opt->{force} or ($dr and -f "$dr/$_")) {
$image =3D $_;
$path =3D "$dr/$_";
}
}
last IMAGE_EXISTS if $image;
}
}
return unless $image;
return 1 if $opt->{exists_only};
if ($opt->{getsize} and $path) {
eval {
require Image::Size;
my ($width, $height) =3D Image::Size::imgsize($path);
($opt->{width}, $opt->{height}) =3D ($width, $height)
if $width and $height;
};
}
}
$opt->{title} =3D $opt->{alt} if ! defined $opt->{title} and $opt->{alt};
my $opts =3D '';
for (qw: width height alt title border hspace vspace :) {
if (defined $opt->{$_}) {
my $val =3D $opt->{$_};
$val =3D '"' . HTML::Entities::encode($val) . '"'
if $val =3D~ /\W/;
$val =3D '""' if $val eq '';
$opts .=3D qq{ $_=3D$val};
}
}
if($opt->{extra}) {
$opts .=3D " $opt->{extra}";
}
$image =3D $imagedircurrent . $image unless
$image =3D~ /$absurlre/ or substr($image, 0, 1) eq '/';
$image =3D~ s/"/"/g;
return qq{<img src=3D"$image"$opts>};
}
EOR
1.1 interchange/code/SystemTag/menu.coretag
rev 1.1, prev_rev 1.0
Index: menu.coretag
=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
UserTag menu Order name
UserTag menu hasEndTag
UserTag menu addAttr
UserTag menu noReparse
UserTag menu Routine <<EOR
require Vend::Menu;
sub {
return Vend::Menu::menu(@_);
}
EOR
1.2 +53 -267 interchange/dist/foundation/templates/components/produ=
ct_tree
rev 1.2, prev_rev 1.1
Index: product_tree
=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/foundation/templates/components/product=
_tree,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- product_tree 3 Aug 2002 21:37:29 -0000 1.1
+++ product_tree 5 Aug 2002 04:05:40 -0000 1.2
@@ -4,16 +4,57 @@
ui_name: product_tree
ui_class: vertical
ui_group: Navigation
-ui_label: Vertical category list
+ui_label: Products Tree
ui_source: templates/components/product_tree
=20
tree_selector:
- advanced: 1
help: Defines which tree menu is selected
label: Tree name
db: tree
lookup: mgroup
type: select
+
+no_image:
+ help: Use '+' and '-' instead of folder icons
+ label: No images
+ widget: yesno
+
+link_class:
+ help: Set the class for links (default 'barlink')
+ label: Link CSS class
+ default: barlink
+ widget: text
+ width: 16
+
+link_class_open:
+ help: Set the CSS class for toggled open entries (default same as Link CS=
S class)
+ label: Open CSS class
+ widget: text
+ width: 16
+
+link_class_closed:
+ help: Set the CSS class for toggled closed entries (default same as Link =
CSS class)
+ label: Closed CSS class
+ widget: text
+ width: 16
+
+link_style:
+ help: Set the CSS style for links (default is blank)
+ label: Link CSS style
+ widget: text
+ width: 60
+
+link_open_style:
+ help: Set the CSS style for toggled open links (default "font-size: large=
r;")
+ label: Open CSS style
+ widget: text
+ width: 60
+
+link_style:
+ help: Set the CSS style for toggled closed links (default "font-size: lar=
ger;")
+ label: Open CSS style
+ widget: text
+ width: 60
[/comment]
=20
<!-- BEGIN COMPONENT [control component product_tree] -->
@@ -23,271 +64,16 @@
<tr>=20
<td valign=3D"top" class=3D"categorybar">
=20
-[tmpn OLDBROWSER][/tmpn]
-[if type=3Dsession term=3Dbrowser op=3D"!~" compare=3D"/MSIE [5-9].*Window=
s|Mozilla.*Gecko/"]
-[set OLDBROWSER]1[/set]
-[/if]
-
-[goto name=3DOLDBROWSER if=3D"[scratch OLDBROWSER]"]
-
-<P>
-<A HREF=3D"javascript:do_explode(); void(0)" class=3Dbarlink>Explode tree<=
/A><br>
-<A HREF=3D"javascript:do_collapse(); void(0)" class=3Dbarlink>Collaps tree=
</A><br>
-</P>
-<script>
- var lines =3D new Array;
-[tmpn tmp_field_vars][/tmpn]
-[tree start=3DProducts
- table=3Dtree
- master=3Dparent_fld
- subordinate=3Dcode
- autodetect=3D1
- toggle=3Dtoggle
- sort=3Dcode
- iterator=3Djsline
- full=3D1
- spacing=3D4
- ][item-sub jsline]
-sub {
- my $loopname =3D shift;
- my $row =3D shift;
- $loopinc =3D 0 if ! defined $loopinc;
-
-#Debug("loopname=3D$loopname row=3D" . uneval($row));
- $loopname =3D~ s/^\s+//;
- $loopname =3D~ s/\s+$//;
- my $fields;
- $loopname =3D~ s/[\s,]+(.*)//s
- and $fields =3D $1;
- $fields ||=3D q{
- code
- parent_fld
- mv_level
- mv_children
- mv_increment
- page
- form
- name
- description};
- $fields =3D~ s/^\s+//;
- my @fields =3D split /[\s,\0]+/, $fields;
-#Debug("form=3D$row->{form}");
- if($row->{page}) {
- my $form =3D $row->{form};
- if($form) {
- $form =3D~ s/&/\n/g;
- $form .=3D "\nopen=3D";
- }
- else {
- $form =3D 'open=3D';
- }
- $row->{page} =3D $Tag->area( { href =3D> $row->{page}, form =3D> $form }=
);
- }
- $row->{description} =3D $Tag->filter('encode_entities', $row->{descriptio=
n});
- my @values =3D @{$row}{@fields};
-
- if(! $Scratch->{tmp_field_vars}) {
- push @fields, 'open';
- my @out;
- for(my $i =3D 0; $i < @fields; $i++) {
- push @out, " var \U$fields[$i]\E =3D $i;";
- }
- $Scratch->{tmp_field_vars} =3D join "\n", @out;
- pop @fields;
- }
-
- for(@values) {
- my $foundit =3D '';
- if(s/^\s*{\s+//) {
- s/(,?\s*\}\s*)$//;
- $foundit =3D 1;
- }
- s/\\'/-_ESC_QUOTE_-/g;
- s/'/\\'/g;
- s/\r+$/' + "\\r"/g;
- s/\r/' + "\\r" + '/g;
- s/-_ESC_QUOTE_-/\\\\\\'/g;
- if($foundit) {
- $_ =3D "{" . $_ . "}";
- }
- if(/\D/) {
- $_ =3D qq{'$_'};
- }
- }
- my $out =3D "$loopname\[" . $loopinc++ . "] =3D [" . join(", ", @values)=
. "];";
- return $out;
-}
-[/item-sub]lines[/tree]
-
-[calc]
- my $out =3D ' var openstatus =3D [';
- $out .=3D join ",", split //, $CGI->{open};
- $out .=3D "];\n";
- $out .=3D " var explode =3D ";
- $out .=3D $CGI->{explode} ? 1 : 0;
- $out .=3D ";\n";
- $out .=3D " var collapse =3D ";
- $out .=3D $CGI->{collapse} ? 1 : 0;
- $out .=3D ";\n";
- return $out;
-[/calc]
-
-[scratch tmp_field_vars]
-
-[restrict log=3Dnone]
- var next_level =3D 0;
- var openstring =3D '';
-
- function tree_link (idx) {
-
- var out =3D '';
- var treebox;
-
- var l =3D lines[idx];
-
- if(l =3D=3D undefined) {
- do_alert("Bad idx=3D" + idx + ", no line there.");
- return;
- }
-
- if(l[MV_LEVEL] > next_level)
- return '';
- // return 'next_level=3D' + next_level + ', mv_level=3D' + l[MV_LEVEL] =
+ '<br>';
-// alert("line is " + l);
- var i;
- var needed =3D l[MV_LEVEL];
- for(i =3D 1; i <=3D needed; i++)
- out =3D out + ' ';
-
- if(l[MV_CHILDREN] > 0) {
- out =3D out + '<a href=3D"javascript:toggit(' + idx + ');void(0)">';
- var iname;
- if(openstatus[idx] =3D=3D 1) {
- iname =3D "__IMAGE_DIR__/" + "folder.open.gif";
- out =3D out + '<img src=3D' + '"' + iname + '" border=3D0 align=3Dabsb=
ottom>';
- next_level =3D l[MV_LEVEL] + 1;
- }
- else {
- iname =3D "__IMAGE_DIR__/folder.gif";
- out =3D out + '<img src=3D' + '"' + iname + '" border=3D0 align=3Dabsb=
ottom>';
- next_level =3D l[MV_LEVEL];
- }
- out =3D out + '</a>';
- }
- else {
- out =3D out + '<img'; // > Defeate image subst
- out =3D out + ' src=3D"' + '__IMAGE_DIR__/bg.gif" height=3D22';
- out =3D out + ' width=3D20 border=3D0 align=3Dabsbottom>';
- next_level =3D l[MV_LEVEL];
- }
-
- if(l[PAGE]) {
- out =3D out + '<a class=3Dbarlink href=3D"' + l[PAGE] + openstring + '"=
';
- out =3D out + ' onDblClick=3D"toggit(' + idx + ')"';
- if(l[DESCRIPTION])
- out =3D out + ' title=3D"' + l[DESCRIPTION] + '"';
- out =3D out + '>';
- out =3D out + l[NAME] + '</a>';
- }
- else {
- out =3D out + l[NAME];
- }
- // out =3D out + ' level=3D' + l[MV_LEVEL] + ' children=3D' + l[MV_CHILD=
REN];
- // out =3D out + ' needed=3D' + needed + ", next_level=3D" + next_level;
- out =3D out + '<br>';
-
- return out;
- }
-
- function toggit (idx) {
-
- var l =3D lines[idx];
- if(l =3D=3D undefined) {
- alert("bad index " + idx);
- return;
- }
- if(l[MV_CHILDREN] < 1) {
- alert("nothing to toggle at index " + idx);
- return;
- }
-
- openstatus[idx] =3D openstatus[idx] =3D=3D 1 ? 0 : 1;
- openstring =3D openstatus.join('');
- openstring =3D openstring.replace(/0+$/, '');
- rewrite_tree();
- }
-
- function do_explode () {
- for(var i =3D 0; i < lines.length; i++)
- openstatus[i] =3D 1;
- rewrite_tree();
- }
-
- function do_collapse () {
- for(var i =3D 0; i < lines.length; i++)
- openstatus[i] =3D 0;
- rewrite_tree();
- }
-
-
- function rewrite_tree () {
- var thing =3D '';
- for(i =3D 0; i < lines.length; i++) {
- thing =3D thing + tree_link(i);
- }
- treebox.innerHTML =3D thing;
- next_level =3D 0;
- }
-
-</script>
-[/restrict]
-
-<div id=3Dtreebox style=3D"Visibility: Visible">
-Test.
-</div>
-
-<script>
- treebox =3D document.getElementById('treebox');
- if(collapse =3D=3D 1 || explode =3D=3D 1) {
- openstatus.length =3D 0;
- }
- for( var i =3D 0; i < lines.length; i++) {
- if(openstatus[i] =3D=3D undefined)
- openstatus[i] =3D explode;
- }
- collapse =3D 0;
- explode =3D 0;
- openstring =3D openstatus.join('');
- openstring =3D openstring.replace(/0+$/, '');
- rewrite_tree();
-</script>
-
-[goto LAST]
-
-
-[label OLDBROWSER]
-
-<P>
-<a href=3D"[area href=3D@@MV_PAGE@@ form=3D"explode=3D1"]" class=3Dbarlink=
>Explode tree</A><br>
-<a href=3D"[area href=3D@@MV_PAGE@@ form=3D"collapse=3D1"]" class=3Dbarlin=
k>Collapse tree</A>
-</P>
-
-[tree start=3D"[control tree_selector Products]"
- table=3Dtree
- master=3Dparent_fld
- subordinate=3Dcode
- autodetect=3D1
- toggle=3Dtoggle
- memo=3Dmemo
- sort=3Dcode
- collapse=3Dcollapse
- explode=3Dexplode
- spacer=3D" "
- spacing=3D4
- iterator=3Dtree_link
- /]
-
-[label LAST]
+[menu tree-selector=3D"[control tree_selector Products]"
+ link-class=3D"[control link_class barlink]"
+ link-style=3D"[control link_style]"
+ link-class-open=3D"[control link_class_open]"
+ link-style-open=3D"[control link_style_open font-size: larger;]"
+ link-class-closed=3D"[control link_class_closed]"
+ link-style-closed=3D"[control link_style_closed font-size: larger;]"
+ no-image=3D"[control no_image]"
+ menu-type=3Dtree
+ reparse=3D0][/menu]
=20
</td>
</tr>
2.5 +5 -1 interchange/dist/lib/UI/pages/admin/menu_editor.html
rev 2.5, prev_rev 2.4
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.4
retrieving revision 2.5
diff -u -r2.4 -r2.5
--- menu_editor.html 3 Aug 2002 21:23:32 -0000 2.4
+++ menu_editor.html 5 Aug 2002 04:05:40 -0000 2.5
@@ -16,6 +16,10 @@
@_UI_STD_HEAD_@
<!-- ----- BEGIN REAL STUFF ----- -->
=20
+[loop list=3D"tree __MV_TREE_TABLE__"]
+[flag type=3Dwrite table=3D"[loop-code]"]
+[/loop]
+
[seti medit_tables]
__MV_TREE_TABLE__
__ProductFiles_0__
@@ -25,7 +29,7 @@
[/seti]
=20
[perl tables=3D"[scratch medit_tables]"]
- my $menupath =3D $Variable->{MENU_DIRECTORY} || 'include/menus';
+ my $menupath =3D $Variable->{MV_MENU_DIRECTORY} || 'include/menus';
@menufields =3D qw/code mgroup inactive msort page form name description =
extended/;
=20
$Tag->tmp('qmenu_fdata');
2.4 +3 -42 interchange/dist/lib/UI/pages/admin/quicklinks.html
rev 2.4, prev_rev 2.3
Index: quicklinks.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/quicklinks.html,v
retrieving revision 2.3
retrieving revision 2.4
diff -u -r2.3 -r2.4
--- quicklinks.html 2 Aug 2002 06:14:33 -0000 2.3
+++ quicklinks.html 5 Aug 2002 04:05:40 -0000 2.4
@@ -30,57 +30,18 @@
[seti win][data session arg][/seti]
[/if]
=20
-[loop prefix=3Dmenu
- head-skip=3D1
- list=3D"[file include/menus/Quicklinks.txt]"
- lr=3D1
-][on-match][menu-exec menu_link]Just gets fieldnames[/menu-exec][/on-match]
-[menu-sub menu_link]
-sub {
- my $attrlist =3D shift;
-
- # Set to a default if not passed
- $attrlist =3D <<EOF unless $attrlist =3D~ /\S/;
+[menu menu-type=3Dsimple name=3DQuicklinks]
{PAGE:}
<b>{NAME}:</b>
<br>
-{/PAGE:}
-
-{PAGE?}
-
-<a href=3D"{HREF}"{DESCRIPTION?} title=3D"{DESCRIPTION}"{/DESCRIPTION?}>{N=
AME}</a><br>
-{/PAGE?}
-EOF
-
- my $row =3D shift;
- if(ref($row) eq 'HASH') {
- @menu_fieldnames =3D map { uc($_) } @{$row->{object}{mv_field_names}};
- return;
- }
- my %line;
- @line{@menu_fieldnames} =3D @$row;
- if($line{MGROUP} and $CGI->{mgroup} !~ /\b$line{MGROUP}\b/) {
- return;
- }
- return '<br>' unless $line{NAME};
- return $line{NAME} if ! $line{PAGE} and $line{NAME} =3D~ /^\s*</;
- $line{WIN} =3D $Scratch->{win};
- $line{HREF} =3D $Tag->area( { href =3D> $line{PAGE}, form =3D> $line{FORM=
} });
- $line{NAME} =3D errmsg($line{NAME});
- $line{DESCRIPTION} =3D~ s/"/"/g;
- return $Tag->attr_list(\%line, $attrlist);
-}
-[/menu-sub]
-[menu-exec menu_link]{PAGE:}
- <b>{NAME}:</b>
- <br>
{/PAGE:}{PAGE?}
<a
target=3D"mainwindow{WIN}"
href=3D"{HREF}"{DESCRIPTION?}
title=3D"{DESCRIPTION}"{/DESCRIPTION?}>{NAME}</a><br>
-{/PAGE?}[/menu-exec][/loop]
+{/PAGE?}
+[/menu]
=20
</FONT>
</TD>
2.100 +27 -12 interchange/lib/Vend/Interpolate.pm
rev 2.100, prev_rev 2.99
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.99
retrieving revision 2.100
diff -u -r2.99 -r2.100
--- Interpolate.pm 3 Aug 2002 04:20:30 -0000 2.99
+++ Interpolate.pm 5 Aug 2002 04:05:40 -0000 2.100
@@ -1,6 +1,6 @@
# Vend::Interpolate - Interpret Interchange tags
#=20
-# $Id: Interpolate.pm,v 2.99 2002/08/03 04:20:30 mheins Exp $
+# $Id: Interpolate.pm,v 2.100 2002/08/05 04:05:40 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.99 $, 10);
+$VERSION =3D substr(q$Revision: 2.100 $, 10);
=20
@EXPORT =3D qw (
=20
@@ -4066,7 +4066,7 @@
}
=20
sub tag_attr_list {
- my ($body, $hash) =3D @_;
+ my ($body, $hash, $ucase) =3D @_;
if(! ref $hash) {
$hash =3D string_to_ref($hash);
if($@) {
@@ -4074,6 +4074,18 @@
}
return undef if ! ref $hash;
}
+ if($ucase) {
+ $body =3D~ s!\{($Codere)\}!$hash->{"\L$1"}!g;
+ $body =3D~ s!\{($Codere)\?($Codere)\:($Codere)\}!
+ length($hash->{lc $1}) ? $hash->{lc $2} : $hash->{lc $3}
+ !eg;
+ $body =3D~ s!\{($Codere)\|($Some)\}!$hash->{lc $1} || $2!eg;
+ $body =3D~ s!\{($Codere)\s+($Some)\}! $hash->{lc $1} ? $2 : ''!eg;
+ 1 while $body =3D~ s!\{($Codere)\?\}($Some){/\1\?\}! $hash->{lc $1} ? $2=
: ''!eg;
+ 1 while $body =3D~ s!\{($Codere)\:\}($Some){/\1\:\}! $hash->{lc $1} ? ''=
: $2!eg;
+ $body =3D~ s!\{(\w+)\:+(\w+)\:+(.*?)\}! tag_data($1, $2, $3) !eg;
+ }
+ else {
$body =3D~ s!\{($Codere)\}!$hash->{$1}!g;
$body =3D~ s!\{($Codere)\?($Codere)\:($Codere)\}!
length($hash->{$1}) ? $hash->{$2} : $hash->{$3}
@@ -4083,6 +4095,7 @@
1 while $body =3D~ s!\{($Codere)\?\}($Some){/\1\?\}! $hash->{$1} ? $2 : '=
'!eg;
1 while $body =3D~ s!\{($Codere)\:\}($Some){/\1\:\}! $hash->{$1} ? '' : $=
2!eg;
$body =3D~ s!\{(\w+)\:+(\w+)\:+(.*?)\}! tag_data($1, $2, $3) !eg;
+ }
return $body;
}
=20
@@ -4316,7 +4329,6 @@
last =3D> \&interpolate_html,
next =3D> \&interpolate_html,
options =3D> \&tag_options,
- tag =3D> \&tag_dispatch,
);
=20
use vars qw/%Hash_code/;
@@ -4328,7 +4340,6 @@
last =3D> \&interpolate_html,
next =3D> \&interpolate_html,
options =3D> \&tag_options,
- tag =3D> \&tag_dispatch,
);
=20
sub map_list_routines {
@@ -4359,13 +4370,13 @@
if($ac =3D $opt->{maproutine}) {
$nc ||=3D {};
if(! ref($ac) ) {
- $ac =3D~ s/\s+$//;
- $ac =3D~ s/^\s+//;
- $ac =3D { split /[\s,=3D\0]/, $ac };
+ $ac =3D~ s/[\s'",=3D>\0]+$//;
+ $ac =3D~ s/^[\s'",=3D>\0]+//;
+ $ac =3D { split /[\s'",=3D>\0]+/, $ac };
}
$ac =3D {} if ref($ac) ne 'HASH';
- for(keys %$ac) {
- $nc->{$_} =3D $Vend::Cfg->{Sub}{$_} || $Global::GlobalSub->{$_}
+ while( my($k,$v) =3D each %$ac) {
+ $nc->{$k} =3D $Vend::Cfg->{Sub}{$v} || $Global::GlobalSub->{$v}
or do {
logError("%s: non-existent mapped routine %s.", $type, $_);
delete $nc->{$_};
@@ -4426,7 +4437,9 @@
my $oexec =3D { %$opt };
=20
if($opt->{iterator}) {
- my $sub =3D $Vend::Cfg->{Sub}{$opt->{iterator}}
+ my $sub;
+ $sub =3D $opt->{iterator} if ref($opt->{iterator}) eq 'CODE';
+ $sub ||=3D $Vend::Cfg->{Sub}{$opt->{iterator}}
|| $Global::GlobalSub->{$opt->{iterator}};
if(! $sub) {
logError(
@@ -4581,7 +4594,9 @@
my $oexec =3D { %$opt };
=20
if($opt->{iterator}) {
- my $sub =3D $Vend::Cfg->{Sub}{$opt->{iterator}}
+ my $sub;
+ $sub =3D $opt->{iterator} if ref($opt->{iterator}) eq 'CODE';
+ $sub ||=3D $Vend::Cfg->{Sub}{$opt->{iterator}}
|| $Global::GlobalSub->{$opt->{iterator}};
if(! $sub) {
logError(
2.1 interchange/lib/Vend/Menu.pm
rev 2.1, prev_rev 2.0