Skip to content

Commit

Permalink
Fix Custom Commands module in accordance with Webmin
Browse files Browse the repository at this point in the history
  • Loading branch information
iliajie committed Dec 15, 2021
1 parent 9c2f3d5 commit 2f0bc80
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 14 deletions.
1 change: 0 additions & 1 deletion commands/config.info
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ display_mode=Main page shows,1,0-All commands and parameters,1-Links to commands
width=Width of file editor window,3,Default (80 chars)
height=Height of file editor window,3,Default (20 chars)
wrap=File editor wrap mode,1,-Default (Soft),hard-Hard,off-Off
columns=Columns to display commands in,1,2-2,1-1
sort=Sort commands by,1,desc-Command name,html-Description,-Command ordering
access=Command access control list&#44; formatted like<br><tt>username: id1 id2</tt><br><tt>@groupname: id3 id4</tt>,9,0,0,\t
line2=System configuration,11
Expand Down
1 change: 0 additions & 1 deletion commands/config.info.ca
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ display_mode=La pàgina principal mostra,1,0-Totes les ordres i els seus paràme
width=Amplada de la finestra de l'editor de fitxers,3,Per defecte (80 caràcters)
height=Alçada de la finestra de l'editor de fitxers,3,Per defecte (20 caràcters)
wrap=Mode de tall de l'editor de fitxers,1,-Per defecte (Soft),hard-Hard,off-Desactivat
columns=Columnes per mostrar-hi les ordres,1,2-2,1-1
sort=Ordena les ordres per,1,desc-Nom d'ordre,html-Descripció,-Ordenació d'ordres
access=Llista de control d'accés a les ordres&#44; formatada com<br><tt>usuari: id1 id2</tt>i<br><tt>@grup: id3 id4</tt>,9,0,0,\t
line2=Configuració del sistema,11
Expand Down
1 change: 0 additions & 1 deletion commands/config.info.nl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ display_mode=Hoofd pagina laat zien,1,0-Alle opdrachten en parameters,1-Links na
width=Breedte van de file bewerkings window,3,Standaard (80 karakters)
height=Hoogte van de file bewerkings window,3,Standaard (20 karakters)
wrap=File bewerking wrap mode,1,-Standaard (Zacht),hard-Hard,off-Uit
columns=Kolommen om de opdrachten in te laten zien,1,2-2,1-1
access=Opdrachten toegangs controle lijst&#44;<br>in <tt>gebruikersnaam: id1 id2</tt> formaat.,9,0,0,\t
line2=Systeem configuratie,11
webmin_config=Webmin handmatige opdrachten config directory,0
16 changes: 6 additions & 10 deletions commands/index.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,19 @@ elsif ($config{'display_mode'} == 0) {
}
}
$html .= &ui_hidden("id", $c->{'id'});
$w = $config{'columns'} == 2 ? 2 : 4;
$html .= &ui_table_start(undef, undef, $w,
$html .= &ui_table_start(undef, undef, 2,
$config{'columns'} == 1 ? [ "width=20%", "width=30%" ]
: [ "width=30%" ]);
$html .= &ui_table_row(undef, &ui_submit($c->{'desc'}), $w, []);
$html .= &ui_table_row(undef, &ui_submit($c->{'desc'}), 2, []);
if ($c->{'html'}) {
$html .= &ui_table_row(undef,
&filter_javascript($c->{'html'}), $w, []);
&filter_javascript($c->{'html'}), 2, []);
}
foreach $a (@a) {
$html .= &ui_table_row(&html_escape($a->{'desc'}),
&show_parameter_input($a, $formno));
}
if (scalar(@a)%2 && $w == 4) {
# Hack to make spacing nicer
$html .= &ui_table_row(" ", " ");
}
$links = '';
if ($access{'edit'}) {
if ($c->{'edit'}) {
$link = "<a href='edit_file.cgi?id=$c->{'id'}'>$text{'index_fedit'}</a>";
Expand All @@ -77,9 +73,9 @@ elsif ($config{'display_mode'} == 0) {
else {
$link = "<a href='edit_cmd.cgi?id=$c->{'id'}'>$text{'index_edit'}</a>";
}
$html .= &ui_table_row(undef,
&ui_links_row([ $link ]), $w);
$links = &ui_links_row([ $link ]);
}
$html .= &ui_table_row(undef, $links, 2);
$html .= &ui_table_end();
$html .= &ui_form_end();
push(@grid, $html);
Expand Down
1 change: 0 additions & 1 deletion commands/uconfig.info.no
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ display_mode=Hovedsiden viser,1,0-Alle kommandoer og parametere,1-Lenker til kom
width=Bredde p&#229; fileditor vindu,3,Standard (80 tegn)
height=H&#248;yde p&#229; fileditor vindu,3,Standard (20 tegn)
wrap=Fileditor delingsmodus,1,-Standard (Myk),hard-Hard,off-Av
columns=Kolonner kommandoer skal vises i,1,2-2,1-1
sort=Sorter kommandoer etter,1,desc-Kommandonavn,html-Beskrivelse,-Kommandosortering
access=Kommando tilgangskontrolliste&#44; formattert som<br><tt>brukernavn: id1 id2</tt><br><tt>@gruppenavn: id3 id4</tt>,9,0,0,\t
line2=Systemkonfigurasjon,11
Expand Down

0 comments on commit 2f0bc80

Please sign in to comment.