cryptonas-branches/pythonrewrite/plugins/partition/set_partitions.cs

68 lines
2.6 KiB
C#
Raw Normal View History

<?cs # $Id$ ?>
<style type="text/css"><?cs include:Data.Plugins.partition.StyleSheetFile ?></style>
<h1><?cs var:html_escape(Lang.Plugins.partition.Title.Partition) ?></h1>
<?cs call:handle_messages() ?>
<div align="center">
<table class="partition">
<?cs if:Data.Plugins.partition.availSize > 0 ?>
<?cs # no table header if the harddisk is not partitionable (e.g. still active) ?>
<tr>
<th><?cs var:html_escape(Lang.Plugins.partition.Text.PartNum) ?></th>
<th><?cs var:html_escape(Lang.Plugins.partition.Text.Size) ?></th>
<th><?cs var:html_escape(Lang.Plugins.partition.Text.PartType) ?></th>
<th></th>
</tr>
<?cs /if ?>
<?cs loop: x = #0, subcount(Data.Plugins.partition.Parts)-1, #1 ?>
<tr>
<td><?cs var:x ?></td>
<td><?cs var:Data.Plugins.partition.Parts[x].Size ?></td>
<td><?cs var:Data.Plugins.partition.Parts[x].Type ?></td>
<td>
<?cs call:print_form_header("part_del_" + x, "plugins/partition") ?>
<?cs include:Settings.PluginDir + "/partition/current_partition_info.cs" ?>
<input type="hidden" name="step" value="del_partition" />
<input type="hidden" name="del_num" value="<?cs var:x ?>" />
<button type="submit"><?cs var:html_escape(Lang.Plugins.partition.Button.DelPartition) ?></button>
</form>
</td>
</tr>
<?cs /loop ?></p>
<?cs # new partition input if space is available ?>
<?cs if:Data.Plugins.partition.availSize > 0 ?>
<tr>
<?cs call:print_form_header("part_add", "plugins/partition") ?>
<?cs include:Settings.PluginDir + "/partition/current_partition_info.cs" ?>
<input type="hidden" name="step" value="add_partition" />
<?cs set: x = subcount(Data.Plugins.partition.Parts) ?>
<td><?cs var:x ?></td>
<td><input type="text" name="part<?cs var:x ?>_size" size="8" value="<?cs var:Data.Plugins.partition.availSize ?>" tabindex="1" /></td>
<td><select name="part<?cs var:x ?>_type" tabindex="2" size="0"><?cs each: t = Data.Plugins.partition.Types ?><option <?cs if:t == "windows" ?>selected="selected"<?cs /if ?>><?cs var:t ?></option>
<?cs /each ?></select></td>
<td>
<button type="submit" tabindex="3"><?cs var:html_escape(Lang.Plugins.partition.Button.AddPartition) ?></button>
</td>
</form>
</tr>
<?cs /if ?>
</table>
</div>
<?cs if:subcount(Data.Plugins.partition.Parts) > 0 ?>
<?cs call:hint(Lang.Plugins.partition.Text.WarningMessage) ?>
<?cs call:print_form_header("part_finish", "plugins/partition") ?>
<?cs include:Settings.PluginDir + "/partition/current_partition_info.cs" ?>
<input type="hidden" name="step" value="finish" />
<button type="submit"><?cs var:html_escape(Lang.Plugins.partition.Button.SavePartitions) ?></button>
</form>
<?cs /if ?>