3 * FusionForge Documentation Manager
5 * Copyright 2000, Quentin Cregan/Sourceforge
6 * Copyright 2002-2003, Tim Perdue/GForge, LLC
7 * Copyright 2010, Franck Villaume - Capgemini
9 * This file is part of FusionForge.
11 * FusionForge is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * FusionForge is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with FusionForge; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 /* please do not add require here : use www/docman/index.php to add require */
27 /* global variables used */
28 global $g; // group object
29 global $group_id; // id of the group
30 global $dirid; //id of the doc_group
31 global $dgh; // document group html object
32 global $gdf; // document grou factory object
34 if ( $dgf->getNested() == NULL ) {
35 echo '<div class="docmanDivIncluded">';
36 echo '<div class="warning">'. _('You MUST first create at least one directory to store your document.') .'</p></div>';
38 /* display the add new documentation form */
40 <script type="text/javascript" >
41 function displayRowFile() {
42 document.getElementById('filerow').style.display = '';
43 document.getElementById('urlrow').style.display = 'none';
44 document.getElementById('editrow').style.display = 'none';
45 document.getElementById('editnamerow').style.display = 'none';
47 function displayRowUrl() {
48 document.getElementById('filerow').style.display = 'none';
49 document.getElementById('urlrow').style.display = '';
50 document.getElementById('editrow').style.display = 'none';
51 document.getElementById('editnamerow').style.display = 'none';
53 function displayRowEditor() {
54 document.getElementById('filerow').style.display = 'none';
55 document.getElementById('urlrow').style.display = 'none';
56 document.getElementById('editrow').style.display = '';
57 document.getElementById('editnamerow').style.display = '';
61 echo '<div class="docmanDivIncluded">';
62 echo '<p><strong>'. _('Document Title:') .'</strong> '. _('Refers to the relatively brief title of the document (e.g. How to use the download server).'). '</p>';
63 echo '<p><strong>'. _('Description:') .'</strong> '. _('A brief description to be placed just under the title.') .'</p>';
65 if ($g->useDocmanSearch())
66 echo '<p>'. _('Both fields are used by document search engine.'). '</p>';
68 echo '<form name="adddata" action="?group_id='.$group_id.'&action=addfile" method="post" enctype="multipart/form-data">
71 <td style="text-align:right;">
72 <strong>'. _('Document Title').'</strong>'.utils_requiredField()
74 .' <input type="text" name="title" size="40" maxlength="255" /> '
75 .sprintf(_('(at least %1$s characters)'), 5)
79 <td style="text-align:right;">
80 <strong>'. _('Description') .'</strong>'.utils_requiredField()
82 .' <input type="text" name="description" size="50" maxlength="255" /> '
83 .sprintf(_('(at least %1$s characters)'), 10)
87 <td style="text-align:right;">
88 <strong>'. _('Type of Document') .'</strong>'.utils_requiredField()
90 <input type="radio" name="type" value="httpupload" onClick="javascript:displayRowFile()" />'. _('File') .'<input type="radio" name="type" value="pasteurl" onClick="javascript:displayRowUrl()" />'. _('URL');
91 if ($g->useCreateOnline()) {
92 echo '<input type="radio" name="type" value="editor" onClick="javascript:displayRowEditor()" />'. _('Create online');
96 <tr id="filerow" style="display:none">
97 <td style="text-align:right;">
98 <strong>'. _('Upload File') .'</strong>'. utils_requiredField()
100 .' <input type="file" name="uploaded_data" size="30" />
103 <tr id="urlrow" style="display:none">
104 <td style="text-align:right;">
105 <strong>'. _('URL') .'</strong>'. utils_requiredField()
107 .' <input type="text" name="file_url" size="30" />
110 <tr id="editnamerow" style="display:none">
111 <td style="text-align:right;">
112 <strong>'. _('File Name') .'</strong>'. utils_requiredField()
114 .' <input type="text" name="name" size="30" />
117 <tr id="editrow" style="display:none">
119 $GLOBALS['editor_was_set_up']=false;
121 /* name must be details !!! if name = data then nothing is displayed */
122 $params['name'] = 'details';
123 $params['width'] = "800";
124 $params['height'] = "300";
125 $params['body'] = "";
126 $params['group'] = $group_id;
127 plugin_hook("text_editor",$params);
128 if (!$GLOBALS['editor_was_set_up']) {
129 echo '<textarea name="details" rows="5" cols="80"></textarea>';
131 unset($GLOBALS['editor_was_set_up']);
136 echo '<input type="hidden" name="doc_group" value="'.$dirid.'">';
141 <strong>'. _('Directory that document belongs in').'</strong>
143 $dgh->showSelectNestedGroups($dgf->getNested(), 'doc_group', false, $dirid);
149 echo utils_requiredField() . ' '. _('Mandatory field');
150 echo ' <div class="docmanSubmitDiv">
151 <input type="submit" name="submit" value="'. _('Submit Information').' " />