ui_link conversion -> pam

This commit is contained in:
Nawawi Jamili
2013-12-19 15:50:54 +08:00
parent ada20e8e2d
commit 69d96d9912
2 changed files with 12 additions and 16 deletions

View File

@@ -49,16 +49,15 @@ foreach $t ('auth', 'account', 'session', 'password') {
local @cols;
if ($m->{'control'} eq 'include') {
# Included module
push(@cols, "<a href='edit_inc.cgi?".
"idx=$pam->{'index'}&midx=$m->{'index'}'>".
&text('edit_inc', "<tt>$mn</tt>")."</a>");
push(@cols, &ui_link("edit_inc.cgi?".
"idx=".$pam->{'index'}."&midx=".$m->{'index'},
&text('edit_inc', "<tt>$mn</tt>")) );
@rtds = ( "colspan=4", "width=5%" );
}
else {
# Regular PAM module
push(@cols, "<a href='edit_mod.cgi?".
"idx=$pam->{'index'}&midx=$m->{'index'}'>".
"$mn</a>");
push(@cols, &ui_link("edit_mod.cgi?".
"idx=".$pam->{'index'}."&midx=".$m->{'index'}, $mn) );
push(@cols, $text{$mn});
push(@cols, $text{'control_'.$m->{'control'}});
push(@cols, $m->{'args'});
@@ -69,17 +68,15 @@ foreach $t ('auth', 'account', 'session', 'password') {
$mv .= "<img src=images/gap.gif>";
}
else {
$mv .= "<a href='move.cgi?idx=$pam->{'index'}&".
"midx=$m->{'index'}&down=1'><img ".
"src=images/down.gif border=0></a>";
$mv .= &ui_link("move.cgi?idx=$pam->{'index'}&".
"midx=".$m->{'index'}."&down=1", "<img src='images/down.gif' border=0>");
}
if ($m eq $mods[0]) {
$mv .= "<img src=images/gap.gif>";
$mv .= "<img src='images/gap.gif'>";
}
else {
$mv .= "<a href='move.cgi?idx=$pam->{'index'}&".
"midx=$m->{'index'}&up=1'><img ".
"src=images/up.gif border=0></a>";
$mv .= &ui_link("move.cgi?idx=".$pam->{'index'}."&".
"midx=".$m->{'index'}."&up=1", "<img src='images/up.gif' border=0>");
}
push(@cols, $mv);
$ptable .= &ui_columns_row(\@cols, \@rtds);

View File

@@ -14,7 +14,7 @@ if (!@pams) {
exit;
}
@links = ( "<a href='create_form.cgi'>$text{'index_add'}</a>" );
@links = ( &ui_link("create_form.cgi", $text{'index_add'}) );
print &ui_links_row(\@links);
$mid = int((@pams-1) / 2);
print "<table width=100%><tr> <td width=50% valign=top>\n";
@@ -32,8 +32,7 @@ print &ui_columns_start([ $text{'index_name'}, $text{'index_desc'} ], 100);
foreach $p (@_) {
local $t = $text{'desc_'.$p->{'name'}};
print &ui_columns_row([
"<a href='edit_pam.cgi?idx=$p->{'index'}'>".
&html_escape($p->{'name'})."</a>",
&ui_link("edit_pam.cgi?idx=".$p->{'index'}, &html_escape($p->{'name'}) ),
$p->{'desc'} || $t
]);
}