silverorange Code


Swat.Swat
/Swat/Swat.php at line 15

Class Swat

Swat

public class Swat

Container for package wide static methods

Copyright:
2005-2006 silverorange
License:
http://www.gnu.org/copyleft/lesser.html LGPL License 2.1

Field Summary
final mixed

GETTEXT_DOMAIN

The gettext domain for Swat.

final mixed

PACKAGE_ID

The package identifier.

Constructor Summary

Swat()

Don't allow instantiation of the Swat object.

Method Summary
static void

displayInlineJavaScript(string javascript)

Displays inline JavaScript properly encapsulating the script in a CDATA section.

static void

displayMethods(mixed object)

Displays the methods of an object.

static void

displayProperties(mixed object)

Displays the properties of an object.

static array

getDependencies()

Gets the packages this package depends on.

static string

gettext(string message)

Translates a phrase.

static string

ngettext(string singular_message, string plural_message, integer number)

Translates a plural phrase.

static void

printObject(mixed object)

Displays an object's properties and values recursively.

static void

setupGettext()

Field Detail

/Swat/Swat.php at line 29

GETTEXT_DOMAIN

public final mixed GETTEXT_DOMAIN = 'swat'

The gettext domain for Swat

This is used to support multiple locales.


/Swat/Swat.php at line 22

PACKAGE_ID

public final mixed PACKAGE_ID = 'Swat'

The package identifier


Constructor Detail

/Swat/Swat.php at line 207

Swat

public Swat()

Don't allow instantiation of the Swat object

This class contains only static methods and should not be instantiated.


Method Detail

/Swat/Swat.php at line 190

displayInlineJavaScript

public static void displayInlineJavaScript(string javascript)

Displays inline JavaScript properly encapsulating the script in a CDATA section

Parameters:
javascript - the inline JavaScript to display.

/Swat/Swat.php at line 114

displayMethods

public static void displayMethods(mixed object)

Displays the methods of an object

This is useful for debugging.

Parameters:
object - the object whose methods are to be displayed.

/Swat/Swat.php at line 135

displayProperties

public static void displayProperties(mixed object)

Displays the properties of an object

This is useful for debugging.

Parameters:
object - the object whose properties are to be displayed.

/Swat/Swat.php at line 176

getDependencies

public static array getDependencies()

Gets the packages this package depends on

Returns:
an array of package IDs that this package depends on.

/Swat/Swat.php at line 61

gettext

public static string gettext(string message)

Translates a phrase

This method relies on the php gettext extension and uses dgettext() internally.

Parameters:
message - the phrase to be translated.
Returns:
the translated phrase.

/Swat/Swat.php at line 89

ngettext

public static string ngettext(string singular_message, string plural_message, integer number)

Translates a plural phrase

This method should be used when a phrase depends on a number. For example, use ngettext when translating a dynamic phrase like:

This method relies on the php gettext extension and uses dngettext() internally.

Parameters:
singular_message - the message to use when the number the phrase depends on is one.
plural_message - the message to use when the number the phrase depends on is more than one.
number - the number the phrase depends on.
Returns:
the translated phrase.

/Swat/Swat.php at line 163

printObject

public static void printObject(mixed object)

Displays an object's properties and values recursively

Note:

If the object being printed is a UI object then its parent property is temporarily set to null to prevent recursing up the widget tree.

Parameters:
object - the object to display.

/Swat/Swat.php at line 98

setupGettext

public static void setupGettext()

silverorange Code