a new option in the SEARCH macro
this shows in the search list if a page is locked by another user (and maybe even for how much longer the lock will be active.)
it has required a change in wiki.pm
sub handleSearchWeb
{
my( $attributes ) = @_;
my $searchVal = extractNameValuePair( $attributes );
if( ! $searchVal ) {
# %SEARCH{"string" ...} not found, try
# %SEARCH{search="string" ...}
$searchVal = extractNameValuePair( $attributes, "search" );
}
return &searchWikiWeb( "1",
extractNameValuePair( $attributes, "web" ),
$searchVal,
extractNameValuePair( $attributes, "scope" ),
extractNameValuePair( $attributes, "regex" ),
extractNameValuePair( $attributes, "casesensitive" ),
extractNameValuePair( $attributes, "nosummary" ),
extractNameValuePair( $attributes, "nosearch" ),
extractNameValuePair( $attributes, "nototal" ),
extractNameValuePair( $attributes, "showlock" )
);
}
and in wikisearch.pm
my ( $doInline, $theWebName, $theSearchVal, $theScope, $theRegex,
$caseSensitive, $noSummary, $noSearch, $noTotal, $showLock ) = @_;
.........snip..............
$tempVal = $repeatText;
$tempVal =~ s/%WEB%/$theWebName/go;
my ($isLockedBy) = wiki::topicIsLocked($filename);
if ( $isLockedBy )
{
$tempVal =~ s/%LOCKEDBY%/(Locked by $isLockedBy)/;
} else {
$tempVal =~ s/\t%LOCKEDBY%//;
}
$tempVal =~ s/%TOPICNAME%/$filename/go;
And the addition of % LOCKEDBY% to the template
--
SvenDowideit - 12 Feb 2001
Implemented
"showlock" parameter. Template variable
%LOCKED% gets expanded to
(LOCKED) if topic is locked, and the "Changed by" user is the lock user.
Commited to
TWikiAlphaRelease.
--
PeterThoeny - 11 Mar 2001