[ Index ]
 

Code source de Plume CMS 1.2.2

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/manager/ -> tools.php (source)

   1  <?php
   2  /* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
   3  /*
   4  # ***** BEGIN LICENSE BLOCK *****
   5  # This file is part of Plume CMS, a website management application.
   6  # Copyright (C) 2001-2005 Loic d'Anterroches and contributors.
   7  #
   8  # Plume CMS is free software; you can redistribute it and/or modify
   9  # it under the terms of the GNU General Public License as published by
  10  # the Free Software Foundation; either version 2 of the License, or
  11  # (at your option) any later version.
  12  #
  13  # Plume CMS is distributed in the hope that it will be useful,
  14  # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16  # GNU General Public License for more details.
  17  #
  18  # You should have received a copy of the GNU General Public License
  19  # along with this program; if not, write to the Free Software
  20  # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  21  #
  22  # ***** END LICENSE BLOCK ***** */
  23  
  24  require_once 'path.php';
  25  require_once $_PX_config['manager_path'].'/prepend.php';
  26  auth::checkAuth(PX_AUTH_ADMIN);
  27  
  28  $m = new Manager();
  29  $_px_theme = $m->user->getTheme();
  30  
  31  
  32  $px_lang = new l10n($m->user->lang);
  33  $is_user_root = auth::asLevel(PX_AUTH_ROOT);
  34  
  35  require dirname(__FILE__).'/extinc/class.plugins.php';
  36  
  37  
  38  # On fait la liste des plugins
  39  $plugins_root = dirname(__FILE__).'/tools/';
  40  
  41  $objPlugins = new plugins($plugins_root);
  42  $plugins_list = $objPlugins->getPlugins();
  43  
  44  $include = '';
  45  
  46  if (!empty($_REQUEST['p']) && !empty($plugins_list[$_REQUEST['p']])
  47      && $plugins_list[$_REQUEST['p']]['active']) {
  48      $px_submenu->addItem(__('Back to the tools'), 'tools.php',
  49                           'themes/'.$_px_theme.'/images/ico_back.png',
  50                           false);
  51      $p = $_REQUEST['p'];
  52      $_px_ptheme = $m->user->getPluginTheme($p);
  53      ob_start();
  54      include $plugins_root.$p.'/index.php';
  55      $include = ob_get_contents();
  56      ob_end_clean();
  57  }
  58  
  59  $px_title = __('Tools and plugins');
  60  
  61  include dirname(__FILE__).'/mtemplates/_top.php';
  62  
  63  if ($include != '') {    
  64      echo $include;
  65  } else {
  66      echo '<h1>'. __('Tools and plugins')."</h1>\n\n";
  67      
  68      if (count($plugins_list) == 0) {
  69          echo '<p>'. __('No active or available tools.').'</p>';
  70      } else {
  71          echo '<dl class="plugin-list">';
  72          foreach ($plugins_list as $pname => $pdesc) {
  73              if ($pdesc['rootonly'] != true or ($is_user_root)) {
  74                  echo '<dt>';
  75                  $ptheme = $m->user->getPluginTheme($pname);
  76                  if (file_exists($plugins_root.$pname.'/themes/'.$ptheme.'/icon.png')) {
  77                      echo '<img alt="" src="tools/'.$pname.'/themes/'.$ptheme.'/icon.png" /> ';
  78                  }
  79                  echo '<a href="tools.php?p='.$pname.'">';
  80                  
  81                  if (!empty($pdesc['label'])) {
  82                      echo $pdesc['label'];
  83                  } else {
  84                      echo $pdesc['name'];
  85                  }
  86                  echo '</a>';
  87                  echo '</dt>';
  88                  
  89                  echo '<dd>'.$pdesc['desc'].'</dd>';
  90              }
  91          }
  92          echo '</dl>';
  93      }
  94  }
  95  
  96  include dirname(__FILE__).'/mtemplates/_bottom.php'; 
  97  ?>


Généré le : Mon Nov 26 11:57:01 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics