mirror of
https://github.com/webmin/webmin.git
synced 2025-07-20 16:48:46 +00:00
Add ui_element_inline
API and use it on the button in **Net** module
This commit is contained in:
File diff suppressed because one or more lines are too long
@ -227,10 +227,10 @@ if ($b && $b->{'virtual'} eq "" && !$in{'new'}) {
|
||||
}
|
||||
$vlink = "";
|
||||
if ($access{'virt'} && !$noos_support_add_virtifcs) {
|
||||
$vlink = "(<a href='edit_bifc.cgi?new=1&virtual=$b->{'name'}'>".
|
||||
"$text{'ifcs_addvirt'}</a>)\n";
|
||||
$vlink = &ui_element_inline("(<a href='edit_bifc.cgi?new=1&virtual=$b->{'name'}'>".
|
||||
"$text{'ifcs_addvirt'}</a>)\n", 'button');
|
||||
}
|
||||
print &ui_table_row($text{'ifcs_virts'}, $vcount." ".$vlink);
|
||||
print &ui_table_row($text{'ifcs_virts'}, &ui_text_wrap($vcount)." ".$vlink);
|
||||
}
|
||||
|
||||
# Special parameters for teaming
|
||||
|
22
ui-lib.pl
22
ui-lib.pl
@ -2804,7 +2804,7 @@ if (defined(&theme_ui_div_row)) {
|
||||
return &theme_ui_div_row(@_);
|
||||
}
|
||||
my ($label, $content) = @_;
|
||||
return "<div class='ui_div_row'><span>$label</span><span>$content</span></div>";
|
||||
return "<div class='ui_div_row'><span>$label</span><span>$content</span></div>\n";
|
||||
}
|
||||
|
||||
=head2 ui_space(number)
|
||||
@ -2819,7 +2819,7 @@ if (defined(&theme_ui_space)) {
|
||||
}
|
||||
my ($number) = @_;
|
||||
$number ||= 1;
|
||||
return "<span class='ui_space'>".(" " x $number)."</span>";
|
||||
return "<span class='ui_space'>".(" " x $number)."</span>\n";
|
||||
}
|
||||
|
||||
=head2 ui_newline(number)
|
||||
@ -2834,7 +2834,7 @@ if (defined(&theme_ui_newline)) {
|
||||
}
|
||||
my ($number) = @_;
|
||||
$number ||= 1;
|
||||
return "<span class='ui_newline'>".("<br>" x $number)."</span>";
|
||||
return "<span class='ui_newline'>".("<br>" x $number)."</span>\n";
|
||||
}
|
||||
|
||||
=head2 ui_text_wrap(text)
|
||||
@ -2848,7 +2848,21 @@ if (defined(&theme_ui_text_wrap)) {
|
||||
return &theme_ui_text_wrap(@_);
|
||||
}
|
||||
my ($text) = @_;
|
||||
return "<span class='ui_text_wrap'>$text</span>";
|
||||
return "<span class='ui_text_wrap'>$text</span>\n";
|
||||
}
|
||||
|
||||
=head2 ui_element_inline(text)
|
||||
|
||||
Wraps any text into span tags
|
||||
|
||||
=cut
|
||||
sub ui_element_inline
|
||||
{
|
||||
if (defined(&theme_ui_element_inline)) {
|
||||
return &theme_ui_element_inline(@_);
|
||||
}
|
||||
my ($element, $type) = @_;
|
||||
return "<span data-element='$type' class='ui_element_inline'>$element</span>\n";
|
||||
}
|
||||
|
||||
=head2 ui_paginations(&array, &opts)
|
||||
|
Reference in New Issue
Block a user