Welcome, Registration, and other StartingPoints; TWiki history & Wiki style; All the docs...
View   r3  >  r2  ...
TWikiDotPm 3 - 16 Jan 2007 - Main.TWikiContributor
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>)
>
>
  • $text is the text of the page body (<html> to </html> if it's HTML)
  • $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:
<
<
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

  1. It is overridden by a plugin declaring a redirectCgiQueryHandler.
  2. $session->{cgiQuery} is undef or
  3. $query->param('noredirect') is set to a true value.
Thus a redirect is only generated when in a CGI context.

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.

 
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 () -> $queryString

Caches 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:
<
<
  • ... - 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
>
>
  • ... - 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
 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&param1=$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:
<
<
  • $remoteUser the logged-in user (login name)
  • $query the query
>
>
  • $loginName is the username 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.
  • $query the CGI 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: 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 a TWiki::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:
>
>
 
  • $text - text to expand
  • $user - reference to user object. This is the user expanded in e.g. %USERNAME. Optional, defaults to logged-in user.
Expand limited set of variables during topic creation. These are variables
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) -> $unescapedStr

Expands standard escapes used in parameter values to block evaluation. The following escapes are handled:

Escape: Expands To:
$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 (")
$percnt Percent sign (%)
$dollar Dollar sign ($)

Revision 3r3 - 16 Jan 2007 - 04:12:01 - TWikiContributor
Revision 2r2 - 25 Jun 2006 - 16:26:33 - TWikiContributor
This site is powered by the TWiki collaboration platform.
All material on this collaboration platform is the property of the contributing authors.
All material marked as authored by Eben Moglen is available under the license terms CC-BY-SA version 4.
Syndicate this site RSSATOM