Files
webgui/plugins/dynamix.vm.manager/VMTemplates.page
2017-08-20 18:20:53 +02:00

57 lines
1.4 KiB
Plaintext

Menu="VMs:2"
Title="Templates"
Tag="clipboard"
Cond="(pgrep('libvirtd')!==false)"
---
<?PHP
/* Copyright 2005-2017, Lime Technology
* Copyright 2015-2017, Derek Macias, Eric Schultz, Jon Panozzo.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
* as published by the Free Software Foundation.
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*/
?>
<style type="text/css">
.vmheader {
padding: 10px;
font-size: 16px;
text-align: left;
color: #888;
}
.vmtemplate {
display: inline-block;
width: 80px;
height: 90px;
margin-bottom: 15px;
margin-left: 10px;
text-align: center;
vertical-align: top;
}
.vmtemplate img {
width: 48px;
height: 48px;
}
.vmtemplate p {
text-align: center;
margin-top: 8px;
line-height: 12px;
}
</style>
<? foreach($arrAllTemplates as $strName => $arrTemplate):
if (empty($arrTemplate)) {
// render header
echo '<div class="vmheader">'.$strName.'</div>';
continue;
}
?>
<div class="vmtemplate">
<a href="/VMs/AddVM?template=<?=htmlspecialchars(urlencode($strName))?>">
<img src="/plugins/dynamix.vm.manager/templates/images/<?=htmlspecialchars($arrTemplate['icon'])?>" title="<?=htmlspecialchars($strName)?>">
<p><?=htmlspecialchars($strName)?></p>
</a>
</div>
<? endforeach; ?>