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)
|
## default rank (0..100) of the plugin in listings (lower value means higher priority)
|
||||||
rank = 80
|
rank = 80
|
||||||
|
|
||||||
|
|
||||||
|
## default icon of this plugin (relative path)
|
||||||
|
iconFile = "plugin_icon.png"
|
||||||
|
|
||||||
|
|
||||||
def __init__(self, cbox, pluginDir):
|
def __init__(self, cbox, pluginDir):
|
||||||
self.cbox = cbox
|
self.cbox = cbox
|
||||||
self.hdf = {}
|
self.hdf = {}
|
||||||
|
@ -42,6 +47,12 @@ class CryptoBoxPlugin:
|
||||||
return self.__module__
|
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):
|
def getTemplateFileName(self, template_name):
|
||||||
"""return the filename of the template, if it is part of this plugin
|
"""return the filename of the template, if it is part of this plugin
|
||||||
|
|
||||||
|
|
|
@ -179,6 +179,8 @@ class WebInterfaceSites:
|
||||||
del args["weblang"]
|
del args["weblang"]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
if "icon" in args.keys():
|
||||||
|
return plugin.getIcon()
|
||||||
## check the device argument of volume plugins
|
## check the device argument of volume plugins
|
||||||
if "volume" in plugin.pluginCapabilities:
|
if "volume" in plugin.pluginCapabilities:
|
||||||
try:
|
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)
|
- python code: plugins/PLUGINNAME/PLUGINNAME.py (all lower case is recommended)
|
||||||
- language files: plugins/PLUGINNAME/lang/(en|de|??).hdf
|
- language files: plugins/PLUGINNAME/lang/(en|de|??).hdf
|
||||||
- clearsilver templates: plugins/PLUGINNAME/*.cs
|
- clearsilver templates: plugins/PLUGINNAME/*.cs
|
||||||
|
- icon (128x128px recommended): plugins/PLUGINNAME/plugin_icon.png
|
||||||
|
|
||||||
|
|
||||||
Python code interface:
|
Python code interface:
|
||||||
|
|
BIN
pythonrewrite/plugins/plugin_manager/plugin_icon.png
Normal file
After Width: | Height: | Size: 631 B |
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 loop: order = #0, #100, #1
|
||||||
?><?cs # plugins ?><?cs each:x = Settings.PluginList
|
?><?cs # plugins ?><?cs each:x = Settings.PluginList
|
||||||
?><?cs if:x.Enabled && x.Types.system && x.Rank == order ?>
|
?><?cs if:x.Enabled && x.Types.system && x.Rank == order ?>
|
||||||
<li><a href="<?cs call:link('plugins/' + name(x),'','','','') ?>" title="<?cs
|
<?cs call:show_plugin(name(x)) ?><?cs /if ?><?cs
|
||||||
var:html_escape(x.Link) ?>"><?cs var:html_escape(x.Link) ?></a></li><?cs
|
|
||||||
/if ?><?cs
|
|
||||||
/each ?><?cs
|
/each ?><?cs
|
||||||
/loop ?>
|
/loop ?>
|
||||||
|
|
||||||
|
|
|
@ -79,8 +79,15 @@ def:link(path, attr1, value1, attr2, value2)
|
||||||
?><?cs /if ?><?cs
|
?><?cs /if ?><?cs
|
||||||
/def ?><?cs
|
/def ?><?cs
|
||||||
|
|
||||||
|
|
||||||
def:print_form_header(form_name, action) ?><?cs #
|
def:print_form_header(form_name, action) ?><?cs #
|
||||||
# the header of a form - including Setting.LinkAttrs
|
# 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
|
?><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 ?>
|
/def ?>
|
||||||
|
|
||||||
|
|
|
@ -443,3 +443,44 @@ button:hover {
|
||||||
padding-top: 10px;
|
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;
|
||||||
|
}
|
||||||
|
|