Tags:
archive_me1Add my vote for this tag create new tag
, view all tags
a new option in the SEARCH macro
  • showlock="on"

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

TopicClassification:
FeatureDone
Topic revision: r2 - 2001-03-12 - PeterThoeny
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by PerlIdeas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.