yana

phpDocumentor v 1.4.0

Class Microsummary

Description

«utility» Microsummary
This class provides static methods to read and write persistent microsummaries.
"Microsummaries" are a Firefox 2.0 feature that allows users to create dynamic bookmark titles that automatically update when the content of the bookmarked page changes.
Have a look at what microsummaries can be:
  • the numbers of downloads of a file on a download site
  • the latest news on a news page
  • current number of unread e-mail in the inbox of a webmail service
  • current total of donations to a project
  • the date of latest updates on a database
  • the latest submission to a guestbook or forum
  • the number of visitors currently online in a chat room
  • the latest stock values aso.
Examples of usage:
  1. Setting a microsummary from a plugin:
    1. Microsummary::set($this->name'Summary text');
  2. Retrieving a microsummary in a plugin:
    1. $microsummary Microsummary::get($this->name);
  3. To indicate that a microsummary exists for your plugin add this to your output function
    1. Microsummary::publish($this->name);
  4. Calling a microsummary from a browser:
    1. index.php?action=get_microsummary&target=guestbook
    (where 'guestbook' is the name of the plugin)
  • access: public
Utility
   |
   --Microsummary
Method Summary
  • bool get (string $id)
  • bool publish (string $id)
  • bool set (string $id, string $text)

Methods

get a microsummary
bool get (
string $id
)
List of parameters:
Name Type Description
$id string identifies the summary to get
Description:
Reads the microsummary string identified by $id and returns it. This function returns bool(false) if no corresponding summary exists.
Example of usage:
Retrieving a microsummary in a plugin:
  1. $microsummary Microsummary::get($this->name);
  • access: public
publish a microsummary
bool publish (
string $id
)
List of parameters:
Name Type Description
$id string identifies the summary to get
Description:
Adds the microsummary identified by $id to the list of microsummaries to be printed to the browser.
Example of usage:
Add this to your output function
  1. Microsummary::publish($this->name);
Returns bool(false) on error.
  • access: public
set a microsummary
bool set (
string $id, string $text
)
List of parameters:
Name Type Description
$id string identifies the summary to get
$text string the text of the microsummary
Description:
Saves the microsummary string identified by $id for later use. This function returns bool(false) if the input is invalid or the entry could not be saved.
Example of usage:
Retrieving a microsummary in a plugin:
  1. $microsummary Microsummary::get($this->name);
  • access: public
inherited from base classes

Inherited From Utility

Documentation generated on Sat, 03 Jan 2009 22:22:30 +0100 by phpDocumentor 1.4.0

yana author: Thomas MeyerHomepage: www.yanaframework.net