Remove the TOC and chapter views from the Help. Make the index the
default Help view.
This commit is contained in:
parent
a83702f2ed
commit
9fe8fc782e
4 changed files with 3 additions and 99 deletions
|
|
@ -80,6 +80,8 @@
|
|||
- add: Database Links now have a 'Allow access from macro's' setting
|
||||
- All help except for hoverHelp and template variables has been removed from
|
||||
WebGUI and put into the WebGUI Community Wiki, http://www.webgui.org/community-wiki.
|
||||
- The Table of Contents view was removed from the Help system. The only view
|
||||
is now the Help Index.
|
||||
|
||||
7.3.21
|
||||
- fix: Self-deactivation doesn't show login screen after success
|
||||
|
|
|
|||
|
|
@ -311,7 +311,7 @@ sub getAdminFunction {
|
|||
namespace=>"WebGUI"
|
||||
},
|
||||
icon=>"help.gif",
|
||||
op=>"viewHelpTOC",
|
||||
op=>"viewHelpIndex",
|
||||
group=>"7"
|
||||
},
|
||||
"statistics"=>{
|
||||
|
|
|
|||
|
|
@ -159,9 +159,7 @@ sub getOperations {
|
|||
'manageUsersInGroup' => 'WebGUI::Operation::Group',
|
||||
|
||||
'viewHelp' => 'WebGUI::Operation::Help',
|
||||
'viewHelpChapter' => 'WebGUI::Operation::Help',
|
||||
'viewHelpIndex' => 'WebGUI::Operation::Help',
|
||||
'viewHelpTOC' => 'WebGUI::Operation::Help',
|
||||
|
||||
'viewInbox' => 'WebGUI::Operation::Inbox',
|
||||
'viewInboxMessage' => 'WebGUI::Operation::Inbox',
|
||||
|
|
|
|||
|
|
@ -407,102 +407,6 @@ sub www_viewHelpIndex {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_viewHelpTOC ( $session )
|
||||
|
||||
Display the table of contents for the Help system. This generates a list of
|
||||
the assetName,macroName,topicNames for each installed Help file.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_viewHelpTOC {
|
||||
my $session = shift;
|
||||
return $session->privilege->insufficient() unless ($session->user->isInGroup(7));
|
||||
my $i18n = WebGUI::International->new($session);
|
||||
my %tabs;
|
||||
tie %tabs, 'Tie::IxHash';
|
||||
%tabs = (
|
||||
other => {
|
||||
label => $i18n->get('topicName', 'WebGUI'),
|
||||
uiLevel => 1,
|
||||
},
|
||||
asset => {
|
||||
label => $i18n->get('topicName', 'Asset'),
|
||||
uiLevel => 1,
|
||||
},
|
||||
macro => {
|
||||
label => $i18n->get('topicName', 'Macros'),
|
||||
uiLevel => 1,
|
||||
},
|
||||
);
|
||||
|
||||
my @files = _getHelpFilesList($session,);
|
||||
my %entries;
|
||||
foreach my $fileSet (@files) {
|
||||
my $moduleName = $fileSet->[1];
|
||||
##This whole sorting routine sucks and should be replaced
|
||||
my $tab = lc substr $moduleName, 0, 5;
|
||||
unless (exists $tabs{$tab} or $tab eq "wobje" or $tab eq "workf") {
|
||||
$tab = 'other';
|
||||
}
|
||||
my $helpTopic = _loadHelp($session, "WebGUI::Help::".$moduleName);
|
||||
my @helpEntries = keys %{ $helpTopic };
|
||||
my $link;
|
||||
if (scalar @helpEntries > 1) {
|
||||
##Chapter
|
||||
$link = _linkTOC($session, $moduleName);
|
||||
}
|
||||
else {
|
||||
##Single page
|
||||
$link = _link($session, $helpEntries[0], $moduleName);
|
||||
}
|
||||
push @{ $entries{$tab} } ,
|
||||
{
|
||||
link => $link,
|
||||
name => _getHelpName($session,$moduleName),
|
||||
};
|
||||
}
|
||||
|
||||
my $tabForm = WebGUI::TabForm->new($session, \%tabs);
|
||||
foreach my $tab ( keys %tabs ) {
|
||||
my $tabPut = '<table width="100%" class="content"><tr><td valign="top">';
|
||||
$tabPut .= _columnar(3, $entries{$tab});
|
||||
$tabPut .= '</table>';
|
||||
$tabForm->getTab($tab)->raw($tabPut);
|
||||
}
|
||||
my $ac = WebGUI::AdminConsole->new($session,"help");
|
||||
$ac->addSubmenuItem($session->url->page('op=viewHelpIndex'),$i18n->get(95));
|
||||
$tabForm->{_submit} = $tabForm->{_cancel} = '';
|
||||
return $ac->render(wikiHelpLink($session).$tabForm->print, join(': ',$i18n->get(93), $i18n->get('help toc')));
|
||||
}
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_viewHelpChapter ( $session )
|
||||
|
||||
Display all entries in one chapter of the help. The namespace is passed in via
|
||||
the form paramter "namespace".
|
||||
|
||||
=cut
|
||||
|
||||
sub www_viewHelpChapter {
|
||||
my $session = shift;
|
||||
return $session->privilege->insufficient() unless ($session->user->isInGroup(7));
|
||||
my $namespace = $session->form->process("namespace","className");
|
||||
my $help = _load($session,$namespace);
|
||||
my @entries = sort keys %{ $help };
|
||||
my $output = '';
|
||||
my $i18n = WebGUI::International->new($session);
|
||||
foreach my $id (@entries) {
|
||||
next if $help->{$id}{private};
|
||||
$output .= '<p><a href="'._link($session,$id,$namespace).'">'.$i18n->get($help->{$id}{title},$namespace).'</a></p>';
|
||||
}
|
||||
my $ac = WebGUI::AdminConsole->new($session,"help");
|
||||
$ac->addSubmenuItem($session->url->page('op=viewHelpIndex'),$i18n->get(95));
|
||||
$ac->addSubmenuItem($session->url->page('op=viewHelpTOC'),$i18n->get('help contents'));
|
||||
return $ac->render(wikiHelpLink($session).$output, join ': ',$i18n->get(93), _getHelpName($session,$namespace));
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 wikiHelpLink ( $session )
|
||||
|
||||
Utility method that returns link to the WebGUI Community Wiki with i18n'ed text.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue