diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 149925b2e..21af8dc7e 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -1,3 +1,6 @@ +6.8.2 + - Added macro to return the MIME type to a file, FetchMimeType. + 6.8.1 - fix [ 1364965 ] Assets in Trash give Permission Denied in stead of Not Found diff --git a/etc/WebGUI.conf.original b/etc/WebGUI.conf.original index d20d2560e..1e1bbb64d 100644 --- a/etc/WebGUI.conf.original +++ b/etc/WebGUI.conf.original @@ -211,6 +211,7 @@ macros=# => Hash_userId, \ D => D_date, \ EditableToggle => EditableToggle, \ Extras => Extras, \ + FetchMimeType => FetchMimeType, \ FileUrl => FileUrl, \ GroupAdd => GroupAdd, \ GroupDelete => GroupDelete, \ diff --git a/lib/WebGUI/Help/Asset_InOutBoard.pm b/lib/WebGUI/Help/Asset_InOutBoard.pm index e8c700cc8..899587210 100644 --- a/lib/WebGUI/Help/Asset_InOutBoard.pm +++ b/lib/WebGUI/Help/Asset_InOutBoard.pm @@ -1,7 +1,7 @@ package WebGUI::Help::Asset_InOutBoard; our $HELP = { - '1' => { + 'in out board add/edit' => { title => '18', body => '19', related => [ @@ -24,7 +24,7 @@ our $HELP = { body => '21', related => [ { - tag => '1', + tag => 'in out board add/edit', namespace => 'Asset_InOutBoard' }, { @@ -42,7 +42,7 @@ our $HELP = { body => '23', related => [ { - tag => '1', + tag => 'in out board add/edit', namespace => 'Asset_InOutBoard' }, { diff --git a/lib/WebGUI/Help/Asset_StockData.pm b/lib/WebGUI/Help/Asset_StockData.pm index 3bf51ec50..8d0ca496a 100644 --- a/lib/WebGUI/Help/Asset_StockData.pm +++ b/lib/WebGUI/Help/Asset_StockData.pm @@ -1,4 +1,4 @@ -package WebGUI::Help::StockData; +package WebGUI::Help::Asset_StockData; our $HELP = { 'stock data add/edit' => { @@ -8,41 +8,41 @@ our $HELP = { { title => 'template_label', description => 'template_label_description', - namespace => 'StockList', + namespace => 'Asset_StockData', }, { title => 'display_template_label', description => 'display_template_label_description', - namespace => 'StockList', + namespace => 'Asset_StockData', }, { title => 'default_stock_label', description => 'default_stock_label_description', - namespace => 'StockList', + namespace => 'Asset_StockData', }, { title => 'stock_source', description => 'stock_source_description', - namespace => 'StockList', + namespace => 'Asset_StockData', }, { title => 'failover_label', description => 'failover_label_description', - namespace => 'StockList', + namespace => 'Asset_StockData', }, ], related => [ { tag => 'stock list user edit', - namespace => 'StockList' + namespace => 'Asset_StockData' }, { tag => 'stock list template', - namespace => 'StockList' + namespace => 'Asset_StockData' }, { tag => 'stock list display template', - namespace => 'StockList' + namespace => 'Asset_StockData' }, { tag => 'wobjects using', @@ -61,13 +61,13 @@ our $HELP = { { title => 'symbol_label', description => 'symbol_label_description', - namespace => 'StockList', + namespace => 'Asset_StockData', }, ], related => [ { tag => 'stock list display template', - namespace => 'StockList' + namespace => 'Asset_StockData' }, ] }, @@ -79,7 +79,7 @@ our $HELP = { related => [ { tag => 'stock list display template', - namespace => 'StockList' + namespace => 'Asset_StockData' }, { tag => 'pagination template variables', @@ -99,7 +99,7 @@ our $HELP = { related => [ { tag => 'stock list template', - namespace => 'StockList' + namespace => 'Asset_StockData' }, { tag => 'pagination template variables', diff --git a/lib/WebGUI/Help/Macro_FetchMimeType.pm b/lib/WebGUI/Help/Macro_FetchMimeType.pm new file mode 100644 index 000000000..2de0d0aeb --- /dev/null +++ b/lib/WebGUI/Help/Macro_FetchMimeType.pm @@ -0,0 +1,20 @@ +package WebGUI::Help::Macro_FetchMimeType; + +our $HELP = { + + 'fetch mime type' => { + title => 'fetch mime type title', + body => 'fetch mime type body', + fields => [ + ], + related => [ + { + tag => 'macros using', + namespace => 'Macros' + }, + ] + }, + +}; + +1; diff --git a/lib/WebGUI/Macro/FetchMimeType.pm b/lib/WebGUI/Macro/FetchMimeType.pm new file mode 100644 index 000000000..590b0c7ec --- /dev/null +++ b/lib/WebGUI/Macro/FetchMimeType.pm @@ -0,0 +1,25 @@ +package WebGUI::Macro::FetchMimeType; # edit this line to match your own macro name + +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2005 Plain Black Corporation. +#------------------------------------------------------------------- +# Please read the legal notices (docs/legal.txt) and the license +# (docs/license.txt) that came with this distribution before using +# this software. +#------------------------------------------------------------------- +# http://www.plainblack.com info@plainblack.com +#------------------------------------------------------------------- + +use strict; +use WebGUI::Session; +use LWP::MediaTypes qw(guess_media_type); + +#------------------------------------------------------------------- +sub process { + my $path = shift; + return guess_media_type($path); +} + +1; + + diff --git a/lib/WebGUI/i18n/English/Macro_FetchMimeType.pm b/lib/WebGUI/i18n/English/Macro_FetchMimeType.pm new file mode 100644 index 000000000..066148297 --- /dev/null +++ b/lib/WebGUI/i18n/English/Macro_FetchMimeType.pm @@ -0,0 +1,23 @@ +package WebGUI::i18n::English::Macro_FetchMimeType; + +our $I18N = { + + 'fetch mime type title' => { + message => q|Fetch MIME Type Macro|, + lastUpdated => 1134252488, + }, + + 'fetch mime type body' => { + message => q| + +^FetchMimeType;
+^FetchMimeType(file system path to file);
+Returns the MIME type for a file. An absolute or relative file path +to the file is required. A URL to the file will not work. +|, + lastUpdated => 1134252720, + }, + +}; + +1;