the wiki pretty much works. now it's just about the cleanup work.
This commit is contained in:
parent
becec72418
commit
737cbf0fef
4 changed files with 68 additions and 20 deletions
|
|
@ -13,7 +13,12 @@
|
|||
<h3><tmpl_var resultsLabel></h3>
|
||||
<tmpl_if searchResults>
|
||||
<ul><tmpl_loop searchResults><li><a href="<tmpl_var url>"><tmpl_var title></a></li></tmpl_loop></ul>
|
||||
<p><tmpl_var notWhatYouWanted></p>
|
||||
<tmpl_if pagination.pageCount.isMultiple>
|
||||
<div class="pagination">
|
||||
<tmpl_var pagination.previousPage> · <tmpl_var pagination.pageList.upTo10> · <tmpl_var pagination.nextPage>
|
||||
</div>
|
||||
</tmpl_if>
|
||||
<p><tmpl_var notWhatYouWanted></p>
|
||||
<p><a href="javascript:wiki_getAddForm('<tmpl_var getEditFormUrl>');"><tmpl_var addPageLabel></a></p>
|
||||
<tmpl_else>
|
||||
<p><tmpl_var nothingFoundLabel></p>
|
||||
|
|
@ -22,6 +27,7 @@
|
|||
</tmpl_if>
|
||||
<div id="addFormGoesHere" style="display: none;"></div>
|
||||
<div style="padding: 8px;"><a href="<tmpl_var recentChangesUrl>"><tmpl_var recentChangesLabel></a> | <a href="<tmpl_var wikiHomeUrl>"><tmpl_var wikiHomeLabel></a></div>
|
||||
|
||||
~~~
|
||||
<script type="text/javascript" src="^Extras(yui/build/yahoo/yahoo-min.js);"></script>
|
||||
<script type="text/javascript" src="^Extras(yui/build/connection/connection-min.js);"></script>
|
||||
|
|
|
|||
|
|
@ -156,18 +156,22 @@ sub duplicate {
|
|||
#-------------------------------------------------------------------
|
||||
sub getEditForm {
|
||||
my $self = shift;
|
||||
my $i18n = WebGUI::International->new($self->session, "Asset_WikiPage");
|
||||
my $session = $self->session;
|
||||
my $form = $session->form;
|
||||
my $i18n = WebGUI::International->new($session, "Asset_WikiPage");
|
||||
my $newPage = 0;
|
||||
my $wiki = $self->getWiki;
|
||||
my $var = {
|
||||
title=> $i18n->get("editing")." ".(defined($self->get('title'))? $self->get('title') : $i18n->get("assetName")),
|
||||
formHeader => WebGUI::Form::formHeader($self->session, { action => $wiki->getUrl }) .WebGUI::Form::hidden($self->session, { name => 'func', value => 'editSave' }) .WebGUI::Form::hidden($self->session, { name => 'class', value => ref $self }),
|
||||
formTitle => WebGUI::Form::text($self->session, { name => 'title', maxlength => 255, size => 40, value => $self->get('title') }),
|
||||
formContent => WebGUI::Form::HTMLArea($self->session, { name => 'content', richEditId => $wiki->get('richEditor'), value => $self->get('content') }),
|
||||
formSubmit => WebGUI::Form::submit($self->session, { value => 'Save' }),
|
||||
formHeader => WebGUI::Form::formHeader($session, { action => $wiki->getUrl })
|
||||
.WebGUI::Form::hidden($session, { name => 'func', value => 'editSave' })
|
||||
.WebGUI::Form::hidden($session, { name=>"proceed", value=>$form->process("proceed") }),
|
||||
formTitle => WebGUI::Form::text($session, { name => 'title', maxlength => 255, size => 40, value => $self->get('title') }),
|
||||
formContent => WebGUI::Form::HTMLArea($session, { name => 'content', richEditId => $wiki->get('richEditor'), value => $self->get('content') }),
|
||||
formSubmit => WebGUI::Form::submit($session, { value => 'Save' }),
|
||||
formAttachment => '',
|
||||
allowsAttachments => $wiki->get("maxAttachments"),
|
||||
formFooter => WebGUI::Form::formFooter($self->session),
|
||||
formFooter => WebGUI::Form::formFooter($session),
|
||||
isNew => ($self->getId eq "new"),
|
||||
canAdminister => $wiki->canAdminister,
|
||||
titleLabel => $i18n->get("titleLabel"),
|
||||
|
|
@ -179,6 +183,10 @@ sub getEditForm {
|
|||
unprotectUrl => $self->get("func=unprotect"),
|
||||
isProtected => $self->isProtected
|
||||
};
|
||||
if ($self->getId eq "new") {
|
||||
$var->{formHeader} .= WebGUI::Form::hidden($session, { name=>"assetId", value=>"new" })
|
||||
.WebGUI::Form::hidden($session, { name=>"class", value=>$form->process("class","className") });
|
||||
}
|
||||
$self->_appendFuncTemplateVars($var);
|
||||
return $self->processTemplate($var, $wiki->getValue('pageEditTemplateId'));
|
||||
}
|
||||
|
|
@ -265,7 +273,8 @@ sub processPropertiesFromFormPost {
|
|||
my $self = shift;
|
||||
$self->SUPER::processPropertiesFromFormPost(@_);
|
||||
$self->update({ groupIdView => $self->getWiki->get('groupIdView'),
|
||||
groupIdEdit => $self->getWiki->get('groupIdEdit') });
|
||||
groupIdEdit => $self->getWiki->get('groupToAdminister'),
|
||||
isHidden => 1});
|
||||
$self->getWiki->updateTitleIndex([$self], from => 'edit');
|
||||
delete $self->{_storageLocation};
|
||||
my $size = 0;
|
||||
|
|
@ -325,9 +334,21 @@ sub updateWikiHistory {
|
|||
#-------------------------------------------------------------------
|
||||
sub view {
|
||||
my $self = shift;
|
||||
my $var = {};
|
||||
my $content = $self->getWiki->autolinkHtml($self->get('content'));
|
||||
return $self->processPageTemplate($content, 'view');
|
||||
my $i18n = WebGUI::International->new($self->session, "Asset_WikiPage");
|
||||
my $var = {
|
||||
viewLabel => $i18n->get("viewLabel"),
|
||||
editLabel => $i18n->get("editLabel"),
|
||||
historyLabel => $i18n->get("historyLabel"),
|
||||
wikiHomeLabel=>$i18n->get("wikiHomeLabel", "Asset_WikiMaster"),
|
||||
searchLabel=>$i18n->get("searchLabel", "Asset_WikiMaster"),
|
||||
recentChangesUrl=>$self->getUrl("func=recentChanges"),
|
||||
recentChangesLabel=>$i18n->get("recentChangesLabel", "Asset_WikiMaster"),
|
||||
wikiHomeUrl=>$self->getUrl,
|
||||
historyUrl=>$self->getUrl("func=getHistory"),
|
||||
editUrl=>$self->getUrl("func=getEditForm"),
|
||||
content => $self->getWiki->autolinkHtml($self->get('content')),
|
||||
};
|
||||
return $self->processTemplate($var, $self->getWiki->get("pageTemplateId"));
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -340,24 +361,28 @@ sub www_delete {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# here to keep backward compatibility with traditional editing
|
||||
sub www_edit {
|
||||
my $self = shift;
|
||||
return $self->session->privilege->insufficient unless $self->canEdit;
|
||||
return $self->getWiki->processStyle($self->getEditForm);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_getEditForm {
|
||||
my $self = shift;
|
||||
return $self->session->privilege->insufficient unless $self->canEdit;
|
||||
return $self->getEditForm;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_pageHistory {
|
||||
sub www_getHistory {
|
||||
my $self = shift;
|
||||
my $template = WebGUI::Asset::Template->new($self->session, $self->getWiki->get('pageHistoryTemplateId'));
|
||||
$template->prepare;
|
||||
|
||||
# Buggo: hardcoded count
|
||||
my $var = {};
|
||||
$var->{title} = sprintf(WebGUI::International->new($self->session, 'Asset_WikiPage')->get('pageHistory title'), $self->get('title'));
|
||||
$self->getWiki->_appendPageHistoryVars($var, [0, 50], $self);
|
||||
|
||||
return $self->getWiki->processStyle($self->processPageTemplate($self->processTemplate($var, undef, $template), 'pageHistory'));
|
||||
return $self->processTemplate($var, $self->getWiki->get('pageHistoryTemplateId'));
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -372,6 +397,20 @@ sub www_protect {
|
|||
return $self->www_view;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_showConfirmation ( )
|
||||
|
||||
Shows a confirmation message letting the user know their page has been submitted.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_showConfirmation {
|
||||
my $self = shift;
|
||||
my $i18n = WebGUI::International->new($self->session, "Asset_WikiPage");
|
||||
return $self->getWiki->processStyle('<p>'.$i18n->get("page received").'</p><p><a href="'.$self->getWiki->getUrl.'">'.$i18n->get("493","WebGUI").'</a></p>');
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_unprotect {
|
||||
my $self = shift;
|
||||
|
|
|
|||
|
|
@ -521,10 +521,12 @@ sub www_search {
|
|||
$search->search({ keywords => $queryString,
|
||||
lineage => [$self->get('lineage')],
|
||||
classes => ['WebGUI::Asset::WikiPage'] });
|
||||
my $rs = $search->getResultSet;
|
||||
my $rs = $search->getPaginatorResultSet;
|
||||
$rs->appendTemplateVars($var);
|
||||
my @results = ();
|
||||
while (defined(my $row = $rs->hashRef)) {
|
||||
push @results, $self->_templateSubvarOfPage($row->{assetId});
|
||||
foreach my $row (@{$rs->getPageData}) {
|
||||
$row->{url} = $self->session->url->gateway($row->{url});
|
||||
push @results, $row;
|
||||
}
|
||||
$var->{'searchResults'} = \@results;
|
||||
$var->{'performSearch'} = 1;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ our $I18N =
|
|||
'editing' => { lastUpdated => 1160157064, message => 'Editing' },
|
||||
'assetName' => { lastUpdated => 1160157064, message => 'Wiki Page' },
|
||||
|
||||
'page received' => { lastUpdated => 1160157064, message => q|Your page has been received and is being processed so it can be added to the site. It will be available for further editing after being processed. Please be patient.| },
|
||||
'editLabel' => { lastUpdated => 1160157064, message => q|Edit| },
|
||||
'viewLabel' => { lastUpdated => 1160157064, message => q|View| },
|
||||
'historyLabel' => { lastUpdated => 1160425002, message => q|History| },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue