Giter Club home page Giter Club logo

webmin-notes's Introduction

webmin-notes

A small module that allows you to create/edit/remove notes.


General usage

Add the following in your template file (body.cgi or 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
}

Example usage (authentic-theme theme):

This example fits authentic-theme (https://github.com/virtualmin/authentic-theme).

Edit /usr/share/webmin/authentic-theme/sysinfo.cgi and add the following code on line 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";
	}
}

Example usage (winfuture Bootstrap theme):

This example fits @winfuture Bootstrap theme (http://theme.winfuture.it/).

Edit the index.cgi of the theme and add the following code:

&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";
	}
}


API

Methods

::list_notes()
::create_note($note)
::modify_note($note)
::delete_note($note)

Hashmap ($note)

| Key        | Value           
| ------------- |:-------------:
| status      	| 0 = disabled / 1 = enabled
| style      	| warning, info, danger, success
| title      	| note-title
| content      	| note-content


Download:

http://www.webmin.com/cgi-bin/search_third.cgi?search=Webmin-Notes

webmin-notes's People

Contributors

burnett01 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.