mirror of
https://github.com/webmin/webmin.git
synced 2026-03-20 16:50:24 +00:00
Add UI lib for adding text color
This commit is contained in:
File diff suppressed because one or more lines are too long
33
ui-lib.pl
33
ui-lib.pl
@@ -1026,9 +1026,9 @@ if (defined($opts_title)) {
|
||||
$rv .= "<tr class='ui_multi_select_row'>";
|
||||
$rv .= "<td>".&ui_select($name."_opts", [ ], $leftover,
|
||||
$size, 1, 0, $dis, $wstyle)."</td>\n";
|
||||
$rv .= "<td>".&ui_button("▶", $name."_add", $dis,
|
||||
$rv .= "<td>".&ui_button("â¶", $name."_add", $dis,
|
||||
"onClick='multi_select_move(\"$name\", form, 1)'")."<br>".
|
||||
&ui_button("◀", $name."_remove", $dis,
|
||||
&ui_button("â", $name."_remove", $dis,
|
||||
"onClick='multi_select_move(\"$name\", form, 0)'")."</td>\n";
|
||||
$rv .= "<td>".&ui_select($name."_vals", [ ], $values,
|
||||
$size, 1, 0, $dis, $wstyle)."</td>\n";
|
||||
@@ -2418,6 +2418,35 @@ $rv .= "</center>\n";
|
||||
return $rv;
|
||||
}
|
||||
|
||||
=head2 ui_text_type(text, type)
|
||||
|
||||
Returns HTML for a text string, with its color determined by $type.
|
||||
|
||||
=item text - contains any text string
|
||||
|
||||
=item type - returned text color
|
||||
|
||||
=cut
|
||||
|
||||
sub ui_text_type
|
||||
{
|
||||
my ($text, $type) = @_;
|
||||
my ($rv, $color);
|
||||
|
||||
if (defined (&theme_ui_text_type)) {
|
||||
return &theme_ui_text_type(@_);
|
||||
}
|
||||
|
||||
if ($type eq "success") { $color = "3c763d"; }
|
||||
elsif ($type eq "info") { $color = "31708f"; }
|
||||
elsif ($type eq "warn") { $color = "8a6d3b"; }
|
||||
elsif ($type eq "danger") { $color = "a94442"; }
|
||||
|
||||
$rv .= "<span class='ui_text_type text_type_$type' style='color: #$color'>$text</span>\n";
|
||||
|
||||
return $rv;
|
||||
}
|
||||
|
||||
=head2 ui_alert_box(msg, type)
|
||||
|
||||
Returns HTML for an alert box, with background color determined by $type.
|
||||
|
||||
Reference in New Issue
Block a user