Commit c5ad33bb authored by Penny Leach's avatar Penny Leach
Browse files

rework of admin plugins page

parent dcb4910c
......@@ -104,12 +104,17 @@ $javascript = <<<JAVASCRIPT
function installplugin(name) {
var d = loadJSONDoc('../upgrade.json.php', { 'name': name });
$(name).innerHTML = '<img src="{$loadingicon}" alt="{$loadingstring}" />';
$(name + '.message').innerHTML = '<img src="{$loadingicon}" alt="{$loadingstring}" />';
d.addCallbacks(function (data) {
if (data.success) {
var message = '{$successstring}' + data.newversion;
$(name).innerHTML = '<img src="{$successicon}" alt=":)" /> ' + message;
$(name + '.message').innerHTML = '<img src="{$successicon}" alt=":)" /> ' + message;
// move the whole thing into the list of installed plugins
// new parent node
var bits = name.split('\.');
var newparent = $(bits[0] + '.installed');
appendChildNodes(newparent, $(name));
}
if (data.error) {
var message = '';
......
......@@ -8,38 +8,46 @@
<div class="box-cnrs"><span class="cnr-tl"><span class="cnr-tr"><span class="cnr-bl"><span class="cnr-br">
<div class="maincontent">
<h2>Plugin Administration</h2>
{foreach from=$plugins key='plugintype' item='plugins'}
<h4>{str tag='plugintype'}: {$plugintype}</h4>
{assign var="installed" value=$plugins.installed}
{assign var="notinstalled" value=$plugins.notinstalled}
<p><b>{str tag='installedplugins'}</b></p>
{foreach from=$installed key='plugin' item='data'}
{$plugin}
{if $data.config}
(<a href="pluginconfig.php?plugintype={$plugintype}&amp;pluginname={$plugin}">{str tag='config'}</a>)
{/if}<br />
{if $data.types}
{foreach from=$data.types key='type' item='config'}
&nbsp;&nbsp;&nbsp;{$type}
{if $config} (<a href="pluginconfig.php?plugintype={$plugintype}&amp;pluginname={$plugin}&amp;type={$type}">{str tag='config'}</a>){/if}<br />
{/foreach}
{/if}
{/foreach}
{if $notinstalled}
<p><b>{str tag='notinstalledplugins'}</b></p>
{foreach from=$notinstalled key='plugin' item='data'}
{$plugin} {if $data.notinstallable} {str tag='notinstallable'} {$data.notinstallable}
{else} (<a href="" onClick="{$installlink}('{$plugintype}.{$plugin}'); return false;">install</a>)
{/if}
<div id="{$plugintype}.{$plugin}"></div>
{/foreach}
{/if}
{/foreach}
</div>
</span></span></span></span></div>
<h2>{str tag='pluginadmin' section='admin'}</h2>
<ul class="adminpluginstypes">
{foreach from=$plugins key='plugintype' item='plugins'}
<li><h4>{str tag='plugintype'}: {$plugintype}</h4></li>
{assign var="installed" value=$plugins.installed}
{assign var="notinstalled" value=$plugins.notinstalled}
<ul>
<li><b>{str tag='installedplugins'}</b></li>
<ul id="{$plugintype}.installed">
{foreach from=$installed key='plugin' item='data'}
<li id="{$plugintype}.{$plugin}">{$plugin}
{if $data.config}
(<a href="pluginconfig.php?plugintype={$plugintype}&amp;pluginname={$plugin}">{str tag='config'}</a>)
{/if}</li>
{if $data.types}
<ul>
{foreach from=$data.types key='type' item='config'}
<li>{$type}
{if $config} (<a href="pluginconfig.php?plugintype={$plugintype}&amp;pluginname={$plugin}&amp;type={$type}">{str tag='config'}</a>){/if}</li>
{/foreach}
</ul>
{/if}
{/foreach}
</ul>
{if $notinstalled}
<li><b>{str tag='notinstalledplugins'}</b></li>
<ul id="{$plugintype}.notinstalled">
{foreach from=$notinstalled key='plugin' item='data'}
<li id="{$plugintype}.{$plugin}">{$plugin} {if $data.notinstallable} {str tag='notinstallable'} {$data.notinstallable}
{else} (<a href="" onClick="{$installlink}('{$plugintype}.{$plugin}'); return false;">install</a>)
{/if}
<div id="{$plugintype}.{$plugin}.message"></div>
</li>
{/foreach}
</ul>
{/if}
</ul>
{/foreach}
</ul>
</div>
</div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment