diff --git a/docs/create.sql b/docs/create.sql index 446280861..402da12df 100644 --- a/docs/create.sql +++ b/docs/create.sql @@ -6220,7 +6220,7 @@ CREATE TABLE webguiVersion ( -- -INSERT INTO webguiVersion VALUES ('4.5.0','initial install',unix_timestamp()); +INSERT INTO webguiVersion VALUES ('4.6.0','initial install',unix_timestamp()); -- -- Table structure for table 'wobject' @@ -6258,3 +6258,15 @@ CREATE TABLE wobject ( INSERT INTO wobject VALUES (-1,4,'SiteMap',0,'Page Not Found',1,'The page you were looking for could not be found on this system. Perhaps it has been deleted or renamed. The following list is a site map of this site. If you don\'t find what you\'re looking for on the site map, you can always start from the Home Page.',1,1001744792,3,1016077239,3,0,1001744792,1336444487,2,3600,4,0,'after'); INSERT INTO wobject VALUES (-2,1,'Article',1,'Welcome to WebGUI!',1,'
\r\n

If you’re reading this message it means that you’ve got WebGUI up and running. Good job! The installation is not trivial.

\r\n

 

\r\n

In order to do anything useful with your new installation you’ll need to log in as the default administrator account. Follow these steps to get started:

\r\n

 

\r\n
    \r\n
  1. Click here to log in. (username: Admin password: 123qwe) \r\n
  2. Click here to turn the administrative interface on.
\r\n

 Now that you’re in as the administrator, you should change your password so no one else can log in and mess with your site. You might also want to create another account for yourself with Administrative privileges in case you can\'t log in with the Admin account for some reason.

\r\n

 

\r\n

You’ll notice three menus at the top of your screen. Those are your administrative menus. Going from left to right they are Content, Clipboard, and Admin. The content menu allows you to add new pages and content to your site. The clipboard menu is currently empty, but if you cut or copy anything from any of your pages, it will end up there. The admin menu controls things like system settings and users.

\r\n

 

\r\n

For more information about how to administer WebGUI consider getting a copy of Ruling WebGUI. Plain Black Software also provides several Support Programs for WebGUI if you run into trouble.

\r\n

 

Enjoy your new WebGUI site!\r\n
',1,1023555430,3,1023555630,3,0,1023512400,1338872400,2,3600,4,0,'after'); +insert into international values (716,'WebGUI',1,'Login'); +insert into international values (717,'WebGUI',1,'Logout'); +delete from international where internationalId=624 and namespace='WebGUI' and languageId=1; +insert into international (internationalId,namespace,languageId,message) values (624, 'WebGUI',1,'WebGUI macros are used to create dynamic content within otherwise static content. For instance, you may wish to show which user is logged in on every page, or you may wish to have a dynamically built menu or crumb trail. \r\n

\r\n\r\nMacros always begin with a carat (^) and follow with at least one other character and ended with w semicolon (;). Some macros can be extended/configured by taking the format of ^x("config text");. The following is a description of all the macros in the WebGUI system.\r\n

\r\n\r\n^a; or ^a(); - My Account Link
\r\nA link to your account information. In addition you can change the link text by creating a macro like this ^a("Account Info");. \r\n

\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^AdminBar;
\r\nPlaces the administrative tool bar on the page. This is a required element in the "body" segment of the Style Manager.\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^C; or ^C(); - Crumb Trail
\r\nA dynamically generated crumb trail to the current page. You can optionally specify a delimeter to be used between page names by using ^C(::);. The default delimeter is >.\r\n

\r\n\r\nNote: The .crumbTrail style sheet class is tied to this macro.\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^D; or ^D(); - Date
\r\nThe current date and time.\r\n

\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
%%%
%y4 digit year
%Y2 digit year
%m2 digit month
%Mvariable digit month
%cmonth name
%d2 digit day of month
%Dvariable digit day of month
%wday of week name
%h2 digit base 12 hour
%Hvariable digit base 12 hour
%j2 digit base 24 hour
%Jvariable digit base 24 hour
%plower case am/pm
%Pupper case AM/PM
%zuser preference date format
%Zuser preference time format
\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^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^Extras;
\r\nReturns the path to the WebGUI "extras" folder, which contains things like WebGUI icons.\r\n

\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^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^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\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^I(); - Image Manager Image with Tag
\r\nThis macro returns an image tag with the parameters for an image defined in the image manager. Specify the name of the image using a tag like this ^I("imageName");.\r\n

\r\n\r\n^i(); - Image Manager Image Path
\r\nThis macro returns the path of an image uploaded using the Image Manager. Specify the name of the image using a tag like this ^i("imageName");.\r\n

\r\n\r\n^Include();
\r\nAllows a content manager or administrator to include a file from the local filesystem. Takes the format of ^Include("/this/file.html");\r\n

\r\n\r\n^L; or ^L(); - Login
\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 messages like this: ^LoginToggle("Click here to log in.","Click here to log out.");\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^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^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^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^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\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^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^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\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^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^Thumbnail();
\r\nReturns the URL of a thumbnail for an image from the image manager. Specify the name of the image like this ^Thumbnail("imageName");.\r\n

\r\n\r\n^ThumbnailLinker();
\r\nThis is a good way to create a quick and dirty screenshots page or a simple photo gallery. Simply specify the name of an image in the Image Manager like this: ^ThumbnailLinker("My Grandmother"); and this macro will create a thumnail image with a title under it that links to the full size version of the image.\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^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^/; - 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^@; - Username
\r\nThe username of the currently logged in user.\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^#; - User ID
\r\nThe user id of the currently logged in user.\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'); + + + + + + + + diff --git a/docs/upgrades/upgrade_4.5.0-4.6.0.sql b/docs/upgrades/upgrade_4.5.0-4.6.0.sql index d3e2e0a1c..0f4784b97 100644 --- a/docs/upgrades/upgrade_4.5.0-4.6.0.sql +++ b/docs/upgrades/upgrade_4.5.0-4.6.0.sql @@ -1,6 +1,8 @@ insert into webguiVersion values ('4.6.0','upgrade',unix_timestamp()); insert into international values (716,'WebGUI',1,'Login'); insert into international values (717,'WebGUI',1,'Logout'); +delete from international where internationalId=624 and namespace='WebGUI' and languageId=1; +insert into international (internationalId,namespace,languageId,message) values (624, 'WebGUI',1,'WebGUI macros are used to create dynamic content within otherwise static content. For instance, you may wish to show which user is logged in on every page, or you may wish to have a dynamically built menu or crumb trail. \r\n

\r\n\r\nMacros always begin with a carat (^) and follow with at least one other character and ended with w semicolon (;). Some macros can be extended/configured by taking the format of ^x("config text");. The following is a description of all the macros in the WebGUI system.\r\n

\r\n\r\n^a; or ^a(); - My Account Link
\r\nA link to your account information. In addition you can change the link text by creating a macro like this ^a("Account Info");. \r\n

\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^AdminBar;
\r\nPlaces the administrative tool bar on the page. This is a required element in the "body" segment of the Style Manager.\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^C; or ^C(); - Crumb Trail
\r\nA dynamically generated crumb trail to the current page. You can optionally specify a delimeter to be used between page names by using ^C(::);. The default delimeter is >.\r\n

\r\n\r\nNote: The .crumbTrail style sheet class is tied to this macro.\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^D; or ^D(); - Date
\r\nThe current date and time.\r\n

\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
%%%
%y4 digit year
%Y2 digit year
%m2 digit month
%Mvariable digit month
%cmonth name
%d2 digit day of month
%Dvariable digit day of month
%wday of week name
%h2 digit base 12 hour
%Hvariable digit base 12 hour
%j2 digit base 24 hour
%Jvariable digit base 24 hour
%plower case am/pm
%Pupper case AM/PM
%zuser preference date format
%Zuser preference time format
\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^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^Extras;
\r\nReturns the path to the WebGUI "extras" folder, which contains things like WebGUI icons.\r\n

\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^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^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\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^I(); - Image Manager Image with Tag
\r\nThis macro returns an image tag with the parameters for an image defined in the image manager. Specify the name of the image using a tag like this ^I("imageName");.\r\n

\r\n\r\n^i(); - Image Manager Image Path
\r\nThis macro returns the path of an image uploaded using the Image Manager. Specify the name of the image using a tag like this ^i("imageName");.\r\n

\r\n\r\n^Include();
\r\nAllows a content manager or administrator to include a file from the local filesystem. Takes the format of ^Include("/this/file.html");\r\n

\r\n\r\n^L; or ^L(); - Login
\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 messages like this: ^LoginToggle("Click here to log in.","Click here to log out.");\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^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^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^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^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\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^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^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\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^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^Thumbnail();
\r\nReturns the URL of a thumbnail for an image from the image manager. Specify the name of the image like this ^Thumbnail("imageName");.\r\n

\r\n\r\n^ThumbnailLinker();
\r\nThis is a good way to create a quick and dirty screenshots page or a simple photo gallery. Simply specify the name of an image in the Image Manager like this: ^ThumbnailLinker("My Grandmother"); and this macro will create a thumnail image with a title under it that links to the full size version of the image.\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^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^/; - 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^@; - Username
\r\nThe username of the currently logged in user.\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^#; - User ID
\r\nThe user id of the currently logged in user.\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'); diff --git a/lib/WebGUI.pm b/lib/WebGUI.pm index 2a28049b3..43988481b 100644 --- a/lib/WebGUI.pm +++ b/lib/WebGUI.pm @@ -27,7 +27,7 @@ use WebGUI::Utility; #------------------------------------------------------------------- sub page { my ($debug, %contentHash, $w, $cmd, $pageEdit, $wobject, $wobjectOutput, $extra, $originalWobject, $proxyWobjectId, - $sth, $httpHeader, $header, $footer, $content, $operationOutput, $adminBar, %hash); + $sth, $httpHeader, $header, $footer, $content, $operationOutput, $adminBar, %hash, $canEdit); WebGUI::Session::open($_[0],$_[1]); if (exists $session{form}{op}) { $cmd = "WebGUI::Operation::www_".$session{form}{op}; @@ -91,18 +91,21 @@ sub page { } else { if (WebGUI::Privilege::canViewPage()) { if ($session{var}{adminOn}) { - $pageEdit = "\n
" - .pageIcon() - .deleteIcon('op=deletePage') - .editIcon('op=editPage') - .moveUpIcon('op=movePageUp') - .moveDownIcon('op=movePageDown') - .cutIcon('op=cutPage') - ."\n"; + $canEdit = WebGUI::Privilege::canEditPage(); + if ($canEdit) { + $pageEdit = "\n
" + .pageIcon() + .deleteIcon('op=deletePage') + .editIcon('op=editPage') + .moveUpIcon('op=movePageUp') + .moveDownIcon('op=movePageDown') + .cutIcon('op=cutPage') + ."\n"; + } } $sth = WebGUI::SQL->read("select * from wobject where pageId=$session{page}{pageId} order by sequenceNumber, wobjectId"); while ($wobject = $sth->hashRef) { - if ($session{var}{adminOn}) { + if ($session{var}{adminOn} && $canEdit) { $contentHash{${$wobject}{templatePosition}} .= "\n


" .deleteIcon('func=delete&wid='.${$wobject}{wobjectId}) .editIcon('func=edit&wid='.${$wobject}{wobjectId})