mirror of
https://github.com/webmin/webmin.git
synced 2025-07-20 16:48:46 +00:00
Add new API: ui_space
, ui_newline
, ui_text
Nothing can be thrown to the browser without being used with UI lib!
This commit is contained in:
File diff suppressed because one or more lines are too long
@ -1041,7 +1041,7 @@ sub edit_LimitRequestBody
|
||||
{
|
||||
return (1, $text{'core_maxbody'},
|
||||
&opt_input($_[0]->{'value'}, "LimitRequestBody", $text{'core_default'}, 8)
|
||||
.$text{'bytes'});
|
||||
.&ui_space(2).$text{'bytes'});
|
||||
}
|
||||
sub save_LimitRequestBody
|
||||
{
|
||||
@ -1052,7 +1052,7 @@ sub edit_LimitXMLRequestBody
|
||||
{
|
||||
return (1, $text{'core_maxxml'},
|
||||
&opt_input($_[0]->{'value'}, "LimitXMLRequestBody",
|
||||
$text{'core_default'}, 8).$text{'bytes'});
|
||||
$text{'core_default'}, 8).&ui_space(2).$text{'bytes'});
|
||||
}
|
||||
sub save_LimitXMLRequestBody
|
||||
{
|
||||
|
@ -13,6 +13,7 @@ sub edit_SuexecUserGroup
|
||||
local $rv;
|
||||
$rv .= sprintf "<input type=radio name=SuexecUserGroup_def value=1 %s> %s\n",
|
||||
$_[0] ? "" : "checked", $text{'suexec_none'};
|
||||
$rv .= &ui_newline();
|
||||
$rv .= sprintf "<input type=radio name=SuexecUserGroup_def value=0 %s>\n",
|
||||
$_[0] ? "checked" : "";
|
||||
$rv .= sprintf "%s <input name=SuexecUserGroup_u size=8 value='%s'> %s\n",
|
||||
|
44
ui-lib.pl
44
ui-lib.pl
@ -2807,6 +2807,50 @@ my ($label, $content) = @_;
|
||||
return "<div class='ui_div_row'><span>$label</span><span>$content</span></div>";
|
||||
}
|
||||
|
||||
=head2 ui_space(number)
|
||||
|
||||
Prints no breakable space number of given times
|
||||
|
||||
=cut
|
||||
sub ui_space
|
||||
{
|
||||
if (defined(&theme_ui_space)) {
|
||||
return &theme_ui_space(@_);
|
||||
}
|
||||
my ($number) = @_;
|
||||
$number ||= 1;
|
||||
return "<span class='ui_space'>".(" " x $number)."</span>";
|
||||
}
|
||||
|
||||
=head2 ui_newline(number)
|
||||
|
||||
Prints new lines given number of times
|
||||
|
||||
=cut
|
||||
sub ui_newline
|
||||
{
|
||||
if (defined(&theme_ui_newline)) {
|
||||
return &theme_ui_newline(@_);
|
||||
}
|
||||
my ($number) = @_;
|
||||
$number ||= 1;
|
||||
return "<span class='ui_newline'>".("<br>" x $number)."</span>";
|
||||
}
|
||||
|
||||
=head2 ui_text(text)
|
||||
|
||||
Wraps any text into span tags
|
||||
|
||||
=cut
|
||||
sub ui_text
|
||||
{
|
||||
if (defined(&theme_ui_text)) {
|
||||
return &theme_ui_text(@_);
|
||||
}
|
||||
my ($text) = @_;
|
||||
return "<span>$text</span>";
|
||||
}
|
||||
|
||||
=head2 ui_paginations(&array, &opts)
|
||||
|
||||
Given an array reference, slice it and return hash
|
||||
|
Reference in New Issue
Block a user