diff --git a/lib/WebGUI/Macro/PageTitle.pm b/lib/WebGUI/Macro/PageTitle.pm index a2a39a0e6..9de7e7175 100644 --- a/lib/WebGUI/Macro/PageTitle.pm +++ b/lib/WebGUI/Macro/PageTitle.pm @@ -24,7 +24,7 @@ Macro for returning the title of the current Asset. =head2 process ( ) Returns the title of the current Asset. If a WebGUI operation or function -is active, then the title is returned as a link to the Asset. If there's +is active, then the title is returned as a link to the Asset. If there is no asset cached in the session variable, nothing is returned. =cut diff --git a/lib/WebGUI/Macro/RawHeadTags.pm b/lib/WebGUI/Macro/RawHeadTags.pm index 2e426b13b..3e425a97d 100644 --- a/lib/WebGUI/Macro/RawHeadTags.pm +++ b/lib/WebGUI/Macro/RawHeadTags.pm @@ -14,6 +14,24 @@ use strict; use WebGUI::Session; use WebGUI::Style; +=head1 NAME + +Package WebGUI::Macro::RawHeadTags + +=head1 DESCRIPTION + +Macro for adding + +=head2 process ( tags ) + +process is a wrapper for WebGUI::Style::setRawHeadTags(); + +=head3 text + +Text that will be added to the HEAD tags for this page. + +=cut + #------------------------------------------------------------------- sub process { WebGUI::Style::setRawHeadTags(shift); diff --git a/lib/WebGUI/Macro/RootTitle.pm b/lib/WebGUI/Macro/RootTitle.pm index a16b9dacb..de9c68928 100644 --- a/lib/WebGUI/Macro/RootTitle.pm +++ b/lib/WebGUI/Macro/RootTitle.pm @@ -14,6 +14,22 @@ use strict; use WebGUI::Asset; use WebGUI::Session; +=head1 NAME + +Package WebGUI::Macro::RootTitle + +=head1 DESCRIPTION + +Macro for returning the title of the root for this page. + +=head2 process ( ) + +If an asset exists in the session variable cache and and it's +topmost parent (root) can be found the title for that asset +is returned. Otherwise a space is returned. + +=cut + #------------------------------------------------------------------- sub process { if (exists $session{asset}) { diff --git a/lib/WebGUI/Macro/SQL.pm b/lib/WebGUI/Macro/SQL.pm index f56cdd261..ea1147466 100644 --- a/lib/WebGUI/Macro/SQL.pm +++ b/lib/WebGUI/Macro/SQL.pm @@ -14,6 +14,30 @@ use strict; use WebGUI::Session; use WebGUI::SQL; +=head1 NAME + +Package WebGUI::Macro::SQL + +=head1 DESCRIPTION + +Macro for executing SQL select-type statements and returning formatted output. + +=head2 process ( SQL, format ) + +=head3 SQL + +The SQL statement to execute. If the statement is not something that +returns data (select, show, describe), an error message is returned. If +there is an error executing the SQL, an error message will be returned. + +=head3 format + +Describes how to format the results of the SQL statement. For each +term in in a select-type statement, a numeric macro (^0, ^1, etc.)can +be used to position its output in the format. + +=cut + #------------------------------------------------------------------- sub process { my ($output, @data, $rownum, $temp); @@ -22,7 +46,7 @@ sub process { if ($statement =~ /^\s*select/i || $statement =~ /^\s*show/i || $statement =~ /^\s*describe/i) { my $sth = WebGUI::SQL->unconditionalRead($statement,WebGUI::SQL->getSlave); unless ($sth->errorCode < 1) { - return '
SQL Macro Failed: '.$sth->errorMessage.'
'; + return sprintf WebGUI::International::get('sql error','Macro_SQL'), $sth->errorMessage; } else { while (@data = $sth->array) { $temp = $format; @@ -35,7 +59,7 @@ sub process { return $output; } } else { - return "Cannot execute this type of query."; + return WebGUI::International::get('illegal query','Macro_SQL'); } } diff --git a/lib/WebGUI/Macro/Slash_gatewayUrl.pm b/lib/WebGUI/Macro/Slash_gatewayUrl.pm index 92639353a..acd66d40f 100644 --- a/lib/WebGUI/Macro/Slash_gatewayUrl.pm +++ b/lib/WebGUI/Macro/Slash_gatewayUrl.pm @@ -14,6 +14,20 @@ use strict; use WebGUI::Session; use WebGUI::URL; +=head1 NAME + +Package WebGUI::Macro::Slash_gatewayUrl + +=head1 DESCRIPTION + +Macro for returning the gateway URL (defined in the WebGUI config file) to the site. + +=head2 process ( ) + +process is really a wrapper around WebGUI::URL::gateway(); + +=cut + #------------------------------------------------------------------- sub process { return WebGUI::URL::gateway(); diff --git a/lib/WebGUI/i18n/English/Macro_SQL.pm b/lib/WebGUI/i18n/English/Macro_SQL.pm index 4ba951459..8ebec35d7 100644 --- a/lib/WebGUI/i18n/English/Macro_SQL.pm +++ b/lib/WebGUI/i18n/English/Macro_SQL.pm @@ -24,6 +24,17 @@ A one line SQL report. Sometimes you just need to pull something back from the d |, lastUpdated => 1112466919, }, + + 'illegal query' => { + message => q|Cannot execute this type of query.|, + lastUpdated => 1135105884, + }, + + 'sql error' => { + message => q|
SQL Macro Failed:%s
|, + lastUpdated => 1135105919, + }, + }; 1;