Browse Source

removed obsolete 'show_volume.cs'

improved marking of active plugin icons
master
lars 15 years ago
parent
commit
46e10ee6d4
  1. 34
      templates/header.cs
  2. 11
      templates/macros.cs
  3. 11
      templates/main.cs
  4. 10
      templates/show_volume.cs
  5. 2
      templates/show_volume_header.cs
  6. 17
      templates/volume_plugins.cs

34
templates/header.cs

@ -19,16 +19,40 @@
<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.Types.system && x.Visible.menu && x.Rank == order ?>
<?cs call:show_plugin(name(x), 'menu') ?><?cs /if ?><?cs
<?cs # three possibilities to find the active ('to be marked') plugin:
- the active plugin is a volume plugin -> mark 'disks'
- the active plugin is part of the menu list -> mark it
- the rest: mark 'preferences' ?><?cs
if:Settings.PluginList[Data.ActivePlugin].Types.volume ?><?cs
set:markPlugin = 'disks' ?><?cs
else ?><?cs
# first: set default value ?><?cs
set:markPlugin = 'system_preferences' ?><?cs
# check if the active plugin is visible in the menu ?><?cs
each:plugin = Settings.PluginList ?><?cs
if:plugin.Visible.menu && (name(plugin) == Data.ActivePlugin) ?><?cs
set:markPlugin = name(plugin) ?><?cs
/if ?><?cs
/each ?><?cs
/if ?><?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.Types.system && x.Visible.menu && x.Rank == order ?>
<div class="plugin_menu plugin_menu_<?cs
if:markPlugin == name(x) ?>active<?cs else ?>passive<?cs /if
?>"><a href="<?cs call:link(name(x),'','','','') ?>" title="<?cs
var:html_escape(x.Link) ?>"><img src="<?cs
call:link('icons/' + name(x), '','','','') ?>" alt="<?cs
var:html_escape('icon: ' + name(x)) ?>" /><br/><?cs
var:html_escape(x.Link) ?></a></div><?cs
/if ?><?cs
/each ?><?cs
/loop ?>
</div>
<div id="main">
<?cs if:?Data.EnvironmentWarning

11
templates/macros.cs

@ -115,15 +115,6 @@ def:print_form_header(form_name, action) ?><?cs #
/def ?><?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) ?> plugin_<?cs var:html_escape(type) ?>_<?cs if:Data.ActivePlugin == plugin ?>active<?cs else ?>passive<?cs /if ?>">
<a href="<?cs call:link(plugin,'','','','') ?>" title="<?cs var:html_escape(Settings.PluginList[plugin].Link) ?>">
<img src="<?cs call:link('icons/' + 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_icon(volume) ?><?cs
# show the appropriate icon for the current state of the volume ?>
<?cs if:volume.active ?><?cs
@ -171,5 +162,3 @@ def:handle_messages() ?><?cs
?><?cs set:messages_are_handled = 1 ?><?cs
/def ?>

11
templates/main.cs

@ -5,6 +5,15 @@
<!-- chosen cryptobox template: <?cs var:Settings.TemplateFile ?> -->
<?cs include:Settings.TemplateFile ?>
<?cs if:Data.ActivePlugin && (Settings.PluginList[Data.ActivePlugin].Types.volume) ?>
<?cs include:Settings.TemplateDir + '/show_volume_header.cs' ?>
<?cs call:handle_messages() ?>
<?cs include:Settings.TemplateFile ?>
<?cs include:Settings.TemplateDir + '/show_volume_footer.cs' ?>
<?cs else ?>
<?cs call:handle_messages() ?>
<?cs include:Settings.TemplateFile ?>
<?cs /if ?>
<?cs include:Settings.TemplateDir + '/footer.cs' ?>

10
templates/show_volume.cs

@ -1,10 +0,0 @@
<?cs # $Id$ ?>
<?cs include:Settings.TemplateDir + "/show_volume_header.cs" ?>
<div align="center">
<image src="../cryptobox-misc/evil_stick.png" style="margin:20px">
<p>just a placeholder - any suggestions are welcome!</p>
</div>
<?cs include:Settings.TemplateDir + "/show_volume_footer.cs" ?>

2
templates/show_volume_header.cs

@ -1,7 +1,5 @@
<?cs # $Id$ ?>
<?cs # TODO: show buttons for available plugins ?>
<div id="volume_name">
<table><tr><td>
<h1><?cs var:html_escape(Lang.Title.Volume) ?> <i><?cs var:html_escape(Data.CurrentDisk.name) ?></i></h1>

17
templates/volume_plugins.cs

@ -10,11 +10,22 @@
<?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 # two possibilities to find the active ('to be marked') plugin:
- the active plugin is part of the volume menu list -> mark it
- the rest: mark 'volume_props' ?><?cs
# first: set default value ?><?cs
set:markPlugin = 'volume_props' ?><?cs
# check if the active plugin is visible in the menu ?><?cs
each:plugin = Settings.PluginList ?><?cs
if:plugin.Visible.volume && (name(plugin) == Data.ActivePlugin) ?><?cs
set:markPlugin = name(plugin) ?><?cs
/if ?><?cs
/each ?><?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.Types.volume && x.Visible.volume && x.Rank == order ?>
<td <?cs if:Data.ActivePlugin == name(x)
<td <?cs if:markPlugin == name(x)
?>class="volume_plugin_active"<?cs
else ?>class="volume_plugin_passive"<?cs
/if ?>><a href="<?cs call:link(name(x),'device',Data.CurrentDisk.device,'','') ?>" title="<?cs var:html_escape(x.Link) ?>"><img src="<?cs call:link("icons/" + name(x),'','','','') ?>" alt="icon: <?cs var:html_escape(name(x)) ?>" />&nbsp;<?cs var:html_escape(x.Link) ?></a></td><?cs

Loading…
Cancel
Save