value > 0 ? (int) $this->value : '';
// Build the script.
$script = array();
// Select button script
$script[] = 'function jSelectAssociation_' . $this->id . '(id) {';
$script[] = ' target = document.getElementById("target-association");';
$script[] = ' document.getElementById("target-association").src = target.getAttribute("data-editurl") + '
. '"&task=" + target.getAttribute("data-item") + ".edit" + "&id=" + id';
$script[] = ' jQuery("#associationSelect' . $this->id . 'Modal").modal("hide");';
$script[] = '}';
// Add the script to the document head.
JFactory::getDocument()->addScriptDeclaration(implode("\n", $script));
// Setup variables for display.
$html = array();
$linkAssociations = 'index.php?option=com_associations&view=associations&layout=modal&tmpl=component'
. '&forcedItemType=' . JFactory::getApplication()->input->get('itemtype', '', 'string') . '&function=jSelectAssociation_' . $this->id;
$linkAssociations .= "&forcedLanguage=' + document.getElementById('target-association').getAttribute('data-language') + '";
$urlSelect = $linkAssociations . '&' . JSession::getFormToken() . '=1';
// Select custom association button
$html[] = ''
. ''
. ''
. '';
// Clear association button
$html[] = '';
$html[] = '';
// Select custom association modal
$html[] = JHtml::_(
'bootstrap.renderModal',
'associationSelect' . $this->id . 'Modal',
array(
'title' => JText::_('COM_ASSOCIATIONS_SELECT_TARGET'),
'backdrop' => 'static',
'url' => $urlSelect,
'height' => '400px',
'width' => '800px',
'bodyHeight' => '70',
'modalWidth' => '80',
'footer' => ''
. JText::_("JLIB_HTML_BEHAVIOR_CLOSE") . '',
)
);
return implode("\n", $html);
}
}