[ Index ]
 

Code source de Joomla 1.0.13

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/administrator/components/com_installer/mambot/ -> mambot.php (source)

   1  <?php
   2  /**
   3  * @version $Id: mambot.php 2926 2006-03-27 06:58:11Z akede $
   4  * @package Joomla
   5  * @subpackage Installer
   6  * @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
   7  * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
   8  * Joomla! is free software. This version may have been modified pursuant
   9  * to the GNU General Public License, and as distributed it includes or
  10  * is derivative of works licensed under the GNU General Public License or
  11  * other free or open source software licenses.
  12  * See COPYRIGHT.php for copyright notices and details.
  13  * */
  14  
  15  // no direct access
  16  defined( '_VALID_MOS' ) or die( 'Restricted access' );
  17  
  18  // ensure user has access to this function
  19  if ( !$acl->acl_check( 'administration', 'install', 'users', $my->usertype, $element . 's', 'all' ) ) {
  20      mosRedirect( 'index2.php', _NOT_AUTH );
  21  }
  22  
  23  require_once( $mainframe->getPath( 'installer_html', 'mambot' ) );
  24  
  25  HTML_installer::showInstallForm( 'Install new Mambots', $option, 'mambot', '', dirname(__FILE__) );
  26  ?>
  27  <table class="content">
  28  <?php
  29  writableCell( 'media' );
  30  writableCell( 'language' );
  31  writableCell( 'mambots' );
  32  writableCell( 'mambots/content' );
  33  writableCell( 'mambots/search' );
  34  writableCell( 'mambots/system' );?>
  35  </table>
  36  <?php
  37  showInstalledMambots( $option );
  38  
  39  function showInstalledMambots( $_option ) {
  40      global $database, $mosConfig_absolute_path;
  41  
  42      $query = "SELECT id, name, folder, element, client_id"
  43      . "\n FROM #__mambots"
  44      . "\n WHERE iscore = 0"
  45      . "\n ORDER BY folder, name"
  46      ;
  47      $database->setQuery( $query );
  48      $rows = $database->loadObjectList();
  49  
  50      // path to mambot directory
  51      $mambotBaseDir    = mosPathName( mosPathName( $mosConfig_absolute_path ) . "mambots" );
  52  
  53      $id = 0;
  54      $n = count( $rows );
  55      for ($i = 0; $i < $n; $i++) {
  56          $row =& $rows[$i];
  57          // xml file for module
  58          $xmlfile = $mambotBaseDir. "/" .$row->folder . '/' . $row->element .".xml";
  59  
  60          if (file_exists( $xmlfile )) {
  61              $xmlDoc = new DOMIT_Lite_Document();
  62              $xmlDoc->resolveErrors( true );
  63              if (!$xmlDoc->loadXML( $xmlfile, false, true )) {
  64                  continue;
  65              }
  66  
  67              $root = &$xmlDoc->documentElement;
  68  
  69              if ($root->getTagName() != 'mosinstall') {
  70                  continue;
  71              }
  72              if ($root->getAttribute( "type" ) != "mambot") {
  73                  continue;
  74              }
  75  
  76              $element             = &$root->getElementsByPath('creationDate', 1);
  77              $row->creationdate     = $element ? $element->getText() : '';
  78  
  79              $element             = &$root->getElementsByPath('author', 1);
  80              $row->author         = $element ? $element->getText() : '';
  81  
  82              $element             = &$root->getElementsByPath('copyright', 1);
  83              $row->copyright     = $element ? $element->getText() : '';
  84  
  85              $element             = &$root->getElementsByPath('authorEmail', 1);
  86              $row->authorEmail     = $element ? $element->getText() : '';
  87  
  88              $element             = &$root->getElementsByPath('authorUrl', 1);
  89              $row->authorUrl     = $element ? $element->getText() : '';
  90  
  91              $element             = &$root->getElementsByPath('version', 1);
  92              $row->version         = $element ? $element->getText() : '';
  93          }
  94      }
  95  
  96      HTML_mambot::showInstalledMambots($rows, $_option, $id, $xmlfile );
  97  }
  98  ?>


Généré le : Wed Nov 21 14:43:32 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics