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.