|
| __construct ( $text) |
|
| isValid () |
| Decode and validate the contents.
|
|
| decode () |
| Decode the JSON contents and populate protected variables.
|
|
| redirectProof (Title $title) |
| Resolves the redirect of a Title if it is in fact a redirect.
|
|
| getIntroduction () |
|
| getFooter () |
|
| getImage () |
|
| getContent () |
|
| getDisplayName () |
|
| getThemeColour () |
|
| getHubClasses () |
| Helper function for fillParserOutput to get all the css classes for the page content.
|
|
| getMembersBlock (Title $title, ParserOptions $options, ParserOutput $output, $membersContent=null) |
| Helper function for fillParserOutput.
|
|
| getParsedIntroduction (Title $title, ParserOptions $options) |
| Helper function for fillParserOutput.
|
|
| getParsedAnnouncements (Title $title, ParserOptions $options, $announcementsText=null) |
| Helper function for fillParserOutput.
|
|
| getParsedFooter (Title $title, ParserOptions $options) |
| Helper function for fillParserOutput.
|
|
| getSecondFooter (Title $title) |
| Get some extra buttons for another footer.
|
|
| getTableOfContents (Title $title, ParserOptions $options) |
| Helper function for fillParserOutput: the table of contents.
|
|
| getParsedImage ( $image, $size=200) |
| Generate an image based on what's in 'image', be it an icon or a file.
|
|
| convert ( $toModel, $lossy='') |
| Converts content between wikitext and JSON.
|
|
| convertToHumanEditable () |
| Convert JSON to markup that's easier for humans.
|
|
| getHumanEditableContent () |
| Get the list of items in human editable form.
|
|
|
static | getThemeColours () |
| 10 preset colours; actual colour values are set in the extension.json and less modules
|
|
static | getParentHub (Title $title) |
| Find the parent hub, if any.
|
|
static | escapeForHumanEditable ( $text) |
| Escape characters used as separators in human editable mode.
|
|
static | unescapeForHumanEditable ( $text) |
| Removes escape characters inserted in human editable mode.
|
|
static | convertFromHumanEditable ( $text) |
| Convert from human editable form into a (php) array.
|
|
static | onCustomEditor (Page $page, User $user) |
| Hook to use custom edit page for lists.
|
|
|
| makeHeader (Title $title, array $contentItem) |
| Helper function for getParsedContent for making subpage section headers.
|
|
| makeActionButton ( $title, $message, $setOptions=[]) |
| Helper function for fillParserOutput for making various action links (editsection links, purge cache buttons, whatever)
|
|
|
| $displayName |
|
| $image |
|
| $introduction |
|
| $content |
|
| $footer |
|
| $themeColour |
|
| $decoded = false |
|
◆ __construct()
CollaborationHubContent::__construct |
( |
| $text | ) |
|
◆ convert()
CollaborationHubContent::convert |
( |
| $toModel, |
|
|
| $lossy = '' ) |
Converts content between wikitext and JSON.
- Parameters
-
string | $toModel | |
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
◆ convertFromHumanEditable()
static CollaborationHubContent::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
◆ convertToHumanEditable()
CollaborationHubContent::convertToHumanEditable |
( |
| ) |
|
Convert JSON to markup that's easier for humans.
- Returns
- string
◆ escapeForHumanEditable()
static CollaborationHubContent::escapeForHumanEditable |
( |
| $text | ) |
|
|
static |
Escape characters used as separators in human editable mode.
- Parameters
-
- Returns
- string Escaped text
- Exceptions
-
MWContentSerializationException | |
- Todo
- Unclear if this is best approach. Alternative might be to use 
 Or an obscure unicode character like ␊ (U+240A).
◆ getContent()
CollaborationHubContent::getContent |
( |
| ) |
|
◆ getDisplayName()
CollaborationHubContent::getDisplayName |
( |
| ) |
|
◆ getFooter()
CollaborationHubContent::getFooter |
( |
| ) |
|
◆ getHubClasses()
CollaborationHubContent::getHubClasses |
( |
| ) |
|
Helper function for fillParserOutput to get all the css classes for the page content.
- Returns
- array
◆ getHumanEditableContent()
CollaborationHubContent::getHumanEditableContent |
( |
| ) |
|
Get the list of items in human editable form.
- Returns
- string
- Todo
- Should this be i18n-ized?
◆ getImage()
CollaborationHubContent::getImage |
( |
| ) |
|
◆ getIntroduction()
CollaborationHubContent::getIntroduction |
( |
| ) |
|
◆ getMembersBlock()
CollaborationHubContent::getMembersBlock |
( |
Title | $title, |
|
|
ParserOptions | $options, |
|
|
ParserOutput | $output, |
|
|
| $membersContent = null ) |
Helper function for fillParserOutput.
- Parameters
-
Title | $title | |
ParserOptions | $options | |
ParserOutput | $output | |
CollaborationListContent | null | $membersContent | Member list Content for testing purposes |
- Returns
- string
◆ getParentHub()
static CollaborationHubContent::getParentHub |
( |
Title | $title | ) |
|
|
static |
Find the parent hub, if any.
Returns the first CollaborationHub Title found, even if more are higher up, or null if none
- Parameters
-
Title | $title | Title to start looking from |
- Returns
- Title|null Title of parent hub or null if none was found
◆ getParsedAnnouncements()
CollaborationHubContent::getParsedAnnouncements |
( |
Title | $title, |
|
|
ParserOptions | $options, |
|
|
| $announcementsText = null ) |
Helper function for fillParserOutput.
- Parameters
-
Title | $title | |
ParserOptions | $options | |
string | null | $announcementsText | Force-fed announcements HTML for testing purposes |
- Returns
- string
◆ getParsedFooter()
CollaborationHubContent::getParsedFooter |
( |
Title | $title, |
|
|
ParserOptions | $options ) |
Helper function for fillParserOutput.
- Parameters
-
Title | $title | |
ParserOptions | $options | |
- Returns
- string
◆ getParsedImage()
CollaborationHubContent::getParsedImage |
( |
| $image, |
|
|
| $size = 200 ) |
Generate an image based on what's in 'image', be it an icon or a file.
- Parameters
-
string | $image | Filename or icon name |
int | $size | int for non-icon images |
- Returns
- string HTML
◆ getParsedIntroduction()
CollaborationHubContent::getParsedIntroduction |
( |
Title | $title, |
|
|
ParserOptions | $options ) |
Helper function for fillParserOutput.
- Parameters
-
Title | $title | |
ParserOptions | $options | |
- Returns
- string
◆ getSecondFooter()
CollaborationHubContent::getSecondFooter |
( |
Title | $title | ) |
|
Get some extra buttons for another footer.
- Parameters
-
- Returns
- string
◆ getTableOfContents()
CollaborationHubContent::getTableOfContents |
( |
Title | $title, |
|
|
ParserOptions | $options ) |
Helper function for fillParserOutput: the table of contents.
- Parameters
-
Title | $title | |
ParserOptions | $options | |
- Returns
- string
◆ getThemeColour()
CollaborationHubContent::getThemeColour |
( |
| ) |
|
◆ getThemeColours()
static CollaborationHubContent::getThemeColours |
( |
| ) |
|
|
static |
10 preset colours; actual colour values are set in the extension.json and less modules
- Returns
- array
◆ isValid()
CollaborationHubContent::isValid |
( |
| ) |
|
Decode and validate the contents.
- Returns
- bool Whether the contents are valid
◆ makeActionButton()
CollaborationHubContent::makeActionButton |
( |
| $title, |
|
|
| $message, |
|
|
| $setOptions = [] ) |
|
protected |
Helper function for fillParserOutput for making various action links (editsection links, purge cache buttons, whatever)
- Parameters
-
Title | $title | Target page |
string | $message | Message to display |
array | $setOptions | of a bunch of options, mostly to forward to the OOUI button (see defaults below) |
- Returns
- string either an OOUI\ButtonWidget effectively tostringed, or a ck:editsection marker which will get replaced with an OOUI\ButtonWidget later in CollaborationHubContentHandler::onParserOutputPostCacheTransform
◆ makeHeader()
CollaborationHubContent::makeHeader |
( |
Title | $title, |
|
|
array | $contentItem ) |
|
protected |
Helper function for getParsedContent for making subpage section headers.
- Parameters
-
Title | $title | |
array | $contentItem | Data for the content item we're generating the header for |
- Returns
- string html (NOTE THIS IS AN OPEN DIV)
◆ onCustomEditor()
static CollaborationHubContent::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
◆ redirectProof()
CollaborationHubContent::redirectProof |
( |
Title | $title | ) |
|
Resolves the redirect of a Title if it is in fact a redirect.
Consistent with general MediaWiki behavior, this function does not resolve double redirects.
- Parameters
-
Title | $title | Title which may or may not be a redirect |
- Returns
- Title
◆ unescapeForHumanEditable()
static CollaborationHubContent::unescapeForHumanEditable |
( |
| $text | ) |
|
|
static |
Removes escape characters inserted in human editable mode.
- Parameters
-
- Returns
- string Unescaped text
The documentation for this class was generated from the following file: