|
-
$web - Web name, e.g. 'Main'
-
$topic - Topic name, e.g. 'WebNotify'
-
$script - Script name, e.g. 'view'
|
|
> > |
-
... - an arbitrary number of name,value parameter pairs that will be url-encoded and added to the url. The special parameter name '#' is reserved for specifying an anchor. e.g. getScriptUrl('x','y','view','#'=>'XXX',a=>1,b=>2) will give .../view/x/y?a=1&b=2#XXX
|
| Return: $url URL, e.g. "http://example.com:80/cgi-bin/view.pl/Main/WebNotify"
Since: TWiki::Plugins::VERSION 1.000 (7 Dec 2002) |
| setSessionValue( $key, $value ) -> $boolean |
|
< < | Set a session value via the client session module |
> > | Set a session value. |
|
-
$key - Session key
-
$value - Value associated with key
Return: true if function succeeded |
| clearSessionValue( $key ) -> $boolean |
|
< < | Clear a session value via the client session module
Return: true if function succeeded |
> > | Clear a session value that was set using setSessionValue .
-
$key - name of value stored in session to be cleared. Note that you cannot clear AUTHUSER .
Return: true if the session value was cleared |
| Since: TWiki::Plugins::VERSION 1.1 |
|
-
- WebPreferences topic has:
* Set WEBBGCOLOR = #FFFFC0
-
my $webColor = TWiki::Func::getPreferencesValue( 'WEBBGCOLOR', 'Sandbox' );
|
|
> > | NOTE: As of TWiki4.1, if $NO_PREFS_IN_TOPIC is enabled in the plugin, then
preferences set in the plugin topic will be ignored. |
| getPluginPreferencesValue( $key ) -> $value |
| Since: TWiki::Plugins::VERSION 1.021 (27 Mar 2004) |
|
> > | NOTE: As of TWiki4.1, if $NO_PREFS_IN_TOPIC is enabled in the plugin, then
preferences set in the plugin topic will be ignored. |
| getPreferencesFlag( $key, $web ) -> $value |
|
-
- Use
"MYPLUGIN_SHOWHELP" for $key
-
my $showHelp = TWiki::Func::getPreferencesFlag( "MYPLUGIN_SHOWHELP" );
|
|
> > | NOTE: As of TWiki4.1, if $NO_PREFS_IN_TOPIC is enabled in the plugin, then
preferences set in the plugin topic will be ignored. |
| getPluginPreferencesFlag( $key ) -> $boolean |
| Since: TWiki::Plugins::VERSION 1.021 (27 Mar 2004) |
|
> > | NOTE: As of TWiki4.1, if $NO_PREFS_IN_TOPIC is enabled in the plugin, then
preferences set in the plugin topic will be ignored. |
| getWikiToolName( ) -> $name |
| Since: TWiki::Plugins::VERSION 1.000 (14 Jul 2001) |
|
< < | checkTopicEditLock( $web, $topic ) -> ( $oopsUrl, $loginName, $unlockTime ) |
> > | checkTopicEditLock( $web, $topic, $script ) -> ( $oopsUrl, $loginName, $unlockTime ) |
| Check if a lease has been taken by some other user.
-
$web Web name, e.g. "Main" , or empty
-
$topic Topic name, e.g. "MyTopic" , or "Main.MyTopic"
Return: ( $oopsUrl, $loginName, $unlockTime ) - The $oopsUrl for calling redirectCgiQuery(), user's $loginName , and estimated $unlockTime in minutes, or ( '', '', 0 ) if no lease exists. |
|
> > |
-
$script The script to invoke when continuing with the edit
|
| Since: TWiki::Plugins::VERSION 1.010 (31 Dec 2002) |
| Since: TWiki::Plugins::VERSION 1.000 (7 Dec 2002) |
|
< < | redirectCgiQuery( $query, $url ) |
> > | redirectCgiQuery( $query, $url, $passthru ) |
| Redirect to URL
-
$query - CGI query object. Ignored, only there for compatibility. The session CGI query object is used instead.
-
$url - URL to redirect to
|
|
< < | Return: none, never returns |
> > |
-
$passthru - enable passthrough.
Return: none
Print output to STDOUT that will cause a 302 redirect to a new URL.
Nothing more should be printed to STDOUT after this method has been called.
The $passthru parameter allows you to pass the parameters that were passed
to the current query on to the target URL, as long as it is another URL on the
same TWiki installation. If $passthru is set to a true value, then TWiki
will save the current URL parameters, and then try to restore them on the
other side of the redirect. Parameters are stored on the server in a cache
file (see {PassthroughDir} in =configure ).
Note that if $passthru is set, then any parameters in $url will be lost
when the old parameters are restored. if you want to change any parameter
values, you will need to do that in the current CGI query before redirecting
e.g.
my $query = TWiki::Func::getCgiQuery();
$query->param(-name => 'text', -value => 'Different text');
TWiki::Func::redirectCgiQuery(
undef, TWiki::Func::getScriptUrl($web, $topic, 'edit'), 1);
$passthru does nothing if $url does not point to a script in the current
TWiki installation. |
| Since: TWiki::Plugins::VERSION 1.000 (7 Dec 2002) |
| would let you do this:
%EXEC{"ps -Af" silent="on"}% |
|
> > | Registered tags differ from tags implemented using the old TWiki approach (text substitution in commonTagsHandler ) in the following ways:
- registered tags are evaluated at the same time as system tags, such as %SERVERTIME.
commonTagsHandler is only called later, when all system tags have already been expanded (though they are expanded again after commonTagsHandler returns).
- registered tag names can only contain alphanumerics and _ (underscore)
- registering a tag
FRED defines both %FRED{...}% and also %FRED% .
- registered tag handlers cannot return another tag as their only result (e.g.
return '%SERVERTIME%'; ). It won't work.
|
| registerRESTHandler( $alias, \&fn, ) |
|
> > | |
| Should only be called from initPlugin.
Adds a function to the dispatch table of the REST interface |
| Parse a web and topic name, supplying defaults as appropriate.
-
$web - Web name, identifying variable, or empty string
-
$topic - Topic name, may be a web.topic string, required.
|
|
< < | Return: the parsed Web/Topic pai |
> > | Return: the parsed Web/Topic pair |
| Since: TWiki::Plugins::VERSION 1.1 |
|
( '', 'Topic' ) | ( 'Main', 'Topic' ) |
( '', '' ) | ( 'Main', 'WebHome' ) |
( '', 'Web/Topic' ) | ( 'Web', 'Topic' ) |
|
|
> > |
( '', 'Web/Subweb/Topic' ) | ( 'Web/Subweb', 'Topic' ) |
|
|
( '', 'Web.Topic' ) | ( 'Web', 'Topic' ) |
|
|
> > |
( '', 'Web.Subweb.Topic' ) | ( 'Web/Subweb', 'Topic' ) |
|
|
( 'Web1', 'Web2.Topic' ) | ( 'Web2', 'Topic' ) |
|
|
< < |
( 'Main', 'Topic' ) | ( 'Main', 'Topic' ) |
( 'TWiki', 'Topic' ) | ( 'TWiki', 'Topic' ) |
where Main and TWiki are the web names set in $cfg{UsersWebName} and $cfg{SystemWebName} respectively. |
> > | Note that hierarchical web names (SubWeb? ) are only available if hierarchical webs are enabled in configure .
The symbols %USERSWEB%, %SYSTEMWEB%, %DOCWEB%, %MAINWEB% and %TWIKIWEB% can be used in the input to represent the web names set in $cfg{UsersWebName} and $cfg{SystemWebName}. For example:
Input | Return |
( '%USERSWEB%', 'Topic' ) | ( 'Main', 'Topic' ) |
( '%SYSTEMWEB%', 'Topic' ) | ( 'TWiki', 'Topic' ) |
( '', '%DOCWEB%.Topic' ) | ( 'TWiki', 'Topic' ) |
|
|
writeWarning( $text ) |
| getDataDir( ) -> $dir |
|
< < | DEPRECATED since 1.1 - use the content handling functions to manipulate topics instead |
> > | DEPRECATED since 1.1 - use the "Webs, Topics and Attachments" functions to manipulate topics instead |
| Get data directory (topic file root) |
| getPubDir( ) -> $dir |
|
< < | DEPRECATED since 1.1 - use the content handling functions to manipulateattachments instead |
> > | DEPRECATED since 1.1 - use the "Webs, Topics and Attachments" functions to manipulateattachments instead |
| Get pub directory (file attachment root). Attachments are in $dir/Web/TopicName |