3 <head>{
include="includes"}
</head>
6 {
include="page.header"}
12 <li>You need to enable Javascript to change plugin loading order.
</li>
15 <div class=
"clear"></div>
18 <div id=
"pluginsadmin">
19 <form action=
"./?do=save_pluginadmin" method=
"POST">
20 <section id=
"enabled_plugins">
21 <h1>Enabled Plugins
</h1>
24 {
if="count($enabledPlugins)==
0"}
25 <p>No plugin enabled.
</p>
27 <table id=
"plugin_table">
30 <th class=
"center">Disable
</th>
31 <th class=
"center">Order
</th>
37 {
loop="$enabledPlugins"}
38 <tr data-line=
"{$key}" data-order=
"{$counter}">
39 <td class=
"center"><input type=
"checkbox" name=
"{$key}" id=
"{$key}" checked=
"checked"></td>
41 <a href=
"#" class=
"arrow"
42 onclick=
"return orderUp(this.parentNode.parentNode.getAttribute('data-order'));">
45 <a href=
"#" class=
"arrow"
46 onclick=
"return orderDown(this.parentNode.parentNode.getAttribute('data-order'));">
49 <input type=
"hidden" name=
"order_{$key}" value=
"{$counter}">
51 <td><label for=
"{$key}">{
function="str_replace('_', ' ', $key)"}
</label></td>
52 <td><label for=
"{$key}">{$value.description}
</label></td>
61 <section id=
"disabled_plugins">
62 <h1>Disabled Plugins
</h1>
65 {
if="count($disabledPlugins)==
0"}
66 <p>No plugin disabled.
</p>
70 <th class=
"center">Enable
</th>
74 {
loop="$disabledPlugins"}
76 <td class=
"center"><input type=
"checkbox" name=
"{$key}" id=
"{$key}"></td>
77 <td><label for=
"{$key}">{
function="str_replace('_', ' ', $key)"}
</label></td>
78 <td><label for=
"{$key}">{$value.description}
</label></td>
86 <input type=
"submit" value=
"Save"/>
91 <form action=
"./?do=save_pluginadmin" method=
"POST">
92 <section id=
"plugin_parameters">
93 <h1>Enabled Plugin Parameters
</h1>
96 {
if="count($enabledPlugins)==
0"}
97 <p>No plugin enabled.
</p>
99 {
loop="$enabledPlugins"}
100 {
if="count($value.parameters)
> 0"}
101 <div class="plugin_parameters
">
102 <h2>{function="str_replace('_', ' ', $key)"}
</h2>
103 {
loop="$value.parameters"}
104 <div class=
"plugin_parameter">
105 <div class=
"float_label">
107 <code>{$key}
</code><br>
108 {
if="isset($value.desc)"}
113 <div class=
"float_input">
114 <input name=
"{$key}" value=
"{$value.value}" id=
"{$key}"/>
123 <input type=
"submit" name=
"parameters_form" value=
"Save"/>
130 {
include="page.footer"}
134 * Change the position counter of a row.
136 * @param elem Element Node to change.
137 * @param toPos int New position.
139 function changePos(elem, toPos) {
140 var elemName = elem.getAttribute('data-line');
142 elem.setAttribute('data-order', toPos);
143 var hiddenInput = document.querySelector('[
name="order_' + elemName + '"]');
144 hiddenInput.setAttribute('value', toPos);
148 * Move a row up or down.
150 * @param pos Element Node to move.
151 * @param move int Move: +
1 (down) or -
1 (up)
153 function changeOrder(pos, move) {
154 var newpos = parseInt(pos) + move;
155 var lines = document.querySelectorAll('[
data-order="' + pos + '"]');
156 var changelines = document.querySelectorAll('[
data-order="' + newpos + '"]');
158 // If we go down reverse lines to preserve the rows order
160 lines = [].slice.call(lines).reverse();
163 for (var i =
0; i < lines.length; i++) {
164 var parent = changelines[
0].parentNode;
165 changePos(lines[i], newpos);
166 changePos(changelines[i], parseInt(pos));
167 var changeItem = move <
0 ? changelines[
0] : changelines[changelines.length -
1].nextSibling;
168 parent.insertBefore(lines[i], changeItem);
173 * Move a row up in the table.
175 * @param pos int row counter.
179 function orderUp(pos) {
183 changeOrder(pos, -
1);
188 * Move a row down in the table.
190 * @param pos int row counter.
194 function orderDown(pos) {
195 var lastpos = document.querySelector('[data-order]:last-child').getAttribute('data-order');
196 if (pos == lastpos) {
200 changeOrder(pos, +
1);