Skip to content

Commit

Permalink
*Replace more links with &ui_link call
Browse files Browse the repository at this point in the history
  • Loading branch information
pcfreak30 committed Jun 8, 2014
1 parent 95b0bc7 commit 990d7d3
Show file tree
Hide file tree
Showing 64 changed files with 110 additions and 110 deletions.
4 changes: 2 additions & 2 deletions bacula-backup/bacula-backup-lib.pl
Expand Up @@ -1317,10 +1317,10 @@ sub joblink
}
else {
if ($j) {
return "<a href='edit_gjob.cgi?name=".&urlize($j)."'>$j ($c)</a>";
return &ui_link("edit_gjob.cgi?name=".&urlize($j)."","$j ($c)");
}
else {
return "<a href='edit_job.cgi?name=".&urlize($name)."'>$name</a>";
return &ui_link("edit_job.cgi?name=".&urlize($name)."",$name);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion bacula-backup/list_clients.cgi
Expand Up @@ -34,7 +34,7 @@ if (@clients) {
}
else {
print "<b>$text{'clients_none'}</b><p>\n";
print "<a href='edit_client.cgi?new=1'>$text{'clients_add'}</a><br>\n";
print &ui_link("edit_client.cgi?new=1",$text{'clients_add'})<br>\n";
}
&ui_print_footer("", $text{'index_return'});
Expand Down
2 changes: 1 addition & 1 deletion bacula-backup/list_devices.cgi
Expand Up @@ -34,7 +34,7 @@ if (@devices) {
}
else {
print "<b>$text{'devices_none'}</b><p>\n";
print "<a href='edit_device.cgi?new=1'>$text{'devices_add'}</a><br>\n";
print &ui_link("edit_device.cgi?new=1",$text{'devices_add'})<br>\n";
}
&ui_print_footer("", $text{'index_return'});
Expand Down
6 changes: 3 additions & 3 deletions bacula-backup/list_fdirectors.cgi
Expand Up @@ -11,7 +11,7 @@ if (@fdirectors) {
print &ui_form_start("delete_fdirectors.cgi", "post");
print &select_all_link("d"),"\n";
print &select_invert_link("d"),"\n";
print "<a href='edit_fdirector.cgi?new=1'>$text{'fdirectors_add'}</a><br>\n";
print &ui_link("edit_fdirector.cgi?new=1",$text{'fdirectors_add'})<br>\n";
@tds = ( "width=5", "width=30%", "width=70%" );
print &ui_columns_start([ "", $text{'fdirectors_name'},
$text{'fdirectors_pass'} ], "100%", 0, \@tds);
Expand All @@ -28,12 +28,12 @@ if (@fdirectors) {
print &ui_columns_end();
print &select_all_link("d"),"\n";
print &select_invert_link("d"),"\n";
print "<a href='edit_fdirector.cgi?new=1'>$text{'fdirectors_add'}</a><br>\n";
print &ui_link("edit_fdirector.cgi?new=1",$text{'fdirectors_add'})<br>\n";
print &ui_form_end([ [ "delete", $text{'fdirectors_delete'} ] ]);
}
else {
print "<b>$text{'fdirectors_none'}</b><p>\n";
print "<a href='edit_fdirector.cgi?new=1'>$text{'fdirectors_add'}</a><br>\n";
print &ui_link("edit_fdirector.cgi?new=1",$text{'fdirectors_add'})<br>\n";
}
&ui_print_footer("", $text{'index_return'});
Expand Down
2 changes: 1 addition & 1 deletion bacula-backup/list_filesets.cgi
Expand Up @@ -36,7 +36,7 @@ if (@filesets) {
}
else {
print "<b>$text{'filesets_none'}</b><p>\n";
print "<a href='edit_fileset.cgi?new=1'>$text{'filesets_add'}</a><br>\n";
print &ui_link("edit_fileset.cgi?new=1",$text{'filesets_add'})<br>\n";
}
&ui_print_footer("", $text{'index_return'});
Expand Down
2 changes: 1 addition & 1 deletion bacula-backup/list_gjobs.cgi
Expand Up @@ -40,7 +40,7 @@ if (@jobs) {
}
else {
print "<b>$text{'jobs_none'}</b><p>\n";
print "<a href='edit_gjob.cgi?new=1'>$text{'gjobs_add'}</a><br>\n";
print &ui_link("edit_gjob.cgi?new=1",$text{'gjobs_add'})<br>\n";
}
&ui_print_footer("", $text{'index_return'});
Expand Down
2 changes: 1 addition & 1 deletion bacula-backup/list_jobs.cgi
Expand Up @@ -44,7 +44,7 @@ if (@jobs) {
}
else {
print "<b>$text{'jobs_none'}</b><p>\n";
print "<a href='edit_job.cgi?new=1'>$text{'jobs_add'}</a><br>\n";
print &ui_link("edit_job.cgi?new=1",$text{'jobs_add'})<br>\n";
}
&ui_print_footer("", $text{'index_return'});
Expand Down
2 changes: 1 addition & 1 deletion bacula-backup/list_pools.cgi
Expand Up @@ -34,7 +34,7 @@ if (@pools) {
}
else {
print "<b>$text{'pools_none'}</b><p>\n";
print "<a href='edit_pool.cgi?new=1'>$text{'pools_add'}</a><br>\n";
print &ui_link("edit_pool.cgi?new=1",$text{'pools_add'})<br>\n";
}
&ui_print_footer("", $text{'index_return'});
Expand Down
2 changes: 1 addition & 1 deletion bacula-backup/list_schedules.cgi
Expand Up @@ -34,7 +34,7 @@ if (@schedules) {
}
else {
print "<b>$text{'schedules_none'}</b><p>\n";
print "<a href='edit_schedule.cgi?new=1'>$text{'schedules_add'}</a><br>\n";
print &ui_link("edit_schedule.cgi?new=1",$text{'schedules_add'})<br>\n";
}
&ui_print_footer("", $text{'index_return'});
Expand Down
6 changes: 3 additions & 3 deletions bacula-backup/list_sdirectors.cgi
Expand Up @@ -11,7 +11,7 @@ if (@sdirectors) {
print &ui_form_start("delete_sdirectors.cgi", "post");
print &select_all_link("d"),"\n";
print &select_invert_link("d"),"\n";
print "<a href='edit_sdirector.cgi?new=1'>$text{'sdirectors_add'}</a><br>\n";
print &ui_link("edit_sdirector.cgi?new=1",$text{'sdirectors_add'})<br>\n";
@tds = ( "width=5", "width=30%", "width=70%" );
print &ui_columns_start([ "", $text{'sdirectors_name'},
$text{'sdirectors_pass'} ], "100%", 0, \@tds);
Expand All @@ -28,12 +28,12 @@ if (@sdirectors) {
print &ui_columns_end();
print &select_all_link("d"),"\n";
print &select_invert_link("d"),"\n";
print "<a href='edit_sdirector.cgi?new=1'>$text{'sdirectors_add'}</a><br>\n";
print &ui_link("edit_sdirector.cgi?new=1",$text{'sdirectors_add'})<br>\n";
print &ui_form_end([ [ "delete", $text{'sdirectors_delete'} ] ]);
}
else {
print "<b>$text{'sdirectors_none'}</b><p>\n";
print "<a href='edit_sdirector.cgi?new=1'>$text{'sdirectors_add'}</a><br>\n";
print &ui_link("edit_sdirector.cgi?new=1",$text{'sdirectors_add'})<br>\n";
}
&ui_print_footer("", $text{'index_return'});
Expand Down
2 changes: 1 addition & 1 deletion bacula-backup/list_storages.cgi
Expand Up @@ -38,7 +38,7 @@ if (@storages) {
}
else {
print "<b>$text{'storages_none'}</b><p>\n";
print "<a href='edit_storage.cgi?new=1'>$text{'storages_add'}</a><br>\n";
print &ui_link("edit_storage.cgi?new=1",$text{'storages_add'})<br>\n";
}
&ui_print_footer("", $text{'index_return'});
Expand Down
2 changes: 1 addition & 1 deletion bacula-backup/poolstatus_form.cgi
Expand Up @@ -65,6 +65,6 @@ if ($in{'pool'}) {

sub joblink
{
return $jobs{$_[0]} ? "<a href='edit_job.cgi?name=".&urlize($_[0])."'>$_[0]</a>" : $_[0];
return $jobs{$_[0]} ? &ui_link("edit_job.cgi?name=".&urlize($_[0])."","$_[0]") : $_[0];
}

4 changes: 2 additions & 2 deletions blue-theme/right.cgi
Expand Up @@ -298,11 +298,11 @@ local $others = join("&", map { "open=$_" } grep { $_ ne $name } @open);
$others = "&$others" if ($others);
if ($open{$name}) {
print "<img src=images/open.gif border=0>\n";
print "<a href='right.cgi?$others'>$text</a>";
print &ui_link("right.cgi?$others",$text);
}
else {
print "<img src=images/closed.gif border=0>\n";
print "<a href='right.cgi?open=$name$others'>$text</a>";
print &ui_link("right.cgi?open=$name$others",$text);
}
print "</font><br>\n";
return $open{$name};
Expand Down
4 changes: 2 additions & 2 deletions cfengine/cfengine-lib.pl
Expand Up @@ -389,7 +389,7 @@ sub show_classes_table
next if ($s->{'name'} =~ /^import/);
local (@clist, @dlist);
foreach $c (@{$s->{'cls'}}) {
push(@clist, $_[2] ? $c->{'name'} : "<a href='edit_class.cgi?cfd=$_[1]&idx=$s->{'index'}&cidx=$c->{'index'}'>$c->{'name'}</a>");
push(@clist, $_[2] ? $c->{'name'} : &ui_link("edit_class.cgi?cfd=$_[1]&idx=$s->{'index'}&cidx=$c->{'index'}",$c->{'name'}));
local $desc;
if ($s->{'name'} eq 'links') {
local @l = &parse_links($c);
Expand Down Expand Up @@ -554,7 +554,7 @@ sub show_classes_table
# "<img src=images/up.gif border=0></a>";
# }
if (!$_[2]) {
print "<a href='edit_class.cgi?cfd=$_[1]&idx=$s->{'index'}&new=1'>$text{'index_cadd'}</a></td>\n";
print &ui_link("edit_class.cgi?cfd=$_[1]&idx=$s->{'index'}&new=1",$text{'index_cadd'})</td>\n";
}
print "</tr></table></td>\n";
Expand Down
4 changes: 2 additions & 2 deletions cluster-copy/index.cgi
Expand Up @@ -49,12 +49,12 @@ if (@jobs) {
$files = join(", ", @files);
}
print &ui_checked_columns_row(
[ "<a href='edit.cgi?id=$j->{'id'}'>$files</a>",
[ &ui_link("edit.cgi?id=$j->{'id'}",$files),
$servers,
$j->{'sched'} ?
&text('index_when', &cron::when_text($j)) :
$text{'no'},
"<a href='exec.cgi?id=$j->{'id'}'>$text{'index_exec'}</a>",
&ui_link("exec.cgi?id=$j->{'id'}",$text{'index_exec'}),
], \@tds, "d", $j->{'id'});
}
print &ui_columns_end();
Expand Down
2 changes: 1 addition & 1 deletion cluster-cron/index.cgi
Expand Up @@ -26,7 +26,7 @@ if (@jobs) {
local $max = $cron::config{'max_len'} || 10000;
local $cmd = $j->{'cluster_command'};
push(@cols,
sprintf "<a href='edit.cgi?id=$j->{'cluster_id'}'>%s</a>%s",
sprintf &ui_link("edit.cgi?id=$j->{'cluster_id'}","%s")%s",
length($cmd) > $max ?
&html_escape(substr($cmd, 0, $max)) :
$cmd !~ /\S/ ? "BLANK" : &html_escape($cmd),
Expand Down
2 changes: 1 addition & 1 deletion cluster-software/compare.cgi
Expand Up @@ -47,7 +47,7 @@ foreach $h (@hosts) {
print &ui_columns_start([ $text{'compare_pack'},
map { &server_name($smap{$_->{'id'}}) } @hosts ]);
foreach $pn (sort { $a cmp $b } (keys %packs)) {
local @row = ( "<a href='edit_pack.cgi?package=$pn'>$pn</a>" );
local @row = ( &ui_link("edit_pack.cgi?package=$pn",$pn) );
local $ok = 1;
foreach $h (@hosts) {
local ($ph) = grep { $_->{'host'} eq $h } @{$packs{$pn}};
Expand Down
4 changes: 2 additions & 2 deletions cluster-software/edit_host.cgi
Expand Up @@ -89,8 +89,8 @@ print "<table width=100%>\n";
&traverse("", 0);
print "</table>\n";
if ($hasclasses) {
print "<a href='closeall.cgi?id=$in{'id'}'>$text{'host_close'}</a>\n";
print "<a href='openall.cgi?id=$in{'id'}'>$text{'host_open'}</a><p>\n";
print &ui_link("closeall.cgi?id=$in{'id'}",$text{'host_close'})\n";
print &ui_link("openall.cgi?id=$in{'id'}",$text{'host_open'})<p>\n";
}

&ui_print_footer("", $text{'index_return'});
Expand Down
2 changes: 1 addition & 1 deletion cpan/edit_mod.cgi
Expand Up @@ -42,7 +42,7 @@ if ($midx == $mod->{'master'} && @m > 1) {
# Sub-modules
@links = ( );
for($i=0; $i<@m; $i++) {
push(@links, "<a href='edit_mod.cgi?idx=$in{'idx'}&midx=$i&name=$in{'name'}'>$m[$i]</a>") if ($i != $mod->{'master'});
push(@links, &ui_link("edit_mod.cgi?idx=$in{'idx'}&midx=$i&name=$in{'name'}","$m[$i]")) if ($i != $mod->{'master'});
}
print &ui_table_row($text{'edit_subs'}, &ui_links_row(\@links), 3);
}
Expand Down
6 changes: 3 additions & 3 deletions custom/index.cgi
Expand Up @@ -75,13 +75,13 @@ elsif ($config{'display_mode'} == 0) {
}
if ($access{'edit'}) {
if ($c->{'edit'}) {
$link = "<a href='edit_file.cgi?id=$c->{'id'}'>$text{'index_fedit'}</a>";
$link = &ui_link("edit_file.cgi?id=$c->{'id'}",$text{'index_fedit'});
}
elsif ($c->{'sql'}) {
$link = "<a href='edit_sql.cgi?id=$c->{'id'}'>$text{'index_sedit'}</a>";
$link = &ui_link("edit_sql.cgi?id=$c->{'id'}",$text{'index_sedit'});
}
else {
$link = "<a href='edit_cmd.cgi?id=$c->{'id'}'>$text{'index_edit'}</a>";
$link = &ui_link("edit_cmd.cgi?id=$c->{'id'}",$text{'index_edit'});
}
$html .= &ui_table_row(undef,
&ui_links_row([ $link ]), $w);
Expand Down
6 changes: 3 additions & 3 deletions fetchmail/fetchmail-lib.pl
Expand Up @@ -293,11 +293,11 @@ sub show_polls
print &ui_columns_end();
}
local @links = (
"<a href='edit_poll.cgi?new=1&file=$_[1]&user=$_[2]'>$text{'index_add'}</a>",
"<a href='edit_global.cgi?file=$_[1]&user=$_[2]'>$text{'index_global'}</a>"
&ui_link("edit_poll.cgi?new=1&file=$_[1]&user=$_[2]",$text{'index_add'}),
&ui_link("edit_global.cgi?file=$_[1]&user=$_[2]",$text{'index_global'})
);
if (@{$_[0]}) {
push(@links, "<a href='check.cgi?file=$_[1]&user=$_[2]'>$text{'index_run'}</a>");
push(@links, &ui_link("check.cgi?file=$_[1]&user=$_[2]",$text{'index_run'}));
}
print &ui_links_row(\@links);
}
Expand Down
2 changes: 1 addition & 1 deletion filter/index.cgi
Expand Up @@ -111,7 +111,7 @@ if (@filters || &get_global_spamassassin()) {
# Work out nice condition and action descriptions
local $cond;
($cond, $lastalways) = &describe_condition($f);
$cond = "<a href='edit.cgi?idx=$f->{'index'}'>$cond</a>";
$cond = &ui_link("edit.cgi?idx=$f->{'index'}",$cond);
local $action = &describe_action($f, \@folders);

# Create mover links
Expand Down
2 changes: 1 addition & 1 deletion firewall/index.cgi
Expand Up @@ -209,7 +209,7 @@ else {
$text{"index_jump_".lc($r->{'j'}->[1])} ||
&text('index_jump', $r->{'j'}->[1]);
if ($edit) {
push(@cols, "<a href='edit_rule.cgi?table=".&urlize($in{'table'})."&idx=$r->{'index'}'>$act</a>");
push(@cols, &ui_link("edit_rule.cgi?table=".&urlize($in{'table'})."&idx=$r->{'index'}",$act));
}
else {
push(@cols, $act);
Expand Down
4 changes: 2 additions & 2 deletions gray-theme/right.cgi
Expand Up @@ -339,11 +339,11 @@ local $others = join("&", map { "open=$_" } grep { $_ ne $name } @open);
$others = "&$others" if ($others);
if ($open{$name}) {
print "<img src=images/gray-open.gif border=0>\n";
print "<a href='right.cgi?$others'>$text</a>";
print &ui_link("right.cgi?$others",$text);
}
else {
print "<img src=images/gray-closed.gif border=0>\n";
print "<a href='right.cgi?open=$name$others'>$text</a>";
print &ui_link("right.cgi?open=$name$others",$text);
}
print "</font><br>\n";
return $open{$name};
Expand Down
2 changes: 1 addition & 1 deletion heartbeat/edit_res.cgi
Expand Up @@ -67,7 +67,7 @@ if (@res) {
else {
print "<b>$text{'res_nores'}</b><p>\n";
}
print "<a href='edit_node.cgi?new=1'>$text{'res_add'}</a><p>\n";
print &ui_link("edit_node.cgi?new=1",$text{'res_add'})<p>\n";
&ui_print_footer("", $text{'index_return'});
4 changes: 2 additions & 2 deletions htpasswd-file/index.cgi
Expand Up @@ -40,7 +40,7 @@ if ($config{'md5'}) {
print &ui_subheading(&text('index_file', "<tt>$config{'file'}</tt>"));
$users = &list_users();
if (@$users) {
print "<a href='edit.cgi?new=1'>$text{'index_add'}</a><br>\n"
print &ui_link("edit.cgi?new=1",$text{'index_add'})<br>\n"
if ($access{'create'});
print "<table border width=100%>\n";
print "<tr $tb> <td><b>$text{'index_header'}</b></td> </tr>\n";
Expand All @@ -66,7 +66,7 @@ if (@$users) {
else {
print "<b>$text{'index_none'}</b><p>\n";
}
print "<a href='edit.cgi?new=1'>$text{'index_add'}</a><p>\n"
print &ui_link("edit.cgi?new=1",$text{'index_add'})<p>\n"
if ($access{'create'});

if ($access{'sync'}) {
Expand Down
4 changes: 2 additions & 2 deletions ipsec/list_secrets.cgi
Expand Up @@ -31,9 +31,9 @@ if (@secs) {
else {
print "<b>$text{'secrets_none'}</b><p>\n";
}
print "<a href='edit_secret.cgi?new=1&type=psk'>$text{'secrets_newpsk'}</a>\n";
print &ui_link("edit_secret.cgi?new=1&type=psk",$text{'secrets_newpsk'})\n";
print "&nbsp;" x 2;
print "<a href='edit_secret.cgi?new=1&type=rsa'>$text{'secrets_newrsa'}</a>\n";
print &ui_link("edit_secret.cgi?new=1&type=rsa",$text{'secrets_newrsa'})\n";
print "<br>\n";

&ui_print_footer("", $text{'index_return'});
2 changes: 1 addition & 1 deletion ldap-client/list_switches.cgi
Expand Up @@ -19,7 +19,7 @@ foreach $s (@$conf) {
$srcs = join(", ", map { $text{'order_'.$_->{'src'}} } @{$s->{'srcs'}});
$name = $text{'desc_'.$s->{'name'}} || $s->{'name'};
print &ui_columns_row([
"<a href='edit_switch.cgi?name=$s->{'name'}'>$name</a>",
&ui_link("edit_switch.cgi?name=$s->{'name'}",$name),
$srcs,
]);
}
Expand Down
2 changes: 1 addition & 1 deletion ldap-server/edit_acl.cgi
Expand Up @@ -45,7 +45,7 @@ if (@access) {
$i < @access-1);
$p = &parse_ldap_access($a);
print &ui_checked_columns_row([
"<a href='acl_form.cgi?idx=$i'>$p->{'whatdesc'}</a>",
&ui_link("acl_form.cgi?idx=$i",$p->{'whatdesc'}),
$p->{'bydesc'},
$hasorder ? ( $p->{'order'} ) : ( ),
$mover,
Expand Down
8 changes: 4 additions & 4 deletions lilo/index.cgi
Expand Up @@ -46,11 +46,11 @@ foreach $i (@images) {
$default && $default eq $l ? "<b>$l</b>" : $l);
push(@links, "edit_$n.cgi?idx=$i->{'index'}");
}
print "<a href='edit_image.cgi?new=1'>$text{'index_addk'}</a> &nbsp;\n";
print "<a href='edit_other.cgi?new=1'>$text{'index_addp'}</a><br>\n";
print &ui_link("edit_image.cgi?new=1",$text{'index_addk'}) &nbsp;\n";
print &ui_link("edit_other.cgi?new=1",$text{'index_addp'})<br>\n";
&icons_table(\@links, \@titles, \@icons, 4);
print "<a href='edit_image.cgi?new=1'>$text{'index_addk'}</a> &nbsp;\n";
print "<a href='edit_other.cgi?new=1'>$text{'index_addp'}</a><p>\n";
print &ui_link("edit_image.cgi?new=1",$text{'index_addk'}) &nbsp;\n";
print &ui_link("edit_other.cgi?new=1",$text{'index_addp'})<p>\n";
print &ui_hr();

print "<table width=100%>\n";
Expand Down
2 changes: 1 addition & 1 deletion lvm/edit_lv.cgi
Expand Up @@ -226,7 +226,7 @@ if ($in{'lv'}) {
if (@pvinfo) {
foreach $p (@pvinfo) {
($pv) = grep { $_->{'name'} eq $p->[0] } @pvs;
push(@pvlist, "<a href='edit_pv.cgi?vg=$in{'vg'}&pv=$pv->{'name'}'>$pv->{'name'}</a> ".&nice_size($p->[1]*$pv->{'pe_size'}*1024));
push(@pvlist, &ui_link("edit_pv.cgi?vg=$in{'vg'}&pv=$pv->{'name'}",$pv->{'name'}) ".&nice_size($p->[1]*$pv->{'pe_size'}*1024));
}
print &ui_table_row($text{'lv_pvs'},
&ui_grid_table(\@pvlist, 4), 3);
Expand Down
4 changes: 2 additions & 2 deletions mailboxes/mailboxes-lib.pl
Expand Up @@ -528,7 +528,7 @@ sub show_users_table
push(@ccols, int($foldercount{$u->[0]}))
}
print &ui_columns_row(
[ "<a href='list_mail.cgi?user=$u->[0]'>$u->[0]</a>",
[ &ui_link("list_mail.cgi?user=$u->[0]","$u->[0]"),
$u->[6], $g,
$size{$u->[0]} == 0 ? $text{'index_empty'} :
&nice_size($size{$u->[0]}),
Expand Down Expand Up @@ -596,7 +596,7 @@ sub switch_user_back

sub folder_link
{
return "<a href='list_mail.cgi?user=$_[0]&folder=$_[1]->{'index'}'>$text{'mail_return2'}</a>";
return &ui_link("list_mail.cgi?user=$_[0]&folder=$_[1]->{'index'}",$text{'mail_return2'});
}

# get_from_address()
Expand Down

2 comments on commit 990d7d3

@jcameron
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, this commit and others like it introduced a large number of Perl syntax errors into Webmin. Please at least run perl -c on all files changed in future before submitting them.

@pcfreak30
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about that. I generally try to use an IDE, but there are not any good ones and I didn't catch any syntax errors.

Please sign in to comment.