icons added to all system plugins (preliminary)
|
@ -20,6 +20,11 @@ class CryptoBoxPlugin:
|
|||
## default rank (0..100) of the plugin in listings (lower value means higher priority)
|
||||
rank = 80
|
||||
|
||||
|
||||
## default icon of this plugin (relative path)
|
||||
iconFile = "plugin_icon.png"
|
||||
|
||||
|
||||
def __init__(self, cbox, pluginDir):
|
||||
self.cbox = cbox
|
||||
self.hdf = {}
|
||||
|
@ -40,6 +45,12 @@ class CryptoBoxPlugin:
|
|||
def getName(self):
|
||||
"""the name of the python file (module) should be the name of the plugin"""
|
||||
return self.__module__
|
||||
|
||||
|
||||
def getIcon(self):
|
||||
"""return the image data of the icon of the plugin"""
|
||||
import cherrypy
|
||||
return cherrypy.lib.cptools.serveFile(os.path.join(self.pluginDir, self.iconFile))
|
||||
|
||||
|
||||
def getTemplateFileName(self, template_name):
|
||||
|
|
|
@ -179,6 +179,8 @@ class WebInterfaceSites:
|
|||
del args["weblang"]
|
||||
except KeyError:
|
||||
pass
|
||||
if "icon" in args.keys():
|
||||
return plugin.getIcon()
|
||||
## check the device argument of volume plugins
|
||||
if "volume" in plugin.pluginCapabilities:
|
||||
try:
|
||||
|
|
BIN
pythonrewrite/plugins/date/plugin_icon.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
pythonrewrite/plugins/logs/plugin_icon.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
pythonrewrite/plugins/network/plugin_icon.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
pythonrewrite/plugins/partition/plugin_icon.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
|
@ -2,6 +2,7 @@ The following directory structure is required:
|
|||
- python code: plugins/PLUGINNAME/PLUGINNAME.py (all lower case is recommended)
|
||||
- language files: plugins/PLUGINNAME/lang/(en|de|??).hdf
|
||||
- clearsilver templates: plugins/PLUGINNAME/*.cs
|
||||
- icon (128x128px recommended): plugins/PLUGINNAME/plugin_icon.png
|
||||
|
||||
|
||||
Python code interface:
|
||||
|
|
BIN
pythonrewrite/plugins/plugin_manager/plugin_icon.png
Normal file
After Width: | Height: | Size: 631 B |
|
@ -1,5 +1,5 @@
|
|||
Name = Shutdown or reboot the computer
|
||||
Link = Shutdown/Reboot
|
||||
Link = Shutdown / Reboot
|
||||
|
||||
Title.Shutdown = Shutdown computer
|
||||
|
||||
|
|
BIN
pythonrewrite/plugins/shutdown/plugin_icon.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
pythonrewrite/plugins/user_manager/plugin_icon.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
|
@ -8,9 +8,7 @@
|
|||
<?cs loop: order = #0, #100, #1
|
||||
?><?cs # plugins ?><?cs each:x = Settings.PluginList
|
||||
?><?cs if:x.Enabled && x.Types.system && x.Rank == order ?>
|
||||
<li><a href="<?cs call:link('plugins/' + name(x),'','','','') ?>" title="<?cs
|
||||
var:html_escape(x.Link) ?>"><?cs var:html_escape(x.Link) ?></a></li><?cs
|
||||
/if ?><?cs
|
||||
<?cs call:show_plugin(name(x)) ?><?cs /if ?><?cs
|
||||
/each ?><?cs
|
||||
/loop ?>
|
||||
|
||||
|
|
|
@ -79,8 +79,15 @@ def:link(path, attr1, value1, attr2, value2)
|
|||
?><?cs /if ?><?cs
|
||||
/def ?><?cs
|
||||
|
||||
|
||||
def:print_form_header(form_name, action) ?><?cs #
|
||||
# the header of a form - including Setting.LinkAttrs
|
||||
?><form name="<?cs var:html_escape(form_name) ?>" action="<?cs call:link(action,"","","","") ?>" method="post" enctype="application/x-www-form-urlencoded" accept-charset="utf-8"><?cs
|
||||
/def ?><?cs
|
||||
|
||||
|
||||
def:show_plugin(plugin) ?><?cs
|
||||
# show the icon and the name of this plugin
|
||||
?><div<?cs each:x=Settings.PluginList[plugin].Types ?> class="plugin_<?cs var:html_escape(name(x)) ?><?cs /each ?>"><img src="<?cs call:link('plugins/' + plugin, 'icon','x','','') ?>" alt="<?cs var:html_escape('icon: ' + plugin) ?>" /><br/><?cs var:html_escape(Settings.PluginList[plugin].Link) ?></div><?cs
|
||||
/def ?>
|
||||
|
||||
|
|
|
@ -443,3 +443,44 @@ button:hover {
|
|||
padding-top: 10px;
|
||||
}
|
||||
|
||||
|
||||
/* -------------=-=-=- plugin icons -=-=-=--------------- */
|
||||
|
||||
|
||||
div.plugin_main, div.plugin_system, div.plugin_volume {
|
||||
text-align: center;
|
||||
float: left;
|
||||
padding: 10px;
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
|
||||
div.plugin_main {
|
||||
width: 80px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
div.plugin_main img {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
}
|
||||
|
||||
div.plugin_system {
|
||||
width: 64px;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
div.plugin_system img {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
}
|
||||
|
||||
div.plugin_volume {
|
||||
width: 48px;
|
||||
height: 64px;
|
||||
}
|
||||
|
||||
div.plugin_volume img {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
|
|