MobileFrontend
Mobile optimised frontend for MediaWiki
Loading...
Searching...
No Matches
MobileFrontend\Models\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.
 
 setLatestTimestamp ( $timestamp)
 Set rev_timestamp of latest edit to this page.
 
 getLatestEdit ()
 Retrieve the last edit to this page.
 
 getTitle ()
 Get the title of the page.
 
 hasThumbnail ()
 Check whether a page has a thumbnail associated with it.
 
 getSmallThumbnailHtml ( $useBackgroundImage=false)
 Get a small sized thumbnail in div container.
 

Static Public Member Functions

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

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()

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

Member Function Documentation

◆ getLatestEdit()

MobileFrontend\Models\MobilePage::getLatestEdit ( )

Retrieve the last edit to this page.

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

◆ getLatestTimestamp()

MobileFrontend\Models\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 MobileFrontend\Models\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()

MobileFrontend\Models\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()

MobileFrontend\Models\MobilePage::getTitle ( )

Get the title of the page.

Returns
Title

◆ hasThumbnail()

MobileFrontend\Models\MobilePage::hasThumbnail ( )

Check whether a page has a thumbnail associated with it.

Returns
bool whether the page has an image associated with it

◆ setLatestTimestamp()

MobileFrontend\Models\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: