2 /************************************************************************/
4 /************************************************************************/
5 /* Copyright (c) 2002-2006 by Greg Gay, Joel Kronenberg & Heidi Hazelton*/
6 /* Adaptive Technology Resource Centre / University of Toronto */
9 /* This program is free software. You can redistribute it and/or */
10 /* modify it under the terms of the GNU General Public License */
11 /* as published by the Free Software Foundation. */
12 /************************************************************************/
15 define('AT_INCLUDE_PATH', '../../include/');
16 require(AT_INCLUDE_PATH.'vitals.inc.php');
17 admin_authenticate(AT_ADMIN_PRIV_ADMIN);
21 if (isset($_POST['submit'])) {
22 require('./module.template.php');
24 $maintainers_xml = '';
25 if (isset($_POST['name_1'], $_POST['email_1']) && $_POST['name_1'] && $_POST['email_1']) {
26 $maintainers_xml .= str_replace(array('{NAME}', '{EMAIL}'), array($stripslashes($_POST['name_1']), $stripslashes($_POST['email_1'])), $maintainer_xml);
29 if (isset($_POST['name_2'], $_POST['email_2']) && $_POST['name_2'] && $_POST['email_2']) {
30 $maintainers_xml .= str_replace(array('{NAME}', '{EMAIL}'), array($stripslashes($_POST['name_2']), $stripslashes($_POST['email_2'])), $maintainer_xml);
32 $maintainers_xml .= "\n";
33 $tokens = array('{NAME}', '{DESCRIPTION}', '{MAINTAINERS}', '{URL}', '{VERSION}', '{USER_PRIVILEGE}', '{DATE}', '{LICENSE}', '{STATE}', '{NOTES}');
34 $replace = array($stripslashes($_POST['name']),
35 $stripslashes($_POST['description']),
37 $stripslashes($_POST['url']),
38 $stripslashes($_POST['version']),
39 $stripslashes($_POST['priv']),
40 $stripslashes($_POST['date']),
41 $stripslashes($_POST['license']),
42 $stripslashes($_POST['state']),
43 $stripslashes($_POST['notes']));
45 $module_xml = str_replace($tokens, $replace, $module_xml);
48 require(AT_INCLUDE_PATH.'header.inc.php');
50 if (isset($module_xml)) : ?>
51 <form method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
52 <div class="input-form">
53 <div class="input-form">
54 <div class="row"><pre><?php highlight_string($module_xml); ?></pre></div>
57 <div class="row buttons">
58 <input type="submit" name="submit" value="<?php echo _AT('back'); ?>" />
64 [[ this form is used to generate the module.xml file which must be packaged with each module ]]
66 <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
67 <div class="input-form">
68 <h3><?php echo _AT('module_details'); ?></h3>
71 <div class="required" title="<?php echo _AT('required_field'); ?>">*</div><label for="name"><?php echo _AT('module_name'); ?></label><br />
72 <input type="text" name="name" id="name" size="40" value="" />
76 <label for="desc"><?php echo _AT('description'); ?></label><br />
77 <textarea name="description" id="desc" cols="10" rows="2"></textarea>
81 <?php echo _AT('maintainers'); ?>
82 <ol style="margin-top: 0px; margin-bottom: 0px;">
83 <li style="margin-bottom: 5px;"><label for="name_1"><?php echo _AT('name'); ?></label> <input type="text" name="name_1" id="name_1" size="25" value="" />
84 <label for="email_1"><?php echo _AT('email'); ?></label> <input type="text" name="email_1" id="email_1" size="35" value="" /></li>
86 <li><label for="name_2"><?php echo _AT('name'); ?></label> <input type="text" name="name_2" id="name_2" size="25" value="" />
87 <label for="email_2"><?php echo _AT('email'); ?></label> <input type="text" name="email_2" id="email_2" size="35" value="" /></li>
92 <label for="url"><?php echo _AT('url'); ?></label><br />
93 <input type="text" name="url" id="url" size="50" value="http://" />
97 <label for="license"><?php echo _AT('license'); ?></label><br />
98 <input type="text" name="license" id="license" size="65" value="GPL" />
102 <h3><?php echo _AT('release_details'); ?></h3>
105 <label for="version"><?php echo _AT('version'); ?></label><br />
106 <input type="text" name="version" id="version" size="5" value="" />
110 <?php echo _AT('use_custom_privilege'); ?><br />
111 <input type="radio" name="priv" value="false" id="priv_1" checked="checked" /><label for="priv_1"><?php echo _AT('no'); ?></label>,
112 <input type="radio" name="priv" value="true" id="priv_2" /><label for="priv_2"><?php echo _AT('yes'); ?></label>
116 <label for="date"><?php echo _AT('date'); ?></label><br />
117 <input type="text" name="date" id="date" value="" />
121 <?php echo _AT('state'); ?><br />
122 <input type="radio" name="state" value="stable" id="state_1" checked="checked" /><label for="state_1"><?php echo _AT('stable'); ?></label>,
123 <input type="radio" name="state" value="beta" id="state_2" /><label for="state_2"><?php echo _AT('beta'); ?></label>,
124 <input type="radio" name="state" value="experimental" id="state_3" /><label for="state_3"><?php echo _AT('experimental'); ?></label>
128 <label for="notes"><?php echo _AT('notes'); ?></label><br />
129 <textarea name="notes" id="notes" cols="10" rows="2"></textarea>
132 <div class="row buttons">
133 <input type="submit" name="submit" value="<?php echo _AT('submit'); ?>" />
138 <?php require(AT_INCLUDE_PATH.'footer.inc.php'); ?>