Class mobileOKPythiaForWordpress

Description

The mobileOKPythiaForWordpress class contains the logic of the mobileOK Pythia plugin for Wordpress for regular non-admin pages.

The class wraps the common AskPythia and TransPythia libraries for use in Wordpress, and registers the hooks handled by the plugin to generate mobileOK content.

The mobileOK Pythia plugin is designed to help generate a mobileOK version of a blog.

Located in /plugins/wordpress/mobileOKPythia/includes/mobileOKPythiaForWordpress.php (line 54)


	
			
Method Summary
string addPaginationParameter (string $uri)
void addPowderLink ()
string getContentType ()
array(string=>string) getHttpHeaders ($headers $headers)
void init ()
void switchTemplate ()
string transcodeContent ($content $content)
Methods
Constructor __construct (line 80)

Creates an empty instance of the mobileOKPythia class

  • return: new mobileOKPythia instance.
  • access: public
A __construct ()
addPaginationParameter (line 505)

Adds the pagination parameter to the URI when browsing through comments on a mobile device.

  • return: The updated URI
string addPaginationParameter (string $uri)
  • string $uri: The URI of the prev/next link to comments
addPowderLink (line 444)

Serves the page with an HTTP Link header to a POWDER file that asserts that the blog is mobileOK.

void addPowderLink ()
deleteRegisteredScripts (line 269)

Deletes scripts that registered in Wordpress when the requesting device does not support scripting.

This method is a wrapper around the TranscodingActionDeleteWordpressScripts transcoding action.

void deleteRegisteredScripts ()
getContentType (line 220)

Determines the Content-Type that should be used based on the Accept HTTP header sent by the requesting device.

  • return: 'application/xhtml+xml' or 'text/html', depending on whether the requesting device supports the XHTML media type
  • access: public
string getContentType ()
getHttpHeaders (line 163)

Make sure that content can be cached a bit.

TODO: adds the possibility to define the max-age setting.

  • return: List of HTTP headers to send.
  • access: public
array(string=>string) getHttpHeaders ($headers $headers)
  • $headers $headers: List of HTTP headers that are about to be sent.
getNumberOfCommentsPerPage (line 489)

Forces a low number of comments per page when browsing the site on a mobile device.

  • return: when requesting device is a mobile, false otherwise (will use default value)
2 getNumberOfCommentsPerPage ()
getNumberOfPostsPerPage (line 473)

Forces a low number of posts per page when browsing the site on a mobile device.

  • return: when requesting device is a mobile, false otherwise (will use default value)
2 getNumberOfPostsPerPage ()
getTranscoder (line 324)

Retrieves a transcoder that applies to HTML content.

The transcoding actions are selected based on the options of the plugin.

  • return: a transcoder initialized with transcoding actions.
Transcoder getTranscoder ()
init (line 87)

Initializes this instance, i.e. registers the hooks and prepares the identification of the requesting device.

  • access: public
void init ()
switchTemplate (line 244)

Switches template based on the requesting device.

A mobile template is used when the requesting device is identified as mobile, the regular desktop template is used otherwise.

This method is a wrapper around the TranscodingActionSwitchTemplate transcoding action.

  • access: public
void switchTemplate ()
transcodeContent (line 295)

Transcodes content before delivery.

  • return: transcoded content.
string transcodeContent ($content $content)
  • $content $content: string The content to transcode.

Documentation generated on Tue, 17 Nov 2009 19:00:39 +0100 by phpDocumentor 1.4.2