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

