plugin interface implemented

example plugins added: date and network
moved "logs" to plugins
This commit is contained in:
lars 2006-09-12 08:55:20 +00:00
parent 5af79f90b6
commit dba8ca79fd
27 changed files with 483 additions and 174 deletions

View file

@ -0,0 +1,13 @@
Lang {
Title.Log = CryptoBox logfiles
Text.EmptyLog = The logfile of the CryptoBox is empty.
Modules.logs {
Name = Show the content of the log file
Link = Show the log file
Rank = 90
}
}

View file

@ -0,0 +1,21 @@
from CryptoBoxExceptions import CBPluginActionError
def prepareForm(hdf, cbox):
hdf["Data.Modules.logs.Content"] = __getLogContent(cbox)
def doAction(cbox):
return "show_log"
def getStatus(cbox):
return "%s:%s:%s" % (
cbox.prefs["Log"]["Level"],
cbox.prefs["Log"]["Destination"],
cbox.prefs["Log"]["Details"])
def __getLogContent(cbox, lines=30, maxSize=2000):
return "<br/>".join(cbox.getLogData(lines, maxSize))

View file

@ -0,0 +1,13 @@
<?cs # $Id: show_log.cs 374 2006-05-30 18:47:34Z lars $ ?>
<div id="log">
<h1><?cs var:html_escape(Lang.Title.Log) ?></h1>
<?cs if:Data.Modules.logs.Content ?>
<p class="console"><?cs var:Data.Modules.logs.Content ?></p>
<?cs else ?>
<p><?cs var:html_escape(Lang.Text.EmptyLog) ?></p>
<?cs /if ?>
</div>