webmin notes
0.2
一個小模塊,可讓您創建/編輯/刪除註釋。
在模板文件(body.cgi或index.cgi)中添加以下內容:
&foreign_require( " webmin-notes " );
@notes = &webmin_notes::list_notes();
foreach my $n ( @notes ) {
# now you have access to each note
# Available methods: status, style, title, content
}此示例適合Authentic-Theme(https://github.com/virtualmin/authentic-theme)。
edit /usr/share/webmin/authentic-theme/sysinfo.cgi share/webmin/authentic-theme/sysinfo.cgi,並在22行上添加以下代碼:
&foreign_require( " webmin-notes " , " webmin-notes-lib.pl " );
my @notes = &webmin_notes::list_notes();
foreach my $n ( @notes ) {
if ( $n -> { ' status ' } == 1) {
print ' <div class="alert alert- ' . html_escape( $n -> { ' style ' }) . ' " role="alert"><b> ' . html_escape( $n -> { ' title ' }) . ' </b> ' . html_escape( $n -> { ' content ' }) . " </div> n " ;
}
}此示例適合@winfuture bootstrap主題(http://theme.winfuture.it/)。
編輯主題的index.cgi並添加以下代碼:
&foreign_require( " webmin-notes " );
@notes = &webmin_notes::list_notes();
foreach my $n ( @notes ) {
if ( $n -> { ' status ' } == 1) {
print ' <div class="alert alert- ' . html_escape( $n -> { ' style ' }) . ' " role="alert"><b> ' . html_escape( $n -> { ' title ' }) . ' </b> ' . html_escape( $n -> { ' content ' }) . " </div> n " ;
}
}::list_notes()
::create_note( $note )
::modify_note( $note )
::delete_note( $note )| Key | Value
| ------------- |:-------------:
| status | 0 = disabled / 1 = enabled
| style | warning, info, danger, success
| title | note-title
| content | note-content
http://www.webmin.com/cgi-bin/search_third.cgi?search=webmin-notes