Back to ModulepositionField class

Method getInput

protected string
getInput
()
Method to get the field input markup.
Returns
  • string The field input markup.
Since
  • 1.6

Method getInput - Source code

/**
 * Method to get the field input markup.
 *
 * @return  string	The field input markup.
 *
 * @since   1.6
 */
protected function getInput()
{
    // Build the script.
    $script = array();
    $script[] = '	function jSelectPosition_' . $this->id . '(name) {';
    $script[] = '		document.getElementById("' . $this->id . '").value = name;';
    $script[] = '		jModalClose();';
    $script[] = '	}';
    // Add the script to the document head.
    Factory::getDocument()->addScriptDeclaration(implode("\n", $script));
    // Setup variables for display.
    $html = array();
    $link = 'index.php?option=com_modules&view=positions&layout=modal&tmpl=component&function=jSelectPosition_' . $this->id . '&client_id=' . $this->clientId;
    // The current user display field.
    $html[] = '<div class="input-append">';
    $html[] = parent::getInput() . '<a class="btn" title="' . Text::_('COM_MODULES_CHANGE_POSITION_TITLE') . '" href="' . $link . '" data-bs-toggle="modal" data-bs-target="#modulePositionModal">' . Text::_('COM_MODULES_CHANGE_POSITION_BUTTON') . '</a>';
    $html[] = HTMLHelper::_('bootstrap.renderModal', 'modulePositionModal', array('url' => $link, 'title' => Text::_('COM_MODULES_CHANGE_POSITION_BUTTON'), 'height' => '100%', 'width' => '100%', 'modalWidth' => '800', 'bodyHeight' => '450', 'footer' => '<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" aria-hidden="true">' . Text::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</button>'));
    $html[] = '</div>';
    return implode("\n", $html);
}