3 * Copyright (c) STMicroelectronics, 2007. All Rights Reserved.
5 * Originally written by Mohamed CHAARI, 2007
7 * This file is a part of codendi.
9 * codendi is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * codendi is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 header("content-type: application/x-javascript");
27 require_once 'env.inc.php';
28 require_once 'pre.php';
31 function addHeader(cc,file,header_type)
33 var ni = document.getElementById('mail_header');
34 var numi = document.getElementById('header_val');
35 var num = (document.getElementById('header_val').value -1)+ 2;
37 var divIdName = "mail_header_"+num+"_div";
38 var newdiv = document.createElement('div');
40 newdiv.setAttribute("id",divIdName);
41 if (header_type == 1) {
42 newdiv.innerHTML += "<table><tr><td width='65' align='right'><b><i><?php echo _('CC :') ?> </i></b></td><td align=center width=350><input name='ccs["
44 +"]' type='text' value='"
46 +"'size=41></td><td align=center><a href=\"javascript:;\" onclick=\"removeHeader(\'"
48 +"\')\"><img border='0' src=\"<?php echo getImage("ic/trash.png"); ?>\"></a></td></tr></table>";
50 newdiv.innerHTML += "<table><tr><td width='65' align='right'><b><i><?php echo _('Attach :') ?> </i></b></td><td align=center width=350><input name='files["
52 +"]'' type='file' value='"
54 +"'size=30></td><td align=center><a href=\"javascript:;\" onclick=\"removeHeader(\'"
56 +"\')\"><img border='0' src=\"<?php echo getImage("ic/trash.png"); ?>\"></a></td></tr></table>";
58 ni.appendChild(newdiv);
61 function removeHeader(divNum)
63 var d = document.getElementById('mail_header');
64 var olddiv = document.getElementById(divNum);
65 d.removeChild(olddiv);
69 // Waiting for a better script, this comment just to make test
70 // BlankAfterClosingPhpTag happy...