Ignore:
Timestamp:
11/19/08 16:05:12 (4 years ago)
Author:
CrawfordCurrie
Message:

Item175: corrected references to TWiki in comments and error messages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/lib/Foswiki/Func.pm

    r809 r812  
    88%STARTINCLUDE% 
    99 
    10 _Official list of stable TWiki functions for Plugin developers_ 
     10_Official list of stable Foswiki functions for Plugin developers_ 
    1111 
    1212This module defines official functions that [[%SYSTEMWEB%.Plugins][Plugins]] 
    13 can use to interact with the TWiki engine and content. 
    14  
    15 Refer to TWiki.EmptyPlugin and lib/Foswiki/Plugins/EmptyPlugin.pm for a template Plugin and documentation on how to write a Plugin. 
     13can use to interact with the Foswiki engine and content. 
     14 
     15Refer to lib/Foswiki/Plugins/EmptyPlugin.pm for a template Plugin and documentation on how to write a Plugin. 
    1616 
    1717Plugins should *only* use functions published in this module. If you use 
    18 functions in other TWiki libraries you might create a security hole and 
    19 you will probably need to change your Plugin when you upgrade TWiki. 
     18functions in other Foswiki libraries you might create a security hole and 
     19you will probably need to change your Plugin when you upgrade Foswiki. 
    2020 
    2121Deprecated functions will still work in older code, though they should 
     
    2626of the Foswiki::Plugins module. 
    2727 
    28 Notes on use of =$Foswiki::Plugins::VERSION= (from TWiki 1.2 forwards): 
     28Notes on use of =$Foswiki::Plugins::VERSION=: 
    2929   * If the *major* version (e.g. =1.=) is the same then any plugin coded 
    3030     to use any *earlier* revision of the =1.= API will still work. No 
     
    329329 
    330330The context is a set of identifiers that are set 
    331 during specific phases of TWiki processing. For example, each of 
     331during specific phases of processing. For example, each of 
    332332the standard scripts in the 'bin' directory each has a context 
    333333identifier - the view script has 'view', the edit script has 'edit' 
     
    380380   * =$web= - new web 
    381381   * =$topic= - new topic 
    382 Change the TWiki context so it behaves as if it was processing =$web.$topic= 
     382Change the Foswiki context so it behaves as if it was processing =$web.$topic= 
    383383from now on. All the preferences will be reset to those of the new topic. 
    384384Note that if the new topic is not readable by the logged in user due to 
     
    420420---+++ popTopicContext() 
    421421 
    422 Returns the TWiki context to the state it was in before the 
     422Returns the Foswiki context to the state it was in before the 
    423423=pushTopicContext= was called. 
    424424 
     
    447447---+++ getPreferencesValue( $key, $web ) -> $value 
    448448 
    449 Get a preferences value from TWiki or from a Plugin 
     449Get a preferences value from Foswiki or from a Plugin 
    450450   * =$key= - Preferences key 
    451451   * =$web= - Name of web, optional. Current web if not specified; does not apply to settings of Plugin topics 
     
    463463      * =my $webColor = Foswiki::Func::getPreferencesValue( 'WEBBGCOLOR', 'Sandbox' );= 
    464464 
    465 *NOTE:* As of TWiki4.1, if =$NO_PREFS_IN_TOPIC= is enabled in the plugin, then 
     465*NOTE:* If =$NO_PREFS_IN_TOPIC= is enabled in the plugin, then 
    466466preferences set in the plugin topic will be ignored. 
    467467 
     
    492492*Since:* Foswiki::Plugins::VERSION 1.021 (27 Mar 2004) 
    493493 
    494 *NOTE:* As of TWiki4.1, if =$NO_PREFS_IN_TOPIC= is enabled in the plugin, then 
     494*NOTE:* If =$NO_PREFS_IN_TOPIC= is enabled in the plugin, then 
    495495preferences set in the plugin topic will be ignored. 
    496496 
     
    510510---+++ getPreferencesFlag( $key, $web ) -> $value 
    511511 
    512 Get a preferences flag from TWiki or from a Plugin 
     512Get a preferences flag from Foswiki or from a Plugin 
    513513   * =$key= - Preferences key 
    514514   * =$web= - Name of web, optional. Current web if not specified; does not apply to settings of Plugin topics 
     
    522522      * =my $showHelp = Foswiki::Func::getPreferencesFlag( "MYPLUGIN_SHOWHELP" );= 
    523523 
    524 *NOTE:* As of TWiki4.1, if =$NO_PREFS_IN_TOPIC= is enabled in the plugin, then 
     524*NOTE:* If =$NO_PREFS_IN_TOPIC= is enabled in the plugin, then 
    525525preferences set in the plugin topic will be ignored. 
    526526 
     
    546546*Since:* Foswiki::Plugins::VERSION 1.021 (27 Mar 2004) 
    547547 
    548 *NOTE:* As of TWiki4.1, if =$NO_PREFS_IN_TOPIC= is enabled in the plugin, then 
     548*NOTE:* If =$NO_PREFS_IN_TOPIC= is enabled in the plugin, then 
    549549preferences set in the plugin topic will be ignored. 
    550550 
     
    579579=pod 
    580580 
    581 ---+++ getWikiToolName( ) -> $name 
    582  
    583 Get toolname as defined in TWiki.cfg 
    584  
    585 Return: =$name= Name of tool, e.g. ='TWiki'= 
    586  
    587 *Since:* Foswiki::Plugins::VERSION 1.000 (27 Feb 2001) 
    588  
    589 =cut 
    590  
    591 sub getWikiToolName { 
    592     return $Foswiki::cfg{WikiToolName}; 
    593 } 
    594  
    595 =pod 
    596  
    597 ---+++ getMainWebname( ) -> $name 
    598  
    599 Get name of Main web as defined in TWiki.cfg 
    600  
    601 Return: =$name= Name, e.g. ='Main'= 
    602  
    603 *Since:* Foswiki::Plugins::VERSION 1.000 (27 Feb 2001) 
    604  
    605 =cut 
    606  
    607 sub getMainWebname { 
    608     return $Foswiki::cfg{UsersWebName}; 
    609 } 
    610  
    611 =pod 
    612  
    613 ---+++ getTwikiWebname( ) -> $name 
    614  
    615 Get name of TWiki documentation web as defined in TWiki.cfg 
    616  
    617 Return: =$name= Name, e.g. ='TWiki'= 
    618  
    619 *Since:* Foswiki::Plugins::VERSION 1.000 (27 Feb 2001) 
    620  
    621 =cut 
    622  
    623 sub getTwikiWebname { 
    624     return $Foswiki::cfg{SystemWebName}; 
    625 } 
    626  
    627 =pod 
    628  
    629581---++ User Handling and Access Control 
    630582---+++ getDefaultUserName( ) -> $loginName 
     
    646598   * =$user= can be a login, wikiname or web.wikiname 
    647599Return the cUID of the specified user. A cUID is a unique identifier which 
    648 is assigned by TWiki for each user. 
     600is assigned by Foswiki for each user. 
    649601BEWARE: While the default TopicUserMapping uses a cUID that looks like a user's 
    650602LoginName, some characters are modified to make them compatible with rcs. 
     
    776728---+++ userToWikiName( $loginName, $dontAddWeb ) -> $wikiName 
    777729Translate a login name to a Wiki name 
    778    * =$loginName=  - Login name, e.g. ='jdoe'=. Since TWiki 4.2.1 this may 
     730   * =$loginName=  - Login name, e.g. ='jdoe'=. This may 
    779731     also be a wiki name. This will normally be transparent, but may be 
    780732     relevant if you have login names that are also valid wiki names. 
     
    845797undef, returns the registered email addresses for the logged-in user. 
    846798 
    847 Since TWiki 4.2.1, $user may also be a login name, or the name of a group. 
     799$user may also be a login name, or the name of a group. 
    848800 
    849801*Since:* Foswiki::Plugins::VERSION 1.2 
     
    1029981---+++ isGroup( $group ) -> $boolean 
    1030982 
    1031 Checks if =$group= is the name of a group known to TWiki. 
     983Checks if =$group= is the name of a user group. 
    1032984 
    1033985=cut 
     
    10791031[[%SYSTEMWEB%.AccessControl]] rules 
    10801032   * =$type=     - Access type, required, e.g. ='VIEW'=, ='CHANGE'=. 
    1081    * =$id=  - WikiName of remote user, required, e.g. ="PeterThoeny"=. From 
    1082      TWiki 4.2.1, $id may also be a login name. 
     1033   * =$id=  - WikiName of remote user, required, e.g. ="RickShaw"=. 
     1034     $id may also be a login name. 
    10831035     If =$id= is '', 0 or =undef= then access is *always permitted*. 
    10841036   * =$text=     - Topic text, optional. If 'perl false' (undef, 0 or ''), 
     
    10871039      1 You are setting different access controls in the text to those defined 
    10881040      in the stored topic, 
    1089       1 You already have the topic text in hand, and want to help TWiki avoid 
     1041      1 You already have the topic text in hand, and want to help avoid 
    10901042        having to read it again, 
    10911043      1 You are providing a =$meta= parameter. 
     
    11001052 
    11011053*Note* the weird parameter order is due to compatibility constraints with 
    1102 earlier TWiki releases. 
     1054earlier releases. 
    11031055 
    11041056*Tip* if you want, you can use this method to check your own access control types. For example, if you: 
     
    19361888list of loaded templates, overwriting any previous definition. 
    19371889 
    1938 How TWiki searches for templates is described in SkinTemplates. 
     1890How Foswiki searches for templates is described in SkinTemplates. 
    19391891 
    19401892If template text is found, extracts include statements and fully expands them. 
     
    19581910 
    19591911A template is defined using a %TMPL:DEF% statement in a template 
    1960 file. See the documentation on TWiki templates for more information. 
     1912file. See the documentation on Foswiki templates for more information. 
    19611913 
    19621914=cut 
     
    20021954The =$passthru= parameter allows you to pass the parameters that were passed 
    20031955to the current query on to the target URL, as long as it is another URL on the 
    2004 same TWiki installation. If =$passthru= is set to a true value, then TWiki 
     1956same installation. If =$passthru= is set to a true value, then Foswiki 
    20051957will save the current URL parameters, and then try to restore them on the 
    20061958other side of the redirect. Parameters are stored on the server in a cache 
     
    20181970</verbatim> 
    20191971=$passthru= does nothing if =$url= does not point to a script in the current 
    2020 TWiki installation. 
     1972Foswiki installation. 
    20211973 
    20221974*Since:* Foswiki::Plugins::VERSION 1.000 (7 Dec 2002) 
     
    20391991   * =$header= - the HTML to be added to the <head> section. The HTML must be valid in a HEAD tag - no checks are performed. 
    20401992   * =requires= optional, comma-separated list of id's of other head blocks this one depends on. 
    2041     
    2042 All TWiki variables present in =$header= will be expanded before being inserted into the =<head>= section. 
     1993 
     1994All macros present in =$header= will be expanded before being inserted into the =<head>= section. 
    20431995 
    20441996Note that this is _not_ the same as the HTTP header, which is modified through the Plugins =modifyHeaderHandler=. 
     
    20892041---+++ renderText( $text, $web ) -> $text 
    20902042 
    2091 Render text from TWiki markup into XHTML as defined in [[%SYSTEMWEB%.TextFormattingRules]] 
     2043Render text from TML into XHTML as defined in [[%SYSTEMWEB%.TextFormattingRules]] 
    20922044   * =$text= - Text to render, e.g. ='*bold* text and =fixed font='= 
    20932045   * =$web=  - Web name, optional, e.g. ='Main'=. The current web is taken if missing 
     
    21102062 
    21112063Render topic name and link label into an XHTML link. Normally you do not need to call this funtion, it is called internally by =renderText()= 
    2112    * =$pre=        - Text occuring before the TWiki link syntax, optional 
     2064   * =$pre=        - Text occuring before the link syntax, optional 
    21132065   * =$web=        - Web name, required, e.g. ='Main'= 
    21142066   * =$topic=      - Topic name to link to, required, e.g. ='WebNotify'= 
     
    21822134returns a single email address, where a user may in fact have several. 
    21832135 
    2184 Since TWiki 4.2.1, $wikiName may also be a login name. 
     2136$wikiName may also be a login name. 
    21852137 
    21862138=cut 
     
    22382190---++ Special handlers 
    22392191 
    2240 Special handlers can be defined to make functions in plugins behave as if they were built-in to TWiki. 
     2192Special handlers can be defined to make functions in plugins behave as if they were built-in. 
    22412193 
    22422194=cut 
     
    22482200Should only be called from initPlugin. 
    22492201 
    2250 Register a function to handle a simple variable. Handles both %<nop>VAR% and %<nop>VAR{...}%. Registered variables are treated the same as TWiki internal variables, and are expanded at the same time. This is a _lot_ more efficient than using the =commonTagsHandler=. 
     2202Register a function to handle a simple variable. Handles both %<nop>VAR% and %<nop>VAR{...}%. Registered variables are treated the same as internal macros, and are expanded at the same time. This is a _lot_ more efficient than using the =commonTagsHandler=. 
    22512203   * =$var= - The name of the variable, i.e. the 'MYVAR' part of %<nop>MYVAR%. The variable name *must* match /^[A-Z][A-Z0-9_]*$/ or it won't work. 
    22522204   * =\&fn= - Reference to the handler function. 
    2253    * =$syntax= can be 'classic' (the default) or 'context-free'. 'classic' syntax is appropriate where you want the variable to support classic TWiki syntax i.e. to accept the standard =%<nop>MYVAR{ "unnamed" param1="value1" param2="value2" }%= syntax, as well as an unquoted default parameter, such as =%<nop>MYVAR{unquoted parameter}%=. If your variable will only use named parameters, you can use 'context-free' syntax, which supports a more relaxed syntax. For example, %MYVAR{param1=value1, value 2, param3="value 3", param4='value 5"}% 
     2205   * =$syntax= can be 'classic' (the default) or 'context-free'. 'classic' syntax is appropriate where you want the variable to support classic syntax i.e. to accept the standard =%<nop>MYVAR{ "unnamed" param1="value1" param2="value2" }%= syntax, as well as an unquoted default parameter, such as =%<nop>MYVAR{unquoted parameter}%=. If your variable will only use named parameters, you can use 'context-free' syntax, which supports a more relaxed syntax. For example, %MYVAR{param1=value1, value 2, param3="value 3", param4='value 5"}% 
    22542206 
    22552207*Since:* Foswiki::Plugins::VERSION 1.1 
     
    22602212</verbatim> 
    22612213where: 
    2262    * =\%session= - a reference to the TWiki session object (may be ignored) 
     2214   * =\%session= - a reference to the session object (may be ignored) 
    22632215   * =\%params= - a reference to a Foswiki::Attrs object containing parameters. This can be used as a simple hash that maps parameter names to values, with _DEFAULT being the name for the default parameter. 
    22642216   * =$topic= - name of the topic in the query 
     
    22842236=%<nop>EXEC{"ps -Af" silent="on"}%= 
    22852237 
    2286 Registered tags differ from tags implemented using the old TWiki approach (text substitution in =commonTagsHandler=) in the following ways: 
     2238Registered tags differ from tags implemented using the old approach (text substitution in =commonTagsHandler=) in the following ways: 
    22872239   * 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). 
    22882240   * registered tag names can only contain alphanumerics and _ (underscore) 
     
    23282280</verbatim> 
    23292281where: 
    2330    * =\%session= - a reference to the TWiki session object (may be ignored) 
     2282   * =\%session= - a reference to the Foswiki session object (may be ignored) 
    23312283 
    23322284From the REST interface, the name of the plugin must be used 
     
    23792331---+++ decodeFormatTokens($str) -> $unencodedString 
    23802332 
    2381 TWiki has an informal standard set of tokens used in =format= 
     2333Foswiki has an informal standard set of tokens used in =format= 
    23822334parameters that are used to block evaluation of paramater strings. 
    23832335For example, if you were to write 
     
    23862338 
    23872339then %<nop>WURBLE would be expanded *before* %<NOP>MYTAG is evaluated. To avoid 
    2388 this TWiki uses escapes in the format string. For example: 
     2340this Foswiki uses escapes in the format string. For example: 
    23892341 
    23902342=%<nop>MYTAG{format="$percntWURBLE$percnt"}%= 
    23912343 
    23922344This lets you enter arbitrary strings into parameters without worrying that 
    2393 TWiki will expand them before your plugin gets a chance to deal with them 
     2345Foswiki will expand them before your plugin gets a chance to deal with them 
    23942346properly. Once you have processed your tag, you will want to expand these 
    23952347tokens to their proper value. That's what this function does. 
     
    24682420 
    24692421Gets a private directory for Plugin use. The Plugin is entirely responsible 
    2470 for managing this directory; TWiki will not read from it, or write to it. 
     2422for managing this directory; Foswiki will not read from it, or write to it. 
    24712423 
    24722424The directory is guaranteed to exist, and to be writable by the webserver 
     
    25462498---+++ getRegularExpression( $name ) -> $expr 
    25472499 
    2548 Retrieves a TWiki predefined regular expression or character class. 
     2500Retrieves a Foswiki predefined regular expression or character class. 
    25492501   * =$name= - Name of the expression to retrieve.  See notes below 
    25502502Return: String or precompiled regular expression matching as described below. 
     
    25522504*Since:* Foswiki::Plugins::VERSION 1.020 (9 Feb 2004) 
    25532505 
    2554 __Note:__ TWiki internally precompiles several regular expressions to 
     2506__Note:__ Foswiki internally precompiles several regular expressions to 
    25552507represent various string entities in an <nop>I18N-compatible manner. Plugins 
    25562508authors are encouraged to use these in matching where appropriate. The 
    25572509following are guaranteed to be present. Others may exist, but their use 
    2558 is unsupported and they may be removed in future TWiki versions. 
     2510is unsupported and they may be removed in future Foswiki versions. 
    25592511 
    25602512In the table below, the expression marked type 'String' are intended for 
     
    26202572| *Input*                               | *Return* | 
    26212573| <tt>( '%<nop>USERSWEB%', 'Topic' )</tt>     | <tt>( 'Main', 'Topic' ) </tt>  | 
    2622 | <tt>( '%<nop>SYSTEMWEB%', 'Topic' )</tt>    | <tt>( 'TWiki', 'Topic' ) </tt>  | 
    2623 | <tt>( '', '%<nop>DOCWEB%.Topic' )</tt>    | <tt>( 'TWiki', 'Topic' ) </tt>  | 
     2574| <tt>( '%<nop>SYSTEMWEB%', 'Topic' )</tt>    | <tt>( 'System', 'Topic' ) </tt>  | 
     2575| <tt>( '', '%<nop>DOCWEB%.Topic' )</tt>    | <tt>( 'System', 'Topic' ) </tt>  | 
    26242576 
    26252577=cut 
     
    28332785---++ Deprecated functions 
    28342786 
    2835 From time-to-time, the TWiki developers will add new functions to the interface (either to TWikiFuncDotPm, or new handlers). Sometimes these improvements mean that old functions have to be deprecated to keep the code manageable. When this happens, the deprecated functions will be supported in the interface for at least one more TWiki release, and probably longer, though this cannot be guaranteed. 
    2836  
    2837 Updated plugins may still need to define deprecated handlers for compatibility with old TWiki versions. In this case, the plugin package that defines old handlers can suppress the warnings in %<nop>FAILEDPLUGINS%. 
     2787From time-to-time, the Foswiki developers will add new functions to the interface (either to =Foswiki::Func=, or new handlers). Sometimes these improvements mean that old functions have to be deprecated to keep the code manageable. When this happens, the deprecated functions will be supported in the interface for at least one more release, and probably longer, though this cannot be guaranteed. 
     2788 
     2789Updated plugins may still need to define deprecated handlers for compatibility with old Foswiki versions. In this case, the plugin package that defines old handlers can suppress the warnings in %<nop>FAILEDPLUGINS%. 
    28382790 
    28392791This is done by defining a map from the handler name to the =Foswiki::Plugins= version _in which the handler was first deprecated_. For example, if we need to define the =endRenderingHandler= for compatibility with =Foswiki::Plugins= versions before 1.1, we would add this to the plugin: 
    28402792<verbatim> 
    28412793package Foswiki::Plugins::SinkPlugin; 
    2842 use vars qw( %TWikiCompatibility ); 
    2843 $TWikiCompatibility{endRenderingHandler} = 1.1; 
    2844 </verbatim> 
    2845 If the currently-running TWiki version is 1.1 _or later_, then the _handler will not be called_ and _the warning will not be issued_. TWiki with versions of =Foswiki::Plugins= before 1.1 will still call the handler as required. 
     2794use vars qw( %FoswikiCompatibility ); 
     2795$FoswikiCompatibility{endRenderingHandler} = 1.1; 
     2796</verbatim> 
     2797If the currently-running code version is 1.1 _or later_, then the _handler will not be called_ and _the warning will not be issued_. TWiki with versions of =Foswiki::Plugins= before 1.1 will still call the handler as required. 
    28462798 
    28472799The following functions are retained for compatibility only. You should 
     
    28542806*DEPRECATED* since 1.1 - use =getScriptUrl= instead. 
    28552807 
    2856 Return: =$path= URL path of TWiki scripts, e.g. ="/cgi-bin"= 
     2808Return: =$path= URL path of bin scripts, e.g. ="/cgi-bin"= 
    28572809 
    28582810*WARNING:* you are strongly recommended *not* to use this function, as the 
     
    28682820    return $Foswiki::Plugins::SESSION->getScriptUrl( 0, '' ); 
    28692821} 
     2822 
     2823 
     2824=pod 
     2825 
     2826---+++ getWikiToolName( ) -> $name 
     2827 
     2828*DEPRECATED* in Foswiki; use $Foswiki::cfg{WikiToolName} instead 
     2829 
     2830=cut 
     2831 
     2832sub getWikiToolName { return $Foswiki::cfg{WikiToolName}; } 
     2833 
     2834=pod 
     2835 
     2836---+++ getMainWebname( ) -> $name 
     2837 
     2838*DEPRECATED* in Foswiki; use $Foswiki::cfg{UsersWebName} instead 
     2839 
     2840=cut 
     2841 
     2842sub getMainWebname { return $Foswiki::cfg{UsersWebName}; } 
     2843 
     2844=pod 
     2845 
     2846---+++ getTwikiWebname( ) -> $name 
     2847 
     2848*DEPRECATED* in Foswiki; use $Foswiki::cfg{SystemWebName} instead 
     2849 
     2850=cut 
     2851 
     2852sub getTwikiWebname { return $Foswiki::cfg{SystemWebName}; } 
    28702853 
    28712854=pod 
     
    28802863Return: =$url=                     URL, e.g. ="http://example.com:80/cgi-bin/oops.pl/ Main/WebNotify?template=oopslocked&amp;param1=joe"= 
    28812864 
    2882 *DEPRECATED* since 1.1, the recommended approach is to throw an [[TWikiOopsExceptionDotPm][oops exception]]. 
     2865*DEPRECATED* since 1.1, the recommended approach is to throw an oops exception. 
    28832866<verbatim> 
    28842867   use Error qw( :try ); 
     
    29642947*DEPRECATED* since 1.1 - use =getListOfWebs= instead. 
    29652948 
    2966 Get list of all public webs, e.g. all webs that do not have the =NOSEARCHALL= flag set in the WebPreferences 
    2967  
    2968 Return: =@webs= List of all public webs, e.g. =( 'Main',  'Know', 'TWiki' )= 
     2949Get list of all public webs, e.g. all webs *and subwebs* that do not have the =NOSEARCHALL= flag set in the WebPreferences 
     2950 
     2951Return: =@webs= List of all public webs *and subwebs* 
    29692952 
    29702953*Since:* Foswiki::Plugins::VERSION 1.000 (07 Dec 2002) 
     
    30092992*DEPRECATED* since 1.1 - use the "Webs, Topics and Attachments" functions to manipulate topics instead 
    30102993 
    3011 Get data directory (topic file root) 
    3012  
    3013 Return: =$dir= Data directory, e.g. ='/twiki/data'= 
    3014  
    3015 This function violates store encapsulation and is therefore *deprecated*. 
    3016  
    3017 *Since:* Foswiki::Plugins::VERSION 1.000 (07 Dec 2002) 
    3018  
    30192994=cut 
    30202995 
     
    30293004*DEPRECATED* since 1.1 - use the "Webs, Topics and Attachments" functions to manipulateattachments instead 
    30303005 
    3031 Get pub directory (file attachment root). Attachments are in =$dir/Web/TopicName= 
    3032  
    3033 Return: =$dir= Pub directory, e.g. ='/htdocs/twiki/pub'= 
    3034  
    3035 This function violates store encapsulation and is therefore *deprecated*. 
    3036  
    3037 Use =readAttachment= and =saveAttachment= instead. 
    3038  
    3039 *Since:* Foswiki::Plugins::VERSION 1.000 (07 Dec 2002) 
    3040  
    3041 =cut 
    3042  
    3043 sub getPubDir { 
    3044     return $Foswiki::cfg{PubDir}; 
    3045 } 
    3046  
    3047 =pod 
    3048  
    3049 ---+++ checkDependencies( $moduleName, $dependenciesRef ) -> $error 
    3050  
    3051 *DEPRECATED* since 1.1 - use TWiki:Plugins.BuildContrib and define DEPENDENCIES that can be statically 
    3052 evaluated at install time instead. It is a lot more efficient. 
    3053  
    3054 *Since:* Foswiki::Plugins::VERSION 1.025 (01 Aug 2004) 
    3055  
    3056 =cut 
    3057  
     3006=cut 
     3007 
     3008sub getPubDir { return $Foswiki::cfg{PubDir}; } 
     3009 
     3010# Removed; it was never used 
    30583011sub checkDependencies { 
    3059     my ( $context, $deps ) = @_; 
    3060     my $report = ''; 
    3061     my $depsOK = 1; 
    3062     foreach my $dep (@$deps) { 
    3063         my ( $ok, $ver ) = ( 1, 0 ); 
    3064         my $msg   = ''; 
    3065         my $const = ''; 
    3066  
    3067         eval "require $dep->{package}"; 
    3068         if ($@) { 
    3069             $msg .= "it could not be found: $@"; 
    3070             $ok = 0; 
    3071         } 
    3072         else { 
    3073             if ( defined( $dep->{constraint} ) ) { 
    3074                 $const = $dep->{constraint}; 
    3075                 eval "\$ver = \$$dep->{package}::VERSION;"; 
    3076                 if ($@) { 
    3077                     $msg .= "the VERSION of the package could not be found: $@"; 
    3078                     $ok = 0; 
    3079                 } 
    3080                 else { 
    3081                     eval "\$ok = ( \$ver $const )"; 
    3082                     if ( $@ || !$ok ) { 
    3083                         $msg .= " $ver is currently installed: $@"; 
    3084                         $ok = 0; 
    3085                     } 
    3086                 } 
    3087             } 
    3088         } 
    3089         unless ($ok) { 
    3090             $report .= 
    3091 "WARNING: $dep->{package}$const is required for $context, but $msg\n"; 
    3092             $depsOK = 0; 
    3093         } 
    3094     } 
    3095     return undef if ($depsOK); 
    3096  
    3097     return $report; 
     3012    die "checkDependencies removed; contact plugin author or maintainer and tell them to use BuildContrib DEPENDENCIES instead"; 
    30983013} 
    30993014 
     
    31203035 
    31213036As per the GPL, removal of this notice is prohibited. 
    3122  
    3123 ---++ API History 
    3124  
    3125 ---+++ twiki-20010901-release (Athens) 
    3126 $Foswiki::Plugins::VERSION 1.000 
    3127 ---++++ EmptyPlugin.pm 
    3128    * =commonTagsHandler($text, $topic, $web)= 
    3129    * =endRenderingHandler($text)= 
    3130    * =outsidePREHandler($text)= 
    3131    * =insidePREHandler($text)= 
    3132    * =startRenderingHandler($text, $web)= 
    3133 ---++++ Func.pm 
    3134    * =checkAccessPermission($type, $login, $topicText, $topicName, $webName) -> $boolean= 
    3135    * =expandCommonVariables($text, $topic, $web) -> $text= 
    3136    * =extractNameValuePair($attrs, $name) -> $value= 
    3137    * =formatGmTime($time) -> $text= 
    3138    * =getCgiQuery() -> $query= 
    3139    * =getDataDir() -> $dir= 
    3140    * =getDefaultUserName() -> $loginName= 
    3141    * =getMainWebname() -> $name= 
    3142    * =getOopsUrl($web, $topic, $template, @theParams) -> $url= 
    3143    * =getPreferencesFlag($key) -> $boolean= 
    3144    * =getPreferencesValue($key, $web) -> $value= 
    3145    * =getPublicWebList() -> @webs= 
    3146    * =getPubDir() -> $dir= 
    3147    * =getPubUrlPath() -> $path= 
    3148    * =getRevisionInfo($webName, $topic, $rev, $attachment) -> ($date, $user, $rev, $comment)= 
    3149    * =getScriptUrl($web, $topic, $script) -> $url= 
    3150    * =getScriptUrlPath() -> $path= 
    3151    * =getSessionValue($key) -> $value= 
    3152    * =getSkin() -> $skin= 
    3153    * =getTopicList($web) -> @topics= 
    3154    * =getTwikiWebname() -> $name= 
    3155    * =getUrlHost() -> $host= 
    3156    * =getViewUrl($web, $topic) -> $url= 
    3157    * =getWikiName() -> $wikiName= 
    3158    * =getWikiUserName($text) -> $wikiName= 
    3159    * =getWikiToolName() -> $name= 
    3160    * =internalLink($preamble, $web, $topic, $linkText, $anchor, $createLink) -> $text= 
    3161    * =isGuest() -> $boolean= 
    3162    * =permissionsSet($web) -> $boolean= 
    3163    * =readFile($filename) -> $text= 
    3164    * =readTemplate($name, $skin) -> $text= 
    3165    * =readTopic($webName, $topic) -> ($meta, $text)= 
    3166    * =redirectCgiQuery($query, $url)= 
    3167    * =renderText($text, $web) -> $text= 
    3168    * =saveFile($filename, $text)= 
    3169    * =setSessionValue($key, $value)= 
    3170    * =topicExists($web, $topic) -> $boolean= 
    3171    * =userToWikiName($user, $dontAddWeb) -> $wikiName= 
    3172    * =webExists($web) -> $boolean= 
    3173    * =wikiToUserName($wiki) -> $loginName= 
    3174    * =writeDebug($text)= 
    3175    * =writeHeader($query)= 
    3176    * =writeWarning($text)= 
    3177  
    3178 ---+++ TWikiRelease01Feb2003 (Beijing) 
    3179 $Foswiki::Plugins::VERSION 1.010 
    3180 ---++++ EmptyPlugin.pm 
    3181    * =afterEditHandler($text, $topic, $web)= 
    3182    * =beforeEditHandler($text, $topic, $web)= 
    3183    * =beforeSaveHandler($text, $topic, $web)= 
    3184    * =initializeUserHandler($loginName, $url, $pathInfo)= 
    3185    * =redirectCgiQueryHandler($query, $url)= 
    3186    * =registrationHandler($web, $wikiName, $loginName)= 
    3187    * =writeHeaderHandler($query)= 
    3188 ---++++ Func.pm 
    3189    * =checkTopicEditLock($web, $topic) ->($oopsUrl, $loginName, $unlockTime)= 
    3190    * =readTopicText($web, $topic, $rev, $ignorePermissions) -> $text= 
    3191    * =saveTopicText($web, $topic, $text, $ignorePermissions, $dontNotify) -> $oopsUrl= 
    3192    * =setTopicEditLock($web, $topic, $lock) -> $oopsUrl= 
    3193  
    3194 ---+++ twiki-20040902-release (Cairo) 
    3195 $Foswiki::Plugins::VERSION 1.025 
    3196 ---++++ EmptyPlugin.pm 
    3197    * =afterCommonTagsHandler($text, $topic, $web)= 
    3198    * =afterSaveHandler($text, $topic, $web, $error)= 
    3199    * =beforeCommonTagsHandler($text, $topic, $web)= 
    3200    * =earlyInitPlugin()= 
    3201 ---++++ Func.pm 
    3202    * =afterAttachmentSaveHandler(\%attrHash, $topic, $web, $error)= 
    3203    * =beforeAttachmentSaveHandler(\%attrHash, $topic, $web)= 
    3204    * =checkDependencies($moduleName, $dependenciesRef) -> $error= 
    3205    * =extractParameters($attr) -> %params= 
    3206    * =formatTime($time, $format, $timezone) -> $text= 
    3207    * =getPluginPreferencesFlag($key) -> $boolean= 
    3208    * =getPluginPreferencesValue($key) -> $value= 
    3209    * =getRegularExpression($regexName) -> $pattern= 
    3210  
    3211 ---+++ TWikiRelease04x00x00 (Dakar) 
    3212 $Foswiki::Plugins::VERSION 1.1 
    3213 ---++++ EmptyPlugin.pm 
    3214    * =mergeHandler($diff, $old, $new, \%info) -> $text= 
    3215    * =modifyHeaderHandler(\%headers, $query)= 
    3216    * =postRenderingHandler($text)= 
    3217    * =preRenderingHandler($text, \%map)= 
    3218    * =renderFormFieldForEditHandler($name, $type, $size, $value, $attributes, $possibleValues) -> $html= 
    3219    * =renderWikiWordHandler($linkText, $hasExplicitLinkLabel, $web, $topic) -> $linkText= 
    3220  
    3221    * <strike> =endRenderingHandler($text)= </strike> 
    3222    * <strike> =startRenderingHandler($text, $web)= </strike> 
    3223 ---++++ Func.pm 
    3224    * =addToHEAD($id, $header)= 
    3225    * =attachmentExists($web, $topic, $attachment) -> $boolean= 
    3226    * =clearSessionValue($key) -> $boolean= 
    3227    * =checkDependencies($moduleName, $dependenciesRef) -> $error= 
    3228    * =createWeb($newWeb, $baseWeb, $opts)= 
    3229    * =expandTemplate($def ) -> $string= 
    3230    * =expandVariablesOnTopicCreation($text) -> $text= 
    3231    * =getContext() -> \%hash= 
    3232    * =getListOfWebs($filter) -> @webs= 
    3233    * =getScriptUrl($web, $topic, $script, @params) -> $url= 
    3234    * =getRevisionAtTime($web, $topic, $time) -> $rev= 
    3235    * =getWorkArea($pluginName) -> $directorypath= 
    3236    * =isValidWikiWord($text) -> $boolean= 
    3237    * =loadTemplate($name, $skin, $web) -> $text= 
    3238    * =moveAttachment($web, $topic, $attachment, $newWeb, $newTopic, $newAttachment)= 
    3239    * =moveTopic($web, $topic, $newWeb, $newTopic)= 
    3240    * =moveWeb($oldName, $newName)= 
    3241    * =normalizeWebTopicName($web, $topic) ->($web, $topic)= 
    3242    * =readAttachment($web, $topic, $name, $rev) -> $data= 
    3243    * =registerRESTHandler($alias, \&fn,)= 
    3244    * =registerTagHandler($var, \&fn, $syntax)= 
    3245    * =saveAttachment($web, $topic, $attachment, $opts)= 
    3246    * =saveTopic($web, $topic, $meta, $text, $options) -> $error= 
    3247    * =searchInWebContent($searchString, $web, \@topics, \%options) -> \%map= 
    3248    * =sendEmail($text, $retries) -> $error= 
    3249    * =wikiToEmail($wikiName) -> $email= 
    3250    * =writeHeader($query, $contentLength)= 
    3251  
    3252    * <strike> =checkDependencies($moduleName, $dependenciesRef) -> $error= </strike> 
    3253    * <strike> =formatGmTime($time, $format) -> $text= </strike> 
    3254    * <strike> =getDataDir() -> $dir= </strike> 
    3255    * <strike> =getOopsUrl( $web, $topic, $template, @params ) -> $url= </strike> 
    3256    * <strike> =getPubDir() -> $dir= </strike> 
    3257    * <strike> =getPublicWebList() -> @webs= </strike> 
    3258    * <strike> =getScriptUrlPath() -> $path= </strike> 
    3259  
    3260 ---+++ TWikiRelease04x00x01 
    3261 $Foswiki::Plugins::VERSION 1.1 
    3262 ---++++ EmptyPlugin.pm 
    3263    * =afterSaveHandler($text, $topic, $web, $error, $meta)= 
    3264    * =beforeSaveHandler($text, $topic, $web, $meta)= 
    3265 ---++++ Func.pm 
    3266  
    3267 ---+++ TWikiRelease04x01x00 
    3268 $Foswiki::Plugins::VERSION 1.11 
    3269 ---++++ EmptyPlugin.pm 
    3270    * =afterRenameHandler($oldWeb, $oldTopic, $oldAttachment, $newWeb, $newTopic, $newAttachment)= 
    3271 ---++++ Func.pm 
    3272 No changes 
    3273  
    3274 ---+++ TWikiRelease04x02x00 
    3275 $Foswiki::Plugins::VERSION 1.2 
    3276 ---++++ EmptyPlugin.pm 
    3277    * =afterCommonTagsHandler($text, $topic, $web, $meta)= 
    3278    * =beforeCommonTagsHandler($text, $topic, $web, $meta)= 
    3279    * =commonTagsHandler($text, $topic, $web, $included, $meta)= 
    3280 ---++++ Func.pm 
    3281    * =decodeFormatTokens($str) -> $unencodedString= 
    3282    * =eachChangeSince($web, $time) -> $iterator= 
    3283    * =eachGroup() -> $iterator= 
    3284    * =eachGroupMember($group) -> $iterator= 
    3285    * =eachMembership($wikiname) -> $iterator= 
    3286    * =eachUser() -> $iterator= 
    3287    * =emailToWikiNames($email, $dontAddWeb) -> @wikiNames= 
    3288    * =expandCommonVariables($text, $topic, $web, $meta) -> $text= 
    3289    * =getCanonicalUserID( $user ) -> $cUID= 
    3290    * =getExternalResource($url) -> $response= 
    3291    * =getSessionKeys() -> @keys= 
    3292    * =isAnAdmin($login) -> $boolean= 
    3293    * =isGroup($group) -> $boolean= 
    3294    * =isGroupMember($group, $login) -> $boolean= 
    3295    * =isTrue($value, $default) -> $boolean= 
    3296    * =popTopicContext()= 
    3297    * =pushTopicContext($web, $topic)= 
    3298    * =sanitizeAttachmentName($fname) -> ($fileName, $origName)= 
    3299    * =setPreferencesValue($name, $val)= 
    3300    * =spaceOutWikiWord($word, $sep) -> $text= 
    3301    * =wikiNameToEmails($wikiname) -> @emails= 
    3302    * <strike> =permissionsSet($web) -> $boolean= </strike> 
    3303    * <strike> =getOopsUrl( $web, $topic, $template, $param1, $param2, $param3, $param4 ) -> $url= </strike> 
    3304  
Note: See TracChangeset for help on using the changeset viewer.