PHP Class View_Button, atk4

(c) 2008-2011 Romans Malinovskis Distributed under Affero General Public License v3 See http://agiletoolkit.org/about/license =====================================================ATK4=
Inheritance: extends View_HtmlElement
Exibir arquivo Open project: atk4/atk4 Class Usage Examples

Public Properties

Property Type Description
$icon This property looks quite obsolete
$js_active_class jQuery-UI class for active (selected) button
$js_triangle_class jQuery-UI class for triangle, down arrow button
$menu Menu_jUI
$menu_class Menu class
$options Options to pass to JS button widget
$popover_class Popover class
$virtual_page VirtualPage

Protected Properties

Property Type Description
$js_button_called boolean

Public Methods

Method Description
addMenu ( array $options = [], boolean $vertical = false ) : Menu Show menu when clicked. For example, dropdown menu.
addPopover ( array $js_options = [], array $class_options = null ) : View_Popover When button is clicked, opens a frame containing generic view.
addSplitButton ( array $options = null ) : Button Adds another button after this one with an arrow and returns it.
defaultTemplate ( ) Set template of button element.
getPosition ( boolean $vertical = false ) : array Return array with position settings for JS.
isClicked ( string $message = null ) : boolean Add click handler on button and returns true if button was clicked.
jsButton ( )
link ( string $page, array $args = [] ) Set button as HTML link object .
onClick ( callback $callback, string $confirm_msg = null ) Add click handler on button and executes $callback if button was clicked.
onClickConsole ( callable $callback, string $title = null ) Add click handler on button, that will execute callback. Similar to onClick, however output from callback execution will appear in a dialog window with a console.
render ( ) Render button.
setIcon ( string $icon ) Sets icon for button.
setLabel ( string | array $label ) Sets label of button.
setNoText ( string $icon = null ) Set button without text and optionally with icon.

Method Details

addMenu() public method

Show menu when clicked. For example, dropdown menu.
public addMenu ( array $options = [], boolean $vertical = false ) : Menu
$options array Options to pass to Menu class
$vertical boolean Direction of menu (false=horizontal, true=vertical)
return Menu

addPopover() public method

Because this is based on a dialog (popover), this is a modal action even though it does not add dimming / transparency.
public addPopover ( array $js_options = [], array $class_options = null ) : View_Popover
$js_options array Options to pass to popover JS widget
$class_options array Options to pass to popover PHP class
return View_Popover

addSplitButton() public method

Adds another button after this one with an arrow and returns it.
public addSplitButton ( array $options = null ) : Button
$options array Options to pass to new Button class
return Button New button object (button with triangle)

defaultTemplate() public method

Set template of button element.
public defaultTemplate ( )

getPosition() public method

Return array with position settings for JS.
public getPosition ( boolean $vertical = false ) : array
$vertical boolean Direction of menu (false=horizontal, true=vertical)
return array

isClicked() public method

Add click handler on button and returns true if button was clicked.
public isClicked ( string $message = null ) : boolean
$message string Confirmation question to ask
return boolean

jsButton() public method

public jsButton ( )
Add click handler on button and executes $callback if button was clicked.
public onClick ( callback $callback, string $confirm_msg = null )
$callback callback Callback function to execute
$confirm_msg string Confirmation question to ask

onClickConsole() public method

Add click handler on button, that will execute callback. Similar to onClick, however output from callback execution will appear in a dialog window with a console.
public onClickConsole ( callable $callback, string $title = null )
$callback callable
$title string

render() public method

Render button.
public render ( )

setIcon() public method

Sets icon for button.
public setIcon ( string $icon )
$icon string Icon CSS class

setLabel() public method

Sets label of button.
public setLabel ( string | array $label )
$label string | array

setNoText() public method

Set button without text and optionally with icon.
public setNoText ( string $icon = null )
$icon string Icon CSS class

Property Details

$icon public_oe property

This property looks quite obsolete
public $icon

$js_active_class public_oe property

jQuery-UI class for active (selected) button
public $js_active_class

$js_button_called protected_oe property

protected bool $js_button_called
return boolean

$js_triangle_class public_oe property

jQuery-UI class for triangle, down arrow button
public $js_triangle_class

$menu public_oe property

public Menu_jUI $menu
return Menu_jUI

$menu_class public_oe property

Menu class
public $menu_class

$options public_oe property

Options to pass to JS button widget
public $options

$popover_class public_oe property

Popover class
public $popover_class

$virtual_page public_oe property

public VirtualPage $virtual_page
return VirtualPage