Difference: TWikiDotPm (7 vs. 8)

Revision 82013-10-14 - TWikiContributor

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

 
  • request Pointer to the TWiki::Request
  • response Pointer to the TWiki::Respose
  • context Hash of context ids
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.
  • $text is the text of the page body (<html> to </html> if it's HTML)
Line: 62 to 62
  caching for 24 hours, to prevent BackFromPreviewLosesText bug, which caused data loss with IE5 and IE6.
  • $contentType - page content type | text/html
Added:
>
>
  • $status - page status | 200 OK
  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.

  • $pageType - May be "edit", which will cause headers to be generated that force caching for 24 hours, to prevent BackFromPreviewLosesText bug, which caused data loss with IE5 and IE6.
  • $contentType - page content type | text/html
Changed:
<
<
  • $contentLength - content-length | no content-length will be set if this is undefined, as required by HTTP1.1
>
>
  • $status - page status | 200 OK
  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)

 
  • $url - url or twikitopic to redirect to
  • $passthrough - (optional) parameter to *FILLMEIN*
  • $action_redirectto - (optional) redirect to where ?redirectto= points to (if it's valid)
Added:
>
>
  • $viaCache - forcibly cache a redirect CGI query. It cuts off all the params in a GET url and replace with a "?$cache=..." param.
  Redirects the request to $url, unless
  1. It is overridden by a plugin declaring a redirectCgiQueryHandler.
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:
<
<
site name URL link note
>
>
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) -> $dataDir

You can specify either $web or $diskID, not both.

ObjectMethod getPubDir ($web,$diskID) -> $pubDir

You can specify either $web or $diskID, not both.

 

ObjectMethod getPubUrl ($absolute,$web,$topic,$attachment) -> $url

Line: 502 to 548
 
Added:
>
>

StaticMethod topLevelWeb ($web) -> toplevelwebof$web

If $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) -> $string

Spaces 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
 
$n or $n() New line. Use $n() if followed by alphanumeric character, e.g. write Foo$n()Bar instead of Foo$nBar
$nop or $nop() Is a "no operation".
$quot Double quote (")
Added:
>
>
$aquot Apostrophe quote (')
 
$percnt Percent sign (%)
$dollar Dollar sign ($)
$lt Less than sign (<)
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.TWikiDotPm.