|
Perforce Chronicle 2012.2/486814
API Documentation
|
A drop-down button with a tooltip dialog. More...
Public Member Functions | |
| getValue () | |
| Get the rendered tooltip dialog. | |
| loadDefaultDecorators () | |
| Default decorators. | |
| setContent ($content) | |
| Set the content to put in the tooltip dialog. | |
| setHref ($href) | |
| Set the href to use for the tooltip dialog. | |
| setLabel ($label) | |
| Set the label to display in the button. | |
Public Attributes | |
| $dijitParams | |
| $helper = 'CustomDijit' | |
Protected Member Functions | |
| _getTooltipAttribs () | |
| Get the attributes to set on the tooltip element. | |
Protected Attributes | |
| $_content = null | |
| $_dialogDojoType = 'p4cms.ui.TooltipDialog' | |
| $_href = null | |
A drop-down button with a tooltip dialog.
To populate the tooltip dialog, set the href or content properties of the element.
| P4Cms_Form_Element_TooltipDialogButton::_getTooltipAttribs | ( | ) | [protected] |
Get the attributes to set on the tooltip element.
{
return array_merge(
$this->getAttribs(),
array(
'dojoType' => $this->_dialogDojoType,
'href' => $this->_href
)
);
}
| P4Cms_Form_Element_TooltipDialogButton::getValue | ( | ) |
Get the rendered tooltip dialog.
The custom dijit helper uses the value of the element to populate the content of the dijit - that is why we use getValue() to provide the rendered dialog.
{
$view = $this->getView();
return $view->customDijit(
$this->getId() . '-tooltip-dialog',
$this->_content,
$this->_getTooltipAttribs()
);
}
| P4Cms_Form_Element_TooltipDialogButton::loadDefaultDecorators | ( | ) |
Default decorators.
Uses only 'DijitElement' and 'DtDdWrapper' decorators by default.
{
if ($this->loadDefaultDecoratorsIsDisabled()) {
return;
}
$decorators = $this->getDecorators();
if (empty($decorators)) {
$this->addDecorator('DijitElement')
->addDecorator('DtDdWrapper');
}
}
| P4Cms_Form_Element_TooltipDialogButton::setContent | ( | $ | content | ) |
Set the content to put in the tooltip dialog.
| string | $content | the content to put in the tooltip dialog. |
{
$this->_content = (string) $content;
return $this;
}
| P4Cms_Form_Element_TooltipDialogButton::setHref | ( | $ | href | ) |
Set the href to use for the tooltip dialog.
| string | $href | the href to pass set on the tooltip dialog. |
{
$this->_href = (string) $href;
return $this;
}
| P4Cms_Form_Element_TooltipDialogButton::setLabel | ( | $ | label | ) |
Set the label to display in the button.
We implement this method to copy the label to dijit params.
| string | $label | the label to display in the button. |
{
$this->dijitParams['label'] = $label;
parent::setLabel($label);
return $this;
}
P4Cms_Form_Element_TooltipDialogButton::$_content = null [protected] |
P4Cms_Form_Element_TooltipDialogButton::$_dialogDojoType = 'p4cms.ui.TooltipDialog' [protected] |
Reimplemented in P4Cms_Form_Element_ConfirmTooltipButton.
P4Cms_Form_Element_TooltipDialogButton::$_href = null [protected] |
| P4Cms_Form_Element_TooltipDialogButton::$dijitParams |
array(
'dojoType' => 'dijit.form.DropDownButton',
)
| P4Cms_Form_Element_TooltipDialogButton::$helper = 'CustomDijit' |