Line: 697 to 697 | ||||||||
---|---|---|---|---|---|---|---|---|
Since: TWiki::Plugins::VERSION 1.000 (14 Jul 2001) | ||||||||
Added: | ||||||||
> > | isValidWebName( $name, $templateWeb ) -> $booleanCheck for a valid web name.
| |||||||
createWeb( $newWeb, $baseWeb, $opts ) | ||||||||
Line: 794 to 808 | ||||||||
topicExists( $web, $topic ) -> $boolean | ||||||||
Changed: | ||||||||
< < | Test if topic exists | |||||||
> > | Test if topic exists. | |||||||
| ||||||||
Line: 805 to 819 | ||||||||
Since: TWiki::Plugins::VERSION 1.000 (14 Jul 2001) | ||||||||
Added: | ||||||||
> > | isValidTopicName( $name ) -> $booleanCheck for a valid topic name. Names considerd valid for autolinking are WikiWords (such as 'SanFrancisco') and acronym (such as 'SWMBO').
| |||||||
checkTopicEditLock( $web, $topic, $script ) -> ( $oopsUrl, $loginName, $unlockTime ) | ||||||||
Line: 851 to 875 | ||||||||
Since: TWiki::Plugins::VERSION 1.000 (29 Jul 2001) | ||||||||
Changed: | ||||||||
< < | For example, | |||||||
> > | Example: | |||||||
Changed: | ||||||||
< < | my( $meta, $text ) = TWiki::Func::readTopic( $web, $topic ) $text =~ s/APPLE/ORANGE/g; TWiki::Func::saveTopic( $web, $topic, $meta, $text, { forcenewrevision => 1 } ); | |||||||
> > | # read topic: my( $topicMeta, $topicText ) = TWiki::Func::readTopic( $web, $topic ) # example to change topic text: $topicText =~ s/APPLE/ORANGE/g; # example to change TWiki form field: my $field = $topicMeta->get( 'FIELD', 'Title' ); if( $field ) { $field->{value} = $newTitle; $topicMeta->putKeyed( 'FIELD', $field ); } # save updated topic: TWiki::Func::saveTopic( $web, $topic, $topicMeta, $topicText, { forcenewrevision => 1 } ); | |||||||
Note: Plugins handlers ( e.g. beforeSaveHandler ) will be called as | ||||||||
Line: 978 to 1011 | ||||||||
checkAccessPermission to ensure the current user has read access to the
topic. | ||||||||
Added: | ||||||||
> > | See usage example at TWiki::Func::saveTopic. | |||||||
Since: TWiki::Plugins::VERSION 1.000 (7 Dec 2002) | ||||||||
Line: 1369 to 1404 | ||||||||
| ||||||||
Added: | ||||||||
> > |
| |||||||
for example, to execute an arbitrary command on the server, you might do this:
sub initPlugin{ | ||||||||
Line: 1384 to 1421 | ||||||||
my $result = `$cmd 2>&1`; return $params->{silent} ? '' : $result; } | ||||||||
Deleted: | ||||||||
< < | } | |||||||
would let you do this:
%EXEC{"ps -Af" silent="on"}% | ||||||||
Line: 1677 to 1713 | ||||||||
Since: TWiki::Plugins::VERSION 1.020 (16 Feb 2004) | ||||||||
Added: | ||||||||
> > | writeLog( $action, $extra, $web, $topic, $user )Write the log for an event to the logfile.
TWiki::Func::writeLog( 'blacklist', 'Magic number is missing' )
will add a log entry like this:
| 2011-01-19 - 01:13 | guest | blacklist | TWiki.TWikiRegistration | Magic number is missing | 1.2.3.4 |Note: Older plugins that use $TWiki::cfg{LogFileName} or call the internal TWiki
function directly should be fixed to use writeLog .
To maintain compatibility with older TWiki releases, you can write conditional code as follows:
if( defined &TWiki::Func::writeLog ) { # use writeLog TWiki::Func::writeLog( $web, $topic, 'myevent', $extra ); } else { # deprecated code if plugin is used in older TWiki releases $TWiki::Plugins::VERSION > 1.1 ? $TWiki::Plugins::SESSION->writeLog( 'myevent', "$web.$topic", $extra ) : TWiki::Store::writeLog( 'myevent', "$web.$topic", $extra ); } | |||||||
formatTime( $time, $format, $timezone ) -> $text | ||||||||
Line: 1701 to 1772 | ||||||||
If the value is undef, then $default is returned. If $default is
not specified it is taken as 0. | ||||||||
Changed: | ||||||||
< < | Since: $TWiki::Plugins::VERSION 1.2 | |||||||
> > | Since: TWiki::Plugins::VERSION 1.2 | |||||||
Line: 1990 to 2061 | ||||||||
Func.pm | ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Line: 2107 to 2178 | ||||||||
Func.pm
| ||||||||
Added: | ||||||||
> > | TWiki-5.1 (Istanbul Release)$TWiki::Plugins::VERSION 1.4EmptyPlugin.pm
Func.pm
|