Added an option to open menu links in a new window.
This commit is contained in:
parent
e531f31665
commit
690864df45
5 changed files with 47 additions and 19 deletions
|
|
@ -266,6 +266,12 @@ delete from international where languageId=1 and namespace='WebGUI' and internat
|
|||
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (933,1,'WebGUI','Theme, Edit', 1050430737);
|
||||
delete from international where languageId=1 and namespace='WebGUI' and internationalId=934;
|
||||
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (934,1,'WebGUI','Creating and editing themes is a fairly simple process. First you set up some basic properties for the theme, and then you start adding components to the theme. \r\n<p>\r\nThe basic properties of a theme cannot be changed by anyone except the site that the theme was created on. The following are the definitions of the basic properties of a theme:\r\n<p>\r\n<b>Theme ID</b><br>\r\nThe unique ID for this theme within this WebGUI site. This ID will change if this theme is imported into another site.\r\n<p>\r\n\r\n<b>Theme Name</b><br>\r\nThis is the unique name of the theme. It must be unique in every site that the theme will be imported into. This name will not change across sites.\r\n<p>\r\n\r\n<b>Theme Designer</b><br>\r\nThe name of the person or company that created this theme. \r\n<p>\r\n\r\n<b>Designer URL</b><br>\r\nThe URL of the web site for this theme\'s designer. If you are in the business of creating themes for WebGUI, then this is your place to attract attention to your offerings.\r\n<p>\r\n\r\n', 1050430737);
|
||||
alter table page add column newWindow int not null default 0;
|
||||
delete from international where languageId=1 and namespace='WebGUI' and internationalId=606;
|
||||
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (606,1,'WebGUI','Think of pages as containers for content. For instance, if you want to write a letter to the editor of your favorite magazine you\'d get out a notepad (or open a word processor) and start filling it with your thoughts. The same is true with WebGUI. Create a page, then add your content to the page.\r\n<p>\r\n\r\n<b>Title</b><br>\r\nThe title of the page is what your users will use to navigate through the site. Titles should be descriptive, but not very long.\r\n<p>\r\n\r\n\r\n<b>Menu Title</b><br>\r\nA shorter or altered title to appear in navigation. If left blank this will default to <i>Title</i>.\r\n<p>\r\n\r\n<b>Page URL</b><br>\r\nWhen you create a page a URL for the page is generated based on the page title. If you are unhappy with the URL that was chosen, you can change it here.\r\n<p>\r\n\r\n<b>Redirect URL</b><br>\r\nWhen this page is visited, the user will be redirected to the URL specified here. \r\n<p>\r\n\r\n\r\n<b>Hide from navigation?</b><br>\r\nSelect yes to hide this page from the navigation.\r\n<p>\r\n<B>NOTE:</b> This will not hide the page from the page tree (Administrative functions... > Manage page tree.), only from navigation macros.\r\n<p>\r\n\r\n<b>Open in new window?</b><br>\r\nSelect yes to open this page in a new window. This is often used in conjunction with the <b>Redirect URL</b> parameter.\r\n<p>\r\n\r\n\r\n\r\n<b>Language</b><br/>\r\nChoose the default language for this page. All WebGUI generated messages will appear in that language and the character set will be changed to the character set for that language.\r\n<p/>\r\n\r\n<b>Template</b><br>\r\nBy default, WebGUI has one big content area to place wobjects. However, by specifying a template other than the default you can sub-divide the content area into several sections.\r\n<p>\r\n\r\n<b>Synopsis</b><br>\r\nA short description of a page. It is used to populate default descriptive meta tags as well as to provide descriptions on Site Maps.\r\n<p>\r\n\r\n<b>Meta Tags</b><br>\r\nMeta tags are used by some search engines to associate key words to a particular page. There is a great site called <a href="http://www.metatagbuilder.com/">Meta Tag Builder</a> that will help you build meta tags if you\'ve never done it before.\r\n<p>\r\n\r\n<i>Advanced Users:</i> If you have other things (like JavaScript) you usually put in the area of your pages, you may put them here as well.\r\n<p>\r\n\r\n<b>Use default meta tags?</b><br>\r\nIf you don\'t wish to specify meta tags yourself, WebGUI can generate meta tags based on the page title and your company\'s name. Check this box to enable the WebGUI-generated meta tags.\r\n<p>\r\n\r\n\r\n<b>Style</b><br>\r\nBy default, when you create a page, it inherits a few traits from its parent. One of those traits is style. Choose from the list of styles if you would like to change the appearance of this page. See <i>Add Style</i> for more details.\r\n<p>\r\n\r\nIf you select "Yes" below the style pull-down menu, all of the pages below this page will take on the style you\'ve chosen for this page.\r\n<p>\r\n\r\n<b>Start Date</b><br>\r\nThe date when users may begin viewing this page. Note that before this date only content managers with the rights to edit this page will see it.\r\n<p>\r\n\r\n<b>End Date</b><br>\r\nThe date when users will stop viewing this page. Note that after this date only content managers with the rights to edit this page will see it.\r\n<p>\r\n\r\n\r\n<b>Owner</b><br>\r\nThe owner of a page is usually the person who created the page. This user always has full edit and viewing rights on the page.\r\n<p>\r\n<b>NOTE:</b> The owner can only be changed by an administrator.\r\n<p>\r\n\r\n\r\n<b>Who can view?</b><br>\r\nChoose which group can view this page. If you want both visitors and registered users to be able to view the page then you should choose the "Everybody" group.\r\n<p>\r\n\r\n<b>Who can edit?</b><br>\r\nChoose the group that can edit this page. The group assigned editing rights can also always view the page.\r\n<p>\r\n\r\nYou can optionally recursively give these privileges to all pages under this page.\r\n<p>\r\n\r\n<b>What next?</b><br/>\r\nIf you leave this on the default setting you\'ll be redirected to the new page after creating it.\r\n<p/>', 1050440248);
|
||||
delete from international where languageId=1 and namespace='WebGUI' and internationalId=940;
|
||||
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (940,1,'WebGUI','Open in new window?', 1050438829);
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -30,10 +30,12 @@ sub process {
|
|||
sub _reversePageTree {
|
||||
my ($sth, @data, $output, $parentId);
|
||||
($parentId) = WebGUI::SQL->quickArray("select parentId from page where pageId='$_[0]'");
|
||||
$sth = WebGUI::SQL->read("select pageId,parentId,menuTitle,urlizedTitle,hideFromNavigation from page where parentId=$_[0] order by sequenceNumber");
|
||||
$sth = WebGUI::SQL->read("select pageId,parentId,menuTitle,urlizedTitle,hideFromNavigation,newWindow from page where parentId=$_[0] order by sequenceNumber");
|
||||
while (@data = $sth->array) {
|
||||
if (!($data[4]) && WebGUI::Privilege::canViewPage($data[0])) {
|
||||
$output .= '<a class="verticalMenu" href="'.WebGUI::URL::gateway($data[3]).'">';
|
||||
$output .= '<a class="verticalMenu" ';
|
||||
$output .= ' target="_blank"' if ($data[5]);
|
||||
$output .= 'href="'.WebGUI::URL::gateway($data[3]).'">';
|
||||
if ($session{page}{pageId} == $data[0]) {
|
||||
$output .= '<span class="selectedMenuItem">'.$data[2].'</span>';
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -81,7 +81,9 @@ sub drawHorizontal {
|
|||
} else {
|
||||
$output .= ' '.$seperator.' ';
|
||||
}
|
||||
$output .= '<a class="'.$class.'" href="'.$tree->{$pageId}{url}.'">';
|
||||
$output .= '<a class="'.$class.'"';
|
||||
$output .= ' target="_blank"' if ($tree->{$pageId}{newWindow});
|
||||
$output .= ' href="'.$tree->{$pageId}{url}.'">';
|
||||
if ($pageId == $session{page}{pageId}) {
|
||||
$output .= '<span class="selectedMenuItem">'.$tree->{$pageId}{title}.'</span>';
|
||||
} else {
|
||||
|
|
@ -136,7 +138,9 @@ sub drawVertical {
|
|||
$leading .= "<br>";
|
||||
}
|
||||
foreach $pageId (keys %{$tree}) {
|
||||
$output .= $padding.$bullet.'<a class="'.$class.'" href="'.$tree->{$pageId}{url}.'">';
|
||||
$output .= $padding.$bullet.'<a class="'.$class.'"';
|
||||
$output .= ' target="_blank"' if ($tree->{$pageId}{newWindow});
|
||||
$output .= ' href="'.$tree->{$pageId}{url}.'">';
|
||||
if ($pageId == $session{page}{pageId}) {
|
||||
$output .= '<span class="selectedMenuItem">'.$tree->{$pageId}{title}.'</span>';
|
||||
} else {
|
||||
|
|
@ -152,17 +156,21 @@ sub drawVertical {
|
|||
|
||||
=head2 tree ( parentId [, toLevel ] )
|
||||
|
||||
Generates and returns a hash reference containing a page tree with keys of "url", "title", and "sub" with orignating keys of page ids. The tree looks like this:
|
||||
Generates and returns a hash reference containing a page tree with keys of "url", "title", "fullTitle", "synopsis", "newWindow" and "sub" with orignating keys of page ids. The tree looks like this:
|
||||
|
||||
root
|
||||
|-pageId
|
||||
| |-url
|
||||
| |-title
|
||||
| |-fullTitle
|
||||
| |-synopsis
|
||||
| |-newWindow
|
||||
| `-sub (pageId)
|
||||
| |-url
|
||||
| |-title
|
||||
| |-fullTitle
|
||||
| |-synopsis
|
||||
| |-newWindow
|
||||
| `-sub (pageId)
|
||||
| `-etc
|
||||
`-pageId
|
||||
|
|
@ -189,13 +197,16 @@ sub tree {
|
|||
tie %tree, 'Tie::IxHash';
|
||||
tie %data, 'Tie::CPHash';
|
||||
if ($depth < $toLevel) {
|
||||
$sth = WebGUI::SQL->read("select urlizedTitle, menuTitle, pageId, synopsis, hideFromNavigation from page
|
||||
$sth = WebGUI::SQL->read("select urlizedTitle, menuTitle, pageId, synopsis, hideFromNavigation,
|
||||
newWindow, title from page
|
||||
where parentId='$parentId' order by sequenceNumber");
|
||||
while (%data = $sth->hash) {
|
||||
if (!($data{hideFromNavigation}) && WebGUI::Privilege::canViewPage($data{pageId})) {
|
||||
$tree{$data{pageId}}{url} = WebGUI::URL::gateway($data{urlizedTitle});
|
||||
$tree{$data{pageId}}{title} = $data{menuTitle};
|
||||
$tree{$data{pageId}}{synopsis} = $data{synopsis};
|
||||
$tree{$data{pageId}}{fullTitle} = $data{title};
|
||||
$tree{$data{pageId}}{newWindow} = $data{newWindow};
|
||||
$tree{$data{pageId}}{sub} = tree($data{pageId},$toLevel,($depth+1));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,7 +74,8 @@ sub _recursePageTree {
|
|||
userDefined3,
|
||||
userDefined4,
|
||||
userDefined5,
|
||||
hideFromNavigation
|
||||
hideFromNavigation,
|
||||
newWindow
|
||||
) values (
|
||||
$newPageId,
|
||||
$_[1],
|
||||
|
|
@ -98,7 +99,8 @@ sub _recursePageTree {
|
|||
".quote($newParent{userDefined3}).",
|
||||
".quote($newParent{userDefined4}).",
|
||||
".quote($newParent{userDefined5}).",
|
||||
$package{hideFromNavigation}
|
||||
$package{hideFromNavigation},
|
||||
$package{newWindow}
|
||||
)");
|
||||
_recursePageTree($package{pageId},$newPageId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -266,17 +266,29 @@ sub www_editPage {
|
|||
-value=>$page{menuTitle},
|
||||
-uiLevel=>1
|
||||
);
|
||||
$f->getTab("properties")->text(
|
||||
-name=>"urlizedTitle",
|
||||
-label=>WebGUI::International::get(104),
|
||||
-value=>$page{urlizedTitle},
|
||||
-uiLevel=>3
|
||||
);
|
||||
$f->getTab("properties")->url(
|
||||
-name=>"redirectURL",
|
||||
-label=>WebGUI::International::get(715),
|
||||
-value=>$page{redirectURL},
|
||||
-uiLevel=>9
|
||||
);
|
||||
$f->getTab("properties")->yesNo(
|
||||
-name=>"hideFromNavigation",
|
||||
-value=>$page{hideFromNavigation},
|
||||
-label=>WebGUI::International::get(886),
|
||||
-uiLevel=>6
|
||||
);
|
||||
$f->getTab("properties")->text(
|
||||
-name=>"urlizedTitle",
|
||||
-label=>WebGUI::International::get(104),
|
||||
-value=>$page{urlizedTitle},
|
||||
-uiLevel=>3
|
||||
$f->getTab("properties")->yesNo(
|
||||
-name=>"newWindow",
|
||||
-value=>$page{newWindow},
|
||||
-label=>WebGUI::International::get(940),
|
||||
-uiLevel=>6
|
||||
);
|
||||
$f->getTab("properties")->select(
|
||||
-name=>"languageId",
|
||||
|
|
@ -285,12 +297,6 @@ sub www_editPage {
|
|||
-uiLevel=>1,
|
||||
-options=>WebGUI::International::getLanguages()
|
||||
);
|
||||
$f->getTab("properties")->url(
|
||||
-name=>"redirectURL",
|
||||
-label=>WebGUI::International::get(715),
|
||||
-value=>$page{redirectURL},
|
||||
-uiLevel=>9
|
||||
);
|
||||
$f->getTab("properties")->textarea(
|
||||
-name=>"synopsis",
|
||||
-label=>WebGUI::International::get(412),
|
||||
|
|
@ -444,6 +450,7 @@ sub www_editPageSave {
|
|||
ownerId=$session{form}{ownerId},
|
||||
groupIdView=$session{form}{groupIdView},
|
||||
groupIdEdit=$session{form}{groupIdEdit},
|
||||
newWindow=$session{form}{newWindow},
|
||||
hideFromNavigation=$session{form}{hideFromNavigation},
|
||||
startDate=$session{form}{startDate},
|
||||
endDate=$session{form}{endDate},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue