Static Public Member Functions | |
| static | requireResource ($moduleName) |
| Adds a resource module to the parser output. | |
| static | requireScript ($id, $script) |
| Require the presence of header scripts, provided as strings with enclosing script tags. | |
| static | requireHeadItem ($id, $item= '') |
| Adds head items that are not Resource Loader modules. | |
| static | requireFromParserOutput (ParserOutput $parserOutput) |
| This function takes output requirements as can be found in a given ParserOutput object and puts them back in to the internal temporal requirement list from which they can be committed to some other output. | |
| static | commitToParser (Parser $parser) |
| Acutally commit the collected requirements to a given parser that is about to parse what will later be the HTML output. | |
| static | commitToParserOutput (ParserOutput $parserOutput) |
| Similar to SMWOutputs::commitToParser() but acting on a ParserOutput object. | |
| static | commitToOutputPage (OutputPage $output) |
| Acutally commit the collected requirements to a given OutputPage object that will later generate the HTML output. | |
| static | addModulesBC ($output) |
| Backwards compatibility method to add the stored modules to an OutputPage or ParserOuput (calls are the same so we don't care). | |
| static | processModuleBC ($moduleName, &$items) |
| Backwards compatibility method to generate the header items for loading the specified module. | |
| static | getValueArrayForKey ($key, $array) |
| Helper method for processModuleBC(). | |
Static Protected Attributes | |
| static | $headItems = array() |
| Protected member for temporarily storing header items. | |
| static | $scripts = array() |
| Protected member for temporarily storing additional Javascript snippets. | |
| static | $resourceModules = array() |
| Protected member for temporarily storing resource modules. | |
Definition at line 28 of file SMW_Outputs.php.
| static SMWOutputs::requireResource | ( | $ | moduleName | ) | [static] |
Adds a resource module to the parser output.
| string | $moduleName |
Definition at line 55 of file SMW_Outputs.php.
Referenced by SMWSearchByProperty::addAutoComplete(), SMWSpecialBrowse::addAutoComplete(), SMWQueryUI::enableAutocompletion(), SMWStringValue::getAbbValue(), SMWStringValue::getCodeDisplay(), SMWFactbox::getFactboxText(), SMWQueryUI::getFormatSelectBoxSep(), SMWQueryUI::getPoSortFormBox(), SRFGallery::getResultText(), SMMapPrinter::getResultText(), SMWNumberValue::getShortWikiText(), SMWInfolink::getText(), SMWPropertyValue::highlightText(), SRFTimeline::includeJS(), SMWQueryCreatorPage::makeForm(), SMWConcept::render(), and smwfEncodeMessages().
| static SMWOutputs::requireScript | ( | $ | id, | |
| $ | script | |||
| ) | [static] |
Require the presence of header scripts, provided as strings with enclosing script tags.
Note that the same could be achieved with requireHeadItems, but scripts use a special method "addScript" in MediaWiki OutputPage, hence we distinguish them.
The id is used to avoid that the requirement for one script is recorded multiple times in SMWOutputs.
| string | $id | |
| string | $item |
Definition at line 71 of file SMW_Outputs.php.
Referenced by SMWSearchByProperty::addAutoComplete(), SMWSpecialBrowse::addAutoComplete(), and SMWQueryCreatorPage::makeForm().
| static SMWOutputs::requireHeadItem | ( | $ | id, | |
| $ | item = '' | |||
| ) | [static] |
Adds head items that are not Resource Loader modules.
Should only be used for custom head items such as RSS fedd links.
The id is used to avoid that the requirement for one script is recorded multiple times in SMWOutputs.
Support for calling this with the old constants SMW_HEADER_STYLE and SMW_HEADER_TOOLTIP will vanish in SMW 1.7 at the latest.
| mixed | $id | |
| string | $item |
Definition at line 88 of file SMW_Outputs.php.
Referenced by SMGeoCoordsValue::getLongWikiText(), SMWRSSResultPrinter::getResultText(), SMMapPrinter::getResultText(), SRFTimeline::includeJS(), and SMWParserExtensions::onInternalParseBeforeLinks().
| static SMWOutputs::requireFromParserOutput | ( | ParserOutput $ | parserOutput | ) | [static] |
This function takes output requirements as can be found in a given ParserOutput object and puts them back in to the internal temporal requirement list from which they can be committed to some other output.
It is needed when code that would normally call SMWOutputs::requireHeadItem() has need to use a full independent parser call (Parser::parse()) that produces its own parseroutput. If omitted, all output items potentially committed to this parseroutput during parsing will not be passed on to higher levels.
Note that this is not required if the $parseroutput is further processed by MediaWiki, but there are cases where the output is discarded and only its text is used.
| ParserOutput | $parserOutput |
TODO Is the following needed?
Definition at line 118 of file SMW_Outputs.php.
Referenced by SMWResultPrinter::handleNonFileResult(), and SMWFactbox::onOutputPageParserOutput().
| static SMWOutputs::commitToParser | ( | Parser $ | parser | ) | [static] |
Acutally commit the collected requirements to a given parser that is about to parse what will later be the HTML output.
This makes sure that HTML output based on the parser results contains all required output items.
If the parser creates output for a normal wiki page, then the committed items will also become part of the page cache so that they will correctly be added to all page outputs built from this cache later on.
| Parser | $parser |
TODO find out and document when this b/c code can go away
Definition at line 146 of file SMW_Outputs.php.
Referenced by SMWParserExtensions::onInternalParseBeforeLinks(), SDBrowseDataPage::outputResults(), SMWShow::render(), SMWSetRecurringEvent::render(), SMWInfo::render(), SMWDeclare::render(), SMWConcept::render(), and SMWAsk::render().
| static SMWOutputs::commitToParserOutput | ( | ParserOutput $ | parserOutput | ) | [static] |
Similar to SMWOutputs::commitToParser() but acting on a ParserOutput object.
| ParserOutput | $parserOutput |
Definition at line 164 of file SMW_Outputs.php.
| static SMWOutputs::commitToOutputPage | ( | OutputPage $ | output | ) | [static] |
Acutally commit the collected requirements to a given OutputPage object that will later generate the HTML output.
This makes sure that HTML output contains all required output items. Note that there is no parser caching at this level of processing. In particular, data should not be committed to $wgOut in methods that run during page parsing, since these would not run next time when the page is produced from parser cache.
| OutputPage | $output |
Definition at line 193 of file SMW_Outputs.php.
Referenced by SMWSearchByProperty::execute(), SMWPageProperty::execute(), SMWSpecialBrowse::execute(), SMWSpecialWantedProperties::execute(), SMWSpecialUnusedProperties::execute(), SMWSpecialTypes::execute(), SMWSpecialProperties::execute(), SMWAskPage::execute(), SMWQueryUI::execute(), SMWFactbox::onOutputPageParserOutput(), SDBrowseDataPage::outputResults(), SMWShow::render(), SMWSetRecurringEvent::render(), SMWInfo::render(), SMWDeclare::render(), SMWConcept::render(), SMWAsk::render(), and SMWOrderedListPage::showList().
| static SMWOutputs::addModulesBC | ( | $ | output | ) | [static] |
Backwards compatibility method to add the stored modules to an OutputPage or ParserOuput (calls are the same so we don't care).
Only extension modules and a few MW modules that are included in SMW for compatibility are supported.
Definition at line 220 of file SMW_Outputs.php.
| static SMWOutputs::processModuleBC | ( | $ | moduleName, | |
| &$ | items | |||
| ) | [static] |
Backwards compatibility method to generate the header items for loading the specified module.
Definition at line 236 of file SMW_Outputs.php.
References $smwgScriptPath, and $wgResourceModules.
| static SMWOutputs::getValueArrayForKey | ( | $ | key, | |
| $ | array | |||
| ) | [static] |
Helper method for processModuleBC().
Definition at line 263 of file SMW_Outputs.php.
SMWOutputs::$headItems = array() [static, protected] |
Protected member for temporarily storing header items.
Format $id => $headItem where $id is used only to avoid duplicate items in the time before they are forwarded to the output.
Definition at line 35 of file SMW_Outputs.php.
SMWOutputs::$scripts = array() [static, protected] |
Protected member for temporarily storing additional Javascript snippets.
Format $id => $scriptText where $id is used only to avoid duplicate scripts in the time before they are forwarded to the output.
Definition at line 43 of file SMW_Outputs.php.
SMWOutputs::$resourceModules = array() [static, protected] |
Protected member for temporarily storing resource modules.
Definition at line 46 of file SMW_Outputs.php.
1.5.6