silverorange Code


Swat.SwatToolLink
/Swat/SwatToolLink.php at line 16

Class SwatToolLink

SwatObject
└─SwatUIObject
└─SwatWidget
└─SwatControl
└─SwatToolLink

public class SwatToolLink
extends SwatControl

A a tool link in the widget tree

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

Field Summary
string

$access_key

Access key for this link.

string

$content_type

Optional content type for the title of the link default text/plain use text/xml for XHTML fragments.

string

$link

The href attribute in the XHTML anchor tag.

protected string

$stock_class

A CSS class set by the stock_id of this tool link.

string

$stock_id

The stock id of this tool link.

string

$title

The title of this link.

mixed

$value

A value or array of values to substitute into the link of this cell.

Constructor Summary

SwatToolLink(string id)

Creates a new toollink.

Method Summary
void

display()

Displays this tool link.

protected array

getCSSClassNames()

Gets the array of CSS classes that are applied to this tool link.

protected SwatHtmlTag

getInsensitiveTag()

Gets the tag used to display this tool link when it is not sensitive.

protected SwatHtmlTag

getSensitiveTag()

Gets the tag used to display this tool link when it is sensitive.

void

init()

Initializes this widget.

void

setFromStock(string stock_id, boolean overwrite_properties)

Sets the values of this tool link to a stock type.

Methods inherited from Swat.SwatControl
addMessage, getNote, printWidgetTree
Methods inherited from Swat.SwatWidget
addCompositeWidget, addMessage, confirmCompositeWidgets, copy, createCompositeWidgets, display, displayHtmlHeadEntries, getCSSClassNames, getCompositeWidget, getCompositeWidgets, getFocusableHtmlId, getHtmlHeadEntrySet, getMessages, hasMessage, init, isDisplayed, isInitialized, isProcessed, isSensitive, printWidgetTree, process, replaceWithContainer
Methods inherited from Swat.SwatUIObject
addComment, addJavaScript, addStyleSheet, addTangoAttribution, copy, getCSSClassNames, getCSSClassString, getFirstAncestor, getHtmlHeadEntrySet, getInlineJavaScript, getUniqueId, isVisible

Field Detail

/Swat/SwatToolLink.php at line 84

access_key

public string $access_key = null

Access key for this link

Specifying an access key makes this tool link keyboard-accessible.


/Swat/SwatToolLink.php at line 48

content_type

public string $content_type = 'text/plain'

Optional content type for the title of the link default text/plain use text/xml for XHTML fragments


/Swat/SwatToolLink.php at line 32
public string $link = null

The href attribute in the XHTML anchor tag

Optionally uses vsprintf() syntax, for example:

<?php
$tool_link
->link 'MySection/MyPage/%s?id=%s';
?>

See Also:
SwatToolLink::$value

/Swat/SwatToolLink.php at line 94

stock_class

protected string $stock_class = null

A CSS class set by the stock_id of this tool link


/Swat/SwatToolLink.php at line 75

stock_id

public string $stock_id = null

The stock id of this tool link

Specifying a stock id initializes this tool link with a set of stock values.

See Also:
SwatToolLink::setFromStock()

/Swat/SwatToolLink.php at line 39

title

public string $title = null

The title of this link


/Swat/SwatToolLink.php at line 63

value

public mixed $value = null

A value or array of values to substitute into the link of this cell

The value property may be specified either as an array of values or as a single value. If an array is passed, a call to vsprintf() is done on the SwatToolLink::$link property. If the value is a string a single sprintf() call is made.

See Also:
SwatToolLink::$link

Constructor Detail

/Swat/SwatToolLink.php at line 106

SwatToolLink

public SwatToolLink(string id)

Creates a new toollink

Parameters:
id - a non-visible unique id for this widget.
See Also:
SwatWidget::__construct()

Method Detail

/Swat/SwatToolLink.php at line 140

display

public void display()

Displays this tool link


/Swat/SwatToolLink.php at line 252

getCSSClassNames

protected array getCSSClassNames()

Gets the array of CSS classes that are applied to this tool link

Returns:
the array of CSS classes that are applied to this tool link.
See Also:
SwatUIObject::getCSSClassString()

/Swat/SwatToolLink.php at line 305

getInsensitiveTag

protected SwatHtmlTag getInsensitiveTag()

Gets the tag used to display this tool link when it is not sensitive

Returns:
the tag used to display this tool link when it is not sensitive.

/Swat/SwatToolLink.php at line 276

getSensitiveTag

protected SwatHtmlTag getSensitiveTag()

Gets the tag used to display this tool link when it is sensitive

Returns:
the tag used to display this tool link when it is sensitive.

/Swat/SwatToolLink.php at line 126

init

public void init()

Initializes this widget

Loads properties from stock if $stock_id is set.

See Also:
SwatWidget::init()

/Swat/SwatToolLink.php at line 178

setFromStock

public void setFromStock(string stock_id, boolean overwrite_properties)

Sets the values of this tool link to a stock type

Valid stock type ids are:

Parameters:
stock_id - the identifier of the stock type to use.
overwrite_properties - whether to overwrite properties if they are already set.
Throws:
SwatUndefinedStockTypeException

silverorange Code