"show_plugin" macro supports different types of plugins

"show_volume" macro can display disks with appropriate icons according to their state
main interface partly moved to new design
This commit is contained in:
lars 2006-11-01 09:28:48 +00:00
parent 253b69e1db
commit 5c7a6c474c
4 changed files with 54 additions and 22 deletions

View File

@ -14,7 +14,6 @@
<a href="http://cryptobox.org" title="<?cs var:html_escape(Lang.Text.ProjectHomePage) ?>">CryptoBox-Home</a>&nbsp;&nbsp;&nbsp;<?cs var:html_escape(Lang.Text.ProjectNote) ?>&nbsp;<a href="https://systemausfall.org/senselab" title="systemausfall.org">sense.lab</a>
</div>
</div><!-- end of 'content' -->
</div><!-- end of 'main' -->
<?cs # TODO: update these status settings - most are outdated ... ?>

View File

@ -16,19 +16,30 @@
</head>
<body>
<?cs if:subcount(Data.Disks) > 0 ?>
<div id="volumes">
<?cs include:Settings.TemplateDir + '/show_volumes.cs' ?>
</div>
<?cs /if ?>
<div id="lang">
<?cs each:item = Data.Languages ?>
<a href="<?cs call:link('','weblang',name(item),'','') ?>"><?cs
var:item ?></a><br/>
<?cs /each ?>
<div id="main_menu">
<?cs # sort the Plugins - using the most stupid way :) ?>
<?cs loop: order = #0, #100, #1
?><?cs # plugins ?><?cs each:x = Settings.PluginList
?><?cs if:x.Enabled && x.Types.menu && x.Rank == order ?>
<?cs call:show_plugin(name(x), 'menu') ?><?cs /if ?><?cs
/each ?><?cs
/loop ?>
<?cs call:print_form_header("select_language",'') ?>
<div id="lang">
<select name="weblang">
<?cs each:item = Data.Languages ?>
<option value="<?cs var:name(item) ?>" <?cs
if:Settings.Language == name(item) ?>selected="selected"<?cs /if
?>><?cs var:item ?></option><?cs /each ?>
</select>
<button type="submit"><?cs var:html_escape(Lang.Button.SelectLanguage) ?></button>
</div>
</form>
</div>
<div id="main">
<?cs if:Data.activeDisksCount > 0 ?>
<div id="head_red">
@ -39,14 +50,8 @@
<h2><?cs var:html_escape(Lang.Title.Slogan) ?></h2>
</div>
<div id="content">
<div id="menu">
<?cs if:Data.Redirect.URL ?>
<?cs # the menu bar is disabled if redirection has been suggested ?>
&nbsp;
<?cs else ?>
<?cs include:Settings.TemplateDir + '/nav.cs' ?>
<?cs /if ?>
</div>
<div id="words">

View File

@ -86,8 +86,34 @@ def:print_form_header(form_name, action) ?><?cs #
/def ?><?cs
def:show_plugin(plugin) ?><?cs
# show the icon and the name of this plugin
?><a href="<?cs call:link('plugins/' + plugin,'','','','') ?>" title="<?cs var:html_escape(Settings.PluginList[plugin].Name) ?>"><div<?cs each:x=Settings.PluginList[plugin].Types ?> class="plugin_<?cs var:html_escape(name(x)) ?><?cs /each ?>"><img src="<?cs call:link('icons/plugins/' + plugin, '','','','') ?>" alt="<?cs var:html_escape('icon: ' + plugin) ?>" /><br/><?cs var:html_escape(Settings.PluginList[plugin].Link) ?></div></a><?cs
def:show_plugin(plugin, type) ?><?cs
# show the icon and the name of a plugin of a give type (system/volume/menu) ?>
<div class="plugin_<?cs var:html_escape(type) ?>">
<a href="<?cs call:link('plugins/' + plugin,'','','','') ?>" title="<?cs var:html_escape(Settings.PluginList[plugin].Link) ?>">
<img src="<?cs call:link('icons/plugins/' + plugin, '','','','') ?>" alt="<?cs var:html_escape('icon: ' + plugin) ?>" /><br/><?cs
var:html_escape(Settings.PluginList[plugin].Link) ?></a></div><?cs
/def ?><?cs
def:show_volume(index) ?><?cs
# show the icon of the volume ?>
<?cs if:Data.Disks[index].active ?><?cs
if:Data.Disks[index].encryption ?><?cs
set:filename='volume_active_crypto.png' ?><?cs
else ?><?cs
set:filename='volume_active_plain.png' ?><?cs
/if ?><?cs
else ?><?cs
if:Data.Disks[index].encryption ?><?cs
set:filename='volume_passive_crypto.png' ?><?cs
else ?><?cs
set:filename='volume_passive_plain.png' ?><?cs
/if ?><?cs
/if ?>
<div class="volume">
<a href="<?cs call:link('plugins/volume_mount','device',Data.Disks[index].device,'','') ?>" title="<?cs var:html_escape(Data.Disks[index].name) ?>">
<img src="<?cs call:link('cryptobox-misc/' + filename,'','','','') ?>" alt="icon: volume" /><br/><?cs
var:html_escape(Data.Disks[index].name) ?></a></div><?cs
/def ?>

View File

@ -1,12 +1,15 @@
<?cs # $Id$ ?>
<?cs # show all available volume plugins on top of the volume table ?>
<?cs # count volume plugins ?>
<?cs set:volume_plugin_count=0 ?><?cs
each: x = Settings.PluginList ?><?cs
if:x.Types.volume ?><?cs set:volume_plugin_count=volume_plugin_count+1 ?><?cs /if ?><?cs
/each ?>
<?cs # show one tab for each plugin ?>
<?cs if:volume_plugin_count>0 ?>
<?cs # sort the Plugins - using the most stupid way :) ?>
<?cs loop: order = #0, #100, #1
?><?cs # plugins ?><?cs each:x = Settings.PluginList
@ -18,5 +21,4 @@
/if ?><?cs
/each ?><?cs
/loop ?>
<?cs /if ?>