Annotation of /mambo/branches/4.6/administrator/components/com_installer/module/module.php
Parent Directory
|
Revision Log
Revision 941 - (view) (download)
| 1 : | root | 1 | <?php |
| 2 : | /** | ||
| 3 : | csouza | 297 | * @package Mambo Open Source |
| 4 : | root | 1 | * @subpackage Installer |
| 5 : | cauld | 941 | * @copyright (C) 2005 - 2007 Mambo Foundation Inc. |
| 6 : | root | 1 | * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL |
| 7 : | csouza | 297 | * |
| 8 : | * Mambo was originally developed by Miro (www.miro.com.au) in 2000. Miro assigned the copyright in Mambo to The Mambo Foundation in 2005 to ensure | ||
| 9 : | * that Mambo remained free Open Source software owned and managed by the community. | ||
| 10 : | root | 1 | * Mambo is Free Software |
| 11 : | */ | ||
| 12 : | |||
| 13 : | /** ensure this file is being included by a parent file */ | ||
| 14 : | defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); | ||
| 15 : | |||
| 16 : | // ensure user has access to this function | ||
| 17 : | if ( !$acl->acl_check( 'administration', 'install', 'users', $my->usertype, $element . 's', 'all' ) ) { | ||
| 18 : | csouza | 194 | mosRedirect( 'index2.php', T_('You are not authorized to view this resource.') ); |
| 19 : | root | 1 | } |
| 20 : | |||
| 21 : | require_once( $mainframe->getPath( 'installer_html', 'module' ) ); | ||
| 22 : | |||
| 23 : | showInstalledModules( $option ); | ||
| 24 : | |||
| 25 : | /** | ||
| 26 : | * @param string The URL option | ||
| 27 : | */ | ||
| 28 : | function showInstalledModules( $_option ) { | ||
| 29 : | global $database, $mosConfig_absolute_path; | ||
| 30 : | |||
| 31 : | $filter = mosGetParam( $_POST, 'filter', '' ); | ||
| 32 : | csouza | 149 | $select[] = mosHTML::makeOption( '', T_('All') ); |
| 33 : | $select[] = mosHTML::makeOption( '0', T_('Site Modules') ); | ||
| 34 : | $select[] = mosHTML::makeOption( '1', T_('Admin Modules') ); | ||
| 35 : | root | 1 | $lists['filter'] = mosHTML::selectList( $select, 'filter', 'class="inputbox" size="1" onchange="document.adminForm.submit();"', 'value', 'text', $filter ); |
| 36 : | if ( $filter == NULL ) { | ||
| 37 : | konlong | 315 | $_and = ''; |
| 38 : | root | 1 | } else if ( !$filter ) { |
| 39 : | konlong | 315 | $_and = "\n AND client_id = '0'"; |
| 40 : | root | 1 | } else if ( $filter ) { |
| 41 : | konlong | 315 | $_and = "\n AND client_id = '1'"; |
| 42 : | root | 1 | } |
| 43 : | |||
| 44 : | $database->setQuery( "SELECT id, module, client_id" | ||
| 45 : | . "\n FROM #__modules" | ||
| 46 : | . "\n WHERE module LIKE 'mod_%' AND iscore='0'" | ||
| 47 : | konlong | 315 | . $_and |
| 48 : | root | 1 | . "\n GROUP BY module, client_id" |
| 49 : | . "\n ORDER BY client_id, module" | ||
| 50 : | ); | ||
| 51 : | $rows = $database->loadObjectList(); | ||
| 52 : | |||
| 53 : | $n = count( $rows ); | ||
| 54 : | for ($i = 0; $i < $n; $i++) { | ||
| 55 : | $row =& $rows[$i]; | ||
| 56 : | |||
| 57 : | // path to module directory | ||
| 58 : | if ($row->client_id == "1"){ | ||
| 59 : | csouza | 129 | $moduleBaseDir = mosPathName($mosConfig_absolute_path.'/administrator/modules'); |
| 60 : | root | 1 | } else { |
| 61 : | csouza | 129 | $moduleBaseDir = mosPathName($mosConfig_absolute_path.'/modules'); |
| 62 : | root | 1 | } |
| 63 : | |||
| 64 : | // xml file for module | ||
| 65 : | csouza | 129 | $xmlfile = $moduleBaseDir.$row->module.".xml"; |
| 66 : | root | 1 | |
| 67 : | if (file_exists( $xmlfile )) { | ||
| 68 : | csouza | 129 | $parser =& new mosXMLDescription($xmlfile); |
| 69 : | if ($parser->getType() != 'module') continue; | ||
| 70 : | $row->creationdate = $parser->getCreationDate('module'); | ||
| 71 : | $row->author = $parser->getAuthor('module'); | ||
| 72 : | $row->copyright = $parser->getCopyright('module'); | ||
| 73 : | $row->authorEmail = $parser->getAuthorEmail('module'); | ||
| 74 : | $row->authorUrl = $parser->getAuthorUrl('module'); | ||
| 75 : | $row->version = $parser->getVersion('module'); | ||
| 76 : | /* | ||
| 77 : | root | 1 | $xmlDoc =& new DOMIT_Lite_Document(); |
| 78 : | $xmlDoc->resolveErrors( true ); | ||
| 79 : | if (!$xmlDoc->loadXML( $xmlfile, false, true )) { | ||
| 80 : | continue; | ||
| 81 : | } | ||
| 82 : | |||
| 83 : | $element = &$xmlDoc->documentElement; | ||
| 84 : | |||
| 85 : | if ($element->getTagName() != 'mosinstall') { | ||
| 86 : | continue; | ||
| 87 : | } | ||
| 88 : | if ($element->getAttribute( "type" ) != "module") { | ||
| 89 : | continue; | ||
| 90 : | } | ||
| 91 : | |||
| 92 : | $element = &$xmlDoc->getElementsByPath( 'creationDate', 1 ); | ||
| 93 : | $row->creationdate = $element ? $element->getText() : ''; | ||
| 94 : | |||
| 95 : | $element = &$xmlDoc->getElementsByPath( 'author', 1 ); | ||
| 96 : | $row->author = $element ? $element->getText() : ''; | ||
| 97 : | |||
| 98 : | $element = &$xmlDoc->getElementsByPath( 'copyright', 1 ); | ||
| 99 : | $row->copyright = $element ? $element->getText() : ''; | ||
| 100 : | |||
| 101 : | $element = &$xmlDoc->getElementsByPath( 'authorEmail', 1 ); | ||
| 102 : | $row->authorEmail = $element ? $element->getText() : ''; | ||
| 103 : | |||
| 104 : | $element = &$xmlDoc->getElementsByPath( 'authorUrl', 1 ); | ||
| 105 : | $row->authorUrl = $element ? $element->getText() : ''; | ||
| 106 : | |||
| 107 : | $element = &$xmlDoc->getElementsByPath( 'version', 1 ); | ||
| 108 : | $row->version = $element ? $element->getText() : ''; | ||
| 109 : | csouza | 129 | */ |
| 110 : | root | 1 | } |
| 111 : | } | ||
| 112 : | |||
| 113 : | HTML_module::showInstalledModules( $rows, $_option, $xmlfile, $lists ); | ||
| 114 : | } | ||
| 115 : | ?> |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |
Web Hosting provided by Network Redux.

