...

Difference: TWikiDotPm (4 vs. 5)

Revision 52010-05-29 - TWikiContributor

Line: 10 to 10
 with CGI accelerators such as mod_perl.

Public Data members

Changed:
<
<
  • cgiQuery Pointer to the CGI::
>
>
  • request Pointer to the TWiki::Request
  • response Pointer to the TWiki::Respose
 
  • context Hash of context ids
  • moved: loginManager TWiki::LoginManager singleton (moved to TWiki::Users)
  • plugins TWiki::Plugins singleton
Line: 25 to 26
  not consistently used. Avoid.
  • security TWiki::Access singleton
  • SESSION_TAGS Hash of TWiki variables whose value is specific to
Changed:
<
<
the current CGI request.
>
>
the current request.
 
  • store TWiki::Store singleton
  • topicName Name of topic found in URL path or topic URL parameter
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:
<
<
  • $query CGI query object | Session CGI query (there is no good reason to set this)
 
  • $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
  • $contentLength - content-length | no content-length will be set if this is undefined, as required by HTTP1.1
Line: 100 to 100
  Redirects the request to $url, unless
  1. It is overridden by a plugin declaring a redirectCgiQueryHandler.
Changed:
<
<
  1. $session->{cgiQuery} is undef or
>
>
  1. $session->{request} is undef or
 
  1. $query->param('noredirect') is set to a true value.
Thus a redirect is only generated when in a CGI context.
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:
  • 'delete' - delete cache file
  • 'read' - read cache file
  • 'expire' - expire (invalidate) cache if needed
  • 'save' - save cache file
 
Changed:
<
<

ObjectMethod mapToIconFileName ($fileName,$default) -> $fileName

>
>

ObjectMethod formatIcon ($iconName,$format,$default) -> $icon

Format an icon based on name and format parameter. The format parameter handles these variables (with example):

  • $name: Name of icon ('home')
  • $type: Type of icon ('gif')
  • $filename: Icon filename ('home.gif')
  • $web: Web where icon is located ('TWiki')
  • $topic: Topic where icon is located ('TWikiDocGraphics')
  • $description: Icon description ('Home')
  • $width: Width of icon ('16')
  • $height: Height of icon ('16')
  • $img: Full img tag of icon ('')
  • $url: URL of icon ('http://example.com/pub/TWiki/TWikiDocGraphics/home.gif')
  • $urlpath: URL path of icon ('/pub/TWiki/TWikiDocGraphics/home.gif')
 
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
 
  • $loginName is the login username (not the wikiname) of the user you want to be logged-in if none is available from a session or browser. Used mainly for side scripts and debugging.
Changed:
<
<
  • $query the CGI query (may be undef, in which case an empty query
>
>
  • $query the TWiki::Request query (may be undef, in which case an empty query
  is used)
  • \%initialContext - reference to a hash containing context name=value pairs to be pre-installed in the context hash
Line: 566 to 584
 
Deleted:
<
<

StaticMethod restDispatch ($subject,$verb)=>\&fn

Returns 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) -> $text

Processes %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.
>
>

%ADDTOHEAD%

You can write == in a topic or template. This variable accepts the following parameters:
  • _DEFAULT optional, id of the head block. Used to generate a comment in the output HTML.
  • text optional, text to use for the head block. Mutually exclusive with topic.
  • topic optional, full TWiki path name of a topic that contains the full text to use for the head block. Mutually exclusive with text. Example: topic="TWiki.MyTopic".
  • requires optional, comma-separated list of id's of other head blocks this one depends on.
%ADDTOHEAD% expands in-place to the empty string, unless there is an error in which case the variable expands to an error string.

Use %RENDERHEAD% to generate the sorted head tags.

%<nop}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.
 
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)

 
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.