diff --git a/mysql/index.cgi b/mysql/index.cgi index a97c900c5..b5a4fa79a 100755 --- a/mysql/index.cgi +++ b/mysql/index.cgi @@ -82,7 +82,10 @@ if ($r == 0) { print &ui_alert_box($text{'index_notrun'}, 'danger'); if ($rout) { - print &ui_details($text{'syslog_desc2'}, &text('index_emsg', "$rout"), 'error'); + print &ui_details({ + 'title' => $text{'syslog_desc2'}, + 'content' => &text('index_emsg',"$rout"), + 'class' =>'error'}); } if ($access{'stop'} && &is_mysql_local()) { @@ -102,8 +105,12 @@ elsif ($r == -1) { print &ui_alert_box($text{'index_nopass'}, 'warn'); if ($rout) { - print &ui_details($text{'syslog_desc2'}, &text('index_emsg', "$rout"), 'error') . "
"; - } + print &ui_details({ + 'title' => $text{'syslog_desc2'}, + 'content' => &text('index_emsg',"$rout"), + 'class' => 'error', + 'open' => 'open'}) . "
"; + } print &ui_form_start("login.cgi", "post"); print &ui_table_start($text{'index_ltitle'}, undef, 2); diff --git a/ui-lib.pl b/ui-lib.pl index da7585892..3bf83525a 100755 --- a/ui-lib.pl +++ b/ui-lib.pl @@ -2731,15 +2731,16 @@ the widget is toggled into an "open" state. =cut sub ui_details { -my ($title, $content, $class) = @_; +my ($c) = @_; if (defined(&theme_ui_details)) { return &theme_ui_details(@_); } + my $rv; -$class = " class=\"$class\"" if($class); -$rv = ""; -$rv .= "$title"; -$rv .= "$content"; +$c->{'class'} = "class=\"$c->{'class'}\"" if($c->{'class'}); +$rv = "
{'class'} $c->{'open'}>"; +$rv .= "$c->{'title'}"; +$rv .= "$c->{'content'}"; $rv .= "
"; return $rv; }