header('Location: tools.php?p=toolsmng'); exit; } if ($err != '') { buffer::str('<div class="erreur"><p><strong>' . __('Error(s)') . ' :</strong></p>' . $err . '</div>'); } buffer::str('<h2>' . __('Plugins manager') . '</h2>' . '<h3>' . __('Install a plugin') . '</h3>'); if (!$is_writable) { buffer::str('<p>' . sprintf(__('The folder %s is not writable, please check its permissions.'), DC_ECRIRE . '/tools/') . '</p>'); } else { buffer::str('<form action="tools.php" method="get">' . '<p><label for="tool_url">' . __('Please give the URL (http or ftp) of the plugin\'s file') . ' :</label>' . form::field('tool_url', 50, '', $tool_url) . '</p>' . '<p><input type="submit" class="submit" value="' . __('install') . '" />' . '<input type="hidden" name="p" value="toolsmng" /></p>' . '</form>'); } buffer::str('<p><a href="http://www.wikini.net">' . __('Install new plugins') . '</a></p>'); # Traduction des plugins foreach ($plugins_list as $k => $v) { $plugins->loadl10n($k); $plugins_list[$k]['label'] = __($v['label']); $plugins_list[$k]['desc'] = __($v['desc']); } # Tri des plugins par leur nom uasort($plugins_list, create_function('$a,$b', 'return strcmp($a["label"],$b["label"]);')); buffer::str('<h3>' . __('List of installed plugins') . '</h3>' . '<dl>'); foreach ($plugins_list as $k => $v) { buffer::str('<dt>' . __($v['label']) . ' - ' . $k . '</dt>' . '<dd>' . __($v['desc']) . ' <br />' . 'par ' . $v['author'] . ' - ' . __('version') . ' ' . $v['version'] . ' <br />'); if ($k != 'toolsmng') { if (is_writable($plugins_root . $k . '/desc.xml')) { $action = $v['active'] ? 'disable' : 'enable'; buffer::str('<a href="tools.php?p=toolsmng&switch=' . $k . '">' . __($action) . '</a>'); } else { buffer::str('<em>' . sprintf(__('cannot enable/disable'), 'desc.xml') . '</em>'); }