Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Vend 0.3.4
  • Loading branch information
Andrew M. Wilcox authored and jonjensen committed Jan 2, 2009
1 parent 38df6af commit 537db7e
Show file tree
Hide file tree
Showing 13 changed files with 800 additions and 645 deletions.
47 changes: 47 additions & 0 deletions ChangeLog
@@ -1,3 +1,50 @@
Tue Jan 30 23:34:55 1996 Andrew Wilcox <awilcox@maine.com>

* Vend/Startup.pm, setup: Version 0.3.4.

* setup (configuration): take out Dump_session directive.
(parse_url): accept "https:" without warning.

* Vend/Util.pm (wrap, fill_table, file_modification_time): new functions.

* Vend/Table/Import.pm (import_ascii_delimited):
fix bug where trailing empty fields were
getting dropped.

* Vend/Orders.pm (order_body):
call die() if the report file can't be opened.

* Vend/Startup.pm (startup):
call setup() in modules before starting server, and init()
afterwards. Initialize session after starting the server.
(run_module_setup_functions, run_module_init_functions): new
functions.
(aquire_server_lock, become_daemon, run_server_in_foreground,
run_deamon_server): new functions.
(run_server): moved here from Server.pm. Now kills a running Vend
server before starting the new one.

* Vend/Server.pm (run_server): moved to Startup.pm.
(restart_server): deleted.

* Vend/Dispatch.pm:
No longer dump error and warning tracebacks to the screen, but only
include them in the error log file.
(dispatch): don't perform traceback if error begins with "ABORT:".
(interaction_error): now calls die().
(_display_page): take out $Debug argument.
(report): new function, synonym for report_error().

* Vend/Dispatch.pm, Vend/Directive.pm, Vend/Builtin.pm:
Documentation update.

* Vend/Shopcart.pm: New module.

Wed Dec 20 18:24:52 1995 Andrew Wilcox <awilcox@maine.com>

* Vend/Table/GDBM.pm (row, each_record):
wasn't splitting out trailing empty field values.

Fri Dec 15 21:55:28 1995 Andrew Wilcox <awilcox@maine.com>

* Vend/Startup.pm, setup: Version 0.3.3
Expand Down
64 changes: 62 additions & 2 deletions Vend/Builtin.pm
@@ -1,6 +1,6 @@
# Builtin.pm: defines placeholders available to all Vend applications
#
# $Id: Builtin.pm,v 1.9 1995/11/28 18:30:21 amw Exp $
# $Id: Builtin.pm,v 1.10 1996/01/30 23:10:08 amw Exp $
#
package Vend::Builtin;

Expand All @@ -27,10 +27,39 @@ use Vend::Session;
use Vend::Page;


=head1 NAME
Vend::Builtin - Common placeholder definitions for all applications
=head1 FUNCTIONS
=head2 C<[message]>
Returns the contents of the global variable $Vend::Message, which is
used to display messages such as fields in the shopping list that have
to be filled in.
=cut

define_placeholder '[message]', sub {
$Vend::Message;
};

=head2 C<[page-url "name"]>
Returns the URL which references the specified catalog page.
Names that start with a "/" are absolute names, rooted in the
C<Page-directory> as defined in the configuration file.
Names that don't start with a "/" are relative to the current
page being displayed.
Using a relative page name serves the same purpose as using a relative
URL in HTML. The difference is that the location of the page is
determined by Vend instead of by the browser. The page-url
placeholder always returns a fully qualified URL.
=cut

define_placeholder '[page-url $pg]', sub {
my ($pg) = @_;
my ($path, $base);
Expand All @@ -47,10 +76,29 @@ define_placeholder '[page-url $pg]', sub {
}
};

=head2 C<[default-page-url]>
Returns a URL refering to the default page of the catalog. The name
of the default page is specified by the Default_page directive.
=cut

define_placeholder '[default-page-url]', sub {
vend_url(Default_page);
};

=head2 C<[external-url $img]>
Inline images and other non-textual entities are served directly by
your HTTPD server and do not go through Vend. You can set up an
C<External-directory> parallel to your C<Page-directory> structure, if
you wish. This is particularly handy for inline images. Absolute
names beginning with a "/" are rooted in the C<External-URL>.
Relative names, those which don't start with a "/", use the parallel
location to the page currently being displayed.
=cut

define_placeholder '[external-url $img]', sub {
my ($img) = @_;
my ($path, $base);
Expand All @@ -67,7 +115,11 @@ define_placeholder '[external-url $img]', sub {
}
};

# Returns the text of the user entered field.
=head2 C<[value $field]>
Returns the value of the user-entered field.
=cut

define_placeholder '[value $field]', sub {
my ($field) = @_;
Expand All @@ -83,6 +135,14 @@ define_placeholder '[value $field]', sub {
};


=head2 C<[checked-if $field $value]>
This placeholder is used in a checkbox input field tag to include the
"checked" attribule. Returns "checked" if the C<field> currently has
the specified C<value>, and returns nothing ("") if not.
=cut

define_placeholder '[checked-if $field $value]', \&checked_if;

sub checked_if {
Expand Down
18 changes: 17 additions & 1 deletion Vend/Directive.pm
@@ -1,6 +1,6 @@
# Directive.pm: provides access to configuration directives
#
# $Id: Directive.pm,v 1.5 1995/10/30 19:51:51 amw Exp $
# $Id: Directive.pm,v 1.6 1996/01/30 23:17:30 amw Exp $
#
package Vend::Directive;

Expand All @@ -24,6 +24,22 @@ use Carp;
use strict;
no strict 'refs';

=head1 NAME
Vend::Directive - Access configuration directives
=head1 SYNOPSIS
use Vend::Directive qw(Data_directory Mail_order_to);
=head1 DESCRIPTION
For each directive listed, a subroutine is created in the caller's
namespace which returns the value of the configuration directive of
the same name.
=cut

sub import {
my ($package) = caller;
my $val;
Expand Down

0 comments on commit 537db7e

Please sign in to comment.