From c45ddfc5d600b5c08a5ce3987d1019ffe8d13656 Mon Sep 17 00:00:00 2001 From: Nawawi Jamili Date: Thu, 19 Dec 2013 01:46:41 +0800 Subject: [PATCH] ui_link conversion -> init --- init/edit_action.cgi | 4 ++-- init/hostconfig-lib.pl | 2 +- init/index.cgi | 29 +++++++++++------------------ 3 files changed, 14 insertions(+), 21 deletions(-) diff --git a/init/edit_action.cgi b/init/edit_action.cgi index c79521d7f..95f7e209f 100755 --- a/init/edit_action.cgi +++ b/init/edit_action.cgi @@ -92,8 +92,8 @@ if ($ty == 1 && $access{'bootup'} == 1) { # Display a message about the script being bogus print &ui_table_end(); print "",&text("edit_bad$ss", $rl),"
\n"; - print "", - "$text{'edit_fix'}.

\n"; + print &ui_link("fix_action.cgi?$rl+$ss+$num+$ac", $text{'edit_fix'}); + print "

\n"; } elsif (!$config{'expert'} || $access{'bootup'} == 2) { # Just tell the user if this action is started at boot time diff --git a/init/hostconfig-lib.pl b/init/hostconfig-lib.pl index e316f7bde..338ab4567 100755 --- a/init/hostconfig-lib.pl +++ b/init/hostconfig-lib.pl @@ -161,7 +161,7 @@ local($ahref, $setting, $link, $description); my($ahref, $setting, $description) = @_; local @cols; if ($access{'bootup'} == 1) { - push(@cols, "$ahref"); + push(@cols, &ui_link("edit_hostconfig.cgi?0+$ahref", $ahref) ); } else { push(@cols, $ahref); diff --git a/init/index.cgi b/init/index.cgi index de726ccc5..d48b7939e 100755 --- a/init/index.cgi +++ b/init/index.cgi @@ -28,11 +28,8 @@ if ($init_mode eq "osx" && $access{'bootup'}) { print &ui_columns_end(); if ($access{'bootup'} == 1) { print &ui_links_row([ - "". - "$text{'index_add_mac'}", - "". - &text('index_editconfig', - "$config{'hostconfig'}")."" + &ui_link("edit_hostconfig.cgi?1", $text{'index_add_mac'}), + &ui_link("edit_hostconfig.cgi?2", &text('index_editconfig',"$config{'hostconfig'}") ) ]); } } @@ -96,8 +93,7 @@ elsif ($init_mode eq "init" && $access{'bootup'}) { @links = ( ); if ($access{'bootup'} == 1) { - push(@links, - "$text{'index_add'}"); + push(@links, &ui_link("edit_action.cgi?2", $text{'index_add'}) ); } if (!$config{'desc'}) { # Display actions by name only @@ -105,8 +101,7 @@ elsif ($init_mode eq "init" && $access{'bootup'}) { @grid = ( ); for($i=0; $i<@acts; $i++) { if ($acts[$i]) { - push(@grid, "$acts[$i]"); + push(@grid, &ui_link("edit_action.cgi?".$actsl[$i], $acts[$i]) ); } } print &ui_grid_table(\@grid, 4, 100, @@ -142,8 +137,7 @@ elsif ($init_mode eq "init" && $access{'bootup'}) { } $order = $actsb[$i]->[0]->[1]; local @cols; - push(@cols, "$acts[$i]"); + push(@cols, &ui_link("edit_action.cgi?".$actsl[$i], $acts[$i]) ); local %has; $d = &html_escape(&init_description($actsf[$i], $config{'status_check'} == 2 ? \%has : undef)); @@ -269,7 +263,7 @@ elsif ($init_mode eq "rc" && $access{'bootup'}) { print &ui_form_start("mass_rcs.cgi", "post"); @links = ( &select_all_link("d"), &select_invert_link("d"), - "$text{'index_radd'}" ); + &ui_link("edit_rc.cgi?new=1", $text{'index_radd'}) ); print &ui_links_row(\@links); print &ui_columns_start([ "", $text{'index_rname'}, $text{'index_rdesc'}, @@ -277,8 +271,7 @@ elsif ($init_mode eq "rc" && $access{'bootup'}) { foreach $rc (&list_rc_scripts()) { print &ui_columns_row([ &ui_checkbox("d", $rc->{'name'}, undef), - "$rc->{'name'}", + &ui_link("edit_rc.cgi?name=".&urlize($rc->{'name'}), $rc->{'name'}), $rc->{'desc'}, $rc->{'enabled'} == 1 ? $text{'yes'} : $rc->{'enabled'} == 2 ? "$text{'index_unknown'}": @@ -302,7 +295,7 @@ elsif ($init_mode eq "upstart" && $access{'bootup'}) { print &ui_form_start("mass_upstarts.cgi", "post"); @links = ( &select_all_link("d"), &select_invert_link("d"), - "$text{'index_uadd'}" ); + &ui_link("edit_upstart.cgi?new=1", $text{'index_uadd'}) ); print &ui_links_row(\@links); print &ui_columns_start([ "", $text{'index_uname'}, $text{'index_udesc'}, @@ -317,7 +310,7 @@ elsif ($init_mode eq "upstart" && $access{'bootup'}) { } print &ui_columns_row([ &ui_checkbox("d", $u->{'name'}, undef, 0), - "$u->{'name'}", + &ui_link($l, $u->{'name'}), $u->{'desc'}, $u->{'boot'} eq 'start' ? $text{'yes'} : $u->{'boot'} eq 'stop' ? @@ -348,7 +341,7 @@ elsif ($init_mode eq "systemd" && $access{'bootup'}) { print &ui_form_start("mass_systemd.cgi", "post"); @links = ( &select_all_link("d"), &select_invert_link("d"), - "$text{'index_sadd'}" ); + &ui_link("edit_systemd.cgi?new=1", $text{'index_sadd'}) ); print &ui_links_row(\@links); print &ui_columns_start([ "", $text{'index_uname'}, $text{'index_udesc'}, @@ -363,7 +356,7 @@ elsif ($init_mode eq "systemd" && $access{'bootup'}) { } print &ui_columns_row([ &ui_checkbox("d", $u->{'name'}, undef), - "$u->{'name'}", + &ui_link($l, $u->{'name'}), $u->{'desc'}, $u->{'boot'} == 1 ? $text{'yes'} : $u->{'boot'} == 2 ? $text{'index_always'} :