From d324b766ce9a211429ef7a998e85323a83042d09 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Fri, 20 Jul 2007 16:34:10 +0000 Subject: [PATCH] Help pruning for Matrix. Changed www_edit to use Wobject style add/edit title generation, this really needs to be a method. --- lib/WebGUI/Asset/Wobject/Matrix.pm | 6 +- lib/WebGUI/Help/Asset_Matrix.pm | 225 +----------------------- lib/WebGUI/i18n/English/Asset_Matrix.pm | 76 +------- 3 files changed, 15 insertions(+), 292 deletions(-) diff --git a/lib/WebGUI/Asset/Wobject/Matrix.pm b/lib/WebGUI/Asset/Wobject/Matrix.pm index 683cd7a43..1a7c8e578 100644 --- a/lib/WebGUI/Asset/Wobject/Matrix.pm +++ b/lib/WebGUI/Asset/Wobject/Matrix.pm @@ -511,9 +511,9 @@ sub www_edit { my $self = shift; return $self->session->privilege->insufficient() unless $self->canEdit; return $self->session->privilege->locked() unless $self->canEditIfLocked; - my $i18n = WebGUI::International->new($self->session,'Asset_Matrix'); - $self->getAdminConsole->setHelp('matrix add/edit', 'Asset_Matrix'); - return $self->getAdminConsole->render($self->getEditForm->print, $i18n->get("edit matrix")); + my $i18n = WebGUI::International->new($self->session, 'Asset_Wobject'); + my $addEdit = ($self->session->form->process("func") eq 'add') ? $i18n->get('add') : $i18n->get('edit'); + return $self->getAdminConsole->render($self->getEditForm->print,$addEdit.' '.$self->getName); } #------------------------------------------------------------------- diff --git a/lib/WebGUI/Help/Asset_Matrix.pm b/lib/WebGUI/Help/Asset_Matrix.pm index 2eeace8b7..fca481a20 100644 --- a/lib/WebGUI/Help/Asset_Matrix.pm +++ b/lib/WebGUI/Help/Asset_Matrix.pm @@ -1,207 +1,10 @@ package WebGUI::Help::Asset_Matrix; our $HELP = { - 'matrix add/edit' => { - title => 'add/edit help title', - body => 'add/edit help body', - isa => [ - ], - fields => [ - { - title => 'visitor cache timeout', - namespace => 'Asset_Matrix', - description => 'visitor cache timeout help', - uiLevel => 8, - }, - { - title => 'categories', - description => 'categories description', - namespace => 'Asset_Matrix', - }, - { - title => 'max comparisons', - description => 'max comparisons description', - namespace => 'Asset_Matrix', - }, - { - title => 'max comparisons privileged', - description => 'max comparisons privileged description', - namespace => 'Asset_Matrix', - }, - { - title => 'detail template', - description => 'detail template description', - namespace => 'Asset_Matrix', - }, - { - title => 'rating timeout', - description => 'rating timeout description', - namespace => 'Asset_Matrix', - }, - { - title => 'rating timeout privileged', - description => 'rating timeout privileged description', - namespace => 'Asset_Matrix', - }, - { - title => 'group to add', - description => 'group to add description', - namespace => 'Asset_Matrix', - }, - { - title => 'privileged group', - description => 'privileged group description', - namespace => 'Asset_Matrix', - }, - { - title => 'rating group', - description => 'rating group description', - namespace => 'Asset_Matrix', - }, - { - title => 'main template', - description => 'main template description', - namespace => 'Asset_Matrix', - }, - { - title => 'rating detail template', - description => 'rating detail template description', - namespace => 'Asset_Matrix', - }, - { - title => 'search template', - description => 'search template description', - namespace => 'Asset_Matrix', - }, - { - title => 'compare template', - description => 'compare template description', - namespace => 'Asset_Matrix', - }, - ], - related => [ - { - tag => 'search template', - namespace => 'Asset_Matrix' - }, - { - tag => 'compare template', - namespace => 'Asset_Matrix' - }, - { - tag => 'ratings detail template', - namespace => 'Asset_Matrix' - }, - { - tag => 'main template', - namespace => 'Asset_Matrix' - }, - { - tag => 'listing detail template', - namespace => 'Asset_Matrix' - }, - ], - }, - - 'listing add/edit' => { - title => 'listing add/edit help title', - body => 'listing add/edit help body', - fields => [ - { - title => 'product name', - description => 'product name description', - namespace => 'Asset_Matrix', - }, - { - title => 'version number', - description => 'version number description', - namespace => 'Asset_Matrix', - }, - { - title => 'product url', - description => 'product url description', - namespace => 'Asset_Matrix', - }, - { - title => 'manufacturer name', - description => 'manufacturer name description', - namespace => 'Asset_Matrix', - }, - { - title => 'manufacturer url', - description => 'manufacturer url description', - namespace => 'Asset_Matrix', - }, - { - title => 'description', - description => 'description description', - namespace => 'Asset_Matrix', - }, - { - title => 'listing maintainer', - description => 'listing maintainer description', - namespace => 'Asset_Matrix', - }, - { - title => 'matrix specific fields', - description => 'matrix specific fields description', - namespace => 'Asset_Matrix', - }, - ], - related => [ - { - tag => 'matrix add/edit', - namespace => 'Asset_Matrix' - }, - ], - }, - - 'field add/edit' => { - title => 'field add/edit help title', - body => 'field add/edit help body', - fields => [ - { - title => 'field name', - description => 'field name description', - namespace => 'Asset_Matrix', - }, - { - title => 'field label', - description => 'field label description', - namespace => 'Asset_Matrix', - }, - { - title => 'field type', - description => 'field type description', - namespace => 'Asset_Matrix', - }, - { - title => 'field description', - description => 'field description description', - namespace => 'Asset_Matrix', - }, - { - title => 'default value', - description => 'default value description', - namespace => 'Asset_Matrix', - }, - { - title => 'category', - description => 'category description', - namespace => 'Asset_Matrix', - }, - ], - related => [ - { - tag => 'matrix add/edit', - namespace => 'Asset_Matrix' - }, - ], - }, 'search template' => { title => 'search template help title', - body => 'search template help body', + body => '', variables => [ { 'name' => 'compare.form', @@ -240,10 +43,6 @@ our $HELP = { } ], related => [ - { - tag => 'matrix add/edit', - namespace => 'Asset_Matrix' - }, { tag => 'compare template', namespace => 'Asset_Matrix' @@ -265,7 +64,7 @@ our $HELP = { 'compare template' => { title => 'comparison template help title', - body => 'comparison template help body', + body => '', variables => [ { 'name' => 'isTooMany' @@ -333,10 +132,6 @@ our $HELP = { } ], related => [ - { - tag => 'matrix add/edit', - namespace => 'Asset_Matrix' - }, { tag => 'search template', namespace => 'Asset_Matrix' @@ -358,7 +153,7 @@ our $HELP = { 'ratings detail template' => { title => 'ratings detail template help title', - body => 'ratings detail template help body', + body => '', variables => [ { 'name' => 'rating_loop', @@ -395,10 +190,6 @@ our $HELP = { } ], related => [ - { - tag => 'matrix add/edit', - namespace => 'Asset_Matrix' - }, { tag => 'search template', namespace => 'Asset_Matrix' @@ -420,7 +211,7 @@ our $HELP = { 'main template' => { title => 'matrix template help title', - body => 'matrix template help body', + body => '', variables => [ { 'name' => 'compare.form', @@ -575,10 +366,6 @@ our $HELP = { } ], related => [ - { - tag => 'matrix add/edit', - namespace => 'Asset_Matrix' - }, { tag => 'search template', namespace => 'Asset_Matrix' @@ -711,10 +498,6 @@ our $HELP = { } ], related => [ - { - tag => 'matrix add/edit', - namespace => 'Asset_Matrix' - }, { tag => 'search template', namespace => 'Asset_Matrix' diff --git a/lib/WebGUI/i18n/English/Asset_Matrix.pm b/lib/WebGUI/i18n/English/Asset_Matrix.pm index 77e565d47..d7f1cb3b3 100644 --- a/lib/WebGUI/i18n/English/Asset_Matrix.pm +++ b/lib/WebGUI/i18n/English/Asset_Matrix.pm @@ -114,15 +114,9 @@ our $I18N = { lastUpdated => 1149783768, }, - 'comparison template help body' => { - lastUpdated => 0, - message => q|

The following template variables are available in the comparison template.

-| - }, - 'comparison template help title' => { - lastUpdated => 0, - message => q|Matrix Comparison Template| + message => q|Matrix Comparison Template Variables|, + lastUpdated => 1184949083, }, 'discussion' => { @@ -285,15 +279,9 @@ our $I18N = { lastUpdated => 1149784175, }, - 'detail template help body' => { - lastUpdated => 1149795166, - message => q|

The following variables are available in the listing detail template.

-| - }, - 'detail template help title' => { lastUpdated => 0, - message => q|Matrix Listing Detail Template| + message => q|Matrix Listing Detail Template Variables| }, 'search.url' => { @@ -506,19 +494,14 @@ our $I18N = { lastUpdated => 1149795214, }, - 'matrix template help body' => { - lastUpdated => 1149795645, - message => q|

The following variables are available in the main Matrix template.

| - }, - 'matrix template help title' => { - lastUpdated => 0, - message => q|Matrix Main Template| + message => q|Matrix Main Template Variables|, + lastUpdated => 1184949132, }, 'ratings detail template help title' => { lastUpdated => 0, - message => q|Matrix Ratings Detail Template| + message => q|Matrix Ratings Detail Template Variables| }, 'rating_loop' => { @@ -556,12 +539,6 @@ our $I18N = { lastUpdated => 1149996259, }, - 'ratings detail template help body' => { - lastUpdated => 1149997187, - message => q|

The following variables are available in the ratings detail template.

-| - }, - 'form.header' => { message => q|The required header component of the search form.|, lastUpdated => 1149996685, @@ -597,26 +574,9 @@ our $I18N = { lastUpdated => 1149996685, }, - 'search template help body' => { - lastUpdated => 1149997201, - message => q|

The following variables are available in the matrix search template.

-| - }, - 'search template help title' => { - lastUpdated => 0, - message => q|Matrix Search Template| - }, - - 'add/edit help title' => { - lastUpdated => 0, - message => q|Matrix, Add/Edit| - }, - - 'add/edit help body' => { - lastUpdated => 1135271513, - message => q|

The Matrix allows you to set up a really powerful comparison system for any manner of item or service.

-| + message => q|Matrix Search Template Variables|, + lastUpdated => 1184949060, }, 'categories description' => { @@ -940,16 +900,6 @@ our $I18N = { message => q|Limited| }, - 'listing add/edit help title' => { - lastUpdated => 1136488382, - message => q|Matrix Listing, Add/Edit| - }, - - 'listing add/edit help body' => { - lastUpdated => 1135279558, - message => q|In this form, you may add a listing in the Matrix for a new product or edit the listing for an existing product.| - }, - 'product name description' => { lastUpdated => 1135279558, message => q|Enter the name of the product. If there are entries for the product with different revisions, it would be best to make sure the names are the same.| @@ -997,16 +947,6 @@ our $I18N = { message => q|Matrix Specific Fields| }, - 'field add/edit help title' => { - lastUpdated => 1136488382, - message => q|Matrix Field, Add/Edit| - }, - - 'field add/edit help body' => { - lastUpdated => 1135279558, - message => q|In this form, you may add a field to the Matrix. This will define a new feature or performance criterion that will be used to rate all products in the Matrix. This is very similar to adding fields to a DataForm Asset.| - }, - 'field name description' => { lastUpdated => 1135279558, message => q|The name of the field that you are creating. It is case sensitive and must be unique.|