2015-11-18 17:40:42 +01:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>{include="includes"}</head>
|
|
|
|
<body>
|
|
|
|
<div id="pageheader">
|
|
|
|
{include="page.header"}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<noscript>
|
|
|
|
<div>
|
|
|
|
<ul class="errors">
|
|
|
|
<li>You need to enable Javascript to change plugin loading order.</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<div class="clear"></div>
|
|
|
|
</noscript>
|
|
|
|
|
|
|
|
<div id="pluginsadmin">
|
|
|
|
<form action="?do=save_pluginadmin" method="POST">
|
|
|
|
<section id="enabled_plugins">
|
|
|
|
<h1>Enabled Plugins</h1>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
{if="count($enabledPlugins)==0"}
|
|
|
|
<p>No plugin enabled.</p>
|
|
|
|
{else}
|
|
|
|
<table id="plugin_table">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th class="center">Disable</th>
|
|
|
|
<th class="center">Order</th>
|
|
|
|
<th>Name</th>
|
|
|
|
<th>Description</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{loop="$enabledPlugins"}
|
|
|
|
<tr data-line="{$key}" data-order="{$counter}">
|
2016-02-23 14:48:35 +01:00
|
|
|
<td class="center"><input type="checkbox" name="{$key}" id="{$key}" checked="checked"></td>
|
2015-11-18 17:40:42 +01:00
|
|
|
<td class="center">
|
2016-12-01 11:40:24 +01:00
|
|
|
<a href="#" class="arrow"
|
2015-11-18 17:40:42 +01:00
|
|
|
onclick="return orderUp(this.parentNode.parentNode.getAttribute('data-order'));">
|
|
|
|
▲
|
|
|
|
</a>
|
2016-12-01 11:40:24 +01:00
|
|
|
<a href="#" class="arrow"
|
2015-11-18 17:40:42 +01:00
|
|
|
onclick="return orderDown(this.parentNode.parentNode.getAttribute('data-order'));">
|
|
|
|
▼
|
|
|
|
</a>
|
|
|
|
<input type="hidden" name="order_{$key}" value="{$counter}">
|
|
|
|
</td>
|
2016-02-23 14:48:35 +01:00
|
|
|
<td><label for="{$key}">{function="str_replace('_', ' ', $key)"}</label></td>
|
|
|
|
<td><label for="{$key}">{$value.description}</label></td>
|
2015-11-18 17:40:42 +01:00
|
|
|
</tr>
|
|
|
|
{/loop}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
{/if}
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section id="disabled_plugins">
|
|
|
|
<h1>Disabled Plugins</h1>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
{if="count($disabledPlugins)==0"}
|
|
|
|
<p>No plugin disabled.</p>
|
|
|
|
{else}
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<th class="center">Enable</th>
|
|
|
|
<th>Name</th>
|
|
|
|
<th>Description</th>
|
|
|
|
</tr>
|
|
|
|
{loop="$disabledPlugins"}
|
|
|
|
<tr>
|
2016-02-23 14:48:35 +01:00
|
|
|
<td class="center"><input type="checkbox" name="{$key}" id="{$key}"></td>
|
|
|
|
<td><label for="{$key}">{function="str_replace('_', ' ', $key)"}</label></td>
|
|
|
|
<td><label for="{$key}">{$value.description}</label></td>
|
2015-11-18 17:40:42 +01:00
|
|
|
</tr>
|
|
|
|
{/loop}
|
|
|
|
</table>
|
|
|
|
{/if}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="center">
|
|
|
|
<input type="submit" value="Save"/>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
<form action="?do=save_pluginadmin" method="POST">
|
|
|
|
<section id="plugin_parameters">
|
|
|
|
<h1>Enabled Plugin Parameters</h1>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
{if="count($enabledPlugins)==0"}
|
|
|
|
<p>No plugin enabled.</p>
|
|
|
|
{else}
|
|
|
|
{loop="$enabledPlugins"}
|
|
|
|
{if="count($value.parameters) > 0"}
|
|
|
|
<div class="plugin_parameters">
|
2016-02-23 14:48:35 +01:00
|
|
|
<h2>{function="str_replace('_', ' ', $key)"}</h2>
|
2015-11-18 17:40:42 +01:00
|
|
|
{loop="$value.parameters"}
|
|
|
|
<div class="plugin_parameter">
|
|
|
|
<div class="float_label">
|
|
|
|
<label for="{$key}">
|
2016-08-02 11:03:55 +02:00
|
|
|
<code>{$key}</code><br>
|
2016-10-14 12:48:01 +02:00
|
|
|
{if="isset($value.desc)"}
|
|
|
|
{$value.desc}
|
|
|
|
{/if}
|
2015-11-18 17:40:42 +01:00
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
<div class="float_input">
|
2016-08-02 11:03:55 +02:00
|
|
|
<input name="{$key}" value="{$value.value}" id="{$key}"/>
|
2015-11-18 17:40:42 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{/loop}
|
|
|
|
</div>
|
|
|
|
{/if}
|
|
|
|
{/loop}
|
|
|
|
{/if}
|
|
|
|
<div class="center">
|
|
|
|
<input type="submit" name="parameters_form" value="Save"/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
{include="page.footer"}
|
|
|
|
|
2018-02-24 18:34:50 +01:00
|
|
|
<script>
|
|
|
|
/**
|
|
|
|
* Change the position counter of a row.
|
|
|
|
*
|
|
|
|
* @param elem Element Node to change.
|
|
|
|
* @param toPos int New position.
|
|
|
|
*/
|
|
|
|
function changePos(elem, toPos) {
|
|
|
|
var elemName = elem.getAttribute('data-line');
|
|
|
|
|
|
|
|
elem.setAttribute('data-order', toPos);
|
|
|
|
var hiddenInput = document.querySelector('[name="order_' + elemName + '"]');
|
|
|
|
hiddenInput.setAttribute('value', toPos);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Move a row up or down.
|
|
|
|
*
|
|
|
|
* @param pos Element Node to move.
|
|
|
|
* @param move int Move: +1 (down) or -1 (up)
|
|
|
|
*/
|
|
|
|
function changeOrder(pos, move) {
|
|
|
|
var newpos = parseInt(pos) + move;
|
|
|
|
var lines = document.querySelectorAll('[data-order="' + pos + '"]');
|
|
|
|
var changelines = document.querySelectorAll('[data-order="' + newpos + '"]');
|
|
|
|
|
|
|
|
// If we go down reverse lines to preserve the rows order
|
|
|
|
if (move > 0) {
|
|
|
|
lines = [].slice.call(lines).reverse();
|
|
|
|
}
|
|
|
|
|
|
|
|
for (var i = 0; i < lines.length; i++) {
|
|
|
|
var parent = changelines[0].parentNode;
|
|
|
|
changePos(lines[i], newpos);
|
|
|
|
changePos(changelines[i], parseInt(pos));
|
|
|
|
var changeItem = move < 0 ? changelines[0] : changelines[changelines.length - 1].nextSibling;
|
|
|
|
parent.insertBefore(lines[i], changeItem);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Move a row up in the table.
|
|
|
|
*
|
|
|
|
* @param pos int row counter.
|
|
|
|
*
|
|
|
|
* @returns false
|
|
|
|
*/
|
|
|
|
function orderUp(pos) {
|
|
|
|
if (pos == 0) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
changeOrder(pos, -1);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Move a row down in the table.
|
|
|
|
*
|
|
|
|
* @param pos int row counter.
|
|
|
|
*
|
|
|
|
* @returns false
|
|
|
|
*/
|
|
|
|
function orderDown(pos) {
|
|
|
|
var lastpos = document.querySelector('[data-order]:last-child').getAttribute('data-order');
|
|
|
|
if (pos == lastpos) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
changeOrder(pos, +1);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
</script>
|
2015-11-18 17:40:42 +01:00
|
|
|
</body>
|
2016-02-23 14:48:35 +01:00
|
|
|
</html>
|