This repository was archived by the owner on Dec 18, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathedit.cgi
More file actions
60 lines (42 loc) · 1.18 KB
/
edit.cgi
File metadata and controls
60 lines (42 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/perl
require 'webmin-notes-lib.pl';
ReadParse();
my $note;
if($in{'new'}){
ui_print_header(undef, $text{'title_create'}, "");
$note = { };
}else{
ui_print_header(undef, $text{'title_edit'}, "");
my @notes = list_notes();
($note) = grep { $_->{'title'} eq $in{'title'} } @notes;
}
print ui_form_start('save.cgi');
print ui_hidden('new', $in{'new'});
print ui_hidden('old', $in{'title'});
print ui_table_start($text{'edit_header'}, undef, 3);
print ui_table_row($text{'edit_status'},
ui_yesno_radio('status', $note->{'status'}, 1, 0));
print ui_table_row($text{'edit_style'},
ui_select('style', $note->{'style'},
[
["success", "Success"],
["info", "Info"],
["warning", "Warning"],
["danger", "Danger"]
], 1, 0
)
);
print ui_table_row($text{'edit_title'},
ui_textbox('title', $note->{'title'}, 40));
print ui_table_row($text{'edit_content'},
ui_textbox('content', $note->{'content'}, 40));
print ui_table_end();
if ($in{'new'}){
print ui_form_end([ [ undef, $text{'create'}]]);
}else{
print ui_form_end([
[ undef, $text{'save'}],
[ 'delete', $text{'delete'} ]
]);
}
ui_print_footer('', $text{'index_return'});