>> YANA 4 PHP Framework >> Docs For Class Microsummary

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

Located in /plugins/default_library/class_microsummary.php

Utility
   |
   --Microsummary
Method Summary
  • boolean get (string $id)
  • boolean publish (string $id)
  • boolean set (string $id, string $text)

Methods

get a microsummary
boolean 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
boolean 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);

  • access: public
set a microsummary
boolean 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 Sun, 11 Mar 2007 15:02:38 +0100 by phpDocumentor 1.3.1

yana author: Thomas MeyerHomepage: www.yanaframework.net