Annotation of /mambo/branches/4.6/administrator/components/com_installer/module/module.php
Parent Directory
|
Revision Log
Revision 218 - (view) (download)
| 1 : | root | 1 | <?php |
| 2 : | /** | ||
| 3 : | * @version $Id: module.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 : | root | 1 | } |
| 18 : | |||
| 19 : | require_once( $mainframe->getPath( 'installer_html', 'module' ) ); | ||
| 20 : | |||
| 21 : | showInstalledModules( $option ); | ||
| 22 : | |||
| 23 : | /** | ||
| 24 : | * @param string The URL option | ||
| 25 : | */ | ||
| 26 : | function showInstalledModules( $_option ) { | ||
| 27 : | global $database, $mosConfig_absolute_path; | ||
| 28 : | |||
| 29 : | $filter = mosGetParam( $_POST, 'filter', '' ); | ||
| 30 : | csouza | 149 | $select[] = mosHTML::makeOption( '', T_('All') ); |
| 31 : | $select[] = mosHTML::makeOption( '0', T_('Site Modules') ); | ||
| 32 : | $select[] = mosHTML::makeOption( '1', T_('Admin Modules') ); | ||
| 33 : | root | 1 | $lists['filter'] = mosHTML::selectList( $select, 'filter', 'class="inputbox" size="1" onchange="document.adminForm.submit();"', 'value', 'text', $filter ); |
| 34 : | if ( $filter == NULL ) { | ||
| 35 : | $and = ''; | ||
| 36 : | } else if ( !$filter ) { | ||
| 37 : | $and = "\n AND client_id = '0'"; | ||
| 38 : | } else if ( $filter ) { | ||
| 39 : | $and = "\n AND client_id = '1'"; | ||
| 40 : | } | ||
| 41 : | |||
| 42 : | $database->setQuery( "SELECT id, module, client_id" | ||
| 43 : | . "\n FROM #__modules" | ||
| 44 : | . "\n WHERE module LIKE 'mod_%' AND iscore='0'" | ||
| 45 : | . $and | ||
| 46 : | . "\n GROUP BY module, client_id" | ||
| 47 : | . "\n ORDER BY client_id, module" | ||
| 48 : | ); | ||
| 49 : | $rows = $database->loadObjectList(); | ||
| 50 : | |||
| 51 : | $n = count( $rows ); | ||
| 52 : | for ($i = 0; $i < $n; $i++) { | ||
| 53 : | $row =& $rows[$i]; | ||
| 54 : | |||
| 55 : | // path to module directory | ||
| 56 : | if ($row->client_id == "1"){ | ||
| 57 : | csouza | 129 | $moduleBaseDir = mosPathName($mosConfig_absolute_path.'/administrator/modules'); |
| 58 : | root | 1 | } else { |
| 59 : | csouza | 129 | $moduleBaseDir = mosPathName($mosConfig_absolute_path.'/modules'); |
| 60 : | root | 1 | } |
| 61 : | |||
| 62 : | // xml file for module | ||
| 63 : | csouza | 129 | $xmlfile = $moduleBaseDir.$row->module.".xml"; |
| 64 : | root | 1 | |
| 65 : | if (file_exists( $xmlfile )) { | ||
| 66 : | csouza | 129 | $parser =& new mosXMLDescription($xmlfile); |
| 67 : | if ($parser->getType() != 'module') continue; | ||
| 68 : | $row->creationdate = $parser->getCreationDate('module'); | ||
| 69 : | $row->author = $parser->getAuthor('module'); | ||
| 70 : | $row->copyright = $parser->getCopyright('module'); | ||
| 71 : | $row->authorEmail = $parser->getAuthorEmail('module'); | ||
| 72 : | $row->authorUrl = $parser->getAuthorUrl('module'); | ||
| 73 : | $row->version = $parser->getVersion('module'); | ||
| 74 : | /* | ||
| 75 : | root | 1 | $xmlDoc =& new DOMIT_Lite_Document(); |
| 76 : | $xmlDoc->resolveErrors( true ); | ||
| 77 : | if (!$xmlDoc->loadXML( $xmlfile, false, true )) { | ||
| 78 : | continue; | ||
| 79 : | } | ||
| 80 : | |||
| 81 : | $element = &$xmlDoc->documentElement; | ||
| 82 : | |||
| 83 : | if ($element->getTagName() != 'mosinstall') { | ||
| 84 : | continue; | ||
| 85 : | } | ||
| 86 : | if ($element->getAttribute( "type" ) != "module") { | ||
| 87 : | continue; | ||
| 88 : | } | ||
| 89 : | |||
| 90 : | $element = &$xmlDoc->getElementsByPath( 'creationDate', 1 ); | ||
| 91 : | $row->creationdate = $element ? $element->getText() : ''; | ||
| 92 : | |||
| 93 : | $element = &$xmlDoc->getElementsByPath( 'author', 1 ); | ||
| 94 : | $row->author = $element ? $element->getText() : ''; | ||
| 95 : | |||
| 96 : | $element = &$xmlDoc->getElementsByPath( 'copyright', 1 ); | ||
| 97 : | $row->copyright = $element ? $element->getText() : ''; | ||
| 98 : | |||
| 99 : | $element = &$xmlDoc->getElementsByPath( 'authorEmail', 1 ); | ||
| 100 : | $row->authorEmail = $element ? $element->getText() : ''; | ||
| 101 : | |||
| 102 : | $element = &$xmlDoc->getElementsByPath( 'authorUrl', 1 ); | ||
| 103 : | $row->authorUrl = $element ? $element->getText() : ''; | ||
| 104 : | |||
| 105 : | $element = &$xmlDoc->getElementsByPath( 'version', 1 ); | ||
| 106 : | $row->version = $element ? $element->getText() : ''; | ||
| 107 : | csouza | 129 | */ |
| 108 : | root | 1 | } |
| 109 : | } | ||
| 110 : | |||
| 111 : | HTML_module::showInstalledModules( $rows, $_option, $xmlfile, $lists ); | ||
| 112 : | } | ||
| 113 : | ?> |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |
Web Hosting provided by Network Redux.

