CollaborationKit
MediaWiki CollaborationKit extension
Loading...
Searching...
No Matches
CollaborationKitImage Class Reference

Static Public Member Functions

static makeImage ( $image, $width, $options=[])
 Generate an image element from the wiki or the extension.
 
static getCannedIcons ()
 

Static Protected Member Functions

static makeImageFromFile ( $imageObj, $width, $link, $renderAsWikitext, $label, $squareAdjustmentAxis)
 
static makeImageFromIcon ( $image, $width, $colour, $link, $renderAsWikitext, $label)
 
static linkFactory ( $imageHtml, $link, $label, $imageObj=null)
 

Member Function Documentation

◆ getCannedIcons()

static CollaborationKitImage::getCannedIcons ( )
static
Returns
array All the canned icons in CollaborationKit
+ Here is the caller graph for this function:

◆ linkFactory()

static CollaborationKitImage::linkFactory ( $imageHtml,
$link,
$label,
$imageObj = null )
staticprotected
Parameters
string$imageHtml
Title | string$link
string$label
null | File$imageObj
Returns
string
+ Here is the caller graph for this function:

◆ makeImage()

static CollaborationKitImage::makeImage ( $image,
$width,
$options = [] )
static

Generate an image element from the wiki or the extension.

Parameters
string | null$imageThe filename (no namespace prefix) or CollaborationKit icon identifier (or null to use fallback instead)
int$widthThe width of the image in pixels
array$optionsAn array with optional parameters:
  • array $options['classes'] Array of element classes to assign
  • Title|string|bool $options['link'] Internal link for the image; default is true (i.e. link to its description page). Pass false for no link at all. Pass a string to link to a page in the manner of an internal wiki link.
  • string $options['colour'] The colour of the icon if using a canned icon
  • string $options['css'] In-line style parameters. Avoid if possible.
  • bool $options['renderAsWikitext'] Should the output be wikitext instead of HTML? Defaults to false.
  • string $options['label'] Label to put under image; used for ToC icons
  • string $options['fallback'] If the specified image is null or doesn't exist. Valid options are 'none', a valid icon ID, or an arbitrary string to use a seed. (Note: if you specify a label, then that will serve as the fallback.)
  • bool $options['optimizeForSquare'] Fetch an image such that it's ideal for shoving into a square frame. Default is false. Images with labels always get optimzied for squares.
Returns
string HTML elements or wikitext, depending on $options['renderAsWikitext']
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ makeImageFromFile()

static CollaborationKitImage::makeImageFromFile ( $imageObj,
$width,
$link,
$renderAsWikitext,
$label,
$squareAdjustmentAxis )
staticprotected
Parameters
File$imageObj
int$width
string$link
bool$renderAsWikitext
string$label
string | null$squareAdjustmentAxisx or y
Returns
string
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ makeImageFromIcon()

static CollaborationKitImage::makeImageFromIcon ( $image,
$width,
$colour,
$link,
$renderAsWikitext,
$label )
staticprotected
Parameters
string$image
int$width
string$colour
string$link
bool$renderAsWikitext
string$label
Returns
string
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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