"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> <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>
</div><!-- end of 'content' -->
</div><!-- end of 'main' --> </div><!-- end of 'main' -->
<?cs # TODO: update these status settings - most are outdated ... ?> <?cs # TODO: update these status settings - most are outdated ... ?>

View file

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

View file

@ -86,8 +86,34 @@ def:print_form_header(form_name, action) ?><?cs #
/def ?><?cs /def ?><?cs
def:show_plugin(plugin) ?><?cs def:show_plugin(plugin, type) ?><?cs
# show the icon and the name of this plugin # show the icon and the name of a plugin of a give type (system/volume/menu) ?>
?><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 <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 ?> /def ?>

View file

@ -1,12 +1,15 @@
<?cs # $Id$ ?> <?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 <?cs set:volume_plugin_count=0 ?><?cs
each: x = Settings.PluginList ?><?cs each: x = Settings.PluginList ?><?cs
if:x.Types.volume ?><?cs set:volume_plugin_count=volume_plugin_count+1 ?><?cs /if ?><?cs if:x.Types.volume ?><?cs set:volume_plugin_count=volume_plugin_count+1 ?><?cs /if ?><?cs
/each ?> /each ?>
<?cs # show one tab for each plugin ?>
<?cs if:volume_plugin_count>0 ?> <?cs if:volume_plugin_count>0 ?>
<?cs # sort the Plugins - using the most stupid way :) ?> <?cs # sort the Plugins - using the most stupid way :) ?>
<?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
@ -18,5 +21,4 @@
/if ?><?cs /if ?><?cs
/each ?><?cs /each ?><?cs
/loop ?> /loop ?>
<?cs /if ?> <?cs /if ?>