just about to copy adrian's templates in
authorTony Cook <tony@develop-help.com>
Mon, 10 Mar 2003 06:36:18 +0000 (06:36 +0000)
committertony <tony@45cb6cf1-00bc-42d2-bb5a-07f51df49f94>
Mon, 10 Mar 2003 06:36:18 +0000 (06:36 +0000)
36 files changed:
MANIFEST
Makefile
schema/bse.sql
schema/mysql_build.pl
site/cgi-bin/admin/add.pl
site/cgi-bin/admin/makeIndex.pl
site/cgi-bin/admin/shopadmin.pl
site/cgi-bin/admin/subs.pl
site/cgi-bin/bse.cfg
site/cgi-bin/modules/Article.pm
site/cgi-bin/modules/BSE/DB/Mysql.pm
site/cgi-bin/modules/BSE/Edit/Article.pm
site/cgi-bin/modules/BSE/Edit/Catalog.pm
site/cgi-bin/modules/BSE/Edit/Product.pm
site/cgi-bin/modules/BSE/Util/Tags.pm
site/cgi-bin/modules/Constants.pm
site/cgi-bin/modules/DevHelp/HTML.pm [new file with mode: 0644]
site/cgi-bin/modules/Generate.pm
site/cgi-bin/modules/Generate/Article.pm
site/cgi-bin/modules/Generate/Catalog.pm
site/cgi-bin/modules/Generate/Product.pm
site/docs/bse.pod
site/docs/config.pod
site/templates/admin/add_product.tmpl
site/templates/admin/article_img.tmpl
site/templates/admin/edit_0.tmpl
site/templates/admin/edit_1.tmpl
site/templates/admin/edit_2.tmpl
site/templates/admin/edit_catalog.tmpl
site/templates/admin/edit_product.tmpl
site/templates/admin/edit_steps.tmpl
site/templates/admin/order_detail.tmpl
site/util/initial.pl
t/t00smoke.t
t/t10edit.t
t/t20gen.t

index bfab3306a6bb43bd336a1049218b1eeda65df734..2f227bbb4d10a5212b2ec57ba59a396a4cbeb20e 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -85,6 +85,7 @@ site/cgi-bin/modules/BSE/Util/Tags.pm
 site/cgi-bin/modules/BSE/Util/Valid.pm
 site/cgi-bin/modules/BSE/Version.pm
 site/cgi-bin/modules/Constants.pm
+site/cgi-bin/modules/DevHelp/HTML.pm
 site/cgi-bin/modules/DevHelp/Tags.pm
 site/cgi-bin/modules/Generate.pm
 site/cgi-bin/modules/Generate/Article.pm
@@ -189,7 +190,7 @@ site/htdocs/js/validate.js
 #  site/htdocs/shop created by the Makefile
 site/templates/1/shop_multicat.tmpl
 site/templates/1/sitemap.tmpl
-site/templates/admin/add_product.tmpl
+site/templates/admin/add_product.tmpl
 site/templates/admin/article_img.tmpl
 site/templates/admin/catalog.tmpl  # embedded in the shopadmin catalog/product display
 site/templates/admin/edit_0.tmpl
@@ -222,7 +223,7 @@ site/templates/admin/showuser.tmpl
 site/templates/admin/showuserart.tmpl
 site/templates/admin/showuser_del.tmpl
 site/templates/admin/showuser_glob.tmpl
-site/templates/admin/subs/add.tmpl
+site/templates/admin/subs/add.tmpl
 site/templates/admin/subs/edit.tmpl
 site/templates/admin/subs/list.tmpl
 site/templates/admin/subs/send_form.tmpl
index 5d3e03aa4b586652de41fe200d4a7f770b066fc0..fddac12dc2a961f781ff7932ddd1052afb887196 100755 (executable)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-VERSION=0.12_22
+VERSION=0.12_23
 DISTNAME=bse-$(VERSION)
 DISTBUILD=$(DISTNAME)
 DISTTAR=../$(DISTNAME).tar
index a91e595ddab2ad59558550b1eeca81b1f2c30fa6..1a51ca4fc7b8265eca58d0c027ebb8aaa614661a 100644 (file)
@@ -56,6 +56,11 @@ CREATE TABLE article (
   listed smallint not null default 1,
   -- date last modified
   lastModified date not null,
+
+  -- flags specified via the config file
+  -- used by code and templates
+  flags varchar(80) not null default '',
+
   PRIMARY KEY (id),
 
   -- if we keep id in the indexes MySQL will sometimes be able to
index c936192bc5f17e5c2d911ec09f1e078745fb619f..4286d93fc3ce376fe934973862ffe1963a52989b 100644 (file)
@@ -25,7 +25,7 @@ for my $drop (@drop_tables) {
     or die "Could not drop old table: ", $dbh->errstr;
 }
 
-system "/usr/local/mysql/bin/mysql -u$un -p$pw $db <$dist"
+system "mysql -u$un -p$pw $db <$dist"
   and die "Error loading database";
 
 $tl = $dbh->prepare("show tables")
index 2afb71894ecd361e0149e374848e2d11a05240ea..c3679b7dfa5a95806f580f79cf62befeb71d6f0a 100755 (executable)
@@ -85,7 +85,10 @@ sub get_class {
   eval {
     require $file;
   };
-  return if $@;
+  if ($@) {
+    print STDERR "Loading $class: $@\n";
+    return;
+  }
   return $class->new(cfg=>$cfg, db=>BSE::DB->single);
 }
 
index 9dd3f6dc999c040982c2c9bfa70fe7b88b47e921..13400abc8d97f8f268989da52a42a3a492ef049e 100755 (executable)
@@ -36,8 +36,16 @@ my %scores =
    title=>5,
    body=>3,
    keyword=>4,
+   file_description => 0,
   );
 
+for my $name (keys %scores) {
+  my $score = $cfg->entry('search index scores', $name);
+  if (defined($score) && $score =~ /^\d+$/) {
+    $scores{$name} = $score;
+  }
+}
+
 # if the level of the article is higher than this, store it's parentid 
 # instead
 my $max_level = $SEARCH_LEVEL;
@@ -86,6 +94,7 @@ sub makeIndex {
   until ($articles->EOF) {
     # find the section
     my $article = $articles->getNext;
+    next unless ($article->{listed} || $article->{flags} =~ /I/);
     my $section = $article;
     while ($section->{parentid} >= 1) {
       $section = $articles->getByPkey($section->{parentid});
@@ -101,8 +110,19 @@ sub makeIndex {
     next if $dont_search{$sectionid};
 
     for my $field (sort { $scores{$b} <=> $scores{$a} } keys %scores) {
+
+      next unless $scores{$field};
       # strip out markup
-      my $text = $article->{$field};
+      my $text;
+      if (exists $article->{$field}) {
+       $text = $article->{$field};
+      }
+      else {
+       if ($field eq 'file_description') {
+         my @files = $article->files;
+         $text = join "\n", map { @$_{qw/displayName description/} } @files;
+       }
+      }
       #next if $text =~ m!^\<html\>!i; # I don't know how to do this (yet)
       if ($field eq 'body') {
        Generate->remove_block(\$text);
index d01058e453ffa9ed510cdd19a5a775a2fbea554c..c0d9f217c52d42559a8ae7418acf69905ebab9a7 100755 (executable)
@@ -206,6 +206,7 @@ HTML
        else {
         $html .= $blank;
        }
+       $html =~ tr/\n//d;
        return $html;
      },
      script=>sub { $ENV{SCRIPT_NAME} },
@@ -239,6 +240,7 @@ HTML
        else {
         $html .= $blank;
        }
+       $html =~ tr/\n//d;
        return $html;
      },
     );
@@ -304,6 +306,7 @@ HTML
        else {
         $html .= $blank;
        }
+       $html =~ tr/\n//d;
        return $html;
      },
      ifShowStepKids => sub { $session->{showstepkids} },
@@ -662,6 +665,7 @@ HTML
        else {
          $html .= $blank;
        }
+       $html =~ tr/\n//d;
        return $html;
      },
      ifStepcatPossibles => sub { @stepcat_possibles },
index a0bae16cfab1f7efcf15b7982ff8d82dac995588..f6b31c38d86b5a77a945fa30e5fb46456d032b2f 100755 (executable)
@@ -153,6 +153,7 @@ sub sub_form {
         return '';
        }
      },
+     ifNew => !defined($sub),
     );
   if ($sub) {
     $acts{subscription} =
@@ -170,7 +171,7 @@ sub add {
   $req->user_can('subs_add')
     or return list($q, $req, $cfg, "You dont have access to add subscriptions");
 
-  sub_form($q, $req, $cfg, 'admin/subs/add', undef, 0);
+  sub_form($q, $req, $cfg, 'admin/subs/edit', undef, 0);
 }
 
 sub validate {
index c5566966edfcd3c114332cba63001b5861b3d125..e1ebc51d2cd8e639c5827ef9cb9f9bde8e43e95a 100644 (file)
@@ -79,11 +79,11 @@ override=1
 
 [level names]
 0=Your Site
-1=Section
-2=Subsect Lev1
-3=Subsect Lev2
-4=Subsect Lev3
-5=Subsect Lev4
+1=Page Lev1
+2=Page Lev2
+3=Page Lev3
+4=Page Lev4
+5=Page Lev5
 
 [articles]
 shop=3
@@ -209,3 +209,12 @@ brief=Full access (Article + Decendants)
 help=Full access to the article and it's decendants.  The user can modify all modifiable fields for this article or product.
 permissions=edit_*,regen_*
 descendants=1
+
+[article flags]
+I=Index even if hidden
+
+[article 1]
+extra_templates=index.tmpl
+
+[article 2]
+extra_templates=index2.tmpl
index 89e7c3667e948e7ff172a71609756a52e468b32e..7d18a8d280c4e0f40f954ecd47ae4ea00d0c099e 100644 (file)
@@ -9,7 +9,7 @@ sub columns {
   return qw/id parentid displayOrder title titleImage body
     thumbImage thumbWidth thumbHeight imagePos
     release expire keyword template link admin threshold
-    summaryLength generator level listed lastModified/;
+    summaryLength generator level listed lastModified flags/;
 }
 
 sub step_parents {
index 943e4c8d588daefcf6cdfcaa41206f6b4992f59d..e16b57c8ae96db0de10d28ecea70fab03d34ea53 100644 (file)
@@ -18,9 +18,9 @@ my %statements =
   (
    Articles => 'select * from article',
    replaceArticle =>
-     'replace article values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)',
+     'replace article values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)',
    addArticle =>  
-     'insert article values (null, ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)',
+     'insert article values (null, ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)',
    deleteArticle => 'delete from article where id = ?',
    getArticleByPkey => 'select * from article where id = ?',
    
index 385eef64403e4938717ee8b6dd7ba9421877cbeb..983d870a2fe7f4c1e6db22bb1866c09ec051073b 100644 (file)
@@ -64,6 +64,7 @@ sub edit_sections {
   $article{body} = '';
   $article{listed} = 0;
   $article{generator} = $self->generator;
+  $article{flags} = '';
 
   return $self->low_edit_form($req, \%article, $articles, $msg);
 }
@@ -412,17 +413,25 @@ sub templates {
 
   my @dirs = $self->template_dirs($article);
   my @templates;
-  my $basedir = $self->{cfg}->entryVar('paths', 'templates');
-  for my $dir (@dirs) {
-    my $path = File::Spec->catdir($basedir, $dir);
-    if (-d $path) {
-      if (opendir TEMPLATE_DIR, $path) {
-       push(@templates, sort map "$dir/$_",
-            grep -f "$path/$_" && /\.(tmpl|html)$/i, readdir TEMPLATE_DIR);
-       closedir TEMPLATE_DIR;
+  my @basedirs = BSE::Template->template_dirs($self->{cfg});
+  for my $basedir (@basedirs) {
+    for my $dir (@dirs) {
+      my $path = File::Spec->catdir($basedir, $dir);
+      if (-d $path) {
+       if (opendir TEMPLATE_DIR, $path) {
+         push(@templates, sort map "$dir/$_",
+              grep -f "$path/$_" && /\.(tmpl|html)$/i, readdir TEMPLATE_DIR);
+         closedir TEMPLATE_DIR;
+       }
       }
     }
   }
+
+  # eliminate any dups, and order it nicely
+  my %seen;
+  @templates = sort { lc($a) cmp lc($b) }
+    grep !$seen{$_}++, @templates;
+  
   return (@templates, $self->extra_templates($article));
 }
 
@@ -529,6 +538,7 @@ HTML
   else {
     $html .= $blank;
   }
+  $html =~ tr/\n//d;
   return $html;
 }
 
@@ -628,6 +638,7 @@ HTML
   else {
     $html .= $blank;
   }
+  $html =~ tr/\n//d;
   return $html;
 }
 
@@ -777,6 +788,7 @@ HTML
   else {
     $html .= $nomove;
   }
+  $html =~ tr/\n//d;
   return $html;
 }
 
@@ -893,6 +905,21 @@ sub tag_default {
   }
 }
 
+sub iter_flags {
+  my ($self) = @_;
+
+  $self->flags;
+}
+
+sub tag_if_flag_set {
+  my ($article, $arg, $acts, $funcname, $templater) = @_;
+
+  my @args = DevHelp::Tags->get_parms($arg, $acts, $templater);
+  @args or return;
+
+  return index($article->{flags}, $args[0]) >= 0;
+}
+
 sub low_edit_tags {
   my ($self, $acts, $request, $article, $articles, $msg, $errors) = @_;
 
@@ -945,7 +972,7 @@ sub low_edit_tags {
      default => [ \&tag_default, $self, $request, $article ],
      articleType => [ \&tag_art_type, $article->{level}, $cfg ],
      parentType => [ \&tag_art_type, $article->{level}-1, $cfg ],
-     ifnew => [ \&tag_if_new, $article ],
+     ifNew => [ \&tag_if_new, $article ],
      list => [ \&tag_list, $self, $article, $articles, $cgi, $request ],
      script => $ENV{SCRIPT_NAME},
      level => $article->{level},
@@ -1011,6 +1038,9 @@ sub low_edit_tags {
      error_img => [ \&tag_error_img, $self, $errors ],
      ifFieldPerm => [ \&tag_if_field_perm, $request, $article ],
      parent => [ \&tag_hash, $parent ],
+     DevHelp::Tags->make_iterator2
+     ([ \&iter_flags, $self ], 'flag', 'flags' ),
+     ifFlagSet => [ \&tag_if_flag_set, $article ],
     );
 }
 
@@ -1100,14 +1130,17 @@ sub generator { 'Generate::Article' }
 sub _validate_common {
   my ($self, $data, $articles, $errors) = @_;
 
-  if (defined $data->{parentid} && $data->{parentid} =~ /^(?:-1|\d+)$/) {
-    unless ($data->{parentid} == -1 or 
-           $articles->getByPkey($data->{parentid})) {
-      $errors->{parentid} = "Selected parent article doesn't exist";
-    }
-  }
-  else {
-    $errors->{parentid} = "You need to select a valid parent";
+#   if (defined $data->{parentid} && $data->{parentid} =~ /^(?:-1|\d+)$/) {
+#     unless ($data->{parentid} == -1 or 
+#          $articles->getByPkey($data->{parentid})) {
+#       $errors->{parentid} = "Selected parent article doesn't exist";
+#     }
+#   }
+#   else {
+#     $errors->{parentid} = "You need to select a valid parent";
+#   }
+  if (exists $data->{title} && $data->{title} !~ /\S/) {
+    $errors->{title} = "Please enter a title";
   }
 
   if (exists $data->{template} && $data->{template} =~ /\.\./) {
@@ -1117,7 +1150,7 @@ sub _validate_common {
 }
 
 sub validate {
-  my ($self, $data, $articles, $rmsg, $errors) = @_;
+  my ($self, $data, $articles, $errors) = @_;
 
   $self->_validate_common($data, $articles, $errors);
 
@@ -1125,7 +1158,7 @@ sub validate {
 }
 
 sub validate_old {
-  my ($self, $article, $data, $articles, $rmsg, $errors) = @_;
+  my ($self, $article, $data, $articles, $errors) = @_;
 
   $self->_validate_common($data, $articles, $errors);
 
@@ -1168,10 +1201,11 @@ sub save_new {
     $data{$name} = $cgi->param($name) 
       if defined $cgi->param($name);
   }
+  $data{flags} = join '', sort $cgi->param('flags');
 
   my $msg;
   my %errors;
-  $self->validate(\%data, $articles, \$msg, \%errors)
+  $self->validate(\%data, $articles, \%errors)
     or return $self->add_form($req, $articles, $msg, \%errors);
 
   my $parent;
@@ -1281,6 +1315,9 @@ sub save {
       if defined($cgi->param($name)) and $name ne 'id' && $name ne 'parentid'
        && $req->user_can("edit_field_edit_$name", $article);
   }
+  # possibly this needs tighter error checking
+  $data{flags} = join '', sort $cgi->param('flags')
+    if $req->user_can("edit_field_edit_flags", $article);
   my %errors;
   $self->validate_old($article, \%data, $articles, \%errors)
     or return $self->edit_form($req, $article, $articles, undef, \%errors);
@@ -1742,10 +1779,10 @@ sub refresh {
 }
 
 sub show_images {
-  my ($self, $req, $article, $articles, $msg) = @_;
+  my ($self, $req, $article, $articles, $msg, $errors) = @_;
 
   my %acts;
-  %acts = $self->low_edit_tags(\%acts, $req, $article, $articles, $msg);
+  %acts = $self->low_edit_tags(\%acts, $req, $article, $articles, $msg, $errors);
   my $template = 'admin/article_img';
 
   return BSE::Template->get_response($template, $req->cfg, \%acts);
@@ -1810,11 +1847,13 @@ sub add_image {
   my $image = $cgi->param('image');
   unless ($image) {
     return $self->show_images($req, $article, $articles,
-                             'Enter or select the name of an image file on your machine');
+                             'Enter or select the name of an image file on your machine', 
+                             { image => 'Please enter an image filename' });
   }
   if (-z $image) {
     return $self->show_images($req, $article, $articles,
-                             'Image file is empty');
+                             'Image file is empty',
+                            { image => 'Image file is empty' });
   }
   my $imagename = $image;
   $imagename .= ''; # force it into a string
@@ -1925,7 +1964,7 @@ sub move_img_up {
   use Util 'generate_article';
   generate_article($articles, $article) if $Constants::AUTO_GENERATE;
 
-  return $self->refresh($article, $req->cgi, undef, undef, '&showimage=1');
+  return $self->refresh($article, $req->cgi, undef, undef, '&showimages=1');
 }
 
 sub move_img_down {
@@ -1950,7 +1989,7 @@ sub move_img_down {
   use Util 'generate_article';
   generate_article($articles, $article) if $Constants::AUTO_GENERATE;
 
-  return $self->refresh($article, $req->cgi, undef, undef, '&showimage=1');
+  return $self->refresh($article, $req->cgi, undef, undef, '&showimages=1');
 }
 
 sub get_article {
@@ -1996,10 +2035,10 @@ sub _refresh_filelist {
 }
 
 sub filelist {
-  my ($self, $req, $article, $articles, $msg) = @_;
+  my ($self, $req, $article, $articles, $msg, $errors) = @_;
 
   my %acts;
-  %acts = $self->low_edit_tags(\%acts, $req, $article, $articles, $msg);
+  %acts = $self->low_edit_tags(\%acts, $req, $article, $articles, $msg, $errors);
   my $template = 'admin/filelist';
 
   return BSE::Template->get_response($template, $req->cfg, \%acts);
@@ -2034,11 +2073,13 @@ sub fileadd {
   my $file = $cgi->param('file');
   unless ($file) {
     return $self->filelist($req, $article, $articles,
-                          "Enter or select the name of a file on your machine");
+                          "Enter or select the name of a file on your machine",
+                         { file => 'Please enter a filename' });
   }
   if (-z $file) {
     return $self->filelist($req, $article, $articles,
-                          message=>"File is empty");
+                          "File is empty",
+                          { file => 'File is empty' });
   }
 
   unless ($file{contentType}) {
@@ -2305,6 +2346,24 @@ sub default_value {
   return '';
 }
 
+sub flag_sections {
+  return ( 'article flags' );
+}
+
+sub flags {
+  my ($self) = @_;
+
+  my $cfg = $self->{cfg};
+
+  my @sections = $self->flag_sections;
+
+  my %flags = map $cfg->entriesCS($_), reverse @sections;
+  my @valid = grep /^\w$/, keys %flags;
+  
+  return map +{ id => $_, desc => $flags{$_} },
+    sort { lc($flags{$a}) cmp lc($flags{$b}) }@valid;
+}
+
 1;
 
 =head1 NAME
index 4627fb0e6ce271d302eddcfc90e491a804c9df3c..e34341992e1de7e66281a2daceccb039f5ce9c66 100644 (file)
@@ -10,7 +10,7 @@ sub extra_templates {
   my ($self, $article) = @_;
 
   my @extras = $self->SUPER::extra_templates($article);
-  my $basedir = $self->{cfg}->entry('paths', 'templates', $Constants::TMPLDIR);
+  my $basedir = $self->{cfg}->entryVar('paths', 'templates');
   push @extras, 'catalog.tmpl' if -f "$basedir/catalog.tmpl";
 
   return @extras;
@@ -98,5 +98,11 @@ sub default_template {
   return $self->SUPER::default_template($article, $cfg, $templates);
 }
 
+sub flag_sections {
+  my ($self) = @_;
+
+  return ( 'catalog flags', $self->SUPER::flag_sections );
+}
+
 1;
 
index e3a7109fd1921e9088146d83bbb5d0acc419a364..4c3061d8d9b3333b2f39d6bb419ebbc655bd1b8b 100644 (file)
@@ -69,7 +69,7 @@ sub add_template {
   my ($self, $article, $cgi) = @_;
 
   return $self->{cfg}->entry('admin templates', 'add_product', 
-                            'admin/add_product');
+                            'admin/edit_product');
 }
 
 sub validate_parent {
@@ -105,9 +105,9 @@ sub _validate_common {
 }
 
 sub validate {
-  my ($self, $data, $articles, $rmsg, $errors) = @_;
+  my ($self, $data, $articles, $errors) = @_;
 
-  my $ok = $self->SUPER::validate($data, $articles, $rmsg, $errors);
+  my $ok = $self->SUPER::validate($data, $articles, $errors);
   $self->_validate_common($data, $articles, $errors);
 
   for my $field (qw(title summary body)) {
@@ -120,9 +120,9 @@ sub validate {
 }
 
 sub validate_old {
-  my ($self, $article, $data, $articles, $rmsg, $errors) = @_;
+  my ($self, $article, $data, $articles, $errors) = @_;
 
-  $self->SUPER::validate($data, $articles, $rmsg, $errors)
+  $self->SUPER::validate($data, $articles, $errors)
     or return;
   
   return !keys %$errors;
@@ -197,6 +197,9 @@ sub _fill_product_data {
       }
     }
   }
+  if (exists $src->{options}) {
+    $data->{options} = $src->{options};
+  }
 }
 
 sub fill_new_data {
@@ -238,4 +241,10 @@ sub can_remove {
   return $self->SUPER::can_remove($req, $article, $articles, $rmsg);
 }
 
+sub flag_sections {
+  my ($self) = @_;
+
+  return ( 'product flags', $self->SUPER::flag_sections );
+}
+
 1;
index 119f4c30b0260b94550d2e1b0747d84cd2545954..f890d32e3495b24dac1128144e077380bcb8fbb2 100644 (file)
@@ -2,6 +2,7 @@ package BSE::Util::Tags;
 use strict;
 use HTML::Entities;
 use DevHelp::Tags;
+use DevHelp::HTML;
 
 sub _get_parms {
   my ($acts, $args) = @_;
@@ -153,10 +154,10 @@ sub static {
      sub {
        my ($value, $fmt) = @_;
        if ($fmt eq 'u') {
-        return CGI::escape($value);
+        return escape_uri($value);
        }
        elsif ($fmt eq 'h') {
-        return CGI::escapeHTML($value);
+        return escape_html($value);
        }
        return $value;
      },
index acf32647fc5378feed4163d0a6c983971042feef..a1195bf405a82e1da29e2221bfc81a971a1262c5 100644 (file)
@@ -99,36 +99,36 @@ $IMAGES_URI = $ROOT_URI."images";
 $CGI_URI = "/cgi-bin";
 
 # level defaults
-%LEVEL_DEFAULTS = 
+%LEVEL_DEFAULTS =
   (
    0=>{
        display=>"Your Site",
       },
-    
+
    1=>{
        threshold=>1,
        template=>'common/default.tmpl',
-       display=>'Section',
+       display=>'Page Lev1',
       },
    2=>{
        threshold=>1,
        template=>'common/default.tmpl',
-       display=>'Subsect Lev1',
+       display=>'Page Lev2',
       },
    3=>{
        threshold=>1,
        template=>'common/default.tmpl',
-       display=>'Subsect Lev2',
+       display=>'Page Lev3',
       },
    4=>{
        threshold=>1,
        template=>'common/default.tmpl',
-       display=>'Subsect Lev3',
+       display=>'Page Lev4',
       },
    5=>{
        threshold=>1,
        template=>'common/default.tmpl',
-       display=>"Subsect Lev4",
+       display=>"Page Lev5",
       },
   );
 
diff --git a/site/cgi-bin/modules/DevHelp/HTML.pm b/site/cgi-bin/modules/DevHelp/HTML.pm
new file mode 100644 (file)
index 0000000..995dd3c
--- /dev/null
@@ -0,0 +1,56 @@
+package DevHelp::HTML;
+use strict;
+use Carp qw(confess);
+
+require Exporter;
+use vars qw(@EXPORT_OK @EXPORT @ISA);
+@EXPORT_OK = qw(escape_html escape_uri unescape_html unescape_uri popup_menu);
+@EXPORT = qw(escape_html escape_uri unescape_html unescape_uri);
+@ISA = qw(Exporter);
+
+use HTML::Entities ();
+
+sub escape_html {
+  HTML::Entities::encode(shift, '<>&"\x7F-\xFF');
+}
+
+sub unescape_html {
+  HTML::Entities::decode(shift);
+}
+
+sub escape_uri {
+  URI::Escape::uri_escape(shift);
+}
+
+sub unescape_uri {
+  URI::Escape::uri_unescape(shift);
+}
+
+sub popup_menu {
+  my (%opts) = @_;
+
+  exists $opts{'-name'}
+    or confess "No -name parameter";
+
+  my $html = '<select name="' . escape_html($opts{"-name"}) . '">';
+  my $labels = $opts{"-labels"} || {};
+  my $values = $opts{"-values"};
+  my $default = $opts{"-default"};
+  for my $value (@$values) {
+    my $option = "<option";
+    my $label = $labels->{$value};
+    if (defined $label) {
+      $option .= ' value="' . escape_html($value) . '"';
+      $option .= ' checked' if defined($default) && $default eq $value;
+      $option .= '>' . escape_html($label);
+    }
+    else {
+      $option .= ' checked' if defined($default) && $default eq $value;
+      $option .= '>' . escape_html($value);
+    }
+    $html .= $option . "\n";
+  }
+  $html .= "</select>";
+}
+
+1;
index 0b83364ebfd62c2fded2364bd264fda6bc0b37be..db772685d72ea079b9c3c287581ef1c0c1317cb6 100644 (file)
@@ -1,11 +1,11 @@
 package Generate;
 use strict;
 use Articles;
-use CGI ();
 use Constants qw($IMAGEDIR $LOCAL_FORMAT $BODY_EMBED 
                  $EMBED_MAX_DEPTH $HAVE_HTML_PARSER);
 use BSE::Custom;
 use DevHelp::Tags;
+use DevHelp::HTML;
 
 my $excerptSize = 300;
 
@@ -158,7 +158,7 @@ sub _format_ol {
 # the input text has already been escaped, so we need to unescape it
 # too bad if you want [] in your html (but you can use entities)
 sub _make_html {
-  return CGI::unescapeHTML($_[0]);
+  return unescape_html($_[0]);
 }
 
 sub _embed_low {
@@ -252,7 +252,7 @@ sub _make_img {
 #      }
     my $im = $images->[$index-1];
     $text = qq!<img src="/images/$im->{image}" width="$im->{width}"!
-      . qq! height="$im->{height}" alt="! . CGI::escapeHTML($im->{alt}).'"'
+      . qq! height="$im->{height}" alt="! . escape_html($im->{alt}).'"'
        . qq! border="0"!;
     $text .= qq! align="$align"! if $align && $align ne 'center';
     $text .= qq! />!;
@@ -262,7 +262,7 @@ sub _make_img {
       $url = $im->{url};
     }
     if ($url) {
-      $text = qq!<a href="! . CGI::escapeHTML($url) . qq!">$text</a>!;
+      $text = qq!<a href="! . escape_html($url) . qq!">$text</a>!;
     }
   }
   return $text;
@@ -275,7 +275,7 @@ sub format_body {
   return substr($body, 6) if $body =~ /^<html>/i;
 
   # clean up any possible existing markup
-  $body = CGI::escapeHTML($body);
+  $body = escape_html($body);
   
   # I considered replacing these with single character codes and replacing
   # them later with the tags, to avoid having to check for the middle of 
@@ -557,7 +557,7 @@ sub baseActs {
        }
      },
      level1 => sub {
-       return CGI::escapeHTML($sections[$section_index]{$_[0]});
+       return escape_html($sections[$section_index]{$_[0]});
      },
 
      # used to generate a list of subsections for the side-menu
@@ -583,7 +583,7 @@ sub baseActs {
      iterate_level3 => sub {
        return ++$level3_index < @level3;
      },
-     level3 => sub { CGI::escapeHTML($level3[$level3_index]{$_[0]}) },
+     level3 => sub { escape_html($level3[$level3_index]{$_[0]}) },
      ifLevel3 => sub { scalar @level3 },
 
      # generate an admin or link url, depending on admin state
@@ -606,7 +606,7 @@ sub baseActs {
          return qq!<img src="/images/titles/!.$image .qq!" border=0>!
        }
        else {
-         return CGI::escapeHTML($text);
+         return escape_html($text);
        }
      },
      DevHelp::Tags->make_iterator2
index 80f8c22a7b7012e873956c7c41fa8e8b8b213898..62a37a0ea7250329b7943ff6e1b169a6503e83ae 100644 (file)
@@ -6,11 +6,11 @@ use Constants qw(%LEVEL_DEFAULTS $CGI_URI $ADMIN_URI $IMAGES_URI
 use Images;
 use vars qw(@ISA);
 use Generate;
-use CGI (); # for escapeHTML()
 use Util qw(generate_button);
 use BSE::Util::Tags;
 use ArticleFiles;
 @ISA = qw/Generate/;
+use DevHelp::HTML;
 
 my $excerptSize = 300;
 
@@ -40,11 +40,11 @@ sub link_to_form {
     for my $attr (split /&/, $query) {
       my ($name, $value) = split /=/, $attr, 2;
       # I'm assuming none of the values are uri escaped
-      $value = CGI::escapeHTML($value);
+      $value = escape_html($value);
       $form .= qq!<input type=hidden name="$name" value="$value">!
     }
   }
-  $form .= qq!<input type=submit value="!.CGI::escapeHTML($text).'">';
+  $form .= qq!<input type=submit value="!.escape_html($text).'">';
   $form .= "</form>";
 
   return $form;
@@ -105,7 +105,7 @@ sub baseActs {
   my %acts =
     (
      $self->SUPER::baseActs($articles, $acts, $article, $embedded),
-     article=>sub { CGI::escapeHTML($article->{$_[0]}) },
+     article=>sub { escape_html($article->{$_[0]}) },
      ifTitleImage => 
      sub { 
        my $which = shift || 'article';
@@ -173,10 +173,10 @@ sub baseActs {
      },
      child =>
      sub {
-       return CGI::escapeHTML($children[$child_index]{$_[0]});
+       return escape_html($children[$child_index]{$_[0]});
      },
 
-     section=>sub { CGI::escapeHTML($section->{$_[0]}) },
+     section=>sub { escape_html($section->{$_[0]}) },
 
      # these are mostly obsolete, use moveUp and moveDown instead
      # where possible
@@ -264,7 +264,7 @@ HTML
      },
      crumbs =>
      sub {
-       return CGI::escapeHTML($work_crumbs[$crumb_index]{$_[0]});
+       return escape_html($work_crumbs[$crumb_index]{$_[0]});
      },
      ifCrumbs =>
      sub {
@@ -283,15 +283,17 @@ HTML
      # access to parent
      ifParent => sub { $parent },
      parent =>
-     sub { return $parent && CGI::escapeHTML($parent->{$_[0]}) },
+     sub { return $parent && escape_html($parent->{$_[0]}) },
      # for rearranging order in admin mode
      moveDown=>
      sub {
        @children > 1 or return '';
        if ($self->{admin} && $child_index < $#children) {
-         return <<HTML;
+         my $html = <<HTML;
 <a href="$CGI_URI/admin/move.pl?id=$children[$child_index]{id}&d=down"><img src="$IMAGES_URI/admin/move_down.gif" width="17" height="13" border="0" alt="Move Down" align="absbottom"></a>
 HTML
+        chop $html;
+        return $html;
        } else {
          return $blank;
        }
@@ -300,9 +302,11 @@ HTML
      sub {
        @children > 1 or return '';
        if ($self->{admin} && $child_index > 0) {
-         return <<HTML;
+         my $html = <<HTML;
 <a href="$CGI_URI/admin/move.pl?id=$children[$child_index]{id}&d=up"><img src="$IMAGES_URI/admin/move_up.gif" width="17" height="13" border="0" alt="Move Up" align="absbottom"></a>
 HTML
+        chop $html;
+        return $html;
        } else {
          return $blank;
        }
@@ -312,8 +316,7 @@ HTML
        my $html = '';
        return '' unless $self->{admin};
        return '' unless @allkids > 1;
-       my $refreshto = CGI::escape($ENV{SCRIPT_NAME}
-                                  ."?id=$article->{id}");
+       my $refreshto = escape_uri($ENV{SCRIPT_NAME} . "?id=$article->{id}");
        if ($allkids_index < $#allkids) {
         $html .= <<HTML
 <a href="$CGI_URI/admin/move.pl?stepparent=$article->{id}&d=swap&id=$allkids[$allkids_index]{id}&other=$allkids[$allkids_index+1]{id}&refreshto=$refreshto"><img src="$IMAGES_URI/admin/move_down.gif" width="17" height="13" border="0" alt="Move Down" align="absbottom"></a>
@@ -330,6 +333,7 @@ HTML
        else {
         $html .= $blank;
        }
+       $html =~ tr/\n//d;
        return $html;
      },
      ifCurrentPage=>
@@ -365,17 +369,18 @@ HTML
        }
        my $html;
        if ($align && exists $im->{$align}) {
-        $html = CGI::escapeHTML($im->{$align});
+        $html = escape_html($im->{$align});
        }
        else {
         $html = qq!<img src="/images/$im->{image}" width="$im->{width}"!
-          . qq! height="$im->{height}" alt="! . CGI::escapeHTML($im->{alt});
+          . qq! height="$im->{height}" alt="! . escape_html($im->{alt})
+            . qq!"!;
         $html .= qq! align="$align"! if $align && $align ne '-';
          unless (defined($rest) && $rest =~ /\bborder=/i) {
            $html .= ' border="0"';
          }
          $html .= " $rest" if defined $rest;
-        $html .= qq!" />!;
+        $html .= qq! />!;
         if ($im->{url}) {
           $html = qq!<a href="$im->{url}">$html</a>!;
         }
index 8ba58214fcecf3fabaa9ed09f9cec05def180c07..dfc013fb5aa254e6776f4a36bcefb2e77f08721a 100644 (file)
@@ -8,6 +8,7 @@ use BSE::Template;
 use Constants qw($CGI_URI $IMAGES_URI $ADMIN_URI);
 use Util qw(generate_button);
 use OtherParents;
+use DevHelp::HTML;
 
 sub generate_low {
   my ($self, $template, $article, $articles, $embedded) = @_;
@@ -38,12 +39,12 @@ sub generate_low {
   %acts =
     (
      $self->baseActs($articles, \%acts, $article, $embedded),
-     article => sub { CGI::escapeHTML($article->{$_[0]}) },
+     article => sub { escape_html($article->{$_[0]}) },
      iterate_products =>
      sub {
        return ++$product_index < @products;
      },
-     product=> sub { CGI::escapeHTML($products[$product_index]{$_[0]}) },
+     product=> sub { escape_html($products[$product_index]{$_[0]}) },
      ifProducts => sub { @products },
      admin => 
      sub { 
@@ -69,7 +70,7 @@ HTML
 <td><form action="$CGI_URI/admin/add.pl">
 <input type=hidden name="parentid" value="$article->{id}">
 <input type=hidden name="type" value="Catalog">
-<input type=submit value="Add product"></form></td>
+<input type=submit value="Add Sub-catalog"></form></td>
 HTML
          }
         $html .= <<HTML;
@@ -103,9 +104,11 @@ HTML
      moveDown=>
      sub {
        if ($self->{admin} && $product_index < $#products) {
-        return <<HTML;
+        my $html = <<HTML;
  <a href="$CGI_URI/admin/move.pl?id=$products[$product_index]{id}&d=down"><img src="$IMAGES_URI/admin/move_down.gif" width="17" height="13" border="0" alt="Move Down" align="absbottom"></a>
 HTML
+        chop $html;
+        return $html;
        }
        else {
         return '';
@@ -114,9 +117,11 @@ HTML
      moveUp=>
      sub {
        if ($self->{admin} && $product_index > 0) {
-        return <<HTML;
+        my $html = <<HTML;
  <a href="$CGI_URI/admin/move.pl?id=$products[$product_index]{id}&d=up"><img src="$IMAGES_URI/admin/move_up.gif" width="17" height="13" border="0" alt="Move Up" align="absbottom"></a>
 HTML
+        chop $html;
+        return $html;
        }
        else {
         return '';
@@ -124,7 +129,7 @@ HTML
      },
      iterate_allprods_reset => sub { $allprod_index = -1 },
      iterate_allprods => sub { ++$allprod_index < @allprods },
-     allprod => sub { CGI::escapeHTML($allprods[$allprod_index]{$_[0]}) },
+     allprod => sub { escape_html($allprods[$allprod_index]{$_[0]}) },
      moveallprod =>
      sub {
        return '' unless $self->{admin};
@@ -157,17 +162,18 @@ HTML
        else {
         $html .= $blank;
        }
+       $html =~ tr/\n//d;
        return $html;
      },
-     ifAnyProds => sub { CGI::escapeHTML(@allprods) },
+     ifAnyProds => sub { escape_html(@allprods) },
      iterate_stepprods_reset => sub { $stepprod_index = -1 },
      iterate_stepprods => sub { ++$stepprod_index < @stepprods; },
-     stepprod => sub { CGI::escapeHTML($stepprods[$stepprod_index]{$_[0]}) },
+     stepprod => sub { escape_html($stepprods[$stepprod_index]{$_[0]}) },
      ifStepProds => sub { @stepprods },
      iterate_catalogs_reset => sub { $category_index = -1 },
      iterate_catalogs => sub { ++$category_index < @subcats },
      catalog => 
-     sub { CGI::escapeHTML($subcats[$category_index]{$_[0]}) },
+     sub { escape_html($subcats[$category_index]{$_[0]}) },
      ifSubcats => sub { @subcats },
     );
   my $oldurl = $acts{url};
index b34d26713c9db940999db8eecf866eda1b9ddd96..905ba6c22f5ada374578abe64ddeb300163030c6 100644 (file)
@@ -6,6 +6,7 @@ use Images;
 use base qw(Generate::Article);
 use Constants qw(:shop $CGI_URI $ADMIN_URI);
 use Carp qw(confess);
+use DevHelp::HTML;
 
 sub edit_link {
   my ($self, $id) = @_;
@@ -30,13 +31,14 @@ sub baseActs {
   my $stepcat_index;
   my @options = 
     map { +{ id=>$_, %{$SHOP_PRODUCT_OPTS{$_}} } } 
+      grep $SHOP_PRODUCT_OPTS{$_},
       split /,/, $product->{options};
   my $option_index;
 
   return
     (
      $self->SUPER::baseActs($articles, $acts, $product, $embedded),
-     product=> sub { CGI::escapeHTML($product->{$_[0]}) },
+     product=> sub { escape_html($product->{$_[0]}) },
      admin =>
      sub {
        return '' unless $self->{admin};
@@ -72,16 +74,16 @@ HTML
           );
         push(@args, -labels=>$option->{labels}) if $option->{labels};
         push(@args, -default=>$option->{default}) if $option->{default};
-        return CGI::popup_menu(@args);
+        return DevHelp::HTML::popup_menu(@args);
        }
        else {
-        return CGI::escapeHTML($options[$option_index]{$_[0]})
+        return escape_html($options[$option_index]{$_[0]})
        }
      },
      ifOptions => sub { @options },
      iterate_stepcats_reset => sub { $stepcat_index = -1 },
      iterate_stepcats => sub { ++$stepcat_index < @stepcats },
-     stepcat => sub { CGI::escapeHTML($stepcats[$stepcat_index]{$_[0]}) },
+     stepcat => sub { escape_html($stepcats[$stepcat_index]{$_[0]}) },
      ifStepCats => sub { @stepcats },
     );
 }
index ae2c61e1c43debe3d15f8bc577cbd6686860344c..aa9061254b58f594375076a9035992587df8420d 100644 (file)
@@ -10,6 +10,82 @@ Maybe I'll add some other bits here.
 
 =head1 CHANGES
 
+=head2 0.12_23
+
+=over
+
+=item *
+
+the list of templates in the drop down on the article edit page didn't
+reflect the local_templates config option correctlt.
+
+=item *
+
+validation errors weren't always reported (or acted upon) correctly
+
+=item *
+
+when an invalid product options string was stored a 500 error was
+produced when generating the page
+
+=item *
+
+the image tag wasn't including a closing " at the end of the alt
+attribute
+
+=item *
+
+the article generation code no longer relies upon CGI.pm functions for
+escaping HTML, URIs or producing product option popups, this should
+make it possible to use gen.pl from cron jobs without getting prompts
+for CGI parameters
+
+=item *
+
+catalogs had two buttons labelled "Add product", but one added
+catalogs.  Relabelled the one that adds catalogs to "Add Sub-catalog".
+
+=item *
+
+the ifnew tag on edit templates is no longer available, use ifNew
+instead (this was true as of 0.12_22)
+
+=item *
+
+added a flags field to articles, this is used for both BSE internal
+flags and for site specific flags.
+
+=item *
+
+the search index builder will now only index articles that are listed,
+or have the "Index even if hidden" (I) flag set.  Changed the simple
+search test to search for a non-hidden article.
+
+=item *
+
+the title field of all articles are now validated to include at least
+one non-space character
+
+=item *
+
+validation failures on images and files are now available via the
+error_img tag
+
+=item *
+
+the move image up/down action on the images manager were refreshing to
+the wrong page after reordering the images
+
+=item *
+
+changed default level names in Constants.pm and bse.cfg
+
+=item *
+
+changed tests to use the new level names
+
+=back
+
 =head2 0.12_22
 
 =over
index bc08c0f37f0a39d19eadee575bb26fcb76d5851c..476877b367817d680373e5737ae683a0659d3a47 100644 (file)
@@ -528,6 +528,40 @@ If the user supplies a template name to printable.pl then you can use
 a different content type by adding an entry to this section.  The key
 is the template name, and the value is the full content type.
 
+=head2 [search index scores]
+
+This section is used when generating the search index to override the
+default scores for each field in the articles.
+
+The default scores are:
+
+  Field   Score
+  -----   -----
+  title     5
+  body      3
+  keyword   4
+
+A special key C<file_description> can be used here to set the score
+for indexing downloadable file descriptions, which aren't indexed by
+default.  A good value is probably 2 or 1.
+
+=head2 [article flags]
+
+=head2 [product flags]
+
+=head2 [catalog flags]
+
+Flags that can be set for articles, products and catalogs
+respectively.  Note that flags for articles are also visible in
+products and catalogs.
+
+All flag Ids are single letters or digits.  Uppercase letters are
+reserved for use by BSE internally, leaving lower-case letters and
+digits for your own use.
+
+Use the id of the flag as the key, and a description of the flag as
+it's value.
+
 =head1 AUTHOR
 
 Tony Cook <tony@develop-help.com>
index 700b06dbe49c8c6e824942ccbfdbe2f35bdf9073..4c351435cb39798982605684d2a211635ca2b1f8 100644 (file)
               (<:alloptions:>) </td>
             <td bgcolor="#FFFFFF"><:help product options:></td>
           </tr>
+          <tr> 
+            <th nowrap bgcolor="#FFFFFF" align="left">Flags:</th>
+            <td bgcolor="#FFFFFF" width="100%"><:iterator begin flags:><:if FieldPerm flags:><input type=checkbox name=flags value="<:flag id:>" <:ifFlagSet [flag id]:>checked<:or:><:eif:>><:or FieldPerm:><:ifFlagSet [flag id]:>Yes<:or:>No<:eif:><:eif FieldPerm:><:flag desc:><:iterator end flags:></td>
+            <td bgcolor="#FFFFFF"><:help edit listed:></td>
+          </tr>
           <tr> 
             <th nowrap align="left" bgcolor="#FFFFFF" valign="top">Thumbnail image:</th>
             <td nowrap bgcolor="#FFFFFF"> 
index ef2c7f5e529e7a52aa9ba21f9dcd1b47f9d00a9c..9cde714ecdbab27dd02d2d02b5d89e9efa75ab2b 100644 (file)
       <td>
         <table cellpadding="6" border="0" cellspacing="1">
           <tr> 
-            <th valign="top" bgcolor="#FFFFFF" colspan="3">First Image Position</th>
+            <th valign="top" bgcolor="#FFFFFF" colspan="4">First Image Position</th>
           </tr>
           <tr> 
-            <td bgcolor="#FFFFFF" colspan="3"> 
+            <td bgcolor="#FFFFFF" colspan="4"> 
               <table width="100%" border="0" cellspacing="0" cellpadding="0">
                 <tr>
                   <td width="100%" align="center"><input type="radio" name="imagePos" value="tl" <: ifEq [article imagePos] "tl":>checked<:or:><:eif:>
            </td>
           </tr>
           <tr bgcolor="#FFFFFF"> 
-            <th colspan="3">Image</th>
+            <th colspan="4">Image</th>
           </tr>
           <: iterator begin images :> 
           <tr bgcolor="#FFFFFF"> 
-            <td align="center" colspan="3"> <img src="/images/<: image image :>" alt="<: image alt :>" width="<: 
+            <td align="center" colspan="4"> <img src="/images/<: image image :>" alt="<: image alt :>" width="<: 
               image width :>" height="<: image height :>"></td>
           </tr>
           <tr bgcolor="#FFFFFF"> 
             <th> Alt Text</th>
             <th width="50%"> URL</th>
             <th nowrap> Modify</th>
+                       <th nowrap> Move</th>
           </tr>
           <tr bgcolor="#FFFFFF"> 
             <td valign="top"> 
               <:ifUserCan edit_images_save:article:><input type="text" name="url" value="<: image url :>" size="32"><:or:><: image url :><:eif:>
             </td>
             <td valign="bottom" nowrap> 
-              <:ifUserCan edit_images_delete:article:><b><a href="<:script:>?level=<: level :>&parentid=<: article parentid :>&id=<:article id:>&imgtype=<: articleType :>&removeimg_<: image id :>" onClick="return window.confirm('Are you sure you want to delete this Image')">Delete</a></b><:or:><:eif:>
-<:imgmove:> </td>
+              <:ifUserCan edit_images_delete:article:><b><a href="<:script:>?level=<: level :>&parentid=<: article parentid :>&id=<:article id:>&imgtype=<: articleType :>&removeimg_<: image id :>" onClick="return window.confirm('Are you sure you want to delete this Image')">Delete</a></b><:or:><:eif:></td>
+            <td><:imgmove:></td>
           </tr>
           <: iterator separator images :> 
           <tr bgcolor="#FFFFFF"> 
-            <td colspan="3">&nbsp;</td>
+            <td colspan="4">&nbsp;</td>
           </tr>
           <: iterator end images :> 
 <:ifUserCan edit_images_save:article:>
           <tr> 
-            <td align="right" bgcolor="#FFFFFF" colspan="3"> 
+            <td align="right" bgcolor="#FFFFFF" colspan="4"> 
               <input type="submit" name="process" value="Save changes">
             </td>
          </tr>
index 4cf5b831fbf5fdb28be5f31eb97b0b74d3c4f58f..d073578bc8bc7bc72166e9dbd7efb447392b6fb7 100644 (file)
           <th width="70%">Summary</th>
           <th>Listed</th>
           <th nowrap>Modify</th>
+                 <th nowrap>Move</th>
         </tr>
 <:if UserCan edit_reorder_children:>
         <tr> 
-          <td colspan="4" bgcolor="#FFFFFF">Reorder child articles: <a href="/cgi-bin/admin/reorder.pl?parentid=<:article id:>&sort=title&refreshto=/cgi-bin/admin/add.pl?id=<:article id:>">by 
+          <td colspan="5" bgcolor="#FFFFFF">Reorder child articles: <a href="/cgi-bin/admin/reorder.pl?parentid=<:article id:>&sort=title&refreshto=/cgi-bin/admin/add.pl?id=<:article id:>">by 
             title</a> | <a href="/cgi-bin/admin/reorder.pl?parentid=<:article id:>&sort=date&refreshto=/cgi-bin/admin/add.pl?id=<:article id:>">by 
             date</a> | <a href="/cgi-bin/admin/reorder.pl?parentid=<:article id:>&reverse=1&refreshto=/cgi-bin/admin/add.pl?id=<:article id:>">reverse 
             order</a></td>
@@ -73,8 +74,8 @@
           <td width="70%"><: summary child body :></td>
           <td bgcolor="#FFFFFF" align="center"><: is child listed :></td>
           <td nowrap> <a href="/cgi-bin/admin/add.pl?id=<:child id:>">Edit</a> 
-            <:if UserCan edit_delete_article:child:><a href="/cgi-bin/admin/add.pl?id=<:child id:>&remove=1" onClick="return window.confirm('Are you sure you want to delete this Section')">Delete</a> <:or UserCan:><:eif UserCan:>
-            <:movechild:> </td>
+            <:if UserCan edit_delete_article:child:><a href="/cgi-bin/admin/add.pl?id=<:child id:>&remove=1" onClick="return window.confirm('Are you sure you want to delete this Section')">Delete</a> <:or UserCan:><:eif UserCan:></td>
+                  <td nowrap><:movechild:></td>
         </tr>
         <:iterator separator children:> <:iterator end children:> 
       </table>
 <:or children:>
 <:eif children:>
 <:if HaveChildType:>
-<:if new:>
-<:or new:>
+<:if New:>
+<:or New:>
 <form action="/cgi-bin/admin/add.pl" method="POST">
 <input type=hidden name="parentid" value="<:article id:>">
 <p><input type=submit value="Add <:childtype:>"></p>
 </form>
-<p><:eif new:> <:or HaveChildType:> <:eif HaveChildType:></p>
+<p><:eif New:> <:or HaveChildType:> <:eif HaveChildType:></p>
 <p><font size="-1">BSE Release <:release:></font></p>
-</body
-></html>
+</body></html>
index c2463da65f0cda42556adf1a13023a2994375796..123da5d49081a5c213400325ea172e0e26f2f209 100644 (file)
@@ -2,7 +2,7 @@
 <head>
 
   <title>
-    Administration - <: ifnew :>New<: or :>Edit<: eif :> <:articleType:>
+    Administration - <: ifNew :>New<: or :>Edit<: eif :> <:articleType:>
   </title>
 
   <link rel="stylesheet" type="text/css" href="/css/admin.css">
 <h1>Administration Page</h1>
 <:ifMessage:> 
 <p><b><:message:></b></p>
-<:or:><:eif:>
-<p>| <a href="/cgi-bin/admin/menu.pl">Admin menu</a> | <:ifnew:><:or:><:if Eq [article id] 3:><a href="<:article admin:>">See 
-  shop</a><:or Eq:><a href="<:article admin:>">See article</a><:eif Eq:> | <:eif:><:editParent:> 
-  <:if Eq [article id] 3:><a href="/cgi-bin/admin/shopadmin.pl">Manage catalogs</a> 
-  |<:or Eq:><:eif Eq:><:if new:><:or new:> <a href="<:script:>?id=<:article id:>&_t=steps">Manage 
-  step children/parents</a> | <:eif new:></p>
+<:or:><:eif:> 
+<p>| <a href="/cgi-bin/admin/menu.pl">Admin menu</a> | <:ifNew:><:or:><:if Eq
+   [article id] [cfg articles shop]:><a href="<:article admin:>">See shop</a><:or
+    Eq:><a href="<:article admin:>">See article</a><:eif Eq:> | <:eif:><:editParent:> 
+  <:if Eq [article id] [cfg articles shop]:><a href="/cgi-bin/admin/shopadmin.pl">Manage
+   catalogs</a> |<:or Eq:><:eif Eq:><:if New:><:or New:> <a href="<:script:>?id=<:article id:>&_t=steps">Manage
+    step children/parents</a> | <:eif New:></p>
 
   <h2><:articleType:> Details</h2>
 
-<:ifnew:><:or:>
+<:ifNew:><:or:>
 <:if Or [iadminuser_count] [iadmingroup_count]:>
       <form action="/cgi-bin/admin/adminusers.pl">
   <input type=hidden name=id value="<: article id:>">
             <th nowrap bgcolor="#FFFFFF" align="left"> Release date: </th>
             <td bgcolor="#FFFFFF" width="100%"> 
               <:if FieldPerm release:><input type="text" name="release" value="<: date "%d/%m/%Y" article release :>" size="10" maxlength="10">
-              (dd/mm/yyyy<: ifnew :> - default is today<: or :><: eif :>)<:or FieldPerm:><: date "%d/%m/%Y" article release :><:eif FieldPerm:></td>
+              (dd/mm/yyyy<: ifNew :> - default is today<: or :><: eif :>)<:or FieldPerm:><: date "%d/%m/%Y" article release :><:eif FieldPerm:></td>
             <td bgcolor="#FFFFFF"><:help edit release:></td>
           </tr>
           <tr> 
             <th nowrap bgcolor="#FFFFFF" align="left"> Expiry date: </th>
             <td bgcolor="#FFFFFF" width="100%"> 
               <:if FieldPerm expire:><input type="text" name="expire" value="<: date "%d/%m/%Y" article expire :>" size="10" maxlength="10">
-              (dd/mm/yyyy - <: ifnew :>default is never, <: or :><: eif :>blank 
+              (dd/mm/yyyy - <: ifNew :>default is never, <: or :><: eif :>blank 
               for never expires)<:or FieldPerm:><: date "%d/%m/%Y" article expire :><:eif FieldPerm:></td>
             <td bgcolor="#FFFFFF"><:help edit expire:></td>
           </tr>
             <th nowrap bgcolor="#FFFFFF" align="left"> Summary length: </th>
             <td bgcolor="#FFFFFF" width="100%"> 
               <:if FieldPerm summaryLength:><input type="text" name="summaryLength" size="10" maxlength="10" value="<: article summaryLength :>">
-              (in characters - <: ifnew :>default inherited from <:parentType:>, <: or :><: eif :> 
+              (in characters - <: ifNew :>default inherited from <:parentType:>, <: or :><: eif :> 
               zero for no summary)<:or FieldPerm:><: article summaryLength :><:eif FieldPerm:></td>
             <td bgcolor="#FFFFFF"><:help edit summary:></td>
           </tr>
             <td bgcolor="#FFFFFF" width="100%"> <:if FieldPerm listed:><:list listed:><:or FieldPerm:><:if Article listed:><:ifEq [article listed] "1":>Yes<:or:>In Sections, but not menu<:eif:><:or Article:>No<:eif Article:><:eif FieldPerm:> </td>
             <td bgcolor="#FFFFFF"><:help edit listed:></td>
           </tr>
+          <tr> 
+            <th nowrap bgcolor="#FFFFFF" align="left">Flags:</th>
+            <td bgcolor="#FFFFFF" width="100%"><:iterator begin flags:><:if FieldPerm flags:><input type=checkbox name=flags value="<:flag id:>" <:ifFlagSet [flag id]:>checked<:or:><:eif:>><:or FieldPerm:><:ifFlagSet [flag id]:>Yes<:or:>No<:eif:><:eif FieldPerm:><:flag desc:><:iterator end flags:></td>
+            <td bgcolor="#FFFFFF"><:help edit listed:></td>
+          </tr>
           <tr> 
             <th nowrap bgcolor="#FFFFFF" align="left" valign="top">Thumbnail image:</th>
             <td bgcolor="#FFFFFF" width="100%"> 
 </tr>
 </table>
 
-  <p><: ifnew :>
+  <p><: ifNew :>
     <input type="submit" name="save" value="  Add New <: articleType:>  ">
    <:or:>
   <:if UserCan edit_save:article:><input type="submit" name="save" value="  Update <: articleType:>  "><:or UserCan:><:eif UserCan:>
    <:eif:></p>
   </form>
-<:if children:> <:ifEq [article id] 3:> 
+<:if children:> <:ifEq [article id] [cfg articles shop]:> 
 <h2>Catalogs</h2>
 <:or:> 
 <h2><: childtype :></h2>
           <th width="70%">Summary</th>
           <th>Listed</th>
           <th nowrap>Modify</th>
+                 <th nowrap>Move</th>
         </tr>
 <:if UserCan edit_reorder_children:article:>
         <tr> 
-          <td colspan="4" bgcolor="#FFFFFF">Reorder child articles: <a href="/cgi-bin/admin/reorder.pl?parentid=<:article id:>&sort=title&refreshto=/cgi-bin/admin/add.pl?id=<:article id:>">by 
+          <td colspan="5" bgcolor="#FFFFFF">Reorder child articles: <a href="/cgi-bin/admin/reorder.pl?parentid=<:article id:>&sort=title&refreshto=/cgi-bin/admin/add.pl?id=<:article id:>">by 
             title</a> | <a href="/cgi-bin/admin/reorder.pl?parentid=<:article id:>&sort=date&refreshto=/cgi-bin/admin/add.pl?id=<:article id:>">by 
             date</a> | <a href="/cgi-bin/admin/reorder.pl?parentid=<:article id:>&reverse=1&refreshto=/cgi-bin/admin/add.pl?id=<:article id:>">reverse 
             order</a></td>
           <td width="70%"><: summary child body :></td>
           <td align="center"><: is child listed :></td>
           <td nowrap> <a href="/cgi-bin/admin/add.pl?id=<:child id:>">Edit</a> 
-            <:if UserCan edit_delete_article:child:><a href="/cgi-bin/admin/add.pl?id=<:child id:>&remove=1" onClick="return window.confirm('Are you sure you want to delete this <:ifEq [article id] 3:>Catalog<:or:><: childtype :><:eif:>')">Delete</a><:or UserCan:><:eif UserCan:>
-            <:movechild:> </td>
+            <:if UserCan edit_delete_article:child:><a href="/cgi-bin/admin/add.pl?id=<:child id:>&remove=1" onClick="return window.confirm('Are you sure you want to delete this <:ifEq [article id] 3:>Catalog<:or:><: childtype :><:eif:>')">Delete</a><:or UserCan:><:eif UserCan:></td>
+                 <td nowrap><:movechild:></td>
         </tr>
         <:iterator separator children:> <:iterator end children:> 
       </table>
 <:or children:>
 <:eif children:>
 <:if HaveChildType:>
-<:if new:>
-<:or new:>
+<:if New:>
+<:or New:>
 <:if UserCan edit_add_child:article:><form action="/cgi-bin/admin/add.pl">
 <input type=hidden name="parentid" value="<:article id:>">
   <p> 
-    <input type=submit value="Add <:ifEq [article id] 3:>Catalog<:or:><: childtype :><:eif:>">
+    <input type=submit value="Add <:ifEq [article id] [cfg articles shop]:>Catalog<:or:><: childtype :><:eif:>">
   </p>
 </form><:or UserCan:><:eif UserCan:>
-<:eif new:> <:or HaveChildType:> <:eif HaveChildType:>
+<:eif New:> <:or HaveChildType:> <:eif HaveChildType:>
 <p><font size="-1">BSE Release <:release:></font></p>
 </body></html>
index c2463da65f0cda42556adf1a13023a2994375796..123da5d49081a5c213400325ea172e0e26f2f209 100644 (file)
@@ -2,7 +2,7 @@
 <head>
 
   <title>
-    Administration - <: ifnew :>New<: or :>Edit<: eif :> <:articleType:>
+    Administration - <: ifNew :>New<: or :>Edit<: eif :> <:articleType:>
   </title>
 
   <link rel="stylesheet" type="text/css" href="/css/admin.css">
 <h1>Administration Page</h1>
 <:ifMessage:> 
 <p><b><:message:></b></p>
-<:or:><:eif:>
-<p>| <a href="/cgi-bin/admin/menu.pl">Admin menu</a> | <:ifnew:><:or:><:if Eq [article id] 3:><a href="<:article admin:>">See 
-  shop</a><:or Eq:><a href="<:article admin:>">See article</a><:eif Eq:> | <:eif:><:editParent:> 
-  <:if Eq [article id] 3:><a href="/cgi-bin/admin/shopadmin.pl">Manage catalogs</a> 
-  |<:or Eq:><:eif Eq:><:if new:><:or new:> <a href="<:script:>?id=<:article id:>&_t=steps">Manage 
-  step children/parents</a> | <:eif new:></p>
+<:or:><:eif:> 
+<p>| <a href="/cgi-bin/admin/menu.pl">Admin menu</a> | <:ifNew:><:or:><:if Eq
+   [article id] [cfg articles shop]:><a href="<:article admin:>">See shop</a><:or
+    Eq:><a href="<:article admin:>">See article</a><:eif Eq:> | <:eif:><:editParent:> 
+  <:if Eq [article id] [cfg articles shop]:><a href="/cgi-bin/admin/shopadmin.pl">Manage
+   catalogs</a> |<:or Eq:><:eif Eq:><:if New:><:or New:> <a href="<:script:>?id=<:article id:>&_t=steps">Manage
+    step children/parents</a> | <:eif New:></p>
 
   <h2><:articleType:> Details</h2>
 
-<:ifnew:><:or:>
+<:ifNew:><:or:>
 <:if Or [iadminuser_count] [iadmingroup_count]:>
       <form action="/cgi-bin/admin/adminusers.pl">
   <input type=hidden name=id value="<: article id:>">
             <th nowrap bgcolor="#FFFFFF" align="left"> Release date: </th>
             <td bgcolor="#FFFFFF" width="100%"> 
               <:if FieldPerm release:><input type="text" name="release" value="<: date "%d/%m/%Y" article release :>" size="10" maxlength="10">
-              (dd/mm/yyyy<: ifnew :> - default is today<: or :><: eif :>)<:or FieldPerm:><: date "%d/%m/%Y" article release :><:eif FieldPerm:></td>
+              (dd/mm/yyyy<: ifNew :> - default is today<: or :><: eif :>)<:or FieldPerm:><: date "%d/%m/%Y" article release :><:eif FieldPerm:></td>
             <td bgcolor="#FFFFFF"><:help edit release:></td>
           </tr>
           <tr> 
             <th nowrap bgcolor="#FFFFFF" align="left"> Expiry date: </th>
             <td bgcolor="#FFFFFF" width="100%"> 
               <:if FieldPerm expire:><input type="text" name="expire" value="<: date "%d/%m/%Y" article expire :>" size="10" maxlength="10">
-              (dd/mm/yyyy - <: ifnew :>default is never, <: or :><: eif :>blank 
+              (dd/mm/yyyy - <: ifNew :>default is never, <: or :><: eif :>blank 
               for never expires)<:or FieldPerm:><: date "%d/%m/%Y" article expire :><:eif FieldPerm:></td>
             <td bgcolor="#FFFFFF"><:help edit expire:></td>
           </tr>
             <th nowrap bgcolor="#FFFFFF" align="left"> Summary length: </th>
             <td bgcolor="#FFFFFF" width="100%"> 
               <:if FieldPerm summaryLength:><input type="text" name="summaryLength" size="10" maxlength="10" value="<: article summaryLength :>">
-              (in characters - <: ifnew :>default inherited from <:parentType:>, <: or :><: eif :> 
+              (in characters - <: ifNew :>default inherited from <:parentType:>, <: or :><: eif :> 
               zero for no summary)<:or FieldPerm:><: article summaryLength :><:eif FieldPerm:></td>
             <td bgcolor="#FFFFFF"><:help edit summary:></td>
           </tr>
             <td bgcolor="#FFFFFF" width="100%"> <:if FieldPerm listed:><:list listed:><:or FieldPerm:><:if Article listed:><:ifEq [article listed] "1":>Yes<:or:>In Sections, but not menu<:eif:><:or Article:>No<:eif Article:><:eif FieldPerm:> </td>
             <td bgcolor="#FFFFFF"><:help edit listed:></td>
           </tr>
+          <tr> 
+            <th nowrap bgcolor="#FFFFFF" align="left">Flags:</th>
+            <td bgcolor="#FFFFFF" width="100%"><:iterator begin flags:><:if FieldPerm flags:><input type=checkbox name=flags value="<:flag id:>" <:ifFlagSet [flag id]:>checked<:or:><:eif:>><:or FieldPerm:><:ifFlagSet [flag id]:>Yes<:or:>No<:eif:><:eif FieldPerm:><:flag desc:><:iterator end flags:></td>
+            <td bgcolor="#FFFFFF"><:help edit listed:></td>
+          </tr>
           <tr> 
             <th nowrap bgcolor="#FFFFFF" align="left" valign="top">Thumbnail image:</th>
             <td bgcolor="#FFFFFF" width="100%"> 
 </tr>
 </table>
 
-  <p><: ifnew :>
+  <p><: ifNew :>
     <input type="submit" name="save" value="  Add New <: articleType:>  ">
    <:or:>
   <:if UserCan edit_save:article:><input type="submit" name="save" value="  Update <: articleType:>  "><:or UserCan:><:eif UserCan:>
    <:eif:></p>
   </form>
-<:if children:> <:ifEq [article id] 3:> 
+<:if children:> <:ifEq [article id] [cfg articles shop]:> 
 <h2>Catalogs</h2>
 <:or:> 
 <h2><: childtype :></h2>
           <th width="70%">Summary</th>
           <th>Listed</th>
           <th nowrap>Modify</th>
+                 <th nowrap>Move</th>
         </tr>
 <:if UserCan edit_reorder_children:article:>
         <tr> 
-          <td colspan="4" bgcolor="#FFFFFF">Reorder child articles: <a href="/cgi-bin/admin/reorder.pl?parentid=<:article id:>&sort=title&refreshto=/cgi-bin/admin/add.pl?id=<:article id:>">by 
+          <td colspan="5" bgcolor="#FFFFFF">Reorder child articles: <a href="/cgi-bin/admin/reorder.pl?parentid=<:article id:>&sort=title&refreshto=/cgi-bin/admin/add.pl?id=<:article id:>">by 
             title</a> | <a href="/cgi-bin/admin/reorder.pl?parentid=<:article id:>&sort=date&refreshto=/cgi-bin/admin/add.pl?id=<:article id:>">by 
             date</a> | <a href="/cgi-bin/admin/reorder.pl?parentid=<:article id:>&reverse=1&refreshto=/cgi-bin/admin/add.pl?id=<:article id:>">reverse 
             order</a></td>
           <td width="70%"><: summary child body :></td>
           <td align="center"><: is child listed :></td>
           <td nowrap> <a href="/cgi-bin/admin/add.pl?id=<:child id:>">Edit</a> 
-            <:if UserCan edit_delete_article:child:><a href="/cgi-bin/admin/add.pl?id=<:child id:>&remove=1" onClick="return window.confirm('Are you sure you want to delete this <:ifEq [article id] 3:>Catalog<:or:><: childtype :><:eif:>')">Delete</a><:or UserCan:><:eif UserCan:>
-            <:movechild:> </td>
+            <:if UserCan edit_delete_article:child:><a href="/cgi-bin/admin/add.pl?id=<:child id:>&remove=1" onClick="return window.confirm('Are you sure you want to delete this <:ifEq [article id] 3:>Catalog<:or:><: childtype :><:eif:>')">Delete</a><:or UserCan:><:eif UserCan:></td>
+                 <td nowrap><:movechild:></td>
         </tr>
         <:iterator separator children:> <:iterator end children:> 
       </table>
 <:or children:>
 <:eif children:>
 <:if HaveChildType:>
-<:if new:>
-<:or new:>
+<:if New:>
+<:or New:>
 <:if UserCan edit_add_child:article:><form action="/cgi-bin/admin/add.pl">
 <input type=hidden name="parentid" value="<:article id:>">
   <p> 
-    <input type=submit value="Add <:ifEq [article id] 3:>Catalog<:or:><: childtype :><:eif:>">
+    <input type=submit value="Add <:ifEq [article id] [cfg articles shop]:>Catalog<:or:><: childtype :><:eif:>">
   </p>
 </form><:or UserCan:><:eif UserCan:>
-<:eif new:> <:or HaveChildType:> <:eif HaveChildType:>
+<:eif New:> <:or HaveChildType:> <:eif HaveChildType:>
 <p><font size="-1">BSE Release <:release:></font></p>
 </body></html>
index 9c90963793b0554214dae642c6cc7a96c76d3818..94d492da19fae1e8c57b718b20dbcda2c2410eb4 100644 (file)
@@ -2,7 +2,7 @@
 <head>
 
 <title>
-    <: ifnew :>New<: or :>Edit<: eif :> Catalog - Shop Administration
+    <: ifNew :>New<: or :>Edit<: eif :> Catalog - Shop Administration
 </title>
 
   <link rel="stylesheet" type="text/css" href="/css/admin.css">
 <:ifMessage:> 
 <p><b><:message:></b></p>
 <:or:><:eif:> 
-<p>| <a href="/cgi-bin/admin/menu.pl">Admin menu</a> | <:ifnew:><:or:><a href="<:article admin:>">See 
+<p>| <a href="/cgi-bin/admin/menu.pl">Admin menu</a> | <:ifNew:><:or:><a href="<:article admin:>">See 
   catalog</a> | <:eif:><:editParent:> <a href="/cgi-bin/admin/shopadmin.pl">Manage 
-  catalogs</a> | <:if new:><:or new:><a href="<:script:>?id=<:article id:>&_t=steps">Manage 
-  step children/parents</a> | <:eif new:></p>
+  catalogs</a> | <:if New:><:or New:><a href="<:script:>?id=<:article id:>&_t=steps">Manage 
+  step children/parents</a> | <:eif New:></p>
 
   <h2>Catalog Details</h2>
 
-<:ifnew:><:or:>
+<:ifNew:><:or:>
 <:if Or [iadminuser_count] [iadmingroup_count]:>
       <form action="/cgi-bin/admin/adminusers.pl">
   <input type=hidden name=id value="<: article id:>">
             <th bgcolor="#FFFFFF" nowrap align="left"> Release date: </th>
             <td bgcolor="#FFFFFF" width="100%"> 
               <:if FieldPerm release:><input type="text" name="release" value="<: date "%d/%m/%Y" article release :>" size="10" maxlength="10">
-              (dd/mm/yyyy<: ifnew :> - default is today<: or :><: eif :>)<:or FieldPerm:><: date "%d/%m/%Y" article release :><:eif FieldPerm:></td></td>
+              (dd/mm/yyyy<: ifNew :> - default is today<: or :><: eif :>)<:or FieldPerm:><: date "%d/%m/%Y" article release :><:eif FieldPerm:></td></td>
             <td bgcolor="#FFFFFF"><:help catalog release:></td>
           </tr>
           <tr> 
             <th bgcolor="#FFFFFF" nowrap align="left"> Expiry date: </th>
             <td bgcolor="#FFFFFF" width="100%"> 
               <:if FieldPerm expire:><input type="text" name="expire" value="<: date "%d/%m/%Y" article expire :>" size="10" maxlength="10">
-              (dd/mm/yyyy - <: ifnew :>default is never, <: or :><: eif :>blank 
+              (dd/mm/yyyy - <: ifNew :>default is never, <: or :><: eif :>blank 
               for never expires)<:or FieldPerm:><: date "%d/%m/%Y" article expire :><:eif FieldPerm:></td>
             <td bgcolor="#FFFFFF"><:help catalog expire:></td>
           </tr>
             <td bgcolor="#FFFFFF" width="100%"> <:if FieldPerm listed:><:list listed:><:or FieldPerm:><:if Article listed:><:ifEq [article listed] "1":>Yes<:or:>In Sections, but not menu<:eif:><:or Article:>No<:eif Article:><:eif FieldPerm:> </td>
             <td bgcolor="#FFFFFF"><:help catalog list:></td>
           </tr>
+          <tr> 
+            <th nowrap bgcolor="#FFFFFF" align="left">Flags:</th>
+            <td bgcolor="#FFFFFF" width="100%"><:iterator begin flags:><:if FieldPerm flags:><input type=checkbox name=flags value="<:flag id:>" <:ifFlagSet [flag id]:>checked<:or:><:eif:>><:or FieldPerm:><:ifFlagSet [flag id]:>Yes<:or:>No<:eif:><:eif FieldPerm:><:flag desc:><:iterator end flags:></td>
+            <td bgcolor="#FFFFFF"><:help edit listed:></td>
+          </tr>
           <tr> 
             <th bgcolor="#FFFFFF" nowrap align="left" valign="top">Thumbnail image:</th>
             <td bgcolor="#FFFFFF" width="100%"> 
 </tr>
 </table>
 
-  <p><: ifnew :>
+  <p><: ifNew :>
     <input type="submit" name="save"
            value="  Add New Catalog  ">
      <: or :>
           <th width="70%">Summary</th>
           <th>Listed</th>
           <th nowrap>Modify</th>
+                 <th nowrap>Move</th>
         </tr>
 <:if UserCan edit_reorder_children:article:>
         <tr> 
-          <td colspan="4" bgcolor="#FFFFFF">Reorder child articles: <a href="/cgi-bin/admin/reorder.pl?parentid=<:article id:>&sort=title&refreshto=/cgi-bin/admin/add.pl?id=<:article id:>">by 
+          <td colspan="5" bgcolor="#FFFFFF">Reorder child articles: <a href="/cgi-bin/admin/reorder.pl?parentid=<:article id:>&sort=title&refreshto=/cgi-bin/admin/add.pl?id=<:article id:>">by 
             title</a> | <a href="/cgi-bin/admin/reorder.pl?parentid=<:article id:>&sort=date&refreshto=/cgi-bin/admin/add.pl?id=<:article id:>">by 
             date</a> | <a href="/cgi-bin/admin/reorder.pl?parentid=<:article id:>&reverse=1&refreshto=/cgi-bin/admin/add.pl?id=<:article id:>">reverse 
             order</a></td>
           <td width="30%"><a href="<:child admin:>"><:child title:></a></td>
           <td width="70%"><: summary child body :></td>
           <td align="center"><: is child listed :></td>
-          <td nowrap> <: edit child Edit :> <:if UserCan edit_delete_article:child:><a href="/cgi-bin/admin/add.pl?id=<:child id:>&remove=1" onClick="return window.confirm('Are you sure you want to delete this <:ifMatch [child generator] "Product":>Product<:or:>Sub-catalog<:eif:>')">Delete</a><:or UserCan:><:eif UserCan:>
-         <:movechild:> </td>
+          <td nowrap> <: edit child Edit :> <:if UserCan edit_delete_article:child:><a href="/cgi-bin/admin/add.pl?id=<:child id:>&remove=1" onClick="return window.confirm('Are you sure you want to delete this <:ifMatch [child generator] "Product":>Product<:or:>Sub-catalog<:eif:>')">Delete</a><:or UserCan:><:eif UserCan:></td>
+             <td nowrap><:movechild:></td>
         </tr>
         <:iterator separator children:> <:iterator end children:> 
       </table>
 <:or children:>
 <:eif children:>
 <:if HaveChildType:>
-<:if new:>
-<:or new:>
+<:if New:>
+<:or New:>
 <:if UserCan edit_add_child:article:>
 <p>
 <form action="/cgi-bin/admin/add.pl" method="POST">
 <input type=hidden name="parentid" value="Product">
     <input type=submit value="Add Product">
 </form><:or UserCan:><:eif UserCan:></p>
-<:eif new:> <:or HaveChildType:> <:eif HaveChildType:> 
+<:eif New:> <:or HaveChildType:> <:eif HaveChildType:> 
 <p><font size="-1">BSE Release <:release:></font></p>
 </body
 ></html>
index e28c63a26311ae1a04a98f31584256fd3235feb4..f2247df7a128bc4b86cf9b2a5de46857c246ca99 100644 (file)
             <td bgcolor="#FFFFFF" width="100%"> <:if FieldPerm listed:><:list listed:><:or FieldPerm:><:if Article listed:><:ifEq [article listed] "1":>Yes<:or:>In Sections, but not menu<:eif:><:or Article:>No<:eif Article:><:eif FieldPerm:> </td>
             <td bgcolor="#FFFFFF"><:help edit listed:></td>
           </tr>
+          <tr> 
+            <th nowrap bgcolor="#FFFFFF" align="left">Flags:</th>
+            <td bgcolor="#FFFFFF" width="100%"><:iterator begin flags:><:if FieldPerm flags:><input type=checkbox name=flags value="<:flag id:>" <:ifFlagSet [flag id]:>checked<:or:><:eif:>><:or FieldPerm:><:ifFlagSet [flag id]:>Yes<:or:>No<:eif:><:eif FieldPerm:><:flag desc:><:iterator end flags:></td>
+            <td bgcolor="#FFFFFF"><:help edit listed:></td>
+          </tr>
           <tr> 
             <th nowrap align="left" bgcolor="#FFFFFF" valign="top">Thumbnail image:</th>
             <td nowrap bgcolor="#FFFFFF"> 
index 42c44eb97d143571645a3478d9f365f24b102632..478a7a64c6ddef0a0c56441d1411dfdbbffbf5ed 100644 (file)
@@ -19,7 +19,7 @@
   catalogs</a> | <a href="/cgi-bin/admin/add.pl?id=<:article id:>">Edit 
   product</a><:or:><a href="/cgi-bin/admin/add.pl?id=<:article id:>"><:if Eq [article 
   parentid] 3:>Edit catalog<:or Eq:>Edit article<:eif Eq:></a><:eif:> |</p>
-<:if new:><:or new:> <:if Match [article generator] "Product":><:or Match:> 
+<:if New:><:or New:> <:if Match [article generator] "Product":><:or Match:> 
 <h2><a name="step"></a>Step children</h2>
 <table border="0" cellspacing="0" cellpadding="0" bgcolor='#000000' width="100%" class="table">
   <tr><td>
           <th>Release</th>
           <th>Expire</th>
           <th>Modify</th>
+                 <th>Move</th>
         </tr>
         <:if Kids:>
         <tr bgcolor="#FFFFFF"> 
-          <td colspan="5" align="center">Note: Delete only removes the stepchild 
+          <td colspan="6" align="center">Note: Delete only removes the stepchild 
             relationship. It does not delete the article.</td>
         </tr>
  
 <:if UserCan edit_reorder_children:article:>
         <tr> 
-          <td colspan="5" bgcolor="#FFFFFF">Reorder stepchild articles: <a href="/cgi-bin/admin/reorder.pl?stepparent=<:article id:>&sort=title&refreshto=/cgi-bin/admin/add.pl?id=<:article id:>%26_t=steps%23step">by 
+          <td colspan="6" bgcolor="#FFFFFF">Reorder stepchild articles: <a href="/cgi-bin/admin/reorder.pl?stepparent=<:article id:>&sort=title&refreshto=/cgi-bin/admin/add.pl?id=<:article id:>%26_t=steps%23step">by 
             title</a> | <a href="/cgi-bin/admin/reorder.pl?stepparent=<:article id:>&sort=date&refreshto=/cgi-bin/admin/add.pl?id=<:article id:>%26_t=steps%23step">by 
             date</a> | <a href="/cgi-bin/admin/reorder.pl?stepparent=<:article id:>&reverse=1&refreshto=/cgi-bin/admin/add.pl?id=<:article id:>%26_t=steps%23step">reverse 
             order</a></td>
             <td nowrap><:ifStepKid:> 
               <:if UserCan edit_stepkid_save:article,edit_stepparent_save:[stepkid childId]:><input type="text" name="expire_<:stepkid childId:>" value="<:date "%d/%m/%Y" stepkid expire:>" size=10><:or UserCan:><:date "%d/%m/%Y" stepkid expire:><:eif UserCan:>
               <:or:>&nbsp;<:eif:></td>
-            <td nowrap><:edit kid Edit:> <:ifStepKid:><:if UserCan edit_stepkid_delete:article,edit_stepparent_delete:[stepkid childId] :><a href="<:script:>?del_stepkid=1&id=<:stepkid parentId:>&stepkid=<:stepkid childId:>&_t=steps" onClick="return window.confirm('Are you sure you want to delete this Step child')">Delete</a><:or UserCan:><:eif UserCan:><:or:><:eif:> 
-              <:movestepkid:></td>
+            <td nowrap><:edit kid Edit:> <:ifStepKid:><:if UserCan edit_stepkid_delete:article,edit_stepparent_delete:[stepkid childId] :><a href="<:script:>?del_stepkid=1&id=<:stepkid parentId:>&stepkid=<:stepkid childId:>&_t=steps" onClick="return window.confirm('Are you sure you want to delete this Step child')">Delete</a><:or UserCan:><:eif UserCan:><:or:><:eif:> </td>
+                       <td nowrap><:movestepkid:></td>
           </tr>
           <:iterator end kids:> 
 <:if UserCan edit_stepkid_save:article :>
           <tr bgcolor="#FFFFFF"> 
-            <td colspan="5" align="center"> 
+            <td colspan="6" align="center"> 
               <input type="submit" name="save_stepkids" value="Save Changes">
             </td>
           </tr>
 <:or UserCan:><:eif UserCan:>
           <:or Kids:> 
           <tr bgcolor="#FFFFFF"> 
-            <td colspan="5" align="center">No children</td>
+            <td colspan="6" align="center">No children</td>
           </tr>
           <:eif Kids:> 
         </form>
@@ -87,7 +88,7 @@
             <td> 
               <input type="text" name="expire" value="31/12/2999" size="10">
             </td>
-            <td> 
+            <td colspan="2"
               <input type="submit" name="add_stepkid" value="Add Stepchild">
             </td>
           </tr>
@@ -95,7 +96,7 @@
         <:or Possibles:><:eif Possibles:> 
       </table>
 </td></tr></table>
-<:eif Match:> <:eif new:> <a name="stepparents"></a>
+<:eif Match:> <:eif New:> <a name="stepparents"></a>
 <h2>Step parents</h2>
 <table border="0" cellspacing="0" cellpadding="0" bgcolor='#000000' width="100%" class="table">
   <tr><td>
           <th>Release</th>
           <th>Expire</th>
           <th>Modify</th>
+                 <th>Move</th>
         </tr>
         <:if StepParents:> 
         <tr bgcolor="#FFFFFF"> 
-          <td colspan="5" align="center">Note: Delete only removes the stepparent 
+          <td colspan="6" align="center">Note: Delete only removes the stepparent 
             relationship. It does not delete the article.</td>
         </tr>
 <:if UserCan edit_reorder_stepparents:article :>
         <tr bgcolor="#FFFFFF"> 
-          <td colspan="5">Reorder stepparent articles: <a href="/cgi-bin/admin/reorder.pl?stepchild=<:article id:>&sort=title&refreshto=/cgi-bin/admin/add.pl?id=<:article id:>%26_t=steps%23stepparents">by 
+          <td colspan="6">Reorder stepparent articles: <a href="/cgi-bin/admin/reorder.pl?stepchild=<:article id:>&sort=title&refreshto=/cgi-bin/admin/add.pl?id=<:article id:>%26_t=steps%23stepparents">by 
             title</a> | <a href="/cgi-bin/admin/reorder.pl?stepchild=<:article id:>&sort=date&refreshto=/cgi-bin/admin/add.pl?id=<:article id:>%26_t=steps%23stepparents">by 
             date</a> | <a href="/cgi-bin/admin/reorder.pl?stepchild=<:article id:>&reverse=1&refreshto=/cgi-bin/admin/add.pl?id=<:article id:>%26_t=steps%23stepparents">reverse 
             order</a></td>
               <:if UserCan edit_stepparent_save:article,edit_stepkid_save:[stepparent parentId]:><input type="text" name="expire_<:stepparent parentId:>" value="<:date "%d/%m/%Y" stepparent expire:>" size="10"><:or UserCan:><:date "%d/%m/%Y" stepparent expire:><:eif UserCan:>
             </td>
             <td nowrap><a href="/cgi-bin/admin/add.pl?id=<:stepparent parentId:>">Edit</a> 
-              <:if UserCan edit_stepkid_delete:[stepparent parentId],edit_stepparent_delete:article :><a href="<:script:>?del_stepparent=1&id=<:stepparent childId:>&stepparent=<:stepparent parentId:>&_t=steps" onClick="return window.confirm('Are you sure you want to delete this Step parent')">Delete</a> <:or UserCan:><:eif UserCan:>
-              <:movestepparent:></td>
+              <:if UserCan edit_stepkid_delete:[stepparent parentId],edit_stepparent_delete:article :><a href="<:script:>?del_stepparent=1&id=<:stepparent childId:>&stepparent=<:stepparent parentId:>&_t=steps" onClick="return window.confirm('Are you sure you want to delete this Step parent')">Delete</a> <:or UserCan:><:eif UserCan:></td>
+                         <td nowrap><:movestepparent:></td>
           </tr>
           <:iterator end stepparents:> 
 <:if UserCan edit_stepparent_save:article :>
           <tr bgcolor="#FFFFFF"> 
-            <td colspan="5" align="center"> 
+            <td colspan="6" align="center"> 
               <input type="submit" name="save_stepparents" value="Save Changes">
             </td>
           </tr>
         </form>
         <:or StepParents:> 
         <tr bgcolor="#FFFFFF"> 
-          <td colspan="5" align="center">No step parents</td>
+          <td colspan="6" align="center">No step parents</td>
         </tr>
         <:eif StepParents:> <:if StepparentPossibles:> 
         <form action="<:script:>" method="POST">
             <td> 
               <input type="text" name="expire" value="31/12/2999" size="10">
             </td>
-            <td> 
+            <td colspan="2"
               <input type="submit" name="add_stepparent" value="Add Stepparent">
             </td>
           </tr>
         </form>
         <:or StepparentPossibles:> 
         <tr bgcolor="#FFFFFF"> 
-          <td colspan="5" align="center">No more possible catalogs to add.</td>
+          <td colspan="6" align="center">No more possible catalogs to add.</td>
         </tr>
         <:eif StepparentPossibles:> 
       </table>
 </td></tr>
 </table>
 <p><font size="-1">BSE Release <:release:></font></p>
-</body
-></html>
+</body></html>
index 7c66e4be9bfddcd5260bae4f6db88a5c4ddf0fb6..58113122d01012822e85ca06939b960a7755ce68 100644 (file)
@@ -7,31 +7,41 @@
   catalogs</a> | <a href="<:script:>?order_list=1">Manage orders</a> | <a href="<:script:>?order_list=1&template=order_list_unfilled">Unfilled 
   orders</a> | <a href="<:script:>?order_list=1&template=order_list_filled">Filled 
   orders</a> |</p>
-<h2>Order details</h2>
+<h2>Order details - No: #<:order id:></h2>
 <table cellpadding="6" cellspacing="1" border="0">
- <tr><td>E-mail:</td><td><a href="mailto:<:order emailAddress:>"><:order emailAddress:></a></td></tr>
- <tr><td>Date:</td><td><:date order orderDate:></td></tr>
-<tr>
- <td>Delivery:</td>
- <td><:order delivFirstName:> <:order delivLastName:></td>
- <td rowspan=4>&nbsp;&nbsp;</td>
- <td>Billing:</td>
- <td><:order billFirstName:> <:order billLastName:></td>
-</tr>
-<tr>
- <td rowspan=3>&nbsp;</td>
- <td><:order delivStreet:></td>
- <td rowspan=3>&nbsp;</td>
- <td><:order billStreet:></td>
-</tr>
-<tr>
- <td><:order delivSuburb:> <:order delivState:> <:order delivPostCode:></td>
- <td><:order billSuburb:> <:order billState:> <:order billPostCode:></td>
-</tr>
-<tr>
- <td><:order delivCountry:></td>
- <td><:order billCountry:></td>
-</tr>
+  <tr> 
+    <td align="left"><b>E-mail:</b></td>
+    <td><a href="mailto:<:order emailAddress:>"><:order emailAddress:></a></td>
+    <td>&nbsp;</td>
+    <td align="left"><b>Phone:</b></td>
+    <td><:order telephone:></td>
+    <!--<td rowspan=3>&nbsp;&nbsp;</td>-->
+  </tr>
+  <tr> 
+    <td align="left"><b>Date:</b></td>
+    <td><:date order orderDate:></td>
+  </tr>
+  <tr> 
+    <td align="left"><b>Delivery:</b></td>
+    <td><:order delivFirstName:> <:order delivLastName:></td>
+    <td rowspan=4>&nbsp;&nbsp;</td>
+    <td align="left"><b>Billing:</b></td>
+    <td><:order billFirstName:> <:order billLastName:></td>
+  </tr>
+  <tr> 
+    <td rowspan=3>&nbsp;</td>
+    <td><:order delivStreet:></td>
+    <td rowspan=3>&nbsp;</td>
+    <td><:order billStreet:></td>
+  </tr>
+  <tr> 
+    <td><:order delivSuburb:> <:order delivState:> <:order delivPostCode:></td>
+    <td><:order billSuburb:> <:order billState:> <:order billPostCode:></td>
+  </tr>
+  <tr> 
+    <td><:order delivCountry:></td>
+    <td><:order billCountry:></td>
+  </tr>
 </table>
 
 <br>
index d2d5c72edc0bb48e6d479e5b85d4de00683d0bd6..970171abfd064d912dfdfa0159fb9a961957f135 100644 (file)
@@ -40,6 +40,7 @@ my @prebuilt =
     thumbHeight=>0,
     level=>1,
     listed=>0,
+    flags=>'',
    },
    {
     # the invisible subsection for what's hot
@@ -65,6 +66,7 @@ my @prebuilt =
     thumbHeight=>0,
     level=>2,
     listed=>2,
+    flags=>'',
    },
    {
     id=>3,
@@ -89,6 +91,7 @@ my @prebuilt =
     thumbHeight=>0,
     level=>1,
     listed=>1,
+    flags=>'',
    },
    {
     id=>4,
@@ -113,6 +116,7 @@ my @prebuilt =
     thumbHeight=>0,
     level=>2,
     listed=>2,
+    flags=>'',
    },
    {
     id=>5,
@@ -137,6 +141,7 @@ my @prebuilt =
     thumbHeight=>0,
     level=>2,
     listed=>0,
+    flags=>'',
    },
    {
     id=>6,
@@ -391,6 +396,7 @@ EOS
     thumbHeight=>0,
     level=>3,
     listed=>0,
+    flags=>'',
    },
    {
     id=>7,
@@ -419,6 +425,7 @@ EOS
     thumbHeight=>0,
     level=>3,
     listed=>0,
+    flags=>'',
    },
    {
     id=>8,
@@ -447,6 +454,7 @@ EOS
     thumbHeight=>0,
     level=>3,
     listed=>1,
+    flags=>'',
    },
   );
 
index ea142fd113e622c64824ee55c914bcb71d8219d4..5f2f763beec8b9fe01cd1792f25765f9615655ad 100644 (file)
@@ -25,20 +25,20 @@ fetch_ok($ua, "advanced search form", "$baseurl/cgi-bin/search.pl",
         "All\\s+lower\\s+case");
 fetch_ok($ua, "failed search", "$baseurl/cgi-bin/search.pl?q=blargle",
         "No\\s+documents\\s+were\\s+found");
-fetch_ok($ua, "good search", "$baseurl/cgi-bin/search.pl?q=title",
-        qr!My\s+site(?:'|&\#39;)s\s+title.*\[formatting\s+guide!s);
+fetch_ok($ua, "good search", "$baseurl/cgi-bin/search.pl?q=shop",
+        qr!You\s+can\s+buy!s);
 fetch_ok($ua, "user logon page", "$baseurl/cgi-bin/user.pl",
         qr!User\s+Logon!s);
 fetch_ok($ua, "shop admin page", "$baseurl/cgi-bin/admin/shopadmin.pl",
         qr!Shop\s+administration!s);
 fetch_ok($ua, "add article form", "$baseurl/cgi-bin/admin/add.pl",
-        qr!New\s+Subsect\sLev2!s);
+        qr!New\s+Page\sLev3!s);
 fetch_ok($ua, "add catalog form", "$baseurl/cgi-bin/admin/add.pl?type=Catalog",
         qr!New\s+Catalog!s);
 fetch_ok($ua, "add product form", "$baseurl/cgi-bin/admin/add.pl?type=Product",
         qr!Add\s+product!s);
 fetch_ok($ua, "edit article form", "$baseurl/cgi-bin/admin/add.pl?id=1",
-        qr!Section\sDetails!s);
+        qr!Edit\s+Page\s+Lev1!s);
 fetch_ok($ua, "edit catalog form", "$baseurl/cgi-bin/admin/add.pl?id=4",
         qr!Catalog\sDetails!s);
 fetch_ok($ua, "user list", "$baseurl/cgi-bin/admin/adminusers.pl",
index 736f80e14cd4173f914812c4ea242cf3d8f66fd5..d698803547fd2c981b3652d22cde65412aaec5c1 100644 (file)
@@ -14,7 +14,7 @@ ok($ua->get("$baseurl/cgi-bin/admin/add.pl?parentid=-1"), "edit page");
              .*
              common/default.tmpl
              .*
-             Add\s+New\s+Section
+             Add\s+New\s+Page\s+Lev1
              !xs);
 check_form($ua->{content},
           "edit form",
index 587b2d19620bfc22752437911456600e6983eba7..9821ffa5a801f251857df5726bfbd2066f1b520d 100644 (file)
@@ -123,7 +123,7 @@ sub add_article {
      imagePos => 'tr', release=>sql_datetime(time-86400), expire=>'2999-12-31',
      keyword=>'', template=>'common/default.tmpl', link=>'', admin=>'',
      threshold => 5, summaryLength => 100, generator=>'Generate::Article',
-     level => 1, listed=>1, lastModified => sql_datetime(time),
+     level => 1, listed=>1, lastModified => sql_datetime(time), flags=>'',
     );
   for my $key (%defaults) {
     unless (exists $parms{$key}) {