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)
แก้ไข /usr/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 " ;
}
}ตัวอย่างนี้เหมาะกับชุดรูปแบบ bootstrap @winfuture (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