MobileFrontend
MobileoptimisedfrontendforMediaWiki
MobilePage Class Reference

Retrieves information specific to a mobile page Currently this only provides helper functions for creating Page Thumbnail. More...

Public Member Functions

 __construct (Title $title, $file=false)
 
 getLatestTimestamp ()
 Retrieve timestamp when the page content was last modified. More...
 
 setLatestTimestamp ( $timestamp)
 Set rev_timestamp of latest edit to this page. More...
 
 getLatestEdit ()
 Retrieve the last edit to this page. More...
 
 getTitle ()
 Get the title of the page. More...
 
 hasThumbnail ()
 Check whether a page has a thumbnail associated with it. More...
 
 getSmallThumbnailHtml ( $useBackgroundImage=false)
 Get a small sized thumbnail in div container. More...
 

Static Public Member Functions

static getPlaceHolderThumbnailHtml ( $className, $iconClassName='')
 Get a placeholder div container for thumbnails. More...
 

Public Attributes

const SMALL_IMAGE_WIDTH = 150
 
const TINY_IMAGE_WIDTH = 80
 

Detailed Description

Retrieves information specific to a mobile page Currently this only provides helper functions for creating Page Thumbnail.

Todo:
FIXME: Rename this class when its purpose becomes clearer

Constructor & Destructor Documentation

◆ __construct()

MobilePage::__construct ( Title  $title,
  $file = false 
)
Parameters
Title$titlePage title
File | false$filePage image file

Member Function Documentation

◆ getLatestEdit()

MobilePage::getLatestEdit ( )

Retrieve the last edit to this page.

Returns
array defining edit with keys:
  • string name
  • string timestamp (Unix format)
  • string gender

◆ getLatestTimestamp()

MobilePage::getLatestTimestamp ( )

Retrieve timestamp when the page content was last modified.

Does not reflect null edits.

Returns
string|bool Timestamp (MW format) or false

◆ getPlaceHolderThumbnailHtml()

static MobilePage::getPlaceHolderThumbnailHtml (   $className,
  $iconClassName = '' 
)
static

Get a placeholder div container for thumbnails.

Parameters
string$classNameClass for element
string$iconClassNamecontrols size of thumbnail, defaults to empty string
Returns
string

◆ getSmallThumbnailHtml()

MobilePage::getSmallThumbnailHtml (   $useBackgroundImage = false)

Get a small sized thumbnail in div container.

Parameters
bool$useBackgroundImageWhether the thumbnail should have a background image
Returns
string

◆ getTitle()

MobilePage::getTitle ( )

Get the title of the page.

Returns
Title

◆ hasThumbnail()

MobilePage::hasThumbnail ( )

Check whether a page has a thumbnail associated with it.

Returns
Boolean whether the page has an image associated with it

◆ setLatestTimestamp()

MobilePage::setLatestTimestamp (   $timestamp)

Set rev_timestamp of latest edit to this page.

Parameters
string$timestampTimestamp (MW format)

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