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'));
92 <?php if (isset($_REQUEST['new'])): ?>
94 $hidden_vars['mod'] = $_REQUEST['mod'];
95 $hidden_vars['new'] = '1';
96 $msg->addConfirm(array('ADD_MODULE', $_REQUEST['mod']), $hidden_vars);
103 $savant->assign('module', $module);
104 $savant->assign('properties', $properties);
105 $savant->display('admin/modules/details.tmpl.php');
106 require(AT_INCLUDE_PATH.'footer.inc.php'); ?>