123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- <?php
- require dirname(__FILE__).'/inc/prepend.php';
- require dirname(__FILE__).'/../inc/libs/lib.buffer.php';
- if (!empty($_GET['logout'])) {
- $_SESSION = array();
- }
- $auth->check(9);
- include dirname(__FILE__).'/inc/connexion.php';
- $plugins_root = dirname(__FILE__).'/tools/';
- $plugins = new plugins($plugins_root);
- $plugins->getPlugins(true);
- $plugins_list = $plugins->getPluginsList();
- $PLUGIN_HEAD = '';
- $PLUGIN_BODY = '';
- if ((!empty($_REQUEST['p']) && !empty($plugins_list[$_REQUEST['p']])
- && $plugins_list[$_REQUEST['p']]['active']))
- {
- $p = $_REQUEST['p'];
- $plugins->loadl10n($p);
- buffer::init();
- include $plugins_root.$p.'/index.php';
- $PLUGIN_BODY = buffer::getContent();
- buffer::clean();
-
- $mySubMenu->addItem(__('Back to tools'),'tools.php',
- 'images/ico_retour.png',false);
- }
- openPage(__('Tools'),$PLUGIN_HEAD);
- if ($PLUGIN_BODY != '')
- {
- echo $PLUGIN_BODY;
- }
- else
- {
- echo '<h2>'.__('Tools').'</h2>';
- if (count($plugins_list) == 0)
- {
- echo '<p>Aucun outil n\'est disponible ou actif</p>';
- }
- else
- {
-
- foreach ($plugins_list as $k => $v)
- {
- $plugins->loadl10n($k);
-
- $plugins_list[$k]['label'] = __($v['label']);
- $plugins_list[$k]['desc'] = __($v['desc']);
- }
-
-
- uasort($plugins_list,create_function('$a,$b','return strcmp($a["label"],$b["label"]);'));
-
-
- echo '<dl class="plugin-list">';
- foreach ($plugins_list as $k => $v)
- {
- $plink = '<a href="tools.php?p='.$k.'">%s</a>';
- $plabel = (!empty($v['label'])) ? $v['label'] : $v['name'];
-
- echo '<dt>';
- if (file_exists($plugins_root.$k.'/icon.png')) {
- printf($plink,'<img alt="" src="tools/'.$k.'/icon.png" />');
- echo ' ';
- }
-
- printf($plink,$plabel);
- echo '</dt>';
-
- echo '<dd>'.$v['desc'].'</dd>';
- }
- echo '</dl>';
- }
- }
- closePage();
- ?>
|