...
Line: 308 to 308 | ||||||||
---|---|---|---|---|---|---|---|---|
Added: | ||||||||
> > | ObjectMethod determineWebTopic ($pathInfo,$web,$topic) -> ($web,$topic,$requestedWeb)Determine the web and topic names from PATH_INFO and web and topic names explicitly provided. And then sanitize them. | |||||||
ClassMethod new ($loginName,$query,\%initialContext)Constructs a new TWiki object. Parameters are taken from the query object. | ||||||||
Line: 557 to 565 | ||||||||
StaticMethod spaceOutWikiWord ($word,$sep) -> $string | ||||||||
Changed: | ||||||||
< < | Spaces out a wiki word by inserting a string (default: one space) between each word component. With parameter $sep any string may be used as separator between the word components; if $sep is undefined it defaults to a space. | |||||||
> > | Spaces out a wiki word by inserting a string between each word component. Word component boundaries are transitions from lowercase to uppercase or numeric, from numeric to uppercase or lowercase, and from uppercase to numeric characters. Parameter $sep defines the separator between the word components, the default is a space. Example: "ABC2015ProjectCharter" results in "ABC 2015 Project Charter" | |||||||
Line: 710 to 723 | ||||||||
Added: | ||||||||
> > | StaticMethod suffixToMimeType ($filename) -> $mimeTypeReturns the MIME type corresponding to the extension of the $filename based on the file specified by {MimeTypesFileName}. If there is no extension or the extension is not found in the {MimeTypesFileName} file, 'text/plain' is returned. | |||||||
StaticMethod expandStandardEscapes ($str) -> $unescapedStrExpands standard escapes used in parameter values to block evaluation. The following escapes |
Line: 9 to 9 | ||||||||
---|---|---|---|---|---|---|---|---|
Global variables are avoided wherever possible to avoid problems with CGI accelerators such as mod_perl. | ||||||||
Changed: | ||||||||
< < | Public Data members | |||||||
> > | Public Data members | |||||||
| ||||||||
Line: 54 to 54 | ||||||||
Changed: | ||||||||
< < | ObjectMethod writeCompletePage ($text,$pageType,$contentType) | |||||||
> > | ObjectMethod writeCompletePage ($text,$pageType,$contentType,$status) | |||||||
Write a complete HTML page with basic header to the browser.
| ||||||||
Line: 62 to 62 | ||||||||
caching for 24 hours, to prevent BackFromPreviewLosesText bug, which caused
data loss with IE5 and IE6.
| ||||||||
Added: | ||||||||
> > |
| |||||||
This method removes noautolink and nop tags before outputting the page unless $contentType is text/plain. | ||||||||
Changed: | ||||||||
< < | ObjectMethod generateHTTPHeaders ($pageType,$contentType,$contentLength) -> $header | |||||||
> > | ObjectMethod generateHTTPHeaders ($pageType,$contentType,$status) -> $header | |||||||
All parameters are optional.
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Implements the post-Dec2001 release plugin API, which requires the writeHeaderHandler in plugin to return a string of HTTP headers, CR/LF | ||||||||
Line: 91 to 92 | ||||||||
Changed: | ||||||||
< < | ObjectMethod redirect ($url,$passthrough,$action_redirectto) | |||||||
> > | ObjectMethod redirect ($url,$passthrough,$action_redirectto,$viaCache) | |||||||
| ||||||||
Added: | ||||||||
> > |
| |||||||
Redirects the request to $url , unless
| ||||||||
Line: 116 to 119 | ||||||||
over a cache reference in the redirect GET. NOTE: Passthrough is only meaningful if the redirect target is on the same | ||||||||
Changed: | ||||||||
< < | server. | |||||||
> > | server. "$viaCache" is meaningful only if "$action_redirectto" is false and "$passthru" is true. | |||||||
Line: 161 to 165 | ||||||||
Changed: | ||||||||
< < | ObjectMethod readOnlyMirrorWeb ($theWeb) -> ($mirrorSiteName,$mirrorViewURL,$mirrorLink,$mirrorNote)If this is a mirrored web, return information about the mirror. The info is returned in a quadruple: | |||||||
> > | ObjectMethod modeAndMaster ($web)Returns the following hash reference such as this:('', undef) | |||||||
Changed: | ||||||||
< < |
| |||||||
> > | and this:
('slave', { # master site data siteName => 'na', webScriptUrlTmpl => 'http://twiki.example.com/cgi-bin//Web', scriptSuffix => '', webViewUrl => 'http://twiki.example.com/Web', }) | |||||||
Added: | ||||||||
> > | The first value is the mode of the web: either 'local', 'master', 'slave', or 'read-only'. The second value is defined only when the master site is defined for the web. | |||||||
ObjectMethod getSkin () -> $string | ||||||||
Line: 185 to 201 | ||||||||
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 | ||||||||
Changed: | ||||||||
< < | .../view/x/y?a=1&b=2#XXX | |||||||
> > | .../view/x/y?a=1&b=2#XXX | |||||||
If $absolute is set, generates an absolute URL. $absolute is advisory only; TWiki can decide to generate absolute URLs (for example when run from the | ||||||||
Line: 203 to 219 | ||||||||
(including web and topic). Otherwise will generate only up to the script name. An undefined web will default to the main web name. | ||||||||
Added: | ||||||||
> > | The returned URL takes ReadOnlyAndMirrorWebs into account.
If the specified $web is slave on this site, with the scripts
edit , save , attach , upload , and rename , this method returns
the URLs on the master site because it does not make sense to execute
those scripts on the master site of the web.
Even with the other scripts, you may need to get the URLs on the master site.
You can get those URLs by providing $master => 1 as a name value pair.
ObjectMethod getDiskInfo ($web,$site,$diskID) -> ($dataDir,$pubDir,$diskID)You can specify either $web or $diskID, not both.ObjectMethod getDiskList () -> ('',1,2,...)ObjectMethod getDataDir ($web,$diskID) -> $dataDirYou can specify either $web or $diskID, not both.ObjectMethod getPubDir ($web,$diskID) -> $pubDirYou can specify either $web or $diskID, not both. | |||||||
ObjectMethod getPubUrl ($absolute,$web,$topic,$attachment) -> $url | ||||||||
Line: 502 to 548 | ||||||||
Added: | ||||||||
> > | StaticMethod topLevelWeb ($web) -> toplevelwebof$webIf $web is a top level web, it returns $web. If $web is a subweb, it returns the top level web of $web. | |||||||
StaticMethod spaceOutWikiWord ($word,$sep) -> $stringSpaces out a wiki word by inserting a string (default: one space) between each word component. | ||||||||
Line: 623 to 676 | ||||||||
Changed: | ||||||||
< < | %<nop}RENDERHEAD% | |||||||
> > | %RENDERHEAD% | |||||||
== should be written where you want the sorted head tags to be generated. This will normally be in a template. The variable expands to a sorted list of the head blocks added up to the point the RENDERHEAD variable is expanded. Each expanded head block is preceded by an HTML comment that records the ID of the head block.
Head blocks are sorted to satisfy all their requires constraints. | ||||||||
Line: 666 to 719 | ||||||||
| ||||||||
Added: | ||||||||
> > |
| |||||||
|
Line: 387 to 387 | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
Added: | ||||||||
> > |
| |||||||
Expand limited set of variables during topic creation. These are variables expected in templates that must be statically expanded in new content. | ||||||||
Deleted: | ||||||||
< < |
| |||||||
# SMELL: no plugin handler |
Line: 181 to 181 | ||||||||
---|---|---|---|---|---|---|---|---|
Returns the URL to a TWiki script, providing the web and topic as "path info" parameters. The result looks something like this: "http://host/twiki/bin/$script/$web/$topic". | ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
If $absolute is set, generates an absolute URL. $absolute is advisory only; TWiki can decide to generate absolute URLs (for example when run from the | ||||||||
Line: 195 to 199 | ||||||||
when running from the command line, or when generating rss). If $script is not given, absolute URLs will always be generated. | ||||||||
Changed: | ||||||||
< < | If either the web or the topic is defined, will generate a full url (including web and topic). Otherwise will generate only up to the script name. An undefined web will default to the main web name. | |||||||
> > | If either the web or the topic is defined, will generate a full url (including web and topic). Otherwise will generate only up to the script name. An undefined web will default to the main web name. | |||||||
Line: 661 to 667 | ||||||||
| ||||||||
Added: | ||||||||
> > |
| |||||||
Line: 10 to 10 | ||||||||
---|---|---|---|---|---|---|---|---|
with CGI accelerators such as mod_perl.
Public Data members | ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Line: 25 to 26 | ||||||||
not consistently used. Avoid.
| ||||||||
Changed: | ||||||||
< < | the current CGI request. | |||||||
> > | the current request. | |||||||
| ||||||||
Line: 46 to 47 | ||||||||
Changed: | ||||||||
< < | StaticMethod UTF82SiteCharSet ($utf8) -> $ascii | |||||||
> > | ObjectMethod UTF82SiteCharSet ($utf8) -> $ascii | |||||||
Auto-detect UTF-8 vs. site charset in string, and convert UTF-8 into site charset. | ||||||||
Line: 67 to 68 | ||||||||
Changed: | ||||||||
< < | ObjectMethod generateHTTPHeaders ($query,$pageType,$contentType,$contentLength) -> $header | |||||||
> > | ObjectMethod generateHTTPHeaders ($pageType,$contentType,$contentLength) -> $header | |||||||
All parameters are optional. | ||||||||
Deleted: | ||||||||
< < |
| |||||||
| ||||||||
Line: 100 to 100 | ||||||||
Redirects the request to $url , unless
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Line: 211 to 211 | ||||||||
Changed: | ||||||||
< < | ObjectMethod getIconUrl ($absolute,$iconName) -> $iconURL | |||||||
> > | ObjectMethod cacheIconData ($action) | |||||||
Changed: | ||||||||
< < | Map an icon name to a URL path. | |||||||
> > | Cache icon data based on action:
| |||||||
Changed: | ||||||||
< < | ObjectMethod mapToIconFileName ($fileName,$default) -> $fileName | |||||||
> > | ObjectMethod formatIcon ($iconName,$format,$default) -> $iconFormat an icon based on name and format parameter. The format parameter handles these variables (with example):
| |||||||
Changed: | ||||||||
< < | Maps from a filename (or just the extension) to the name of the file that contains the image for that file type. | |||||||
> > | The optional default parameter specifies the icon name in case the icon is not defined. Leave empty if you assume icon files exist in the default location. | |||||||
Line: 245 to 263 | ||||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
is used)
| ||||||||
Line: 566 to 584 | ||||||||
Deleted: | ||||||||
< < | StaticMethod restDispatch ($subject,$verb)=>\&fnReturns the handler function associated to the given $subject and $werb, or undef if none is found. Since: TWiki::Plugins::VERSION 1.1 | |||||||
ObjectMethod handleCommonTags ($text,$web,$topic,$meta) -> $textProcesses %VARIABLE%, and %TOC% syntax; also includes | ||||||||
Line: 588 to 597 | ||||||||
Changed: | ||||||||
< < | ObjectMethod addToHEAD ($id,$html) | |||||||
> > | ObjectMethod ADDTOHEAD ($args) | |||||||
Add $html to the HEAD tag of the page currently being generated.
Note that TWiki variables may be used in the HEAD. They will be expanded
according to normal variable expansion rules. | ||||||||
Changed: | ||||||||
< < | The 'id' is used to ensure that multiple adds of the same block of HTML don't result in it being added many times. | |||||||
> > |
You can write == in a topic or template. This variable accepts the following parameters: | |||||||
Added: | ||||||||
> > | Head blocks are sorted to satisfy all their requires constraints.
The output order of blocks with no requires value is undefined. If cycles
exist in the dependency order, the cycles will be broken but the resulting
order of blocks in the cycle is undefined. | |||||||
StaticMethod initialize ($pathInfo,$remoteUser,$topic,$url,$query) -> ($topicName,$webName,$scriptUrlPath,$userName,$dataDir) |
Line: 9 to 9 | ||||||||
---|---|---|---|---|---|---|---|---|
Global variables are avoided wherever possible to avoid problems with CGI accelerators such as mod_perl. | ||||||||
Added: | ||||||||
> > | Public Data members
| |||||||
On this page:
StaticMethod getTWikiLibDir () -> $path | ||||||||
Deleted: | ||||||||
< < | STATIC method. | |||||||
Returns the full path of the directory containing TWiki.pm | ||||||||
Changed: | ||||||||
< < | ObjectMethod UTF82SiteCharSet ($utf8) -> $ascii | |||||||
> > | StaticMethod UTF82SiteCharSet ($utf8) -> $ascii | |||||||
Auto-detect UTF-8 vs. site charset in string, and convert UTF-8 into site charset. | ||||||||
Line: 41 to 67 | ||||||||
Changed: | ||||||||
< < | ObjectMethod writePageHeader ($query,$pageType,$contentType,$contentLength) | |||||||
> > | ObjectMethod generateHTTPHeaders ($query,$pageType,$contentType,$contentLength) -> $header | |||||||
All parameters are optional. | ||||||||
Line: 55 to 81 | ||||||||
delimited. Filters any illegal headers. Plugin headers will override core settings. | ||||||||
Added: | ||||||||
> > | Does not add a Content-length header.
StaticMethod isRedirectSafe ($redirect)=>$ok | |||||||
Added: | ||||||||
> > | tests if the $redirect is an external URL, returning false if AllowRedirectUrl is denied | |||||||
Changed: | ||||||||
< < | ObjectMethod redirect ($url,$passthrough) | |||||||
> > |
ObjectMethod redirect ($url,$passthrough,$action_redirectto)
| |||||||
Redirects the request to $url , unless
| ||||||||
Line: 65 to 104 | ||||||||
| ||||||||
Changed: | ||||||||
< < | Normally this method will ignore parameters to the current query. If $passthrough is set, then it will pass all parameters that were passed to the current query on to the redirect target. If the request_method was GET, then all parameters can be passed in the URL. If the request_method was POST then it caches the form data and passes over a cache reference in the redirect GET. | |||||||
> > | Normally this method will ignore parameters to the current query. Sometimes, for example when redirecting to a login page during authentication (and then again from the login page to the original requested URL), you want to make sure all parameters are passed on, and for this $passthrough should be set to true. In this case it will pass all parameters that were passed to the current query on to the redirect target. If the request_method for the current query was GET, then all parameters will be passed by encoding them in the URL (after ?). If the request_method was POST, then there is a risk the URL would be too big for the receiver, so it caches the form data and passes over a cache reference in the redirect GET. | |||||||
Changed: | ||||||||
< < | Passthrough is only meaningful if the redirect target is on the same server. | |||||||
> > | NOTE: Passthrough is only meaningful if the redirect target is on the same server. | |||||||
Line: 112 to 156 | ||||||||
system web names are considered valid (names starting with _) otherwise only user web names are valid | ||||||||
Added: | ||||||||
> > | If $TWiki::cfg{EnableHierarchicalWebs} is off, it will also return false when a nested web name is passed to it. | |||||||
ObjectMethod readOnlyMirrorWeb ($theWeb) -> ($mirrorSiteName,$mirrorViewURL,$mirrorLink,$mirrorNote) | ||||||||
Line: 177 to 224 | ||||||||
Changed: | ||||||||
< < | ObjectMethod getOopsUrl ($template,@options) -> $absoluteOopsURL | |||||||
> > | ObjectMethod normalizeWebTopicName ($theWeb,$theTopic) -> ($theWeb,$theTopic)Normalize a Web.TopicName | |||||||
Changed: | ||||||||
< < | Composes a URL for an "oops" error page. The @options consists of a list
of key => value pairs. The following keys are used:
| |||||||
> > | See TWikiFuncDotPm for a full specification of the expansion (not duplicated here) | |||||||
Changed: | ||||||||
< < | Do not include the "oops" part in front of the template name. | |||||||
> > | WARNING if there is no web specification (in the web or topic parameters) the web defaults to $TWiki::cfg{UsersWebName}. If there is no topic specification, or the topic is '0', the topic defaults to the web home topic name. | |||||||
Deleted: | ||||||||
< < | Alternatively you can pass a reference to an OopsException in place of the template. All other parameters will be ignored. | |||||||
Deleted: | ||||||||
< < | The returned URL ends up looking something like this: "http://host/twiki/bin/oops/$web/$topic?template=$template¶m1=$scriptParams[0]..." | |||||||
Changed: | ||||||||
< < | Note: if {keep} is true in the params, then they will also be pushed into the current query. | |||||||
> > | ClassMethod new ($loginName,$query,\%initialContext) | |||||||
Added: | ||||||||
> > | Constructs a new TWiki object. Parameters are taken from the query object. | |||||||
Added: | ||||||||
> > |
| |||||||
Deleted: | ||||||||
< < | ObjectMethod normalizeWebTopicName ($theWeb,$theTopic) -> ($theWeb,$theTopic) | |||||||
Deleted: | ||||||||
< < | Normalize a Web.TopicName | |||||||
Changed: | ||||||||
< < | See TWikiFuncDotPm for a full specification of the expansion (not duplicated here) | |||||||
> > | ObjectMethod renderer ()Get a reference to the renderer object. Done lazily because not everyone needs the renderer. | |||||||
Deleted: | ||||||||
< < | WARNING if there is no web specification (in the web or topic parameters) the web defaults to $TWiki::cfg{UsersWebName}. If there is no topic specification, or the topic is '0', the topic defaults to the web home topic name. | |||||||
Added: | ||||||||
> > | ObjectMethod attach ()Get a reference to the attach object. Done lazily because not everyone needs the attach. | |||||||
Deleted: | ||||||||
< < | ClassMethod new ($loginName,$query,\%initialContext) | |||||||
Deleted: | ||||||||
< < | Constructs a new TWiki object. Parameters are taken from the query object. | |||||||
Changed: | ||||||||
< < |
| |||||||
> > | ObjectMethod templates ()Get a reference to the templates object. Done lazily because not everyone needs the templates. | |||||||
Added: | ||||||||
> > | ObjectMethod i18n ()Get a reference to the i18n object. Done lazily because not everyone needs the i18ner. | |||||||
Deleted: | ||||||||
< < | ObjectMethod finish | |||||||
Changed: | ||||||||
< < | Complete processing after the client's HTTP request has been responded
to. Right now this does two things:
| |||||||
> > | ObjectMethod search ()Get a reference to the search object. Done lazily because not everyone needs the searcher.ObjectMethod security ()Get a reference to the security object. Done lazily because not everyone needs the security.ObjectMethod net ()Get a reference to the net object. Done lazily because not everyone needs the net.ObjectMethod finish ()Break circular references. | |||||||
Line: 237 to 304 | ||||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Write the log for an event to the logfile | ||||||||
Line: 292 to 359 | ||||||||
Changed: | ||||||||
< < | ObjectMethod expandVariablesOnTopicCreation ($text,$user) -> $text | |||||||
> > | ObjectMethod expandVariablesOnTopicCreation ($text,$user,$web,$topic) -> $text | |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Expand limited set of variables during topic creation. These are variables expected in templates that must be statically expanded in new content. | ||||||||
Added: | ||||||||
> > |
| |||||||
# SMELL: no plugin handler | ||||||||
Line: 339 to 408 | ||||||||
Added: | ||||||||
> > | StaticMethod urlEncodeAttachment ($text)For attachments, URL-encode specially to 'freeze' any characters >127 in the site charset (e.g. ISO-8859-1 or KOI8-R), by doing URL encoding into native charset ($siteCharset) - used when generating attachment URLs, to enable the web server to serve attachments, including images, directly. This encoding is required to handle the cases of: - browsers that generate UTF-8 URLs automatically from site charset URLs - now quite common - web servers that directly serve attachments, using the site charset for filenames, and cannot convert UTF-8 URLs into site charset filenames The aim is to prevent the browser from converting a site charset URL in the web page to a UTF-8 URL, which is the default. Hence we 'freeze' the URL into the site character set through URL encoding. In two cases, no URL encoding is needed: For EBCDIC mainframes, we assume that site charset URLs will be translated (outbound and inbound) by the web server to/from an EBCDIC character set. For sites running in UTF-8, there's no need for TWiki to do anything since all URLs and attachment filenames are already in UTF-8. | |||||||
StaticMethod urlEncode ($string) -> encodedstringEncode by converting characters that are illegal in URLs to | ||||||||
Line: 348 to 441 | ||||||||
characters such as = and ?. RFC 1738, Dec. '94: | ||||||||
Changed: | ||||||||
< < | > | |||||||
> > | ||||||||
...Only alphanumerics [0-9a-zA-Z], the special characters $-_.+!*'(), and reserved characters used for their reserved purposes may be used unencoded within a URL. | ||||||||
Line: 356 to 450 | ||||||||
Reserved characters are $&+,/:;=?@ - these are also encoded by this method. | ||||||||
Changed: | ||||||||
< < | SMELL: For non-ISO-8859-1 $TWiki::cfg{Site}{CharSet}, need to convert to UTF-8 before URL encoding. This encoding only supports 8-bit character codes. | |||||||
> > | This URL-encoding handles all character encodings including ISO-8859-*, KOI8-R, EUC-* and UTF-8. This may not handle EBCDIC properly, as it generates an EBCDIC URL-encoded URL, but mainframe web servers seem to translate this outbound before it hits browser - see CGI::Util::escape for another approach. | |||||||
Line: 387 to 484 | ||||||||
Added: | ||||||||
> > | ObjectMethod expandAllTags (\$text,$topic,$web,$meta)Expands variables by replacing the variables with their values. Some example variables: %TOPIC%, %SCRIPTURL%, %WIKINAME%, etc. $web and $incs are passed in for recursive include expansion. They can safely be undef. The rules for tag expansion are:
| |||||||
ObjectMethod enterContext ($id,$val)Add the context id $id into the set of active contexts. The $val | ||||||||
Line: 461 to 575 | ||||||||
Changed: | ||||||||
< < | ObjectMethod handleCommonTags ($text,$web,$topic) -> $text | |||||||
> > | ObjectMethod handleCommonTags ($text,$web,$topic,$meta) -> $text | |||||||
Processes %VARIABLE%, and %TOC% syntax; also includes 'commonTagsHandler' plugin hook. | ||||||||
Line: 469 to 583 | ||||||||
Returns the text of the topic, after file inclusion, variable substitution, table-of-contents generation, and any plugin changes from commonTagsHandler. | ||||||||
Added: | ||||||||
> > | $meta may be undef when, for example, expanding templates, or one-off strings at a time when meta isn't available. | |||||||
ObjectMethod addToHEAD ($id,$html) |
Line: 29 to 30 | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ObjectMethod writeCompletePage ($text,$pageType,$contentType)Write a complete HTML page with basic header to the browser. | |||||||||||||
Changed: | |||||||||||||
< < | $text is the HTML of the page body (<html> to </html>) | ||||||||||||
> > |
| ||||||||||||
Changed: | |||||||||||||
< < | This method removes noautolink and nop tags before outputting the page. | ||||||||||||
> > | This method removes noautolink and nop tags before outputting the page unless $contentType is text/plain. | ||||||||||||
Line: 51 to 57 | |||||||||||||
Changed: | |||||||||||||
< < | ObjectMethod redirect ($url,...) | ||||||||||||
> > | ObjectMethod redirect ($url,$passthrough)Redirects the request to$url , unless
| ||||||||||||
Changed: | |||||||||||||
< < | Generate a CGI redirect to $url unless (1) $session->{cgiQuery} is undef or (2) $query->param('noredirect') is set to a true value. Thus a redirect is only generated when in a CGI context. | ||||||||||||
> > | Passthrough is only meaningful if the redirect target is on the same server. | ||||||||||||
Deleted: | |||||||||||||
< < | The ... parameters are concatenated to the message written when printing to STDOUT, and are ignored for a redirect. | ||||||||||||
Changed: | |||||||||||||
< < | Redirects the request to $url, via the CGI module object $query unless
overridden by a plugin declaring a redirectCgiQueryHandler . | ||||||||||||
> > |
ObjectMethod cacheQuery () -> $queryStringCaches the current query in the params cache, and returns a rewritten query string for the cache to be picked up again on the other side of a redirect. We can't encode post params into a redirect, because they may exceed the size of the GET request. So we cache the params, and reload them when the redirect target is reached. | ||||||||||||
Line: 111 to 134 | |||||||||||||
Returns the URL to a TWiki script, providing the web and topic as "path info" parameters. The result looks something like this: "http://host/twiki/bin/$script/$web/$topic". | |||||||||||||
Changed: | |||||||||||||
< < |
| ||||||||||||
> > |
| ||||||||||||
If $absolute is set, generates an absolute URL. $absolute is advisory only; TWiki can decide to generate absolute URLs (for example when run from the | |||||||||||||
Line: 170 to 193 | |||||||||||||
The returned URL ends up looking something like this: "http://host/twiki/bin/oops/$web/$topic?template=$template¶m1=$scriptParams[0]..." | |||||||||||||
Added: | |||||||||||||
> > | Note: if {keep} is true in the params, then they will also be pushed into the current query. | ||||||||||||
ObjectMethod normalizeWebTopicName ($theWeb,$theTopic) -> ($theWeb,$theTopic)Normalize a Web.TopicName | |||||||||||||
Deleted: | |||||||||||||
< < | Input: Return: ( 'Web', 'Topic' ) ( 'Web', 'Topic' ) ( '', 'Topic' ) ( 'Main', 'Topic' ) ( '', '' ) ( 'Main', 'WebHome' ) ( '', 'Web/Topic' ) ( 'Web', 'Topic' ) ( '', 'Web.Topic' ) ( 'Web', 'Topic' ) ( 'Web1', 'Web2.Topic' ) ( 'Web2', 'Topic' ) ( 'Main', 'Web2.Topic' ) ( 'Main', 'Topic' ) ( 'TWiki', 'Web2.Topic' ) ( 'TWiki', 'Topic' )Note: Function renamed from getWebTopic | ||||||||||||
Changed: | |||||||||||||
< < | SMELL: WARNING: this function defaults the web and topic names. Be very careful where you use it! | ||||||||||||
> > | See TWikiFuncDotPm for a full specification of the expansion (not duplicated here) | ||||||||||||
Added: | |||||||||||||
> > | WARNING if there is no web specification (in the web or topic parameters) the web defaults to $TWiki::cfg{UsersWebName}. If there is no topic specification, or the topic is '0', the topic defaults to the web home topic name. | ||||||||||||
Changed: | |||||||||||||
< < | ClassMethod new ($remoteUser,$query) | ||||||||||||
> > |
ClassMethod new ($loginName,$query,\%initialContext) | ||||||||||||
Constructs a new TWiki object. Parameters are taken from the query object. | |||||||||||||
Changed: | |||||||||||||
< < |
| ||||||||||||
> > |
| ||||||||||||
Line: 247 to 271 | |||||||||||||
Added: | |||||||||||||
> > | StaticMethod parseSections ($text) -> ($string,$sectionlistref)Generic parser for sections within a topic. Sections are delimited by STARTSECTION and ENDSECTION, which may be nested, overlapped or otherwise abused. The parser builds an array of sections, which is ordered by the order of the STARTSECTION within the topic. It also removes all the SECTION tags from the text, and returns the text and the array of sections. Each section is aTWiki::Attrs object, which contains the attributes
{type, name, start, end}
where start and end are character offsets in the
string after all section tags have been removed. All sections
are required to be uniquely named; if a section is unnamed, it
will be given a generated name. Sections may overlap or nest.
See test/unit/Fn_SECTION.pm for detailed testcases that
round out the spec.
| ||||||||||||
ObjectMethod expandVariablesOnTopicCreation ($text,$user) -> $text | |||||||||||||
Added: | |||||||||||||
> > | |||||||||||||
| |||||||||||||
Line: 384 to 430 | |||||||||||||
Changed: | |||||||||||||
< < | registerRESTHandler( $subject, $verb, \&fn ) | ||||||||||||
> > | StaticMethod registerRESTHandler ($subject,$verb,\&fn) | ||||||||||||
Adds a function to the dispatch table of the REST interface for a given subject. See TWikiScripts#rest for more info. | |||||||||||||
Line: 403 to 450 | |||||||||||||
Since: TWiki::Plugins::VERSION 1.1 | |||||||||||||
Changed: | |||||||||||||
< < | restDispatch( $subject, $verb) => \&fn | ||||||||||||
> > |
StaticMethod restDispatch ($subject,$verb)=>\&fn | ||||||||||||
Returns the handler function associated to the given $subject and $werb, or undef if none is found. | |||||||||||||
Line: 453 to 507 | |||||||||||||
used only if there is absolutely no alternative. | |||||||||||||
Added: | |||||||||||||
> > |
StaticMethod expandStandardEscapes ($str) -> $unescapedStrExpands standard escapes used in parameter values to block evaluation. The following escapes are handled:
|
Line: 203 to 203 | ||||||||
---|---|---|---|---|---|---|---|---|
ObjectMethod finishComplete processing after the client's HTTP request has been responded | ||||||||
Changed: | ||||||||
< < | to. Right now this only entails one activity: calling TWiki::Client to flushing the user's session (if any) to disk. | |||||||
> > | to. Right now this does two things:
| |||||||
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Added: | ||||||||
> > | Package
TWiki operates by creating a singleton object (known as the Session
object) that acts as a point of reference for all the different
modules in the system. This package is the class for this singleton,
and also contains the vast bulk of the basic constants and the per-
site configuration mechanisms.
Global variables are avoided wherever possible to avoid problems
with CGI accelerators such as mod_perl.
|
site name | URL | link | note |
...
- 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#XXX?a=1&b=2
-web
- web name
-topic
- topic name
-def
- optional template def within the main template file
-params
- a single parameter, or a reference to an array of parameters These are passed in the URL as '¶m1=' etc.
Input: Return: ( 'Web', 'Topic' ) ( 'Web', 'Topic' ) ( '', 'Topic' ) ( 'Main', 'Topic' ) ( '', '' ) ( 'Main', 'WebHome' ) ( '', 'Web/Topic' ) ( 'Web', 'Topic' ) ( '', 'Web.Topic' ) ( 'Web', 'Topic' ) ( 'Web1', 'Web2.Topic' ) ( 'Web2', 'Topic' ) ( 'Main', 'Web2.Topic' ) ( 'Main', 'Topic' ) ( 'TWiki', 'Web2.Topic' ) ( 'TWiki', 'Topic' )Note: Function renamed from getWebTopic SMELL: WARNING: this function defaults the web and topic names. Be very careful where you use it!
$remoteUser
the logged-in user (login name)
$query
the query
$action
- what happened, e.g. view, save, rename
$wbTopic
- what it happened to
$extra
- extra info, such as minor flag
$user
- user who did the saving (user object or string user name)
$text
- text to expand
$user
- reference to user object. This is the user expanded in e.g. %USERNAME. Optional, defaults to logged-in user.
> ...Only alphanumerics [0-9a-zA-Z], the special characters $-_.+!*'(), and reserved characters used for their reserved purposes may be used unencoded within a URL.Reserved characters are $&+,/:;=?@ - these are also encoded by this method. SMELL: For non-ISO-8859-1 $TWiki::cfg{Site}{CharSet}, need to convert to UTF-8 before URL encoding. This encoding only supports 8-bit character codes.
$value
is true, and 0 otherwise. "true" means set to
something with a Perl true value, with the special cases that "off",
"false" and "no" (case insensitive) are forced to false. Leading and
trailing spaces in $value
are ignored.
If the value is undef, then $default
is returned. If $default
is
not specified it is taken as 0.
enterContext
for more information on contexts)
enterContext
for more information on contexts)
$tag
name of the tag e.g. MYTAG
$fnref
Function to execute. Will be passed ($session, \%params, $web, $topic )
$subject
- The subject under which the function will be registered.
$verb
- The verb under which the function will be registered.
\&fn
- Reference to the function.
sub handler(\%session,$subject,$verb) -> $textwhere:
\%session
- a reference to the TWiki session object (may be ignored)
$subject
- The invoked subject (may be ignored)
$verb
- The invoked verb (may be ignored)
$html
to the HEAD tag of the page currently being generated.
Note that TWiki variables may be used in the HEAD. They will be expanded
according to normal variable expansion rules.
The 'id' is used to ensure that multiple adds of the same block of HTML don't
result in it being added many times.