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

