diff --git a/docs/credits.txt b/docs/credits.txt index 68e392758..a9ccf88e3 100644 --- a/docs/credits.txt +++ b/docs/credits.txt @@ -30,6 +30,7 @@ Contributing Developers..............Peter Beardsley / Appropriate Solutions Ben Simpson Jeff Szpak / Plain Black Sean Tu / WDI + Madsen Wikholm Contributing Translators.............AGOFER Ltda. Natalia Almazova diff --git a/docs/upgrades/upgrade_5.2.5-5.3.0.pl b/docs/upgrades/upgrade_5.2.5-5.3.0.pl new file mode 100644 index 000000000..d7ea7eac0 --- /dev/null +++ b/docs/upgrades/upgrade_5.2.5-5.3.0.pl @@ -0,0 +1,35 @@ +#!/usr/bin/perl + +use lib "../../lib"; +use Getopt::Long; +use Parse::PlainConfig; +use strict; +use WebGUI::Utility; + + +my $configFile; +my $quiet; + +GetOptions( + 'configFile=s'=>\$configFile, + 'quiet'=>\$quiet +); + +print "\tUpdating config file.\n" unless ($quiet); + +my $pathToConfig = '../../etc/'.$configFile; +my $conf = Parse::PlainConfig->new('DELIM' => '=', 'FILE' => $pathToConfig); +my $macros = $conf->get("macros"); +$macros->{RootTab} = "RootTab"; +$macros->{RandomSnippet} = "RandomSnippet"; +$macros->{RandomImage} = "RandomImage"; +$macros->{CanEditText} = "CanEditText"; +$macros->{If} = "If"; +$macros->{Spacer} = "Spacer"; +$macros->{SpecificDropMenu} = "SpecificDropMenu"; +$macros->{LastModified} = "LastModified"; +$macros->{PreviousDropMenu} = "PreviousDropMenu"; +$macros->{TopDropMenu} = "TopDropMenu"; +$macros->{SI} = "SI_scaledImage"; +$conf->set("macros"=>$macros); +$conf->write; diff --git a/docs/upgrades/upgrade_5.2.5-5.3.0.sql b/docs/upgrades/upgrade_5.2.5-5.3.0.sql index 473c8c3fe..39e3dbcdb 100644 --- a/docs/upgrades/upgrade_5.2.5-5.3.0.sql +++ b/docs/upgrades/upgrade_5.2.5-5.3.0.sql @@ -1,6 +1,4 @@ insert into webguiVersion values ('5.3.0','upgrade',unix_timestamp()); -delete from international where languageId=1 and namespace='WebGUI' and internationalId=844; -insert into international (internationalId,languageId,namespace,message,lastUpdated) values (844,1,'WebGUI','These macros have to do with users and logins.\r\n
\r\n\r\n^a; or ^a(); - My Account Link\r\n\r\nNOTES: You can also use the special case ^a(linkonly); to return only the URL to the account page and nothing more. Also, the .myAccountLink style sheet class is tied to this macro.\r\n
\r\n\r\n\r\n^AdminText();
\r\nDisplays a small text message to a user who is in admin mode. Example: ^AdminText("You are in admin mode!");\r\n
\r\n\r\n^AdminToggle; or ^AdminToggle();
\r\nPlaces a link on the page which is only visible to content managers and adminstrators. The link toggles on/off admin mode. You can optionally specify other messages to display like this: ^AdminToggle("Edit On","Edit Off");\r\n
\r\n\r\n\r\n\r\n^GroupText();
\r\nDisplays a small text message to the user if they belong to the specified group. Example: ^GroupText("Visitors","You need an account to do anything cool on this site!");\r\n
\r\n\r\n^L; or ^L(); - Login Box
\r\nA small login form. You can also configure this macro. You can set the width of the login box like this ^L(20);. You can also set the message displayed after the user is logged in like this ^L(20,Hi ^a(^@;);. Click %here% if you wanna log out!)\r\n
\r\n\r\nNOTE: The .loginBox style sheet class is tied to this macro.\r\n
\r\n\r\n^LoginToggle; or ^LoginToggle();
\r\nDisplays a "Login" or "Logout" message depending upon whether the user is logged in or not. You can optionally specify other labels like this: ^LoginToggle("Click here to log in.","Click here to log out.");. You can also use the special case ^LoginToggle(linkonly); to return only the URL with no label.\r\n
\r\n\r\n^@; - Username
\r\nThe username of the currently logged in user.\r\n
\r\n\r\n\r\n^#; - User ID
\r\nThe user id of the currently logged in user.\r\n
\r\n\r\n', 1050100597);
delete from template where namespace='Article' and templateId<10;
INSERT INTO template VALUES (4,'Linked Image with Caption','
\r\n
\r\n\r\n
\r\n\r\n\r\n\r\n\r\n \" border=\"0\">\r\n
\" border=\"0\">\r\n
\r\n
\r\n \r\n \"> \r\n \">
\r\n
\r\n\r\n \" align=\"right\" border=\"0\">\r\n\r\n\r\n\r\n
\r\n
\r\n \r\n \"> \r\n \">
\r\nNOTE: These macros are included in WebGUI in order to provide very powerful display mechanisms. Though they could be used to write simple web applications, this is not their intended use, nor is it supported or condoned by Plain Black. If you find yourself trying to do something like that, just write a macro. =)\r\n\r\n
\r\n\r\n^D; or ^D(); - Date\r\n\r\nYou can configure the date by using date formatting symbols. For instance, if you created a macro like this ^D("%c %D, %y"); it would output September 26, 2001. The following are the available date formatting symbols:\r\n
\r\n\r\n
| %% | % |
| %y | 4 digit year |
| %Y | 2 digit year |
| %m | 2 digit month |
| %M | variable digit month |
| %c | month name |
| %d | 2 digit day of month |
| %D | variable digit day of month |
| %w | day of week name |
| %h | 2 digit base 12 hour |
| %H | variable digit base 12 hour |
| %j | 2 digit base 24 hour |
| %J | variable digit base 24 hour |
| %p | lower case am/pm |
| %P | upper case AM/PM |
| %z | user preference date format |
| %Z | user preference time format |
\r\n\r\n^Env()
\r\nCan be used to display a web server environment variable on a page. The environment variables available on each server are different, but you can find out which ones your web server has by going to: http://www.yourwebguisite.com/env.pl\r\n
\r\n\r\nThe macro should be specified like this ^Env("REMOTE_ADDR");\r\n
\r\n\r\n^Execute();
\r\nAllows a content manager or administrator to execute an external program. Takes the format of ^Execute("/this/file.sh");.\r\n
\r\n\r\n\r\n^FormParam();
\r\nThis macro is mainly used in generating dynamic queries in SQL Reports. Using this macro you can pull the value of any form field simply by specifing the name of the form field, like this: ^FormParam("phoneNumber");\r\n
\r\n\r\n\r\n^If();
\r\nA simple conditional statement (IF/THEN/ELSE) to control layout and messages.\r\n
\r\nExamples:
\r\nDisplay Happy New Year on 1st January:\r\n ^If(\'^D("%m%d");\' eq \'0101\' , Happy New Year);\r\n
\r\nDisplay a message to people on your subnet (192.168.1.*):
\r\n^If(\'^Env("REMOTE_ADDR");\' =~ /^192.168.1/,"Hi co-worker","Hi Stranger");\r\n
\r\nDisplay a message to Windows users:
\r\n ^If(\'^Env("HTTP_USER_AGENT");\' =~ /windows/i,"Hey... Linux is free !");\r\n
\r\nDisplay a message if a user is behind a proxy:
\r\n ^If(\'^Env("HTTP_VIA");\' ne "", You\'re behind a proxy !, Proxy-free is the best...);\r\n
\r\nDisplay Good Morning/Afternoon/Evening:
\r\n ^If(^D("%J");<=12,Good Morning,^If(^D("%J");<=18,Good Afternoon,Good evening););\r\n
\r\n\r\n^Include();
\r\nAllows a content manager or administrator to include a file from the local filesystem. \r\n
\r\n\r\n^International();
\r\nPull a translated message from the internationalization system.\r\n
\r\n\r\n\r\n^Page();
\r\nThis can be used to retrieve information about the current page. For instance it could be used to get the page URL like this ^Page("urlizedTitle"); or to get the menu title like this ^Page("menuTitle");.\r\n
\r\n\r\n^SQL();
\r\nA one line SQL report. Sometimes you just need to pull something back from the database quickly. This macro is also useful in extending the SQL Report wobject. It uses the numeric macros (^0; ^1; ^2; etc) to position data and can also use the ^rownum; macro just like the SQL Report wobject. Examples:
\r\n ^SQL("select count(*) from users","There are ^0; users on this system.");\r\n
\r\n^SQL("select userId,username from users order by username","<a href=\'^/;?op=viewProfile&uid=^0;\'>^1;</a><br>");\r\n
\r\n^URLEncode();
\r\nThis macro is mainly useful in SQL reports, but it could be useful elsewhere as well. It takes the input of a string and URL Encodes it so that the string can be passed through a URL. It\'s syntax looks like this: ^URLEncode("Is this my string?");\r\n
\r\n\r\n\r\n^User();
\r\nThis macro will allow you to display any information from a user\'s account or profile. For instance, if you wanted to display a user\'s email address you\'d create this macro: ^User("email");\r\n
\r\n\r\n^*; or ^*(); - Random Number
\r\nA randomly generated number. This is often used on images (such as banner ads) that you want to ensure do not cache. In addition, you may configure this macro like this ^*(100); to create a random number between 0 and 100.\r\n
\r\n\r\n^-;,^0;,^1;,^2;,^3;, etc.
\r\nThese macros are reserved for system/wobject-specific functions as in the SQL Report wobject and the Body in the Style Manager.\r\n
\r\n', 1051223757,NULL); +delete from international where languageId=1 and namespace='WebGUI' and internationalId=846; +insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (846,1,'WebGUI','These macros are mainly useful in maintaining styles in WebGUI.\r\n
\r\n\r\n^AdminBar;\r\n\r\n\r\n^c; - Company Name
\r\nThe name of your company specified in the settings by your Administrator.\r\n
\r\n\r\n\r\n^e; - Company Email Address
\r\nThe email address for your company specified in the settings by your Administrator.\r\n
\r\n\r\n^Extras;
\r\nReturns the path to the WebGUI "extras" folder, which contains things like WebGUI icons.\r\n
\r\n\r\n^LastModified; or ^LastModified();
\r\nDisplays the date that the current page was last modified based upon the wobjects on the page. The date is defaultly displayed based upon the user\'s date preferences. Optionally, it can take two parameters. The first is text to display before the date. The second is a date format string (see the D (date) macro for details.\r\n
\r\nExample: ^LastModified("Updated: ","%c %D, %y");\r\n
\r\n\r\n\r\n^PageTitle;
\r\nDisplays the title of the current page.\r\n
\r\n\r\nNOTE: If you begin using admin functions or the indepth functions of any wobject, the page title will become a link that will quickly bring you back to the page.\r\n
\r\n\r\n^r; or ^r(); - Make Page Printable
\r\nCreates a link to remove the style from a page to make it printable. In addition, you can change the link text by creating a macro like this ^r("Print Me!");.\r\n
\r\n\r\nBy default, when this link is clicked, the current page\'s style is replaced with the "Make Page Printable" style in the Style Manager. However, that can be overridden by specifying the name of another style as the second parameter, like this: ^r("Print!","WebGUI");\r\n
\r\n\r\nNOTES: You can also use the special case ^r(linkonly); to return only the URL to the make printable page and nothing more. Also, the .makePrintableLink style sheet class is tied to this macro.\r\n
\r\n\r\n^RootTitle;
\r\nReturns the title of the root of the current page. For instance, the main root in WebGUI is the "Home" page. Many advanced sites have many roots and thus need a way to display to the user which root they are in.\r\n
\r\n\r\n^u; - Company URL
\r\nThe URL for your company specified in the settings by your Administrator.\r\n
\r\n\r\n\r\n\r\n^?; - Search
\r\nAdd a search box to the page. The search box is tied to WebGUI\'s built-in search engine.\r\n
\r\n\r\nNOTE: The .searchBox style sheet class is tied to this macro.\r\n
\r\n\r\n^Spacer();
\r\nCreate a spacer in your layout. Great for creating blocks of color with divs and tables. It takes two parameters, width and height.\r\n
\r\nExample: ^Spacer("100","50");\r\n
\r\n\r\n^-;
\r\nThis is known as the separator macro. It must appear exactly once in every style. Wherever it appears is where the content for any given page will be put.\r\n
\r\n\r\nNOTE: The .crumbTrail style sheet class is tied to this macro.\r\n
\r\n\r\n^FlexMenu;
\r\nThis menu macro creates a top-level menu that expands as the user selects each menu item.\r\n
\r\n\r\n^H; or ^H(); - Home Link
\r\nA link to the home page of this site. In addition you can change the link text by creating a macro like this ^H("Go Home");.\r\n
\r\n\r\nNOTES: You can also use the special case ^H(linkonly); to return only the URL to the home page and nothing more. Also, the .homeLink style sheet class is tied to this macro.\r\n
\r\n\r\n^M; or ^M(); - Current Menu (Vertical)
\r\nA vertical menu containing the sub-pages at the current level. In addition, you may configure this macro by specifying how many levels deep the menu should go. By default it will show only the first level. To go three levels deep create a macro like this ^M(3);. If you set the macro to "0" it will track the entire site tree.\r\n
\r\n\r\n^m; - Current Menu (Horizontal)
\r\nA horizontal menu containing the sub-pages at the current level. You can optionally specify a delimeter to be used between page names by using ^m(:--:);. The default delimeter is ·.\r\n
\r\n\r\n^PreviousDropMenu;
\r\nCreate a drop down menu containing the sub-pages at the previous level in the page tree.\r\n
\r\nExample: ^PreviousDropMenu;\r\n
\r\n\r\n^P; or ^P(); - Previous Menu (Vertical)
\r\nA vertical menu containing the sub-pages at the previous level. In addition, you may configure this macro by specifying how many levels deep the menu should go. By default it will show only the first level. To go three levels deep create a macro like this ^P(3);. If you set the macro to "0" it will track the entire site tree.\r\n
\r\n\r\n^p; - Previous Menu (Horizontal)
\r\nA horizontal menu containing the sub-pages at the previous level. You can optionally specify a delimeter to be used between page names by using ^p(:--:);. The default delimeter is ·.\r\n
\r\n\r\n^rootmenu; or ^rootmenu(); (Horizontal)
\r\nCreates a horizontal menu of the various roots on your system (except for the WebGUI system roots). You can optionally specify a menu delimiter like this: ^rootmenu(|);\r\n
\r\n\r\n^RootTab;
\r\nCreate a tab navigation system from the roots on your site (except WebGUI\'s system roots) similar to the tabs used in the tab forms (editing wobjects or pages).\r\n
\r\nNOTE: Has two special style sheet classes: .RootTabOn{} and .RootTabOff{}.\r\n
\r\nExample:
\r\n<style>\r\n.rootTabOn {\r\n line-height: 17px;\r\n font-size: 16px;\r\n spacing: 3px;\r\n border: 1px solid black;\r\n border-bottom-width: 0px;\r\n background-color: #333333;\r\n z-index: 10000;\r\n padding: 3px 9px 5px 9px;\r\n color: white;\r\n}\r\n\r\n.rootTabOn A, .rootTabOn A:visited {\r\n color: white;\r\n font-weight: bold;\r\n text-decoration: none;\r\n}\r\n\r\n.rootTabOff {\r\n line-height: 15px;\r\n font-size: 14px;\r\n border: 1px solid black;\r\n border-bottom-width: 0px;\r\n background-color: #c8c8c8;\r\n z-index: 1000;\r\n padding: 2px 9px 2px 9px;\r\n}\r\n\r\n.rootTabOff A, .rootTabOff A:visited {\r\n color: black;\r\n text-decoration: underline;\r\n}\r\n\r\n.rootTabOff A:hover {\r\n font-weight: bold;\r\n}\r\n</style>\r\n^RootTab;\r\n
\r\n\r\n\r\n^SpecificDropMenu();
\r\nCreate a drop down menu starting at a specific point in your navigation tree. This takes two parameters. The first is the url of the page to start with and the second (optional parameter) is the depth to traverse to.\r\n
\r\nExample: ^SpecificDropMenu("home",3);\r\n
\r\n\r\n^S(); - Specific SubMenu (Vertical)
\r\nThis macro allows you to get the submenu of any page, starting with the page you specified. For instance, you could get the home page submenu by creating a macro that looks like this ^S("home",0);. The first value is the urlized title of the page and the second value is the depth you\'d like the menu to go. By default it will show only the first level. To go three levels deep create a macro like this ^S("home",3);.\r\n
\r\n\r\n\r\n^s(); - Specific SubMenu (Horizontal)
\r\nThis macro allows you to get the submenu of any page, starting with the page you specified. For instance, you could get the home page submenu by creating a macro that looks like this ^s("home");. The value is the urlized title of the page. You can optionally specify a delimeter to be used between page names by using ^s("home",":--:");. The default delimeter is ·.\r\n
\r\n\r\n^Synopsis; or ^Synopsis(); Menu
\r\nThis macro allows you to get the submenu of a page along with the synopsis of each link. You may specify an integer to specify how many levels deep to traverse the page tree.\r\n
\r\n\r\nNOTES: The .synopsis_sub, .synopsis_summary, and .synopsis_title style sheet classes are tied to this macro.\r\n
\r\n\r\n^TopDropMenu;
\r\nCreate a drop down menu of your top level navigation.\r\n
\r\nExample: ^TopDropMenu;\r\n
\r\n\r\n^T; or ^T(); - Top Level Menu (Vertical)
\r\nA vertical menu containing the main pages of the site (aka the sub-pages from the home page). In addition, you may configure this macro by specifying how many levels deep the menu should go. By default it will show only the first level. To go three levels deep create a macro like this ^T(3);. If you set the macro to "0" it will track the entire site tree.\r\n
\r\n\r\n^t; - Top Level Menu (Horizontal)
\r\nA vertical menu containing the main pages of the site (aka the sub-pages from the home page). You can optionally specify a delimeter to be used between page names by using ^t(:--:);. The default delimeter is ·.\r\n
\r\n\r\n^/; - System URL
\r\nThe URL to the gateway script (example: /index.pl/).\r\n
\r\n\r\n^\\; - Page URL
\r\nThe URL to the current page (example: /index.pl/pagename).\r\n
\r\n\r\n', 1051222723,NULL); +delete from international where languageId=1 and namespace='WebGUI' and internationalId=844; +insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (844,1,'WebGUI','These macros have to do with users and logins.\r\n
\r\n\r\n^a; or ^a(); - My Account Link\r\n\r\nNOTES: You can also use the special case ^a(linkonly); to return only the URL to the account page and nothing more. Also, the .myAccountLink style sheet class is tied to this macro.\r\n
\r\n\r\n\r\n^AdminText();
\r\nDisplays a small text message to a user who is in admin mode. Example: ^AdminText("You are in admin mode!");\r\n
\r\n\r\n^AdminToggle; or ^AdminToggle();
\r\nPlaces a link on the page which is only visible to content managers and adminstrators. The link toggles on/off admin mode. You can optionally specify other messages to display like this: ^AdminToggle("Edit On","Edit Off");\r\n
\r\n\r\n^CanEditText();
\r\nDisplay a message to a user that can edit the current page.\r\n
\r\nExample: ^CanEditText(^AdminToggle;);\r\n
\r\n\r\n\r\n^GroupText();
\r\nDisplays a small text message to the user if they belong to the specified group. And you can specify an alternate message to those who are not in the group.\r\n
\r\nExample: ^GroupText("Visitors","You need an account to do anything cool on this site!","We value our registered users!");\r\n
\r\n\r\n^L; or ^L(); - Login Box
\r\nA small login form. You can also configure this macro. You can set the width of the login box like this ^L(20);. You can also set the message displayed after the user is logged in like this ^L(20,Hi ^a(^@;);. Click %here% if you wanna log out!)\r\n
\r\n\r\nNOTE: The .loginBox style sheet class is tied to this macro.\r\n
\r\n\r\n^LoginToggle; or ^LoginToggle();
\r\nDisplays a "Login" or "Logout" message depending upon whether the user is logged in or not. You can optionally specify other labels like this: ^LoginToggle("Click here to log in.","Click here to log out.");. You can also use the special case ^LoginToggle(linkonly); to return only the URL with no label.\r\n
\r\n\r\n^@; - Username
\r\nThe username of the currently logged in user.\r\n
\r\n\r\n\r\n^#; - User ID
\r\nThe user id of the currently logged in user.\r\n
\r\n\r\n', 1051222028,NULL); +delete from international where languageId=1 and namespace='WebGUI' and internationalId=832; +insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (832,1,'WebGUI','The collateral management system has several macros for its specific purpose.\r\n
\r\n\r\n^File();\r\nIt takes four parameters. The first is the image name or optionally the collateral id. The second is the width. Set the width to "0" to maintain aspect ratio by height. The third is height. Set the height to "0" to maintain aspect ratio by width. The fourth parameter allows you to specify additional parameters to the image.\r\n
\r\nExamples:\r\nRetrieving an image by collateralId (no scaling)
\r\n^SI(66);\r\n
\r\nScaling by width, maintaining aspect ratio
\r\n^SI(66,25);\r\n
\r\nScaling by height, maintaining aspect ratio
\r\n^SI(66,0,25);\r\n
\r\nPlaying with the aspect ratio
\r\n^SI(66,148,25);\r\n
\r\nUsing parameters
\r\n^SI(66,0,0,\'border="0"\');\r\n
If Macro failed: $@
Expression: $expression
+
Display if true: $true
Display if false: $false" if ($@);
+
+ $output = $true if ($return);
+
+ return $output;
+}
+
+1;
+
diff --git a/lib/WebGUI/Macro/LastModified.pm b/lib/WebGUI/Macro/LastModified.pm
new file mode 100644
index 000000000..7472edc6c
--- /dev/null
+++ b/lib/WebGUI/Macro/LastModified.pm
@@ -0,0 +1,37 @@
+package WebGUI::Macro::LastModified;
+
+#-------------------------------------------------------------------
+# WebGUI is Copyright 2001-2003 Plain Black LLC.
+#-------------------------------------------------------------------
+# 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::DateTime;
+use WebGUI::Macro;
+use WebGUI::Session;
+use WebGUI::SQL;
+
+#-------------------------------------------------------------------
+sub process {
+ my ($label, $format, $time, $output);
+
+ ($label, $format) = WebGUI::Macro::getParams(shift);
+ $format = '%z' if ($format eq "");
+ $output = "";
+
+ ($time) = WebGUI::SQL->quickArray("SELECT max(lastEdited) FROM wobject where pageId=$session{page}{pageId}");
+ if ($time) {
+ $output = $label.epochToHuman($time,$format);
+ }
+
+ return $output;
+}
+
+1;
+
+
diff --git a/lib/WebGUI/Macro/PreviousDropMenu.pm b/lib/WebGUI/Macro/PreviousDropMenu.pm
new file mode 100644
index 000000000..1503a4747
--- /dev/null
+++ b/lib/WebGUI/Macro/PreviousDropMenu.pm
@@ -0,0 +1,64 @@
+package WebGUI::Macro::PreviousDropMenu;
+
+#-------------------------------------------------------------------
+# WebGUI is Copyright 2001-2003 Plain Black LLC.
+#-------------------------------------------------------------------
+# 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::Macro;
+use WebGUI::Navigation;
+use WebGUI::Session;
+use WebGUI::SQL;
+
+#-------------------------------------------------------------------
+sub _draw {
+ my ($output, $i, $padding, $pageId);
+ my ($tree, $indent, $maxDepth, $currentDepth) = @_;
+ unless ($currentDepth >= $maxDepth) {
+ for ($i=1;$i<=$indent;$i++) {
+ $padding .= " ";
+ }
+ foreach $pageId (keys %{$tree}) {
+ $output .= '';
+ $output .= _draw($tree->{$pageId}{sub}, ($indent+1), $maxDepth, ($currentDepth+1));
+ }
+ }
+ return $output;
+}
+
+#-------------------------------------------------------------------
+sub process {
+ my ($temp, @param, $tree);
+ @param = WebGUI::Macro::getParams($_[0]);
+ $param[2] = 99 unless ($param[2]);
+ if ($param[0] ne "") {
+ $tree = WebGUI::Navigation::tree($session{page}{parentId},$param[0]);
+ } else {
+ $tree = WebGUI::Navigation::tree($session{page}{parentId},1);
+ }
+ $temp = '';
+ $temp .= '
';
+ return $output;
+}
+
+1;
+
diff --git a/lib/WebGUI/Macro/SpecificDropMenu.pm b/lib/WebGUI/Macro/SpecificDropMenu.pm
new file mode 100644
index 000000000..da5f5cfe8
--- /dev/null
+++ b/lib/WebGUI/Macro/SpecificDropMenu.pm
@@ -0,0 +1,69 @@
+package WebGUI::Macro::SpecificDropMenu;
+
+#-------------------------------------------------------------------
+# WebGUI is Copyright 2001-2003 Plain Black LLC.
+#-------------------------------------------------------------------
+# 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::Macro;
+use WebGUI::Navigation;
+use WebGUI::Session;
+use WebGUI::SQL;
+
+#-------------------------------------------------------------------
+sub _draw {
+ my ($output, $i, $padding, $pageId);
+ my ($tree, $indent, $maxDepth, $currentDepth) = @_;
+ unless ($currentDepth >= $maxDepth) {
+ for ($i=1;$i<=$indent;$i++) {
+ $padding .= " ";
+ }
+ foreach $pageId (keys %{$tree}) {
+ $output .= '';
+ $output .= _draw($tree->{$pageId}{sub}, ($indent+1), $maxDepth, ($currentDepth+1));
+ }
+ }
+ return $output;
+}
+
+#-------------------------------------------------------------------
+sub process {
+ my ($temp, @param, $pageId, $tree);
+ @param = WebGUI::Macro::getParams($_[0]);
+ ($pageId) = WebGUI::SQL->quickArray("select pageId from page where urlizedTitle='$param[0]'");
+ if (defined $pageId) {
+ $param[2] = 99 unless ($param[2]);
+ if ($param[1] ne "") {
+ $tree = WebGUI::Navigation::tree($pageId,$param[1]);
+ } else {
+ $tree = WebGUI::Navigation::tree($pageId,1);
+ }
+ $temp = '';
+ $temp .= '';
+ } else {
+ $temp = "No page specified.";
+ }
+ return $temp;
+}
+
+
+1;
+
+
diff --git a/lib/WebGUI/Macro/TopDropMenu.pm b/lib/WebGUI/Macro/TopDropMenu.pm
new file mode 100644
index 000000000..44c45b104
--- /dev/null
+++ b/lib/WebGUI/Macro/TopDropMenu.pm
@@ -0,0 +1,40 @@
+package WebGUI::Macro::TopDropMenu;
+
+#-------------------------------------------------------------------
+# WebGUI is Copyright 2001-2003 Plain Black LLC.
+#-------------------------------------------------------------------
+# 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::Navigation;
+use WebGUI::Session;
+
+#-------------------------------------------------------------------
+sub process {
+ my ($temp, $tree, $pageId);
+ $tree = WebGUI::Navigation::tree(1,1);
+ $temp = '';
+ $temp .= '';
+ return $temp;
+}
+
+
+1;
+
+
diff --git a/www/extras/htmlArea/popups/macros.html b/www/extras/htmlArea/popups/macros.html
index 8792b7477..22b4674b0 100644
--- a/www/extras/htmlArea/popups/macros.html
+++ b/www/extras/htmlArea/popups/macros.html
@@ -20,10 +20,13 @@ function returnSelected(in_values) {
@@ -37,11 +40,15 @@ function returnSelected(in_values) {
+
+
+
+
@@ -58,6 +65,7 @@ function returnSelected(in_values) {
+
@@ -79,8 +87,10 @@ function returnSelected(in_values) {
+
+
@@ -88,9 +98,11 @@ function returnSelected(in_values) {