|
static | convertFromHumanEditable ( $text) |
| Convert from human editable form into a (php) array.
|
|
static | transcludeHook ( $parser, $pageName='',... $args) |
| Function to handle {{#trancludelist:Page name|options...}} calls.
|
|
static | loadStyles ( $content, array $attributes, Parser $parser) |
| Hack to allow styles to be loaded from plain transclusion.
|
|
static | onArticleViewHeader (Article $article) |
| Hook used to determine if current user should be given the edit interface for a page.
|
|
static | onBeforePageDisplay (OutputPage $out, $skin) |
| Hook to add timestamp for edit conflict detection.
|
|
static | onCustomEditor (Page $page, User $user) |
| Hook to use custom edit page for lists.
|
|
|
const | MAX_LIST_SIZE = 2000 |
|
const | RANDOM_CACHE_EXPIRY = 28800 |
|
const | MAX_TAGS = 50 |
|
const | HUMAN_COLUMN_SPLIT = "\n---------~-~---------\n" |
|
const | HUMAN_COLUMN_SPLIT2 = "\n---------------------\n" |
|
|
| decode () |
| Decode the JSON contents and populate protected variables.
|
|
| fillParserOutput (Title $title, $revId, ParserOptions $options, $generateHtml, ParserOutput &$output) |
| Fill $output with information derived from the content.
|
|
|
| $description |
|
| $options |
|
| $columns |
|
| $displaymode |
|
| $errortext |
|
◆ __construct()
◆ beautifyJSON()
CollaborationListContent::beautifyJSON |
( |
| ) |
|
Format JSON.
Do not escape < and > it's unnecessary and ugly
- Returns
- string
◆ convert()
CollaborationListContent::convert |
( |
| $toModel, |
|
|
| $lossy = '' ) |
Converts between different text-based content models.
- Parameters
-
string | $toModel | The desired content model, use the CONTENT_MODEL_XXX flags. |
string | $lossy | Flag, set to "lossy" to allow lossy conversion. If lossy conversion is not allowed, full round-trip conversion is expected to work without losing information. |
- Returns
- Content|bool A content object with the content model $toModel.
◆ convertFromHumanEditable()
static CollaborationListContent::convertFromHumanEditable |
( |
| $text | ) |
|
|
static |
Convert from human editable form into a (php) array.
- Parameters
-
string | $text | text to convert |
- Returns
- array Result of converting it to native form
- Exceptions
-
MWContentSerializationException | |
◆ convertToHumanEditable()
CollaborationListContent::convertToHumanEditable |
( |
| ) |
|
Convert JSON to markup that's easier for humans.
- Returns
- string
◆ convertToWikitext()
CollaborationListContent::convertToWikitext |
( |
Language | $lang, |
|
|
| $options = [] ) |
Convert the JSON to wikitext.
- Parameters
-
Language | $lang | The (content) language to render the page in. |
array | $options | Options to override the default transclude options |
- Returns
- string The wikitext
◆ fillParserOutput()
CollaborationListContent::fillParserOutput |
( |
Title | $title, |
|
|
| $revId, |
|
|
ParserOptions | $options, |
|
|
| $generateHtml, |
|
|
ParserOutput & | $output ) |
|
protected |
Fill $output with information derived from the content.
- Parameters
-
Title | $title | |
int | $revId | Revision ID |
ParserOptions | $options | |
bool | $generateHtml | |
ParserOutput | &$output | |
◆ generateImage()
static CollaborationListContent::generateImage |
( |
| $definedImage, |
|
|
| $displayMode, |
|
|
| $title, |
|
|
| $size = 32 ) |
|
staticprotected |
Invokes CollaborationKitImage::makeImage with fallback criteria.
- Parameters
-
string | null | $definedImage | The filename given in the list item |
string | $displayMode | Type of list (members or otherwise) |
Title | null | $title | Title object of the list item |
int | $size | The width of the icon image. Default is 32px; |
- Returns
- string HTML
◆ getDefaultOptions()
CollaborationListContent::getDefaultOptions |
( |
| ) |
|
Default rendering options.
These are used when rendering a list and no option value was specified. getFullRenderListOptions() will override some of these values when a list page is directly viewed.
Any new option must be added to this list.
- Returns
- array default rendering options to use.
◆ getDescription()
CollaborationListContent::getDescription |
( |
| ) |
|
◆ getHumanEditableList()
CollaborationListContent::getHumanEditableList |
( |
| ) |
|
Get the list of items in human editable form.
- Returns
- string
- Todo
- i18n-ize
◆ isValid()
CollaborationListContent::isValid |
( |
| ) |
|
Decode and validate the contents.
- Returns
- bool Whether the contents are valid
◆ loadStyles()
static CollaborationListContent::loadStyles |
( |
| $content, |
|
|
array | $attributes, |
|
|
Parser | $parser ) |
|
static |
Hack to allow styles to be loaded from plain transclusion.
We don't have access to a parser object in getWikitextForTransclusion(). So instead we put <collaborationkitloadliststyles> on the page, which calls this.
- Parameters
-
string | $content | Input to parser hook |
array | $attributes | |
Parser | $parser | |
- Returns
- string Empty string
◆ onArticleViewHeader()
static CollaborationListContent::onArticleViewHeader |
( |
Article | $article | ) |
|
|
static |
Hook used to determine if current user should be given the edit interface for a page.
- Todo
- Not clear if this is the best hook to use. onBeforePageDisplay doesn't have easy access to oldid
- Parameters
-
◆ onBeforePageDisplay()
static CollaborationListContent::onBeforePageDisplay |
( |
OutputPage | $out, |
|
|
| $skin ) |
|
static |
Hook to add timestamp for edit conflict detection.
- Parameters
-
◆ onCustomEditor()
static CollaborationListContent::onCustomEditor |
( |
Page | $page, |
|
|
User | $user ) |
|
static |
Hook to use custom edit page for lists.
- Parameters
-
Article | Page | $page | |
User | $user | (Not used) |
- Returns
- bool|null
◆ transcludeHook()
static CollaborationListContent::transcludeHook |
( |
| $parser, |
|
|
| $pageName = '', |
|
|
| $args ) |
|
static |
Function to handle {{#trancludelist:Page name|options...}} calls.
- Parameters
-
Parser | $parser | |
string | $pageName | |
| string | ...$args |
- Returns
- string|array HTML string or an array [ string, 'noparse' => false ]
The documentation for this class was generated from the following file: