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);
20 if (isset($_POST['submit'])) {
21 require('./module.template.php');
23 $maintainers_xml = '';
24 if (isset($_POST['name_1'], $_POST['email_1']) && $_POST['name_1'] && $_POST['email_1']) {
25 $maintainers_xml .= str_replace(array('{NAME}', '{EMAIL}'), array($stripslashes($_POST['name_1']), $stripslashes($_POST['email_1'])), $maintainer_xml);
28 if (isset($_POST['name_2'], $_POST['email_2']) && $_POST['name_2'] && $_POST['email_2']) {
29 $maintainers_xml .= str_replace(array('{NAME}', '{EMAIL}'), array($stripslashes($_POST['name_2']), $stripslashes($_POST['email_2'])), $maintainer_xml);
31 $maintainers_xml .= "\n";
32 $tokens = array('{NAME}', '{DESCRIPTION}', '{MAINTAINERS}', '{URL}', '{VERSION}', '{USER_PRIVILEGE}', '{DATE}', '{LICENSE}', '{STATE}', '{NOTES}');
33 $replace = array($stripslashes($_POST['name']),
34 $stripslashes($_POST['description']),
36 $stripslashes($_POST['url']),
37 $stripslashes($_POST['version']),
38 $stripslashes($_POST['priv']),
39 $stripslashes($_POST['date']),
40 $stripslashes($_POST['license']),
41 $stripslashes($_POST['state']),
42 $stripslashes($_POST['notes']));
44 $module_xml = str_replace($tokens, $replace, $module_xml);
47 require(AT_INCLUDE_PATH.'header.inc.php');
49 if (isset($module_xml)) : ?>
50 <form method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
51 <div class="input-form">
52 <div class="input-form">
53 <div class="row"><pre><?php highlight_string($module_xml); ?></pre></div>
56 <div class="row buttons">
57 <input type="submit" name="submit" value="<?php echo _AT('back'); ?>" />
63 [[ this form is used to generate the module.xml file which must be packaged with each module ]]
65 <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
66 <div class="input-form">
67 <h3><?php echo _AT('module_details'); ?></h3>
70 <span class="required" title="<?php echo _AT('required_field'); ?>">*</span><label for="name"><?php echo _AT('module_name'); ?></label><br />
71 <input type="text" name="name" id="name" size="40" value="" />
75 <label for="desc"><?php echo _AT('description'); ?></label><br />
76 <textarea name="description" id="desc" cols="10" rows="2"></textarea>
80 <?php echo _AT('maintainers'); ?>
81 <ol style="margin-top: 0px; margin-bottom: 0px;">
82 <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="" />
83 <label for="email_1"><?php echo _AT('email'); ?></label> <input type="text" name="email_1" id="email_1" size="35" value="" /></li>
85 <li><label for="name_2"><?php echo _AT('name'); ?></label> <input type="text" name="name_2" id="name_2" size="25" value="" />
86 <label for="email_2"><?php echo _AT('email'); ?></label> <input type="text" name="email_2" id="email_2" size="35" value="" /></li>
91 <label for="url"><?php echo _AT('url'); ?></label><br />
92 <input type="text" name="url" id="url" size="50" value="http://" />
96 <label for="license"><?php echo _AT('license'); ?></label><br />
97 <input type="text" name="license" id="license" size="65" value="GPL" />
101 <h3><?php echo _AT('release_details'); ?></h3>
104 <label for="version"><?php echo _AT('version'); ?></label><br />
105 <input type="text" name="version" id="version" size="5" value="" />
109 <?php echo _AT('use_custom_privilege'); ?><br />
110 <input type="radio" name="priv" value="false" id="priv_1" checked="checked" /><label for="priv_1"><?php echo _AT('no'); ?></label>,
111 <input type="radio" name="priv" value="true" id="priv_2" /><label for="priv_2"><?php echo _AT('yes'); ?></label>
115 <label for="date"><?php echo _AT('date'); ?></label><br />
116 <input type="text" name="date" id="date" value="" />
120 <?php echo _AT('state'); ?><br />
121 <input type="radio" name="state" value="stable" id="state_1" checked="checked" /><label for="state_1"><?php echo _AT('stable'); ?></label>,
122 <input type="radio" name="state" value="beta" id="state_2" /><label for="state_2"><?php echo _AT('beta'); ?></label>,
123 <input type="radio" name="state" value="experimental" id="state_3" /><label for="state_3"><?php echo _AT('experimental'); ?></label>
127 <label for="notes"><?php echo _AT('notes'); ?></label><br />
128 <textarea name="notes" id="notes" cols="10" rows="2"></textarea>
131 <div class="row buttons">
132 <input type="submit" name="submit" value="<?php echo _AT('submit'); ?>" />
137 <?php require(AT_INCLUDE_PATH.'footer.inc.php'); ?>