Source for file mambot.php

Documentation is available at mambot.php

  1. <?php
  2. /**
  3. @package Mambo
  4. @subpackage Installer
  5. @copyright  Refer to copyright.php
  6. @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
  7. @author Mambo Foundation Inc see README.php
  8. */
  9.  
  10. /** ensure this file is being included by a parent file */
  11. defined'_VALID_MOS' or die'Direct Access to this location is not allowed.' );
  12.  
  13. // ensure user has access to this function
  14. if !$acl->acl_check'administration''install''users'$my->usertype$element 's''all' ) ) {
  15.     mosRedirect'index2.php'T_('You are not authorized to view this resource.') );
  16. }
  17.  
  18. require_once$mainframe->getPath'installer_html''mambot' ) );
  19.  
  20. showInstalledMambots$option );
  21.  
  22. function showInstalledMambots$_option {
  23.     global $database$mosConfig_absolute_path;
  24.  
  25.     $database->setQuery"SELECT id, name, folder, element, client_id"
  26.     . "\n FROM #__mambots"
  27.     . "\n WHERE iscore='0'"
  28.     . "\n ORDER BY folder, name"
  29.     );
  30.     $rows $database->loadObjectList();
  31.  
  32.     // path to mambot directory
  33.     $mambotBaseDir    mosPathName($mosConfig_absolute_path.'/mambots');
  34.  
  35.     $id 0;
  36.     $n count$rows );
  37.     for ($i 0$i $n$i++{
  38.         $row =$rows[$i];
  39.         // xml file for module
  40.         $xmlfile mosPathName ($mambotBaseDir.$row->folder).$row->element.".xml";
  41.  
  42.         if (file_exists$xmlfile )) {
  43.             $parser =new mosXMLDescription($xmlfile);
  44.             if ($parser->getType(!= 'mambot'continue;
  45.             $row->creationdate $parser->getCreationDate('mambot');
  46.             $row->author $parser->getAuthor('mambot');
  47.             $row->copyright $parser->getCopyright('mambot');
  48.             $row->authorEmail $parser->getAuthorEmail('mambot');
  49.             $row->authorUrl $parser->getAuthorUrl('mambot');
  50.             $row->version $parser->getVersion('mambot');
  51.  
  52. /*            $xmlDoc =& new DOMIT_Lite_Document();
  53.             $xmlDoc->resolveErrors( true );
  54.             if (!$xmlDoc->loadXML( $xmlfile, false, true )) {
  55.                 continue;
  56.             }
  57.  
  58.             $element = &$xmlDoc->documentElement;
  59.  
  60.             if ($element->getTagName() != 'mosinstall') {
  61.                 continue;
  62.             }
  63.             if ($element->getAttribute( "type" ) != "mambot") {
  64.                 continue;
  65.             }
  66.  
  67.             $element = &$xmlDoc->getElementsByPath('creationDate', 1);
  68.             $row->creationdate = $element ? $element->getText() : '';
  69.  
  70.             $element = &$xmlDoc->getElementsByPath('author', 1);
  71.             $row->author = $element ? $element->getText() : '';
  72.  
  73.             $element = &$xmlDoc->getElementsByPath('copyright', 1);
  74.             $row->copyright = $element ? $element->getText() : '';
  75.  
  76.             $element = &$xmlDoc->getElementsByPath('authorEmail', 1);
  77.             $row->authorEmail = $element ? $element->getText() : '';
  78.  
  79.             $element = &$xmlDoc->getElementsByPath('authorUrl', 1);
  80.             $row->authorUrl = $element ? $element->getText() : '';
  81.  
  82.             $element = &$xmlDoc->getElementsByPath('version', 1);
  83.             $row->version = $element ? $element->getText() : '';
  84. */
  85.         }
  86.     }
  87.  
  88.     HTML_mambot::showInstalledMambots($rows$_option$id$xmlfile );
  89. }
  90. ?>

Documentation generated on Mon, 05 May 2008 16:21:08 +0400 by phpDocumentor 1.4.0