function mb_str_pad($str, $len, $padstr = ' ', $padtype = STR_PAD_RIGHT, $enc = '') { if (!function_exists('mb_strlen')) { return str_pad($str, $len, $padstr, $padtype); } if ($enc === '') { $enc = mb_internal_encoding(); } $strlen = mb_strLen($str, $enc); $flen = $len - $strlen; if ($flen <= 0) { return $str; } $pad = str_repeat($padstr, $flen); switch ($padtype) { case STR_PAD_RIGHT: $pad = mb_subStr($pad, 0, $flen, $enc); return $str . $pad; case STR_PAD_LEFT: $pad = mb_subStr($pad, 0, $flen, $enc); return $pad . $str; case STR_PAD_BOTH: $flenh = $flen / 2; $padl = mb_subStr($pad, 0, floor($flenh), $enc); $padr = mb_subStr($pad, 0, ceil($flenh), $enc); return $padl . $str . $padr; default: trigger_error('mb_str_pad(): Padding type has to be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH.', E_USER_WARNING); return null; } }
echo '<a href="', gs_url($SECTION, $MODULE, null, 'bp_del_h=' . $p['host_id'] . '&edit=' . rawUrlEncode($edit_user) . '&action=edit' . '&name=' . rawUrlEncode($name) . '&number=' . rawUrlEncode($number) . '&page=' . $page . '&sort=' . $sort . '&sortorder=' . $sortorder), '" title="', __('entfernen'), '"><img alt="', __('entfernen'), '" src="', GS_URL_PATH, 'crystal-svg/16/act/editdelete.png" /></a>'; echo "</td>\n"; echo "</tr>\n"; ++$i; } echo '<tr class="', $i % 2 === 0 ? 'odd' : 'even', '">', "\n"; echo "<td> </td>\n"; echo '<td colspan="2">', "\n"; echo '<select name="bp_add_h">', "\n"; echo '<option value="">', __('hinzufügen ...'), '</option>', "\n"; $rs_hosts = $DB->execute('SELECT `id`, `host`, `comment` ' . 'FROM `hosts` ' . 'WHERE `is_foreign`=1 AND `id` NOT IN ( ' . 'SELECT `host_id` ' . 'FROM `boi_perms` ' . 'WHERE `user_id`=' . (int) $r['uid'] . ' AND `roles`<>\'\' ' . ') ' . 'ORDER BY `comment`'); echo '<optgroup label="', __('Fremd-Hosts'), '">', "\n"; while ($h = $rs_hosts->fetchRow()) { echo '<option value="', $h['id'], '">'; $comment = mb_subStr($h['comment'], 0, 25 + 1); if (mb_strLen($comment) > 25) { $comment = mb_subStr($h['comment'], 0, 25 - 1) . "…"; } elseif (trim($comment) === '') { $comment = '#' . $h['id']; } echo htmlEnt($comment), ' -- ', htmlEnt($h['host']); if ($h['id'] == $r['hid']) { echo ' (•)'; } echo '</option>', "\n"; } echo '</optgroup>', "\n"; echo '</select>', "\n"; echo '</td>', "\n"; echo "<td>\n"; //echo '[save]';
echo '<br class="nofloat" />', "\n"; echo '</div>', "\n"; echo '<div class="extensions-block">', "\n"; } $first_digit = $new_first_digit; //echo '<div class="first-digit">', $first_digit ,'</div>' ,"\n"; } echo '<div class="e e_ukn" id="e', $ext, '">'; echo '<span class="num">', $ext, '</span>'; //echo '<span class="nam">', $ext_info['abbr'] ,'</span>'; $ext_info['ln'] = $ext_info['ln']; $abbr = mb_strCut($ext_info['ln'], 0, 18 - strLen($ext) * 2.8); if (mb_strLen($abbr) < 9 && trim($ext_info['fn']) != '') { $abbr = mb_subStr($ext_info['fn'], 0, 1) . '. ' . $abbr; } if (mb_strLen($ext_info['ln']) > mb_strLen($abbr)) { $abbr = mb_strCut($abbr, 0, -1) . '.'; } echo '<span class="nam">', htmlEnt($abbr), '</span>'; echo '<span class="link" id="e', $ext, 'l"></span>'; echo '</div>', "\n"; } echo '<br class="nofloat" />', "\n"; echo '</div>', "\n"; } ?> <br />
/** * @return string * @param string $location */ public function trimSectionLocation($location) { return subStr($location, mb_strLen($this->location)); }
/** * @return int */ public function length() { return mb_strLen($this->value, $this->encoding); }