Displays a link, or a button if the link's URL is too large, to
accommodate some browsers' limitations
public static linkOrButton ( string $url, string $message, mixed $tag_params = [], boolean $new_form = true, boolean $strip_img = false, string $target = '', boolean $force_button = false ) : string | ||
$url | string | the URL |
$message | string | the link message |
$tag_params | mixed | string: js confirmation array: additional tag params (f.e. style="") |
$new_form | boolean | we set this to false when we are already in a form, to avoid generating nested forms |
$strip_img | boolean | whether to strip the image |
$target | string | target |
$force_button | boolean | use a button even when the URL is not too long |
Результат | string | the results to be echoed or saved in an array |
/** * Prepares a Delete link * * @param string $del_url delete url * @param string $del_str text for the delete link * @param string $js_conf text for the JS confirmation * @param string $class css classes for the td element * * @return string the generated HTML * * @access private * * @see _getTableBody(), _getCheckboxAndLinks() */ private function _getDeleteLink($del_url, $del_str, $js_conf, $class) { $ret = ''; if (empty($del_url)) { return $ret; } $ret .= '<td class="'; if (!empty($class)) { $ret .= $class . ' '; } $ajax = Response::getInstance()->isAjax() ? ' ajax' : ''; $ret .= 'center print_ignore" ' . ' >' . Util::linkOrButton($del_url, $del_str, array('class' => 'delete_row requireConfirm' . $ajax), false) . '<div class="hide">' . $js_conf . '</div>' . '</td>'; return $ret; }