-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathform_mailing.php
executable file
·160 lines (152 loc) · 4.56 KB
/
form_mailing.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<?php
/*
* Factux le facturier libre
* Copyright (C) 2003-2005 Guy Hendrickx, 2017 Thomas Ingles
*
* Licensed under the terms of the GNU General Public License:
* http://opensource.org/licenses/GPL-3.0
*
* For further information visit:
* http://factux.free.fr
*
* File Name: mailing.php
* formulaire de la mailing list
*
* * * Version: 5.0.0
* * * * Modified: 07/10/2016
*
* File Authors:
* Guy Hendrickx
*.
*/
include_once("include/headers.php");
#include_once("include/finhead.php");
?>
<script type="text/javascript">
_editor_url = "include/htmlarea";
_editor_lang = "<?php echo $lang ?>";
</script>
<script type="text/javascript" src="include/htmlarea/htmlarea.js"></script>
<script type="text/javascript">
var editor = null;
function initEditor() {
editor = new HTMLArea("ta");
editor.generate();
return false;
var cfg = editor.config; // this is the default configuration
cfg.registerButton({
id : "my-hilite",
tooltip : "Highlight text",
image : "ed_custom.gif",
textMode : false,
action : function(editor) {
editor.surroundHTML("<span class=\"hilite\">", "</span>");
},
context : 'table'
});
cfg.toolbar.push(["linebreak", "my-hilite"]); // add the new button to the toolbar
// BEGIN: code that adds a custom button
// uncomment it to test
var cfg = editor.config;
function clickHandler(editor, buttonId) {
switch (buttonId) {
case "my-toc":
editor.insertHTML("<h1>Table Of Contents</h1>");
break;
case "my-date":
editor.insertHTML((new Date()).toString());
break;
case "my-bold":
editor.execCommand("bold");
editor.execCommand("italic");
break;
case "my-hilite":
editor.surroundHTML("<span class=\"hilite\">", "</span>");
break;
}
};
cfg.registerButton("my-toc", "Insert TOC", "ed_custom.gif", false, clickHandler);
cfg.registerButton("my-date", "Insert date/time", "ed_custom.gif", false, clickHandler);
cfg.registerButton("my-bold", "Toggle bold/italic", "ed_custom.gif", false, clickHandler);
cfg.registerButton("my-hilite", "Hilite selection", "ed_custom.gif", false, clickHandler);
cfg.registerButton("my-sample", "Class: sample", "ed_custom.gif", false,
function(editor) {
if (HTMLArea.is_ie) {
editor.insertHTML("<span class=\"sample\"> </span>");
var r = editor._doc.selection.createRange();
r.move("character", -2);
r.moveEnd("character", 2);
r.select();
} else { // Gecko/W3C compliant
var n = editor._doc.createElement("span");
n.className = "sample";
editor.insertNodeAtSelection(n);
var sel = editor._iframe.contentWindow.getSelection();
sel.removeAllRanges();
var r = editor._doc.createRange();
r.setStart(n, 0);
r.setEnd(n, 0);
sel.addRange(r);
}
}
);
cfg.pageStyle = "body { background-color: #efd; } .hilite { background-color: yellow; } "+
".sample { color: green; font-family: monospace; }";
cfg.toolbar.push(["linebreak", "my-toc", "my-date", "my-bold", "my-hilite", "my-sample"]); // add the new button to the toolbar
editor.generate();
}
function insertHTML() {
var html = prompt("Enter some HTML code here");
if (html) {
editor.insertHTML(html);
}
}
function highlight() {
editor.surroundHTML('<span style="background-color: yellow">', '</span>');
}
</script>
</head>
<body onload="initEditor()">
<table width="760" border="0" class="page" align="center">
<tr>
<td class="page" align="center">
<?php
include_once("include/head.php");
if (isset($message)&&$message!='') {
echo $message; $message='';
}
if ($user_admin != 'y') {
echo "<h1>$lang_admin_droit";
include_once("include/bas.php");
exit;
}
?>
<form action="mailing.php" method="post" id="edit" name="edit">
<table class="page boiteaction">
<tr>
<caption><?php echo $lang_mailing_list; ?></caption>
</tr>
<tr>
<td class="texte0"><?php echo $lang_mailing_list_titremessage; ?></td>
<td class="texte0"><input type="text" name="titre"></tr>
<tr>
<td class="texte0"><?php echo "$lang_mailing_list_message"; ?></td>
<td class="texte0">
<textarea id="ta" name="message" style="width:100%" rows="20" cols="80"></textarea>
</td>
</tr>
<tr>
<td class= "submit" colspan="2"><input type="submit" value="<?php echo $lang_envoyer; ?>">
<input type="reset" Value= "<?php echo $lang_annuler; ?>"></td>
</tr>
</table>
</form>
<?php
$aide = 'mailing';
include("help.php");
include_once("include/bas.php");
?>
</td></tr>
</table>
</body>
</html>