2 /************************************************************************/
4 /************************************************************************/
5 /* Copyright (c) 2002-2010 */
6 /* Inclusive Design Institute */
8 /* This program is free software. You can redistribute it and/or */
9 /* modify it under the terms of the GNU General Public License */
10 /* as published by the Free Software Foundation. */
11 /************************************************************************/
14 define('AT_INCLUDE_PATH', '../../../include/');
15 require(AT_INCLUDE_PATH.'vitals.inc.php');
16 admin_authenticate(AT_ADMIN_PRIV_MODULES);
18 require(AT_INCLUDE_PATH.'../mods/_core/modules/classes/ModuleParser.class.php');
21 if (isset($_POST['submit_no'])) {
22 $msg->addFeedback('CANCELLED');
23 header('Location: '.AT_BASE_HREF.'mods/_core/modules/add_new.php');
25 } else if (isset($_POST['mod']) && isset($_POST['submit_yes'])) {
26 $module = $moduleFactory->getModule($_POST['mod']);
30 if ($msg->containsErrors()) {
31 header('Location: '.AT_BASE_HREF.'mods/_core/modules/details.php?mod='.$addslashes($_POST['mod']).SEP.'new=1');
33 $msg->addFeedback('MOD_INSTALLED');
34 header('Location: '.AT_BASE_HREF.'mods/_core/modules/index.php');
37 } else if (isset($_GET['submit'])) {
40 if (isset($_GET['enabled']) && $_GET['enabled']) { $args .= 'enabled=1'; }
41 if (isset($_GET['disabled']) && $_GET['disabled']) { $args .= SEP.'disabled=1'; }
42 if (isset($_GET['missing']) && $_GET['missing']) { $args .= SEP.'missing=1'; }
43 if (isset($_GET['core']) && $_GET['core']) { $args .= SEP.'core=1'; }
44 if (isset($_GET['standard']) && $_GET['standard']) { $args .= SEP.'standard=1'; }
45 if (isset($_GET['extra']) && $_GET['extra']) { $args .= SEP.'extra=1'; }
47 header('Location: index.php?'. $args);
51 require(AT_INCLUDE_PATH.'header.inc.php');
53 $moduleParser = new ModuleParser();
55 $_REQUEST['mod'] = str_replace(array('.','..'), '', $_REQUEST['mod']);
57 if (!file_exists('../../../mods/'.$_GET['mod'].'/module.xml')) {
59 <form method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
60 <input type="hidden" name="mod" value="<?php echo $_GET['mod']; ?>" />
61 <input type="hidden" name="new" value="<?php echo $_GET['new']; ?>" />
62 <div class="input-form">
64 <h3><?php echo $_GET['mod']; ?></h3>
68 <?php echo _AT('missing_info'); ?>
71 <div class="row buttons">
72 <input type="submit" name="submit" value="<?php echo _AT('back'); ?>" />
73 <?php if (isset($_GET['new']) && $_GET['new']): ?>
74 <input type="submit" name="install" value="<?php echo _AT('install'); ?>" />
81 require(AT_INCLUDE_PATH.'footer.inc.php');
85 $moduleParser->parse(file_get_contents('../../../mods/'.$_GET['mod'].'/module.xml'));
87 $module = $moduleFactory->getModule($_GET['mod']);
89 $properties = $module->getProperties(array('maintainers', 'url', 'date', 'license', 'state', 'notes', 'version'));
91 <form method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
92 <input type="hidden" name="mod" value="<?php echo $_GET['mod']; ?>" />
93 <input type="hidden" name="new" value="<?php echo $_GET['new']; ?>" />
95 <input type="hidden" name="enabled" value="<?php echo (int) isset($_GET['enabled']); ?>" />
96 <input type="hidden" name="disabled" value="<?php echo (int) isset($_GET['disabled']); ?>" />
97 <input type="hidden" name="core" value="<?php echo (int) isset($_GET['core']); ?>" />
98 <input type="hidden" name="standard" value="<?php echo (int) isset($_GET['standard']); ?>" />
99 <input type="hidden" name="extra" value="<?php echo (int) isset($_GET['extra']); ?>" />
100 <input type="hidden" name="missing" value="<?php echo (int) isset($_GET['missing']); ?>" />
102 <div class="input-form">
104 <h3><?php echo $module->getName(); ?></h3>
108 <?php echo _AT('description'); ?><br />
109 <?php echo nl2br($module->getDescription($_SESSION['lang'])); ?>
113 <?php echo _AT('maintainers'); ?><br />
114 <ul class="horizontal">
115 <?php foreach ($properties['maintainers'] as $maintainer): ?>
116 <li><?php echo $maintainer['name'] .' <'.$maintainer['email'].'>'; ?></li>
122 <?php echo _AT('url'); ?><br />
123 <?php echo $properties['url']; ?>
127 <?php echo _AT('version'); ?><br />
128 <?php echo $properties['version']; ?>
132 <?php echo _AT('date'); ?><br />
133 <?php echo $properties['date']; ?>
137 <?php echo _AT('license'); ?><br />
138 <?php echo $properties['license']; ?>
142 <?php echo _AT('state'); ?><br />
143 <?php echo $properties['state']; ?>
147 <?php echo _AT('notes'); ?><br />
148 <?php echo nl2br($properties['notes']); ?>
151 <?php if (is_array($module->_pages)): ?>
153 <?php if (!isset($_GET['files'])): ?>
154 <a href="<?php echo htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES).SEP; ?>files#files"><?php echo _AT('files'); ?></a><br />
156 <?php $module_pages = array_keys($module->_pages); ?>
157 <?php natsort($module_pages); ?>
158 <a name="files"></a><?php echo _AT('files'); ?><br />
159 <ul style="margin-top: 0px;">
160 <?php foreach ($module_pages as $key): ?>
161 <?php if (defined($key)) : continue; endif; ?>
162 <li><kbd><?php echo $key; ?></kbd></li>
169 <?php if (!isset($_REQUEST['new'])): ?>
170 <div class="row buttons">
171 <input type="submit" name="submit" value="<?php echo _AT('back'); ?>" />
176 <?php if (isset($_REQUEST['new'])): ?>
178 $hidden_vars['mod'] = $_REQUEST['mod'];
179 $hidden_vars['new'] = '1';
180 $msg->addConfirm(array('ADD_MODULE', $_REQUEST['mod']), $hidden_vars);
181 $msg->printConfirm();
185 <?php require(AT_INCLUDE_PATH.'footer.inc.php'); ?>