SRFGallery Class Reference

Inherits SMWResultPrinter.

List of all members.

Public Member Functions

 getName ()
 Get a human readable label for this printer.
 getResult (SMWQueryResult $results, array $params, $outputmode)
 Main entry point: takes an SMWQueryResult and parameters given as key-value-pairs in an array, and returns the serialised version of the results, formatted as HTML or Wiki or whatever is specified.
 getResultText (SMWQueryResult $results, $outputmode)
 Return serialised results in specified format.
 getParameters ()

Protected Member Functions

 addImageProperties (SMWQueryResult $results, ImageGallery &$ig, $imageProperty, $captionProperty)
 Handles queries where the images (and optionally their captions) are specified as properties.
 addImagePages (SMWQueryResult $results, ImageGallery &$ig)
 Handles queries where the result objects are image pages.
 addImageToGallery (ImageGallery &$ig, Title $imgTitle, $imgCaption)
 Adds a single image to the gallery.


Detailed Description

Definition at line 13 of file SRF_Gallery.php.


Member Function Documentation

SRFGallery::getName (  ) 

Get a human readable label for this printer.

The default is to return just the format identifier. Concrete implementations may refer to messages here. The format name is normally not used in wiki text but only in forms etc. hence the user language should be used when retrieving messages.

Returns:
string

Reimplemented from SMWResultPrinter.

Definition at line 15 of file SRF_Gallery.php.

SRFGallery::getResult ( SMWQueryResult results,
array $  params,
outputmode 
)

Main entry point: takes an SMWQueryResult and parameters given as key-value-pairs in an array, and returns the serialised version of the results, formatted as HTML or Wiki or whatever is specified.

Normally this is not overwritten by subclasses.

If the outputmode is SMW_OUTPUT_WIKI, then the function will return something that is suitable for being used in a MediaWiki parser function, i.e. a wikitext strong *or* an array with flags and the string as entry 0. See Parser::setFunctionHook() for documentation on this. In all other cases, the function returns just a string.

For outputs SMW_OUTPUT_WIKI and SMW_OUTPUT_HTML, error messages or standard "further results" links are directly generated and appended. For SMW_OUTPUT_FILE, only the plain generated text is returned.

Note:
A note on recursion: some query printers may return wiki code that comes from other pages, e.g. from templates that are used in formatting or from embedded result pages. Both kinds of pages may contain #ask queries that do again use new pages, so we must care about recursion. We do so by simply counting how often this method starts a subparse and stopping at depth 2. There is one special case: if this method is called outside parsing, and the concrete printer returns wiki text, and wiki text is requested, then we may return wiki text with sub-queries to the caller. If the caller parses this (which is likely) then this will again call us in parse-context and all recursion checks catch. Only the first level of parsing is done outside and thus not counted. Thus you effectively can get down to level 3. The basic maximal depth of 2 can be changed by setting the variable SMWResultPrinter::$maxRecursionDepth (in LocalSettings.php, after enableSemantics()). Do this at your own risk.
Parameters:
$results SMWQueryResult
$params array
$outputmode integer
Returns:
string

Reimplemented from SMWResultPrinter.

Definition at line 19 of file SRF_Gallery.php.

References getResultText(), and SMWResultPrinter::handleParameters().

SRFGallery::getResultText ( SMWQueryResult res,
outputmode 
)

Return serialised results in specified format.

Implemented by subclasses.

Reimplemented from SMWResultPrinter.

Definition at line 25 of file SRF_Gallery.php.

References addImagePages(), addImageProperties(), and SMWOutputs::requireResource().

Referenced by getResult().

SRFGallery::addImageProperties ( SMWQueryResult results,
ImageGallery &$  ig,
imageProperty,
captionProperty 
) [protected]

Handles queries where the images (and optionally their captions) are specified as properties.

Since:
1.5.3
Parameters:
SMWQueryResult $results
ImageGallery $ig
string $imageProperty
string $captionProperty

Definition at line 107 of file SRF_Gallery.php.

References addImageToGallery(), and SMWResultPrinter::getLinker().

Referenced by getResultText().

SRFGallery::addImagePages ( SMWQueryResult results,
ImageGallery &$  ig 
) [protected]

Handles queries where the result objects are image pages.

Since:
1.5.3
Parameters:
SMWQueryResult $results
ImageGallery $ig

Definition at line 147 of file SRF_Gallery.php.

References addImageToGallery(), and SMWResultPrinter::getLinker().

Referenced by getResultText().

SRFGallery::addImageToGallery ( ImageGallery &$  ig,
Title $  imgTitle,
imgCaption 
) [protected]

Adds a single image to the gallery.

Takes care of automatically adding a caption when none is provided and parsing it's wikitext.

Since:
1.5.3
Parameters:
ImageGallery $ig The gallery to add the image to
Title $imgTitle The title object of the page of the image
string $imgCaption An optional caption for the image

Definition at line 179 of file SRF_Gallery.php.

Referenced by addImagePages(), and addImageProperties().

SRFGallery::getParameters (  ) 

See also:
SMWResultPrinter::getParameters
Since:
1.5.3
Returns:
array

Reimplemented from SMWResultPrinter.

Definition at line 216 of file SRF_Gallery.php.

References SMWResultPrinter::$params.


The documentation for this class was generated from the following file:

Generated on Sun Mar 18 07:15:45 2012 for Semantic MediaWiki by  doxygen 1.5.6