added alphabetic site map object and changed hidefromnavigation to hide the page from site maps as well
This commit is contained in:
parent
2186a8d6d5
commit
6856cea379
3 changed files with 28 additions and 6 deletions
|
|
@ -4,6 +4,8 @@
|
|||
- Added external database group privileges. (Thanks to Andy Grundman.)
|
||||
- Added support for encryptLogin user setting. (Thanks to Hal Roberts.)
|
||||
- Added anonymous response option to Survey. (Thanks to Andy Grundman.)
|
||||
- Added the alphabetic? option to the SiteMap wobject. (Thanks to Hal Roberts.)
|
||||
- Changed the page hideFromNavigation option to hide the given page from site maps as well as from navigation menus. (Thanks to Hal Roberts.)
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -97,3 +97,10 @@ delete from international where languageId=1 and namespace='Survey' and internat
|
|||
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (4,1,'Survey','Surveys allow you to gather information from your users. In the case of WebGUI surveys, you can also use them to test your user\'s knowledge.\r\n<p/>\r\n\r\n<b>Question Order</b><br/>\r\nThe order the questions will be asked. Sequential displays the questions in the order you create them. Random displays the questions randomly. Response driven displays the questions in order based on the responses of the users.\r\n<p/>\r\n\r\n<b>Mode</b><br/>\r\nBy default the Survey is in survey mode. This allows it to ask questions of your users. However, if you switch to Quiz mode, you can have a self-correcting test of your user\'s knowledge.\r\n<p/>\r\n\r\n<b>Anonymous responses?</b><br/>\r\nSelect whether or not the survey will record and display information that can identify a user and their responses. If left at the default value of "No", the survey will record the user\'s IP address as well as their WebGUI User ID and Username if logged in. This info will then be available in the survey\'s reports. If set to "Yes", these three fields will contain scrambled data that can not be traced to a particular user.\r\n<p/>\r\n\r\n<b>Who can take the survey?</b><br/>\r\nWhich users can participate in the survey?\r\n<p/>\r\n\r\n\r\n<b>Who can view reports?</b><br/>\r\nWho can view the results of the survey?\r\n<p/>\r\n\r\n\r\n<b>What next?</b><br/>\r\nIf you leave this set at its default, then you will add a question directly after adding the survey.\r\n<p/>\r\n',1059069492);
|
||||
alter table Survey add column anonymous char(1) not null default 0;
|
||||
alter table Survey_response change userId userId varchar(11);
|
||||
|
||||
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (7,1,'SiteMap','Alphabetic?',1057208065);
|
||||
alter table SiteMap add column alphabetic int(11) not null default 0;
|
||||
delete from international where languageId=1 and namespace='SiteMap' and internationalId=71;
|
||||
insert into international values (71,'SiteMap',1,'Site maps are used to provide additional navigation in WebGUI. You could set up a traditional site map that would display a hierarchical view of all the pages in the site. On the other hand, you could use site maps to provide extra navigation at certain levels in your site.\r\n<br><br>\r\n\r\n<b>Template</b><br/>\r\nChoose a layout for this site map.\r\n<p/>\r\n\r\n<b>Start With</b><br>\r\nSelect the page that this site map should start from.\r\n<br><br>\r\n\r\n<b>Depth To Traverse</b><br>\r\nHow many levels deep of navigation should the Site Map show? If 0 (zero) is specified, it will show as many levels as there are.\r\n<p>\r\n\r\n<b>Indent</b><br>\r\nHow many characters should indent each level?\r\n<p>\r\n\r\n<b>Alphabetic?</b><br>\r\nIf this setting is true, site map entries are sorted alphabetically. If this setting is false, site map entries are sorted by the page sequence order (editable via the up and down arrows in the page toolbar).\r\n<p>\r\n\r\n',1039908464,NULL);
|
||||
delete from international where languageId=1 and namespace='WebGUI' and internationalId=606;
|
||||
insert into international values (606,'WebGUI',1,'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<b>NOTE:</b> The redirects will be disabled while in admin mode in order to make it easier to edit the properties of the page.\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 menus and site maps.\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 and from site maps.\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<P><B>Cache Timeout</B><BR>The amount of time this page should remain cached for registered users. \r\n\r\n<P><B>Cache Timeout (Visitors)</B><BR>The amount of time this page should remain cached for visitors. \r\n\r\n<P><B>NOTE:</B> Page caching is only available if your administrator has installed the Cache::FileCache Perl module. Using page caching can improve site performance by as much as 1000%. \r\n\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/>',1056293101,NULL);
|
||||
|
|
|
|||
|
|
@ -25,17 +25,22 @@ our @ISA = qw(WebGUI::Wobject);
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub _traversePageTree {
|
||||
my ($parent, $sth, $data, $indent, @pages, $i, $currentDepth, $depth, $indentString);
|
||||
my ($parent, $sth, $data, $indent, @pages, $i, $currentDepth, $depth, $indentString, $alphabetic, $orderBy);
|
||||
$parent = $_[0];
|
||||
$currentDepth = $_[1];
|
||||
$depth = $_[2] || 99;
|
||||
$indent = $_[3];
|
||||
$alphabetic = $_[4];
|
||||
for ($i=1;$i<=($indent*$currentDepth);$i++) {
|
||||
$indentString .= " ";
|
||||
}
|
||||
if ($currentDepth < $depth) {
|
||||
$sth = WebGUI::SQL->read("select urlizedTitle, menuTitle, title, pageId, synopsis from page
|
||||
where parentId='$parent' order by sequenceNumber");
|
||||
if ($alphabetic) {
|
||||
$orderBy = 'title';
|
||||
} else {
|
||||
$orderBy = 'sequenceNumber';
|
||||
}
|
||||
$sth = WebGUI::SQL->read("select urlizedTitle, menuTitle, title, pageId, synopsis from page where parentId='$parent' and hideFromNavigation = 0 order by $orderBy");
|
||||
while ($data = $sth->hashRef) {
|
||||
if (($data->{pageId}<0 || $data->{pageId}>999 || $data->{pageId}==1) && WebGUI::Privilege::canViewPage($data->{pageId})) {
|
||||
push(@pages,{
|
||||
|
|
@ -48,7 +53,7 @@ sub _traversePageTree {
|
|||
"page.isRoot" => ($parent == 0),
|
||||
"page.isTop" => ($currentDepth == 0 || ($currentDepth == 1 && $parent == 0))
|
||||
});
|
||||
push(@pages,@{_traversePageTree($data->{pageId},($currentDepth+1),$depth,$indent)});
|
||||
push(@pages,@{_traversePageTree($data->{pageId},($currentDepth+1),$depth,$indent,$alphabetic)});
|
||||
}
|
||||
}
|
||||
$sth->finish;
|
||||
|
|
@ -77,7 +82,10 @@ sub new {
|
|||
},
|
||||
depth=>{
|
||||
defaultValue=>0
|
||||
}
|
||||
},
|
||||
alphabetic=>{
|
||||
defaultValue=>0
|
||||
}
|
||||
},
|
||||
-useTemplate=>1
|
||||
);
|
||||
|
|
@ -111,6 +119,11 @@ sub www_edit {
|
|||
-label=>WebGUI::International::get(6,$_[0]->get("namespace")),
|
||||
-value=>$_[0]->getValue("indent")
|
||||
);
|
||||
$layout->yesNo(
|
||||
-name=>"alphabetic",
|
||||
-label=>WebGUI::International::get(7,$_[0]->get("namespace")),
|
||||
-value=>$_[0]->getValue("alphabetic")
|
||||
);
|
||||
return $_[0]->SUPER::www_edit(
|
||||
-properties=>$properties->printRowsOnly,
|
||||
-layout=>$layout->printRowsOnly,
|
||||
|
|
@ -123,7 +136,7 @@ sub www_edit {
|
|||
#-------------------------------------------------------------------
|
||||
sub www_view {
|
||||
my (%var);
|
||||
$var{page_loop} = _traversePageTree($_[0]->get("startAtThisLevel"),0,$_[0]->get("depth"),$_[0]->get("indent"));
|
||||
$var{page_loop} = _traversePageTree($_[0]->get("startAtThisLevel"),0,$_[0]->get("depth"),$_[0]->get("indent"),$_[0]->get("alphabetic"));
|
||||
return $_[0]->processTemplate($_[0]->get("templateId"),\%var);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue