Newsletter - Version 2.5.0

Version Description

Download this release

Release Info

Developer satollo
Plugin Icon 128x128 Newsletter
Version 2.5.0
Comparing to
See all releases

Code changes from version 1.5.9 to 2.5.0

Files changed (99) hide show
  1. commons.php +425 -92
  2. convert.php +0 -39
  3. editor.css +4 -0
  4. emails-edit.php +223 -0
  5. emails.php +42 -11
  6. export.php +0 -20
  7. forms.php +0 -15
  8. header.php +1 -8
  9. help.png +0 -0
  10. import.php +183 -61
  11. intro.php +427 -0
  12. languages/de_DE.php +58 -56
  13. languages/de_DE_options.php +0 -56
  14. languages/en_US.php +116 -64
  15. languages/en_US_options.php +0 -75
  16. languages/es_ES.php +66 -0
  17. languages/fr_FR.php +50 -33
  18. languages/fr_FR_options.php +0 -46
  19. languages/it_IT.php +69 -55
  20. languages/it_IT_options.php +0 -45
  21. languages/newsletter-1.5.2.pot +0 -419
  22. languages/newsletter-ru_RU.mo +0 -0
  23. languages/newsletter-ru_RU.po +0 -784
  24. languages/nl_NL.php +42 -51
  25. languages/nl_NL_options.php +0 -64
  26. languages/pl_PL.php +56 -57
  27. languages/pl_PL_options.php +0 -53
  28. languages/pt_BR.php +53 -55
  29. languages/pt_BR_options.php +0 -53
  30. languages/ru_RU.php +38 -52
  31. languages/ru_RU_options.php +0 -66
  32. log.txt +1 -0
  33. main.php +377 -27
  34. manage.php +0 -208
  35. newsletter.php +0 -474
  36. options.php +400 -292
  37. plugin-activate.inc.php +151 -0
  38. plugin-export.inc.php +83 -0
  39. plugin-head.inc.php +18 -0
  40. plugin-menu.inc.php +19 -0
  41. plugin.php +711 -1054
  42. profile.php +196 -0
  43. readme.txt +19 -10
  44. smtp.php +0 -15
  45. statistics.php +0 -15
  46. style.css +127 -47
  47. themes-page/page-1/theme.php +27 -0
  48. themes/blank/theme.php +0 -1
  49. themes/default/it_IT.php +0 -5
  50. themes/default/style.css +0 -5
  51. themes/default/theme.php +0 -30
  52. themes/feed-by-mail/style.css +0 -5
  53. themes/feed-by-mail/theme.php +0 -24
  54. themes/messages/theme.php +0 -9
  55. themes/theme-1/theme.php +53 -0
  56. themes/theme-2/theme-2.php +120 -0
  57. themes/theme-3/theme-3.php +81 -0
  58. themes/with-picture/empty.gif +0 -0
  59. themes/with-picture/it_IT.php +0 -5
  60. themes/with-picture/theme.php +0 -39
  61. tiny_mce/plugins/fullscreen/fullscreen.htm +0 -1
  62. tiny_mce/plugins/table/cell.htm +2 -7
  63. tiny_mce/plugins/table/editor_plugin.js +1 -1
  64. tiny_mce/plugins/table/editor_plugin_src.js +1118 -0
  65. tiny_mce/plugins/table/js/cell.js +40 -23
  66. tiny_mce/plugins/table/js/merge_cells.js +18 -20
  67. tiny_mce/plugins/table/js/row.js +47 -22
  68. tiny_mce/plugins/table/js/table.js +22 -13
  69. tiny_mce/plugins/table/merge_cells.htm +3 -8
  70. tiny_mce/plugins/table/row.htm +2 -7
  71. tiny_mce/plugins/table/table.htm +4 -9
  72. tiny_mce/themes/advanced/about.htm +1 -3
  73. tiny_mce/themes/advanced/anchor.htm +2 -7
  74. tiny_mce/themes/advanced/color_picker.htm +1 -3
  75. tiny_mce/themes/advanced/editor_template.js +1 -1
  76. tiny_mce/themes/advanced/editor_template_src.js +0 -5
  77. tiny_mce/themes/advanced/image.htm +2 -7
  78. tiny_mce/themes/advanced/js/anchor.js +7 -7
  79. tiny_mce/themes/advanced/link.htm +2 -7
  80. tiny_mce/themes/advanced/skins/default/content.css +3 -4
  81. tiny_mce/themes/advanced/skins/default/dialog.css +4 -3
  82. tiny_mce/themes/advanced/skins/default/ui.css +1 -2
  83. tiny_mce/themes/advanced/skins/o2k7/content.css +3 -3
  84. tiny_mce/themes/advanced/skins/o2k7/dialog.css +3 -2
  85. tiny_mce/themes/advanced/source_editor.htm +2 -7
  86. tiny_mce/themes/simple/editor_template.js +1 -0
  87. tiny_mce/themes/simple/editor_template_src.js +85 -0
  88. tiny_mce/themes/simple/img/icons.gif +0 -0
  89. tiny_mce/themes/simple/langs/en.js +11 -0
  90. tiny_mce/themes/simple/skins/default/content.css +25 -0
  91. tiny_mce/themes/simple/skins/default/ui.css +32 -0
  92. tiny_mce/themes/simple/skins/o2k7/content.css +17 -0
  93. tiny_mce/themes/simple/skins/o2k7/img/button_bg.png +0 -0
  94. tiny_mce/themes/simple/skins/o2k7/ui.css +35 -0
  95. tiny_mce/tiny_mce.js +1 -1
  96. tiny_mce/tiny_mce_popup.js +1 -1
  97. users-edit.php +100 -0
  98. users.php +251 -0
  99. widget.php +87 -81
commons.php CHANGED
@@ -1,92 +1,425 @@
1
- <?php
2
-
3
- if (!isset($newsletter_options_main['no_translation'])) {
4
- $plugin_dir = basename(dirname(__FILE__));
5
- load_plugin_textdomain('newsletter', 'wp-content/plugins/' . $plugin_dir . '/languages/');
6
- }
7
-
8
- $action = $_REQUEST['act'];
9
- if (isset($action) && !check_admin_referer()) die('Invalid call');
10
-
11
- /**
12
- * Utility class to generate HTML form fields.
13
- */
14
- class NewsletterControls {
15
-
16
- var $data;
17
- var $action = false;
18
-
19
- function NewsletterControls($options=null) {
20
- $this->data = $options;
21
- }
22
-
23
- function yesno($name) {
24
- $value = isset($this->data[$name])?(int)$this->data[$name]:0;
25
-
26
- echo '<select style="width: 60px" name="options[' . $name . ']">';
27
- echo '<option value="0"';
28
- if ($value == 0) echo ' selected';
29
- echo '>No</option>';
30
- echo '<option value="1"';
31
- if ($value == 1) echo ' selected';
32
- echo '>Yes</option>';
33
- echo '</select>';
34
- }
35
-
36
- function select($name, $options) {
37
- $value = $this->data[$name];
38
-
39
- echo '<select name="options[' . $name . ']">';
40
- foreach($options as $key=>$label) {
41
- echo '<option value="' . $key . '"';
42
- if ($value == $key) echo ' selected';
43
- echo '>' . htmlspecialchars($label) . '</option>';
44
- }
45
- echo '</select>';
46
- }
47
-
48
- function text($name, $size) {
49
- echo '<input name="options[' . $name . ']" type="text" size="' . $size . '" value="';
50
- echo htmlspecialchars($this->data[$name]);
51
- echo '"/>';
52
- }
53
-
54
- function button($action, $label, $function=null) {
55
- if (!$this->action) echo '<input name="act" type="hidden" value=""/>';
56
- $this->action = true;
57
- if ($function != null) {
58
- echo '<input type="button" value="' . $label . '" onclick="this.form.act.value=\'' . $action . '\';' . $function . '"/>';
59
- }
60
- else {
61
- echo '<input type="button" value="' . $label . '" onclick="this.form.act.value=\'' . $action . '\';this.form.submit()"/>';
62
- }
63
- }
64
-
65
- function editor($name, $rows=5, $cols=75) {
66
- echo '<textarea class="visual" name="options[' . $name . ']" wrap="off" rows="' . $rows . '" cols="' . $cols . '">';
67
- echo htmlspecialchars($this->data[$name]);
68
- echo '</textarea>';
69
- }
70
-
71
- function textarea($name, $rows=5, $cols=75) {
72
- echo '<textarea name="options[' . $name . ']" wrap="off" rows="' . $rows . '" cols="' . $cols . '">';
73
- echo htmlspecialchars($this->data[$name]);
74
- echo '</textarea>';
75
- }
76
-
77
- function email($prefix) {
78
- echo 'Subject:<br />';
79
- $this->text($prefix . '_subject', 70);
80
- echo '<br />Message:<br />';
81
- $this->editor($prefix . '_message');
82
- }
83
-
84
- function checkbox($name, $label='') {
85
- echo '<input type="checkbox" id="' . $name . '" name="options[' . $name . ']" value="1"';
86
- if (isset($this->data[$name])) echo ' checked="checked"';
87
- echo '/>';
88
- if ($label != '') echo ' <label for="' . $name . '">' . $label . '</label>';
89
- }
90
- }
91
-
92
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ error_reporting(E_ALL ^ E_NOTICE);
4
+
5
+ $newsletter->set_limits();
6
+
7
+ if (!isset($newsletter_options_main['no_translation'])) {
8
+ $plugin_dir = basename(dirname(__FILE__));
9
+ load_plugin_textdomain('newsletter', 'wp-content/plugins/' . $plugin_dir . '/languages/');
10
+ }
11
+
12
+ $action = $_REQUEST['act'];
13
+ $step = null;
14
+ if (isset($action) && !check_admin_referer()) die('Invalid call');
15
+ $errors = null;
16
+ $messages = null;
17
+
18
+ /**
19
+ * Utility class to generate HTML form fields.
20
+ */
21
+ class NewsletterControls {
22
+
23
+ var $data;
24
+ var $action = false;
25
+
26
+ function is_action($action = null) {
27
+ if ($action == null) return !empty($_REQUEST['act']);
28
+ if (empty($_REQUEST['act'])) return false;
29
+ if ($_REQUEST['act'] != $action) return false;
30
+ if (check_admin_referer ()) return true;
31
+ die('Invalid call');
32
+ }
33
+
34
+ function errors($errors) {
35
+ if (is_null($errors)) return;
36
+ echo '<script type="text/javascript">';
37
+ echo 'alert("' . addslashes($errors) . '");';
38
+ echo '</script>';
39
+ }
40
+
41
+ function messages($messages) {
42
+ if (is_null($messages)) return;
43
+ echo '<script type="text/javascript">';
44
+ echo 'alert("' . addslashes($messages) . '");';
45
+ echo '</script>';
46
+ }
47
+
48
+ function NewsletterControls($options=null) {
49
+ if ($options == null) $this->data = stripslashes_deep($_POST['options']);
50
+ else $this->data = $options;
51
+ }
52
+
53
+ function yesno($name) {
54
+ $value = isset($this->data[$name]) ? (int) $this->data[$name] : 0;
55
+
56
+ echo '<select style="width: 60px" name="options[' . $name . ']">';
57
+ echo '<option value="0"';
58
+ if ($value == 0) echo ' selected';
59
+ echo '>No</option>';
60
+ echo '<option value="1"';
61
+ if ($value == 1) echo ' selected';
62
+ echo '>Yes</option>';
63
+ echo '</select>&nbsp;&nbsp;&nbsp;';
64
+ }
65
+
66
+ function enabled($name) {
67
+ $value = isset($this->data[$name]) ? (int) $this->data[$name] : 0;
68
+
69
+ echo '<select style="width: 100px" name="options[' . $name . ']">';
70
+ echo '<option value="0"';
71
+ if ($value == 0) echo ' selected';
72
+ echo '>Disabled</option>';
73
+ echo '<option value="1"';
74
+ if ($value == 1) echo ' selected';
75
+ echo '>Enabled</option>';
76
+ echo '</select>';
77
+ }
78
+
79
+ function select($name, $options, $first = null) {
80
+ $value = $this->data[$name];
81
+
82
+ echo '<select id="options-' . $name . '" name="options[' . $name . ']">';
83
+ if (!empty($first)) {
84
+ echo '<option value="">' . htmlspecialchars($first) . '</option>';
85
+ }
86
+ foreach ($options as $key => $label) {
87
+ echo '<option value="' . $key . '"';
88
+ if ($value == $key) echo ' selected';
89
+ echo '>' . htmlspecialchars($label) . '</option>';
90
+ }
91
+ echo '</select>';
92
+ }
93
+
94
+ function select_grouped($name, $groups) {
95
+ $value = $this->data[$name];
96
+
97
+ echo '<select name="options[' . $name . ']">';
98
+
99
+ foreach ($groups as $group) {
100
+ echo '<optgroup label="' . htmlspecialchars($group['']) . '">';
101
+ foreach ($group as $key => $label) {
102
+ if ($key == '') continue;
103
+ echo '<option value="' . $key . '"';
104
+ if ($value == $key) echo ' selected';
105
+ echo '>' . htmlspecialchars($label) . '</option>';
106
+ }
107
+ echo '</optgroup>';
108
+ }
109
+ echo '</select>';
110
+ }
111
+
112
+ function page_themes($name) {
113
+ $themes[''] = 'Standard page themes';
114
+ $themes['page-1'] = 'Page theme 1';
115
+
116
+ $this->select_grouped($name, array(
117
+ array_merge(array('' => 'Custom page themes'), newsletter_page_get_themes()),
118
+ $themes
119
+ ));
120
+ }
121
+
122
+ function value($name) {
123
+ echo htmlspecialchars($this->data[$name]);
124
+ }
125
+
126
+ function value_date($name) {
127
+ $time = $this->data[$name];
128
+ echo gmdate(get_option('date_format') . ' ' . get_option('time_format'), $time + get_option('gmt_offset') * 3600);
129
+ }
130
+
131
+ function text($name, $size=20) {
132
+ echo '<input name="options[' . $name . ']" type="text" size="' . $size . '" value="';
133
+ echo htmlspecialchars($this->data[$name]);
134
+ echo '"/>';
135
+ }
136
+
137
+ function hidden($name) {
138
+ echo '<input name="options[' . $name . ']" type="hidden" value="';
139
+ echo htmlspecialchars($this->data[$name]);
140
+ echo '"/>';
141
+ }
142
+
143
+ function button($action, $label, $function=null) {
144
+ if (!$this->action) echo '<input name="act" type="hidden" value=""/>';
145
+ $this->action = true;
146
+ if ($function != null) {
147
+ echo '<input class="button-secondary" type="button" value="' . $label . '" onclick="this.form.act.value=\'' . $action . '\';' . htmlspecialchars($function) . '"/>';
148
+ }
149
+ else {
150
+ echo '<input class="button-secondary" type="button" value="' . $label . '" onclick="this.form.act.value=\'' . $action . '\';this.form.submit()"/>';
151
+ }
152
+ }
153
+
154
+ function button_confirm($action, $label, $message, $data='') {
155
+ if (!$this->action) echo '<input name="act" type="hidden" value=""/>';
156
+ $this->action = true;
157
+ echo '<input class="button-secondary" type="button" value="' . $label . '" onclick="this.form.btn.value=\'' . $data . '\';this.form.act.value=\'' . $action . '\';if (confirm(\'' .
158
+ htmlspecialchars($message) . '\')) this.form.submit()"/>';
159
+ }
160
+
161
+ function editor($name, $rows=5, $cols=75) {
162
+ echo '<textarea class="visual" name="options[' . $name . ']" style="width: 100%" wrap="off" rows="' . $rows . '" cols="' . $cols . '">';
163
+ echo htmlspecialchars($this->data[$name]);
164
+ echo '</textarea>';
165
+ }
166
+
167
+ function textarea($name, $width='100%', $height='50') {
168
+ echo '<textarea class="dymanic" name="options[' . $name . ']" wrap="off" style="width:' . $width . ';height:' . $height . '">';
169
+ echo htmlspecialchars($this->data[$name]);
170
+ echo '</textarea>';
171
+ }
172
+
173
+ function textarea_fixed($name, $width='100%', $height='50') {
174
+ echo '<textarea name="options[' . $name . ']" wrap="off" style="width:' . $width . ';height:' . $height . '">';
175
+ echo htmlspecialchars($this->data[$name]);
176
+ echo '</textarea>';
177
+ }
178
+
179
+ function email($prefix) {
180
+ echo 'Subject:<br />';
181
+ $this->text($prefix . '_subject', 70);
182
+ echo '<br />Message:<br />';
183
+ $this->editor($prefix . '_message');
184
+ }
185
+
186
+ function checkbox($name, $label='') {
187
+ echo '<input type="checkbox" id="' . $name . '" name="options[' . $name . ']" value="1"';
188
+ if (!empty($this->data[$name])) echo ' checked="checked"';
189
+ echo '/>';
190
+ if ($label != '') echo ' <label for="' . $name . '">' . $label . '</label>';
191
+ }
192
+
193
+ function hours($name) {
194
+ $hours = array();
195
+ for ($i = 0; $i < 24; $i++) {
196
+ $hours['' . $i] = '' . $i;
197
+ }
198
+ $this->select($name, $hours);
199
+ }
200
+
201
+ function days($name) {
202
+ $days = array(0 => 'Every day', 1 => 'Monday', 2 => 'Tuesday', 3 => 'Wednesday', 4 => 'Thursday', 5 => 'Friday', 6 => 'Saturday', 7 => 'Sunday');
203
+ $this->select($name, $days);
204
+ }
205
+
206
+ function init() {
207
+ echo '<script type="text/javascript">
208
+ jQuery(document).ready(function(){
209
+ jQuery("textarea.dynamic").focus(function() {
210
+ jQuery("textarea.dynamic").css("height", "50px");
211
+ jQuery(this).css("height", "400px");
212
+ });
213
+ });
214
+ </script>
215
+ ';
216
+ echo '<input name="act" type="hidden" value=""/>';
217
+ echo '<input name="btn" type="hidden" value=""/>';
218
+ $this->action = true;
219
+ wp_nonce_field();
220
+ }
221
+
222
+ function save($table, $data=null) {
223
+ global $wpdb;
224
+ if ($data == null) $data = $this->data;
225
+ $keys = array_keys($data);
226
+ foreach ($keys as $key) {
227
+ if ($key[0] == '_') unset($data[$key]);
228
+ }
229
+ $id = $data['id'];
230
+ unset($data['id']);
231
+ if (empty($id)) {
232
+ $wpdb->insert($table, $data);
233
+ $id = $wpdb->insert_id;
234
+ }
235
+ else {
236
+ $wpdb->update($table, $data, array('id' => $id));
237
+ }
238
+ $this->data = $wpdb->get_row("select * from " . $table . " where id=" . $id, ARRAY_A);
239
+ }
240
+
241
+ function load($table, $id) {
242
+ global $wpdb;
243
+ if ($id == 0) $this->data = array('id' => 0);
244
+ else $this->data = $wpdb->get_row("select * from " . $table . " where id=" . $id, ARRAY_A);
245
+ }
246
+
247
+ function update($table, $field, $value, $id=null) {
248
+ global $wpdb;
249
+ if ($id == null) $id = $this->data['id'];
250
+ $wpdb->query("update " . $table . " set " . $field . "='" . mysql_escape_string($value) . "' where id=" . $id);
251
+ $this->data[$field] = $value;
252
+ }
253
+
254
+ }
255
+
256
+ $newsletter_options_main = get_option('newsletter_main', array());
257
+
258
+ function newsletter_search($text, $status='', $order='email', $list = null, $link = null) {
259
+ global $wpdb;
260
+
261
+ if (empty($order)) $order = 'email';
262
+ if ($order == 'id') $order = 'id desc';
263
+
264
+ $query = "select * from " . $wpdb->prefix . "newsletter where 1=1";
265
+ if (!empty($status)) {
266
+ $query .= " and status='" . $wpdb->escape($status) . "'";
267
+ }
268
+
269
+ if (trim($text) != '') {
270
+ $query .= " and (email like '%" .
271
+ $wpdb->escape($text) . "%' or name like '%" . $wpdb->escape($text) . "%')";
272
+ }
273
+
274
+ if (!empty($list)) {
275
+ $query .= " and list_" . ((int)$list) . "=1";
276
+ }
277
+
278
+ if (!empty($link)) {
279
+ list($newsletter, $url) = explode('|', $link);
280
+ $query .= " and id in (select distinct newsletter_id from " . $wpdb->prefix . "newsletter_stats where newsletter='" .
281
+ $wpdb->escape($newsletter) . "' and url='" . $wpdb->escape($url) . "')";
282
+ }
283
+
284
+ $query .= ' order by ' . $order;
285
+
286
+ if (empty($link)) $query .= ' limit 100';
287
+
288
+ $recipients = $wpdb->get_results($query);
289
+
290
+ if (!$recipients) return null;
291
+ return $recipients;
292
+ }
293
+
294
+ function newsletter_get_test_subscribers() {
295
+ global $newsletter;
296
+ $subscribers = array();
297
+ for ($i = 0; $i < 5; $i++) {
298
+ if (!empty($newsletter->options_main['test_email_' . $i])) {
299
+ $subscriber = new stdClass();
300
+ $subscriber->name = $newsletter->options_main['test_name_' . $i];
301
+ $subscriber->email = $newsletter->options_main['test_email_' . $i];
302
+ $subscriber->sex = $newsletter->options_main['test_sex_' . $i];
303
+ $subscriber->token = 'notokenitsatest';
304
+ $subscriber->id = 0;
305
+ $subscriber->feed_time = 0;
306
+ $subscriber->followup_time = 0;
307
+
308
+ $subscribers[] = $subscriber;
309
+ }
310
+ }
311
+ return $subscribers;
312
+ }
313
+
314
+ function newsletter_delete_all($status=null) {
315
+ global $wpdb;
316
+
317
+ if ($status == null) {
318
+ $wpdb->query("delete from " . $wpdb->prefix . "newsletter");
319
+ }
320
+ else {
321
+ $wpdb->query("delete from " . $wpdb->prefix . "newsletter where status='" . $wpdb->escape($status) . "'");
322
+ }
323
+ }
324
+
325
+ function newsletter_set_status_all($status) {
326
+ global $wpdb;
327
+
328
+ $wpdb->query("update " . $wpdb->prefix . "newsletter set status='" . $status . "'");
329
+ }
330
+
331
+ function newsletter_date($time=null, $now=false, $left=false) {
332
+ if (is_null($time)) $time = time();
333
+ if ($time === false) $buffer = 'none';
334
+ else $buffer = gmdate(get_option('date_format') . ' ' . get_option('time_format'), $time + get_option('gmt_offset') * 3600);
335
+ if ($now) {
336
+ $buffer .= ' (now: ' . gmdate(get_option('date_format') . ' ' .
337
+ get_option('time_format'), time() + get_option('gmt_offset') * 3600);
338
+ if ($left) {
339
+ $buffer .= ', ' . gmdate('H:i:s', $time - time()) . ' left';
340
+ }
341
+ $buffer .= ')';
342
+ }
343
+ return $buffer;
344
+ }
345
+
346
+ /**
347
+ * Retrieves a list of custom themes located under wp-plugins/newsletter-custom/themes.
348
+ * Return a list of theme names (which are folder names where the theme files are stored.
349
+ */
350
+ function newsletter_get_themes() {
351
+ $handle = @opendir(ABSPATH . 'wp-content/plugins/newsletter-custom/themes');
352
+ $list = array();
353
+ if (!$handle) return $list;
354
+ while ($file = readdir($handle)) {
355
+ if ($file == '.' || $file == '..') continue;
356
+ if (!is_dir(ABSPATH . 'wp-content/plugins/newsletter-custom/themes/' . $file)) continue;
357
+ if (!is_file(ABSPATH . 'wp-content/plugins/newsletter-custom/themes/' . $file . '/theme.php')) continue;
358
+ $list['*' . $file] = $file;
359
+ }
360
+ closedir($handle);
361
+ return $list;
362
+ }
363
+
364
+ function newsletter_page_get_themes() {
365
+ $handle = @opendir(ABSPATH . 'wp-content/plugins/newsletter-custom/themes-page');
366
+ $list = array();
367
+ if (!$handle) return $list;
368
+ while ($file = readdir($handle)) {
369
+ if ($file == '.' || $file == '..') continue;
370
+ if (!is_dir(ABSPATH . 'wp-content/plugins/newsletter-custom/themes-page/' . $file)) continue;
371
+ if (!is_file(ABSPATH . 'wp-content/plugins/newsletter-custom/themes-page/' . $file . '/theme.php')) continue;
372
+ $list['*' . $file] = $file;
373
+ }
374
+ closedir($handle);
375
+ return $list;
376
+ }
377
+
378
+ /**
379
+ * $subscriber needs to be an array. If the key 'id' is set, the subscriber data will
380
+ * be update, otherwise a new subscriber will be inserted.
381
+ * When inserted as new, subscriber's data is returned with id, token and so on.
382
+ *
383
+ * @global <type> $wpdb
384
+ * @param <type> $subscriber Save a new subscriber setting status to confirmed, creating
385
+ */
386
+ function newsletter_save($subscriber) {
387
+ global $wpdb, $newsletter;
388
+
389
+ $email = $newsletter->normalize_email($email);
390
+ $name = $newsletter->normalize_name($name);
391
+ if (isset($subscriber['id'])) {
392
+ $wpdb->update($wpdb->prefix . 'newsletter', $subscriber, array('id' => $subscriber['id']));
393
+ }
394
+ else {
395
+ $subscriber['status'] = 'C';
396
+ $subscriber['token'] = md5(rand());
397
+
398
+ $wpdb->insert($wpdb->prefix . 'newsletter', $subscriber);
399
+ $subscriber['id'] = $wpdb->insert_id;
400
+ }
401
+ return $subscriber;
402
+ }
403
+
404
+ function newsletter_get_subscriber_strict($id, $token) {
405
+ if (is_null($token)) {
406
+ newsletter_fatal(__FUNCTION__, 'Ivalid token');
407
+ return null;
408
+ }
409
+ $s = newsletter_get_subscriber($id, $token);
410
+ if (is_null($s)) {
411
+ newsletter_fatal(__FUNCTION__, 'Subscriber not found or invalid token');
412
+ }
413
+ return $s;
414
+ }
415
+
416
+ function newsletter_get_subscriber($id, $token=null, $check_token=false) {
417
+ global $wpdb;
418
+
419
+ $recipients = $wpdb->get_results($wpdb->prepare("select * from " . $wpdb->prefix .
420
+ "newsletter where id=%d", $id));
421
+ if (!$recipients) return null;
422
+ if ((!is_null($token) || $check_token) && $recipients[0]->token != $token) return null;
423
+ return $recipients[0];
424
+ }
425
+ ?>
convert.php DELETED
@@ -1,39 +0,0 @@
1
- <?php
2
- @include_once 'commons.php';
3
- ?>
4
- <div class="wrap">
5
- <form method="post" action="">
6
- <h2>Conversion</h2>
7
- <p>From version 1.4.8 a new database structure has been adopted, so it's better to
8
- convert you actual data to the new format. No data will be lost or has been lost since your
9
- last update.
10
- </p>
11
-
12
- <?php
13
-
14
- if (isset($_POST['convert'])) {
15
- $query = "select id,profile from " . $wpdb->prefix . "newsletter";
16
- $recipients = $wpdb->get_results($query);
17
- foreach ($recipients as $s) {
18
- $profile = unserialize($s->profile);
19
- if ($profile) {
20
- foreach ($profile as $name=>$value) {
21
- @$wpdb->insert($wpdb->prefix . 'newsletter_profiles', array(
22
- 'newsletter_id'=>$s->id,
23
- 'name'=>$name,
24
- 'value'=>$value));
25
- }
26
- @$wpdb->query('update ' . $wpdb->prefix . 'newsletter set profile=null where id=' . $s->id);
27
- }
28
- }
29
- echo "DONE!";
30
- }
31
- ?>
32
-
33
-
34
-
35
- <p class="submit">
36
- <input class="button" type="submit" name="convert" value="Convert"/>
37
- </p>
38
- </form>
39
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
editor.css ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ body {
2
+ font-size: 12px;
3
+ }
4
+
emails-edit.php ADDED
@@ -0,0 +1,223 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ @include_once 'commons.php';
3
+ $nc = new NewsletterControls();
4
+
5
+ if (isset($_GET['id'])) {
6
+ $nc->load($wpdb->prefix . 'newsletter_emails', $_GET['id']);
7
+ if (empty($nc->data['id'])) {
8
+ $nc->data['status'] = 'new';
9
+ $nc->data['subject'] = 'Here the email subject';
10
+ $nc->data['message'] = '<p>An empty email to start.</p>';
11
+ $nc->data['track'] = 1;
12
+ }
13
+ }
14
+ else {
15
+ if ($nc->is_action('save') || $nc->is_action('send')) {
16
+ $nc->save($wpdb->prefix . 'newsletter_emails');
17
+ }
18
+
19
+ if ($nc->is_action('send')) {
20
+
21
+ // Fake value representing the WordPress users as target
22
+ if ($nc->data['list'] == -1) {
23
+ $query = "select count(*) from " . $wpdb->prefix . "users " . $nc->data['query'];
24
+ }
25
+ else {
26
+ if (!empty($nc->data['query'])) $query = "select count(*) from " . $wpdb->prefix . "newsletter " . $nc->data['query'];
27
+ else {
28
+ $query = "select count(*) from " . $wpdb->prefix . "newsletter where status='C'";
29
+ if ($nc->data['list'] != 0) $query .= " and list_" . $nc->data['list'] . "=1";
30
+ if (!empty($nc->data['sex'])) $query .= " and sex='" . $nc->data['sex'] . "'";
31
+ }
32
+ }
33
+ $newsletter->log($query, 3);
34
+ $newsletter->log('total: ' . $wpdb->get_var($query), 3);
35
+
36
+ $nc->data['total'] = $wpdb->get_var($query);
37
+ $nc->data['sent'] = 0;
38
+ $nc->data['status'] = 'sending';
39
+ $nc->data['last_id'] = 0;
40
+ $nc->save($wpdb->prefix . 'newsletter_emails');
41
+ $nc->load($wpdb->prefix . 'newsletter_emails', $nc->data['id']);
42
+ }
43
+
44
+ if ($nc->is_action('pause')) {
45
+ $nc->update($wpdb->prefix . 'newsletter_emails', 'status', 'paused');
46
+ $nc->load($wpdb->prefix . 'newsletter_emails', $nc->data['id']);
47
+ }
48
+
49
+ if ($nc->is_action('continue')) {
50
+ $wpdb->query("update " . $wpdb->prefix . "newsletter_emails set status='sending' where id=" . $nc->data['id']);
51
+ $nc->load($wpdb->prefix . 'newsletter_emails', $nc->data['id']);
52
+ }
53
+
54
+ if ($nc->is_action('abort')) {
55
+ $wpdb->query("update " . $wpdb->prefix . "newsletter_emails set last_id=0, status='new' where id=" . $nc->data['id']);
56
+ $nc->load($wpdb->prefix . 'newsletter_emails', $nc->data['id']);
57
+ }
58
+
59
+ if ($nc->is_action('delete')) {
60
+ $wpdb->query("delete from " . $wpdb->prefix . "newsletter_emails where id=" . $nc->data['id']);
61
+ ?><script>location.href="admin.php?page=newsletter/emails.php";</script><?php
62
+ return;
63
+ }
64
+
65
+ if ($nc->is_action('compose')) {
66
+ if ($nc->data['_theme'][0] == '*') $file = ABSPATH . 'wp-content/plugins/newsletter-custom/themes/' . substr($nc->data['_theme'], 1) .
67
+ '/theme.php';
68
+ else $file = dirname(__FILE__) . '/themes/' . $nc->data['_theme'] . '/theme.php';
69
+
70
+ ob_start();
71
+ @include($file);
72
+ $nc->data['message'] = ob_get_contents();
73
+ ob_end_clean();
74
+ }
75
+
76
+ if ($nc->is_action('test')) {
77
+ $nc->save($wpdb->prefix . 'newsletter_emails');
78
+ $users = newsletter_get_test_subscribers();
79
+ $email = new stdClass();
80
+ $email->message = $nc->data['message'];
81
+ $email->subject = $nc->data['subject'];
82
+ $email->track = $nc->data['track'];
83
+ $email->type = 'email';
84
+ $newsletter->send($email, $users);
85
+ }
86
+ }
87
+
88
+
89
+ $options_main = get_option('newsletter_main', array());
90
+
91
+ $options_profile = get_option('newsletter_profile', array());
92
+ $lists = array('0' => 'To all subscribers', '-1'=>'To WordPress users');
93
+ for ($i = 1; $i <= 9; $i++) {
94
+ $lists['' . $i] = '(' . $i . ') ' . $options_profile['list_' . $i];
95
+ }
96
+
97
+ // Themes
98
+ $themes[''] = 'Packaged themes';
99
+ $themes['blank'] = 'Empty email';
100
+ $themes['theme-1'] = 'Newsletter theme 1';
101
+ //$themes['theme-2'] = 'Newsletter theme 2';
102
+ //$themes['theme-3'] = 'Newsletter theme 3';
103
+
104
+ $nc->errors($errors);
105
+ $nc->messages($messages);
106
+ ?>
107
+
108
+ <script type="text/javascript" src="<?php echo get_option('siteurl'); ?>/wp-content/plugins/newsletter/tiny_mce/tiny_mce.js"></script>
109
+ <script type="text/javascript">
110
+ tinyMCE.init({
111
+ mode : "specific_textareas",
112
+ editor_selector : "visual",
113
+ theme : "advanced",
114
+ plugins: "table,fullscreen",
115
+ theme_advanced_disable : "styleselect",
116
+ theme_advanced_buttons1_add: "forecolor,blockquote,code",
117
+ theme_advanced_buttons3 : "tablecontrols,fullscreen",
118
+ relative_urls : false,
119
+ remove_script_host : false,
120
+ theme_advanced_toolbar_location : "top",
121
+ document_base_url : "<?php echo get_option('home'); ?>/"
122
+ });
123
+ </script>
124
+
125
+
126
+ <div class="wrap">
127
+
128
+ <h2>Email Composer</h2>
129
+
130
+ <form method="post" action="admin.php?page=newsletter/emails-edit.php">
131
+ <?php $nc->init(); ?>
132
+ <?php $nc->hidden('id'); ?>
133
+ <?php $nc->hidden('status'); ?>
134
+
135
+ <table class="form-table">
136
+
137
+ <tr valign="top">
138
+ <th>Auto compose</th>
139
+ <td>
140
+ <?php $nc->select_grouped('_theme', array(
141
+ array_merge(array(''=>'Custom themes'), newsletter_get_themes()),
142
+ $themes
143
+ ));
144
+ ?>
145
+ <?php $nc->button('compose', 'Auto compose'); ?>
146
+ <div class="hints">
147
+ Auto composition does not save this email, remember to press save if you are satisfied of the result.
148
+ </div>
149
+ </td>
150
+ </tr>
151
+
152
+ <tr valign="top">
153
+ <th>Subject</th>
154
+ <td>
155
+ <?php $nc->text('subject', 70); ?>
156
+ <div class="hints">
157
+ Tags: <strong>{name}</strong> receiver name.
158
+ </div>
159
+ </td>
160
+ </tr>
161
+
162
+ <tr valign="top">
163
+ <th>Message</th>
164
+ <td>
165
+ <?php $nc->data['editor'] == 0?$nc->editor('message', 20):$nc->textarea_fixed('message', '100%', 400); ?>
166
+ <br />
167
+ <?php $nc->select('editor', array(0=>'Edit with visual editor', 1=>'Edit as plain text')); ?>
168
+ <div class="hints">
169
+ Tags: <strong>{name}</strong> receiver name;
170
+ <strong>{unsubscription_url}</strong> unsubscription URL;
171
+ <strong>{token}</strong> the subscriber token; <strong>{profile_url}</strong> link to user subscription options page;
172
+ <strong>{np_aaa}</strong> user profile data named "aaa".
173
+ </div>
174
+ </td>
175
+ </tr>
176
+
177
+ <tr valign="top">
178
+ <th>To...</th>
179
+ <td>
180
+ list: <?php $nc->select('list', $lists); ?>
181
+ sex: <?php $nc->select('sex', array(''=>'All', 'n'=>'No sex specified', 'f'=>'Females', 'm'=>'Males')); ?>
182
+ <div class="hints">
183
+ When sending to WordPress users, they cannot cancel the subscription and the cannot
184
+ be tracked.
185
+ </div>
186
+ </td>
187
+ </tr>
188
+ <!--
189
+ <tr valign="top">
190
+ <th>Query<br/><small>Really advanced!</small></th>
191
+ <td>
192
+ select * from wp_newsletter<br />
193
+ <?php $nc->textarea('query'); ?>
194
+ <br />
195
+ and id>... order by id limit ...
196
+ <div class="hints">
197
+ If you want to specify a different query to extract subscriber from Newsletter Pro database, here you
198
+ can write it. Be aware that the query starts and ends as specified, so your SQL snippet needs to create a
199
+ complete and working query.<br />
200
+ Leave this area empty to leave Newsletter Pro doing the work.<br />
201
+ When you specify a query, options like the target list will be ignored.<br />
202
+ For examples of queries study the documentation panel.
203
+ </div>
204
+ </td>
205
+ </tr>
206
+ -->
207
+
208
+ </table>
209
+
210
+ <p class="submit">
211
+ <?php if ($nc->data['status'] != 'sending') $nc->button('save', 'Save'); ?>
212
+ <?php if ($nc->data['status'] != 'sending') $nc->button_confirm('test', 'Save and test', 'Save and send test emails to test addresses?'); ?>
213
+
214
+ <?php if ($nc->data['status'] == 'new') $nc->button_confirm('send', 'Send', 'Start a real delivery?'); ?>
215
+ <?php if ($nc->data['status'] == 'sending') $nc->button_confirm('pause', 'Pause', 'Pause the delivery?'); ?>
216
+ <?php if ($nc->data['status'] == 'paused') $nc->button_confirm('continue', 'Continue', 'Continue the delivery?'); ?>
217
+ <?php if ($nc->data['status'] != 'new') $nc->button_confirm('abort', 'Abort', 'Abort the delivery?'); ?>
218
+ <?php if ($nc->data['id'] != 0) $nc->button_confirm('delete', 'Delete', 'Delete?'); ?>
219
+ (email status: <?php echo $nc->data['status']; ?>)
220
+ </p>
221
+
222
+ </form>
223
+ </div>
emails.php CHANGED
@@ -1,11 +1,42 @@
1
- <div class="wrap">
2
-
3
- <h2>Statistics</h2>
4
-
5
- <?php if (!newsletter_has_extras('1.0.3')) { ?>
6
- <strong>You need the <a href="http://www.satollo.net/plugins/newsletter/extras">Newsletter Extras</a> installed to view statistics</strong>
7
- <?php } else { ?>
8
- <?php require_once ABSPATH . 'wp-content/plugins/newsletter-extras/emails.php'; ?>
9
- <?php } ?>
10
-
11
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ @include_once 'commons.php';
3
+ $emails = $wpdb->get_results("select * from " . $wpdb->prefix . "newsletter_emails where type='email' order by id desc");
4
+
5
+ if ($_GET['pippo']) {
6
+ $newsletter->hook_newsletter();
7
+ }
8
+ ?>
9
+
10
+ <div class="wrap">
11
+
12
+ <h2>Messages</h2>
13
+
14
+ <p><a href="admin.php?page=newsletter/emails-edit.php&amp;id=0" class="button">New message</a></p>
15
+ <p>Delivery engine next run: <?php echo wp_next_scheduled('newsletter')-time(); ?> seconds</p>
16
+
17
+ <table class="widefat">
18
+ <thead>
19
+ <tr>
20
+ <th>Id</th>
21
+ <th>Subject</th>
22
+ <th>Date</th>
23
+ <th>Status</th>
24
+ <th>&nbsp;</th>
25
+ </tr>
26
+ </thead>
27
+
28
+ <tbody>
29
+ <?php foreach ($emails as &$email) { ?>
30
+ <tr>
31
+ <td><?php echo $email->id; ?></td>
32
+ <td><a href="admin.php?page=newsletter/emails-edit.php&amp;id=<?php echo $email->id; ?>"><?php echo htmlspecialchars($email->subject); ?></a></td>
33
+ <td><?php echo $email->date; ?></td>
34
+ <td>
35
+ <?php echo $email->status; ?>
36
+ (<?php echo $email->sent; ?>/<?php echo $email->total; ?>)
37
+ </td>
38
+ </tr>
39
+ <?php } ?>
40
+ </tbody>
41
+ </table>
42
+ </div>
export.php DELETED
@@ -1,20 +0,0 @@
1
- <?php
2
- @include_once 'commons.php';
3
-
4
- ?>
5
-
6
- <div class="wrap">
7
- <h2><?php _e('Newsletter Export', 'newsletter'); ?> <a target="_blank" href="http://www.satollo.net/plugins/newsletter#export"><img src="<?php echo get_option('siteurl'); ?>/wp-content/plugins/newsletter/help.png"/></a></h2>
8
-
9
- <textarea wrap="off" style="width: 100%; height: 400px; font-size: 11px; font-family: monospace">
10
- email;name;status;token
11
-
12
- <?php
13
- $query = "select * from " . $wpdb->prefix . "newsletter";
14
- $recipients = $wpdb->get_results($query . " order by email");
15
- for ($i=0; $i<count($recipients); $i++) {
16
- echo $recipients[$i]->email . ';' . $recipients[$i]->name .
17
- ';' . $recipients[$i]->status . ';' . $recipients[$i]->token . "\n";
18
- }
19
- ?></textarea>
20
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
forms.php DELETED
@@ -1,15 +0,0 @@
1
- <?php
2
- @include_once 'commons.php';
3
- ?>
4
-
5
- <div class="wrap">
6
-
7
- <h2>Newsletter Forms</h2>
8
-
9
- <?php if (!defined('NEWSLETTER_EXTRAS')) { ?>
10
- <strong>You need the <a href="http://www.satollo.net/plugins/newsletter-extras">Newsletter Extras</a> installed to use this panel</strong>
11
- <?php } else { ?>
12
- <?php require_once ABSPATH . 'wp-content/plugins/newsletter-extras/forms.php'; ?>
13
- <?php } ?>
14
-
15
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
header.php CHANGED
@@ -1,8 +1 @@
1
-
2
- <?php if (defined('NEWSLETTER_EXTRAS')) { ?>
3
- <iframe width="100%" height="50" src="http://www.satollo.net/services/newsletter?extras=<?php echo NEWSLETTER_EXTRAS; ?>" style="border: 1px solid #ccc"></iframe>
4
- <?php } else { ?>
5
- <iframe width="100%" height="100" src="http://www.satollo.net/services/newsletter" style="border: 1px solid #ccc"></iframe>
6
- <?php } ?>
7
-
8
-
1
+ <!-- -->
 
 
 
 
 
 
 
help.png DELETED
Binary file
import.php CHANGED
@@ -1,61 +1,183 @@
1
- <?php
2
-
3
- @include_once 'commons.php';
4
-
5
- $options = get_option('newsletter');
6
-
7
-
8
- if ($action == 'import') {
9
- @set_time_limit(100000);
10
- $csv = stripslashes($_POST['csv']);
11
- $lines = explode("\n", $csv);
12
-
13
- $errors = array();
14
- foreach ($lines as $line) {
15
- $line = trim($line);
16
- if ($line == '') continue;
17
- if ($line[0] == '#') continue;
18
- $data = explode(';', $line);
19
- $email = newsletter_normalize_email($data[0]);
20
- if (!newsletter_is_email($email))
21
- {
22
- $errors[] = $line;
23
- continue;
24
- }
25
- $name = newsletter_normalize_name($data[1]);
26
- $token = md5(rand());
27
- $r = $wpdb->query("insert into " . $wpdb->prefix . "newsletter (status, email, name, token) values ('C', '" . $wpdb->escape($email) . "','" . $wpdb->escape($name) . "','" . $token . "')");
28
- // Zero or false mean no row inserted
29
- if (!$r) $errors[] = $line;
30
- }
31
- }
32
-
33
- $nc = new NewsletterControls();
34
- ?>
35
-
36
- <div class="wrap">
37
-
38
- <h2><?php _e('Newsletter Import', 'newsletter'); ?> <a target="_blank" href="http://www.satollo.net/plugins/newsletter#import"><img src="<?php echo get_option('siteurl'); ?>/wp-content/plugins/newsletter/help.png"/></a></h2>
39
-
40
- <?php require_once 'header.php'; ?>
41
-
42
- <?php if (!empty($errors)) { ?>
43
-
44
- <h3><?php _e('Rows with errors', 'newsletter'); ?></h3>
45
-
46
- <textarea wrap="off" style="width: 100%; height: 150px; font-size: 11px; font-family: monospace"><?php echo htmlspecialchars(implode("\n", $errors))?></textarea>
47
-
48
- <?php } ?>
49
-
50
- <form method="post" action="">
51
- <?php wp_nonce_field(); ?>
52
-
53
- <h3><?php _e('CSV text with subscribers', 'newsletter'); ?></h3>
54
-
55
- <textarea name="csv" wrap="off" style="width: 100%; height: 300px; font-size: 11px; font-family: monospace"></textarea>
56
- <p class="submit">
57
- <?php $nc->button('import', __('Import', 'newsletter')); ?>
58
- </p>
59
- </form>
60
-
61
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ @include_once 'commons.php';
4
+
5
+ $options = stripslashes_deep($_POST['options']);
6
+
7
+ $options_profile = get_option('newsletter_profile');
8
+
9
+ if ($action == 'import') {
10
+ @set_time_limit(100000);
11
+ $csv = stripslashes($_POST['csv']);
12
+ $lines = explode("\n", $csv);
13
+
14
+ $error = array();
15
+ // Subscriber array with base user data from selected lists and other default values
16
+ $subscriber = array();
17
+ for ($i=1; $i<=NEWSLETTER_LIST_MAX; $i++)
18
+ {
19
+ $list = 'list_' . $i;
20
+ if (isset($options[$list])) $subscriber[$list] = 1;
21
+ else {
22
+ if ($options['mode'] == 'overwrite') $subscriber[$list] = 0;
23
+ }
24
+ }
25
+
26
+ foreach ($lines as $line) {
27
+ // Parse the CSV line
28
+ $line = trim($line);
29
+ if ($line == '') continue;
30
+ if ($line[0] == '#') continue;
31
+ $separator = $options['separator'];
32
+ if ($separator == 'tab') $separator = "\t";
33
+ $data = explode($separator, $line);
34
+
35
+
36
+ // Builds a subscriber data structure
37
+ $subscriber['email'] = $newsletter->normalize_email($data[0]);
38
+ if (!$newsletter->is_email($subscriber['email']))
39
+ {
40
+ $error[] = '[INVALID EMAIL] ' . $line;
41
+ continue;
42
+ }
43
+ $subscriber['name'] = $newsletter->normalize_name($data[1]);
44
+ $subscriber['surname'] = $newsletter->normalize_name($data[2]);
45
+ // May by here for a previous saving
46
+ unset($subscriber['id']);
47
+
48
+ // Try to load the user by email
49
+ $user = $wpdb->get_row($wpdb->prepare("select * from " . $wpdb->prefix .
50
+ "newsletter where email=%s", $subscriber['email']), ARRAY_A);
51
+
52
+ // If the user is new, we simply add it
53
+ if (empty($user)) {
54
+ newsletter_save($subscriber);
55
+ continue;
56
+ }
57
+
58
+ if ($options['mode'] == 'skip') {
59
+ $error[] = '[DUPLICATE] ' . $line;
60
+ continue;
61
+ }
62
+
63
+ if ($options['mode'] == 'overwrite') {
64
+ $subscriber['id'] = $user['id'];
65
+ newsletter_save($subscriber);
66
+ continue;
67
+ }
68
+
69
+ if ($options['mode'] == 'update') {
70
+ newsletter_save(array_merge($user, $subscriber));
71
+ }
72
+ }
73
+ }
74
+
75
+ $nc = new NewsletterControls();
76
+ $nc->errors($errors);
77
+ $nc->messages($messages);
78
+
79
+
80
+ $lists = array('0' => 'All');
81
+ for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
82
+ $lists['' . $i] = '(' . $i . ') ' . $options_profile['list_' . $i];
83
+ }
84
+ ?>
85
+
86
+ <div class="wrap">
87
+ <h2>Newsletter Import/Export</h2>
88
+ <form method="post" action="">
89
+ <?php $nc->init(); ?>
90
+ <h3>Export</h3>
91
+ <table class="form-table">
92
+ <tr>
93
+ <td>
94
+ <?php $nc->select('list', $lists); ?>
95
+ <?php $nc->button('export', 'Export'); ?>
96
+ </td>
97
+ </tr>
98
+ </table>
99
+ </form>
100
+
101
+ <h3>Import</h3>
102
+ <p>
103
+ Please consider to break up your input list if you get errors, blank pages or partially imported lists: it can be a time/resource limit
104
+ of your provider. It's safe to import the same list a second time, no duplications will occur.
105
+ </p>
106
+ <p>
107
+ Import list format is:<br /><br />
108
+ <b>email</b><i>[separator]</i><b>name</b><i>[new line]</i><br />
109
+ <b>email</b><i>[separator]</i><b>name</b><i>[new line]</i><br />
110
+ <br />
111
+ where the [separator] must be selected from the available ones. The "name" field is optional, while the "email" field is
112
+ mandatory. Empty lines and lines starting with "#" will be skipped.
113
+ </p>
114
+
115
+
116
+ <?php require_once 'header.php'; ?>
117
+
118
+ <?php if (!empty($error)) { ?>
119
+
120
+ <h3><?php _e('Rows with errors', 'newsletter'); ?></h3>
121
+
122
+ <textarea wrap="off" style="width: 100%; height: 150px; font-size: 11px; font-family: monospace"><?php echo htmlspecialchars(implode("\n", $error))?></textarea>
123
+
124
+ <?php } ?>
125
+
126
+ <form method="post" action="">
127
+ <?php $nc->init(); ?>
128
+
129
+ <h3><?php _e('CSV text with subscribers', 'newsletter'); ?></h3>
130
+ <table class="form-table">
131
+ <tr valign="top">
132
+ <th>Lists to associate</th>
133
+ <td>
134
+ <?php for ($i=1; $i<=NEWSLETTER_LIST_MAX; $i++) { ?>
135
+ <?php $nc->checkbox('list_' . $i, '(' . $i . ') ' . htmlspecialchars($options_profile['list_' . $i])); ?><br />
136
+ <?php } ?>
137
+ <div class="hints">
138
+ Every new imported or updated subscribers will be associate with selected lists above.
139
+ </div>
140
+ </td>
141
+ </tr>
142
+ <!--
143
+ <tr valign="top">
144
+ <th>Follow up</th>
145
+ <td>
146
+ <?php $nc->select('followup', array('none'=>'None', 'activate'=>'Activate')); ?>
147
+ </td>
148
+ </tr>
149
+ -->
150
+ <tr valign="top">
151
+ <th>Import mode</th>
152
+ <td>
153
+ If the email is already present:
154
+ <?php $nc->select('mode', array('update'=>'Update', 'overwrite'=>'Overwrite', 'skip'=>'Skip')); ?>
155
+ <div class="hints">
156
+ <strong>Update</strong>: the user data is updated: if a user was associated to some lists, those associations will be
157
+ kept and the new one added; his name is updated as well.<br />
158
+ <strong>Overwrite</strong>: recreate the subscriber with specified data (CSV+lists).<br />
159
+ <strong>Skip</strong>: leave untouched user's data when he's already subscribed.
160
+ </div>
161
+ </td>
162
+ </tr>
163
+ <tr valign="top">
164
+ <th>Separator</th>
165
+ <td>
166
+ <?php $nc->select('separator', array(';'=>'Semicolon', ','=>'Comma', 'tab'=>'Tabulation')); ?>
167
+ </td>
168
+ </tr>
169
+
170
+
171
+ <tr valign="top">
172
+ <th>CSV text</th>
173
+ <td>
174
+ <textarea name="csv" wrap="off" style="width: 100%; height: 300px; font-size: 11px; font-family: monospace"></textarea>
175
+ </td>
176
+ </table>
177
+
178
+ <p class="submit">
179
+ <?php $nc->button('import', 'Import'); ?>
180
+ </p>
181
+ </form>
182
+
183
+ </div>
intro.php ADDED
@@ -0,0 +1,427 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <script>
2
+ jQuery(document).ready(function () {
3
+
4
+ jQuery(".wrap h3").each(function () {
5
+ jQuery(this).nextUntil('h3').hide();
6
+ });
7
+
8
+ jQuery(".wrap h3").click(function () {
9
+ jQuery(this).nextUntil('h3').toggle();
10
+ });
11
+ });
12
+ </script>
13
+ <div class="wrap">
14
+ <h2>Newsletter/Newsletter Pro User Guide</h2>
15
+
16
+ <p>Welcome to Newsletter/Neswletter Pro from Stefano Lissa.</p>
17
+ <p>
18
+ I hope Newsletter/Neswletter Pro will be a powerful tool for your business. I made the whole configuration
19
+ as simple as possible but keeping an eye on flexibility, specially in respect of all the
20
+ world languages. I'm Italian and I know how much stressing job is the plug-in translation!
21
+ </p>
22
+ <p>
23
+ This guide is common to Newsletter and Newsletter Pro, so here you will find some chapters with
24
+ instructions on how to operate with Newsletter Pro features: if you're running Newsletter free, just
25
+ skip them.
26
+ </p>
27
+ <p>
28
+ If you want to know more about Newsletter Pro, take a look to
29
+ <a href="http://www.satollo.net/plugins/newsletter" target="_blank">this page</a> (opens on a new window)
30
+ or go directly to the <a href="http://members.satollo.net" target="_blank">Member's site</a> (opens in a new window).
31
+ </p>
32
+ <p>
33
+ <strong>References to pages where leave comments or find support can be find
34
+ on <a href="http://www.satollo.net/plugins/newsletter" target="_blank">this page</a> (opens on a new window).</strong>
35
+ </p>
36
+ <p>
37
+ Every non obvious options you find on configuration panels has a little
38
+ documentation box. Many users asked me to include the documentation on Newsletter panels
39
+ and even if that make them a little bit "verbose", I think it's of great help.
40
+ </p>
41
+ <p>
42
+ Please, take the time to read the info box of each option, specially on main configuration
43
+ panel, because some values, even if formally correct, can be the cause of errors (due to
44
+ your hosting provider policy or limits).
45
+ </p>
46
+ <p>
47
+ <strong>If you have questions due to missing part on this documentation, send me an email to
48
+ stefano@satollo.net so I can complete it and clear any doubt</strong>.
49
+ </p>
50
+
51
+
52
+ <h3>Newsletter configuration structure</h3>
53
+
54
+ <p>
55
+ Newsletter panels are organized as described below. It is separated in modules, so if you don't
56
+ need the feed by mail service or you don't need the follow up service, you can ignore them safely.<br />
57
+ Every panel contains it's own documentation, but here you can find special cases or examples.
58
+ </p>
59
+ <ul>
60
+ <li><strong>User Guide.</strong> It's the panel where you are now...</li>
61
+ <li><strong>Main Configuration.</strong> Really important. It's the first panel you need to check. Almost every value has a preset or can
62
+ be left empty but you at least make some sending test. Other advanced functions are configurable on main panel:
63
+ <ul>
64
+ <li>SMTP (only Newsletter Pro). To use an external SMTP to send emails.</li>
65
+ <li>Locked content (only Newsletter Pro). To create premium content on your blog locking out parts of posts letting only
66
+ subscriber to see them.</li>
67
+ </ul>
68
+ </li>
69
+
70
+ <li><strong>User Profile.</strong> Really important. It's where you set what user's data you want to collect on subscription. There
71
+ you can translate almost every thing of Newsletter.</li>
72
+ <li><strong>Subscription Process.</strong> Really important. It's where you decide how the subscription process works. There you
73
+ can set double or single opt in, emails and messages that are involved on subscription and cancellation.</li>
74
+ <li><strong>Emails.</strong> Where to create and send emails. For Newsletter Pro owners there is access to single email statistics (
75
+ clicks, links clicked, ...).</li>
76
+ <li><strong>Users Management.</strong> There you can search, add, edit, remove subscribers. For Newsletter Pro owners there is a statistics
77
+ sub-panel.</li>
78
+ <li><strong>Feed by mail (only Newsletter Pro).</strong> Configure if and how you subscriber will receive a summary of you
79
+ blog latest posts. There you can create your feed by mail theme (programming skills needed) as no other
80
+ services can do!</li>
81
+ <li><strong>Follow up (only Newsletter Pro).</strong> Don't let your subscribers without messages for long time after they
82
+ signed up. On this panel you can program a series of emails to be sent automatically.</li>
83
+ <li><strong>Import/Export.</strong> Some functionalities to import subscribers from CSV file and to export them.</li>
84
+
85
+ <li><strong>Forms.</strong> You can manually create subscription forms to be recalled on different places. Before use that panel remember that
86
+ Newsletter enables you to customize the subscription form on every configuration which require it (eg. the widget).</li>
87
+ </ul>
88
+
89
+
90
+ <h3>Main configuration panel</h3>
91
+ <p>
92
+ Every setting in the main configuration panel is adequately described there, just be sure to read every note because some
93
+ apparently legal values can block the emails from your account.
94
+ </p>
95
+ <p>
96
+ One important parameter is the number of email per hour you want Newsletter to send. This limit is applied to
97
+ newsletters, feed by mail and follow up emails.
98
+ </p>
99
+
100
+ <h4>Sending process and SMTP</h4>
101
+ <p>
102
+ Newsletter Pro uses the mailing functions of WordPress to send emails so you can use any plugin
103
+ that extend the WordPress mailing system and it will act on Newsletter Pro emails too.
104
+ </p>
105
+ <p>
106
+ Optionally, on main configuration panel, you can choose to use an "external" SMTP service. In that case
107
+ Newsletter Pro sends emails on it's own, using directly the WordPress included libraries. Using the SMTP
108
+ of Newsletter Pro than installing a plugin that forces WordPress standard mailing function to use the same
109
+ SMTP is usually more efficient. Newsletter Pro will use that SMTP for any message it needs to send (not only newsletters
110
+ even welcome and confirmation messages will be sent via SMTP).
111
+ </p>
112
+ <p>
113
+ If the Mailer plugin is installed, Newsletter Pro adds some special headers on outgoing emails so Mailer
114
+ can detect them and schedule correctly every message. Newsletters are send with priority 2 while
115
+ any other message (usually confirmation and welcome messages) is sent with priority 0 (real time).
116
+ </p>
117
+ <p>
118
+ Mailer or other plugins that throttles emails going out from your blog are not required, since Newsletter has it's
119
+ own email throttling system.
120
+ </p>
121
+
122
+ <h4>Locked content</h4>
123
+
124
+ <p>
125
+ <strong>Read carefully if you use a cache system!</strong>
126
+ </p>
127
+ <p>
128
+ With Newsletter Pro you can lock out some content of you blog, making it available only
129
+ to confirmed subscriber. The feature can be configured on main configuration panel.
130
+ </p>
131
+ <p>
132
+ Using the feature is very simple: on a post identify the content you want to lock out and
133
+ surround it with shot code [newsletter_lock]...[/newsletter_lock]. You can lock out multiple
134
+ piece of content, too.
135
+ </p>
136
+ <p>
137
+ In place of the hidden content a short message is shown, as configured in main configuration panel
138
+ (where there are some tips on what to write in it). When a user subscribe and confirm the subscription or
139
+ click on his personal unlocking url ({unlock_url} that you should put only on welcome email) a cookie
140
+ is added to his browser and the lock is removed every where on the blog.
141
+ </p>
142
+ <p>
143
+ <strong>Warning</strong>. Be sure to not cache the posts with locked content, otherwise there are chances that
144
+ subscribers see always the lock message or, worse, the unlocked content is shown to every one. Newsletter
145
+ Pro is already integrated with Hyper Cache, for other cache systems just add a cache bypass based on
146
+ presence of "newsletter" cookie.
147
+ </p>
148
+
149
+
150
+
151
+
152
+
153
+
154
+ <h3>The subscription process</h3>
155
+
156
+ <p>
157
+ The main thing you should care of is the subscription configuration. It's not so hard but
158
+ there are some choices you need to take and that suite your audience and may be your
159
+ local laws.
160
+ </p>
161
+ <p>
162
+ Subscription can be single opt in or double opt in. Choosing the one or the other will change
163
+ the configuration panel to show you only the needed options.
164
+ </p>
165
+ <p>
166
+ Single opt in is not too much legal, since you assume that the subscribed email address is correct and
167
+ owned by who performed the subscription. Double opt in subscription (which is required for example by DreamHost)
168
+ activate the subscriber only after he confirm his email address (by an activation email send by Newsletter).
169
+ </p>
170
+
171
+
172
+
173
+ <h3>User profile</h3>
174
+
175
+ <p>
176
+ User profile is the set of data you can collect about subscribers during the subscription or on their profile panel:
177
+ </p>
178
+
179
+ <ul>
180
+ <li>email, first name, last name</li>
181
+ <li>sex</li>
182
+ <li>privacy check box (for countries which requires it)</li>
183
+ <li>lists/topics preference (up to 9)</li>
184
+ <li>generic textual/selection list profile fields (up to 19)</li>
185
+ <li>ip address and date of subscription (for legal purposes)</li>
186
+ </ul>
187
+ <p>
188
+ Even if Newsletter Pro lets you to collect all that data, it's recommended to ask the subscriber
189
+ the smallest set of fields possible, to avoid subscription loss. It's usually more profitable to give
190
+ the subscriber a complete profile form where to fill in more data on a second time. You
191
+ can offer the complete profile form just after the sign up or invite the user to complete his data
192
+ with a follow up email or with a link to the profile form on newsletters you'll send.
193
+ </p>
194
+
195
+ <p>
196
+ Subscription and profile forms, as generated by Newsletter Pro, are controlled under the "user profile"
197
+ panel. There you can decide what fields to ask on subscription time and what fields on profile editing step.
198
+ </p>
199
+
200
+ <p>
201
+ You can also <strong>translate every single word</strong> in you language!
202
+ </p>
203
+
204
+ <p>
205
+ Check the hints in the panel for detailed explanation of every single field.
206
+ </p>
207
+
208
+
209
+ <h3>Custom forms</h3>
210
+ <p>
211
+ You need HTML skills to create custom forms, but it is so easy that a consultant
212
+ should charge a very low fee to do it for you (or ask to a nephew...).
213
+ </p>
214
+ <p>
215
+ As general rule, you can create a custom form <strong>on every subscription point</strong>: the
216
+ Newsletter Pro main page, on Newsletter Pro widgets, on alternative messages for
217
+ locked content.
218
+ </p>
219
+ <p>
220
+ To create a custom form is very easy, here an example that asks the user only it's email:
221
+ </p>
222
+ <p>
223
+ <code>
224
+ &lt;form&gt;<br />
225
+ &lt;input type="text" name="ne"/&gt;<br />
226
+ &lt;input type="submit"/&gt;<br />
227
+ &lt;/form&gt;<br />
228
+ </code>
229
+ as you can see the form tag has not attributes (method, action, ...): they are added
230
+ automatically by Newsletter Pro. If you need to fire a JavaScript call before the form submission
231
+ add an "onclick" event to the submit button.
232
+ </p>
233
+
234
+ <p>
235
+ The field names you can add to a custom form are:
236
+ </p>
237
+ <ul>
238
+ <li>ne - is the user email</li>
239
+ <li>nn - is the user name (first name or complete name)</li>
240
+ <li>ns - is the user surname/last name</li>
241
+ <li>npN - where N go from 1 to 19, are the custom profile fields (be aware they
242
+ are not the same thing of profile fields in Newsletter Pro 2.1)</li>
243
+ <li>nl[] - must be checkbox fields name when they represent a list/option/topic and the list/option/topic number (1 to 9)
244
+ must be the field value (see below).</li>
245
+ </ul>
246
+ <p>
247
+ For lists on a custom form you can ask the user to check what lists he want to subscribe or
248
+ put an "hidden" list field to "force" the subscription on that list. The latter option is used
249
+ when different forms collect users on different lists without asking directly to the subscriber.
250
+ </p>
251
+ <p>
252
+ An example of check box field for a list is:
253
+ </p>
254
+ <p>
255
+ <code>&lt;input type="checkbox" name="nl[]" value="3"/&gt;</code>
256
+ </p>
257
+
258
+ <h3>Emails</h3>
259
+ <p>
260
+ Emails are created from the "emails" panel. When you enter the panel you'll se the emails archived and their status.
261
+ </p>
262
+ <p>
263
+ Each email has a subject and a body, but some other information are stored: targeted users, if link clicks can be tracked,
264
+ a status, the number of receivers and how many copies have already been sent.
265
+ </p>
266
+ <p>
267
+ You can create as many email as you want and you can even send many of them simultaneously.
268
+ </p>
269
+
270
+ <h4>Email status</h4>
271
+ <p>
272
+ An email has few possible statuses:
273
+ </p>
274
+ <ul>
275
+ <li>new - when it has just been created</li>
276
+ <li>sending - when you start the sending process and Newsletter Pro is taking care of it</li>
277
+ <li>sent - when the sending engine has completed the work</li>
278
+ <li>paused - if you want to pause the sending process, may be to correct an error</li>
279
+ </ul>
280
+ <p>
281
+ When you abort an email sending, the email return to the "new" status and every sending progress information is reset.
282
+ </p>
283
+
284
+ <h3>Email autocomposer and themes</h3>
285
+ <p>
286
+ When a new email is create, it can composed starting from a blank sheet or can be auto composed with
287
+ a theme. I call it auto compose, because a theme can generate actual content getting it from the blog
288
+ (a list of latest posts, tag cloud and so on).
289
+ </p>
290
+ <p>
291
+ Themes are PHP file stored under "themes" folder. There are some pre packaged themes that can be used as
292
+ starting point for your specific theme.
293
+ </p>
294
+ <h4>How to create a custom theme</h4>
295
+ <p>
296
+ To create a new theme follow the steps below (names must be lowercase):
297
+ </p>
298
+
299
+ <ol>
300
+ <li>create a folder named "newsletter-custom" under your WordPress plugins directory</li>
301
+ <li>create a folder named "themes" under the previous created "newsletter-custom"</li>
302
+ <li>inside "themes" create a folder with a name of your choice (the name will be your custom theme name), for example "my-theme": that will be your theme folder</li>
303
+ <li>in your theme folder there must be the file "theme.php" which will be the main file of your theme (and usually the only one)</li>
304
+ </ol>
305
+
306
+ <p>
307
+ To start with an already working theme, start with "theme.php" file of "themes/theme-1" folder.
308
+ </p>
309
+
310
+
311
+ <h3>Follow up or autoresponder</h3>
312
+ <p>
313
+ Follow up or auto-responder is when you send a sequence of emails to new subscribers. A follow up can be a series
314
+ of lessons on a topic, a product/service presentation broken up on small parts or anything else.
315
+ Those emails are typically sent every few days (configurable, of course).
316
+ </p>
317
+
318
+ <p>
319
+ Once you have created your follow up emails (up to 10) and activated the system,
320
+ it starts to work for you contacting the new subscribers as if you're writing to each of them all in
321
+ autopilot.
322
+ </p>
323
+
324
+ <p>
325
+ A subscriber can unsubscribe from the follow up without removing him self from the list:
326
+ simply the "follow up" status will be set to "stop". This point is of great importance,
327
+ because you can let the user to stop annoying (to them) messages without loosing him.
328
+ That "follow up unsubscription" is done via a link you should add to each follow up email.
329
+ The link is inserted on every occurrence of {followup_unsubscription_url} place holder.
330
+ </p>
331
+
332
+
333
+ <h4>Follow up theme</h4>
334
+ <p>
335
+ To give a common skin to each follow up message, the autoresponder applies a theme to every email
336
+ body on configuration panel, so they can be considered only the "content" of follow up messages.
337
+ </p>
338
+
339
+ <p>
340
+ Follow up themes are store under the folder "themes-followup" and prepackaged there are a couple of themes, one
341
+ almost empty (it contains only a footer text with unsubscription link) and the other a little bit
342
+ richer.
343
+ </p>
344
+
345
+ <p>
346
+ Any theme must contain a special tag, {message}, which will be replaced with the current follow up
347
+ email content.
348
+ </p>
349
+
350
+ <p>
351
+ To modify a theme follow the same guide lines for feed by mail themes, just use a themes-followup folder
352
+ instead of themes-feed.
353
+ </p>
354
+
355
+
356
+ <h3>Feed by mail</h3>
357
+
358
+ <p>
359
+ Feed by mail is a Newsletter Pro service that sends an excerpt of last posts
360
+ to subscribers who signed up for it. It's something like Google FeedBurner and other
361
+ external services. What makes the difference is:
362
+ </p>
363
+ <ul>
364
+ <li>you can choose on what days of the week you want to send the summary (you can choose the delivery hour too)</li>
365
+ <li>you can easily track links on those auto generated emails and see clicks statistics</li>
366
+ <li>you can program with PHP your own theme to generate the summary adding other contents of your blog, for example a tag cloud</li>
367
+ <li>subscribers can sign in and sign out of feed by mail service still remaining subscribed to your newsletter</li>
368
+ <li>programming a specific theme (with PHP) you can compose summary emails totally different for each user set (for example, males and females)</li>
369
+ <li>you can automatically add the service to every new subscriber</li>
370
+ </ul>
371
+ <p>
372
+ On feed by mail panel all options are documented, I suggest to subscribe only your self to feed by mail and see the messages Newsletter
373
+ Pro delivers to your mailbox.
374
+ </p>
375
+
376
+ <h4>How to create a new feed by mail theme</h4>
377
+ <p>
378
+ Packaged feed by mail themes are stored under the themes-feed folder. Every theme is a subfolder containing,
379
+ at least, the theme.php file. Packaged themes should be your start point for a new theme, but do not modify
380
+ them directly, otherwise on next Newsletter Pro version upgrade modifications will be lost.
381
+ </p>
382
+
383
+ <p>
384
+ To create a new theme, as for generic newsletter themes, follow the steps below (names must be lowercase):
385
+ </p>
386
+
387
+ <ol>
388
+ <li>create a folder named "newsletter-custom" under your WordPress plugins directory</li>
389
+ <li>create a folder named "themes-feed" under the previous created "newsletter-custom"</li>
390
+ <li>inside "themes-feed" create a folder with a name of your choice (the name will be your custom feed by mail theme name), for example "my-feed-theme": that will be your theme folder</li>
391
+ <li>in your theme folder there must be the file "theme.php" which will be the main file of your theme (and usually the only one)</li>
392
+ </ol>
393
+
394
+ <p>
395
+ To start with an already working theme, start with "theme.php" file of "themes-feed/feed-1" folder or the more complex
396
+ "themes-feed/feed-2" folder: they are well documented.
397
+ </p>
398
+
399
+ <p>
400
+ Do not use one of the "theme.php" files for normal newsletters, the ones you can found under "themes"
401
+ folder, because they do not work!
402
+ </p>
403
+
404
+ <h3>Themes tech details</h3>
405
+ <p>
406
+ Themes for feed by mail and follow up e-mails are "executed" for each user when it's time to generate
407
+ an email body. So the generated text can be customized user by user accessing the "current user" data.
408
+ </p>
409
+
410
+ <p>
411
+ The "current user" is an object stored under the $newsletter->user variable and object properties are
412
+ the values of columns of the table "wp_newsletter" (the prefix "wp_" can be different in your blog).
413
+ </p>
414
+ <p>The user object properties are (use them with the syntax $newsletter->user->property_name):</p>
415
+ <table>
416
+ <tr><td>id</td><td>the user unique identification number</td></tr>
417
+ <tr><td>name</td><td>the user first name</td></tr>
418
+ <tr><td>surname</td><td>the user last name</td></tr>
419
+ <tr><td>sex</td><td>the user sex: m, f, n</td></tr>
420
+ <tr><td>list_n</td><td>list n subscription status: 1 means he's subscribed</td></tr>
421
+ <tr><td>email</td><td>the user email</td></tr>
422
+ <tr><td>followup</td><td>follow up subscription status: 1 means he's subscribed</td></tr>
423
+ <tr><td>feed</td><td>feed by mail subscription status: 1 means he's subscribed</td></tr>
424
+ </table>
425
+
426
+
427
+ </div>
languages/de_DE.php CHANGED
@@ -1,59 +1,61 @@
1
  <?php
2
 
3
- // Subscription form (traslate "your name", "your email" and the button "subscribe me")
4
- $newsletter_labels['subscription_form'] =
5
- '<form method="post" action="" style="text-align: center">
6
- <input type="hidden" name="na" value="s"/>
7
- <table cellspacing="3" cellpadding="3" border="0" width="50%">
8
- <tr><td>Ihr&nbsp;Name</td><td><input type="text" name="nn" size="30"/></td></tr>
9
- <tr><td>Ihre&nbsp;Email</td><td><input type="text" name="ne" size="30"/></td></tr>
10
- <tr><td colspan="2" style="text-align: center"><input type="submit" value="Eintragen"/></td></tr>
11
- </table>
12
- </form>';
13
-
14
- $newsletter_labels['subscription_form_noname'] =
15
- '<form method="post" action="" style="text-align: center">
16
- <input type="hidden" name="na" value="s"/>
17
- <table cellspacing="3" cellpadding="3" border="0" width="50%">
18
- <tr><td>Ihre&nbsp;Email</td><td><input type="text" name="ne" size="30"/></td></tr>
19
- <tr><td colspan="2" style="text-align: center"><input type="submit" value="Eintragen"/></td></tr>
20
- </table>
21
- </form>';
22
-
23
- $newsletter_labels['widget_form'] =
24
- '<form action="{newsletter_url}" method="post">
25
- {text}
26
- <p><input type="text" name="nn" value="Ihr Name" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/></p>
27
- <p><input type="text" name="ne" value="Ihre Email" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/></p>
28
- <p><input type="submit" value="Eintragen"/></p>
29
- <input type="hidden" name="na" value="s"/>
30
- </form>';
31
-
32
- $newsletter_labels['widget_form_noname'] =
33
- '<form action="{newsletter_url}" method="post">
34
- {text}
35
- <p><input type="text" name="ne" value="Ihre Email" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/></p>
36
- <p><input type="submit" value="Eintragen"/></p>
37
- <input type="hidden" name="na" value="s"/>
38
- </form>';
39
-
40
- $newsletter_labels['embedded_form'] =
41
- '<form action="{newsletter_url}" method="post">
42
- <p><input type="text" name="ne" value="Ihre Email" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/>
43
- &nbsp;<input type="text" name="nn" value="Ihr Name" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/>
44
- <input type="submit" value="Eintragen"/>
45
- <input type="hidden" name="na" value="s"/></p>
46
- </form>';
47
-
48
- $newsletter_labels['embedded_form_noname'] =
49
- '<form action="{newsletter_url}" method="post">
50
- <p><input type="text" name="ne" value="Ihre Email" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/>
51
- <input type="submit" value="Eintragen"/>
52
- <input type="hidden" name="na" value="s"/></p>
53
- </form>';
54
-
55
- // Errors on subscription
56
- $newsletter_labels['error_email'] = 'Falsche Email-Adresse. <a href="javascript:history.back()">Go back</a>.';
57
- $newsletter_labels['error_name'] = 'Das Feld für Ihren namen darf nicht leer sein. <a href="javascript:history.back()">Go back</a>.';
58
-
 
 
59
  ?>
1
  <?php
2
 
3
+ $defaults_profile = array();
4
+ $defaults_profile['email_error'] = 'Falsche Email-Adresse.';
5
+ $defaults_profile['name_error'] = 'Das Feld für Ihren namen darf nicht leer sein.';
6
+
7
+
8
+ $defaults = array();
9
+ // Subscription page introductory text (befor the subscription form)
10
+ $defaults['subscription_text'] =
11
+ "<p>Um unseren Newsletter zu erhalten f&uuml;llen Sie das folgende Formular aus.</p>
12
+ <p>Sie erhalten eine Best&auml;tigungs-Email an Ihre Email-Adresse:
13
+ bitte folgen Sie den Anweisungen um Ihre Anmeldung zu vollenden.</p>";
14
+
15
+ // Message show after a subbscription request has made.
16
+ $defaults['subscribed_text'] =
17
+ "<p>Sie haben sich in unseren Newsletter eingetragen.
18
+ In wenigen Minuten erhalten Sie eine Best&auml;tigungs-Email. Folgen Sie dem Link um die Anmeldung zu best&auml;tigen. Sollte die Email nicht innerhalb der n&auml;chsten 15 Minuten in Ihrem Posteingang erscheinen, &uuml;berpr&uuml;fen Sie Ihren Spam-Ordner.</p>";
19
+
20
+ // Confirmation email subject (double opt-in)
21
+ $defaults['confirmation_subject'] =
22
+ "{name},{blog_title} Newsletter - hier Anmeldebest&auml;tigung";
23
+
24
+ // Confirmation email body (double opt-in)
25
+ $defaults['confirmation_message'] =
26
+ "<p>Hallo {name},</p>
27
+ <p>Für diese Email-Adresse haben wir eine Anmeldung zu unserem Newsletter erhalten. Sie k&ouml;nnen diese Anmeldung best&auml;tigen, in dem Sie <a href=\"{subscription_confirm_url}\"><strong>hier klicken</strong></a>.
28
+ Wenn Sie nicht klicken k&ouml;nnen, nutzen Sie die folgenden URL in Ihren Browser ein:</p>
29
+ <p>{subscription_confirm_url}</p>
30
+ <p>Wenn die Anmeldung zu unserem Newsletter nicht von Ihnen stammt, ignorieren Sie diese Nachricht einfach.</p>
31
+ <p>Vielen Dank.</p>";
32
+
33
+
34
+ // Subscription confirmed text (after a user clicked the confirmation link
35
+ // on the email he received
36
+ $defaults['confirmed_text'] =
37
+ "<p>Ihre Anmeldung zu unserem Newsletter wurde best&auml;tigt!
38
+ Herzlichen Dank!</p>";
39
+
40
+ $defaults['confirmed_subject'] =
41
+ "{blog_title} Newsletter - Willkommen";
42
+
43
+ $defaults['confirmed_message'] =
44
+ "<p>
45
+ Hallo {name},
46
+ Willkommen zu unserem {blog_title} Newsletter.</p>
47
+ <p>
48
+ Wir werden Sie künftig regelm&auml;&szlig;ig &uuml;ber Neuigkeiten zu {blog_title} informieren</p>
49
+ <p>
50
+ Wenn Sie unseren newsletter nicht mehr erhalten m&ouml;chten, tragen Sie sich bitte unter dem folgenden Link aus dem Verteiler aus: <a href=\"{newsletter_url}\">austragen</a></p>
51
+ <p>Besten Dank!</p>";
52
+
53
+ // Unsubscription request introductory text
54
+ $defaults['unsubscription_text'] =
55
+ "<p>Bitte best&auml;tigen Sie, dass Sie unseren Newsletter abbestellen, indem Sie
56
+ <a href=\"{unsubscription_confirm_url}\">hier klicken</a>.";
57
+
58
+ // When you finally loosed your subscriber
59
+ $defaults['unsubscribed_text'] =
60
+ "<p>Herzlichen Dank, Sie wurden aus dem Verteiler entfernt...</p>";
61
  ?>
languages/de_DE_options.php DELETED
@@ -1,56 +0,0 @@
1
- <?php
2
- // This file contains the default options values
3
-
4
- // Subscription page introductory text (befor the subscription form)
5
- $newsletter_default_options['subscription_text'] =
6
- "<p>Um unseren Newsletter zu erhalten f&uuml;llen Sie das folgende Formular aus.</p>
7
- <p>Sie erhalten eine Best&auml;tigungs-Email an Ihre Email-Adresse:
8
- bitte folgen Sie den Anweisungen um Ihre Anmeldung zu vollenden.</p>";
9
-
10
- // Message show after a subbscription request has made.
11
- $newsletter_default_options['subscribed_text'] =
12
- "<p>Sie haben sich in unseren Newsletter eingetragen.
13
- In wenigen Minuten erhalten Sie eine Best&auml;tigungs-Email. Folgen Sie dem Link um die Anmeldung zu best&auml;tigen. Sollte die Email nicht innerhalb der n&auml;chsten 15 Minuten in Ihrem Posteingang erscheinen, &uuml;berpr&uuml;fen Sie Ihren Spam-Ordner.</p>";
14
-
15
- // Confirmation email subject (double opt-in)
16
- $newsletter_default_options['confirmation_subject'] =
17
- "{name},{blog_title} Newsletter - hier Anmeldebest&auml;tigung";
18
-
19
- // Confirmation email body (double opt-in)
20
- $newsletter_default_options['confirmation_message'] =
21
- "<p>Hallo {name},</p>
22
- <p>F�r diese Email-Adresse haben wir eine Anmeldung zu unserem Newsletter erhalten. Sie k&ouml;nnen diese Anmeldung best&auml;tigen, in dem Sie <a href=\"{subscription_confirm_url}\"><strong>hier klicken</strong></a>.
23
- Wenn Sie nicht klicken k&ouml;nnen, nutzen Sie die folgenden URL in Ihren Browser ein:</p>
24
- <p>{subscription_confirm_url}</p>
25
- <p>Wenn die Anmeldung zu unserem Newsletter nicht von Ihnen stammt, ignorieren Sie diese Nachricht einfach.</p>
26
- <p>Vielen Dank.</p>";
27
-
28
-
29
- // Subscription confirmed text (after a user clicked the confirmation link
30
- // on the email he received
31
- $newsletter_default_options['confirmed_text'] =
32
- "<p>Ihre Anmeldung zu unserem Newsletter wurde best&auml;tigt!
33
- Herzlichen Dank!</p>";
34
-
35
- $newsletter_default_options['confirmed_subject'] =
36
- ",{blog_title} Newsletter - Willkommen";
37
-
38
- $newsletter_default_options['confirmed_message'] =
39
- "<p>
40
- Hallo {name}
41
- Willkommen zu unserem {blog_title} Newsletter.</p>
42
- <p>
43
- Wir werden Sie k�nftig regelm&auml;&szlig;ig &uuml;ber Neuigkeiten zu {blog_title} informieren</p>
44
- <p>
45
- Wenn Sie unseren newsletter nicht mehr erhalten m&ouml;chten, tragen Sie sich bitte unter dem folgenden Link aus dem Verteiler aus: <a href=\"{newsletter_url}\">austragen</a></p>
46
- <p>Besten Dank!</p>";
47
-
48
- // Unsubscription request introductory text
49
- $newsletter_default_options['unsubscription_text'] =
50
- "<p>Bitte best&auml;tigen Sie, dass Sie unseren Newsletter abbestellen, indem Sie
51
- <a href=\"{unsubscription_confirm_url}\">hier klicken</a>.";
52
-
53
- // When you finally loosed your subscriber
54
- $newsletter_default_options['unsubscribed_text'] =
55
- "<p>Herzlichen Dank, Sie wurden aus dem Verteiler entfernt...</p>";
56
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/en_US.php CHANGED
@@ -1,66 +1,118 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
- // Subscription form (traslate "your name", "your email" and the button "subscribe me")
4
- $newsletter_labels['subscription_form'] =
5
- '<form method="post" action="" style="text-align: center">
6
- <input type="hidden" name="na" value="s"/>
7
- <table cellspacing="3" cellpadding="3" border="0" width="50%">
8
- <tr><td>Your&nbsp;name</td><td><input type="text" name="nn" size="30"/></td></tr>
9
- <tr><td>Your&nbsp;email</td><td><input type="text" name="ne" size="30"/></td></tr>
10
- <tr><td colspan="2" style="text-align: center"><input type="submit" value="Subscribe me"/></td></tr>
11
- </table>
12
- </form>';
13
-
14
-
15
- $newsletter_labels['subscription_form_noname'] =
16
- '<form method="post" action="" style="text-align: center">
17
- <input type="hidden" name="na" value="s"/>
18
- <table cellspacing="3" cellpadding="3" border="0" width="50%">
19
- <tr><td>Your&nbsp;email</td><td><input type="text" name="ne" size="30"/></td></tr>
20
- <tr><td colspan="2" style="text-align: center"><input type="submit" value="Subscribe me"/></td></tr>
21
- </table>
22
- </form>';
23
-
24
- $newsletter_labels['widget_form'] =
25
- '<form action="{newsletter_url}" method="post">
26
- {text}
27
- <p><input type="text" name="nn" value="Your name" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/></p>
28
- <p><input type="text" name="ne" value="Your email" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/></p>
29
- <p><input type="submit" value="Subscribe"/></p>
30
- <input type="hidden" name="na" value="s"/>
31
- </form>';
32
-
33
-
34
- $newsletter_labels['widget_form_noname'] =
35
- '<form action="{newsletter_url}" method="post">
36
- {text}
37
- <p><input type="text" name="ne" value="Your email" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/></p>
38
- <p><input type="submit" value="Subscribe"/></p>
39
- <input type="hidden" name="na" value="s"/>
40
- </form>';
41
-
42
-
43
-
44
- $newsletter_labels['embedded_form'] =
45
- '<form action="{newsletter_url}" method="post">
46
- <p><input type="text" name="ne" value="Your email" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/>
47
- &nbsp;<input type="text" name="nn" value="Your name" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/>
48
- <input type="submit" value="Subscribe"/>
49
- <input type="hidden" name="na" value="s"/></p>
50
- </form>';
51
-
52
- // Example of embedded form without name
53
-
54
- $newsletter_labels['embedded_form_noname'] =
55
- '<form action="{newsletter_url}" method="post">
56
- <p><input type="text" name="ne" value="Your email" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/>
57
- <input type="submit" value="Subscribe"/>
58
- <input type="hidden" name="na" value="s"/></p>
59
- </form>';
60
-
61
-
62
- // Errors on subscription
63
- $newsletter_labels['error_email'] = 'Wrong email address. <a href="javascript:history.back()">Go back</a>.';
64
- $newsletter_labels['error_name'] = 'The name cannot be empty. <a href="javascript:history.back()">Go back</a>.';
65
-
66
- ?>
1
  <?php
2
+ // Those default options are used ONLY on FIRST setup and on plugin updates but limited to
3
+ // new options that may have been added between your and new version.
4
+ //
5
+ // This is the main language file, too, which is always loaded by Newsletter. Other language
6
+ // files are loaded according the WPLANG constant defined in wp-config.php file. Those language
7
+ // specific files are "merged" with this one and the language specific configuration
8
+ // keys override the ones in this file.
9
+ //
10
+ // Language specific files only need to override configurations containing texts
11
+ // language dependant.
12
+ //
13
+ // All language file are UTF-8 encoded!
14
+
15
+ $defaults_profile = array();
16
+ $defaults_profile['profile_text'] = '{profile_form}<p>If you want to cancel your subscription, <a href="{unsubscription_confirm_url}">click here</a></p>';
17
+ $defaults_profile['email'] = 'Email'; // Email field label
18
+ $defaults_profile['email_error'] = 'Your email seems wrong, check it please.';
19
+ $defaults_profile['name_status'] = 1;
20
+ $defaults_profile['name'] = 'Name';
21
+ $defaults_profile['name_error'] = 'Your name cannot be empty';
22
+ $defaults_profile['surname'] = 'Last Name';
23
+ $defaults_profile['surname_status'] = 0;
24
+ $defaults_profile['sex_status'] = 0;
25
+ $defaults_profile['sex'] = 'I\'m';
26
+ $defaults_profile['sex_male'] = 'Male';
27
+ $defaults_profile['sex_female'] = 'Female';
28
+ $defaults_profile['privacy_status'] = 0;
29
+ $defaults_profile['privacy'] = 'Subscribing you accept the privacy informative.';
30
+ $defaults_profile['privacy_error'] = 'You must accept the privacy informative to subscribe.';
31
+ $defaults_profile['subscribe'] = 'Subscribe now!';
32
+ $defaults_profile['save'] = 'Save'; // Profile "save" button
33
+
34
+ // Default values for main configuration
35
+ $sitename = strtolower($_SERVER['SERVER_NAME']);
36
+ if (substr($sitename, 0, 4) == 'www.') $sitename = substr($sitename, 4);
37
+
38
+ $defaults_main = array(
39
+ 'smtp_enabled'=>0,
40
+ 'return_path'=>'',
41
+ 'reply_to'=>'',
42
+ 'test_email_0'=>get_option('admin_email'),
43
+ 'test_name_0'=>'Subscriber',
44
+ 'sender_email'=>'newsletter@' . $sitename,
45
+ 'sender_name'=>get_option('blogname'),
46
+ 'theme'=>'page-1',
47
+ 'lock_message'=>'<div style="margin: 15px; padding: 15px; background-color: #ff9; border-color: 1px solid #000">
48
+ This content is protected, only newsletter subscribers can access it. Subscribe now!
49
+ [newsletter_form]
50
+ </div>'
51
+ );
52
+
53
+
54
+ // Default values for subscription panel (transaled on other language files)
55
+ $defaults = array();
56
+ // Subscription page introductory text (befor the subscription form)
57
+ $defaults['subscription_text'] =
58
+ "<p>Subscribe to my newsletter by filling the form below.
59
+ I'll try to make you happy.</p>
60
+ <p>A confirmation email will be sent to your mailbox:
61
+ please read the instructions to complete the subscription.</p>";
62
+
63
+ // Message show after a subbscription request has made.
64
+ $defaults['subscribed_text'] =
65
+ "<p>You successfully subscribed to my newsletter.
66
+ You'll receive in few minutes a confirmation email. Follow the link
67
+ in it to confirm the subscription. If the email takes more than 15
68
+ minutes to appear in your mailbox, check the spam folder.</p>";
69
+
70
+ // Confirmation email subject (double opt-in)
71
+ $defaults['confirmation_subject'] =
72
+ "Confirm now your subscription to {blog_title}";
73
+
74
+ // Confirmation email body (double opt-in)
75
+ $defaults['confirmation_message'] =
76
+ "<p>Hi {name},</p>
77
+ <p>I received a subscription request for this email address. You can confirm it
78
+ <a href=\"{subscription_confirm_url}\"><strong>clicking here</strong></a>.
79
+ If you cannot click the link, use the following link:</p>
80
+ <p>{subscription_confirm_url}</p>
81
+ <p>If this subscription request has not been made from you, just ignore this message.</p>
82
+ <p>Thank you.</p>";
83
+
84
+
85
+ // Subscription confirmed text (after a user clicked the confirmation link
86
+ // on the email he received
87
+ $defaults['confirmed_text'] =
88
+ "<p>Your subscription has been confirmed!
89
+ Thank you {name}!</p>";
90
+
91
+ $defaults['confirmed_subject'] =
92
+ "Welcome aboard, {name}";
93
+
94
+ $defaults['confirmed_message'] =
95
+ "<p>The message confirm your subscription to {blog_title} newsletter.</p>
96
+ <p>Thank you!</p>
97
+ <p>If you want to cancel your unsubscription, <a href=\"{unsubscription_url}\">click here</a>, if you want to change your
98
+ subscription data, <a href=\"{profile_url}\">click here</a>.</p>";
99
+
100
+ // Unsubscription request introductory text
101
+ $defaults['unsubscription_text'] =
102
+ "<p>Please confirm you want to unsubscribe my newsletter
103
+ <a href=\"{unsubscription_confirm_url}\">clicking here</a>.";
104
+
105
+ // When you finally loosed your subscriber
106
+ $defaults['unsubscribed_text'] =
107
+ "<p>That make me cry, but I have removed your subscription...</p>";
108
+
109
+ $defaults['unsubscribed_subject'] =
110
+ "Goodbye, {name}";
111
+
112
+ $defaults['unsubscribed_message'] =
113
+ "<p>The message confirm your unsubscription to {blog_title} newsletter.</p>
114
+ <p>Good bye!</p>";
115
+
116
+ $defaults['email_theme'] = '{message}'; // do not translate!
117
+
118
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/en_US_options.php DELETED
@@ -1,75 +0,0 @@
1
- <?php
2
- // This file contains the default options values
3
- $newsletter_default_options['from_email'] = get_option('admin_email');
4
- $newsletter_default_options['from_name'] = get_option('blogname');
5
-
6
-
7
-
8
- // Subscription page introductory text (befor the subscription form)
9
- $newsletter_default_options['subscription_text'] =
10
- "<p>Subscribe to my newsletter filling the form below.
11
- I'll try to make you happy.</p>
12
- <p>A confirmation email will be sent to your mailbox:
13
- please read the instruction inside it to complete the subscription.</p>";
14
-
15
- // Message show after a subbscription request has made.
16
- $newsletter_default_options['subscribed_text'] =
17
- "<p>You successfully subscribed to my newsletter.
18
- You'll receive in few minutes a confirmation email. Follow the link
19
- in it to confirm the subscription. If the email takes more than 15
20
- minutes to appear in your mailbox, check the spam folder.</p>";
21
-
22
- // Confirmation email subject (double opt-in)
23
- $newsletter_default_options['confirmation_subject'] =
24
- "{name}, confirm your subscription to {blog_title}";
25
-
26
- // Confirmation email body (double opt-in)
27
- $newsletter_default_options['confirmation_message'] =
28
- "<p>Hi {name},</p>
29
- <p>I received a subscription request for this email address. You can confirm it
30
- <a href=\"{subscription_confirm_url}\"><strong>clicking here</strong></a>.
31
- If you cannot click the link, use the following link:</p>
32
- <p>{subscription_confirm_url}</p>
33
- <p>If this subscription request has not been made from you, just ignore this message.</p>
34
- <p>Thank you.</p>";
35
-
36
-
37
- // Subscription confirmed text (after a user clicked the confirmation link
38
- // on the email he received
39
- $newsletter_default_options['confirmed_text'] =
40
- "<p>Your subscription has been confirmed!
41
- Thank you {name}!</p>";
42
-
43
- $newsletter_default_options['confirmed_subject'] =
44
- "Welcome aboard, {name}";
45
-
46
- $newsletter_default_options['confirmed_message'] =
47
- "<p>The message confirm your subscription to {blog_title} newsletter.</p>
48
- <p>Thank you!</p>";
49
-
50
- // Unsubscription request introductory text
51
- $newsletter_default_options['unsubscription_text'] =
52
- "<p>Please confirm you want to unsubscribe my newsletter
53
- <a href=\"{unsubscription_confirm_url}\">clicking here</a>.";
54
-
55
- // When you finally loosed your subscriber
56
- $newsletter_default_options['unsubscribed_text'] =
57
- "<p>That make me cry, but I have removed your subscription...</p>";
58
-
59
- $newsletter_default_options['unsubscribed_subject'] =
60
- "Goodbye, {name}";
61
-
62
- $newsletter_default_options['unsubscribed_message'] =
63
- "<p>The message confirm your unsubscription to {blog_title} newsletter.</p>
64
- <p>Good bye!</p>";
65
-
66
- $newsletter_default_options['subscription_form'] =
67
- '<form method="post" action="" style="text-align: center">
68
- <input type="hidden" name="na" value="s"/>
69
- <table cellspacing="3" cellpadding="3" border="0" width="50%">
70
- <tr><td>Your&nbsp;name</td><td><input type="text" name="nn" size="30"/></td></tr>
71
- <tr><td>Your&nbsp;email</td><td><input type="text" name="ne" size="30"/></td></tr>
72
- <tr><td colspan="2" style="text-align: center"><input type="submit" value="Subscribe me"/></td></tr>
73
- </table>
74
- </form>';
75
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/es_ES.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $defaults_profile = array();
4
+ $defaults_profile['email_error'] = 'Direccion de correo electronico incorrecta.';
5
+ $defaults_profile['name_error'] = 'El nombre no puede estar vacio.';
6
+
7
+ $defaults = array();
8
+ // Suscripcion pagina de introduccion de texto (formulario de suscripcion)
9
+ $defaults['subscription_text'] =
10
+ "<p>Suscribirse a mi boletín llenando el formulario a continuacion.
11
+ Voy a tratar de hacerte feliz.</p>
12
+ <p>Un correo de confirmacion será enviado a su buzon de correo:
13
+ por favor, lea las instrucciones en su interior para completar la suscripcion.</p>";
14
+
15
+ // Mostrar mensaje despues de una solicitud de suscripcion hecha.
16
+ $defaults['subscribed_text'] =
17
+ "<p>Con exito suscrito a mi boletín informativo.
18
+ Usted recibirá en pocos minutos un email de confirmacion. Siga el enlace
19
+ en el para confirmar la suscripcion. Si el correo tarda mas de 15
20
+ minutos en aparecer en su buzon de correo, revise la carpeta de spam.</p>";
21
+
22
+ // Tema de correo electronico de confirmacion (double opt-in)
23
+ $defaults['confirmation_subject'] =
24
+ "{name}, confirmar su suscripcion a {blog_title}";
25
+
26
+ // Cuerpo confirmacion por correo electronico (double opt-in)
27
+ $defaults['confirmation_message'] =
28
+ "<p>Hola {name},</p>
29
+ <p>He recibido una solicitud de suscripcion para esta direccion de correo electronico. Usted puede confirmar:
30
+ <a href=\"{subscription_confirm_url}\"><strong>click aquí</strong></a>.
31
+ Si usted no puede hacer click en el enlace, utilice el siguiente enlace:</p>
32
+ <p>{subscription_confirm_url}</p>
33
+ <p>Si esta solicitud de suscripcion no se ha hecho de usted, simplemente ignore este mensaje.</p>
34
+ <p>Gracias.</p>";
35
+
36
+
37
+ // Suscripcion confirmacion texto (despues de que un usuario hace clic en el enlace de confirmacion
38
+ // en el correo electronico que recibira
39
+ $defaults['confirmed_text'] =
40
+ "<p>Su suscripcion se ha confirmado!
41
+ Gracias {name}!</p>";
42
+
43
+ $defaults['confirmed_subject'] =
44
+ "Bienvenido a bordo, {name}";
45
+
46
+ $defaults['confirmed_message'] =
47
+ "<p>El mensaje de confirmar su suscripcion a {blog_title} newsletter.</p>
48
+ <p>Gracias!</p>";
49
+
50
+ // Darse de baja de la solicitud introduccion de texto
51
+ $defaults['unsubscription_text'] =
52
+ "<p>Por favor, confirme que desea darse de baja mi boletín de noticias
53
+ <a href=\"{unsubscription_confirm_url}\">click aquí</a>.";
54
+
55
+
56
+ $defaults['unsubscribed_text'] =
57
+ "<p>Me hace llorar, pero he quitado su suscripcion ...</p>";
58
+
59
+ $defaults['unsubscribed_subject'] =
60
+ "Adios, {name}";
61
+
62
+ $defaults['unsubscribed_message'] =
63
+ "<p>Mensaje de confirmacion de su baja en {blog_title} Boletín de noticias.</p>
64
+ <p>Adios!</p>";
65
+
66
+
languages/fr_FR.php CHANGED
@@ -1,35 +1,52 @@
1
  <?php
2
 
3
- // Subscription form (traslate "your name", "your email" and the button "subscribe me")
4
- $newsletter_labels['subscription_form'] =
5
- '<form method="post" action="" style="text-align: center">
6
- <input type="hidden" name="na" value="s"/>
7
- <table cellspacing="3" cellpadding="3" border="0" width="50%">
8
- <tr><td>Votre&nbsp;nom</td><td><input type="text" name="nn" size="30"/></td></tr>
9
- <tr><td>Votre&nbsp;e-mail</td><td><input type="text" name="ne" size="30"/></td></tr>
10
- <tr><td colspan="2" style="text-align: center"><input type="submit" value="Je m&prime;inscris"/></td></tr>
11
- </table>
12
- </form>';
13
-
14
- $newsletter_labels['widget_form'] =
15
- '<form action="{newsletter_url}" method="post">
16
- {text}
17
- <p><input type="text" name="nn" value="Votre nom" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/></p>
18
- <p><input type="text" name="ne" value="Votre e-mail" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/></p>
19
- <p><input type="submit" value="Je m&prime;inscris"/></p>
20
- <input type="hidden" name="na" value="s"/>
21
- </form>';
22
-
23
- $newsletter_labels['embedded_form'] =
24
- '<form action="{newsletter_url}" method="post">
25
- <p><input type="text" name="ne" value="Votre e-mail" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/>
26
- &nbsp;<input type="text" name="nn" value="Votre nom" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/>
27
- <input type="submit" value="Je m&prime;inscris"/>
28
- <input type="hidden" name="na" value="s"/></p>
29
- </form>';
30
-
31
- // Errors on subscription
32
- $newsletter_labels['error_email'] = 'E-mail incorrect. <a href="javascript:history.back()">Retour</a>.';
33
- $newsletter_labels['error_name'] = 'Merci d&prime;indiquer votre nom. <a href="javascript:history.back()">Retour</a>.';
34
-
35
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
 
3
+ $defaults_profile = array();
4
+ $defaults_profile['email_error'] = 'E-mail incorrect.';
5
+ $defaults_profile['name_error'] = 'Merci d&prime;indiquer votre nom.';
6
+
7
+ $defaults = array();
8
+ // Subscription page introductory text (befor the subscription form)
9
+ $defaults['subscription_text'] =
10
+ "<p>Abonnez-vous &agrave; la lettre d&prime;information {blog_title} en remplissants le formulaire ci-dessous.</p>
11
+ <p>Un e-mail de confirmation vous sera envoyé.</p>";
12
+
13
+ // Message show after a subbscription request has made.
14
+ $defaults['subscribed_text'] =
15
+ "<p>Votre demande d'inscription est enregistr&eacute;e. Merci ! Un e-mail de confirmation vous a été envoyé. V&eacute;rifier &eacute;galement votre dossier spam.</p>";
16
+
17
+ // Confirmation email subject (double opt-in)
18
+ $defaults['confirmation_subject'] =
19
+ "Inscription &agrave; la lettre d&prime;information {blog_title}";
20
+
21
+ // Confirmation email body (double opt-in)
22
+ $defaults['confirmation_message'] =
23
+ "<p>Bonjour {name}!</p>
24
+ <p>Vous recevez cet e-mail car nous avons enregistr&eacute; une demande d&prime;inscription &agrave; la lettre d&prime;infrmation {blog_title}.
25
+ Merci de confirmer votre inscription en cliquant sur le lien suivant : <a href=\"{subscription_confirm_url}\"><strong>je confirme mon inscription.</strong></a>.
26
+ Si le lien ne fonctionne pas, merci d'utiliser cette adresse :</p>
27
+ <p>{subscription_confirm_url}</p>
28
+ <p>Ignorez ce message si vous n'avez pas effectué de demande.</p>
29
+ <p>Merci !</p>";
30
+
31
+
32
+ // Subscription confirmed text (after a user clicked the confirmation link
33
+ // on the email he received
34
+ $defaults['confirmed_text'] =
35
+ "<p>Votre inscription est confirm&eacute;. Merci !</p>";
36
+
37
+ $defaults['confirmed_subject'] =
38
+ "Bienvenue, {name}";
39
+
40
+ $defaults['confirmed_message'] =
41
+ "<p>Votre inscription est confirm&eacute;. Merci !</p>";
42
+
43
+ // Unsubscription request introductory text
44
+ $defaults['unsubscription_text'] =
45
+ "<p>&Ecirc;tes-vous certain de vouloir vous d&eacute;sinscrire de la lettre d&prime;information {blog_title} ? <a href=\"{unsubscription_confirm_url}\">Oui</a>.";
46
+
47
+ // When you finally loosed your subscriber
48
+ $defaults['unsubscribed_text'] =
49
+ "<p>Vous n&prime;&ecirc;tes plus abonn&eacute; &agrave; la lettre d'information {blog_title}. Merci de nous avoir suivi et &agrave; bient&ocirc;t !</p>";
50
+
51
+
52
+
languages/fr_FR_options.php DELETED
@@ -1,46 +0,0 @@
1
- <?php
2
- // This file contains the default options values
3
-
4
- // Subscription page introductory text (befor the subscription form)
5
- $newsletter_default_options['subscription_text'] =
6
- "<p>Abonnez-vous &agrave; la lettre d&prime;information {blog_title} en remplissants le formulaire ci-dessous.</p>
7
- <p>Un e-mail de confirmation vous sera envoyé.</p>";
8
-
9
- // Message show after a subbscription request has made.
10
- $newsletter_default_options['subscribed_text'] =
11
- "<p>Votre demande d'inscription est enregistr&eacute;e. Merci ! Un e-mail de confirmation vous a été envoyé. V&eacute;rifier &eacute;galement votre dossier spam.</p>";
12
-
13
- // Confirmation email subject (double opt-in)
14
- $newsletter_default_options['confirmation_subject'] =
15
- "Inscription &agrave; la lettre d&prime;information {blog_title}";
16
-
17
- // Confirmation email body (double opt-in)
18
- $newsletter_default_options['confirmation_message'] =
19
- "<p>Bonjour {name}!</p>
20
- <p>Vous recevez cet e-mail car nous avons enregistr&eacute; une demande d&prime;inscription &agrave; la lettre d&prime;infrmation {blog_title}.
21
- Merci de confirmer votre inscription en cliquant sur le lien suivant : <a href=\"{subscription_confirm_url}\"><strong>je confirme mon inscription.</strong></a>.
22
- Si le lien ne fonctionne pas, merci d'utiliser cette adresse :</p>
23
- <p>{subscription_confirm_url}</p>
24
- <p>Ignorez ce message si vous n'avez pas effectué de demande.</p>
25
- <p>Merci !</p>";
26
-
27
-
28
- // Subscription confirmed text (after a user clicked the confirmation link
29
- // on the email he received
30
- $newsletter_default_options['confirmed_text'] =
31
- "<p>Votre inscription est confirm&eacute;. Merci !</p>";
32
-
33
- $newsletter_default_options['confirmed_subject'] =
34
- "Bienvenue, {name}";
35
-
36
- $newsletter_default_options['confirmed_message'] =
37
- "<p>Votre inscription est confirm&eacute;. Merci !</p>";
38
-
39
- // Unsubscription request introductory text
40
- $newsletter_default_options['unsubscription_text'] =
41
- "<p>&Ecirc;tes-vous certain de vouloir vous d&eacute;sinscrire de la lettre d&prime;information {blog_title} ? <a href=\"{unsubscription_confirm_url}\">Oui</a>.";
42
-
43
- // When you finally loosed your subscriber
44
- $newsletter_default_options['unsubscribed_text'] =
45
- "<p>Vous n&prime;&ecirc;tes plus abonn&eacute; &agrave; la lettre d'information {blog_title}. Merci de nous avoir suivi et &agrave; bient&ocirc;t !</p>";
46
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/it_IT.php CHANGED
@@ -1,58 +1,72 @@
1
  <?php
2
 
3
- $newsletter_labels['subscription_form'] =
4
- '<form method="post" action="" style="text-align: center">
5
- <input type="hidden" name="na" value="s"/>
6
- <table cellspacing="3" cellpadding="3" border="0" width="50%">
7
- <tr><td>Il&nbsp;tuo&nbsp;nome</td><td><input type="text" name="nn" size="30"/></td></tr>
8
- <tr><td>La&nbsp;tua&nbsp;email</td><td><input type="text" name="ne" size="30"/></td></tr>
9
- <tr><td colspan="2" style="text-align: center"><input type="submit" value="Iscrivimi!"/></td></tr>
10
- </table>
11
- </form>';
12
-
13
- $newsletter_labels['subscription_form_noname'] =
14
- '<form method="post" action="" style="text-align: center">
15
- <input type="hidden" name="na" value="s"/>
16
- <table cellspacing="3" cellpadding="3" border="0" width="50%">
17
- <tr><td>La&nbsp;tua&nbsp;email</td><td><input type="text" name="ne" size="30"/></td></tr>
18
- <tr><td colspan="2" style="text-align: center"><input type="submit" value="Iscrivimi!"/></td></tr>
19
- </table>
20
- </form>';
21
-
22
- $newsletter_labels['widget_form'] =
23
- '<form action="{newsletter_url}" method="post">
24
- {text}
25
- <p><input type="text" name="nn" value="Il tuo nome" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/></p>
26
- <p><input type="text" name="ne" value="La tua email" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/></p>
27
- <p><input type="submit" value="Iscrivimi"/></p>
28
- <input type="hidden" name="na" value="s"/>
29
- </form>';
30
-
31
- $newsletter_labels['widget_form_noname'] =
32
- '<form action="{newsletter_url}" method="post">
33
- {text}
34
- <p><input type="text" name="ne" value="La tua email" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/></p>
35
- <p><input type="submit" value="Iscrivimi"/></p>
36
- <input type="hidden" name="na" value="s"/>
37
- </form>';
38
-
39
  // Errors on subscription
40
- $newsletter_labels['error_email'] = 'L\'indirizzo email non è corretto. <a href="javascript:history.back()">Torna indietro</a>.';
41
- $newsletter_labels['error_name'] = 'Il nome non è tato inserito. <a href="javascript:history.back()">Torna indietro</a>.';
42
-
43
- $newsletter_labels['embedded_form'] =
44
- '<form action="{newsletter_url}" method="post">
45
- <p><input type="text" name="ne" value="La tua email" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/>
46
- &nbsp;<input type="text" name="nn" value="Il tuo nome" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/>
47
- <input type="submit" value="Conferma"/>
48
- <input type="hidden" name="na" value="s"/></p>
49
- </form>';
50
-
51
- $newsletter_labels['embedded_form_noname'] =
52
- '<form action="{newsletter_url}" method="post">
53
- <p><input type="text" name="ne" value="La tua email" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/>
54
- <input type="submit" value="Iscrivimi"/>
55
- <input type="hidden" name="na" value="s"/></p>
56
- </form>';
57
-
58
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  // Errors on subscription
4
+ $defaults_profile = array();
5
+ $defaults_profile['email_error'] = 'L\'indirizzo email non è corretto.';
6
+ $defaults_profile['error_name'] = 'Il nome non è stato inserito.';
7
+
8
+ $defaults_profile['profile_text'] = '{profile_form}<p>Se vuoi eliminare la tua iscrizione <a href="{unsubscription_confirm_url}">clicca qui</a></p>';
9
+ $defaults_profile['email'] = 'Email'; // Email field label
10
+ $defaults_profile['email_error'] = 'L\'indirizzo email non è corretto';
11
+ $defaults_profile['name_status'] = 1;
12
+ $defaults_profile['name'] = 'Nome';
13
+ $defaults_profile['name_error'] = 'Il nome non può essere vuoto';
14
+ $defaults_profile['surname'] = 'Cognome';
15
+ $defaults_profile['surname_status'] = 0;
16
+ $defaults_profile['sex_status'] = 0;
17
+ $defaults_profile['sex'] = 'I\'m';
18
+ $defaults_profile['sex_male'] = 'Maschio';
19
+ $defaults_profile['sex_female'] = 'Femmina';
20
+ $defaults_profile['privacy_status'] = 0;
21
+ $defaults_profile['privacy'] = 'Accetto l\'informativa sulla privacy.';
22
+ $defaults_profile['privacy_error'] = 'Devi accettare l\'informativa sulla privacy per iscriverti.';
23
+ $defaults_profile['subscribe'] = 'Procedi';
24
+ $defaults_profile['save'] = 'Salva'; // Profile "save" button
25
+
26
+
27
+ $defaults = array();
28
+ // Subscription page introductory text
29
+ $defaults['subscription_text'] =
30
+ "<p>Per iscriversi alla newsletter, lascia nome ed email qui sotto:
31
+ riceverai una email con la quale potrai confermare l'iscrizione.</p>";
32
+
33
+ // Subscription registration message
34
+ $defaults['subscribed_text'] =
35
+ "<p>L'iscrizione è quasi completa: controlla la tua
36
+ casella di posta, c'è un messaggio per te con il quale confermare l'iscrizione.</p>";
37
+
38
+ // Confirmation email (double opt-in)
39
+ $defaults['confirmation_subject'] =
40
+ "{name}, conferma l'iscrizione alle newsletter di {blog_title}";
41
+
42
+ $defaults['confirmation_message'] =
43
+ "<p>Ciao {name},</p>
44
+ <p>hai richiesto l'iscrizione alla newsletter di {blog_title}.
45
+ Conferma l'iscrizione <a href=\"{subscription_confirm_url}\"><strong>cliccando qui</strong></a>
46
+ oppure copia il link qui sotto nel tu programma di navigazione:</p>
47
+ <p>{subscription_confirm_url}</p>
48
+ <p>Grazie!</p>";
49
+
50
+ $defaults['confirmed_subject'] =
51
+ "Benvenuto {name}!";
52
+
53
+ $defaults['confirmed_message'] =
54
+ "<p>Con questo messaggio ti confermo l'iscrizione alla newsletter.</p>
55
+ <p>Grazie!</p>";
56
+
57
+ // Subscription confirmed text
58
+ $defaults['confirmed_text'] =
59
+ "<p>{name}, la tua iscrizione è stata confermata.
60
+ Buona lettura!</p>";
61
+
62
+
63
+ $defaults['unsubscription_text'] =
64
+ "<p>{name}, vuoi eliminare la tua iscrizione?
65
+ Se sì... mi dispace, ma non ti trattengo oltre:</p>
66
+ <p><a href=\"{unsubscription_confirm_url}\">Sì, voglio eliminare la mia iscrizione per sempre</a>.</p>";
67
+
68
+ $defaults['unsubscribed_text'] =
69
+ "<p>La tua iscrizione è stata definitivamente eliminata.</p>";
70
+
71
+
72
+
languages/it_IT_options.php DELETED
@@ -1,45 +0,0 @@
1
- <?php
2
-
3
- // Subscription page introductory text
4
- $newsletter_default_options['subscription_text'] =
5
- "<p>Per iscriversi alla newsletter, lascia nome ed email qui sotto:
6
- riceverai una email con la quale potrai confermare l'iscrizione.</p>";
7
-
8
- // Subscription registration message
9
- $newsletter_default_options['subscribed_text'] =
10
- "<p>L'iscrizione è quasi completa: controlla la tua
11
- casella di posta, c'è un messaggio per te con il quale confermare l'iscrizione.</p>";
12
-
13
- // Confirmation email (double opt-in)
14
- $newsletter_default_options['confirmation_subject'] =
15
- "{name}, conferma l'iscrizione alle newsletter di {blog_title}";
16
-
17
- $newsletter_default_options['confirmation_message'] =
18
- "<p>Ciao {name},</p>
19
- <p>hai richiesto l'iscrizione alla newsletter di {blog_title}.
20
- Conferma l'iscrizione <a href=\"{subscription_confirm_url}\"><strong>cliccando qui</strong></a>
21
- oppure copia il link qui sotto nel tu programma di navigazione:</p>
22
- <p>{subscription_confirm_url}</p>
23
- <p>Grazie!</p>";
24
-
25
- $newsletter_default_options['confirmed_subject'] =
26
- "Benvenuto {name}!";
27
-
28
- $newsletter_default_options['confirmed_message'] =
29
- "<p>Con questo messaggio ti confermo l'iscrizione alla newsletter.</p>
30
- <p>Grazie!</p>";
31
-
32
- // Subscription confirmed text
33
- $newsletter_default_options['confirmed_text'] =
34
- "<p>{name}, la tua iscrizione è stata confermata.
35
- Buona lettura!</p>";
36
-
37
-
38
- $newsletter_default_options['unsubscription_text'] =
39
- "<p>{name}, vuoi eliminare la tua iscrizione?
40
- Se sì... mi dispace, ma non ti trattengo oltre:</p>
41
- <p><a href=\"{unsubscription_confirm_url}\">Sì, voglio eliminare la mia iscrizione per sempre</a>.</p>";
42
-
43
- $newsletter_default_options['unsubscribed_text'] =
44
- "<p>La tua iscrizione è stata definitivamente eliminata.</p>";
45
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/newsletter-1.5.2.pot DELETED
@@ -1,419 +0,0 @@
1
- # Translation of the WordPress plugin by .
2
- # Copyright (C) 2010
3
- # This file is distributed under the same license as the package.
4
- # FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
5
- #
6
- #, fuzzy
7
- msgid ""
8
- msgstr ""
9
- "Project-Id-Version: \n"
10
- "Report-Msgid-Bugs-To: http://wordpress.org/tag/newsletter\n"
11
- "POT-Creation-Date: 2010-03-03 13:44+0000\n"
12
- "PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n"
13
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
- "Language-Team: LANGUAGE <LL@li.org>\n"
15
- "MIME-Version: 1.0\n"
16
- "Content-Type: text/plain; charset=utf-8\n"
17
- "Content-Transfer-Encoding: 8bit\n"
18
-
19
- #: export.php:7
20
- msgid "Newsletter Export"
21
- msgstr ""
22
-
23
- #: feed.php:6
24
- msgid "Newsletter feed by mail"
25
- msgstr ""
26
-
27
- #: import.php:38
28
- msgid "Newsletter Import"
29
- msgstr ""
30
-
31
- #: import.php:44
32
- msgid "Rows with errors"
33
- msgstr ""
34
-
35
- #: import.php:53
36
- msgid "CSV text with subscribers"
37
- msgstr ""
38
-
39
- #: import.php:57
40
- msgid "Import"
41
- msgstr ""
42
-
43
- #: main.php:18
44
- msgid "Newsletter Configuration"
45
- msgstr ""
46
-
47
- #: main.php:26
48
- msgid "General parameters"
49
- msgstr ""
50
-
51
- #: main.php:29
52
- msgid "Enable access to editors?"
53
- msgstr ""
54
-
55
- #: main.php:35
56
- msgid "Always show panels in english?"
57
- msgstr ""
58
-
59
- #: main.php:39
60
- msgid ""
61
- "The author does NOT mainatin translations, so if you have a doubt about some "
62
- "texts, disable the translations"
63
- msgstr ""
64
-
65
- #: main.php:43
66
- msgid "Logging"
67
- msgstr ""
68
-
69
- #: main.php:47
70
- msgid "Debug level saves user data on file system, use only to debug problems."
71
- msgstr ""
72
-
73
- #: main.php:52 newsletter.php:412 options.php:105 options.php:141
74
- #: options.php:174 options.php:226 options.php:272 options.php:288
75
- msgid "Save"
76
- msgstr ""
77
-
78
- #: manage.php:82
79
- msgid "Resend the subscription confirmation email?"
80
- msgstr ""
81
-
82
- #: manage.php:91
83
- msgid "Newsletter Subscribers"
84
- msgstr ""
85
-
86
- #: manage.php:104 manage.php:107
87
- msgid "Search"
88
- msgstr ""
89
-
90
- #: manage.php:109
91
- msgid ""
92
- "Press without filter to show all. Max 100 results will be shown. Use export "
93
- "panel to get all subscribers."
94
- msgstr ""
95
-
96
- #: manage.php:116
97
- msgid "Only not yet confirmed"
98
- msgstr ""
99
-
100
- #: manage.php:120
101
- msgid "Order"
102
- msgstr ""
103
-
104
- #: manage.php:162
105
- msgid "Remove all unconfirmed"
106
- msgstr ""
107
-
108
- #: manage.php:162
109
- msgid "Are your sure, really sure?"
110
- msgstr ""
111
-
112
- #: manage.php:168
113
- msgid "Subscriber's statistics"
114
- msgstr ""
115
-
116
- #: manage.php:169
117
- msgid "Confirmed subscriber"
118
- msgstr ""
119
-
120
- #: manage.php:171
121
- msgid "Unconfirmed subscriber"
122
- msgstr ""
123
-
124
- #: manage.php:173
125
- msgid "Results"
126
- msgstr ""
127
-
128
- #: manage.php:178
129
- msgid "Email"
130
- msgstr ""
131
-
132
- #: manage.php:178
133
- msgid "Name"
134
- msgstr ""
135
-
136
- #: manage.php:178
137
- msgid "Status"
138
- msgstr ""
139
-
140
- #: manage.php:178
141
- msgid "Actions"
142
- msgstr ""
143
-
144
- #: manage.php:178
145
- msgid "Profile"
146
- msgstr ""
147
-
148
- #: manage.php:186
149
- msgid "edit"
150
- msgstr ""
151
-
152
- #: manage.php:187
153
- msgid "remove"
154
- msgstr ""
155
-
156
- #: manage.php:188
157
- msgid "confirm"
158
- msgstr ""
159
-
160
- #: manage.php:189
161
- msgid "unconfirm"
162
- msgstr ""
163
-
164
- #: manage.php:190
165
- msgid "resend confirmation"
166
- msgstr ""
167
-
168
- #: newsletter.php:297
169
- msgid "Tags: <strong>{name}</strong> receiver name."
170
- msgstr ""
171
-
172
- #: newsletter.php:309
173
- msgid ""
174
- "Tags: <strong>{name}</strong> receiver name;\r\n"
175
- "<strong>{unsubscription_url}</strong> unsubscription URL;\r\n"
176
- "<strong>{token}</strong> the subscriber token."
177
- msgstr ""
178
-
179
- #: newsletter.php:397
180
- msgid ""
181
- "When you simulate a sending process, emails are really sent but all to this"
182
- "\r\n"
183
- "email address. That helps to test out problems with mail server."
184
- msgstr ""
185
-
186
- #: newsletter.php:406
187
- msgid ""
188
- "Force the return path to this email address. Return path is used from mail "
189
- "server to\r\n"
190
- "send back messages with delivery errors."
191
- msgstr ""
192
-
193
- #: options.php:35
194
- msgid "Newsletter Subscription and Unsubscription"
195
- msgstr ""
196
-
197
- #: options.php:42
198
- msgid "Sender and subscription page"
199
- msgstr ""
200
-
201
- #: options.php:44
202
- msgid "<p><strong>It's REQUIRED to complete such configuration.</strong></p>"
203
- msgstr ""
204
-
205
- #: options.php:48
206
- msgid "Sender email"
207
- msgstr ""
208
-
209
- #: options.php:52
210
- msgid ""
211
- "Newsletter sender email address: the address subscribers will see the "
212
- "newsletters coming from."
213
- msgstr ""
214
-
215
- #: options.php:56
216
- msgid "Sender name"
217
- msgstr ""
218
-
219
- #: options.php:60
220
- msgid ""
221
- "The name of the newsletter sender subscribers will see on incoming email."
222
- msgstr ""
223
-
224
- #: options.php:64
225
- msgid "Subscription page URL"
226
- msgstr ""
227
-
228
- #: options.php:68
229
- msgid ""
230
- "This is the page where you placed the <strong>[newsletter]</strong> short "
231
- "tag. (<a href=\"http://www.satollo.net/plugins/newsletter\">Read more on "
232
- "plugin official page</a>)"
233
- msgstr ""
234
-
235
- #: options.php:73
236
- msgid "Theme to use for emails"
237
- msgstr ""
238
-
239
- #: options.php:100
240
- msgid ""
241
- "Selected theme has to be one with {message} tag inside, tag that will be "
242
- "replaced with messages. Use the blank theme to send messages as you see them "
243
- "in the editor."
244
- msgstr ""
245
-
246
- #: options.php:111
247
- msgid "Subscription"
248
- msgstr ""
249
-
250
- #: options.php:116
251
- msgid "Do not ask the user name, only email."
252
- msgstr ""
253
-
254
- #: options.php:120
255
- msgid "Subscription form page"
256
- msgstr ""
257
-
258
- #: options.php:124
259
- msgid ""
260
- "This is the text showed to subscriber before the subscription form which is "
261
- "added automatically."
262
- msgstr ""
263
-
264
- #: options.php:128
265
- msgid "Successfully subscription page"
266
- msgstr ""
267
-
268
- #: options.php:132
269
- msgid ""
270
- "This is the text showed to a user who has pressed \"subscribe me\" on the "
271
- "previous\r\n"
272
- "step informing that an email to confirm subscription has just been sent. "
273
- "Remeber\r\n"
274
- "the user to check the spam folder and to follow the email instructions.<br />"
275
- "\r\n"
276
- "Tags: <strong>{name}</strong> the user name; <strong>{email}</strong> the "
277
- "user email."
278
- msgstr ""
279
-
280
- #: options.php:146
281
- msgid "Confirmation (double opt-in)"
282
- msgstr ""
283
-
284
- #: options.php:148
285
- msgid ""
286
- "<p>Email sent to the user to confirm his subscription, the successful "
287
- "confirmation\r\n"
288
- "page, the welcome email.</p>"
289
- msgstr ""
290
-
291
- #: options.php:155
292
- msgid ""
293
- "Do not use double opt-in. If checked the subscription is direct, so "
294
- "subscribers will be immediately confirmed and will receive the welcome email."
295
- msgstr ""
296
-
297
- #: options.php:161
298
- msgid "Confirmation email"
299
- msgstr ""
300
-
301
- #: options.php:165
302
- msgid ""
303
- "Tags: <strong>{name}</strong> the user name; <strong>"
304
- "{subscription_confirm_url}</strong>\r\n"
305
- "confirmation URL to be clicked by the user to confirm his subscription;\r\n"
306
- "<strong>{unsubscription_url}</strong> the unsubscription link"
307
- msgstr ""
308
-
309
- #: options.php:179 options.php:184
310
- msgid "Welcome message"
311
- msgstr ""
312
-
313
- #: options.php:180
314
- msgid ""
315
- "<p>Users jump directly to this step if you disabled the double opt-in step.</"
316
- "p>"
317
- msgstr ""
318
-
319
- #: options.php:188
320
- msgid ""
321
- "Showed when the user follow the confirmation URL sent to him with previous "
322
- "email\r\n"
323
- "settings or if signed up directly with no double opt-in process.\r\n"
324
- "<br />\r\n"
325
- "Tags: <strong>{name}</strong> the user name; <strong>{email}</strong> for the"
326
- "\r\n"
327
- "user email; <strong>{token}</strong> the subscriber unique token"
328
- msgstr ""
329
-
330
- #: options.php:197
331
- msgid "Conversion tracking code"
332
- msgstr ""
333
-
334
- #: options.php:201
335
- msgid "<strong>Works only with Newsletter Extras installed</strong>"
336
- msgstr ""
337
-
338
- #: options.php:203
339
- msgid ""
340
- "The code is injected AS-IS in welcome page and can be used to track "
341
- "conversion\r\n"
342
- "(you can use PHP if needed). Conversion code is usually supply by tracking "
343
- "services,\r\n"
344
- "like Google AdWords, Google Analytics and so on."
345
- msgstr ""
346
-
347
- #: options.php:212
348
- msgid ""
349
- "Welcome email<br /><small>The right place where to put bonus content link</"
350
- "small>"
351
- msgstr ""
352
-
353
- #: options.php:217
354
- msgid ""
355
- "Tags: <strong>{id}</strong> user id; <strong>{name}</strong> user name;\r\n"
356
- "<strong>{token}</strong> the subscriber unique token; <strong>"
357
- "{unsubscription_url}</strong>\r\n"
358
- "unsubscription link"
359
- msgstr ""
360
-
361
- #: options.php:231
362
- msgid "Unsubscription"
363
- msgstr ""
364
-
365
- #: options.php:232
366
- msgid ""
367
- "<p>A user starts the unsubscription process clicking the unsubscription link "
368
- "in\r\n"
369
- "a newsletter. This link contains the email to unsubscribe and some unique "
370
- "information\r\n"
371
- "to avoid hacking. The user are requird to confirm the unsubscription: this "
372
- "is the last\r\n"
373
- "step where YOU can communicate with you almost missed user.</p>"
374
- msgstr ""
375
-
376
- #: options.php:239
377
- msgid "Unsubscription message"
378
- msgstr ""
379
-
380
- #: options.php:243
381
- msgid ""
382
- "This text is show to users who click on a \"unsubscription link\" in a "
383
- "newsletter\r\n"
384
- "email. You have to insert a link in the text that user can follow to confirm "
385
- "the\r\n"
386
- "unsubscription request (see tags).\r\n"
387
- "<br />\r\n"
388
- "Tags: <strong>{name}</strong> user name; <strong>{email}</strong> user email;"
389
- "\r\n"
390
- "<strong>{unsubscription_confirm_url}</strong> URL to confirm unsubscription."
391
- msgstr ""
392
-
393
- #: options.php:254
394
- msgid "Goodbye message"
395
- msgstr ""
396
-
397
- #: options.php:262
398
- msgid "Goodbye email"
399
- msgstr ""
400
-
401
- #: options.php:266
402
- msgid "Tags: <strong>{name}</strong> user name."
403
- msgstr ""
404
-
405
- #: options.php:277
406
- msgid "Advanced"
407
- msgstr ""
408
-
409
- #: options.php:281
410
- msgid "Disable visual editors?"
411
- msgstr ""
412
-
413
- #: smtp.php:7
414
- msgid "Newsletter SMTP"
415
- msgstr ""
416
-
417
- #: statistics.php:7
418
- msgid "Newsletter Statistics"
419
- msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/newsletter-ru_RU.mo DELETED
Binary file
languages/newsletter-ru_RU.po DELETED
@@ -1,784 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: Russian Lang for Newsletter\n"
4
- "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2010-01-22 20:58+0300\n"
6
- "PO-Revision-Date: \n"
7
- "Last-Translator: M.O.Z.G <mozg@mozg-studio.org>\n"
8
- "Language-Team: M.O.Z.G Studio | http://mozg-studio.org <mozg@mozg-studio.org>\n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "X-Poedit-Language: Russian\n"
13
- "X-Poedit-Country: RUSSIAN FEDERATION\n"
14
- "X-Poedit-SourceCharset: utf-8\n"
15
- "X-Poedit-KeywordsList: _e;__;_c;_n\n"
16
- "X-Poedit-Basepath: ..\n"
17
- "X-Poedit-SearchPath-0: .\n"
18
-
19
- #: export.php:8
20
- msgid "Subscribers Export"
21
- msgstr "Экспорт подписчиков"
22
-
23
- #: export.php:10
24
- msgid "The text below is a list of all your subscribers (confirmed and not) in cvs format. You can copy, save and edit it with Excel or other software. Status column has 2 values: S - subscribed but not confirmed, C - confirmed."
25
- msgstr "Приведенный ниже текст представляет собой список всех Ваших подписчиков (подтвержденных и нет) в CVS формате. Вы можете скопировать, сохранить и редактировать их в MS Excel или другом приложении.<br>Статус колонок имеет 2 значения: S - подписчик не подтвержден, C - подтвержден."
26
-
27
- #: export.php:12
28
- #: manage.php:148
29
- msgid "Email"
30
- msgstr "Email"
31
-
32
- #: export.php:12
33
- #: manage.php:148
34
- msgid "Name"
35
- msgstr "Имя"
36
-
37
- #: export.php:12
38
- #: manage.php:148
39
- msgid "Status"
40
- msgstr "Статус"
41
-
42
- #: export.php:12
43
- #: manage.php:148
44
- msgid "Token"
45
- msgstr "Ключ"
46
-
47
- #: import.php:34
48
- msgid "Subscribers Import"
49
- msgstr "Импорт подписчиков"
50
-
51
- #: import.php:40
52
- msgid "Rows with errors"
53
- msgstr "Строк с ошибками"
54
-
55
- #: import.php:47
56
- #: import.php:54
57
- #: plugin.php:934
58
- msgid "Import"
59
- msgstr "Импорт"
60
-
61
- #: import.php:48
62
- msgid "On the textarea below you can copy a text in CSV (comma separated values) with format:<br /><br /> <pre>user email;user name</pre><br /><br />and then import them. If an email is already stored, it won't be imported. If an email is wrong it won't be imported. Even when there are errors on CSV lines, the import will continue to the end. After the import process has ended, a box will appear with all the line not imported due to duplications or errors. Imported subscriber will be set as confirmed."
63
- msgstr "В текстовоt поле ниже Вы можете cкопировать текст CSV (Сomma Separated Values) в формате:<br /><br /><pre>email пользователя;имя пользователя</pre><br /><br />а затем импортировать его. Если адреса уже занесены в базу, они не будут импортированы. Если адреса записаны с ошибка, они не будут импортированы. Даже при наличии ошибок в строках CSV, импорт будет продолжаться до конца. После завершения процесса Вам будет показано окно со всеми строками, которые не были импортированы. Испортированые подписчики автоматический станут подтвержденными."
64
-
65
- #: import.php:50
66
- msgid "Empty rows and rows staring with sharp (#) are skipped. Emails will be normalized and a subscriber token generated for each imported email."
67
- msgstr "Пустые строки и строки содержащие символ решетки (#) будут пропущены. Адреса электронной почты будут форматированы, а пользователям назначен уникальный бинарный код на каждый e-mail."
68
-
69
- #: manage.php:95
70
- #: manage_.php:70
71
- msgid "Subscribers Management"
72
- msgstr "Управление подписчиками"
73
-
74
- #: manage.php:106
75
- #: manage.php:109
76
- #: manage_.php:81
77
- #: manage_.php:84
78
- msgid "Search"
79
- msgstr "Поиск"
80
-
81
- #: manage.php:109
82
- #: manage_.php:84
83
- msgid "press without filter to show all"
84
- msgstr "оставьте поле пустым, если хотите посмотреть всех подписчиков"
85
-
86
- #: manage.php:116
87
- #: manage_.php:91
88
- msgid "Only not yet confirmed"
89
- msgstr "Только не подвержденные"
90
-
91
- #: manage.php:120
92
- msgid "Order"
93
- msgstr "Порядок"
94
-
95
- #: manage.php:134
96
- #: manage_.php:109
97
- msgid "Remove all unconfirmed"
98
- msgstr "Удалить всех не подтвержденных"
99
-
100
- #: manage.php:134
101
- #: manage_.php:109
102
- msgid "Are your sure, really sure?"
103
- msgstr "Вы уверены?"
104
-
105
- #: manage.php:138
106
- #: manage_.php:113
107
- msgid "Subscriber's statistics"
108
- msgstr "Статистика подписчиков"
109
-
110
- #: manage.php:139
111
- #: manage_.php:114
112
- msgid "Confirmed subscriber"
113
- msgstr "Подтвержденный подписчик"
114
-
115
- #: manage.php:141
116
- #: manage_.php:116
117
- msgid "Unconfirmed subscriber"
118
- msgstr "Не подтвержденный подписчик"
119
-
120
- #: manage.php:143
121
- #: manage_.php:118
122
- msgid "Results"
123
- msgstr "Результат"
124
-
125
- #: manage.php:148
126
- msgid "Profile"
127
- msgstr "Профиль"
128
-
129
- #: manage.php:148
130
- msgid "Actions"
131
- msgstr "Действия"
132
-
133
- #: manage.php:166
134
- msgid "remove"
135
- msgstr "удалить"
136
-
137
- #: manage.php:167
138
- msgid "confirm"
139
- msgstr "подтвердить"
140
-
141
- #: manage.php:168
142
- msgid "unconfirm"
143
- msgstr "убрать подтверждение"
144
-
145
- #: manage.php:169
146
- msgid "resend confirmation"
147
- msgstr "переслать подтверждающее письмо"
148
-
149
- #: manage_.php:76
150
- msgid "search"
151
- msgstr "поиск"
152
-
153
- #: newsletter.php:79
154
- msgid "Newsletter Composer"
155
- msgstr "Компановщик рассылки"
156
-
157
- #: newsletter.php:89
158
- msgid "Continuing with previous batch"
159
- msgstr "Продолжить с предыдущим пакетом"
160
-
161
- #: newsletter.php:95
162
- #: newsletter.php:113
163
- #: newsletter.php:130
164
- msgid "Batch not completed, see more below."
165
- msgstr "Пакетная отправка не завершена, смотрите подробности ниже."
166
-
167
- #: newsletter.php:104
168
- msgid "Simulation"
169
- msgstr "Имитация"
170
-
171
- #: newsletter.php:123
172
- msgid "Sending"
173
- msgstr "Отправка"
174
-
175
- #: newsletter.php:140
176
- msgid "Sending to test subscribers"
177
- msgstr "Отправка тестовым подписчикам"
178
-
179
- #: newsletter.php:160
180
- msgid "Last batch info"
181
- msgstr "Информация о последней пакетной отправке."
182
-
183
- #: newsletter.php:161
184
- msgid "Here you find information about last batch. A sending batch may have completed or not and may be a simulation or not. When a batch is not complete you can use the \"restart\" button and the batch starts again from the last email address processed."
185
- msgstr "Здесь вы найдете информацию о последней пакетной отправке. Пакетная отправка может быть завершена или нет, и может быть имитацией или нет. Когда пакетная отправка не закончена, вы можете нажать кнопку \"Перезапуск\" и отправка продолжится с последнего адреса в процессе."
186
-
187
- #: newsletter.php:166
188
- msgid "No batch info found, it's ok!"
189
- msgstr "Нет информации о последней пакетной отправке, это нормально!"
190
-
191
- #: newsletter.php:172
192
- msgid "Total emails to send"
193
- msgstr "Всего адресов для отправки"
194
-
195
- #: newsletter.php:176
196
- msgid "Emails sent till now"
197
- msgstr "Сейчас отправлено"
198
-
199
- #: newsletter.php:181
200
- #: options.php:353
201
- msgid "List"
202
- msgstr "Список"
203
-
204
- #: newsletter.php:186
205
- msgid "Sending type"
206
- msgstr "Типа отправки"
207
-
208
- #: newsletter.php:190
209
- msgid "Scheduled"
210
- msgstr "Планировщик"
211
-
212
- #: newsletter.php:193
213
- msgid "next"
214
- msgstr "следующая"
215
-
216
- #: newsletter.php:194
217
- msgid "now"
218
- msgstr "сейчас"
219
-
220
- #: newsletter.php:199
221
- msgid "Last subscriber"
222
- msgstr "Последний подписчик"
223
-
224
- #: newsletter.php:203
225
- msgid "Last id"
226
- msgstr "Последний ID"
227
-
228
- #: newsletter.php:204
229
- msgid "debug info"
230
- msgstr "информация для отладки"
231
-
232
- #: newsletter.php:207
233
- #: newsletter.php:263
234
- msgid "Message"
235
- msgstr "Сообщение"
236
-
237
- #: newsletter.php:214
238
- msgid "Restart batch"
239
- msgstr "Перезапуск"
240
-
241
- #: newsletter.php:214
242
- msgid "Continue with this batch?"
243
- msgstr "Продолжить с этой пакетной отправкой?"
244
-
245
- #: newsletter.php:216
246
- msgid "Reset batch"
247
- msgstr "Перезапуск"
248
-
249
- #: newsletter.php:216
250
- msgid "Reset the batch status?"
251
- msgstr "Сбросить состояние пакетной отправки?"
252
-
253
- #: newsletter.php:226
254
- msgid "Newsletter message"
255
- msgstr "Контент рассылки"
256
-
257
- #: newsletter.php:231
258
- msgid "Newsletter name"
259
- msgstr "Название рассылки"
260
-
261
- #: newsletter.php:235
262
- msgid "This symbolic name will be used to track the link clicks and associate them to a specific newsletter. Keep the name compact and significative."
263
- msgstr "Это символическое название будет использоваться для отслеживания кликов ссылки и связывать их с конкретными рассылками. Стсрайтесь делать название компактным и симантичным."
264
-
265
- #: newsletter.php:239
266
- #: newsletter.php:249
267
- msgid "Tracking"
268
- msgstr "Отслеживание"
269
-
270
- #: newsletter.php:242
271
- msgid "Track link clicks"
272
- msgstr "Отслеживать клики"
273
-
274
- #: newsletter.php:244
275
- msgid "When this option is enabled, each link in the email text will be rewritten and clicks on them intercepted."
276
- msgstr "Когда эта опция включена, каждая ссылка в тексте письма будет переписана, и клики на ней будут перехватываться."
277
-
278
- #: newsletter.php:250
279
- msgid "Tracking options available with Newsletter Extras package"
280
- msgstr "Отслеживание доступено после установкой Newsletter Extras"
281
-
282
- #: newsletter.php:255
283
- msgid "Subject"
284
- msgstr "Тема"
285
-
286
- #: newsletter.php:259
287
- msgid "Tags: <strong>{name}</strong> receiver name."
288
- msgstr "Тэги: <strong>{name}</strong> - имя получателя."
289
-
290
- #: newsletter.php:267
291
- msgid "Tags: <strong>{name}</strong> receiver name; <strong>{unsubscription_url}</strong> unsubscription URL; <strong>{token}</strong> the subscriber token."
292
- msgstr "Тэги: <strong>{name}</strong> - имя получателя; <strong>{unsubscription_url}</strong> -адрес для отписки; <strong>{token}</strong> - уникальный ключ подписчика."
293
-
294
- #: newsletter.php:272
295
- msgid "Theme"
296
- msgstr "Шаблон"
297
-
298
- #: newsletter.php:275
299
- msgid "Included themes"
300
- msgstr "Внутренние"
301
-
302
- #: newsletter.php:276
303
- msgid "Default"
304
- msgstr "По умолчанию"
305
-
306
- #: newsletter.php:277
307
- msgid "With picture"
308
- msgstr "С картинками"
309
-
310
- #: newsletter.php:279
311
- msgid "Custom themes"
312
- msgstr "Пользовательский"
313
-
314
- #: newsletter.php:289
315
- msgid "Auto compose"
316
- msgstr "Автоматическое заполнение"
317
-
318
- #: newsletter.php:293
319
- msgid "Number of posts on theme"
320
- msgstr "Кол-во постов в шаблоне"
321
-
322
- #: newsletter.php:301
323
- #: newsletter.php:332
324
- #: newsletter.php:369
325
- #: newsletter.php:399
326
- #: options.php:99
327
- #: options.php:133
328
- #: options.php:169
329
- #: options.php:222
330
- #: options.php:273
331
- #: options.php:388
332
- #: options.php:406
333
- #: options.php:443
334
- msgid "Save"
335
- msgstr "Сохранить"
336
-
337
- #: newsletter.php:302
338
- msgid "Test"
339
- msgstr "Тест"
340
-
341
- #: newsletter.php:303
342
- msgid "Simulate"
343
- msgstr "Имитировать"
344
-
345
- #: newsletter.php:303
346
- msgid "Simulate? The test address will receive all emails!"
347
- msgstr "Имитировать? Тестовые адресаты получат все письма!"
348
-
349
- #: newsletter.php:304
350
- msgid "Send"
351
- msgstr "Отправить"
352
-
353
- #: newsletter.php:304
354
- msgid "Start a real newsletter sending batch?"
355
- msgstr "Начасть настоящую рассылку в пакетном режиме?"
356
-
357
- #: newsletter.php:306
358
- msgid "Scheduled simulation"
359
- msgstr "Имитация по расписанию"
360
-
361
- #: newsletter.php:306
362
- msgid "Start a scheduled simulation?"
363
- msgstr "Начать запланированную имитацию?"
364
-
365
- #: newsletter.php:307
366
- msgid "Scheduled send"
367
- msgstr "Планировщик отправки"
368
-
369
- #: newsletter.php:307
370
- msgid "Start a scheduled real send?"
371
- msgstr "Начать запланированную настоящую рассылку?"
372
-
373
- #: newsletter.php:312
374
- msgid "Scheduler"
375
- msgstr "Планировщик"
376
-
377
- #: newsletter.php:313
378
- msgid "Scheduler helps to send out a long list of emails slowly to not overload the server."
379
- msgstr "Планировщик помогает отправлять длинные списки адресатов медленнее, не перегружая сервер."
380
-
381
- #: newsletter.php:317
382
- msgid "Interval between sending tasks"
383
- msgstr "Интервал между задачами отправки"
384
-
385
- #: newsletter.php:320
386
- msgid "minutes, minimum value is 10"
387
- msgstr "минуты, минимальное значение - 10"
388
-
389
- #: newsletter.php:324
390
- msgid "Max number of emails per task"
391
- msgstr "Максимальное число писем на каждую задачу"
392
-
393
- #: newsletter.php:327
394
- msgid "good value is 20 but if you use an external SMTP go with 5"
395
- msgstr "оптимальное значение - 20, но вы можете использовать внешний SMTP"
396
-
397
- #: newsletter.php:335
398
- msgid "Available only with Newsletter Extras package"
399
- msgstr "Доступен после установки Newsletter Extras"
400
-
401
- #: newsletter.php:342
402
- msgid "General"
403
- msgstr "Общие"
404
-
405
- #: newsletter.php:350
406
- msgid "Sending options"
407
- msgstr "Параметры отправки"
408
-
409
- #: newsletter.php:351
410
- msgid "Configuration for not scheduled sending process."
411
- msgstr "Настройка для незапланированных процессов отправки."
412
-
413
- #: newsletter.php:354
414
- msgid "Max emails in a single batch"
415
- msgstr "Максимум писем в одном пакете"
416
-
417
- #: newsletter.php:360
418
- msgid "Receiver address for simulation"
419
- msgstr "Адреса получателей для имитации"
420
-
421
- #: newsletter.php:363
422
- msgid "When you simulate a sending process, emails are really sent but all to this email address. That helps to test out problems with mail server."
423
- msgstr "Во время имитации процесса отправки, письма действительно отправляються, но только по этому адресу. Это помогает установить проблемы почтового сервера."
424
-
425
- #: newsletter.php:374
426
- msgid "Filter"
427
- msgstr "Фильтр"
428
-
429
- #: newsletter.php:381
430
- msgid "Test subscribers"
431
- msgstr "Тестовые подписчики"
432
-
433
- #: newsletter.php:383
434
- msgid "Define more test subscriber to see how your email looks on different clients: GMail, Outlook, Thunderbird, Hotmail, ..."
435
- msgstr "назначте нескольок тестовых подписчиков, что бы посмотреть как ваше сообщение выглядит в различных клиентах: GMail, Outlook, Thunderbird, Hotmail, ..."
436
-
437
- #: newsletter.php:389
438
- msgid "Subscriber"
439
- msgstr "Подписчик"
440
-
441
- #: newsletter.php:391
442
- msgid "name"
443
- msgstr "имя"
444
-
445
- #: newsletter.php:393
446
- msgid "email"
447
- msgstr "email"
448
-
449
- #: options.php:58
450
- msgid "Newsletter"
451
- msgstr "Newsletter плагин"
452
-
453
- #: options.php:63
454
- msgid "Questions, help, critiques and whatever else <a target=\"_blank\" href=\"http://www.satollo.net/plugins/newsletter\">click here</a>!"
455
- msgstr "Вопросы, помощь, критика и все остальное писать <a target=\"_blank\" href=\"http://www.satollo.net/plugins/newsletter\">здесь</a>!"
456
-
457
- #: options.php:70
458
- msgid "Sender and subscription page"
459
- msgstr "Отправитель и страница подписки"
460
-
461
- #: options.php:73
462
- msgid "Sender email"
463
- msgstr "Адрес отправителя"
464
-
465
- #: options.php:77
466
- msgid "Newsletter sender email address: the address subscribers will see the newsletters coming from."
467
- msgstr "Адрес отправителя рассылки: этот адрес подписчики увидят во поле \"От\" входящего письма, когда получат рассулку."
468
-
469
- #: options.php:81
470
- msgid "Sender name"
471
- msgstr "Имя отправителя"
472
-
473
- #: options.php:85
474
- msgid "The name of the newsletter sender subscribers will see on incoming email."
475
- msgstr "Имя отправителя рассылки подписчики увидят во входящем письме."
476
-
477
- #: options.php:89
478
- msgid "Subscription page URL"
479
- msgstr "Адрес страницы для подписки"
480
-
481
- #: options.php:93
482
- msgid "This is the page where you placed the <strong>[newsletter]</strong> short tag."
483
- msgstr "Это страница на которой вы разместили короткий тег <strong>[newsletter]</strong>."
484
-
485
- #: options.php:94
486
- msgid "Read more on plugin official page"
487
- msgstr "Узнать больше о плагине Вы на официальной странице"
488
-
489
- #: options.php:105
490
- msgid "Subscription form"
491
- msgstr "Форма подписки"
492
-
493
- #: options.php:111
494
- msgid "Do not ask the user name, only email."
495
- msgstr "Не спрашивать имя пользователя, только e-mail."
496
-
497
- #: options.php:115
498
- msgid "Subscription form page"
499
- msgstr "Страница формы подписки"
500
-
501
- #: options.php:119
502
- msgid "This is the text showed to subscriber before the subscription form which is added automatically."
503
- msgstr "Этот текст показываеться подписчику перед формой, которая добавляеться автоматический."
504
-
505
- #: options.php:123
506
- msgid "Successfully subscription page"
507
- msgstr "Страница успешной подписки"
508
-
509
- #: options.php:127
510
- msgid "This is the text showed to a user who has pressed \"subscribe me\" on the previous step informing that an email to confirm subscription has just been sent. Remeber the user to check the spam folder and to follow the email instructions.<br />Tags: <strong>{name}</strong> the user name; <strong>{email}</strong> the user email."
511
- msgstr "Этот текст показывается пользователю нажавшему в предыдущем шаге \"Подписаться\", информируя его о том, что сообщение с подтверждающей ссылкой было отправлено. Напоминает пользователю проверить папку \"Спам\" и следовать инструкция в письме.<br />Тэги: <strong>{name}</strong> - имя пользователя; <strong>{email}</strong> - e-mail пользователя."
512
-
513
- #: options.php:138
514
- msgid "Confirmation"
515
- msgstr "Подтверждение"
516
-
517
- #: options.php:138
518
- msgid "double opt-in"
519
- msgstr "опция"
520
-
521
- #: options.php:140
522
- msgid "Email sent to the user to confirm his subscription, the successful confirmation page, the welcome email."
523
- msgstr "Письмо отпрвлено пользователю для подтверждения, страница успешного подтверждения, преветсвенное письмо."
524
-
525
- #: options.php:147
526
- msgid "Do not use double opt-in. If checked the subscription is direct, so subscribers will be immediately confirmed and will receive the welcome email."
527
- msgstr "Не использовать эту опцию. Если проверка подписки примая, то подписчики немедленно становяться подтвержденными и получают приветвенное письмо."
528
-
529
- #: options.php:151
530
- msgid "Confirmation email subject"
531
- msgstr "Тема подтверждающего письма"
532
-
533
- #: options.php:155
534
- msgid "Tags: <strong>{name}</strong> the user name."
535
- msgstr "Тэги: <strong>{name}</strong> - имя пользователя."
536
-
537
- #: options.php:159
538
- msgid "Confirmation email message"
539
- msgstr "Текст подтверждающего письма"
540
-
541
- #: options.php:163
542
- msgid "Tags: <strong>{name}</strong> the user name; <strong>{subscription_confirm_url}</strong>confirmation URL to be clicked by the user to confirm his subscription."
543
- msgstr "Тэги: <strong>{name}</strong> - имя пользователя; <strong>{subscription_confirm_url}</strong> - адрес ссылки, кликнув по которой пользователя подтверждает подписку."
544
-
545
- #: options.php:174
546
- msgid "Welcome message"
547
- msgstr "Приветвенное сообщение"
548
-
549
- #: options.php:176
550
- msgid "Users jump directly to this step if you disabled the double opt-in step."
551
- msgstr "Пользователи сразу попадуют на этот шаг, если выключена опция подтверждения."
552
-
553
- #: options.php:180
554
- msgid "Successful confirmation page"
555
- msgstr "Страница успешного подтверждения"
556
-
557
- #: options.php:184
558
- msgid "Showed when the user follow the confirmation URL sent to him with previous email settings or if signed up directly with no double opt-in process."
559
- msgstr "Показываеться когда пользователь переходит по подтверждающей ссылке, или если он зарегестрировался напрямую (двойная опция выключена)."
560
-
561
- #: options.php:186
562
- msgid "Tags: <strong>{name}</strong> the user name; <strong>{email}</strong> for the user email; <strong>{token}</strong> the subscriber unique token"
563
- msgstr "Тэги: <strong>{name}</strong> - имя пользователя; <strong>{email}</strong> - e-mail пользователяl; <strong>{token}</strong> - уникальный ключ пользователя"
564
-
565
- #: options.php:191
566
- msgid "Conversion tracking code"
567
- msgstr "Код слежения за переходами"
568
-
569
- #: options.php:196
570
- msgid "Available with Newsletter Extras package"
571
- msgstr "Доступен с установкой Newsletter Extras"
572
-
573
- #: options.php:199
574
- msgid "That code is injected AS-IS in welcome page and can be used to track conversion (you can use PHP if needed). Conversion code is usually supply by tracking services, like Google AdWords, Google Analytics and so on."
575
- msgstr "Этот код вставляеться КАК ЕСТЬ в страницу приветсвия и может отслеживать переходы (вы можете использовать PHP если нужно). Отслеживающий код используеться поддерживающими отслеживание сервисами, такими как Google AdWords, Google Analytics и другими."
576
-
577
- #: options.php:202
578
- msgid "Welcome email"
579
- msgstr "Приветсвенное письмо"
580
-
581
- #: options.php:204
582
- msgid "Welcome email subject"
583
- msgstr "Тема приветсвенного письма"
584
-
585
- #: options.php:208
586
- #: options.php:259
587
- #: options.php:267
588
- msgid "Tags: <strong>{name}</strong> user name."
589
- msgstr "Тэги: <strong>{name}</strong> - имя пользователя."
590
-
591
- #: options.php:212
592
- msgid "Welcome email message"
593
- msgstr "Текст приветсвенного письма"
594
-
595
- #: options.php:216
596
- msgid "Tags: <strong>{name}</strong> user name; <strong>{token}</strong> the subscriber unique token"
597
- msgstr "Тэги: <strong>{name}</strong> - имя пользователя; <strong>{token}</strong> - уникальный ключ пользователя"
598
-
599
- #: options.php:227
600
- msgid "Unsubscription"
601
- msgstr "Отписка"
602
-
603
- #: options.php:229
604
- msgid "A user starts the unsubscription process clicking the unsubscription link in a newsletter. This lkink contains the email to unsubscribe and some unique information to avoid hacking. The user are requird to confirm the unsubscription: this is the last step where YOU can communicate with you almost missed user."
605
- msgstr "Пользователь начавший процесс отписки кликнув на ссылку в письме. Эта ссылка содержит адрес пользователя и некоторую уникальную информацию, защищающую от подлога. Пользователю требуеться подтвердить отписку: это последний шаг когда ВЫ можете связаться с ним во избежании потери пользователя."
606
-
607
- #: options.php:233
608
- #: options.php:282
609
- msgid "Unsubscription text"
610
- msgstr "Текст отписки"
611
-
612
- #: options.php:237
613
- msgid "This text is show to users who click on a \"unsubscription link\" in a newsletter email. You have to insert a link in the text that user can follow to confirm the unsubscription request (see tags)."
614
- msgstr "Этот текст показываеться пользователю котороый кликнул \"ссылку для отписки\" в письме. Вам надо вставить ссылку в текст, так пользователь сможет по ней пройти для потверждения отписки (см. теги)."
615
-
616
- #: options.php:239
617
- msgid "Tags: <strong>{name}</strong> user name; <strong>{email}</strong> user email; <strong>{unsubscription_confirm_url}</strong> URL to confirm unsubscription."
618
- msgstr "Тэги: <strong>{name}</strong> - имя пользователя; <strong>{email}</strong> - e-mail пользователя; <strong>{unsubscription_confirm_url}</strong> адрес ссылки для подтверждения отписки."
619
-
620
- #: options.php:245
621
- msgid "Good bye text"
622
- msgstr "Прощальный текст"
623
-
624
- #: options.php:248
625
- msgid "Latest message showed to the user to say \"good bye\"."
626
- msgstr "Последнее сообщение показываемое пользователю, что бы сказать \"Прощайте\"."
627
-
628
- #: options.php:250
629
- msgid "Tags: none."
630
- msgstr "Нет тэгов."
631
-
632
- #: options.php:255
633
- msgid "Goodbye email subject"
634
- msgstr "Тема прощального письма"
635
-
636
- #: options.php:263
637
- msgid "Goodbye email message"
638
- msgstr "Текст прощального письма"
639
-
640
- #: options.php:277
641
- msgid "Unsubscription for mass mail mode"
642
- msgstr "Отписка для массового режима"
643
-
644
- #: options.php:278
645
- msgid "This section is not working!"
646
- msgstr "Эта рубрика не работает!"
647
-
648
- #: options.php:289
649
- msgid "Unsubscription error"
650
- msgstr "Ошибка отписки"
651
-
652
- #: options.php:293
653
- msgid "Shown with the unsubscription message then the email to unsubscribe is not found."
654
- msgstr "Показываеться с сообщением отписки, когда адрес для отписки не найден."
655
-
656
- #: options.php:297
657
- msgid "\"Email to unsubscribe\" label"
658
- msgstr "Метка \"Адрес для отписки\""
659
-
660
- #: options.php:305
661
- msgid "\"Confirm unsubscription\" label"
662
- msgstr "Метка \"Подтверждение отписки\""
663
-
664
- #: options.php:309
665
- msgid "The button text to confirm unsubscription or to send an unsubscription request for the specified email address when \"mass mail\" mode is used for sending newsletters."
666
- msgstr "Текст кнопки для потдверждения отписки или для отправки запроса отписки на спейифичные адреса, когда режим \"Массовая рассылка\" используеться."
667
-
668
- #: options.php:313
669
- msgid "Unsubscription end text"
670
- msgstr "Текст о законченной отписке"
671
-
672
- #: options.php:317
673
- msgid "This text is shown when a user type in an email to be removed and the confirmation email has been sent."
674
- msgstr "Этот текст показываеться, когда пользователь вводит e-mail который был удален, или подтверждающее письмобыло отправлено."
675
-
676
- #: options.php:322
677
- msgid "Unsubscription email subject"
678
- msgstr "Тема пиьсма об отписке"
679
-
680
- #: options.php:328
681
- msgid "Unsubscription email message"
682
- msgstr "Текст пиьсма об отписке"
683
-
684
- #: options.php:332
685
- msgid "Email sent to confirm unsubscription when the request is made specifying an email address to remove. Use {unsubscription_link} to place the link where the user has to click on; use {unsubscription_url} toplace the plain unsubscription URL."
686
- msgstr "Письмо отправлено для подтверждения отписки, когда запрос был сделан с удаленного адреса. Используйте {unsubscription_link} что бы вставить ссылку где пользователь кликнет по ней; используйте {unsubscription_url} что бы вставить не кликабельную ссылку."
687
-
688
- #: options.php:336
689
- msgid "Unsubscription link text"
690
- msgstr "Текст ссылки для отписки."
691
-
692
- #: options.php:340
693
- msgid "The text of the link for unsubscription to be placed in the unsubscription email."
694
- msgstr "Текст ссылку для отписки будет вставлен в отписывающее письмо."
695
-
696
- #: options.php:346
697
- msgid "Lists"
698
- msgstr "Списки"
699
-
700
- #: options.php:351
701
- msgid "List 0 is the general one"
702
- msgstr "Список 0 - общий"
703
-
704
- #: options.php:362
705
- msgid "Advanced"
706
- msgstr "Дополнительно"
707
-
708
- #: options.php:369
709
- msgid "write logs"
710
- msgstr "писать логи"
711
-
712
- #: options.php:376
713
- msgid "do not use visual editors"
714
- msgstr "не использовать визуальный редактор"
715
-
716
- #: options.php:383
717
- msgid "allow editors to user the newsletter plugin"
718
- msgstr "разрешить редакторам использовать этот плагин"
719
-
720
- #: options.php:392
721
- msgid "Really advanced options"
722
- msgstr "Действительно дополнительные опции"
723
-
724
- #: options.php:399
725
- msgid "Use the custom subscription form below"
726
- msgstr "Использовать настраиваему форму ниже"
727
-
728
- #: options.php:411
729
- msgid "Zanzara client"
730
- msgstr "Zanzara клиент"
731
-
732
- #: options.php:412
733
- msgid "Obsolete"
734
- msgstr "Устаревший"
735
-
736
- #: options.php:415
737
- msgid "Export key"
738
- msgstr "Ключ экспорта"
739
-
740
- #: options.php:419
741
- msgid "Do not search for Zanzara, is a my private software"
742
- msgstr "Не искать Zanzara, это мое частное ПО"
743
-
744
- #: options.php:423
745
- msgid "SMTP address"
746
- msgstr "SMTP адрес"
747
-
748
- #: options.php:429
749
- msgid "SMTP user"
750
- msgstr "SMTP логин"
751
-
752
- #: options.php:435
753
- msgid "SMTP password"
754
- msgstr "SMTP пароль"
755
-
756
- #: options.php:444
757
- msgid "Revert to defaults"
758
- msgstr "Вернуться к настройка по умолчанию"
759
-
760
- #: plugin.php:932
761
- msgid "Configuration"
762
- msgstr "Конфигурация"
763
-
764
- #: plugin.php:933
765
- msgid "Composer"
766
- msgstr "Компановщик"
767
-
768
- #: plugin.php:935
769
- msgid "Export"
770
- msgstr "Экспорт"
771
-
772
- #: plugin.php:936
773
- msgid "Manage"
774
- msgstr "Управление"
775
-
776
- #: plugin.php:937
777
- #: statistics.php:8
778
- msgid "Statistics"
779
- msgstr "Статистика"
780
-
781
- #: statistics.php:11
782
- msgid "You need the Newsletter Extras installed to view statistics"
783
- msgstr "Вам необходим установленый пакет Newsletter Extras, что бы смотреть статистику"
784
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/nl_NL.php CHANGED
@@ -1,66 +1,57 @@
1
  <?php
2
 
3
- // Subscription form (traslate "your name", "your email" and the button "subscribe me")
4
- $newsletter_labels['subscription_form'] =
5
- '<form method="post" action="" style="text-align: center">
6
- <input type="hidden" name="na" value="s"/>
7
- <table cellspacing="3" cellpadding="3" border="0" width="50%">
8
- <tr><td>Jouw&nbsp;naam</td><td><input type="text" name="nn" size="30"/></td></tr>
9
- <tr><td>Jouw&nbsp;email</td><td><input type="text" name="ne" size="30"/></td></tr>
10
- <tr><td colspan="2" style="text-align: center"><input type="submit" value="Inschrijven"/></td></tr>
11
- </table>
12
- </form>';
13
 
 
 
 
 
 
14
 
15
- $newsletter_labels['subscription_form_noname'] =
16
- '<form method="post" action="" style="text-align: center">
17
- <input type="hidden" name="na" value="s"/>
18
- <table cellspacing="3" cellpadding="3" border="0" width="50%">
19
- <tr><td>Jouw&nbsp;email</td><td><input type="text" name="ne" size="30"/></td></tr>
20
- <tr><td colspan="2" style="text-align: center"><input type="submit" value="Inschrijven"/></td></tr>
21
- </table>
22
- </form>';
23
 
24
- $newsletter_labels['widget_form'] =
25
- '<form action="{newsletter_url}" method="post">
26
- {text}
27
- <p><input type="text" name="nn" value="Jouw naam" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/></p>
28
- <p><input type="text" name="ne" value="Jouw email" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/></p>
29
- <p><input type="submit" value="Inschrijven"/></p>
30
- <input type="hidden" name="na" value="s"/>
31
- </form>';
32
 
 
 
 
 
 
 
 
33
 
34
- $newsletter_labels['widget_form_noname'] =
35
- '<form action="{newsletter_url}" method="post">
36
- {text}
37
- <p><input type="text" name="ne" value="Jouw email" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/></p>
38
- <p><input type="submit" value="Inschrijven"/></p>
39
- <input type="hidden" name="na" value="s"/>
40
- </form>';
41
 
 
 
42
 
 
 
 
43
 
44
- $newsletter_labels['embedded_form'] =
45
- '<form action="{newsletter_url}" method="post">
46
- <p><input type="text" name="ne" value="Jouw email" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/>
47
- &nbsp;<input type="text" name="nn" value="Jouw naam" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/>
48
- <input type="submit" value="Inschrijven"/>
49
- <input type="hidden" name="na" value="s"/></p>
50
- </form>';
51
 
52
- // Example of embedded form without name
 
 
53
 
54
- $newsletter_labels['embedded_form_noname'] =
55
- '<form action="{newsletter_url}" method="post">
56
- <p><input type="text" name="ne" value="Jouw email" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/>
57
- <input type="submit" value="Inschrijven"/>
58
- <input type="hidden" name="na" value="s"/></p>
59
- </form>';
60
 
 
 
 
61
 
62
- // Errors on subscription
63
- $newsletter_labels['error_email'] = 'Foutief email-adres. <a href="javascript:history.back()">Ga terug</a>.';
64
- $newsletter_labels['error_name'] = 'Gelieve jouw naam in te vullen. <a href="javascript:history.back()">Ga terug</a>.';
65
 
66
- ?>
1
  <?php
2
 
3
+ $defaults_profile = array();
4
+ $defaults_profile['email_error'] = 'Foutief email-adres.';
5
+ $defaults_profile['name_error'] = 'Gelieve jouw naam in te vullen.';
 
 
 
 
 
 
 
6
 
7
+ $defaults = array();
8
+ // Subscription page introductory text (befor the subscription form)
9
+ $defaults['subscription_text'] =
10
+ "<p>Via onderstaand formuliertje kan je je inschrijven voor onze nieuwsbrief. Via deze nieuwsbrief houden we je op de hoogte van komende activiteiten.</p>
11
+ <p>Nadat je het formuliertje verstuurd hebt, zal je een bevestigingsmail ontvangen. Lees deze mail aandachtig om jouw inschrijving te bevestigen.</p>";
12
 
13
+ // Message show after a subbscription request has made.
14
+ $defaults['subscribed_text'] =
15
+ "<p>Je hebt je ingeschreven op de nieuwsbrief.</p>
16
+ <p>Binnen enkele minuten zal je een bevestigingsmail ontvangen. Volg de link in die mail om jouw inschrijving te bevestigen. Indien je problemen hebt met het ontvangen van de bevestigingsmail kan je ons via het contactformulier bereiken.</p>";
 
 
 
 
17
 
18
+ // Confirmation email subject (double opt-in)
19
+ $defaults['confirmation_subject'] =
20
+ "{name}, Bevestig jouw inschrijving op de nieuwsbrief van {blog_title}";
 
 
 
 
 
21
 
22
+ // Confirmation email body (double opt-in)
23
+ $defaults['confirmation_message'] =
24
+ "<p>Hallo {name},</p>
25
+ <p>We ontvingen jouw inschrijving op onze nieuwsbrief. Gelieve de inschrijving te bevestigen door <a href=\"{subscription_confirm_url}\"><strong>hier</strong></a> te klikken. Als het klikken op de link voor jou niet werkt, kan je de volgende link in jouw browser copieren.</p>
26
+ <p>{subscription_confirm_url}</p>
27
+ <p>Indien je deze mail ontvangt en toch geen inschrijving gevraagd hebt, hoef je niets te doen. De inschrijving wordt dan automatisch geannuleerd.</p>
28
+ <p>Dank u wel.</p>";
29
 
30
+ // Subscription confirmed text (after a user clicked the confirmation link
31
+ // on the email he received
32
+ $defaults['confirmed_text'] =
33
+ "<p>Je hebt zonet jouw inschrijving bevestigd.</p><p>bedankt {name} !</p>";
 
 
 
34
 
35
+ $defaults['confirmed_subject'] =
36
+ "Welkom, {name}";
37
 
38
+ $defaults['confirmed_message'] =
39
+ "<p>Uw inschrijving op de niewsbrief van {blog_title} is bevestigd.</p>
40
+ <p>Bedankt !</p>";
41
 
42
+ // Unsubscription request introductory text
43
+ $defaults['unsubscription_text'] =
44
+ "<p>Gelieve uw uitschrijving te bevestigen door <a href=\"{unsubscription_confirm_url}\">hier</a> te klikken.";
 
 
 
 
45
 
46
+ // When you finally loosed your subscriber
47
+ $defaults['unsubscribed_text'] =
48
+ "<p>U bent uit onze lijst verwijderd.</p>";
49
 
50
+ $defaults['unsubscribed_subject'] =
51
+ "Tot ziens, {name}";
 
 
 
 
52
 
53
+ $defaults['unsubscribed_message'] =
54
+ "<p>Uw uitschrijving op de nieuwsbrief van {blog_title} is bevestigd.</p>
55
+ <p>Tot ziens.</p>";
56
 
 
 
 
57
 
 
languages/nl_NL_options.php DELETED
@@ -1,64 +0,0 @@
1
- <?php
2
- // This file contains the default options values
3
- $newsletter_default_options['from_email'] = get_option('admin_email');
4
- $newsletter_default_options['from_name'] = get_option('blogname');
5
-
6
- // Subscription page introductory text (befor the subscription form)
7
- $newsletter_default_options['subscription_text'] =
8
- "<p>Via onderstaand formuliertje kan je je inschrijven voor onze nieuwsbrief. Via deze nieuwsbrief houden we je op de hoogte van komende activiteiten.</p>
9
- <p>Nadat je het formuliertje verstuurd hebt, zal je een bevestigingsmail ontvangen. Lees deze mail aandachtig om jouw inschrijving te bevestigen.</p>";
10
-
11
- // Message show after a subbscription request has made.
12
- $newsletter_default_options['subscribed_text'] =
13
- "<p>Je hebt je ingeschreven op de nieuwsbrief.</p>
14
- <p>Binnen enkele minuten zal je een bevestigingsmail ontvangen. Volg de link in die mail om jouw inschrijving te bevestigen. Indien je problemen hebt met het ontvangen van de bevestigingsmail kan je ons via het contactformulier bereiken.</p>";
15
-
16
- // Confirmation email subject (double opt-in)
17
- $newsletter_default_options['confirmation_subject'] =
18
- "{name}, Bevestig jouw inschrijving op de nieuwsbrief van {blog_title}";
19
-
20
- // Confirmation email body (double opt-in)
21
- $newsletter_default_options['confirmation_message'] =
22
- "<p>Hallo {name},</p>
23
- <p>We ontvingen jouw inschrijving op onze nieuwsbrief. Gelieve de inschrijving te bevestigen door <a href=\"{subscription_confirm_url}\"><strong>hier</strong></a> te klikken. Als het klikken op de link voor jou niet werkt, kan je de volgende link in jouw browser copieren.</p>
24
- <p>{subscription_confirm_url}</p>
25
- <p>Indien je deze mail ontvangt en toch geen inschrijving gevraagd hebt, hoef je niets te doen. De inschrijving wordt dan automatisch geannuleerd.</p>
26
- <p>Dank u wel.</p>";
27
-
28
- // Subscription confirmed text (after a user clicked the confirmation link
29
- // on the email he received
30
- $newsletter_default_options['confirmed_text'] =
31
- "<p>Je hebt zonet jouw inschrijving bevestigd.</p><p>bedankt {name} !</p>";
32
-
33
- $newsletter_default_options['confirmed_subject'] =
34
- "Welkom, {name}";
35
-
36
- $newsletter_default_options['confirmed_message'] =
37
- "<p>Uw inschrijving op de niewsbrief van {blog_title} is bevestigd.</p>
38
- <p>Bedankt !</p>";
39
-
40
- // Unsubscription request introductory text
41
- $newsletter_default_options['unsubscription_text'] =
42
- "<p>Gelieve uw uitschrijving te bevestigen door <a href=\"{unsubscription_confirm_url}\">hier</a> te klikken.";
43
-
44
- // When you finally loosed your subscriber
45
- $newsletter_default_options['unsubscribed_text'] =
46
- "<p>U bent uit onze lijst verwijderd.</p>";
47
-
48
- $newsletter_default_options['unsubscribed_subject'] =
49
- "Tot ziens, {name}";
50
-
51
- $newsletter_default_options['unsubscribed_message'] =
52
- "<p>Uw uitschrijving op de nieuwsbrief van {blog_title} is bevestigd.</p>
53
- <p>Tot ziens.</p>";
54
-
55
- $newsletter_default_options['subscription_form'] =
56
- '<form method="post" action="" style="text-align: center">
57
- <input type="hidden" name="na" value="s"/>
58
- <table cellspacing="3" cellpadding="3" border="0" width="50%">
59
- <tr><td>Jouw&nbsp;naam</td><td><input type="text" name="nn" size="30"/></td></tr>
60
- <tr><td>Jouw&nbsp;email</td><td><input type="text" name="ne" size="30"/></td></tr>
61
- <tr><td colspan="2" style="text-align: center"><input type="submit" value="Inschrijven"/></td></tr>
62
- </table>
63
- </form>';
64
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/pl_PL.php CHANGED
@@ -1,59 +1,58 @@
1
  <?php
2
 
3
- // Subscription form (traslate "your name", "your email" and the button "subscribe me")
4
- $newsletter_labels['subscription_form'] =
5
- '<form method="post" action="" style="text-align: center">
6
- <input type="hidden" name="na" value="s"/>
7
- <table cellspacing="3" cellpadding="3" border="0" width="50%">
8
- <tr><td>Twoje&nbsp;imię</td><td><input type="text" name="nn" size="30"/></td></tr>
9
- <tr><td>Twój&nbsp;e-mail</td><td><input type="text" name="ne" size="30"/></td></tr>
10
- <tr><td colspan="2" style="text-align: center"><input type="submit" value="Zapisz mnie"/></td></tr>
11
- </table>
12
- </form>';
13
-
14
- $newsletter_labels['subscription_form_noname'] =
15
- '<form method="post" action="" style="text-align: center">
16
- <input type="hidden" name="na" value="s"/>
17
- <table cellspacing="3" cellpadding="3" border="0" width="50%">
18
- <tr><td>Twój&nbsp;e-mail</td><td><input type="text" name="ne" size="30"/></td></tr>
19
- <tr><td colspan="2" style="text-align: center"><input type="submit" value="Zapisz mnie"/></td></tr>
20
- </table>
21
- </form>';
22
-
23
- $newsletter_labels['widget_form'] =
24
- '<form action="{newsletter_url}" method="post">
25
- {text}
26
- <p><input type="text" name="nn" value="Twoje imię" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/></p>
27
- <p><input type="text" name="ne" value="Twój e-mail" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/></p>
28
- <p><input type="submit" value="Zapisz mnie"/></p>
29
- <input type="hidden" name="na" value="s"/>
30
- </form>';
31
-
32
- $newsletter_labels['widget_form_noname'] =
33
- '<form action="{newsletter_url}" method="post">
34
- {text}
35
- <p><input type="text" name="ne" value="Twój e-mail" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/></p>
36
- <p><input type="submit" value="Zapisz mnie"/></p>
37
- <input type="hidden" name="na" value="s"/>
38
- </form>';
39
-
40
- $newsletter_labels['embedded_form'] =
41
- '<form action="{newsletter_url}" method="post">
42
- <p><input type="text" name="ne" value="Twój e-mail" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/>
43
- &nbsp;<input type="text" name="nn" value="Twoje imię" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/>
44
- <input type="submit" value="Zapisz mnie"/>
45
- <input type="hidden" name="na" value="s"/></p>
46
- </form>';
47
-
48
- $newsletter_labels['embedded_form_noname'] =
49
- '<form action="{newsletter_url}" method="post">
50
- <p><input type="text" name="ne" value="Twój e-mail" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/>
51
- <input type="submit" value="Zapisz mnie"/>
52
- <input type="hidden" name="na" value="s"/></p>
53
- </form>';
54
-
55
- // Errors on subscription
56
- $newsletter_labels['error_email'] = 'Nieprawidłowy adres e-mail. <a href="javascript:history.back()">Powrót</a>.';
57
- $newsletter_labels['error_name'] = 'Imię nie może być puste. <a href="javascript:history.back()">Powrót</a>.';
58
-
59
- ?>
1
  <?php
2
 
3
+ $defaults_profile = array();
4
+ $defaults_profile['email_error'] = 'Nieprawidłowy adres e-mail.';
5
+ $defaults_profile['name_error'] = 'Imię nie może być puste.';
6
+
7
+ $defaults = array();
8
+ // Subscription page introductory text (befor the subscription form)
9
+ $defaults['subscription_text'] =
10
+ "<p>Zapisz się do newslettera wypełniając pola poniżej.
11
+ Postaramy się Cię uszczęśliwić.</p>
12
+ <p>Zostanie wysłany do Ciebie e-mail potwierdzający:
13
+ przeczytaj instrukcje w nim zawarte, aby potwierdzić subskrypcję.</p>";
14
+
15
+ // Message show after a subbscription request has made.
16
+ $defaults['subscribed_text'] =
17
+ "<p>Zostałeś zapisany do subskrypcji.
18
+ W ciągu kilku minut otrzymasz e-mail potwierdzający.
19
+ Kliknij w odnośnik w nim zawarty aby potwierdzić subskrypcję. Jeśli e-mail nie pojawi się w Twojej skrzynce przez 15 minut - sprawdź folder spam.</p>";
20
+
21
+ // Confirmation email subject (double opt-in)
22
+ $defaults['confirmation_subject'] =
23
+ "{name}, potwierdź swoją subskrypcję w {blog_title}";
24
+
25
+ // Confirmation email body (double opt-in)
26
+ $defaults['confirmation_message'] =
27
+ "<p>Witaj {name},</p>
28
+ <p>Otrzymaliśmy prośbę o wpis do subskrypcji dla tego adresu e-mail. Możesz potwierdzić ją
29
+ <a href=\"{subscription_confirm_url}\"><strong>klikając tutaj</strong></a>.
30
+ Jeśli nie możesz kliknąć odnośnika, użyj poniższego linku:</p>
31
+ <p>{subscription_confirm_url}</p>
32
+ <p>Jeśli to nie Ty wpisywałeś się do subskrypcji, po prostu zignoruj tę wiadomość.</p>
33
+ <p>Dziękujemy.</p>";
34
+
35
+
36
+ // Subscription confirmed text (after a user clicked the confirmation link
37
+ // on the email he received
38
+ $defaults['confirmed_text'] =
39
+ "<p>Twoja subskrypcja została potwierdzona!
40
+ Dziękujemy {name}!</p>";
41
+
42
+ $defaults['confirmed_subject'] =
43
+ "Witaj, {name}";
44
+
45
+ $defaults['confirmed_message'] =
46
+ "<p>Wiadomość potwierdzająca subskyrpcję {blog_title}.</p>
47
+ <p>Dziękujemy!</p>";
48
+
49
+ // Unsubscription request introductory text
50
+ $defaults['unsubscription_text'] =
51
+ "<p>Proszę potwierdzić rezygnację z subskrypcji
52
+ <a href=\"{unsubscription_confirm_url}\">klikając tutaj</a>.";
53
+
54
+ // When you finally loosed your subscriber
55
+ $defaults['unsubscribed_text'] =
56
+ "<p>To smutne, ale usunęliśmy Twój e-mail z subskrypcji...</p>";
57
+
58
+
 
languages/pl_PL_options.php DELETED
@@ -1,53 +0,0 @@
1
- <?php
2
- // This file contains the default options values
3
-
4
- // Subscription page introductory text (befor the subscription form)
5
- $newsletter_default_options['subscription_text'] =
6
- "<p>Zapisz się do newslettera wypełniając pola poniżej.
7
- Postaramy się Cię uszczęśliwić.</p>
8
- <p>Zostanie wysłany do Ciebie e-mail potwierdzający:
9
- przeczytaj instrukcje w nim zawarte, aby potwierdzić subskrypcję.</p>";
10
-
11
- // Message show after a subbscription request has made.
12
- $newsletter_default_options['subscribed_text'] =
13
- "<p>Zostałeś zapisany do subskrypcji.
14
- W ciągu kilku minut otrzymasz e-mail potwierdzający.
15
- Kliknij w odnośnik w nim zawarty aby potwierdzić subskrypcję. Jeśli e-mail nie pojawi się w Twojej skrzynce przez 15 minut - sprawdź folder spam.</p>";
16
-
17
- // Confirmation email subject (double opt-in)
18
- $newsletter_default_options['confirmation_subject'] =
19
- "{name}, potwierdź swoją subskrypcję w {blog_title}";
20
-
21
- // Confirmation email body (double opt-in)
22
- $newsletter_default_options['confirmation_message'] =
23
- "<p>Witaj {name},</p>
24
- <p>Otrzymaliśmy prośbę o wpis do subskrypcji dla tego adresu e-mail. Możesz potwierdzić ją
25
- <a href=\"{subscription_confirm_url}\"><strong>klikając tutaj</strong></a>.
26
- Jeśli nie możesz kliknąć odnośnika, użyj poniższego linku:</p>
27
- <p>{subscription_confirm_url}</p>
28
- <p>Jeśli to nie Ty wpisywałeś się do subskrypcji, po prostu zignoruj tę wiadomość.</p>
29
- <p>Dziękujemy.</p>";
30
-
31
-
32
- // Subscription confirmed text (after a user clicked the confirmation link
33
- // on the email he received
34
- $newsletter_default_options['confirmed_text'] =
35
- "<p>Twoja subskrypcja została potwierdzona!
36
- Dziękujemy {name}!</p>";
37
-
38
- $newsletter_default_options['confirmed_subject'] =
39
- "Witaj, {name}";
40
-
41
- $newsletter_default_options['confirmed_message'] =
42
- "<p>Wiadomość potwierdzająca subskyrpcję {blog_title}.</p>
43
- <p>Dziękujemy!</p>";
44
-
45
- // Unsubscription request introductory text
46
- $newsletter_default_options['unsubscription_text'] =
47
- "<p>Proszę potwierdzić rezygnację z subskrypcji
48
- <a href=\"{unsubscription_confirm_url}\">klikając tutaj</a>.";
49
-
50
- // When you finally loosed your subscriber
51
- $newsletter_default_options['unsubscribed_text'] =
52
- "<p>To smutne, ale usunęliśmy Twój e-mail z subskrypcji...</p>";
53
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/pt_BR.php CHANGED
@@ -1,59 +1,57 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
- // Subscription form (traslate "your name", "your email" and the button "subscribe me")
4
- $newsletter_labels['subscription_form'] =
5
- '<form method="post" action="" style="text-align: center">
6
- <input type="hidden" name="na" value="s"/>
7
- <table cellspacing="3" cellpadding="3" border="0" width="50%">
8
- <tr><td>Seu&nbsp;nome</td><td><input type="text" name="nn" size="30"/></td></tr>
9
- <tr><td>Seu&nbsp;email</td><td><input type="text" name="ne" size="30"/></td></tr>
10
- <tr><td colspan="2" style="text-align: center"><input type="submit" value="Assinar"/></td></tr>
11
- </table>
12
- </form>';
13
-
14
- $newsletter_labels['subscription_form_noname'] =
15
- '<form method="post" action="" style="text-align: center">
16
- <input type="hidden" name="na" value="s"/>
17
- <table cellspacing="3" cellpadding="3" border="0" width="50%">
18
- <tr><td>Seu&nbsp;email</td><td><input type="text" name="ne" size="30"/></td></tr>
19
- <tr><td colspan="2" style="text-align: center"><input type="submit" value="Assinar"/></td></tr>
20
- </table>
21
- </form>';
22
-
23
- $newsletter_labels['widget_form'] =
24
- '<form action="{newsletter_url}" method="post">
25
- {text}
26
- <p><input type="text" name="nn" value="Seu nome" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/></p>
27
- <p><input type="text" name="ne" value="Seu email" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/></p>
28
- <p><input type="submit" value="Assinar"/></p>
29
- <input type="hidden" name="na" value="s"/>
30
- </form>';
31
-
32
- $newsletter_labels['widget_form_noname'] =
33
- '<form action="{newsletter_url}" method="post">
34
- {text}
35
- <p><input type="text" name="ne" value="Seu email" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/></p>
36
- <p><input type="submit" value="Assinar"/></p>
37
- <input type="hidden" name="na" value="s"/>
38
- </form>';
39
-
40
- $newsletter_labels['embedded_form'] =
41
- '<form action="{newsletter_url}" method="post">
42
- <p><input type="text" name="ne" value="Seu email" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/>
43
- &nbsp;<input type="text" name="nn" value="Seu nome" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/>
44
- <input type="submit" value="Assinar"/>
45
- <input type="hidden" name="na" value="s"/></p>
46
- </form>';
47
-
48
- $newsletter_labels['embedded_form_noname'] =
49
- '<form action="{newsletter_url}" method="post">
50
- <p><input type="text" name="ne" value="Seu email" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/>
51
- <input type="submit" value="Assinar"/>
52
- <input type="hidden" name="na" value="s"/></p>
53
- </form>';
54
-
55
- // Errors on subscription
56
- $newsletter_labels['error_email'] = 'Endereço de email incorreto. <a href="javascript:history.back()">Go back</a>.';
57
- $newsletter_labels['error_name'] = 'O nome não pode estar vazio. <a href="javascript:history.back()">Go back</a>.';
58
 
59
  ?>
1
  <?php
2
+ $defaults_profile['email_error'] = 'Endereço de email incorreto.';
3
+ $defaults_profile['name_error'] = 'O nome não pode estar vazio.';
4
+
5
+ // Subscription page introductory text (befor the subscription form)
6
+ $defaults['subscription_text'] =
7
+ "<p>Inscreva-se na minha newsletter preenchendo os campos abaixo.
8
+ Tentarei lhe fazer feliz.</p>
9
+ <p>Um email de confirmação será enviado a sua caixa de entrada:
10
+ por favor leia as instruções e complete seu registro.</p>";
11
+
12
+ // Message show after a subbscription request has made.
13
+ $defaults['subscribed_text'] =
14
+ "<p>Você foi inscrito corretamente na newsletter.
15
+ Em alguns minutos você receberá um email de confirmação. Siga o link para confirmar a inscrição.
16
+ Se o email demorar mais do que 15 minutos para chegar, cheque sua caixa de SPAM.</p>";
17
+
18
+ // Confirmation email subject (double opt-in)
19
+ $defaults['confirmation_subject'] =
20
+ "{name}, confirme sua inscrição no site {blog_title}";
21
+
22
+ // Confirmation email body (double opt-in)
23
+ $defaults['confirmation_message'] =
24
+ "<p>Oi {name},</p>
25
+ <p>Recebemos um pedido de inscrição nos nossos informativos deste email. Você pode confirmar
26
+ <a href=\"{subscription_confirm_url}\"><strong>clicando aqui</strong></a>.
27
+ Se você não puder seguir o link, acesse este endereço:</p>
28
+ <p>{subscription_confirm_url}</p>
29
+ <p>Se o pedido de inscrição não veio de você, apenas ignore esta mensagem.</p>
30
+ <p>Obrigado.</p>";
31
+
32
+
33
+ // Subscription confirmed text (after a user clicked the confirmation link
34
+ // on the email he received
35
+ $defaults['confirmed_text'] =
36
+ "<p>Sua inscrição foi confirmada!
37
+ Obrigado {name}.</p>";
38
+
39
+ $defaults['confirmed_subject'] =
40
+ "Bem vindo(a) a bordo, {name}";
41
+
42
+ $defaults['confirmed_message'] =
43
+ "<p>A mensagem confirma a sua inscrição nos nossos informativos.</p>
44
+ <p>Obrigado.</p>";
45
+
46
+ // Unsubscription request introductory text
47
+ $defaults['unsubscription_text'] =
48
+ "<p>Cancele a sua inscrição nos informativos
49
+ <a href=\"{unsubscription_confirm_url}\">clicando aqui</a>.";
50
+
51
+ // When you finally loosed your subscriber
52
+ $defaults['unsubscribed_text'] =
53
+ "<p>Sua inscrição foi cancelada. Inscreva-se novamente quando quiser.</p>";
54
+
55
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
 
57
  ?>
languages/pt_BR_options.php DELETED
@@ -1,53 +0,0 @@
1
- <?php
2
- // This file contains the default options values
3
-
4
- // Subscription page introductory text (befor the subscription form)
5
- $newsletter_default_options['subscription_text'] =
6
- "<p>Inscreva-se na minha newsletter preenchendo os campos abaixo.
7
- Tentarei lhe fazer feliz.</p>
8
- <p>Um email de confirmação será enviado a sua caixa de entrada:
9
- por favor leia as instruções e complete seu registro.</p>";
10
-
11
- // Message show after a subbscription request has made.
12
- $newsletter_default_options['subscribed_text'] =
13
- "<p>Você foi inscrito corretamente na newsletter.
14
- Em alguns minutos você receberá um email de confirmação. Siga o link para confirmar a inscrição.
15
- Se o email demorar mais do que 15 minutos para chegar, cheque sua caixa de SPAM.</p>";
16
-
17
- // Confirmation email subject (double opt-in)
18
- $newsletter_default_options['confirmation_subject'] =
19
- "{name}, confirme sua inscrição no site {blog_title}";
20
-
21
- // Confirmation email body (double opt-in)
22
- $newsletter_default_options['confirmation_message'] =
23
- "<p>Oi {name},</p>
24
- <p>Recebemos um pedido de inscrição nos nossos informativos deste email. Você pode confirmar
25
- <a href=\"{subscription_confirm_url}\"><strong>clicando aqui</strong></a>.
26
- Se você não puder seguir o link, acesse este endereço:</p>
27
- <p>{subscription_confirm_url}</p>
28
- <p>Se o pedido de inscrição não veio de você, apenas ignore esta mensagem.</p>
29
- <p>Obrigado.</p>";
30
-
31
-
32
- // Subscription confirmed text (after a user clicked the confirmation link
33
- // on the email he received
34
- $newsletter_default_options['confirmed_text'] =
35
- "<p>Sua inscrição foi confirmada!
36
- Obrigado {name}.</p>";
37
-
38
- $newsletter_default_options['confirmed_subject'] =
39
- "Bem vindo(a) a bordo, {name}";
40
-
41
- $newsletter_default_options['confirmed_message'] =
42
- "<p>A mensagem confirma a sua inscrição nos nossos informativos.</p>
43
- <p>Obrigado.</p>";
44
-
45
- // Unsubscription request introductory text
46
- $newsletter_default_options['unsubscription_text'] =
47
- "<p>Cancele a sua inscrição nos informativos
48
- <a href=\"{unsubscription_confirm_url}\">clicando aqui</a>.";
49
-
50
- // When you finally loosed your subscriber
51
- $newsletter_default_options['unsubscribed_text'] =
52
- "<p>Sua inscrição foi cancelada. Inscreva-se novamente quando quiser.</p>";
53
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/ru_RU.php CHANGED
@@ -1,66 +1,52 @@
1
  <?php
2
 
3
- // Subscription form (traslate "your name", "your email" and the button "subscribe me")
4
- $newsletter_labels['subscription_form'] =
5
- '<form method="post" action="" style="text-align: center">
6
- <input type="hidden" name="na" value="s"/>
7
- <table cellspacing="3" cellpadding="3" border="0" width="50%">
8
- <tr><td>Ваше&nbsp;имя</td><td><input type="text" name="nn" size="30"/></td></tr>
9
- <tr><td>Ваш&nbsp;email</td><td><input type="text" name="ne" size="30"/></td></tr>
10
- <tr><td colspan="2" style="text-align: center"><input type="submit" value="Подписать&nbsp;меня"/></td></tr>
11
- </table>
12
- </form>';
13
 
 
 
 
 
 
14
 
15
- $newsletter_labels['subscription_form_noname'] =
16
- '<form method="post" action="" style="text-align: center">
17
- <input type="hidden" name="na" value="s"/>
18
- <table cellspacing="3" cellpadding="3" border="0" width="50%">
19
- <tr><td>Ваш&nbsp;email</td><td><input type="text" name="ne" size="30"/></td></tr>
20
- <tr><td colspan="2" style="text-align: center"><input type="submit" value="Подписать&nbsp;меня"/></td></tr>
21
- </table>
22
- </form>';
23
 
24
- $newsletter_labels['widget_form'] =
25
- '<form action="{newsletter_url}" method="post">
26
- {text}
27
- <p><input type="text" name="nn" value="Ваше имя" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/></p>
28
- <p><input type="text" name="ne" value="Ваш e-mail" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/></p>
29
- <p><input type="submit" value="Подписаться"/></p>
30
- <input type="hidden" name="na" value="s"/>
31
- </form>';
32
 
 
 
 
 
 
 
 
33
 
34
- $newsletter_labels['widget_form_noname'] =
35
- '<form action="{newsletter_url}" method="post">
36
- {text}
37
- <p><input type="text" name="ne" value="Ваш e-mail" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/></p>
38
- <p><input type="submit" value="Подписаться"/></p>
39
- <input type="hidden" name="na" value="s"/>
40
- </form>';
41
 
 
 
 
 
42
 
 
 
43
 
44
- $newsletter_labels['embedded_form'] =
45
- '<form action="{newsletter_url}" method="post">
46
- <p><input type="text" name="ne" value="Ваш e-mail" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/>
47
- &nbsp;<input type="text" name="nn" value="Ваше имя" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/>
48
- <input type="submit" value="Подписаться"/>
49
- <input type="hidden" name="na" value="s"/></p>
50
- </form>';
51
 
52
- // Example of embedded form without name
 
 
53
 
54
- $newsletter_labels['embedded_form_noname'] =
55
- '<form action="{newsletter_url}" method="post">
56
- <p><input type="text" name="ne" value="Ваш e-mail" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/>
57
- <input type="submit" value="Подписаться"/>
58
- <input type="hidden" name="na" value="s"/></p>
59
- </form>';
60
 
 
 
61
 
62
- // Errors on subscription
63
- $newsletter_labels['error_email'] = 'Неверный e-mail. <a href="javascript:history.back()">Назад</a>.';
64
- $newsletter_labels['error_name'] = 'Имя должно быть указано. <a href="javascript:history.back()">Назад</a>.';
65
-
66
- ?>
1
  <?php
2
 
3
+ $defaults_profile = array();
4
+ $defaults_profile['email_error'] = 'Неверный e-mail.';
5
+ $defaults_profile['name_error'] = 'Имя должно быть указано.';
 
 
 
 
 
 
 
6
 
7
+ $defaults = array();
8
+ // Subscription page introductory text (befor the subscription form)
9
+ $defaults['subscription_text'] =
10
+ "<p>Вы можете подписаться на получение новостей сайта, используя форму ниже.</p>
11
+ <p>На ваш почтовый ящик будет выслано письмо для подтверждения. Пожалуйста, ознакомьтесь с инструкциями в письме, для завершения процедуры.</p>";
12
 
13
+ // Message show after a subbscription request has made.
14
+ $defaults['subscribed_text'] =
15
+ "<p>Вы успешно подписаны на рассылку. Вы получите письмо с подтверждением через несколько минут. Перейдите по ссылке в письме для подтверждения. Если в течении 15 минут письмо все-таки не пришло, проверьте папку со спамом на вашем ящике, на случай если почтовая служба сочла письмо спамом. Если же письма нигде нет, свяжитесь с администратором сайта</a>.</p>";
 
 
 
 
 
16
 
17
+ // Confirmation email subject (double opt-in)
18
+ $defaults['confirmation_subject'] =
19
+ "{name}, Подвердите вашу подписку на новостную ленту {blog_title}";
 
 
 
 
 
20
 
21
+ // Confirmation email body (double opt-in)
22
+ $defaults['confirmation_message'] =
23
+ "<p>Здравствуйте, {name},</p>
24
+ <p>От Вас поступил запрос на получение новостной рассылки. Вы можете подтвердить его, кликнув на эту <a href=\"{subscription_confirm_url}\"><strong>ссылку</strong></a>. Если ссылка по каким-то причинам не нажимается, вставьте вручную в браузер, ссылку:</p>
25
+ <p>{subscription_confirm_url}</p>
26
+ <p>Если Вы не посылали запрос, или кто-то это сделал за Вас, просто проигнорируйте это письмо.</p>
27
+ <p>Спасибо!</p>";
28
 
 
 
 
 
 
 
 
29
 
30
+ // Subscription confirmed text (after a user clicked the confirmation link
31
+ // on the email he received
32
+ $defaults['confirmed_text'] =
33
+ "<p>Ваша подписка подтверждена! Спасибо, {name}!</p>";
34
 
35
+ $defaults['confirmed_subject'] =
36
+ "Добро пожаловать, {name}";
37
 
38
+ $defaults['confirmed_message'] =
39
+ "<p>Вы были успешно подписаны на новостную ленту {blog_title}.</p>
40
+ <p>Спасибо!</p>";
 
 
 
 
41
 
42
+ // Unsubscription request introductory text
43
+ $defaults['unsubscription_text'] =
44
+ "<p>Пожалуйста, подведите свой отказ от подписки, кликнув <a href=\"{unsubscription_confirm_url}\">здесь</a>.</p>";
45
 
46
+ // When you finally loosed your subscriber
47
+ $defaults['unsubscribed_text'] =
48
+ "<p>Это сделает нам немножечко больно, но мы отписали Вас от получения новостей...</p>";
 
 
 
49
 
50
+ $defaults['unsubscribed_subject'] =
51
+ "До свидания, {name}";
52
 
 
 
 
 
 
languages/ru_RU_options.php DELETED
@@ -1,66 +0,0 @@
1
- <?php
2
- // This file contains the default options values
3
- $newsletter_default_options['from_email'] = get_option('admin_email');
4
- $newsletter_default_options['from_name'] = get_option('blogname');
5
-
6
-
7
-
8
- // Subscription page introductory text (befor the subscription form)
9
- $newsletter_default_options['subscription_text'] =
10
- "<p>Вы можете подписаться на получение новостей сайта, используя форму ниже.</p>
11
- <p>На ваш почтовый ящик будет выслано письмо для подтверждения. Пожалуйста, ознакомьтесь с инструкциями в письме, для завершения процедуры.</p>";
12
-
13
- // Message show after a subbscription request has made.
14
- $newsletter_default_options['subscribed_text'] =
15
- "<p>Вы успешно подписаны на рассылку. Вы получите письмо с подтверждением через несколько минут. Перейдите по ссылке в письме для подтверждения. Если в течении 15 минут письмо все-таки не пришло, проверьте папку со спамом на вашем ящике, на случай если почтовая служба сочла письмо спамом. Если же письма нигде нет, свяжитесь с администратором сайта</a>.</p>";
16
-
17
- // Confirmation email subject (double opt-in)
18
- $newsletter_default_options['confirmation_subject'] =
19
- "{name}, Подвердите вашу подписку на новостную ленту {blog_title}";
20
-
21
- // Confirmation email body (double opt-in)
22
- $newsletter_default_options['confirmation_message'] =
23
- "<p>Здравствуйте, {name},</p>
24
- <p>От Вас поступил запрос на получение новостной рассылки. Вы можете подтвердить его, кликнув на эту <a href=\"{subscription_confirm_url}\"><strong>ссылку</strong></a>. Если ссылка по каким-то причинам не нажимается, вставьте вручную в браузер, ссылку:</p>
25
- <p>{subscription_confirm_url}</p>
26
- <p>Если Вы не посылали запрос, или кто-то это сделал за Вас, просто проигнорируйте это письмо.</p>
27
- <p>Спасибо!</p>";
28
-
29
-
30
- // Subscription confirmed text (after a user clicked the confirmation link
31
- // on the email he received
32
- $newsletter_default_options['confirmed_text'] =
33
- "<p>Ваша подписка подтверждена! Спасибо, {name}!</p>";
34
-
35
- $newsletter_default_options['confirmed_subject'] =
36
- "Добро пожаловать, {name}";
37
-
38
- $newsletter_default_options['confirmed_message'] =
39
- "<p>Вы были успешно подписаны на новостную ленту {blog_title}.</p>
40
- <p>Спасибо!</p>";
41
-
42
- // Unsubscription request introductory text
43
- $newsletter_default_options['unsubscription_text'] =
44
- "<p>Пожалуйста, подведите свой отказ от подписки, кликнув <a href=\"{unsubscription_confirm_url}\">здесь</a>.</p>";
45
-
46
- // When you finally loosed your subscriber
47
- $newsletter_default_options['unsubscribed_text'] =
48
- "<p>Это сделает нам немножечко больно, но мы отписали Вас от получения новостей...</p>";
49
-
50
- $newsletter_default_options['unsubscribed_subject'] =
51
- "До свидания, {name}";
52
-
53
- $newsletter_default_options['unsubscribed_message'] =
54
- "<p>The message confirm your unsubscription to {blog_title} newsletter.</p>
55
- <p>Good bye!</p>";
56
-
57
- $newsletter_default_options['subscription_form'] =
58
- '<form method="post" action="" style="text-align: center">
59
- <input type="hidden" name="na" value="s"/>
60
- <table cellspacing="3" cellpadding="3" border="0" width="50%">
61
- <tr><td>Ваше&nbsp;имя</td><td><input type="text" name="nn" size="30"/></td></tr>
62
- <tr><td>Ващ&nbsp;e-mail</td><td><input type="text" name="ne" size="30"/></td></tr>
63
- <tr><td colspan="2" style="text-align: center"><input type="submit" value="Подписать меня"/></td></tr>
64
- </table>
65
- </form>';
66
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
log.txt ADDED
@@ -0,0 +1 @@
 
1
+ ---
main.php CHANGED
@@ -2,62 +2,412 @@
2
 
3
  @include_once 'commons.php';
4
 
5
- $options = get_option('newsletter_main');
6
 
7
- if ($action == 'save') {
8
- $options = stripslashes_deep($_POST['options']);
9
- update_option('newsletter_main', $options);
10
  }
 
 
11
 
12
- $nc = new NewsletterControls($options);
13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  ?>
 
 
15
 
 
 
 
 
 
 
 
 
 
16
  <div class="wrap">
17
 
18
- <h2><?php _e('Newsletter Configuration', 'newsletter'); ?></h2>
19
 
20
- <?php require_once 'header.php'; ?>
21
 
22
- <p>
23
- <strong>Newsletter has an <a href="http://www.satollo.net/plugins/newsletter">official page</a> where
24
- to find documentation on how it
25
- works and how to configure it. Version history and tips are located on
26
- <a href="http://www.satollo.net/tag/newsletter">this archive</a>. Questions can be submitted
27
- on <a href="http://www.satollo.net/newsletter-help">this help page</a>.</strong>
28
- </p>
29
-
30
  <form method="post" action="">
31
- <?php wp_nonce_field(); ?>
32
- <input type="hidden" value="<?php echo NEWSLETTER; ?>" name="options[version]"/>
 
 
 
 
 
 
 
 
 
33
 
34
- <h3><?php _e('General parameters', 'newsletter'); ?></h3>
35
  <table class="form-table">
36
  <tr valign="top">
37
- <th><?php _e('Enable access to editors?', 'newsletter'); ?></th>
38
  <td>
39
- <?php $nc->yesno('editor'); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  </td>
41
  </tr>
42
  <tr valign="top">
43
- <th><?php _e('Always show panels in english?', 'newsletter'); ?></th>
44
  <td>
45
- <?php $nc->yesno('no_translation'); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  <br />
47
- <?php _e('The author does NOT maintain translations, so if you have a doubt about some texts, disable the translations', 'newsletter'); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  </td>
49
  </tr>
50
  <tr valign="top">
51
- <th><?php _e('Logging', 'newsletter'); ?></th>
52
  <td>
53
- <?php $nc->select('logs', array(0=>'None', 1=>'Normal', 2=>'Debug')); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  <br />
55
- <?php _e('Debug level saves user data on file system, use only to debug problems.', 'newsletter'); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  </td>
57
  </tr>
 
 
 
 
 
 
 
 
 
 
 
58
  </table>
 
59
  <p class="submit">
60
- <?php $nc->button('save', __('Save', 'newsletter')); ?>
61
  </p>
 
62
  </form>
 
63
  </div>
2
 
3
  @include_once 'commons.php';
4
 
5
+ $nc = new NewsletterControls();
6
 
7
+ if (!$nc->is_action()) {
8
+ $nc->data = get_option('newsletter_main');
 
9
  }
10
+ else {
11
+ if ($nc->is_action('remove')) {
12
 
13
+ $wpdb->query("delete from " . $wpdb->prefix . "options where option_name like 'newsletter%'");
14
 
15
+ $wpdb->query("drop table " . $wpdb->prefix . "newsletter, " . $wpdb->prefix . "newsletter_stats, " .
16
+ $wpdb->prefix . "newsletter_emails, " . $wpdb->prefix . "newsletter_profiles, " .
17
+ $wpdb->prefix . "newsletter_work");
18
+
19
+ echo 'Newsletter plugin destroyed. Please, deactivate it now.';
20
+ return;
21
+ }
22
+
23
+ if ($nc->is_action('save')) {
24
+ $errors = null;
25
+
26
+ // Validation
27
+ $nc->data['sender_email'] = $newsletter->normalize_email($nc->data['sender_email']);
28
+ if (!$newsletter->is_email($nc->data['sender_email'])) {
29
+ $errors = __('Sender email is not correct');
30
+ }
31
+
32
+ $nc->data['return_path'] = $newsletter->normalize_email($nc->data['return_path']);
33
+ if (!$newsletter->is_email($nc->data['return_path'], true)) {
34
+ $errors = __('Return path email is not correct');
35
+ }
36
+ // With some providers the return path must be left empty
37
+ //if (empty($options['return_path'])) $options['return_path'] = $options['sender_email'];
38
+
39
+ $nc->data['test_email'] = $newsletter->normalize_email($nc->data['test_email']);
40
+ if (!$newsletter->is_email($nc->data['test_email'], true)) {
41
+ $errors = __('Test email is not correct');
42
+ }
43
+
44
+ $nc->data['reply_to'] = $newsletter->normalize_email($nc->data['reply_to']);
45
+ if (!$newsletter->is_email($nc->data['reply_to'], true)) {
46
+ $errors = __('Reply to email is not correct');
47
+ }
48
+
49
+ $nc->data['mode'] = (int)$nc->data['mode'];
50
+ $nc->data['logs'] = (int)$nc->data['logs'];
51
+
52
+ if ($errors == null) {
53
+ update_option('newsletter_main', $nc->data);
54
+ }
55
+ }
56
+
57
+ if ($action == 'test') {
58
+ for ($i=0; $i<5; $i++) {
59
+ if (!empty($nc->data['test_email_' . $i])) {
60
+ $r = $newsletter->mail($nc->data['test_email_' . $i],
61
+ 'Test email from Newsletter Plugin', '<p>This is a test message from Newsletter Plugin. You are reading it, so the plugin is working.</p>',
62
+ true, null, 1);
63
+ }
64
+ }
65
+ $messages = 'Test emails sent. Check the test mailboxes.';
66
+ }
67
+ }
68
+
69
+
70
+ $nc->errors($errors);
71
+ $nc->messages($messages);
72
  ?>
73
+ <script>
74
+ jQuery(document).ready(function () {
75
 
76
+ jQuery(".wrap h3").each(function () {
77
+ jQuery(this).nextUntil('h3').hide();
78
+ });
79
+
80
+ jQuery(".wrap h3").click(function () {
81
+ jQuery(this).nextUntil('h3').toggle();
82
+ });
83
+ });
84
+ </script>
85
  <div class="wrap">
86
 
87
+ <h2>Newsletter Main Configuration</h2>
88
 
89
+ <p><a href="javascript:void(jQuery('.hints').toggle())">Show/hide detailed documentation</a></p>
90
 
 
 
 
 
 
 
 
 
91
  <form method="post" action="">
92
+ <?php $nc->init(); ?>
93
+
94
+
95
+ <h3>Main settings</h3>
96
+
97
+ <p class="intro">
98
+ Configurations on this sub panel can block emails sent by Newsletter Pro. It's not a plugin limit but odd restrictions imposed by
99
+ hosting providers. It's advisable to careful read the detailed documentation you'll found under every options, specially on the "return path"
100
+ field. Try different combination of setting below before send a support request and do it in this way: one single change - test - other single
101
+ change - test, and so on. Thank you for your collaboration.
102
+ </p>
103
 
 
104
  <table class="form-table">
105
  <tr valign="top">
106
+ <th>Sender name and address</th>
107
  <td>
108
+ email address (required): <?php $nc->text('sender_email', 40); ?>
109
+ name (optional): <?php $nc->text('sender_name', 40); ?>
110
+
111
+ <div class="hints">
112
+ These are the name and email address a subscriber will see on emails he'll receive.
113
+ Be aware that hosting providers can block email with a sender address not of the same domain of the blog.<br />
114
+ For example, if your blog is www.myblog.com, using as sender email "info@myblog.com" or
115
+ "newsletter@myblog.com" is safer than using "myaccount@gmail.com". The name is optional but is more professional
116
+ to set it (even if some providers with bugged mail server do not send email with a sender name set as reported by
117
+ a customer).
118
+ </div>
119
+ </td>
120
+ </tr>
121
+ <tr>
122
+ <th>Generic test subscribers</th>
123
+ <td>
124
+ <?php for ($i=0; $i<5; $i++) { ?>
125
+ email: <?php $nc->text('test_email_' . $i, 30); ?> name: <?php $nc->text('test_name_' . $i, 30); ?>
126
+ sex: <?php $nc->select('test_sex_' . $i, array('n'=>'None', 'f'=>'Female', 'm'=>'Male')); ?><br />
127
+ <?php } ?>
128
+ <div class="hints">
129
+ These names and addresses are used by test functionalities on configuration panel. Be sure to fill at least the first
130
+ test subscriber.<br />
131
+ <strong>Do not use as email address the same address set as "sender"</strong> (see above), usually it does not work.<br />
132
+ <strong>You should make a test every time you change one of the settings above</strong>.
133
+ </div>
134
+ </td>
135
+ </tr>
136
+ <tr valign="top">
137
+ <th>Max emails per hour</th>
138
+ <td>
139
+ <?php $nc->text('scheduler_max', 5); ?>
140
+ <div class="hints">
141
+ The internal engine of Newsletter Pro sends email with the specified rate to stay under
142
+ provider limits. The default value is 100 a very low value. The right value for you
143
+ depends on your provider or server capacity.<br />
144
+ Some examples. Hostgator: 500. Dreamhost: 100, asking can be raised to 200. Go Daddy: 1000 per day using their SMTP,
145
+ unknown per hour rate. Gmail: 500 per day using their SMTP, unknown per hour rate.<br />
146
+ My sites are on Hostgator or Linode VPS.<br />
147
+ If you have a service with no limits on the number of emails, still PHP have memory and time limits. Newsletter Pro
148
+ does it's best to detect those limits and to respect them so it can send out less emails per hour than excepted.
149
+ </div>
150
+ </td>
151
+ </tr>
152
+ <tr valign="top">
153
+ <th>Newsletter user interaction page</th>
154
+ <td>
155
+ <?php $nc->page_themes('theme'); ?><br />
156
+ or specify a blog page address:<br />
157
+ WordPress page URL: <?php $nc->text('url', 70); ?> (eg. <?php echo get_option('home') . '/newsletter'; ?>, optional)
158
+
159
+ <div class="hints">
160
+ Newsletter Pro needs to interact with subscribers: subscription form, welcome messages, cancellation messages,
161
+ profile editing form. If you want all those interactions within you blog theme, create a WordPress page and put
162
+ in its body <strong>only</strong> the short code [newsletter] (as is). Then open that page in your browser and copy the
163
+ page address (URL) in this field.<br />
164
+ If you prefer to keep all those interaction out of your blog in a specific designed web page, use the text area
165
+ to create a full valid HTML page. That page must contain the tag {message} used by Newspetter Pro to insert its
166
+ messages. A basic template is already there for your convenience.
167
+ </div>
168
+ </td>
169
+ </tr>
170
+ <tr valign="top">
171
+ <th>Return path</th>
172
+ <td>
173
+ <?php $nc->text('return_path', 40); ?> (valid email address)
174
+ <div class="hints">
175
+ This is the email address where delivery error messages are sent. Error message are sent back from mail systems when
176
+ an email cannot be delivered to the receiver (full mailbox, unrecognized user and invalid address are the most common
177
+ errors).<br />
178
+ <strong>Some providers do not accept this field and block emails is present or if the email address has a
179
+ different domain of the blog</strong> (see above the sender field notes). If you experience problem sending emails
180
+ (just do some tests), try to leave it blank.
181
+ </div>
182
  </td>
183
  </tr>
184
  <tr valign="top">
185
+ <th>Reply to</th>
186
  <td>
187
+ <?php $nc->text('reply_to', 40); ?> (valid email address)
188
+ <div class="hints">
189
+ This is the email address where subscribers will reply (eg. if they want to reply to a newsletter). Leave it blank if
190
+ you don't want to specify a different address from the sender email above. As for return path, come provider do not like this
191
+ setting active.
192
+ </div>
193
+ </td>
194
+ </tr>
195
+
196
+
197
+ </table>
198
+ <p class="submit">
199
+ <?php $nc->button('save', 'Save'); ?>
200
+ <?php $nc->button('test', 'Send a test email'); ?>
201
+ </p>
202
+
203
+
204
+
205
+
206
+ <h3>General parameters</h3>
207
+
208
+ <table class="form-table">
209
+ <!--
210
+ <tr valign="top">
211
+ <th><?php _e('Popup form number', 'newsletter'); ?></th>
212
+ <td>
213
+ <?php $nc->text('popup_form', 40); ?>
214
  <br />
215
+ <?php _e('
216
+ Form to be used for integration with wp-super-popup. Leave it empty to use the default form'); ?>
217
+ </td>
218
+ </tr>
219
+ -->
220
+ <tr valign="top">
221
+ <th>Force receiver</th>
222
+ <td>
223
+ <?php $nc->text('receiver', 40); ?> (valid email address)
224
+ <div class="hints">
225
+ If set, EVERY email sent by newsletter will be sent to this address. Set this only if you need to test
226
+ the plugin but already have a list of regular subscribers and you want to see what happens sending real
227
+ newsletters.<br />
228
+ If set, the subscription process works but new subscribers won't receive confirmation or welcome email!
229
+ </div>
230
  </td>
231
  </tr>
232
  <tr valign="top">
233
+ <th>Notifications</th>
234
  <td>
235
+ <?php $nc->yesno('notify'); ?>
236
+ <div class="hints">
237
+ Enable or disable notifications of subscription, unsubscription and other events to blog administrator.
238
+ </div>
239
+ </td>
240
+ </tr>
241
+ <tr valign="top">
242
+ <th>Enable access to editors?</th>
243
+ <td>
244
+ <?php $nc->yesno('editor'); ?>
245
+ </td>
246
+ </tr>
247
+ <tr valign="top">
248
+ <th>Logging</th>
249
+ <td>
250
+ <?php $nc->select('logs', array(0=>'None', 1=>'Only errors', 2=>'Normal', 3=>'Debug')); ?>
251
+ <div class="hints">
252
+ Be aware of two things: debug level may expose in your log file subscribers data and the file can
253
+ grow very quickly (tens of megabytes).
254
+ </div>
255
+ </td>
256
+ </tr>
257
+
258
+ <tr valign="top">
259
+ <th>API key</th>
260
+ <td>
261
+ <?php $nc->text('api_key', 40); ?>
262
+ <div class="hints">
263
+ When non-empty can be used to directly call the API for external integration. See API documentation on
264
+ documentation panel.
265
+ </div>
266
+ </td>
267
+ </tr>
268
+
269
+ <tr>
270
+ <th>Styling</th>
271
+ <td>
272
+ <?php $nc->textarea('css'); ?>
273
+ <div class="hints">
274
+ Add here your own css to style the forms. The whole form is enclosed in a div with class
275
+ "newsletter" and it's made with a table (guys, I know about your table less design
276
+ mission, don't blame me too much!)
277
+ </div>
278
+ </td>
279
+ </tr>
280
+ </table>
281
+ <p class="submit">
282
+ <?php $nc->button('save', 'Save'); ?>
283
+ </p>
284
+
285
+
286
+ <h3>Content locking</h3>
287
+
288
+ <p class="intro">
289
+ Content locking is a special feature that permits to "lock out" pieces of post content hiding them and unveiling
290
+ them only to newsletter subscribers. I use it to hide special content on some post inviting the reader to subscribe the newsletter
291
+ to read them.<br />
292
+ Content on post can be hidden surrounding it with [newsletter_lock] and [/newsletter_lock] short codes.<br />
293
+ A subscribe can see the hidden content after sign up or following a link on newsletters and welcome email generated by
294
+ {unlock_url} tag. That link bring the user to the URL below that should be a single premium post/page where there is the hidden
295
+ content or a list of premium posts with hidden content. The latter option can be implemented tagging all premium posts with a
296
+ WordPress tag or adding them to a specific WordPress category.
297
+ </p>
298
+ <table class="form-table">
299
+ <tr valign="top">
300
+ <th>Unlock destination URL</th>
301
+ <td>
302
+ <?php $nc->text('lock_url', 70); ?>
303
+ <div class="hints">
304
+ This is a web address (URL) where users are redirect when they click on unlocking URL ({unlock_url})
305
+ inserted in newsletters and welcome message. Usually you will redirect the user on a URL with with locked content
306
+ (that will become visible) or in a place with a list of link to premium content. I send them on a tag page
307
+ (http://www.satollo.net/tag/reserved) since I tag every premium content with "reserved".
308
+ </div>
309
+ </td>
310
+ </tr>
311
+ <tr valign="top">
312
+ <th>Denied content message</th>
313
+ <td>
314
+ <?php $nc->textarea('lock_message'); ?>
315
+ <div class="hints">
316
+ This message is shown in place of protected post or page content which is surrounded with
317
+ [newsletter_lock] and [/newsletter_lock] short codes.<br />
318
+ Use HTML to format the message. PHP code is accepted and executed. WordPress short codes provided
319
+ by other plugins work as well. It's a good
320
+ practice to add the short code [newsletter_embed] to show a subscription form so readers can sign
321
+ up the newsletter directly.<br />
322
+ You can also add a subscription HTML form right here, like:<br />
323
+ <br />
324
+ &lt;form&gt;<br />
325
+ Your email: &lt;input type="text" name="ne"/&gt;<br />
326
+ &lt;input type="submit" value="Subscribe now!"/&gt;<br />
327
+ &lt;/form&gt;<br />
328
+ <br />
329
+ There is no need to specify a form method or action, Newsletter Pro will take care of. To give more evidence of your
330
+ alternative content you can style it:<br />
331
+ <br />
332
+ &lt;div style="margin: 15px; padding: 15px; background-color: #ff9; border-color: 1px solid #000"&gt;<br />
333
+ blah, blah, blah...<br />
334
+ &lt;/div&gt;
335
+ </div>
336
+ </td>
337
+ </tr>
338
+ </table>
339
+ <p class="submit">
340
+ <?php $nc->button('save', 'Save'); ?>
341
+ </p>
342
+
343
+
344
+
345
+
346
+ <h3>System check</h3>
347
+
348
+ <table class="form-table">
349
+ <tr valign="top">
350
+ <th>Cron</th>
351
+ <td>
352
+ <?php if (defined('DISABLE_WP_CRON') && DISABLE_WP_CRON) { ?>
353
+ <strong>The WordPress cron system is disabled.</strong> Emails won't be
354
+ sent without a cron system active, check your wp-config.php file for definition
355
+ of DISABLE_WP_CRON and remove it.
356
+ <?php } ?>
357
+ </td>
358
+ </tr>
359
+ <tr valign="top">
360
+ <th>Database</th>
361
+ <td>
362
+ <?php $wait_timeout = $wpdb->get_var("select @@wait_timeout"); ?>
363
+ Wait timeout: <?php echo $wait_timeout; ?> seconds
364
  <br />
365
+ <?php if ($wait_timeout > 300) { ?>
366
+ The timeout is ok
367
+ <?php } else { ?>
368
+ <?php $wpdb->query("set session wait_timeout=300"); ?>
369
+ <?php if (300 != $wpdb->get_var("select @@wait_timeout")) { ?>
370
+ Cannot rise wait timout, problems may occur while sending.
371
+ <?php } else { ?>
372
+ Wait timeout can be changed
373
+ <?php } ?>
374
+ <?php } ?>
375
+ <div class="hints">
376
+ Connections to database have a idle time limit. If an email takes long time to be sent (due to
377
+ SMTP or local mail system slowness) this limit can be reached. Losing a connection is a bad thing for
378
+ Newsletter Pro, so it tries to raise this limit and to keep the connection alive sending queries.
379
+ </div>
380
+ </td>
381
+ </tr>
382
+ <tr valign="top">
383
+ <th>PHP Execution time</th>
384
+ <td>
385
+ Max execution time: <?php echo ini_get('max_execution_time'); ?> seconds
386
+ <div class="hints">
387
+ Even if PHP execution max time can usually be changed web servers can have external
388
+ controller that will kill PHP scripts if they run too long (like
389
+ fastcgi). Time limit can be a problem while using external SMTPs, if they are slow. Newsletter
390
+ Pro, while sending, continously check the time limit and stops it self as the timeout is approaching.
391
+ </div>
392
  </td>
393
  </tr>
394
+ <tr valign="top">
395
+ <th>Memory limit</th>
396
+ <td>
397
+ <?php echo @ini_get('memory_limit'); ?>
398
+ <div class="hints">
399
+ Newsletter Pro tries (as does WordPress on admin side) to raise the memory limit to
400
+ 256 megabytes while sending.
401
+ </div>
402
+ </td>
403
+ </tr>
404
+
405
  </table>
406
+
407
  <p class="submit">
408
+ <?php $nc->button_confirm('remove', 'Totally remove this plugin', 'Really sure to totally remove this plugin. All data will be lost!'); ?>
409
  </p>
410
+
411
  </form>
412
+ <p></p>
413
  </div>
manage.php DELETED
@@ -1,208 +0,0 @@
1
- <?php
2
-
3
- @include_once 'commons.php';
4
-
5
- $options = get_option('newsletter');
6
-
7
- if ($_POST['a'] == 'resend' && check_admin_referer()) {
8
- newsletter_send_confirmation(newsletter_get_subscriber(newsletter_request('id')));
9
- $_POST['a'] = 'search';
10
- }
11
-
12
- if ($_POST['a'] == 'remove' && check_admin_referer()) {
13
- newsletter_delete(newsletter_request('id'));
14
- $_POST['a'] = 'search';
15
- }
16
-
17
- if ($_POST['removeall'] && check_admin_referer()) {
18
- newsletter_delete_all();
19
- }
20
-
21
- if ($_POST['removeallunconfirmed'] && check_admin_referer()) {
22
- newsletter_delete_all('S');
23
- }
24
-
25
- if ($_POST['showallunconfirmed'] && check_admin_referer()) {
26
- $list = newsletter_get_unconfirmed();
27
- }
28
-
29
- if ($_POST['a'] == 'status' && check_admin_referer()) {
30
- newsletter_set_status(newsletter_request('id'), newsletter_request('status'));
31
- $_POST['a'] = 'search';
32
- }
33
-
34
- if ($_POST['a'] == 'save' && check_admin_referer()) {
35
- newsletter_save(stripslashes_deep($_POST['subscriber']));
36
- $_POST['a'] = 'search';
37
- }
38
-
39
- if ($_POST['a'] == 'search' && check_admin_referer()) {
40
- $status = isset($_POST['unconfirmed'])?'S':null;
41
- $order = $_POST['order'];
42
- $list = newsletter_search(newsletter_request('text'), $status, $order);
43
- }
44
-
45
- $options = null;
46
- $nc = new NewsletterControls($options, 'manage');
47
-
48
- ?>
49
- <script type="text/javascript">
50
- function newsletter_detail(id)
51
- {
52
- document.getElementById("action").value = "detail";
53
- document.getElementById("id").value = id;
54
- document.getElementById("channel").submit();
55
- }
56
- function newsletter_edit(id)
57
- {
58
- document.getElementById("action").value = "edit";
59
- document.getElementById("id").value = id;
60
- document.getElementById("channel").submit();
61
- }
62
- function newsletter_save()
63
- {
64
- document.getElementById("action").value = "save";
65
- document.getElementById("channel").submit();
66
- }
67
- function newsletter_remove(id)
68
- {
69
- document.getElementById("action").value = "remove";
70
- document.getElementById("id").value = id;
71
- document.getElementById("channel").submit();
72
- }
73
- function newsletter_set_status(id, status)
74
- {
75
- document.getElementById("action").value = "status";
76
- document.getElementById("id").value = id;
77
- document.getElementById("status").value = status;
78
- document.getElementById("channel").submit();
79
- }
80
- function newsletter_resend(id)
81
- {
82
- if (!confirm("<?php _e('Resend the subscription confirmation email?', 'newsletter'); ?>")) return;
83
- document.getElementById("action").value = "resend";
84
- document.getElementById("id").value = id;
85
- document.getElementById("channel").submit();
86
- }
87
-
88
- </script>
89
-
90
- <div class="wrap">
91
- <h2><?php _e('Newsletter Subscribers', 'newsletter'); ?></h2>
92
-
93
- <?php require_once 'header.php'; ?>
94
-
95
- <form id="channel" method="post" action="">
96
- <?php wp_nonce_field(); ?>
97
- <input type="hidden" id="action" name="a" value="search"/>
98
- <input type="hidden" id="id" name="id" value=""/>
99
- <input type="hidden" id="status" name="status" value=""/>
100
-
101
- <div style="display: <?php if ($_POST['a'] == 'edit') echo 'none'; else echo 'block'; ?>">
102
- <table class="form-table">
103
- <tr valign="top">
104
- <th><?php _e('Search', 'newsletter'); ?></th>
105
- <td>
106
- <input name="text" type="text" size="50" value="<?php echo htmlspecialchars(newsletter_request('text'))?>"/>
107
- <input type="submit" value="<?php _e('Search', 'newsletter'); ?>" />
108
- <br />
109
- <?php _e('Press without filter to show all. Max 100 results will be shown. Use export panel to get all subscribers.', 'newsletter'); ?>
110
- </td>
111
- </tr>
112
- <tr valign="top">
113
- <th scope="row">&nbsp;</th>
114
- <td>
115
- <input name="unconfirmed" type="checkbox" <?php echo isset($_POST['unconfirmed'])?'checked':''; ?>/>
116
- <?php _e('Only not yet confirmed', 'newsletter'); ?>
117
- </td>
118
- </tr>
119
- <tr valign="top">
120
- <th><?php _e('Order', 'newsletter'); ?></th>
121
- <td>
122
- <select name="order">
123
- <option value="id">id</option>
124
- <option value="email">email</option>
125
- </select>
126
- </td>
127
- </tr>
128
- </table>
129
- </div>
130
-
131
- <?php
132
- if ($_POST['a'] == 'edit' && check_admin_referer()) {
133
- $subscriber = newsletter_get_subscriber($_POST['id']);
134
- ?>
135
- <input type="hidden" name="subscriber[id]" value="<?php echo $subscriber->id; ?>"/>
136
- <table class="form-table">
137
- <tr valign="top">
138
- <th>Name</th>
139
- <td><input type="text" name="subscriber[name]" size="40" value="<?php echo htmlspecialchars($subscriber->name); ?>"/></td>
140
- </tr>
141
- <tr valign="top">
142
- <th>Email</th>
143
- <td><input type="text" name="subscriber[email]" size="40" value="<?php echo htmlspecialchars($subscriber->email); ?>"/></td>
144
- </tr>
145
- </table>
146
- <p class="submit"><input type="button" value="Save" onclick="newsletter_save()"/></p>
147
-
148
- <?php } ?>
149
-
150
- </form>
151
-
152
-
153
- <?php if ($_POST['a'] == 'edit') { ?>
154
- </div>
155
- <?php return; } ?>
156
-
157
-
158
- <form method="post" action="">
159
- <?php wp_nonce_field(); ?>
160
- <p class="submit">
161
- <!--<input type="submit" value="Remove all" name="removeall" onclick="return confirm('Are your sure, really sure?')"/>-->
162
- <input type="submit" value="<?php _e('Remove all unconfirmed', 'newsletter'); ?>" name="removeallunconfirmed" onclick="return confirm('<?php _e('Are your sure, really sure?', 'newsletter'); ?>')"/>
163
- </p>
164
- </form>
165
-
166
-
167
-
168
- <h3><?php _e('Subscriber\'s statistics', 'newsletter'); ?></h3>
169
- <?php _e('Confirmed subscriber', 'newsletter'); ?>: <?php echo $wpdb->get_var("select count(*) from " . $wpdb->prefix . "newsletter where status='C'"); ?>
170
- <br />
171
- <?php _e('Unconfirmed subscriber', 'newsletter'); ?>: <?php echo $wpdb->get_var("select count(*) from " . $wpdb->prefix . "newsletter where status='S'"); ?>
172
-
173
- <h3><?php _e('Results', 'newsletter'); ?></h3>
174
-
175
- <?php
176
- if ($list) {
177
- echo '<table class="bordered-table" border="1" cellspacing="5">';
178
- echo '<tr><th>Id</th><th>' . __('Email', 'newsletter') . '</th><th>' . __('Name', 'newsletter') . '</th><th>' . __('Status', 'newsletter') . '</th><th>' . __('Actions', 'newsletter') . '</th><th>' . __('Profile', 'newsletter') . '</th></tr>';
179
- foreach($list as $s) {
180
- echo '<tr>';
181
- echo '<td>' . $s->id . '</td>';
182
- echo '<td>' . $s->email . '</td>';
183
- echo '<td>' . $s->name . '</td>';
184
- echo '<td><small>' . ($s->status=='S'?'Not confirmed':'Confirmed') . '</small></td>';
185
- echo '<td><small>';
186
- echo '<a href="javascript:void(newsletter_edit(' . $s->id . '))">' . __('edit', 'newsletter') . '</a>';
187
- echo ' | <a href="javascript:void(newsletter_remove(' . $s->id . '))">' . __('remove', 'newsletter') . '</a>';
188
- echo ' | <a href="javascript:void(newsletter_set_status(' . $s->id . ', \'C\'))">' . __('confirm', 'newsletter') . '</a>';
189
- echo ' | <a href="javascript:void(newsletter_set_status(' . $s->id . ', \'S\'))">' . __('unconfirm', 'newsletter') . '</a>';
190
- echo ' | <a href="javascript:void(newsletter_resend(' . $s->id . '))">' . __('resend confirmation', 'newsletter') . '</a>';
191
- echo '</small></td>';
192
- echo '<td><small>';
193
- $query = $wpdb->prepare("select name,value from " . $wpdb->prefix . "newsletter_profiles where newsletter_id=%d", $s->id);
194
- $profile = $wpdb->get_results($query);
195
- foreach ($profile as $field) {
196
- echo htmlspecialchars($field->name) . ': ' . htmlspecialchars($field->value) . '<br />';
197
- }
198
- echo 'Token: ' . $s->token;
199
-
200
- echo '</small></td>';
201
-
202
- echo '</tr>';
203
- }
204
- echo '</table>';
205
- }
206
- ?>
207
-
208
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
newsletter.php DELETED
@@ -1,474 +0,0 @@
1
- <?php
2
-
3
- @include_once 'commons.php';
4
-
5
- $options = get_option('newsletter_email');
6
- $options_newsletter = get_option('newsletter');
7
-
8
- if (isset($_POST['save']) && check_admin_referer()) {
9
- $options = stripslashes_deep($_POST['options']);
10
- update_option('newsletter_email', $options);
11
- }
12
-
13
- // Auto composition
14
- if (isset($_POST['auto']) && check_admin_referer()) {
15
- // Load the theme
16
- $options = stripslashes_deep($_POST['options']);
17
-
18
- $file = newsletter_get_theme_dir($options['theme']) . '/theme.php';
19
-
20
- // Execute the theme file and get the content generated
21
- ob_start();
22
- @include($file);
23
- $options['message'] = ob_get_contents();
24
- ob_end_clean();
25
-
26
- if ($options['novisual']) {
27
- $options['message'] = "<html>\n<head>\n<style type=\"text/css\">\n" . newsletter_get_theme_css($options_email['theme']) .
28
- "\n</style>\n</head>\n<body>\n" . $options['message'] . "\n</body>\n</html>";
29
- }
30
- }
31
-
32
- // Reset the batch
33
- if (isset($_POST['reset']) && check_admin_referer()) {
34
- newsletter_delete_batch_file();
35
- wp_clear_scheduled_hook('newsletter_cron_hook');
36
- delete_option('newsletter_batch', array());
37
- }
38
-
39
- if (isset($_POST['scheduled_simulate']) && check_admin_referer()) {
40
- $options = stripslashes_deep($_POST['options']);
41
- update_option('newsletter_email', $options);
42
- newsletter_send_scheduled(0, true);
43
- }
44
-
45
- if (isset($_POST['scheduled_send']) && check_admin_referer()) {
46
- $options = stripslashes_deep($_POST['options']);
47
- update_option('newsletter_email', $options);
48
- newsletter_send_scheduled(0, false);
49
- }
50
-
51
- if (isset($_POST['restore']) && check_admin_referer()) {
52
- $batch = newsletter_load_batch_file();
53
- update_option('newsletter_batch', $batch);
54
- newsletter_delete_batch_file();
55
- }
56
-
57
- // Theme style
58
-
59
- $css_url = null;
60
- $theme_dir = newsletter_get_theme_dir($options['theme']);
61
- if (file_exists($theme_dir . '/style.css')) {
62
- $css_url = newsletter_get_theme_url($options['theme']) . '/style.css';
63
- }
64
-
65
- $nc = new NewsletterControls($options, 'composer');
66
-
67
- ?>
68
- <?php if (!isset($options['novisual'])) { ?>
69
- <script type="text/javascript" src="<?php echo get_option('siteurl'); ?>/wp-content/plugins/newsletter/tiny_mce/tiny_mce.js"></script>
70
- <script type="text/javascript">
71
- tinyMCE.init({
72
- mode : "textareas",
73
- theme : "advanced",
74
- plugins: "table,fullscreen",
75
- theme_advanced_disable : "styleselect",
76
- theme_advanced_buttons1_add: "forecolor,blockquote,code",
77
- theme_advanced_buttons3 : "tablecontrols,fullscreen",
78
- relative_urls : false,
79
- remove_script_host : false,
80
- theme_advanced_toolbar_location : "top",
81
- document_base_url : "<?php echo get_option('home'); ?>/"
82
- <?php
83
- if ($css_url != null) {
84
- echo ', content_css: "' . $css_url . '?' . time() . '"';
85
- }
86
- ?>
87
- });
88
- </script>
89
- <?php } ?>
90
-
91
- <div class="wrap">
92
-
93
- <h2>Newsletter Composer</h2>
94
-
95
- <?php if (!touch(dirname(__FILE__) . '/test.tmp')) { ?>
96
- <div class="error fade" style="background-color:red;"><p><strong>It seems that Newsletter plugin folder is not writable. Make it writable to let
97
- Newsletter write logs and save date when errors occour.</strong></p></div>
98
- <?php } ?>
99
-
100
- <?php require_once 'header.php'; ?>
101
-
102
- <form method="post" action="">
103
- <?php wp_nonce_field(); ?>
104
-
105
- <?php if (isset($_POST['restart']) && check_admin_referer()) { ?>
106
-
107
- <h3>Continuing with previous batch</h3>
108
- <div class="form-table">
109
- <?php
110
- $options = stripslashes_deep($_POST['options']);
111
- update_option('newsletter_email', $options);
112
- $batch = get_option('newsletter_batch');
113
-
114
- if (defined('NEWSLETTER_EXTRAS') && $batch['scheduled']) {
115
- newsletter_cron_task();
116
- }
117
- else {
118
- newsletter_send_batch();
119
- }
120
- ?>
121
- </div>
122
-
123
- <?php } ?>
124
-
125
-
126
- <?php if (isset($_POST['simulate']) && check_admin_referer()) { ?>
127
-
128
- <h3>Simulation</h3>
129
- <div class="form-table">
130
- <?php
131
- $options = stripslashes_deep($_POST['options']);
132
- update_option('newsletter_email', $options);
133
- $batch = array();
134
- $batch['id'] = 0;
135
- $batch['list'] = 0;
136
- $batch['scheduled'] = false;
137
- $batch['simulate'] = true;
138
-
139
- update_option('newsletter_batch', $batch);
140
-
141
- newsletter_send_batch();
142
- ?>
143
- </div>
144
-
145
- <?php } ?>
146
-
147
-
148
-
149
- <?php if (isset($_REQUEST['send']) && check_admin_referer()) { ?>
150
-
151
- <h3>Sending</h3>
152
- <div class="form-table">
153
- <?php
154
- $options = stripslashes_deep($_POST['options']);
155
- update_option('newsletter_email', $options);
156
- $batch = array();
157
- $batch['id'] = 0;
158
- $batch['list'] = 0;
159
- $batch['scheduled'] = false;
160
- $batch['simulate'] = false;
161
-
162
- update_option('newsletter_batch', $batch);
163
-
164
- newsletter_send_batch();
165
- ?>
166
- </div>
167
-
168
- <?php } ?>
169
-
170
-
171
-
172
- <?php if (isset($_POST['test']) && check_admin_referer()) { ?>
173
-
174
- <h3>Sending to test subscribers</h3>
175
- <div class="form-table">
176
- <?php
177
- $options = stripslashes_deep($_POST['options']);
178
- update_option('newsletter_email', $options);
179
- $subscribers = array();
180
- for ($i=1; $i<=10; $i++) {
181
- if (!$options['test_email_' . $i]) continue;
182
- $subscribers[$i-1]->name = $options['test_name_' . $i];
183
- $subscribers[$i-1]->email = $options['test_email_' . $i];
184
- $subscribers[$i-1]->token = 'FAKETOKEN';
185
- }
186
- newsletter_send_test($subscribers);
187
- ?>
188
- </div>
189
-
190
- <?php } ?>
191
-
192
-
193
-
194
- <?php
195
- $batch_file = newsletter_load_batch_file();
196
- if ($batch_file != null) {
197
- ?>
198
- <h3>Warning!!!</h3>
199
- <p>There is a batch saved to disk. That means an error occurred while sending.
200
- Would you try to restore
201
- that batch?<br />
202
- <input class="button" type="submit" name="restore" value="Restore batch data" onclick="return confirm('Restore batch data?')"/>
203
- </p>
204
- <?php } ?>
205
-
206
- <h3>Batch info</h3>
207
-
208
- <?php $batch = get_option('newsletter_batch'); ?>
209
- <?php if (!is_array($batch) || empty($batch)) { ?>
210
-
211
- <p><strong>No batch info found, it's ok!</strong></p>
212
-
213
- <?php } else { ?>
214
-
215
- <table class="form-table">
216
- <tr>
217
- <th>Status</th>
218
- <td>
219
- <?php
220
- if ($batch['scheduled']) {
221
-
222
- if ($batch['completed']) echo 'Completed';
223
- else {
224
- $time = wp_next_scheduled('newsletter_cron_hook');
225
- if ($time == 0) {
226
- echo 'Not completed but no next run found (errors?)';
227
- }
228
- else {
229
- echo 'Not completed, next run on ' . date('j/m/Y h:i', $time);
230
- echo ' (' . ((int)(($time-time())/60)) . ' minutes left)';
231
- }
232
- }
233
- }
234
- else {
235
- if ($batch['completed']) echo 'Completed';
236
- else echo 'Not completed (you should restart it)';
237
- }
238
- ?>
239
- <br />
240
- <?php echo $batch['message']; ?>
241
- </td>
242
- </tr>
243
- <tr>
244
- <th>Emails sent/total</th>
245
- <td><?php echo $batch['sent']; ?>/<?php echo $batch['total']; ?> (last id: <?php echo $batch['id']; ?>)</td>
246
- </tr>
247
- <!--
248
- <tr>
249
- <td>List</td>
250
- <td><?php echo $batch['list']; ?></td>
251
- </tr>
252
- -->
253
- <tr>
254
- <th>Sending type</th>
255
- <td><?php echo $batch['simulate']?"Simluation":"Real"; ?>/<?php echo $batch['scheduled']?"Scheduled":"Not scheduled"; ?></td>
256
- </tr>
257
- </table>
258
-
259
- <p class="submit">
260
- <?php if (!$batch['completed']) { ?>
261
- <input class="button" type="submit" name="restart" value="Restart batch" onclick="return confirm('Continue with this batch?')"/>
262
- <?php } ?>
263
- <input class="button" type="submit" name="reset" value="Reset batch" onclick="return confirm('Reset the batch status?')"/>
264
- </p>
265
-
266
- <?php } ?>
267
-
268
-
269
-
270
- <h3>Newsletter message</h3>
271
-
272
- <table class="form-table">
273
- <tr valign="top">
274
- <th>Newsletter name and tracking</th>
275
- <?php if (defined('NEWSLETTER_EXTRAS')) { ?>
276
- <td>
277
- <input name="options[name]" type="text" size="25" value="<?php echo htmlspecialchars($options['name'])?>"/>
278
- <input name="options[track]" value="1" type="checkbox" <?php echo $options['track']?'checked':''; ?>/>
279
- Track link clicks
280
- <br />
281
- When this option is enabled, each link in the email text will be rewritten and clicks
282
- on them intercepted.
283
- The symbolic name will be used to track the link clicks and associate them to a specific newsletter.
284
- Keep the name compact and significative.
285
- </td>
286
-
287
- <?php } else { ?>
288
- <td>Tracking options available with Newsletter Extras package</td>
289
- <?php } ?>
290
- </tr>
291
-
292
- <tr valign="top">
293
- <th>Subject</th>
294
- <td>
295
- <?php $nc->text('subject', 70); ?>
296
- <br />
297
- <?php _e('Tags: <strong>{name}</strong> receiver name.', 'newsletter'); ?>
298
- </td>
299
- </tr>
300
-
301
- <tr valign="top">
302
- <th>Message</th>
303
- <td>
304
- <?php $nc->checkbox('novisual', 'disable the visual editor'); ?>
305
- (save to apply and be sure to <a href="http://www.satollo.net/plugins/newsletter#composer">read here</a>)
306
- <br />
307
- <textarea name="options[message]" wrap="off" rows="20" style="font-family: monospace; width: 100%"><?php echo htmlspecialchars($options['message'])?></textarea>
308
- <br />
309
- <?php _e('Tags: <strong>{name}</strong> receiver name;
310
- <strong>{unsubscription_url}</strong> unsubscription URL;
311
- <strong>{token}</strong> the subscriber token.', 'newsletter'); ?>
312
- </td>
313
- </tr>
314
-
315
- <tr valign="top">
316
- <th>Theme</th>
317
- <td>
318
- <select name="options[theme]">
319
- <optgroup label="Included themes">
320
- <option <?php echo ('blank'==$options['theme'])?'selected':''; ?> value="blank">Blank</option>
321
- <option <?php echo ('default'==$options['theme'])?'selected':''; ?> value="default">Default</option>
322
- <option <?php echo ('with-picture'==$options['theme'])?'selected':''; ?> value="with-picture">With picture</option>
323
- </optgroup>
324
- <optgroup label="Extras themes">
325
- <?php
326
- $themes = newsletter_get_extras_themes();
327
-
328
- foreach ($themes as $theme) {
329
- echo '<option ' . (('$'.$theme)==$options['theme']?'selected':'') . ' value="$' . $theme . '">' . $theme . '</option>';
330
- }
331
- ?>
332
- </optgroup>
333
- <optgroup label="Custom themes">
334
- <?php
335
- $themes = newsletter_get_themes();
336
-
337
- foreach ($themes as $theme) {
338
- echo '<option ' . (('*'.$theme)==$options['theme']?'selected':'') . ' value="*' . $theme . '">' . $theme . '</option>';
339
- }
340
- ?>
341
- </optgroup>
342
- </select>
343
- <input class="button" type="submit" name="auto" value="Auto compose"/>
344
- </td>
345
- </tr>
346
- </table>
347
-
348
- <p class="submit">
349
- <input class="button" type="submit" name="save" value="Save"/>
350
- <input class="button" type="submit" name="test" value="Test"/>
351
- <input class="button" type="submit" name="simulate" value="Simulate" onclick="return confirm('Simulate? The test address will receive all emails!')"/>
352
- <input class="button" type="submit" name="send" value="Send" onclick="return confirm('Start a real newsletter sending batch?')"/>
353
- <?php if (defined('NEWSLETTER_EXTRAS')) { ?>
354
- <input class="button" type="submit" name="scheduled_simulate" value="Scheduled simulation" onclick="return confirm('Start a scheduled simulation?')"/>
355
- <input class="button" type="submit" name="scheduled_send" value="Scheduled send" onclick="return confirm('Start a scheduled real send?')"/>
356
- <?php } ?>
357
- </p>
358
-
359
- <h3>Theme parameters</h3>
360
- <p>Themes may not use such parameters!</p>
361
- <table class="form-table">
362
- <tr valign="top">
363
- <th>Number of posts on theme</th>
364
- <td>
365
- <input name="options[theme_posts]" type="text" size="5" value="<?php echo htmlspecialchars($options['theme_posts'])?>"/>
366
- </td>
367
- </tr>
368
- </table>
369
-
370
-
371
-
372
- <!--
373
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
374
- List:
375
- <select name="options[list]">
376
- <option value="0">General</option>
377
- <?php for ($i=1; $i<=10; $i++) { ?>
378
- <option value="<?php echo $i; ?>"><?php echo htmlspecialchars($options_newsletter['list_' . $i]); ?></option>
379
- <?php } ?>
380
- </select>
381
- -->
382
-
383
-
384
- <h3>Sending options</h3>
385
- <table class="form-table">
386
- <tr valign="top">
387
- <th>Max emails in a single batch</th>
388
- <td>
389
- <?php $nc->text('max', 5); ?>
390
- </td>
391
- </tr>
392
- <tr valign="top">
393
- <th>Receiver address for simulation</th>
394
- <td>
395
- <?php $nc->text('simulate_email', 50); ?>
396
- <br />
397
- <?php _e('When you simulate a sending process, emails are really sent but all to this
398
- email address. That helps to test out problems with mail server.', 'newsletter'); ?>
399
- </td>
400
- </tr>
401
- <tr valign="top">
402
- <th>Return path</th>
403
- <td>
404
- <?php $nc->text('return_path', 50); ?>
405
- <br />
406
- <?php _e('Force the return path to this email address. Return path is used from mail server to
407
- send back messages with delivery errors.', 'newsletter'); ?>
408
- </td>
409
- </tr>
410
- </table>
411
- <p class="submit">
412
- <input class="button" type="submit" name="save" value="<?php _e('Save', 'newsletter'); ?>"/>
413
- </p>
414
- <!--
415
- <tr valign="top">
416
- <td>
417
- Filter<br />
418
- <input name="options[filter]" type="text" size="30" value="<?php echo htmlspecialchars($options['filter'])?>"/>
419
- </td>
420
- </tr>
421
- -->
422
-
423
- <h3>Sending options for scheduler</h3>
424
-
425
- <?php if (defined('NEWSLETTER_EXTRAS')) { ?>
426
- <p>Scheduler is described <a href="http://www.satollo.net/plugins/newsletter-extras">here</a>.</p>
427
- <table class="form-table">
428
- <tr valign="top">
429
- <th>Interval between sending tasks</th>
430
- <td>
431
- <?php $nc->text('scheduler_interval', 5); ?>
432
- (minutes, minimum value is 1)
433
- </td>
434
- </tr>
435
- <tr valign="top">
436
- <th>Max number of emails per task</th>
437
- <td>
438
- <?php $nc->text('scheduler_max', 5); ?>
439
- (good value is 20 to 50)
440
- </td>
441
- </tr>
442
- </table>
443
- <p class="submit">
444
- <input class="button" type="submit" name="save" value="Save"/>
445
- </p>
446
- <?php } else { ?>
447
- <p><strong>Available only with <a href="http://www.satollo.net/plugins/newsletter-extras">Newsletter Extras</a> package</strong></p>
448
- <?php } ?>
449
-
450
-
451
- <h3>Test subscribers</h3>
452
- <p>
453
- Define more test subscriber to see how your email looks on different clients:
454
- GMail, Outlook, Thunderbird, Hotmail, ...
455
- </p>
456
-
457
- <table class="form-table">
458
- <?php for ($i=1; $i<=10; $i++) { ?>
459
- <tr valign="top">
460
- <th>Subscriber <?php echo $i; ?></th>
461
- <td>
462
- name: <input name="options[test_name_<?php echo $i; ?>]" type="text" size="30" value="<?php echo htmlspecialchars($options['test_name_' . $i])?>"/>
463
- &nbsp;&nbsp;&nbsp;
464
- email:<input name="options[test_email_<?php echo $i; ?>]" type="text" size="30" value="<?php echo htmlspecialchars($options['test_email_' . $i])?>"/>
465
- </td>
466
- </tr>
467
- <?php } ?>
468
- </table>
469
- <p class="submit">
470
- <input class="button" type="submit" name="save" value="Save"/>
471
- </p>
472
-
473
- </form>
474
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
options.php CHANGED
@@ -1,292 +1,400 @@
1
- <?php
2
-
3
- @include_once 'commons.php';
4
-
5
- $options = get_option('newsletter');
6
-
7
- if ($action == 'save') {
8
- $options = stripslashes_deep($_POST['options']);
9
- update_option('newsletter', $options);
10
- }
11
-
12
- $nc = new NewsletterControls($options);
13
- ?>
14
-
15
- <?php if ($options['novisual'] != 1) { ?>
16
- <script type="text/javascript" src="<?php echo get_option('siteurl'); ?>/wp-content/plugins/newsletter/tiny_mce/tiny_mce.js"></script>
17
-
18
- <script type="text/javascript">
19
- tinyMCE.init({
20
- mode : "specific_textareas",
21
- editor_selector : "visual",
22
- theme : "advanced",
23
- theme_advanced_disable : "styleselect",
24
- relative_urls : false,
25
- remove_script_host : false,
26
- theme_advanced_buttons3: "",
27
- theme_advanced_toolbar_location : "top",
28
- document_base_url : "<?php echo get_option('home'); ?>/"
29
- });
30
- </script>
31
- <?php } ?>
32
-
33
- <div class="wrap">
34
-
35
- <h2><?php _e('Newsletter Subscription and Unsubscription', 'newsletter'); ?></h2>
36
-
37
- <?php require_once 'header.php'; ?>
38
-
39
- <form method="post" action="">
40
- <?php wp_nonce_field(); ?>
41
-
42
- <h3><?php _e('Sender and subscription page', 'newsletter'); ?></h3>
43
-
44
- <?php _e('<p><strong>It\'s REQUIRED to complete such configuration.</strong></p>', 'newsletter'); ?>
45
-
46
- <table class="form-table">
47
- <tr valign="top">
48
- <th><?php _e('Sender email', 'newsletter'); ?></th>
49
- <td>
50
- <?php $nc->text('from_email', 50); ?>
51
- <br />
52
- <?php _e('Newsletter sender email address: the address subscribers will see the newsletters coming from.', 'newsletter'); ?>
53
- </td>
54
- </tr>
55
- <tr valign="top">
56
- <th><?php _e('Sender name'); ?></th>
57
- <td>
58
- <?php $nc->text('from_name', 50); ?>
59
- <br />
60
- <?php _e('The name of the newsletter sender subscribers will see on incoming email.', 'newsletter'); ?>
61
- </td>
62
- </tr>
63
- <tr valign="top">
64
- <th><?php _e('Subscription page URL', 'newsletter'); ?></th>
65
- <td>
66
- <?php $nc->text('url', 70); ?>
67
- <br />
68
- <?php _e('This is the page where you placed the <strong>[newsletter]</strong> short tag. (<a href="http://www.satollo.net/plugins/newsletter">Read more on plugin official page</a>)', 'newsleetter'); ?>
69
- </td>
70
- </tr>
71
-
72
- <tr valign="top">
73
- <th><?php _e('Theme to use for emails', 'newsletter'); ?></th>
74
- <td>
75
- <select name="options[theme]">
76
- <optgroup label="Included themes">
77
- <option <?php echo ('blank'==$options['theme'])?'selected':''; ?> value="blank">Blank</option>
78
- <option <?php echo ('messages'==$options['theme'])?'selected':''; ?> value="messages">For messages</option>
79
- </optgroup>
80
- <optgroup label="Extras themes">
81
- <?php
82
- $themes = newsletter_get_extras_themes();
83
-
84
- foreach ($themes as $theme) {
85
- echo '<option ' . (('$'.$theme)==$options['theme']?'selected':'') . ' value="$' . $theme . '">' . $theme . '</option>';
86
- }
87
- ?>
88
- </optgroup>
89
- <optgroup label="Custom themes">
90
- <?php
91
- $themes = newsletter_get_themes();
92
-
93
- foreach ($themes as $theme) {
94
- echo '<option ' . (('*'.$theme)==$options['theme']?'selected':'') . ' value="*' . $theme . '">' . $theme . '</option>';
95
- }
96
- ?>
97
- </optgroup>
98
- </select>
99
- <br />
100
- <?php _e('Selected theme has to be one with {message} tag inside, tag that will be replaced with messages. Use the blank theme to send messages as you see them in the editor.', 'newsletter'); ?>
101
- </td>
102
- </tr>
103
- </table>
104
- <p class="submit">
105
- <?php $nc->button('save', __('Save', 'newsletter')); ?>
106
- </p>
107
-
108
-
109
-
110
-
111
- <h3><?php _e('Subscription', 'newsletter'); ?></h3>
112
- <table class="form-table">
113
- <tr valign="top">
114
- <th>&nbsp;</th>
115
- <td>
116
- <?php $nc->checkbox('noname', __('Do not ask the user name, only email.', 'newsletter')); ?>
117
- </td>
118
- </tr>
119
- <tr valign="top">
120
- <th><?php _e('Subscription form page', 'newsletter'); ?></th>
121
- <td>
122
- <?php $nc->editor('subscription_text'); ?>
123
- <br />
124
- <?php _e('This is the text showed to subscriber before the subscription form which is added automatically.', 'newsletter'); ?>
125
- </td>
126
- </tr>
127
- <tr valign="top">
128
- <th><?php _e('Successfully subscription page', 'newsletter'); ?></th>
129
- <td>
130
- <?php $nc->editor('subscribed_text'); ?>
131
- <br />
132
- <?php _e('This is the text showed to a user who has pressed "subscribe me" on the previous
133
- step informing that an email to confirm subscription has just been sent. Remeber
134
- the user to check the spam folder and to follow the email instructions.<br />
135
- Tags: <strong>{name}</strong> the user name; <strong>{email}</strong> the user email.', 'newsletter'); ?>
136
- </td>
137
- </tr>
138
- </table>
139
-
140
- <p class="submit">
141
- <?php $nc->button('save', __('Save', 'newsletter')); ?>
142
- </p>
143
-
144
-
145
-
146
- <h3><?php _e('Confirmation (double opt-in)', 'newsletter'); ?></h3>
147
-
148
- <?php _e('<p>Email sent to the user to confirm his subscription, the successful confirmation
149
- page, the welcome email.</p>', 'newsletter'); ?>
150
-
151
- <table class="form-table">
152
- <tr valign="top">
153
- <th>&nbsp;</th>
154
- <td>
155
- <?php $nc->checkbox('noconfirmation', __('Do not use double opt-in. If checked the subscription is direct, so subscribers will be immediately confirmed and will receive the welcome email.', 'newsletter')); ?>
156
- </td>
157
- </tr>
158
-
159
- <!-- CONFIRMATION EMAIL -->
160
- <tr valign="top">
161
- <th><?php _e('Confirmation email', 'newsletter'); ?></th>
162
- <td>
163
- <?php $nc->email('confirmation'); ?>
164
- <br />
165
- <?php _e('Tags: <strong>{name}</strong> the user name; <strong>{subscription_confirm_url}</strong>
166
- confirmation URL to be clicked by the user to confirm his subscription;
167
- <strong>{unsubscription_url}</strong> the unsubscription link', 'newsletter'); ?>
168
- </td>
169
- </tr>
170
-
171
- </table>
172
-
173
- <p class="submit">
174
- <?php $nc->button('save', __('Save', 'newsletter')); ?>
175
- </p>
176
-
177
-
178
-
179
- <h3><?php _e('Welcome message', 'newsletter'); ?></h3>
180
- <?php _e('<p>Users jump directly to this step if you disabled the double opt-in step.</p>', 'newsletter'); ?>
181
-
182
- <table class="form-table">
183
- <tr valign="top">
184
- <th><?php _e('Welcome message', 'newsletter'); ?></th>
185
- <td>
186
- <?php $nc->editor('confirmed_text'); ?>
187
- <br />
188
- <?php _e('Showed when the user follow the confirmation URL sent to him with previous email
189
- settings or if signed up directly with no double opt-in process.
190
- <br />
191
- Tags: <strong>{name}</strong> the user name; <strong>{email}</strong> for the
192
- user email; <strong>{token}</strong> the subscriber unique token', 'newsletter'); ?>
193
- </td>
194
- </tr>
195
-
196
- <tr valign="top">
197
- <th><?php _e('Conversion tracking code', 'newsletter'); ?></th>
198
- <td>
199
- <?php $nc->textarea('confirmed_tracking'); ?>
200
- <br />
201
- <?php _e('<strong>Works only with Newsletter Extras installed</strong>', 'newsletter'); ?>
202
- <br />
203
- <?php _e('The code is injected AS-IS in welcome page and can be used to track conversion
204
- (you can use PHP if needed). Conversion code is usually supply by tracking services,
205
- like Google AdWords, Google Analytics and so on.', 'newsletter'); ?>
206
- </td>
207
- </tr>
208
-
209
- <!-- WELCOME/CONFIRMED EMAIL -->
210
- <tr valign="top">
211
- <th>
212
- <?php _e('Welcome email<br /><small>The right place where to put bonus content link</small>', 'newsletter'); ?>
213
- </th>
214
- <td>
215
- <?php $nc->email('confirmed'); ?>
216
- <br />
217
- <?php _e('Tags: <strong>{id}</strong> user id; <strong>{name}</strong> user name;
218
- <strong>{token}</strong> the subscriber unique token; <strong>{unsubscription_url}</strong>
219
- unsubscription link', 'newsletter'); ?>
220
- </td>
221
- </tr>
222
-
223
- </table>
224
-
225
- <p class="submit">
226
- <?php $nc->button('save', __('Save', 'newsletter')); ?>
227
- </p>
228
-
229
-
230
-
231
- <h3><?php _e('Unsubscription', 'newsletter'); ?></h3>
232
- <?php _e('<p>A user starts the unsubscription process clicking the unsubscription link in
233
- a newsletter. This link contains the email to unsubscribe and some unique information
234
- to avoid hacking. The user are requird to confirm the unsubscription: this is the last
235
- step where YOU can communicate with you almost missed user.</p>', 'newsletter'); ?>
236
-
237
- <table class="form-table">
238
- <tr valign="top">
239
- <th><?php _e('Unsubscription message', 'newsletter'); ?></th>
240
- <td>
241
- <?php $nc->editor('unsubscription_text'); ?>
242
- <br />
243
- <?php _e('This text is show to users who click on a "unsubscription link" in a newsletter
244
- email. You have to insert a link in the text that user can follow to confirm the
245
- unsubscription request (see tags).
246
- <br />
247
- Tags: <strong>{name}</strong> user name; <strong>{email}</strong> user email;
248
- <strong>{unsubscription_confirm_url}</strong> URL to confirm unsubscription.', 'newsletter'); ?>
249
- </td>
250
- </tr>
251
-
252
- <!-- Text showed to the user on successful unsubscription -->
253
- <tr valign="top">
254
- <th><?php _e('Goodbye message', 'newsletter'); ?></th>
255
- <td>
256
- <?php $nc->editor('unsubscribed_text'); ?>
257
- </td>
258
- </tr>
259
-
260
- <!-- GOODBYE EMAIL -->
261
- <tr valign="top">
262
- <th><?php _e('Goodbye email', 'newsletter'); ?></th>
263
- <td>
264
- <?php $nc->email('unsubscribed'); ?>
265
- <br />
266
- <?php _e('Tags: <strong>{name}</strong> user name.', 'newsletter'); ?>
267
- </td>
268
- </tr>
269
- </table>
270
-
271
- <p class="submit">
272
- <?php $nc->button('save', __('Save', 'newsletter')); ?>
273
- </p>
274
-
275
-
276
-
277
- <h3><?php _e('Advanced', 'newsletter'); ?></h3>
278
-
279
- <table class="form-table">
280
- <tr valign="top">
281
- <th><?php _e('Disable visual editors?', 'newsletter')?></th>
282
- <td>
283
- <?php $nc->yesno('novisual'); ?>
284
- </td>
285
- </tr>
286
- </table>
287
- <p class="submit">
288
- <?php $nc->button('save', __('Save', 'newsletter')); ?>
289
- </p>
290
-
291
- </form>
292
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ @include_once 'commons.php';
4
+
5
+ $options = get_option('newsletter');
6
+
7
+ if ($action == 'save') {
8
+ $options = stripslashes_deep($_POST['options']);
9
+ $options['confirmed_url'] = trim($options['confirmed_url']);
10
+ if ($errors == null) {
11
+ update_option('newsletter', $options);
12
+ }
13
+ }
14
+
15
+ if ($action == 'reset') {
16
+ @include_once(dirname(__FILE__) . '/languages/en_US_options.php');
17
+ if (WPLANG != '') @include_once(dirname(__FILE__) . '/languages/' . WPLANG . '_options.php');
18
+ $options = array_merge($options, $newsletter_default_options);
19
+ update_option('newsletter', $options);
20
+ }
21
+
22
+ $nc = new NewsletterControls($options);
23
+ ?>
24
+
25
+ <?php if ($options['novisual'] != 1) { ?>
26
+ <script type="text/javascript" src="<?php echo get_option('siteurl'); ?>/wp-content/plugins/newsletter/tiny_mce/tiny_mce.js"></script>
27
+
28
+ <script type="text/javascript">
29
+ tinyMCE.init({
30
+ mode : "specific_textareas",
31
+ editor_selector : "visual",
32
+ theme : "advanced",
33
+ theme_advanced_disable : "styleselect",
34
+ relative_urls : false,
35
+ remove_script_host : false,
36
+ theme_advanced_buttons3: "",
37
+ theme_advanced_toolbar_location : "top",
38
+ theme_advanced_resizing : true,
39
+ theme_advanced_statusbar_location: "bottom",
40
+ document_base_url : "<?php echo get_option('home'); ?>/",
41
+ content_css : "<?php echo get_option('blogurl'); ?>/wp-content/plugins/newsletter/editor.css?" + new Date().getTime()
42
+ });
43
+ </script>
44
+ <?php } ?>
45
+
46
+ <script>
47
+ jQuery.cookie = function(name, value, options) {
48
+ if (typeof value != 'undefined') { // name and value given, set cookie
49
+ options = options || {};
50
+ if (value === null) {
51
+ value = '';
52
+ options.expires = -1;
53
+ }
54
+ var expires = '';
55
+ if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
56
+ var date;
57
+ if (typeof options.expires == 'number') {
58
+ date = new Date();
59
+ date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
60
+ } else {
61
+ date = options.expires;
62
+ }
63
+ expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
64
+ }
65
+ // CAUTION: Needed to parenthesize options.path and options.domain
66
+ // in the following expressions, otherwise they evaluate to undefined
67
+ // in the packed version for some reason...
68
+ var path = options.path ? '; path=' + (options.path) : '';
69
+ var domain = options.domain ? '; domain=' + (options.domain) : '';
70
+ var secure = options.secure ? '; secure' : '';
71
+ document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
72
+ } else { // only name given, get cookie
73
+ var cookieValue = null;
74
+ if (document.cookie && document.cookie != '') {
75
+ var cookies = document.cookie.split(';');
76
+ for (var i = 0; i < cookies.length; i++) {
77
+ var cookie = jQuery.trim(cookies[i]);
78
+ // Does this cookie string begin with the name we want?
79
+ if (cookie.substring(0, name.length + 1) == (name + '=')) {
80
+ cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
81
+ break;
82
+ }
83
+ }
84
+ }
85
+ return cookieValue;
86
+ }
87
+ };
88
+
89
+ jQuery(document).ready(function () {
90
+ var cookie = jQuery.cookie("np-options");
91
+ if (!cookie) cookie = "0-";
92
+ jQuery(".wrap h3").each(function (index) {
93
+ var div = jQuery(this).next('div');
94
+ div.toggle(cookie.indexOf(index + "-") >= 0);
95
+ });
96
+
97
+ jQuery(".wrap h3").click(function () {
98
+ var cookie = "";
99
+ jQuery(this).next('div').toggle(500);
100
+ jQuery(".wrap h3").each(function (index) {
101
+ if (jQuery(this).next('div').is(":visible")) cookie += index + "-";
102
+ });
103
+ jQuery.cookie("np-options", cookie);
104
+ });
105
+ });
106
+ </script>
107
+
108
+ <div class="wrap">
109
+
110
+ <?php $nc->errors($errors); ?>
111
+
112
+ <h2>Newsletter Subscription and Cancellation Process</h2>
113
+ <p>
114
+ In this panel you can configure the subscription and cancellation process, setting every message, the single or double opt in and
115
+ even a customized subscription form.<br />
116
+ All tags that can be used on texts below are listed under <a href="#documentation">documentation</a> paragraph.
117
+ </p>
118
+
119
+
120
+ <form method="post" action="">
121
+ <?php $nc->init(); ?>
122
+
123
+ <h3>Working mode</h3>
124
+ <div>
125
+ <p>Choose how the subscription process to your newsletter works.</p>
126
+ <table class="form-table">
127
+ <tr valign="top">
128
+ <th>Opt In</th>
129
+ <td>
130
+ <?php $nc->select('noconfirmation', array(0=>'Double Opt In', 1=>'Single Opt In')); ?>
131
+ <div class="hints">
132
+ <strong>Double Opt In</strong> means subscribers need to confirm their email address by an activation link sent them on a activation email message.<br />
133
+ <strong>Single Opt In</strong> means subscribers do not need to confirm their email address.<br />
134
+ </div>
135
+ </td>
136
+ </tr>
137
+ </table>
138
+ <p class="submit">
139
+ <?php $nc->button('save', __('Save', 'newsletter')); ?>
140
+ </p>
141
+ </div>
142
+
143
+ <h3>Subscription</h3>
144
+ <div>
145
+ <table class="form-table">
146
+ <tr valign="top">
147
+ <th>Subscription page</th>
148
+ <td>
149
+ <?php $nc->editor('subscription_text'); ?>
150
+ <div class="hints">
151
+ This is the text shown to subscriber before the subscription form (which is added automatically). To create a custom form,
152
+ code it directly editing the text in HTML mode (Newsletter will auto discover it).
153
+ See documentation about custom forms. A little example:<br />
154
+ &lt;form&gt;<br />
155
+ Your email: &lt;input type="text" name="ne"/&gt;<br />
156
+ &lt;input type="submit" value="Subscribe now!"/&gt;<br />
157
+ &lt;/form&gt;<br />
158
+ Field names are: "ne" email, "nn" name, "ns" surname, "nx" sex (values: f, m, n),
159
+ "nl[]" list (the field value must be the list number, you can use checkbox, radio, select or even hidden
160
+ HTML input tag), "npN" custom profile (with N from 1 to 19).
161
+ </div>
162
+ </td>
163
+ </tr>
164
+ </table>
165
+
166
+ <p class="submit">
167
+ <?php $nc->button('save', 'Save'); ?>
168
+ </p>
169
+ </div>
170
+
171
+
172
+
173
+ <h3>Confirmation (only for double opt-in)</h3>
174
+ <div>
175
+ <table class="form-table">
176
+ <tr valign="top">
177
+ <th>Confirmation required message</th>
178
+ <td>
179
+ <?php $nc->editor('subscribed_text'); ?>
180
+ <div class="hints">
181
+ This is the text showed to a user who has pressed "subscribe me" on the previous
182
+ step informing that an email to confirm subscription has just been sent. Remember
183
+ the user to check the spam folder and to follow the email instructions.
184
+ </div>
185
+ </td>
186
+ </tr>
187
+
188
+ <!-- CONFIRMATION EMAIL -->
189
+ <tr valign="top">
190
+ <th>Confirmation email</th>
191
+ <td>
192
+ <?php $nc->email('confirmation'); ?>
193
+ <div class="hints">
194
+ Message sent by email to new subscribers with instructions to confirm their subscription
195
+ (for double opt-in process). Do not forget to add the <strong>{subscription_confirm_url}</strong>
196
+ that users must click to activate their subscription.<br />
197
+ Sometime can be useful to add a <strong>{unsubscription_url}</strong> to let users to
198
+ cancel if they wrongly subscribed your service.
199
+ </div>
200
+ </td>
201
+ </tr>
202
+ </table>
203
+
204
+ <p class="submit">
205
+ <?php $nc->button('save', 'Save'); ?>
206
+ </p>
207
+ </div>
208
+
209
+
210
+
211
+ <h3>Welcome message/page</h3>
212
+ <div>
213
+ <table class="form-table">
214
+ <tr valign="top">
215
+ <th>Welcome message</th>
216
+ <td>
217
+ <?php $nc->editor('confirmed_text'); ?>
218
+ <div class="hints">
219
+ Showed when the user follow the confirmation URL sent to him with previous email
220
+ settings or if signed up directly with no double opt-in process. You can use the <strong>{profile_form}</strong> tag to let the user to
221
+ complete it's profile.
222
+ </div>
223
+ </td>
224
+ </tr>
225
+
226
+ <tr valign="top">
227
+ <th>Alternative custom welcome page</th>
228
+ <td>
229
+ <?php $nc->text('confirmed_url', 70); ?>
230
+ <div class="hints">
231
+ A full page address (http://yourblog.com/welcome) to be used instead of message above. If empty the message is
232
+ used.
233
+ </div>
234
+ </td>
235
+ </tr>
236
+
237
+ <tr valign="top">
238
+ <th>Conversion tracking code<br/><small>ADVANCED</small></th>
239
+ <td>
240
+ <?php $nc->textarea('confirmed_tracking'); ?>
241
+ <div class="hints">
242
+ The code is injected AS-IS in welcome page and can be used to track conversion
243
+ (you can use PHP if needed). Conversion code is usually supply by tracking services,
244
+ like Google AdWords, Google Analytics and so on.</div>
245
+ </td>
246
+ </tr>
247
+
248
+ <!-- WELCOME/CONFIRMED EMAIL -->
249
+ <tr valign="top">
250
+ <th>
251
+ Welcome email<br /><small>The right place where to put bonus content link</small>
252
+ </th>
253
+ <td>
254
+ <?php $nc->email('confirmed'); ?>
255
+ <div class="hints">
256
+ Email sent to the user to confirm his subscription, the successful confirmation
257
+ page, the welcome email. This is the right message where to put a <strong>{unlock_url}</strong> link to remember to the
258
+ user where is the premium content (if any, main configuration panel).<br />
259
+ It's a good idea to add the <strong>{unsubscription_url}</strong> too and the <strong>{profile_url}</strong>
260
+ letting users to cancel or manage/complete their profile.
261
+ </div>
262
+ </td>
263
+ </tr>
264
+
265
+ </table>
266
+
267
+ <p class="submit">
268
+ <?php $nc->button('save', 'Save'); ?>
269
+ </p>
270
+ </div>
271
+
272
+
273
+ <h3>Cancellation</h3>
274
+ <div>
275
+ <p class="intro">
276
+ A user starts the cancellation process clicking the unsubscription link in
277
+ a newsletter. This link contains the email to unsubscribe and some unique information
278
+ to avoid hacking. The user are required to confirm the unsubscription: this is the last
279
+ step where YOU can communicate with your almost missed user.
280
+ <br />
281
+ To create immediate cancellation, you can use the <strong>{unsubscription_confirm_url}</strong>
282
+ in your newsletters and upon click on that link goodbye message and email are used directly
283
+ skipping the confirm request.
284
+ </p>
285
+
286
+ <table class="form-table">
287
+ <tr valign="top">
288
+ <th>Cancellation message</th>
289
+ <td>
290
+ <?php $nc->editor('unsubscription_text'); ?>
291
+ <div class="hints">
292
+ This text is show to users who click on a "unsubscription link" in a newsletter
293
+ email. You <strong>must</strong> insert a link in the text that user can follow to confirm the
294
+ unsubscription request using the tag <strong>{unsubscription_confirm_url}</strong>.
295
+ </div>
296
+ </td>
297
+ </tr>
298
+
299
+ <!-- Text showed to the user on successful unsubscription -->
300
+ <tr valign="top">
301
+ <th>Goodbye message</th>
302
+ <td>
303
+ <?php $nc->editor('unsubscribed_text'); ?>
304
+ <div class="hints">
305
+ Shown to users after the cancellation has been completed.
306
+ </div>
307
+ </td>
308
+ </tr>
309
+
310
+ <!-- GOODBYE EMAIL -->
311
+ <tr valign="top">
312
+ <th>Goodbye email</th>
313
+ <td>
314
+ <?php $nc->email('unsubscribed'); ?>
315
+ <div class="hints">
316
+ Sent after a cancellation, is the last message you send to the user before his removal
317
+ from your newsletter subscribers. Leave the subject empty to disable this message.
318
+ </div>
319
+ </td>
320
+ </tr>
321
+ </table>
322
+ <p class="submit">
323
+ <?php $nc->button('save', 'Save'); ?>
324
+ </p>
325
+ </div>
326
+
327
+ <h3>Other configurations (advanced)</h3>
328
+ <div>
329
+ <table class="form-table">
330
+ <!--
331
+ <tr>
332
+ <th>Email theme</th>
333
+ <td>
334
+ <?php if ($nc->data['email_theme_novisual'] == 1) $nc->textarea('email_theme'); else $nc->editor('email_theme'); ?><br />
335
+ <?php $nc->select('email_theme_novisual', array(0=>'Edit with visual editor', 1=>'Edit as plain text')); ?> (save to apply)
336
+ <div class="hints">
337
+ Subscription and cancellation processes send out emails as you configured above. To apply a general theme to those
338
+ emails, you can create an HTML layout here. You can also use PHP code, just remember to disable the visual editor and to
339
+ keep it disabled.<br />
340
+ <strong>Messages are inserted in the theme where you put the {message} tag, don't forget it!</strong>
341
+ </div>
342
+ </td>
343
+ </tr>
344
+ -->
345
+ <tr valign="top">
346
+ <th>Disable visual editors?</th>
347
+ <td>
348
+ <?php $nc->yesno('novisual'); ?>
349
+ </td>
350
+ </tr>
351
+ </table>
352
+
353
+
354
+ <p class="submit">
355
+ <?php $nc->button('save', 'Save'); ?>
356
+ <?php $nc->button_confirm('reset', 'Reset all', 'Are you sure you want to reset all?'); ?>
357
+ </p>
358
+ </div>
359
+
360
+ <a name="documentation"></a>
361
+ <h3>Documentation</h3>
362
+ <div>
363
+ <h4>User's data</h4>
364
+ <p>
365
+ <strong>{name}</strong>
366
+ The user name<br />
367
+ <strong>{surname}</strong>
368
+ The user surname<br />
369
+ <strong>{email}</strong>
370
+ The user email<br />
371
+ <strong>{ip}</strong>
372
+ The IP address from where the subscription started<br />
373
+ <strong>{id}</strong>
374
+ The user id<br />
375
+ <strong>{token}</strong>
376
+ The user secret token<br />
377
+ <strong>{profile_N}</strong>
378
+ The user profile field number N (from 1 to 19)<br />
379
+ </p>
380
+
381
+ <h4>Action URLs and forms</h4>
382
+ <p>
383
+ <strong>{subscription_confirm_url}</strong>
384
+ URL to build a link to confirmation of subscription when double opt-in is used. To be used on confirmation email.<br />
385
+ <strong>{unsubscription_url}</strong>
386
+ URL to build a link to start the cancellation process. To be used on every newsletter to let the user to cancel.<br />
387
+ <strong>{unsubscription_confirm_url}</strong>
388
+ URL to build a link to an immediate cancellation action. Can be used on newsletters if you want an immediate cancellation or
389
+ on cancellation page (displayed on {unsubscription_url}) to ask a cancellation confirmation.<br />
390
+ <strong>{profile_url}</strong>
391
+ URL to build a link to user's profile page (see the User Profile panel)<br />
392
+ <strong>{unlock_url}</strong>
393
+ Special URL to build a link that on click unlocks protected contents. See Main Configuration panel.<br />
394
+ <strong>{profile_form}</strong>
395
+ Insert the profile form with user's data. Usually it make sense only on welcome page.<br />
396
+ </p>
397
+ </div>
398
+
399
+ </form>
400
+ </div>
plugin-activate.inc.php ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ global $charset_collate;
3
+
4
+ require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
5
+
6
+ $version = get_option('newsletter_version', 0);
7
+
8
+ $sql = "CREATE TABLE `" . $wpdb->prefix . "newsletter` (
9
+ `id` int(11) NOT NULL AUTO_INCREMENT,
10
+ `name` varchar(100) NOT NULL DEFAULT '',
11
+ `surname` varchar(100) NOT NULL DEFAULT '',
12
+ `email` varchar(100) NOT NULL DEFAULT '',
13
+ `sex` char(1) NOT NULL DEFAULT 'n',
14
+ `token` varchar(50) NOT NULL DEFAULT '',
15
+ `status` varchar(1) NOT NULL DEFAULT 'S',
16
+ `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
17
+ `followup_time` bigint(20) NOT NULL DEFAULT '0',
18
+ `followup_step` tinyint(4) NOT NULL DEFAULT '0',
19
+ `followup` tinyint(4) NOT NULL DEFAULT '0',
20
+ `feed` tinyint(4) NOT NULL DEFAULT '0',
21
+ `feed_time` bigint(20) NOT NULL DEFAULT '0',
22
+ `list_1` tinyint(4) NOT NULL DEFAULT '0',
23
+ `list_2` tinyint(4) NOT NULL DEFAULT '0',
24
+ `list_3` tinyint(4) NOT NULL DEFAULT '0',
25
+ `list_4` tinyint(4) NOT NULL DEFAULT '0',
26
+ `list_5` tinyint(4) NOT NULL DEFAULT '0',
27
+ `list_6` tinyint(4) NOT NULL DEFAULT '0',
28
+ `list_7` tinyint(4) NOT NULL DEFAULT '0',
29
+ `list_8` tinyint(4) NOT NULL DEFAULT '0',
30
+ `list_9` tinyint(4) NOT NULL DEFAULT '0',
31
+ `profile_1` varchar(255) NOT NULL DEFAULT '',
32
+ `profile_2` varchar(255) NOT NULL DEFAULT '',
33
+ `profile_3` varchar(255) NOT NULL DEFAULT '',
34
+ `profile_4` varchar(255) NOT NULL DEFAULT '',
35
+ `profile_5` varchar(255) NOT NULL DEFAULT '',
36
+ `profile_6` varchar(255) NOT NULL DEFAULT '',
37
+ `profile_7` varchar(255) NOT NULL DEFAULT '',
38
+ `profile_8` varchar(255) NOT NULL DEFAULT '',
39
+ `profile_9` varchar(255) NOT NULL DEFAULT '',
40
+ `profile_10` varchar(255) NOT NULL DEFAULT '',
41
+ `profile_11` varchar(255) NOT NULL DEFAULT '',
42
+ `profile_12` varchar(255) NOT NULL DEFAULT '',
43
+ `profile_13` varchar(255) NOT NULL DEFAULT '',
44
+ `profile_14` varchar(255) NOT NULL DEFAULT '',
45
+ `profile_15` varchar(255) NOT NULL DEFAULT '',
46
+ `profile_16` varchar(255) NOT NULL DEFAULT '',
47
+ `profile_17` varchar(255) NOT NULL DEFAULT '',
48
+ `profile_18` varchar(255) NOT NULL DEFAULT '',
49
+ `profile_19` varchar(255) NOT NULL DEFAULT '',
50
+ `referrer` varchar(50) NOT NULL DEFAULT '',
51
+ `ip` varchar(50) NOT NULL DEFAULT '',
52
+ PRIMARY KEY (`id`),
53
+ UNIQUE KEY `email` (`email`)
54
+ ) $charset_collate;";
55
+
56
+ dbDelta($sql);
57
+
58
+ $sql = "alter table " . $wpdb->prefix . "newsletter CONVERT TO CHARACTER SET utf8";
59
+ @$wpdb->query($sql);
60
+
61
+ $sql = 'drop table if exists ' . $wpdb->prefix . 'newsletter_work';
62
+ @$wpdb->query($sql);
63
+
64
+
65
+ // NEWSLETTER_PROFILES
66
+ $sql = 'create table if not exists ' . $wpdb->prefix . 'newsletter_profiles (
67
+ `newsletter_id` int NOT NULL,
68
+ `name` varchar (100) NOT NULL DEFAULT \'\',
69
+ `value` text,
70
+ primary key (newsletter_id, name)
71
+ ) DEFAULT charset=utf8';
72
+ @$wpdb->query($sql);
73
+
74
+ $sql = "alter table " . $wpdb->prefix . "newsletter_profiles CONVERT TO CHARACTER SET utf8";
75
+ @$wpdb->query($sql);
76
+
77
+ // NEWSLETTER_EMAILS
78
+ $sql = "CREATE TABLE " . $wpdb->prefix . "newsletter_emails (
79
+ `id` int auto_increment,
80
+ `subject` varchar(255) NOT NULL DEFAULT '',
81
+ `message` text,
82
+ `name` varchar(255) NOT NULL DEFAULT '',
83
+ `subject2` varchar(255) NOT NULL DEFAULT '',
84
+ `message2` text,
85
+ `name2` varchar(255) NOT NULL DEFAULT '',
86
+ `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
87
+ `status` enum('new','sending','sent','paused') NOT NULL DEFAULT 'new',
88
+ `total` int NOT NULL DEFAULT 0,
89
+ `last_id` int NOT NULL DEFAULT 0,
90
+ `sent` int NOT NULL DEFAULT 0,
91
+ `track` int NOT NULL DEFAULT 0,
92
+ `list` int NOT NULL DEFAULT 0,
93
+ `type` enum('email','feed','followup') NOT NULL DEFAULT 'email',
94
+ `query` varchar(255) NOT NULL DEFAULT '',
95
+ `editor` tinyint NOT NULL DEFAULT 0,
96
+ `sex` char(1) NOT NULL DEFAULT '',
97
+ `theme` varchar(50) NOT NULL DEFAULT '',
98
+ PRIMARY KEY (id)
99
+ ) $charset_collate;";
100
+
101
+ dbDelta($sql);
102
+
103
+ $sql = "alter table " . $wpdb->prefix . "newsletter_emails CONVERT TO CHARACTER SET utf8";
104
+ @$wpdb->query($sql);
105
+
106
+ // Load DEFAULT options (language specific)
107
+ include dirname(__FILE__) . '/languages/en_US.php';
108
+ @include dirname(__FILE__) . '/languages/' . WPLANG . '.php';
109
+
110
+ // MAIN OPTIONS
111
+ $options = get_option('newsletter_main', array());
112
+
113
+ if ($version < 250) {
114
+ // Migration of "protect" configuration
115
+ if (!isset($options['lock_url'])) {
116
+ $protect = get_option('newsletter_protect', array());
117
+ $options['lock_message'] = $protect['message'];
118
+ $options['lock_url'] = $protect['url'];
119
+ delete_option('newsletter_protect');
120
+ }
121
+ }
122
+ if (empty($options['theme'])) $options['theme'] = $defaults_main['theme'];
123
+ if (empty($options['sender_email'])) $options['sender_email'] = $defaults_main['sender_email'];
124
+
125
+ update_option('newsletter_main', array_merge($defaults_main, $options));
126
+
127
+ // SUBSCRIPTION OPTIONS
128
+ update_option('newsletter', array_merge($defaults, get_option('newsletter', array())));
129
+
130
+ wp_clear_scheduled_hook('newsletter');
131
+ wp_schedule_event(time() + 30, 'newsletter', 'newsletter');
132
+
133
+ $options = get_option('newsletter_profile', array());
134
+ if (empty($options)) {
135
+ $lists = get_option('newsletter_lists', array());
136
+ for ($i=1; $i<=9; $i++) {
137
+ $options['list_' . $i] = $lists['name_' . $i];
138
+ $options['list_type_' . $i] = $lists['type_' . $i];
139
+ }
140
+ }
141
+ add_option('newsletter_profile', array(), '', 'no');
142
+ update_option('newsletter_profile', array_merge($defaults_profile, array_filter($options)));
143
+
144
+ // OLD
145
+ delete_option('newsletter_batch');
146
+ $sql = "update " . $wpdb->prefix . "options set autoload='no' where option_name like 'newsletter%'";
147
+ @$wpdb->query($sql);
148
+
149
+ // Update the version number
150
+ add_option('newsletter_version', Newsletter::VERSION, '', 'no');
151
+ update_option('newsletter_version', Newsletter::VERSION);
plugin-export.inc.php ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ header('Content-Type: application/octet-stream');
4
+ header('Content-Disposition: attachment; filename="newsletter-subscribers.csv"');
5
+
6
+ $keys = $wpdb->get_results("select distinct name from " . $wpdb->prefix . "newsletter_profiles order by name");
7
+
8
+ // CSV header
9
+ echo '"Email";"Name";"Surname";"Sex";Status";"Date";"Token";';
10
+
11
+ // In table profiles
12
+ for ($i = 1; $i <= NEWSLETTER_PROFILE_MAX; $i++) {
13
+ echo '"Profile ' . $i . '";'; // To adjust with field name
14
+ }
15
+
16
+ // Lists
17
+ for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
18
+ echo '"List ' . $i . '";';
19
+ }
20
+
21
+ echo '"Feed by mail";"Follow up"';
22
+
23
+ // Old profiles
24
+ foreach ($keys as $key) {
25
+ // Remove some keys?
26
+ echo $key->name . ';';
27
+ }
28
+ echo "\n";
29
+
30
+ $page = 0;
31
+ while (true) {
32
+ $query = "select * from " . $wpdb->prefix . "newsletter";
33
+ if (!empty($_POST['options']['list'])) {
34
+ $query .= " where list_" . $_POST['options']['list'] . "=1";
35
+ }
36
+ $recipients = $wpdb->get_results($query . " order by email limit " . $page * 500 . ",500");
37
+ for ($i = 0; $i < count($recipients); $i++) {
38
+ echo '"' . $recipients[$i]->email . '";"' . newsletter_sanitize_csv($recipients[$i]->name) .
39
+ '";"' . newsletter_sanitize_csv($recipients[$i]->surname) .
40
+ '";"' . $recipients[$i]->sex .
41
+ '";"'. $recipients[$i]->status . '";"' . $recipients[$i]->created . '";"' . $recipients[$i]->token . '";';
42
+
43
+ for ($j = 1; $j <= NEWSLETTER_PROFILE_MAX; $j++) {
44
+ $column = 'profile_' . $j;
45
+ echo newsletter_sanitize_csv($recipients[$i]->$column) . ';';
46
+ }
47
+
48
+ for ($j = 1; $j <= NEWSLETTER_LIST_MAX; $j++) {
49
+ $list = 'list_' . $j;
50
+ echo $recipients[$i]->$list . ';';
51
+ }
52
+
53
+ echo $recipients[$i]->feed . ';';
54
+ echo $recipients[$i]->followup . ';';
55
+
56
+ $profile = $wpdb->get_results("select name,value from " . $wpdb->prefix . "newsletter_profiles where newsletter_id=" . $recipients[$i]->id . " order by name");
57
+ $map = array();
58
+ foreach ($profile as $field) {
59
+ $map[$field->name] = $field->value;
60
+ }
61
+
62
+ foreach ($keys as $key) {
63
+ if (isset($map[$key->name])) {
64
+ echo '"' . newsletter_sanitize_csv($map[$key->name]) . '";';
65
+ }
66
+ else echo '"";';
67
+ }
68
+ echo "\n";
69
+ flush();
70
+ }
71
+ if (count($recipients) < 500) break;
72
+ $page++;
73
+ }
74
+ die();
75
+
76
+ function newsletter_sanitize_csv($text) {
77
+ $text = str_replace('"', "'", $text);
78
+ $text = str_replace("\n", ' ', $text);
79
+ $text = str_replace("\r", ' ', $text);
80
+ $text = str_replace(";", ' ', $text);
81
+ return $text;
82
+ }
83
+ ?>
plugin-head.inc.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $options = get_option('newsletter_profile'); ?>
2
+ <script type="text/javascript">
3
+ function newsletter_check(f) {
4
+ var re = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
5
+ if (!re.test(f.elements["ne"].value)) {
6
+ alert("<?php echo addslashes($options['email_error']); ?>");
7
+ return false;
8
+ }
9
+ if (f.elements["ny"] && !f.elements["ny"].checked) {
10
+ alert("<?php echo addslashes($options['privacy_error']); ?>");
11
+ return false;
12
+ }
13
+ return true;
14
+ }
15
+ </script>
16
+ <style type="text/css">
17
+ <?php echo $this->options_main['css']; ?>
18
+ </style>
plugin-menu.inc.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $level = $this->options_main['editor'] ? 7 : 10;
4
+
5
+ add_menu_page('Newsletter', 'Newsletter', $level, 'newsletter/intro.php', '', '');
6
+ add_submenu_page('newsletter/intro.php', 'User Guide', 'User Guide', $level, 'newsletter/intro.php');
7
+
8
+ add_submenu_page('newsletter/intro.php', 'Main Configuration', 'Main Configuration', $level, 'newsletter/main.php');
9
+ add_submenu_page('newsletter/intro.php', 'Subscription Process', 'Subscription Process', $level, 'newsletter/options.php');
10
+ add_submenu_page('newsletter/intro.php', 'User Profile', 'User Profile', $level, 'newsletter/profile.php');
11
+
12
+ add_submenu_page('newsletter/intro.php', 'Emails', 'Emails', $level, 'newsletter/emails.php');
13
+ add_submenu_page('newsletter/emails.php', 'Email Edit', 'Email Edit', $level, 'newsletter/emails-edit.php');
14
+
15
+ add_submenu_page('newsletter/intro.php', 'Subscribers', 'Subscribers', $level, 'newsletter/users.php');
16
+ add_submenu_page('newsletter/users.php', 'Subscribers Edit', 'Subscribers Edit', $level, 'newsletter/users-edit.php');
17
+
18
+ add_submenu_page('newsletter/intro.php', 'Import/Export', 'Import/Export', $level, 'newsletter/import.php');
19
+ ?>
plugin.php CHANGED
@@ -1,1192 +1,893 @@
1
  <?php
2
  /*
3
- Plugin Name: Newsletter
4
- Plugin URI: http://www.satollo.net/plugins/newsletter
5
- Description: Newsletter is a cool plugin to create your own subscriber list, to send newsletters, to build your business. <strong>Before update give a look to <a href="http://www.satollo.net/plugins/newsletter#update">this page</a> to know what's changed.</strong>
6
- Version: 1.5.9
7
- Author: Satollo
8
- Author URI: http://www.satollo.net
9
- Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
10
- */
11
-
12
- /* Copyright 2008 Satollo (email: info@satollo.net)
13
-
14
- This program is free software; you can redistribute it and/or modify
15
- it under the terms of the GNU General Public License as published by
16
- the Free Software Foundation; either version 2 of the License, or
17
- (at your option) any later version.
18
-
19
- This program is distributed in the hope that it will be useful,
20
- but WITHOUT ANY WARRANTY; without even the implied warranty of
21
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
- GNU General Public License for more details.
23
-
24
- You should have received a copy of the GNU General Public License
25
- along with this program; if not, write to the Free Software
26
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27
- */
28
-
29
- define('NEWSLETTER', '1.5.9');
30
-
31
- $newsletter_options_main = get_option('newsletter_main', array());
32
-
33
- // Labels loading, after that $newsletter_labels is filled
34
- $newsletter_labels = null;
35
- @include_once(dirname(__FILE__) . '/languages/en_US.php');
36
- if (WPLANG != '') @include_once(dirname(__FILE__) . '/languages/' . WPLANG . '.php');
37
- @include_once(ABSPATH . 'wp-content/plugins/newsletter-custom/languages/en_US.php');
38
- if (WPLANG != '') @include_once(ABSPATH . 'wp-content/plugins/newsletter-custom/languages/' . WPLANG . '.php');
39
-
40
- // Don't try to hack that, Newsletter will badly fail
41
- @include(ABSPATH . 'wp-content/plugins/newsletter-extras/newsletter-extras.php');
42
-
43
- require_once(dirname(__FILE__) . '/widget.php');
44
-
45
- $newsletter_step = 'subscription';
46
- $newsletter_subscriber;
47
-
48
- function newsletter_init_labels() {
49
- }
50
-
51
- function newsletter_label($name, $default='') {
52
- global $newsletter_labels;
53
-
54
- if (isset($newsletter_labels[$name])) return $newsletter_labels[$name];
55
- return $default;
56
- }
57
-
58
- function newsletter_echo($name, $default) {
59
- echo newsletter_label($name, $default);
60
- }
61
-
62
- function newsletter_request($name, $default=null ) {
63
- if (!isset($_REQUEST[$name])) return $default;
64
- return stripslashes_deep($_REQUEST[$name]);
65
- }
66
-
67
- function newsletter_subscribers_count() {
68
- global $wpdb;
69
 
70
- return $wpdb->get_var("select count(*) from " . $wpdb->prefix . "newsletter where status='C'");
71
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
 
73
- function newsletter_embed_form($form=0) {
74
- $options = get_option('newsletter');
75
- if (newsletter_has_extras('1.0.2') && $form>0) {
76
- echo str_replace('{newsletter_url}', $options['url'], newsletter_extras_get_form($form));
77
  }
78
- else {
79
- echo '<div class="newsletter-embed-form">';
80
- if (isset($options['noname'])) {
81
- echo str_replace('{newsletter_url}', $options['url'], newsletter_label('embedded_form_noname'));
82
- }
83
- else {
84
- echo str_replace('{newsletter_url}', $options['url'], newsletter_label('embedded_form'));
85
  }
86
- echo '</div>';
87
  }
88
- }
89
 
90
- if (!is_admin()) {
91
- add_shortcode('newsletter', 'newsletter_call');
92
- add_shortcode('newsletter_form', 'newsletter_form_call');
93
- }
94
 
95
- function newsletter_form_call($attrs, $content=null) {
96
- $options = get_option('newsletter');
97
- if (newsletter_has_extras('1.0.2') && isset($attrs['form'])) {
98
- $buffer = str_replace('{newsletter_url}', $options['url'], newsletter_extras_get_form($attrs['form']));
99
  }
100
- else {
101
- $buffer = '<div class="newsletter-embed-form">';
102
- if (!isset($options['noname'])) {
103
- $buffer .= str_replace('{newsletter_url}', $options['url'], newsletter_label('embedded_form'));
104
- }
105
- else {
106
- $buffer .= str_replace('{newsletter_url}', $options['url'], newsletter_label('embedded_form_noname'));
107
- }
108
 
109
- $buffer .= '</div>';
110
  }
111
- return $buffer;
112
- }
113
 
114
- function newsletter_call($attrs, $content=null) {
115
- global $newsletter_step, $newsletter_subscriber;
 
 
 
 
 
 
 
 
 
116
 
117
- $options = get_option('newsletter');
 
118
 
119
- $buffer = '';
 
 
120
 
121
- // When a user is starting the subscription process
122
- if ($newsletter_step == 'subscription') {
123
- $buffer .= $options['subscription_text'];
124
 
125
- if (newsletter_has_extras('1.0.2') && isset($attrs['form'])) {
126
- $buffer .= str_replace('{newsletter_url}', $options['url'], newsletter_extras_get_form($attrs['form']));
 
 
127
  }
128
- else {
129
- if (isset($options['noname'])) {
130
- $buffer .= newsletter_label('subscription_form_noname');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
  }
132
  else {
133
- $buffer .= newsletter_label('subscription_form');
 
 
 
 
 
 
 
 
134
  }
135
- //if (!defined('NEWSLETTER_EXTRAS'))
136
- // $buffer .= '<div style="text-align:right;padding:0 10px;margin:0;"><a style="font-size:9px;color:#bbb;text-decoration:none" href="http://www.satollo.net">by satollo.net</a></div>';
137
  }
138
 
139
- }
 
 
 
 
140
 
141
- // When a user asked to subscribe and the connfirmation request has been sent
142
- if ($newsletter_step == 'subscribed') {
143
- $text = newsletter_replace($options['subscribed_text'], $newsletter_subscriber);
144
- $buffer .= $text;
145
- }
146
 
147
- if ($newsletter_step == 'confirmed') {
148
- $text = newsletter_replace($options['confirmed_text'], $newsletter_subscriber);
149
- $buffer .= $text;
150
 
151
- if (isset($options['confirmed_tracking'])) {
152
- ob_start();
153
- eval('?>' . $options['confirmed_tracking']);
154
- $buffer .= ob_get_clean();
 
 
 
 
155
  }
 
156
  }
157
 
158
- // Here we are when an unsubscription is requested. There are two kind of unsubscription: the
159
- // ones with email and token, so the user has only to confire and the ones without
160
- // data, so the user is requested to insert his email. In the latter case an email
161
- // will be sent to the user with alink to confirm the email removal.
162
- if ($newsletter_step == 'unsubscription' || $newsletter_step == 'unsubscription_error') {
163
- $newsletter_subscriber = newsletter_get_subscriber($_REQUEST['ni']);
164
- $buffer = newsletter_replace($options['unsubscription_text'], $newsletter_subscriber);
165
- $url = newsletter_add_qs($options['url'], 'na=uc&amp;ni=' . $newsletter_subscriber->id .
166
- '&amp;nt=' . $_REQUEST['nt']);
167
- $buffer = newsletter_replace_url($buffer, 'UNSUBSCRIPTION_CONFIRM_URL', $url);
168
  }
169
 
170
- // Last message shown to user to say good bye
171
- if ($newsletter_step == 'unsubscribed') {
172
- $text = $options['unsubscribed_text'];
173
- $text = newsletter_replace($text, $newsletter_subscriber);
174
- $buffer .= $text;
175
  }
176
 
177
- return '<div class="newsletter">' . $buffer . '</div>';
178
- }
179
-
180
- function newsletter_phpmailer_init($phpmailer) {
181
- $options_email = get_option('newsletter_email');
182
- $phpmailer->Sender = $options_email['return_path'];
183
- }
 
 
 
184
 
185
- /**
186
- * Sends out newsletters.
187
- *
188
- * I recipients is an array of subscribers, other parameters are ignored and a test
189
- * batch is started. This parameter has priority over all.
190
- *
191
- * If continue is true, the system try to continue a previous batch keeping its
192
- * configuration (eg. if it was a simulation or not).
193
- *
194
- * If continue is false, simulate indicates if the batch is a simulation and forces
195
- * the subscriber's email to a test one, as specified in the configuration.
196
- *
197
- * Return true if the batch is completed.
198
- */
199
- function newsletter_send_batch() {
200
- global $wpdb;
201
 
202
- newsletter_info(__FUNCTION__, 'Start');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
203
 
204
- $options = get_option('newsletter');
205
- $options_email = get_option('newsletter_email');
206
- $batch = get_option('newsletter_batch');
207
 
208
- if ($batch == null || !is_array($batch)) {
209
- newsletter_error(__FUNCTION__, 'No batch found');
210
- return;
211
- }
 
 
212
 
213
- newsletter_debug(__FUNCTION__, "Batch:\n" . print_r($last, true));
214
 
215
- // Batch have to contain 'id' which is the starting id, 'simulate' boolean
216
- // to indicate if is a simulation or not, 'scheduled' if it's a scheduled
217
- // sending process. 'list' is the list number, required.
218
- // If 'id' = 0 it's a new seding process.
219
 
220
- if (!isset($batch['id'])) {
221
- newsletter_error(__FUNCTION__, 'Batch "id" parameter not present');
222
- return false;
223
- }
 
224
 
225
- if (!isset($batch['list'])) {
226
- newsletter_error(__FUNCTION__, 'Batch "list" parameter not present');
227
- return false;
228
- }
229
 
230
- if (!isset($batch['simulate'])) {
231
- newsletter_error(__FUNCTION__, 'Batch "simulate" parameter not present');
232
- return false;
 
 
 
 
 
 
 
 
 
 
 
 
233
  }
234
 
235
- if (!isset($batch['scheduled'])) {
236
- newsletter_error(__FUNCTION__, 'Batch "scheduled" parameter not present');
237
- return false;
238
  }
239
 
240
- $id = (int)$batch['id'];
241
- $list = (int)$batch['list'];
242
- $simulate = (bool)$batch['simulate'];
243
- $scheduled = (bool)$batch['scheduled']; // Used to avoid echo
244
-
245
- if ($scheduled) {
246
- $max = $options_email['scheduler_max'];
247
- if (!is_numeric($max)) $max = 10;
248
- }
249
- else {
250
- $max = $options_email['max'];
251
- if (!is_numeric($max)) $max = 0;
252
  }
253
 
254
- $query = "select * from " . $wpdb->prefix . "newsletter where status='C' and list=" . $list .
255
- " and id>" . $id . " order by id";
256
- if ($max > 0) {
257
- $query .= " limit " . $max;
258
  }
259
 
260
- $recipients = $wpdb->get_results($query);
 
 
 
 
261
 
262
- // For a new batch save some info
263
- if ($id == 0) {
264
- newsletter_delete_batch_file();
265
- wp_clear_scheduled_hook('newsletter_cron_hook');
266
- $batch['total'] = $wpdb->get_var("select count(*) from " . $wpdb->prefix . "newsletter where status='C' and list=" . $list);
267
- $batch['sent'] = 0;
268
- $batch['completed'] = false;
269
- $batch['message'] = '';
 
 
 
 
270
  }
271
 
272
- // Not all hosting provider allow this...
273
- @set_time_limit(100000);
274
-
275
- $start_time = time();
276
- $max_time = (int)(ini_get('max_execution_time') * 0.8);
277
- $db_time = time();
278
-
279
-
280
-
281
- if (!$scheduled) {
282
- echo 'Sending to: <br />';
283
  }
284
 
285
-
286
- if (isset($options_email['novisual'])) {
287
- $message = $options_email['message'];
288
  }
289
- else {
290
- $message = '<html><head><style type="text/css">' . newsletter_get_theme_css($options_email['theme']) .
291
- '</style></head><body>' . $options_email['message'] . '</body></html>';
292
- }
293
-
294
- $idx = 0;
295
 
296
- add_action('phpmailer_init','newsletter_phpmailer_init');
297
- if (newsletter_has_extras('1.0.4')) newsletter_init_mail();
298
- foreach ($recipients as $r) {
299
-
300
- $url = newsletter_add_qs($options['url'],
301
- 'na=u&amp;ni=' . $r->id . '&amp;nt=' . $r->token);
302
-
303
- $m = newsletter_replace_url($message, 'UNSUBSCRIPTION_URL', $url);
304
- $m = newsletter_replace($m, $r);
305
-
306
- if (defined('NEWSLETTER_EXTRAS') && isset($options_email['track']))
307
- $m = newsletter_relink($m, $r->id, $options_email['name']);
308
 
309
- $s = $options_email['subject'];
310
- $s = newsletter_replace($s, $r);
 
 
 
311
 
312
- if ($simulate) {
313
- $x = newsletter_mail($options_email['simulate_email'], $s, $m, true);
 
 
 
 
314
  }
315
- else {
316
- $x = newsletter_mail($r->email, $s, $m, true);
317
  }
318
-
319
- if (!$scheduled) {
320
- echo htmlspecialchars($r->name) . ' (' . $r->email . ') ';
321
-
322
- if ($x) {
323
- echo '[OK] - ';
324
- newsletter_debug(__FUNCTION__, 'Sent to ' . $r->id . ' success');
325
- } else {
326
- echo '[KO] - ';
327
- newsletter_debug(__FUNCTION__, 'Sent to ' . $r->id . ' failed');
328
- }
329
- flush();
330
  }
331
 
332
- $idx++;
333
-
334
- $batch['sent']++;
335
- $batch['id'] = $r->id;
336
 
337
- // Try to avoid database timeout
338
- if (time()-$db_time > 15) {
339
- newsletter_debug(__FUNCTION__, 'Batch saving to avoid database timeout');
340
- $db_time = time();
341
- $batch['message'] = 'Temporary saved batch to avoid database timeout';
342
- if (!update_option('newsletter_batch', $batch)) {
343
- newsletter_error(__FUNCTION__, 'Unable to save to database, saving on file system');
344
- newsletter_error(__FUNCTION__, "Batch:\n" . print_r($batch, true));
345
 
346
- newsletter_save_batch_file($batch);
347
- remove_action('phpmailer_init','newsletter_phpmailer_init');
348
- if (newsletter_has_extras('1.0.4')) newsletter_close_mail();
349
- return false;
350
  }
351
- }
352
-
353
- // Check for the max emails per batch
354
- if ($max != 0 && $idx >= $max) {
355
- newsletter_info(__FUNCTION__, 'Batch saving due to max emails limit reached');
356
- $batch['message'] = 'Batch max emails limit reached (it is ok)';
357
- if (!update_option('newsletter_batch', $batch)) {
358
- newsletter_error(__FUNCTION__, 'Unable to save to database, saving on file system');
359
- newsletter_error(__FUNCTION__, "Batch:\n" . print_r($batch, true));
360
-
361
- newsletter_save_batch_file($batch);
362
- remove_action('phpmailer_init','newsletter_phpmailer_init');
363
- if (newsletter_has_extras('1.0.4')) newsletter_close_mail();
364
-
365
- return false;
366
  }
367
 
368
- remove_action('phpmailer_init','newsletter_phpmailer_init');
369
- if (newsletter_has_extras('1.0.4')) newsletter_close_mail();
370
-
371
- return true;
372
  }
373
 
374
- // Timeout check, max time is zero if set_time_limit works
375
- if (($max_time != 0 && (time()-$start_time) > $max_time)) {
376
- newsletter_info(__FUNCTION__, 'Batch saving due to max time limit reached');
377
- $batch['message'] = 'Batch max time limit reached (it is ok)';
378
- if (!update_option('newsletter_batch', $batch)) {
379
- newsletter_error(__FUNCTION__, 'Unable to save to database, saving on file system');
380
- newsletter_error(__FUNCTION__, "Batch:\n" . print_r($last, true));
381
-
382
- newsletter_save_batch_file($batch);
383
- remove_action('phpmailer_init','newsletter_phpmailer_init');
384
- if (newsletter_has_extras('1.0.4')) newsletter_close_mail();
385
-
386
- return false;
387
- }
388
-
389
- remove_action('phpmailer_init','newsletter_phpmailer_init');
390
- if (newsletter_has_extras('1.0.4')) newsletter_close_mail();
391
- return true;
392
  }
393
- }
394
-
395
- // All right (incredible!)
396
- newsletter_info(__FUNCTION__, 'Sending completed!');
397
- $batch['completed'] = true;
398
- $batch['message'] = '';
399
- if (!update_option('newsletter_batch', $batch)) {
400
- newsletter_error(__FUNCTION__, 'Unable to save to database, saving on file system');
401
- newsletter_error(__FUNCTION__, "Batch:\n" . print_r($last, true));
402
-
403
- newsletter_save_batch_file($batch);
404
- remove_action('phpmailer_init','newsletter_phpmailer_init');
405
- if (newsletter_has_extras('1.0.4')) newsletter_close_mail();
406
-
407
- return false;
408
- }
409
-
410
- remove_action('phpmailer_init','newsletter_phpmailer_init');
411
- if (newsletter_has_extras('1.0.4')) newsletter_close_mail();
412
- return true;
413
- }
414
-
415
- /**
416
- * Send a set of test emails to a list of recipents. The recipients are created
417
- * in the composer page using the test addresses.
418
- */
419
- function newsletter_send_test($recipients) {
420
- global $wpdb;
421
-
422
- newsletter_info(__FUNCTION__, 'Start');
423
 
424
- $options = get_option('newsletter');
425
- $options_email = get_option('newsletter_email');
426
 
427
- @set_time_limit(100000);
428
-
429
- echo 'Sending to: <br />';
430
-
431
- if (isset($options_email['novisual'])) {
432
- $message = $options_email['message'];
433
- }
434
- else {
435
- $message = '<html><head><style type="text/css">' . newsletter_get_theme_css($options_email['theme']) .
436
- '</style></head><body>' . $options_email['message'] . '</body></html>';
437
  }
438
 
439
- if (newsletter_has_extras('1.0.4')) newsletter_init_mail();
440
- foreach ($recipients as $r) {
441
-
442
- $url = newsletter_add_qs($options['url'],
443
- 'na=u&amp;ni=' . $r->id . '&amp;nt=' . $r->token);
444
-
445
- $m = newsletter_replace_url($message, 'UNSUBSCRIPTION_URL', $url);
446
- $m = newsletter_replace($m, $r);
447
-
448
- if (defined('NEWSLETTER_EXTRAS') && isset($options_email['track']))
449
- $m = newsletter_relink($m, $r->id, $options_email['name']);
450
-
451
- $s = $options_email['subject'];
452
- $s = newsletter_replace($s, $r);
453
-
454
- $x = newsletter_mail($r->email, $s, $m, true);
455
-
456
- echo htmlspecialchars($r->name) . ' (' . $r->email . ') ';
457
- flush();
458
-
459
- if ($x) {
460
- echo '[OK] -- ';
461
- newsletter_debug(__FUNCTION__, 'Sent to ' . $r->id . ' success');
462
- } else {
463
- echo '[KO] -- ';
464
- newsletter_debug(__FUNCTION__, 'Sent to ' . $r->id . ' failed');
465
  }
466
- }
467
- if (newsletter_has_extras('1.0.4')) newsletter_close_mail();
468
-
469
- }
470
-
471
-
472
-
473
- function newsletter_add_qs($url, $qs, $amp=true) {
474
- if (strpos($url, '?') !== false) {
475
- if ($amp) return $url . '&amp;' . $qs;
476
- else return $url . '&' . $qs;
477
- }
478
- else return $url . '?' . $qs;
479
- }
480
-
481
- /**
482
- * Add a request of newsletter subscription into the database with status "S" (waiting
483
- * confirmation) and sends out the confirmation request email to the subscriber.
484
- * The email will contain an URL (or link) the user has to follow to complete the
485
- * subscription (double opt-in).
486
- */
487
- function newsletter_subscribe($email, $name='', $profile=null) {
488
- global $wpdb, $newsletter_subscriber;
489
-
490
- $options = get_option('newsletter');
491
-
492
- $email = newsletter_normalize_email($email);
493
-
494
- $name = newsletter_normalize_name($name);
495
-
496
- $list = 0;
497
-
498
- if ($profile == null) $profile = array();
499
 
500
- // Check if this email is already in our database: if so, just resend the
501
- // confirmation email.
502
- $newsletter_subscriber = newsletter_get_subscriber_by_email($email, $list);
503
- if (!$newsletter_subscriber) {
504
- $token = md5(rand());
505
 
506
- if (isset($options['noconfirmation'])) {
507
- $status = 'C';
 
 
 
508
  }
509
- else {
510
- $status = 'S';
 
 
511
  }
512
- @$wpdb->insert($wpdb->prefix . 'newsletter', array(
513
- 'email'=>$email,
514
- 'name'=>$name,
515
- 'token'=>$token,
516
- 'list'=>$list,
517
- 'status'=>$status
518
- //'profile'=>serialize($profile)
519
- ));
520
- $id = $wpdb->insert_id;
521
- $newsletter_subscriber = newsletter_get_subscriber($id);
522
 
523
- // Profile saving
524
- foreach ($profile as $key=>$value) {
525
- @$wpdb->insert($wpdb->prefix . 'newsletter_profiles', array(
526
- 'newsletter_id'=>$id,
527
- 'name'=>$key,
528
- 'value'=>$value));
 
 
 
 
 
 
 
 
529
  }
530
 
 
 
 
 
 
 
 
531
  }
532
 
533
- if (isset($options['noconfirmation'])) {
534
- newsletter_send_welcome($newsletter_subscriber);
535
  }
536
- else {
537
- newsletter_send_confirmation($newsletter_subscriber);
538
- }
539
-
540
- $message = 'There is a new subscriber to ' . get_option('blogname') . ' newsletter:' . "\n\n" .
541
- $name . ' <' . $email . '>' . "\n\n" .
542
- 'Have a nice day,' . "\n" . 'your Newsletter plugin.';
543
-
544
- $subject = '[' . get_option('blogname') . '] New subscription';
545
- newsletter_notify_admin($subject, $message);
546
- }
547
-
548
 
549
- function newsletter_save($subscriber) {
550
- global $wpdb;
 
 
551
 
552
- $email = newsletter_normalize_email($email);
553
- $name = newsletter_normalize_name($name);
554
- $wpdb->query($wpdb->prepare("update " . $wpdb->prefix . "newsletter set email=%s, name=%s where id=%d",
555
- $subscriber['email'], $subscriber['name'], $subscriber['id']));
556
- }
557
-
558
-
559
- /**
560
- * Resends the confirmation message when asked by user manager panel.
561
- */
562
- function newsletter_send_confirmation($subscriber) {
563
- $options = get_option('newsletter');
564
 
565
- newsletter_debug(__FUNCTION__, "Confirmation request to:\n" . print_r($subscriber, true));
566
-
567
- $message = $options['confirmation_message'];
568
- $html = newsletter_get_theme_html($options['theme']);
569
- if ($html == null) $html = '{message}';
570
-
571
- $message = str_replace('{message}', $message, $html);
572
-
573
- // The full URL to the confirmation page
574
- $url = newsletter_add_qs($options['url'], 'na=c&amp;ni=' . $subscriber->id .
575
- '&amp;nt=' . $subscriber->token);
576
- $message = newsletter_replace_url($message, 'SUBSCRIPTION_CONFIRM_URL', $url);
577
-
578
- // URL to the unsubscription page (for test purpose)
579
- $url = newsletter_add_qs($options['url'], 'na=u&amp;ni=' . $subscriber->id .
580
- '&amp;nt=' . $subscriber->token);
581
- $message = newsletter_replace_url($message, 'UNSUBSCRIPTION_URL', $url);
582
-
583
- $message = newsletter_replace($message, $subscriber);
584
-
585
- $subject = newsletter_replace($options['confirmation_subject'], $subscriber);
586
-
587
- if (newsletter_has_extras('1.0.4')) newsletter_init_mail();
588
- newsletter_mail($subscriber->email, $subject, $message);
589
- if (newsletter_has_extras('1.0.4')) newsletter_close_mail();
590
-
591
- }
592
-
593
- /**
594
- * Return a subscriber by his email. The email will be sanitized and normalized
595
- * before issuing the query to the database.
596
- */
597
- function newsletter_get_subscriber($id) {
598
- global $wpdb;
599
-
600
- $recipients = $wpdb->get_results($wpdb->prepare("select * from " . $wpdb->prefix .
601
- "newsletter where id=%d", $id));
602
- if (!$recipients) return null;
603
- return $recipients[0];
604
- }
605
-
606
- function newsletter_get_subscriber_by_email($email, $list=0) {
607
- global $wpdb;
608
-
609
- $recipients = $wpdb->get_results($wpdb->prepare("select * from " . $wpdb->prefix .
610
- "newsletter where email=%s and list=%d", $email, $list));
611
- if (!$recipients) return null;
612
- return $recipients[0];
613
- }
614
 
615
- function newsletter_get_all() {
616
- global $wpdb;
 
 
617
 
618
- $recipients = $wpdb->get_results("select * from " . $wpdb->prefix . "newsletter order by email");
619
- return $recipients;
620
- }
621
 
622
- function newsletter_search($text, $status=null, $order='email') {
623
- global $wpdb;
 
 
 
 
624
 
625
- if ($order == 'id') $order = 'id desc';
 
626
 
627
- $query = "select * from " . $wpdb->prefix . "newsletter where 1=1";
628
- if ($status != null) {
629
- $query .= " and status='" . $wpdb->escape($status) . "'";
630
  }
631
 
632
- if ($text == '') {
633
- $recipients = $wpdb->get_results($query . " order by " . $order . ' limit 100');
634
  }
635
- else {
636
- $recipients = $wpdb->get_results($query . " and email like '%" .
637
- $wpdb->escape($text) . "%' or name like '%" . $wpdb->escape($text) . "%' order by " . $order . ' limit 100');
638
- }
639
- if (!$recipients) return null;
640
- return $recipients;
641
- }
642
 
643
- function newsletter_get_unconfirmed() {
644
- global $wpdb;
 
 
645
 
646
- $recipients = $wpdb->get_results("select * from " . $wpdb->prefix . "newsletter where status='S' order by email");
647
- return $recipients;
648
- }
649
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
650
 
651
- /**
652
- * Normalize an email address,making it lowercase and trimming spaces.
653
- */
654
- function newsletter_normalize_email($email) {
655
- return strtolower(trim($email));
656
- }
657
 
658
- function newsletter_normalize_name($name) {
659
- $name = str_replace(';', ' ', $name);
660
- $name = strip_tags($name);
661
- return $name;
662
- }
663
 
664
- add_action('init', 'newsletter_init');
665
- /**
666
- * Intercept the request parameters which drive the subscription and unsubscription
667
- * process.
668
- */
669
- function newsletter_init() {
670
- global $newsletter_step, $wpdb, $newsletter_subscriber;
671
- global $hyper_cache_stop;
672
 
673
- // "na" always is the action to be performed - stands for "newsletter action"
674
- $action = $_REQUEST['na'];
675
- if (!$action) return;
676
 
677
- $hyper_cache_stop = true;
 
 
 
 
 
 
 
678
 
679
- if (defined('NEWSLETTER_EXTRAS')) newsletter_extra_init($action);
 
680
 
681
- $options = get_option('newsletter');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
682
 
 
 
 
683
 
684
- // Subscription request from a subscription form (in page or widget), can be
685
- // a direct subscription with no confirmation
686
- if ($action == 's') {
687
- if (!newsletter_is_email($_REQUEST['ne'])) {
688
- die(newsletter_label('error_email'));
689
  }
690
- // If not set, the subscription form is not requesting the name, so we do not
691
- // raise errors.
692
- if (isset($_REQUEST['nn'])) {
693
- if (trim($_REQUEST['nn']) == '') {
694
- die(newsletter_label('error_name'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
695
  }
 
 
696
  }
697
- else {
698
- $_REQUEST['nn'] = '';
 
 
 
699
  }
700
 
701
- $profile1 = $_REQUEST['np'];
702
- if (!isset($profile1) || !is_array($profile1)) $profile1 = array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
703
 
704
- // keys starting with "_" are removed because used internally
705
- $profile = array();
706
- foreach ($profile1 as $k=>$v) {
707
- if ($k[0] == '_') continue;
708
- $profile[$k] = $v;
709
  }
710
 
711
- $profile['_ip'] = $_SERVER['REMOTE_ADDR'];
712
- $profile['_referrer'] = $_SERVER['HTTP_REFERER'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
713
 
714
- // Check if the group is good
715
- newsletter_subscribe($_REQUEST['ne'], $_REQUEST['nn'], $profile);
 
 
 
716
 
717
- if (isset($options['noconfirmation'])) {
718
- $newsletter_step = 'confirmed';
719
- }
720
- else {
721
- $newsletter_step = 'subscribed';
722
  }
723
- return;
724
- }
725
 
726
- // A request to confirm a subscription
727
- if ($action == 'c') {
728
- $id = $_REQUEST['ni'];
729
- newsletter_confirm($id, $_REQUEST['nt']);
730
- header('Location: ' . newsletter_add_qs($options['url'], 'na=cs&ni=' . $id . '&nt=' . $_REQUEST['nt'], false));
731
- die();
732
- }
733
 
734
- // Show the confirmed message after a redirection (to avoid mutiple email sending).
735
- // Redirect is sent by action "c".
736
- if ($action == 'cs') {
737
- $newsletter_subscriber = newsletter_get_subscriber($_REQUEST['ni']);
738
- if ($newsletter_subscriber->token != $_REQUEST['nt']) die('Ivalid token');
739
- $newsletter_step = 'confirmed';
740
  }
741
 
742
- // Unsubscription process has 2 options: if email and token are specified the user
743
- // will only be asked to confirm. If there is no infos of who remove (when
744
- // mass mail mode is used) the user will be asked to type the emailto be removed.
745
- if ($action == 'u') {
746
- $newsletter_step = 'unsubscription';
747
- }
748
 
749
- // User confirmed he want to unsubscribe clicking the link on unsubscription
750
- // page
751
- if ($action == 'uc') {
752
- newsletter_unsubscribe($_REQUEST['ni'], $_REQUEST['nt']);
753
- $newsletter_step = 'unsubscribed';
754
  }
755
- }
756
-
757
-
758
- /**
759
- * Deletes a subscription (no way back). Fills the global $newsletter_subscriber
760
- * with subscriber data to be used to build up messages.
761
- */
762
- function newsletter_unsubscribe($id, $token) {
763
- global $newsletter_subscriber, $wpdb;
764
-
765
- // Save the subscriber for good bye page
766
- $newsletter_subscriber = newsletter_get_subscriber($id);
767
-
768
- $wpdb->query($wpdb->prepare("delete from " . $wpdb->prefix . "newsletter where id=%d" .
769
- " and token=%s", $id, $token));
770
-
771
- $options = get_option('newsletter');
772
-
773
- $html = newsletter_get_theme_html($options['theme']);
774
- if ($html == null) $html = '{message}';
775
- $message = str_replace('{message}', $options['unsubscribed_message'], $html);
776
-
777
- $message = newsletter_replace($message, $newsletter_subscriber);
778
-
779
- // URL to the unsubscription page (for test purpose)
780
- // $url = newsletter_add_qs($options['url'], 'na=u&amp;ni=' . $newsletter_subscriber->id .
781
- // '&amp;nt=' . $newsletter_subscriber->token);
782
- // $message = newsletter_replace_url($message, 'UNSUBSCRIPTION_URL', $url);
783
 
784
- $subject = newsletter_replace($options['unsubscribed_subject'], $newsletter_subscriber);
785
-
786
- if (newsletter_has_extras('1.0.4')) newsletter_init_mail();
787
- newsletter_mail($newsletter_subscriber->email, $subject, $message);
788
- if (newsletter_has_extras('1.0.4')) newsletter_close_mail();
789
-
790
-
791
-
792
- // Admin notification
793
- $message = 'There is an unsubscription to ' . get_option('blogname') . ' newsletter:' . "\n\n" .
794
- $newsletter_subscriber->name . ' <' . $newsletter_subscriber->email . '>' . "\n\n" .
795
- 'Have a nice day,' . "\n" . 'your Newsletter plugin.';
796
-
797
- $subject = '[' . get_option('blogname') . '] Unsubscription';
798
- newsletter_notify_admin($subject, $message);
799
- }
800
-
801
- /*
802
- * Deletes a specific subscription. Called only from the admin panel.
803
- */
804
- function newsletter_delete($id) {
805
- global $wpdb;
806
-
807
- $wpdb->query($wpdb->prepare("delete from " . $wpdb->prefix . "newsletter where id=%d", $id));
808
- }
809
-
810
- function newsletter_delete_all($status=null) {
811
- global $wpdb;
812
-
813
- if ($status == null) {
814
- $wpdb->query("delete from " . $wpdb->prefix . "newsletter");
815
- }
816
- else {
817
- $wpdb->query("delete from " . $wpdb->prefix . "newsletter where status='" . $wpdb->escape($status) . "'");
818
  }
819
- }
820
 
821
- /**
822
- * Confirms a subscription identified by id and token, changing it's status on
823
- * database. Fill the global $newsletter_subscriber with user data.
824
- * If the subscription id already confirmed, the welcome email is still sent to
825
- * the subscriber (the welcome email can contains somthing reserved to the user
826
- * and he may has lost it).
827
- * If id and token do not match, the function does nothing.
828
- */
829
- function newsletter_confirm($id, $token) {
830
- global $wpdb, $newsletter_subscriber;
831
-
832
- $options = get_option('newsletter');
833
 
834
- $newsletter_subscriber = newsletter_get_subscriber($id);
 
 
835
 
836
- newsletter_info(__FUNCTION__, "Starting confirmation of subscriber " . $id);
837
-
838
- if ($newsletter_subscriber == null) {
839
- newsletter_error(__FUNCTION__, "Subscriber not found");
840
- return;
841
  }
842
 
843
- if ($newsletter_subscriber->token != $token) {
844
- newsletter_error(__FUNCTION__, "Token not matching");
845
- return;
846
  }
847
 
848
- newsletter_debug(__FUNCTION__, "Confirming subscriber:\n" . print_r($newsletter_subscriber, true));
849
-
850
- $count = $wpdb->query($wpdb->prepare("update " . $wpdb->prefix . "newsletter set status='C' where id=%d", $id));
 
 
851
 
852
- newsletter_send_welcome($newsletter_subscriber);
853
- }
854
-
855
- function newsletter_send_welcome($subscriber) {
856
- $options = get_option('newsletter');
857
-
858
- newsletter_debug(__FUNCTION__, "Welcome message to:\n" . print_r($subscriber, true));
 
 
 
 
 
859
 
860
- $html = newsletter_get_theme_html($options['theme']);
861
- if ($html == null) $html = '{message}';
862
- $message = str_replace('{message}', $options['confirmed_message'], $html);
863
 
864
- $message = newsletter_replace($message, $subscriber);
865
-
866
- // URL to the unsubscription page (for test purpose)
867
- $url = newsletter_add_qs($options['url'], 'na=u&amp;ni=' . $subscriber->id .
868
- '&amp;nt=' . $subscriber->token);
869
- $message = newsletter_replace_url($message, 'UNSUBSCRIPTION_URL', $url);
870
-
871
- $subject = newsletter_replace($options['confirmed_subject'], $subscriber);
872
- if (newsletter_has_extras('1.0.4')) newsletter_init_mail();
873
- newsletter_mail($subscriber->email, $subject, $message);
874
- if (newsletter_has_extras('1.0.4')) newsletter_close_mail();
875
- }
876
-
877
- /*
878
- * Changes the status of a subscription identified by its id.
879
- */
880
- function newsletter_set_status($id, $status) {
881
- global $wpdb;
882
 
883
- $wpdb->query($wpdb->prepare("update " . $wpdb->prefix . "newsletter set status=%s where id=%d", $status, $id));
884
- }
 
 
885
 
886
- /*
887
- * Sends a notification message to the blog admin.
888
- */
889
- function newsletter_notify_admin(&$subject, &$message) {
890
- $to = get_option('admin_email');
891
- $headers .= "Content-type: text/plain; charset=UTF-8\n";
892
- wp_mail($to, $subject, $message, $headers);
893
- }
894
 
895
- /**
896
- * Sends out an email (html or text). From email and name is retreived from
897
- * Newsletter plugin options. Return false on error. If the subject is empty
898
- * no email is sent out without warning.
899
- * The function uses wp_mail() to really send the message.
900
- */
901
- function newsletter_mail($to, &$subject, &$message, $html=true) {
902
- global $newsletter_mailer, $newsletter_options_main;
903
 
904
- if ($subject == '') {
905
- newsletter_debug(__FUNCTION__, 'Subject empty, skipped');
906
- return true;
907
- }
 
908
 
909
- if (newsletter_has_extras('1.0.4')) {
910
- return newsletter_extra_mail($to, &$subject, &$message, $html);
 
 
 
 
911
  }
912
 
913
- $options = get_option('newsletter');
914
-
915
- $headers = "MIME-Version: 1.0\n";
916
- if ($html) $headers .= "Content-type: text/html; charset=UTF-8\n";
917
- else $headers .= "Content-type: text/plain; charset=UTF-8\n";
 
918
 
919
- // Special character are manager by wp_mail()
920
- $headers .= 'From: "' . $options['from_name'] . '" <' . $options['from_email'] . ">\n";
921
 
922
- $r = wp_mail($to, $subject, $message, $headers);
923
- if (!$r) {
924
- newsletter_error(__FUNCTION__, "wp_mail() failed");
925
  }
926
- return $r;
927
- }
928
-
929
-
930
- add_action('activate_newsletter/plugin.php', 'newsletter_activate');
931
- function newsletter_activate() {
932
- global $wpdb, $newsletter_options_main;
933
 
934
- $options = get_option('newsletter', array());
935
-
936
- if (NEWSLETTER >= '1.5.2') {
937
- if (isset($options['logs'])) $newsletter_options_main['logs'] = $options['logs'];
938
- if (isset($options['editor'])) $newsletter_options_main['editor'] = $options['editor'];
939
- if (isset($options['version'])) $newsletter_options_main['version'] = $options['version'];
940
- if (isset($options['no_translation'])) $newsletter_options_main['no_translation'] = $options['no_translation'];
941
  }
942
 
943
- // Load the default options
944
- @include_once(dirname(__FILE__) . '/languages/en_US_options.php');
945
- if (WPLANG != '') @include_once(dirname(__FILE__) . '/languages/' . WPLANG . '_options.php');
946
- //@include_once(ABSPATH . 'wp-content/newsletter/languages/custom_options.php');
947
-
948
- $options = array_merge($newsletter_default_options, $options);
949
-
950
- // SQL to create the table
951
- $sql = 'create table if not exists ' . $wpdb->prefix . 'newsletter (
952
- `id` int not null auto_increment primary key,
953
- `name` varchar (100) not null default \'\',
954
- `email` varchar (100) not null default \'\',
955
- `token` varchar (50) not null default \'\',
956
- `status` varchar (1) not null default \'S\',
957
- `group` int not null default 0,
958
- `profile` text
959
- )';
960
-
961
- @$wpdb->query($sql);
962
-
963
- if (!isset($newsletter_options_main['version']) || $newsletter_options_main['version'] < '1.4.0') {
964
-
965
- $sql = "alter table " . $wpdb->prefix . "newsletter drop primary key";
966
- @$wpdb->query($sql);
967
-
968
- $sql = "alter table " . $wpdb->prefix . "newsletter add column id int not null auto_increment primary key";
969
- @$wpdb->query($sql);
970
-
971
- $sql = "alter table " . $wpdb->prefix . "newsletter add column list int not null default 0";
972
- @$wpdb->query($sql);
973
-
974
- $sql = "alter table " . $wpdb->prefix . "newsletter drop key email_token";
975
- @$wpdb->query($sql);
976
-
977
- $sql = "alter table " . $wpdb->prefix . "newsletter add column profile text";
978
- @$wpdb->query($sql);
979
-
980
- $sql = "ALTER TABLE " . $wpdb->prefix . "newsletter ADD UNIQUE email_list (email, list)";
981
- @$wpdb->query($sql);
982
  }
983
 
984
- if (!isset($newsletter_options_main['version']) || $newsletter_options_main['version'] < '1.4.1') {
985
- $sql = "alter table " . $wpdb->prefix . "newsletter add column created timestamp not null default current_timestamp";
986
- @$wpdb->query($sql);
987
  }
988
 
989
- $sql = 'create table if not exists ' . $wpdb->prefix . 'newsletter_profiles (
990
- `newsletter_id` int not null,
991
- `name` varchar (100) not null default \'\',
992
- `value` text,
993
- primary key (newsletter_id, name)
994
- )';
995
-
996
- @$wpdb->query($sql);
997
-
998
- newsletter_info(__FUNCTION__, 'Activated');
999
-
1000
- $newsletter_options_main['version'] = NEWSLETTER;
1001
- update_option('newsletter_main', $newsletter_options_main);
1002
- update_option('newsletter', $options);
1003
-
1004
- if (defined('NEWSLETTER_EXTRAS')) newsletter_extra_activate();
1005
- }
1006
-
1007
- if (is_admin()) {
1008
- add_action('admin_menu', 'newsletter_admin_menu');
1009
- function newsletter_admin_menu() {
1010
- global $newsletter_options_main;
1011
- $options = get_option('newsletter');
1012
- $level = ($newsletter_options_main['editor']==1)?7:10;
1013
 
1014
- if (function_exists('add_menu_page')) {
1015
- add_menu_page('Newsletter', 'Newsletter', $level, 'newsletter/main.php', '', '');
 
 
1016
  }
1017
 
1018
- if (function_exists('add_submenu_page')) {
1019
- add_submenu_page('newsletter/main.php', 'Configuration', 'Configuration', $level, 'newsletter/main.php');
1020
- add_submenu_page('newsletter/main.php', 'Subscription', 'Subscription', $level, 'newsletter/options.php');
1021
- add_submenu_page('newsletter/main.php', 'Composer', 'Composer', $level, 'newsletter/newsletter.php');
1022
- add_submenu_page('newsletter/main.php', 'Statistics', 'Statistics', $level, 'newsletter/statistics.php');
1023
- add_submenu_page('newsletter/main.php', 'Subscribers', 'Subscribers', $level, 'newsletter/manage.php');
1024
- add_submenu_page('newsletter/main.php', 'Import', 'Import', $level, 'newsletter/import.php');
1025
- add_submenu_page('newsletter/main.php', 'Export', 'Export', $level, 'newsletter/export.php');
1026
- add_submenu_page('newsletter/main.php', 'Forms', 'Forms', $level, 'newsletter/forms.php');
1027
- add_submenu_page('newsletter/main.php', 'SMTP', 'SMTP', $level, 'newsletter/smtp.php');
1028
- add_submenu_page('newsletter/main.php', 'Update', 'Update', $level, 'newsletter/convert.php');
1029
- }
1030
  }
1031
 
1032
- add_action('admin_head', 'newsletter_admin_head');
1033
- function newsletter_admin_head() {
1034
- if (strpos($_GET['page'], 'newsletter/') === 0) {
1035
- echo '<link type="text/css" rel="stylesheet" href="' .
1036
- get_option('siteurl') . '/wp-content/plugins/newsletter/style.css"/>';
1037
- }
1038
  }
1039
- }
1040
 
1041
- /**
1042
- * Fills a text with sunscriber data and blog data replacing some place holders.
1043
- */
1044
- function newsletter_replace($text, $subscriber) {
1045
- $text = str_replace('{home_url}', get_option('home'), $text);
1046
- $text = str_replace('{blog_title}', get_option('blogname'), $text);
1047
- $text = str_replace('{email}', $subscriber->email, $text);
1048
- $text = str_replace('{id}', $subscriber->id, $text);
1049
- $text = str_replace('{name}', $subscriber->name, $text);
1050
- $text = str_replace('{token}', $subscriber->token, $text);
1051
- $text = str_replace('%7Btoken%7D', $subscriber->token, $text);
1052
- $text = str_replace('%7Bid%7D', $subscriber->id, $text);
1053
-
1054
- return $text;
1055
- }
1056
-
1057
- /**
1058
- * Replaces the URL placeholders. There are two kind of URL placeholders: the ones
1059
- * lowercase and betweeb curly brakets and the ones all uppercase. The tag to be passed
1060
- * is the one all uppercase but the lowercase one will also be replaced.
1061
- */
1062
- function newsletter_replace_url($text, $tag, $url) {
1063
- $home = get_option('home') . '/';
1064
- $tag_lower = strtolower($tag);
1065
- $text = str_replace($home . '{' . $tag_lower . '}', $url, $text);
1066
- $text = str_replace($home . '%7B' . $tag_lower . '%7D', $url, $text);
1067
- $text = str_replace('{' . $tag_lower . '}', $url, $text);
1068
-
1069
- // for compatibility
1070
- $text = str_replace($home . $tag, $url, $text);
1071
-
1072
- return $text;
1073
- }
1074
 
1075
- function newsletter_is_email($email, $empty_ok=false) {
1076
- $email = strtolower(trim($email));
1077
- if ($empty_ok && $email == '') return true;
1078
 
1079
- if (eregi("^([a-z0-9_\.-])+@(([a-z0-9_-])+\\.)+[a-z]{2,6}$", trim($email))) {
1080
  if (strpos($email, 'mailinator.com') !== false) return false;
1081
  if (strpos($email, 'guerrillamailblock.com') !== false) return false;
 
1082
  return true;
1083
  }
1084
- else
1085
- return false;
1086
- }
1087
 
1088
- function newsletter_delete_batch_file() {
1089
- @unlink(dirname(__FILE__) . '/batch.dat');
1090
- }
1091
-
1092
- function newsletter_save_batch_file($batch) {
1093
- $file = @fopen(dirname(__FILE__) . '/batch.dat', 'w');
1094
- if (!$file) return;
1095
- @fwrite($file, serialize($batch));
1096
- @fclose($file);
1097
- }
1098
-
1099
- function newsletter_load_batch_file() {
1100
- $content = @file_get_contents(dirname(__FILE__) . '/batch.dat');
1101
- return @unserialize($content);
1102
- }
1103
-
1104
- /**
1105
- * Write a line of log in the log file if the logs are enabled or force is
1106
- * set to true.
1107
- */
1108
- function newsletter_log($text) {
1109
- $file = @fopen(dirname(__FILE__) . '/newsletter.log', 'a');
1110
- if (!$file) return;
1111
- @fwrite($file, date('Y-m-d h:i') . ' ' . $text . "\n");
1112
- @fclose($file);
1113
- }
1114
 
1115
- function newsletter_debug($fn, $text) {
1116
- global $newsletter_options_main;
1117
- if ($newsletter_options_main['logs'] < 2) return;
1118
- newsletter_log('- DEBUG - ' . $fn . ' - ' . $text);
1119
- }
1120
 
1121
- function newsletter_info($fn, $text) {
1122
- if ($newsletter_options_main['logs'] < 1) return;
1123
- newsletter_log('- INFO - ' . $fn . ' - ' . $text);
1124
- }
1125
-
1126
- function newsletter_error($fn, $text) {
1127
- if ($newsletter_options_main['logs'] < 1) return;
1128
- newsletter_log('- ERROR - ' . $fn . ' - ' . $text);
1129
- }
1130
-
1131
- /**
1132
- * Retrieves a list of custom themes located under wp-plugins/newsletter-custom/themes.
1133
- * Return a list of theme names (which are folder names where the theme files are stored.
1134
- */
1135
- function newsletter_get_themes() {
1136
- $handle = @opendir(ABSPATH . 'wp-content/plugins/newsletter-custom/themes');
1137
- $list = array();
1138
- if (!$handle) return $list;
1139
- while ($file = readdir($handle)) {
1140
- if ($file == '.' || $file == '..') continue;
1141
- if (!is_dir(ABSPATH . 'wp-content/plugins/newsletter-custom/themes/' . $file)) continue;
1142
- if (!is_file(ABSPATH . 'wp-content/plugins/newsletter-custom/themes/' . $file . '/theme.php')) continue;
1143
- $list[] = $file;
1144
  }
1145
- closedir($handle);
1146
- return $list;
1147
- }
1148
 
1149
- function newsletter_get_extras_themes() {
1150
- $handle = @opendir(ABSPATH . 'wp-content/plugins/newsletter-extras/themes');
1151
- $list = array();
1152
- if (!$handle) return $list;
1153
- while ($file = readdir($handle)) {
1154
- if ($file == '.' || $file == '..') continue;
1155
- if (!is_dir(ABSPATH . 'wp-content/plugins/newsletter-extras/themes/' . $file)) continue;
1156
- if (!is_file(ABSPATH . 'wp-content/plugins/newsletter-extras/themes/' . $file . '/theme.php')) continue;
1157
- $list[] = $file;
1158
- }
1159
- closedir($handle);
1160
- return $list;
1161
  }
1162
 
1163
- /**
1164
- * Resets the batch status.
1165
- */
1166
- function newsletter_reset_batch() {
1167
 
1168
- }
1169
 
1170
- function newsletter_has_extras($version=null) {
1171
- if (!defined('NEWSLETTER_EXTRAS')) return false;
1172
- if ($version == null) return true;
1173
- if ($version <= NEWSLETTER_EXTRAS) return true;
1174
- return false;
1175
- }
1176
-
1177
- /**
1178
  * Find an image for a post checking the media uploaded for the post and
1179
  * choosing the first image found.
1180
  */
1181
  function nt_post_image($post_id, $size='thumbnail', $alternative=null) {
1182
 
1183
- $attachments = get_children(array('post_parent'=>$post_id, 'post_status'=>'inherit', 'post_type'=>'attachment', 'post_mime_type'=>'image', 'order'=>'ASC', 'orderby'=>'menu_order ID' ) );
1184
 
1185
  if (empty($attachments)) {
1186
  return $alternative;
1187
  }
1188
 
1189
- foreach ($attachments as $id=>$attachment) {
1190
  $image = wp_get_attachment_image_src($id, $size);
1191
  return $image[0];
1192
  }
@@ -1194,64 +895,20 @@ function nt_post_image($post_id, $size='thumbnail', $alternative=null) {
1194
  }
1195
 
1196
  function nt_option($name, $def = null) {
1197
- // if ($newsletter_is_feed && $name == 'posts') {
1198
- // $options = get_option('newsletter_feed');
1199
- // return $options['posts'];
1200
- // }
1201
  $options = get_option('newsletter_email');
1202
  $option = $options['theme_' . $name];
1203
  if (!isset($option)) return $def;
1204
  else return $option;
1205
  }
1206
 
1207
- /**
1208
- * Retrieves the theme dir path.
1209
- */
1210
- function newsletter_get_theme_dir($theme) {
1211
- if ($theme[0] == '*') {
1212
- return ABSPATH . '/wp-content/plugins/newsletter-custom/themes/' . substr($theme, 1);
1213
- }
1214
- elseif ($theme[0] == '$') {
1215
- return ABSPATH . '/wp-content/plugins/newsletter-extras/themes/' . substr($theme, 1);
1216
- }
1217
- else {
1218
- return dirname(__FILE__) . '/themes/' . $theme;
1219
- }
1220
- }
1221
-
1222
- /**
1223
- * Retrieves the theme URL (pointing to theme dir).
1224
- */
1225
- function newsletter_get_theme_url($theme) {
1226
- if ($theme[0] == '*') {
1227
- return get_option('siteurl') . '/wp-content/plugins/newsletter-custom/themes/' . substr($theme, 1);
1228
- }
1229
- elseif ($theme[0] == '$') {
1230
- return get_option('siteurl') . '/wp-content/plugins/newsletter-extras/themes/' . substr($theme, 1);
1231
- }
1232
- else {
1233
- return get_option('siteurl') . '/wp-content/plugins/newsletter/themes/' . $theme;
1234
- }
1235
- }
1236
-
1237
- /**
1238
- * Loads the theme css content to be embedded in emails body.
1239
- */
1240
- function newsletter_get_theme_css($theme) {
1241
- if ($theme == 'blank') return '';
1242
- return @file_get_contents(newsletter_get_theme_dir($theme) . '/style.css');
1243
  }
1244
 
1245
- function newsletter_get_theme_html($theme) {
1246
- if ($theme == 'blank') return '';
1247
- $file = newsletter_get_theme_dir($theme) . '/theme.php';
1248
-
1249
- // Execute the theme file and get the content generated
1250
- ob_start();
1251
- @include($file);
1252
- $html = ob_get_contents();
1253
- ob_end_clean();
1254
- return $html;
1255
  }
1256
-
1257
- ?>
1
  <?php
2
  /*
3
+ Plugin Name: Newsletter
4
+ Plugin URI: http://www.satollo.net/plugins/newsletter
5
+ Description: Newsletter is a cool plugin to create your own subscriber list, to send newsletters, to build your business. <strong>Before update give a look to <a href="http://www.satollo.net/plugins/newsletter#update">this page</a> to know what's changed.</strong>
6
+ Version: 2.5.0
7
+ Author: Satollo
8
+ Author URI: http://www.satollo.net
9
+ Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
10
+
11
+ Copyright 2011 Stefano Lissa (email: stefano@satollo.net, web: http://www.satollo.net)
12
+ */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
+ define('NEWSLETTER_LIST_MAX', 9);
15
+ define('NEWSLETTER_PROFILE_MAX', 19);
16
+
17
+ global $newsletter;
18
+ $newsletter = new Newsletter();
19
+
20
+ class Newsletter {
21
+ const VERSION = 250;
22
+
23
+ var $time_limit;
24
+ var $email_limit = 10; // Per run
25
+ var $relink_email_id;
26
+ var $relink_user_id;
27
+ var $mailer;
28
+ var $options_main;
29
+ var $message;
30
+ var $user;
31
+ var $error;
32
+
33
+ function Newsletter() {
34
+ global $wpdb;
35
+
36
+ // Early possible
37
+ $max_time = (int) (@ini_get('max_execution_time') * 0.9);
38
+ if ($max_time == 0) $max_time = 600;
39
+ $this->time_limit = time() + $max_time;
40
+
41
+ register_activation_hook(__FILE__, array(&$this, 'hook_activate'));
42
+ register_deactivation_hook(__FILE__, array(&$this, 'hook_deactivate'));
43
+
44
+ add_action('init', array(&$this, 'hook_init'));
45
+ add_action('admin_init', array(&$this, 'hook_admin_init'));
46
+ add_action('mailer_bounce_email', array(&$this, 'mailer_bounce_email'));
47
+
48
+ add_filter('cron_schedules', array(&$this, 'hook_cron_schedules'), 1000);
49
+ add_action('newsletter', array(&$this, 'hook_newsletter'), 1);
50
+
51
+ // This specific event is created by "Feed by mail" panel on configuration
52
+ add_action('newsletter_feed', array(&$this, 'hook_newsletter_feed'));
53
+ add_action('template_redirect', array(&$this, 'hook_template_redirect'));
54
+ add_action('wp_head', array(&$this, 'hook_wp_head'));
55
+ add_shortcode('newsletter', array(&$this, 'shortcode_newsletter'));
56
+ add_shortcode('newsletter_lock', array(&$this, 'shortcode_newsletter_lock'));
57
+ add_shortcode('newsletter_form', array(&$this, 'shortcode_newsletter_form'));
58
+ add_shortcode('newsletter_embed', array(&$this, 'shortcode_newsletter_form'));
59
+ add_action('shutdown', array(&$this, 'hook_shutdown'));
60
+ if (is_admin ()) {
61
+ add_action('admin_menu', array(&$this, 'hook_admin_menu'));
62
+ add_action('admin_head', array(&$this, 'hook_admin_head'));
63
+ }
64
 
65
+ $this->options_main = get_option('newsletter_main', array());
 
 
 
66
  }
67
+
68
+ function hook_admin_head() {
69
+ if (strpos($_GET['page'], 'newsletter/') === 0) {
70
+ echo '<link type="text/css" rel="stylesheet" href="' .
71
+ get_option('siteurl') . '/wp-content/plugins/newsletter/style.css"/>';
 
 
72
  }
 
73
  }
 
74
 
75
+ function hook_admin_menu() {
76
+ include 'plugin-menu.inc.php';
77
+ }
 
78
 
79
+ function hook_wp_head() {
80
+ include 'plugin-head.inc.php';
 
 
81
  }
 
 
 
 
 
 
 
 
82
 
83
+ function hook_newsletter_feed() {
84
  }
 
 
85
 
86
+ function check_transient($name, $time) {
87
+ if (get_transient($name) !== false) {
88
+ $this->log('Called too quickly');
89
+ return false;
90
+ }
91
+ set_transient($name, 1, $time);
92
+ return true;
93
+ }
94
+
95
+ function hook_newsletter() {
96
+ global $wpdb;
97
 
98
+ $this->log();
99
+ if (!$this->check_transient('newsletter', 60)) return;
100
 
101
+ $max = $this->options_main['scheduler_max'];
102
+ if (!is_numeric($max)) $max = 100;
103
+ $this->email_limit = max(floor($max / 12), 1);
104
 
105
+ $this->set_limits();
 
 
106
 
107
+ // Retrieve all email in "sending" status
108
+ $emails = $wpdb->get_results("select * from " . $wpdb->prefix . "newsletter_emails where status='sending' order by id desc");
109
+ foreach ($emails as $email) {
110
+ if (!$this->send($email)) return;
111
  }
112
+ }
113
+
114
+ function send($email, $users = null) {
115
+ global $wpdb;
116
+
117
+ $this->log();
118
+
119
+ if ($users == null) {
120
+ // Fake value representing the WordPress users target
121
+ if ($email->list == -1) {
122
+ if (!empty($email->query)) $query = "select * from " . $wpdb->prefix . "users " . $email->query . " and id>" . $email->last_id . " order by id limit " . $this->email_limit;
123
+ else $query = "select * from " . $wpdb->prefix . "users where id>" . $email->last_id . " order by id limit " . $this->email_limit;
124
+ $this->log($query, 3);
125
+ $wp_users = $wpdb->get_results($query);
126
+ $users = array();
127
+ foreach ($wp_users as &$wp_user) {
128
+ $user = new stdClass();
129
+ $user->email = $wp_user->user_email;
130
+ $user->name = $wp_user->user_login;
131
+ $user->id = -$wp_user->ID;
132
+ $users[] = $user;
133
+ }
134
  }
135
  else {
136
+ if (!empty($email->query)) $query = "select * from " . $wpdb->prefix . "newsletter " . $email->query;
137
+ else {
138
+ $query = "select * from " . $wpdb->prefix . "newsletter where status='C'";
139
+ if ($email->list != 0) $query .= " and list_" . $email->list . "=1";
140
+ if (!empty($email->sex)) $query .= " and sex='" . $email->sex . "'";
141
+ }
142
+ $query .= " and id>" . $email->last_id . " order by id limit " . $this->email_limit;
143
+ $this->log($query, 3);
144
+ $users = $wpdb->get_results($query);
145
  }
 
 
146
  }
147
 
148
+ if (empty($users)) {
149
+ $this->log('No more users');
150
+ $wpdb->query("update " . $wpdb->prefix . "newsletter_emails set status='sent' where id=" . $email->id);
151
+ return;
152
+ }
153
 
154
+ foreach ($users as $user) {
155
+ $headers = array('List-Unsubscribe' => '<' .
156
+ $this->add_qs($this->options_main['url'], 'na=u&ni=' . $user->id . '&nt=' . $user->token) . '>');
 
 
157
 
158
+ $m = $this->execute($email->message, $user);
159
+ if (empty($m)) continue;
160
+ $m = $this->replace($m, $user);
161
 
162
+ if ($email->track == 1) $m = $this->relink($m, $email->id, $user->id);
163
+
164
+ $s = $this->replace($email->subject, $user);
165
+ $x = $this->mail($user->email, $s, $m, true, $headers, 2);
166
+
167
+ $wpdb->query("update " . $wpdb->prefix . "newsletter_emails set sent=sent+1, last_id=" . abs($user->id) . " where id=" . $email->id);
168
+ $this->email_limit--;
169
+ if ($this->limits_exceeded()) return false;
170
  }
171
+ return true;
172
  }
173
 
174
+ function feed_send($email, $users = null) {
 
 
 
 
 
 
 
 
 
175
  }
176
 
177
+ function followup_send($users = null, $options=null) {
 
 
 
 
178
  }
179
 
180
+ function execute($text, $user=null) {
181
+ global $wpdb;
182
+ ob_start();
183
+ $r = eval('?' . '>' . $text);
184
+ if ($r === false) {
185
+ $this->error = 'Error while executing a PHP expression in a message body. See log file.';
186
+ $this->log('Error on execution of ' . $text, 1);
187
+ ob_end_clean();
188
+ return false;
189
+ }
190
 
191
+ return ob_get_clean();
192
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
193
 
194
+ /**
195
+ * Return true if the execution timeout is reached or the maximum number of email
196
+ * has been sent.
197
+ */
198
+ function limits_exceeded() {
199
+ if (time() > $this->time_limit) {
200
+ $this->log('Timeout', 2);
201
+ return true;
202
+ }
203
+ if ($this->email_limit < 0) {
204
+ $this->log('Email limit reached', 3);
205
+ return true;
206
+ }
207
+ return false;
208
+ }
209
 
210
+ function mail($to, $subject, $message, $html=true, $headers=null, $priority=0) {
 
 
211
 
212
+ $this->log('To: ' . $to, 3);
213
+ $this->log('Subject: ' . $subject, 3);
214
+ if (empty($subject)) {
215
+ $this->log('Subject empty, skipped', 3);
216
+ return true;
217
+ }
218
 
219
+ if (!empty($this->options_main['receiver'])) $to = $this->options_main['receiver'];
220
 
 
 
 
 
221
 
222
+ $h = '';
223
+ if (!empty($headers)) {
224
+ foreach ($headers as $key => $value)
225
+ $h .= $key . ': ' . $value . "\n";
226
+ }
227
 
228
+ $h .= "From: " . $this->options_main['sender_name'] . " <" . $this->options_main['sender_email'] . ">\n";
 
 
 
229
 
230
+ if (!empty($this->options_main['reply_to'])) {
231
+ $h .= "Reply-To: " . $this->options_main['reply_to'] . "\n";
232
+ }
233
+ if (!empty($this->options_main['return_path'])) {
234
+ $h .= "Return-Path: " . $this->options_main['return_path'] . "\n";
235
+ }
236
+ $h .= "X-MailerPriority: " . $priority . "\n";
237
+ $h .= "X-MailerGroup: newsletter\n";
238
+ $h .= "MIME-Version: 1.0\n";
239
+ if ($html) $h .= "Content-type: text/html; charset=UTF-8\n";
240
+ else $h .= "Content-type: text/plain; charset=UTF-8\n";
241
+ $this->log('Headers: ' . $h, 3);
242
+ $r = wp_mail($to, $subject, $message, $h);
243
+ $this->log($r ? 'Mail sent' : 'Mail sending failed', 1);
244
+ return $r;
245
  }
246
 
247
+ function mailer_init() {
 
 
248
  }
249
 
250
+ function relink($text, $email_id, $user_id) {
251
+ return $text;
 
 
 
 
 
 
 
 
 
 
252
  }
253
 
254
+ function relink_callback($matches) {
 
 
 
255
  }
256
 
257
+ /**
258
+ * Levels are: 1 for errors, 2 for normal activity, 3 for debug.
259
+ */
260
+ function log($text='', $level=2) {
261
+ if ((int) $this->options_main['logs'] < $level) return;
262
 
263
+ $db = debug_backtrace(false);
264
+ $time = date('d-m-Y H:i:s ');
265
+ switch ($level) {
266
+ case 1: $time .= '- ERROR';
267
+ break;
268
+ case 2: $time .= '- INFO ';
269
+ break;
270
+ case 3: $time .= '- DEBUG';
271
+ break;
272
+ }
273
+ if (is_array($text) || is_object($text)) $text = print_r($text, true);
274
+ file_put_contents(dirname(__FILE__) . '/log.txt', $time . ' - ' . $db[1]['function'] . ' - ' . $text . "\n", FILE_APPEND | FILE_TEXT);
275
  }
276
 
277
+ function hook_activate() {
278
+ global $wpdb;
279
+ include 'plugin-activate.inc.php';
 
 
 
 
 
 
 
 
280
  }
281
 
282
+ function hook_deactivate() {
283
+ wp_clear_scheduled_hook('newsletter');
 
284
  }
 
 
 
 
 
 
285
 
286
+ function hook_cron_schedules($schedules) {
287
+ $schedules['newsletter'] = array(
288
+ 'interval' => 300, // seconds
289
+ 'display' => 'Newsletter'
290
+ );
291
+ return $schedules;
292
+ }
 
 
 
 
 
293
 
294
+ /**
295
+ * Generate the profile editing form.
296
+ */
297
+ function profile_form($user) {
298
+ $options = get_option('newsletter_profile');
299
 
300
+ $buffer .= '<div class="newsletter newsletter-profile">';
301
+ $buffer .= '<form action="" method="post"><input type="hidden" name="na" value="ps"/>';
302
+ $buffer .= '<table>';
303
+ $buffer .= '<tr><th align="right">' . $options['email'] . '</th><td><input type="text" size="30" name="ne" value="' . htmlspecialchars($user->email) . '"/></td></tr>';
304
+ if ($options['name_status'] >= 1) {
305
+ $buffer .= '<tr><th align="right">' . $options['name'] . '</th><td><input type="text" size="30" name="nn" value="' . htmlspecialchars($user->name) . '"/></td></tr>';
306
  }
307
+ if ($options['surname_status'] >= 1) {
308
+ $buffer .= '<tr><th align="right">' . $options['surname'] . '</th><td><input type="text" size="30" name="ns" value="' . htmlspecialchars($user->surname) . '"/></td></tr>';
309
  }
310
+ if ($options['sex_status'] >= 1) {
311
+ $buffer .= '<tr><th align="right">' . $options['sex'] . '</th><td><select name="nx" class="newsletter-sex">';
312
+ // if (!empty($options['sex_none'])) {
313
+ // $buffer .= '<option value="n"' . ($user->sex == 'n' ? ' selected' : '') . '>' . $options['sex_none'] . '</option>';
314
+ // }
315
+ $buffer .= '<option value="f"' . ($user->sex == 'f' ? ' selected' : '') . '>' . $options['sex_female'] . '</option>';
316
+ $buffer .= '<option value="m"' . ($user->sex == 'm' ? ' selected' : '') . '>' . $options['sex_male'] . '</option>';
317
+ $buffer .= '</select></td></tr>';
 
 
 
 
318
  }
319
 
320
+ // Profile
321
+ for ($i = 1; $i <= 19; $i++) {
322
+ if ($options['profile_' . $i . '_status'] == 0) continue;
 
323
 
324
+ $buffer .= '<tr><th align="right">' . $options['profile_' . $i] . '</th><td>';
325
+ //if ($options['list_type_' . $i] != 'public') continue;
326
+ $field = 'profile_' . $i;
 
 
 
 
 
327
 
328
+ if ($options['profile_' . $i . '_type'] == 'text') {
329
+ $buffer .= '<input type="text" size="40" name="np' . $i . '" value="' . htmlspecialchars($user->$field) . '"/>';
 
 
330
  }
331
+ if ($options['profile_' . $i . '_type'] == 'select') {
332
+ $buffer .= '<select name="np' . $i . '">';
333
+ $opts = explode(',', $options['profile_' . $i . '_options']);
334
+ for ($i = 0; $i < count($opts); $i++) {
335
+ $opts[$i] = trim($opts[$i]);
336
+ $buffer .= '<option';
337
+ if ($opts[$i] == $user->$field) $buffer .= ' selected';
338
+ $buffer .= '>' . $opts[$i] . '</option>';
339
+ }
340
+ $buffer .= '</select>';
 
 
 
 
 
341
  }
342
 
343
+ $buffer .= '</td></tr>';
 
 
 
344
  }
345
 
346
+ // Lists
347
+ $buffer .= '<tr><th>&nbsp;</th><td>';
348
+ for ($i = 1; $i <= 9; $i++) {
349
+ if ($options['list_' . $i . '_status'] == 0) continue;
350
+ $buffer .= '<input type="checkbox" name="nl[]" value="' . $i . '"';
351
+ $list = 'list_' . $i;
352
+ if ($user->$list == 1) $buffer .= ' checked';
353
+ $buffer .= '/> ' . htmlspecialchars($options['list_' . $i]) . '<br />';
 
 
 
 
 
 
 
 
 
 
354
  }
355
+ $buffer .= '</td></tr>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
356
 
357
+ $buffer .= '<tr><td colspan="2" align="center"><input type="submit" value="' . $options['save'] . '"/></td></tr>';
358
+ $buffer .= '</table></form></div>';
359
 
360
+ return $buffer;
 
 
 
 
 
 
 
 
 
361
  }
362
 
363
+ function subscription_form() {
364
+ $options_profile = get_option('newsletter_profile');
365
+ $options = get_option('newsletter');
366
+ $buffer = '<div class="newsletter newsletter-subscription"><form method="post" action="' . $this->options_main['url'] . '" onsubmit="return newsletter_check(this)"><input type="hidden" name="na" value="s"/>';
367
+ $buffer .= '<table>';
368
+ if ($options_profile['name_status'] == 2) {
369
+ $buffer .= '<tr><th>' . $options_profile['name'] . '</th><td><input type="text" name="nn" size="30"/></td></tr>';
370
+ }
371
+ if ($options_profile['surname_status'] == 2) {
372
+ $buffer .= '<tr><th>' . $options_profile['surname'] . '</td><th><input type="text" name="ns" size="30"/></td></tr>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
373
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
374
 
375
+ $buffer .= '<tr><th>' . $options_profile['email'] . '</th><td align="left"><input type="text" name="ne" size="30"/></td></tr>';
 
 
 
 
376
 
377
+ if ($options_profile['sex_status'] == 2) {
378
+ $buffer .= '<tr><th>' . $options_profile['sex'] . '</th><td><select name="nx" class="newsletter-sex">';
379
+ $buffer .= '<option value="m">' . $options_profile['sex_male'] . '</option>';
380
+ $buffer .= '<option value="f">' . $options_profile['sex_female'] . '</option>';
381
+ $buffer .= '</select></td></tr>';
382
  }
383
+ $lists = '';
384
+ for ($i = 1; $i <= 9; $i++) {
385
+ if ($options_profile['list_' . $i . '_status'] != 2) continue;
386
+ $lists .= '<input type="checkbox" name="nl[]" value="' . $i . '"/>&nbsp;' . $options_profile['list_' . $i] . '<br />';
387
  }
388
+ if (!empty($lists)) $buffer .= '<tr><th>&nbsp;</th><td>' . $lists . '</td></tr>';
 
 
 
 
 
 
 
 
 
389
 
390
+ // Extra profile fields
391
+ for ($i = 1; $i <= 19; $i++) {
392
+ if ($options_profile['profile_' . $i . '_status'] != 2) continue;
393
+ if ($options_profile['profile_' . $i . '_type'] == 'text') {
394
+ $buffer .= '<tr><th>' . $options_profile['profile_' . $i] . '</th><td><input type="text" size="30" name="np' . $i . '"/></td></tr>';
395
+ }
396
+ if ($options_profile['profile_' . $i . '_type'] == 'select') {
397
+ $buffer .= '<tr><th>' . $options_profile['profile_' . $i] . '</th><td><select name="np' . $i . '">';
398
+ $opts = explode(',', $options_profile['profile_' . $i . '_options']);
399
+ for ($i = 0; $i < count($opts); $i++) {
400
+ $buffer .= '<option>' . trim($opts[$i]) . '</option>';
401
+ }
402
+ $buffer .= '</select></td></tr>';
403
+ }
404
  }
405
 
406
+ $buffer .= '<tr><td colspan="2" style="text-align: center">';
407
+ if ($options_profile['privacy_status'] == 1) {
408
+ $buffer .= '<input type="checkbox" name="ny"/>&nbsp;' . $options_profile['privacy'] . '<br />';
409
+ }
410
+ $buffer .= '<input type="submit" value="' . $options_profile['subscribe'] . '"/></td></tr>';
411
+ $buffer .= '</table></form></div>';
412
+ return $buffer;
413
  }
414
 
415
+ function mailer_bounce_email($email) {
 
416
  }
 
 
 
 
 
 
 
 
 
 
 
 
417
 
418
+ function hook_template_redirect() {
419
+ if (!empty($this->message) && empty($this->options_main['url'])) {
420
+ if ($this->options_main['theme'][0] == '*') $file = ABSPATH . 'wp-content/plugins/newsletter-custom/themes-page/' . substr($this->options_main['theme'], 1) . '/theme.php';
421
+ else $file = dirname(__FILE__) . '/themes-page/' . $this->options_main['theme'] . '/theme.php';
422
 
423
+ // Include the labels, language dependend
424
+ @include(dirname($file) . '/en_US.php');
425
+ if (defined('WPLANG') && WPLANG != '') @include(dirname($file) . '/' . WPLANG . '.php');
 
 
 
 
 
 
 
 
 
426
 
427
+ ob_start();
428
+ @include($file);
429
+ $m = ob_get_contents();
430
+ ob_end_clean();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
431
 
432
+ echo $this->execute(str_replace('{message}', $this->message, $m));
433
+ die();
434
+ }
435
+ }
436
 
437
+ function shortcode_newsletter() {
438
+ if (!empty($this->message)) return $this->message;
 
439
 
440
+ $options = get_option('newsletter');
441
+ // If there is an "embedded" form, adjust it and ignore the standard subscription form
442
+ if (stripos($options['subscription_text'], '<form') !== false) {
443
+ $buffer = str_ireplace('<form', '<form method="post" action="' . $this->options_main['url'] . '" onsubmit="return newsletter_check(this)"', $options['subscription_text']);
444
+ return str_ireplace('</form>', '<input type="hidden" name="na" value="s"/></form>', $buffer);
445
+ }
446
 
447
+ if (strpos($buffer, '{subscription_form}') !== false) return str_replace('{subscription_form}', $this->subscription_form(), $options['subscription_text']);
448
+ else return $options['subscription_text'] . $this->subscription_form();
449
 
450
+ return $buffer;
 
 
451
  }
452
 
453
+ function shortcode_newsletter_form($attrs, $content) {
454
+ return $this->form($attrs['form']);
455
  }
 
 
 
 
 
 
 
456
 
457
+ function form($number=null) {
458
+ if ($number == null) return $this->subscription_form();
459
+ $options = get_option('newsletter_forms');
460
+ $options_profile = get_option('newsletter_profile');
461
 
462
+ $form = str_replace('{newsletter_url}', $this->options_main['url'], $options['form_' . $number]);
 
 
463
 
464
+ $lists = '';
465
+ for ($i = 1; $i <= 9; $i++) {
466
+ if ($options_profile['list_' . $i . '_status'] != 2) continue;
467
+ $lists .= '<input type="checkbox" name="nl[]" value="' . $i . '"/>&nbsp;' . $options_profile['list_' . $i] . '<br />';
468
+ }
469
+ $form = str_replace('{lists}', $lists, $form);
470
+ return $form;
471
+ }
472
+
473
+ function hook_init() {
474
+ global $hyper_cache_stop, $wpdb;
475
+
476
+ $action = $_REQUEST['na'];
477
+ if (empty($action) || is_admin()) return;
478
+
479
+ $hyper_cache_stop = true;
480
+
481
+ $this->log($action);
482
+
483
+ $options = get_option('newsletter', array()); // Subscription options, emails and texts
484
+
485
+ // Subscription request from a subscription form (in page or widget), can be
486
+ // a direct subscription with no confirmation
487
+ if ($action == 's') {
488
+ $email = $this->normalize_email(stripslashes($_REQUEST['ne']));
489
+ if ($email == null) die('Wrong email');
490
+ $user = $wpdb->get_row($wpdb->prepare("select * from " . $wpdb->prefix . "newsletter where email=%s", $email));
491
+ if ($user == null) {
492
+ $this->log("not found");
493
+ $user = array('email' => $email);
494
+
495
+ $user['name'] = $this->normalize_name(stripslashes($_REQUEST['nn']));
496
+ $user['surname'] = $this->normalize_name(stripslashes($_REQUEST['ns']));
497
+ if (!empty($_REQUEST['nx'])) $user['sex'] = $_REQUEST['nx'][0];
498
+ $user['referrer'] = $_REQUEST['nr'];
499
+
500
+ // New profiles
501
+ for ($i = 1; $i <= 19; $i++) {
502
+ if ($options_profile['profile_' . $i . '_status'] == 0) continue;
503
+ $user['profile_' . $i] = trim(stripslashes($_REQUEST['np' . $i]));
504
+ }
505
+
506
+ // Lists (field names are nl[] and values the list number so special forms with radio button can work)
507
+ if (is_array($_REQUEST['nl'])) {
508
+ $options_profile = get_option('newsletter_profile');
509
+ for ($i = 1; $i <= 9; $i++) {
510
+ if ($options_profile['list_' . $i . '_status'] != 2) continue;
511
+ if (in_array($i, $_REQUEST['nl'])) $user['list_' . $i] = 1;
512
+ }
513
+ }
514
+
515
+ $user['token'] = md5(rand());
516
+ $user['ip'] = $_SERVER['REMOTE_ADDR'];
517
+ $user['status'] = $options['noconfirmation'] == 1 ? 'C' : 'S';
518
+
519
+ $wpdb->insert($wpdb->prefix . 'newsletter', $user);
520
+ $user = $this->get_user($wpdb->insert_id); // back to an object
521
+ // Notification to admin (only for new subscriptions)
522
+ if ($this->options_main['notify'] == 1 && $user->status == 'C') {
523
+ $this->log('Notification');
524
+ $message = "Subscriber details:\n\n" .
525
+ "name: " . $user->name . "\n" .
526
+ "surname: " . $user->surname . "\n" .
527
+ "sex: " . $user->sex . "\n" .
528
+ "email: " . $user->email . "\n" .
529
+ "id: " . $user->id . "\n" .
530
+ "token: " . $user->token . "\n" .
531
+ "status: " . $user->status . "\n" .
532
+ "\nYours, Newsletter Pro.";
533
+
534
+ $r = wp_mail(get_option('admin_email'), '[' . get_option('blogname') . '] Newsletter subscription', $message, "Content-type: text/plain; charset=UTF-8\n");
535
+ if ($r == false) {
536
+ $this->log('Notification error');
537
+ }
538
+ }
539
+ }
540
 
541
+ $this->log($user);
 
 
 
 
 
542
 
543
+ $prefix = ($user->status == 'C') ? 'confirmed_' : 'confirmation_';
544
+ $message = $options[$prefix . 'message'];
545
+ $subject = $options[$prefix . 'subject'];
 
 
546
 
547
+ //setcookie('newsletter', $user->id . '-' . $user->token, time() + 60 * 60 * 24 * 365, '/');
 
 
 
 
 
 
 
548
 
549
+ $this->mail($user->email, $this->replace($subject, $user), $this->replace($message, $user));
 
 
550
 
551
+ if ($user->status == 'C') {
552
+ if (!empty($options['confirmed_url'])) {
553
+ header('Location: ' . $options['confirmed_url']);
554
+ die();
555
+ }
556
+ $this->message = $this->replace($options['confirmed_text'], $user);
557
+ }
558
+ else $this->message = $this->replace($options['subscribed_text'], $user);
559
 
560
+ return;
561
+ }
562
 
563
+ if ($action == 'api-add') {
564
+ $key = stripslashes($_REQUEST['nk']);
565
+ if (empty($newsletter->options_main['api_key']) || $key != $newsletter->options_main['api_key']) die('Wrong API key');
566
+
567
+ if (!is_email($_REQUEST['ne'])) die('Wrong email');
568
+ $subscriber = array();
569
+ $subscriber['name'] = stripslashes($_REQUEST['nn']);
570
+ $subscriber['surname'] = stripslashes($_REQUEST['ns']);
571
+ $subscriber['email'] = stripslashes($_REQUEST['ne']);
572
+
573
+ // Only one list
574
+ if (!empty($_REQUEST['nl'])) $subscriber['list_' . $_REQUEST['nl']] = 1;
575
+ $subscriber['status'] = 'C';
576
+ $subscriber['token'] = md5(rand());
577
+ $wpdb->insert($wpdb->prefix . 'newsletter', $user);
578
+ die('ok');
579
+ }
580
 
581
+ if ($action == 'api-delete') {
582
+ $key = stripslashes($_REQUEST['nk']);
583
+ if (empty($newsletter->options_main['api_key']) || $key != $newsletter->options_main['api_key']) die('Wrong API key');
584
 
585
+ $email = $this->normalize_email(stripslashes($_REQUEST['ne']));
586
+ $r = $wpdb->query($wpdb->prepare("delete from " . $wpdb->prefix . "newsletter where email=%s", $email));
587
+ die($r = 0 ? 'ko' : 'ok');
 
 
588
  }
589
+
590
+ // Actions below need a user. This code loads the user checking parameter or cookies.
591
+ $user = $this->check_user();
592
+ if ($user == null) die('No user');
593
+
594
+ if ($action == 'c') {
595
+ setcookie('newsletter', $user->id . '-' . $user->token, time() + 60 * 60 * 24 * 365, '/');
596
+ $wpdb->query("update " . $wpdb->prefix . "newsletter set status='C' where id=" . $user->id);
597
+
598
+ $this->mail($user->email, $this->replace($options['confirmed_subject'], $user), $this->replace($options['confirmed_message'], $user));
599
+
600
+ if ($this->options_main['notify'] == 1) {
601
+ $this->log('Notification');
602
+ $message = "Subscriber details:\n\n" .
603
+ "name: " . $user->name . "\n" .
604
+ "surname: " . $user->surname . "\n" .
605
+ "sex: " . $user->sex . "\n" .
606
+ "email: " . $user->email . "\n" .
607
+ "id: " . $user->id . "\n" .
608
+ "token: " . $user->token . "\n" .
609
+ "status: " . $user->status . "\n" .
610
+ "\nYours, Newsletter.";
611
+
612
+ $r = wp_mail(get_option('admin_email'), '[' . get_option('blogname') . '] Newsletter subscription', $message, "Content-type: text/plain; charset=UTF-8\n");
613
+ if ($r == false) {
614
+ $this->log('Notification error');
615
+ }
616
+ }
617
+ if (!empty($options['confirmed_url'])) {
618
+ header('Location: ' . $options['confirmed_url']);
619
+ die();
620
  }
621
+ $this->message = $this->replace($options['confirmed_text'], $user);
622
+ return;
623
  }
624
+
625
+ // Unsubscription request
626
+ if ($action == 'u') {
627
+ $this->message = $this->replace($options['unsubscription_text'], $user);
628
+ return;
629
  }
630
 
631
+ // Unsubscription confirm
632
+ if ($action == 'uc') {
633
+ setcookie("newsletter", "", time() - 3600);
634
+ $wpdb->query($wpdb->prepare("delete from " . $wpdb->prefix . "newsletter where id=%d" . " and token=%s", $user->id, $user->token));
635
+ $this->message = $this->replace($options['unsubscribed_text'], $user);
636
+ $this->mail($user->email, $this->replace($options['unsubscribed_subject'], $user), $this->replace($options['unsubscribed_message'], $user));
637
+
638
+ if ($newsletter->options_main['notify'] == 1) {
639
+ $message = "Subscriber details:\n\n" .
640
+ "name: " . $user->name . "\n" .
641
+ "surname: " . $user->surname . "\n" .
642
+ "sex: " . $user->sex . "\n" .
643
+ "email: " . $user->email . "\n" .
644
+ "id: " . $user->id . "\n" .
645
+ "token: " . $user->token . "\n" .
646
+ "status: " . $user->status . "\n" .
647
+ "\nYours, Newsletter.";
648
+
649
+ wp_mail(get_option('admin_email'), '[' . get_option('blogname') . '] Newsletter cancellation', $message, "Content-type: text/plain; charset=UTF-8\n");
650
+ }
651
 
652
+ return;
 
 
 
 
653
  }
654
 
655
+ // Profile saving
656
+ if ($action == 'ps') {
657
+ $options_profile = get_option('newsletter_profile', array());
658
+ // Javascript checked
659
+ if (!$this->is_email($_REQUEST['ne'])) die('Wrong email address.');
660
+
661
+ // General data
662
+ $data['email'] = $this->normalize_email(stripslashes($_REQUEST['ne']));
663
+ $data['name'] = $this->normalize_name(stripslashes($_REQUEST['nn']));
664
+ $data['surname'] = $this->normalize_name(stripslashes($_REQUEST['ns']));
665
+ if ($options_profile['sex_status'] >= 1) {
666
+ $data['sex'] = $_REQUEST['nx'][0];
667
+ // Wrong data injection check
668
+ if ($data['sex'] != 'm' && $data['sex'] != 'f') die('Wrong sex field');
669
+ }
670
+
671
+ // Lists
672
+ if (is_array($_REQUEST['nl'])) {
673
+ for ($i = 1; $i <= 9; $i++) {
674
+ if ($options_profile['list_' . $i . '_status'] == 0) continue;
675
+ $data['list_' . $i] = in_array($i, $_REQUEST['nl']) ? 1 : 0;
676
+ }
677
+ }
678
 
679
+ // Profile
680
+ for ($i = 1; $i <= 19; $i++) {
681
+ if ($options_profile['profile_' . $i . '_status'] == 0) continue;
682
+ $data['profile_' . $i] = stripslashes($_REQUEST['np' . $i]);
683
+ }
684
 
685
+ $wpdb->update($wpdb->prefix . 'newsletter', $data, array('id' => $user->id));
686
+ $url = empty($this->options_main['url']) ? get_option('home') : $this->options_main['url'];
687
+ header('Location: ' . $url . '/?na=pe&ni=' . $user->id . '&nt=' . $user->token);
688
+ die();
 
689
  }
 
 
690
 
691
+ // Profile editing.
692
+ if ($action == 'pe') {
693
+ $options_profile = get_option('newsletter_profile');
694
+ if (empty($options_profile['profile_text'])) $options_profile['profile_text'] = '{profile_form}';
695
+ $this->message = $this->replace($options_profile['profile_text'], $user);
696
+ return;
697
+ }
698
 
699
+ if ($action == 'm') {
700
+ if ($user->status == 'C') setcookie('newsletter', $user->id . '-' . $user->token, time() + 60 * 60 * 24 * 365, '/');
701
+ header('Location: ' . $this->options_main['lock_url']);
702
+ die();
703
+ }
 
704
  }
705
 
706
+ function set_limits() {
707
+ global $wpdb;
 
 
 
 
708
 
709
+ $wpdb->query("set session wait_timeout=300");
710
+ // From default-constants.php
711
+ if (function_exists('memory_get_usage') && ( (int) @ini_get('memory_limit') < 128 )) @ini_set('memory_limit', '128M');
 
 
712
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
713
 
714
+ function hook_admin_init() {
715
+ global $wpdb;
716
+ if ($_REQUEST['act'] == 'export' && check_admin_referer()) {
717
+ include 'plugin-export.inc.php';
718
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
719
  }
 
720
 
721
+ /**
722
+ * Return a user if there are request parameters or cookie with identification data otherwise null.
723
+ */
724
+ function check_user() {
725
+ global $wpdb;
 
 
 
 
 
 
 
726
 
727
+ $id = (int) $_REQUEST['ni'];
728
+ $token = $_REQUEST['nt'];
729
+ if (empty($id) || empty($token)) list ($id, $token) = @explode('-', $_COOKIE['newsletter'], 2);
730
 
731
+ return $wpdb->get_row($wpdb->prepare("select * from " . $wpdb->prefix . "newsletter where id=%d and token=%s", $id, $token));
 
 
 
 
732
  }
733
 
734
+ function get_user($id) {
735
+ global $wpdb;
736
+ return $wpdb->get_row($wpdb->prepare("select * from " . $wpdb->prefix . "newsletter where id=%d", $id));
737
  }
738
 
739
+ /**
740
+ * Replace any kind of newsletter placeholder in a text.
741
+ */
742
+ function replace($text, $user=null) {
743
+ global $wpdb;
744
 
745
+ if (is_array($user)) $user = $this->get_user($user['id']);
746
+ $text = str_replace('{home_url}', get_option('home'), $text);
747
+ $text = str_replace('{blog_title}', get_option('blogname'), $text);
748
+ if ($user != null) {
749
+ $text = str_replace('{email}', $user->email, $text);
750
+ $text = str_replace('{name}', $user->name, $text);
751
+ $text = str_replace('{surname}', $user->surname, $text);
752
+ $text = str_replace('{token}', $user->token, $text);
753
+ $text = str_replace('%7Btoken%7D', $user->token, $text);
754
+ $text = str_replace('{id}', $user->id, $text);
755
+ $text = str_replace('%7Bid%7D', $user->id, $text);
756
+ $text = str_replace('{ip}', $user->ip, $text);
757
 
758
+ if (strpos($text, '{profile_form}') !== false) $text = str_replace('{profile_form}', $this->profile_form($user), $text);
 
 
759
 
760
+ for ($i = 1; $i < 20; $i++) {
761
+ $p = 'profile_' . $i;
762
+ $text = str_replace('{profile_' . $i . '}', $user->$p, $text);
763
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
764
 
765
+ $profile = $wpdb->get_results("select name,value from " . $wpdb->prefix . "newsletter_profiles where newsletter_id=" . $user->id);
766
+ foreach ($profile as $field) {
767
+ $text = str_ireplace('{np_' . $field->name . '}', htmlspecialchars($field->value), $text);
768
+ }
769
 
770
+ $text = preg_replace('/\\{np_.+\}/i', '', $text);
 
 
 
 
 
 
 
771
 
772
+ $base = $this->options_main['url'];
773
+ if ($base == '') $base = get_option('home');
774
+ $id_token = '&amp;ni=' . $user->id . '&amp;nt=' . $user->token;
 
 
 
 
 
775
 
776
+ $text = $this->replace_url($text, 'SUBSCRIPTION_CONFIRM_URL', $this->add_qs($base, 'na=c' . $id_token));
777
+ $text = $this->replace_url($text, 'UNSUBSCRIPTION_URL', $this->add_qs($base, 'na=u' . $id_token));
778
+ $text = $this->replace_url($text, 'UNSUBSCRIPTION_CONFIRM_URL', $this->add_qs($base, 'na=uc' . $id_token));
779
+ $text = $this->replace_url($text, 'PROFILE_URL', $this->add_qs($base, 'na=pe' . $id_token));
780
+ $text = $this->replace_url($text, 'UNLOCK_URL', $this->add_qs($base, 'na=m' . $id_token));
781
 
782
+ for ($i = 1; $i <= 9; $i++) {
783
+ $text = $this->replace_url($text, 'LIST_' . $i . '_SUBSCRIPTION_URL', $this->add_qs($base, 'na=ls&amp;nl=' . $i . $id_token));
784
+ $text = $this->replace_url($text, 'LIST_' . $i . '_UNSUBSCRIPTION_URL', $this->add_qs($base, 'na=lu&amp;nl=' . $i . $id_token));
785
+ }
786
+ }
787
+ return $text;
788
  }
789
 
790
+ function replace_url($text, $tag, $url) {
791
+ $home = get_option('home') . '/';
792
+ $tag_lower = strtolower($tag);
793
+ $text = str_replace($home . '{' . $tag_lower . '}', $url, $text);
794
+ $text = str_replace($home . '%7B' . $tag_lower . '%7D', $url, $text);
795
+ $text = str_replace('{' . $tag_lower . '}', $url, $text);
796
 
797
+ // for compatibility
798
+ $text = str_replace($home . $tag, $url, $text);
799
 
800
+ return $text;
 
 
801
  }
 
 
 
 
 
 
 
802
 
803
+ function add_qs($url, $qs, $amp=true) {
804
+ if (strpos($url, '?') !== false) {
805
+ if ($amp) return $url . '&amp;' . $qs;
806
+ else return $url . '&' . $qs;
807
+ }
808
+ else return $url . '?' . $qs;
 
809
  }
810
 
811
+ function post_is_old() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
812
  }
813
 
814
+ function hook_shutdown() {
815
+ if ($this->mailer != null) $this->mailer->SmtpClose();
 
816
  }
817
 
818
+ function shortcode_newsletter_lock($attrs, $content=null) {
819
+ global $hyper_cache_stop;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
820
 
821
+ $user = $this->check_user();
822
+ if ($user != null && $user->status == 'C') {
823
+ $hyper_cache_stop = true;
824
+ return do_shortcode($content);
825
  }
826
 
827
+ $buffer = $this->options_main['lock_message'];
828
+ ob_start();
829
+ eval('?>' . $buffer . "\n");
830
+ $buffer = ob_get_clean();
831
+ $buffer = str_ireplace('<form', '<form method="post" action="' . $this->options_main['url'] . '"', $buffer);
832
+ $buffer = str_ireplace('</form>', '<input type="hidden" name="na" value="s"/></form>', $buffer);
833
+ return do_shortcode($buffer);
 
 
 
 
 
834
  }
835
 
836
+ function normalize_email($email) {
837
+ $email = strtolower(trim($email));
838
+ if (!is_email($email)) return null;
839
+ return $email;
 
 
840
  }
 
841
 
842
+ function normalize_name($name) {
843
+ $name = str_replace(';', ' ', $name);
844
+ $name = strip_tags($name);
845
+ return $name;
846
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
847
 
848
+ function is_email($email, $empty_ok=false) {
849
+ $email = strtolower(trim($email));
850
+ if ($empty_ok && $email == '') return true;
851
 
852
+ if (!is_email($email)) return false;
853
  if (strpos($email, 'mailinator.com') !== false) return false;
854
  if (strpos($email, 'guerrillamailblock.com') !== false) return false;
855
+ if (strpos($email, 'emailtemporanea.net') !== false) return false;
856
  return true;
857
  }
 
 
 
858
 
859
+ function m2t($s) {
860
+ $s = explode(' ', $s);
861
+ $d = explode('-', $s[0]);
862
+ $t = explode(':', $s[1]);
863
+ return gmmktime((int) $t[0], (int) $t[1], (int) $t[2], (int) $d[1], (int) $d[2], (int) $d[0]);
864
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
865
 
866
+ function query($query) {
867
+ global $wpdb;
 
 
 
868
 
869
+ $this->log($query, 3);
870
+ return $wpdb->query($query);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
871
  }
 
 
 
872
 
 
 
 
 
 
 
 
 
 
 
 
 
873
  }
874
 
875
+ require_once(dirname(__FILE__) . '/widget.php');
 
 
 
876
 
 
877
 
878
+ /**
 
 
 
 
 
 
 
879
  * Find an image for a post checking the media uploaded for the post and
880
  * choosing the first image found.
881
  */
882
  function nt_post_image($post_id, $size='thumbnail', $alternative=null) {
883
 
884
+ $attachments = get_children(array('post_parent' => $post_id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID'));
885
 
886
  if (empty($attachments)) {
887
  return $alternative;
888
  }
889
 
890
+ foreach ($attachments as $id => $attachment) {
891
  $image = wp_get_attachment_image_src($id, $size);
892
  return $image[0];
893
  }
895
  }
896
 
897
  function nt_option($name, $def = null) {
 
 
 
 
898
  $options = get_option('newsletter_email');
899
  $option = $options['theme_' . $name];
900
  if (!isset($option)) return $def;
901
  else return $option;
902
  }
903
 
904
+ // For compatibility
905
+ function newsletter_form($number=null) {
906
+ global $newsletter;
907
+ echo $newsletter->form($number);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
908
  }
909
 
910
+ // For compatibility
911
+ function newsletter_embed_form($number=null) {
912
+ global $newsletter;
913
+ echo $newsletter->form($number);
 
 
 
 
 
 
914
  }
 
 
profile.php ADDED
@@ -0,0 +1,196 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ @include_once 'commons.php';
3
+
4
+ $nc = new NewsletterControls();
5
+
6
+ if (!$nc->is_action()) {
7
+ $nc->data = get_option('newsletter_profile');
8
+ }
9
+ else {
10
+ if ($nc->is_action('save')) {
11
+ update_option('newsletter_profile', $nc->data);
12
+ }
13
+ if ($nc->is_action('reset')) {
14
+ include dirname(__FILE__) . '/languages/en_US.php';
15
+ @include dirname(__FILE__) . '/languages/' . WPLANG . '.php';
16
+ update_option('newsletter_profile', $defaults_profile);
17
+ $nc->data = $defaults_profile;
18
+ }
19
+ }
20
+
21
+ $nc->errors($errors);
22
+ $nc->messages($messages);
23
+
24
+ $status = array(0=>'Disabled', 1=>'Only on profile page', 2=>'Even on subscription page');
25
+ ?>
26
+ <script type="text/javascript" src="<?php echo get_option('siteurl'); ?>/wp-content/plugins/newsletter/tiny_mce/tiny_mce.js"></script>
27
+ <script type="text/javascript">
28
+ tinyMCE.init({
29
+ mode : "specific_textareas",
30
+ editor_selector : "visual",
31
+ theme : "advanced",
32
+ theme_advanced_disable : "styleselect",
33
+ relative_urls : false,
34
+ remove_script_host : false,
35
+ theme_advanced_buttons3: "",
36
+ theme_advanced_toolbar_location : "top",
37
+ theme_advanced_resizing : true,
38
+ theme_advanced_statusbar_location: "bottom",
39
+ document_base_url : "<?php echo get_option('home'); ?>/",
40
+ content_css : "<?php echo get_option('blogurl'); ?>/wp-content/plugins/newsletter/editor.css?" + new Date().getTime()
41
+ });
42
+ </script>
43
+
44
+ <div class="wrap">
45
+
46
+ <h2>Newsletter Profile</h2>
47
+ <p>
48
+ User profile is the whole set of user data that he can edit accessing the profile page (usually via the {profile_url} link you
49
+ should add in any newsletter or welcome message.<br />
50
+ Some of this data (at least the email) is collected on subscription and you can decide here what to ask the user on sign up for your
51
+ newsletter.<br />
52
+ It's a good practice to let the subscriber to sign up with a small set of data (eg. only his email or email and name) and then let him to
53
+ add more information on a profile page.<br />
54
+ The form seems complex, but it's not! On first approach, skip profiles and lists.
55
+ </p>
56
+
57
+ <form action="" method="post">
58
+ <?php $nc->init(); ?>
59
+
60
+ <h3>Profile page</h3>
61
+ <table class="form-table">
62
+ <tr valign="top">
63
+ <th>Profile page text</th>
64
+ <td>
65
+ <?php $nc->editor('profile_text'); ?>
66
+ <div class="hints">
67
+ This is the page content where the profile form is placed. Use the tag {profile_form} (required, don't forget it!) to let Newsletter
68
+ Pro know how to insert the profile editing form. You can add text before and after the tag to give some kind of explanation to
69
+ the subscriber.<br />
70
+ You can use the tag {unsubscription_url} to create a link to let the user to cancel his subscription. Using the tag
71
+ {unsubscription_confirm_url} the link leads to a direct cancellation without the confirm step.
72
+ </div>
73
+ </td>
74
+ </tr>
75
+ </table>
76
+ <p class="submit"><?php $nc->button('save', 'Save'); ?></p>
77
+
78
+
79
+ <h3>Main profile fields</h3>
80
+ <table class="form-table">
81
+ <tr>
82
+ <th>User's data/fields</th>
83
+ <td>
84
+ <table class="widefat">
85
+ <thead>
86
+ <tr>
87
+ <th>Field</th><th>When/Where</th><th>Configuration</th>
88
+ </tr>
89
+ </thead>
90
+ <tr>
91
+ <td>Email</td><td>&nbsp;</td>
92
+ <td>
93
+ label: <?php $nc->text('email'); ?><br/>
94
+ wrong email message: <?php $nc->text('email_error', 50); ?>
95
+ </td>
96
+ </tr>
97
+ <tr><td>First Name</td><td><?php $nc->select('name_status', $status); ?></td><td>label: <?php $nc->text('name'); ?></td></tr>
98
+ <tr><td>Last Name</td><td><?php $nc->select('surname_status', $status); ?></td><td>label: <?php $nc->text('surname'); ?></td></tr>
99
+ <tr>
100
+ <td>Sex</td><td><?php $nc->select('sex_status', $status); ?></td>
101
+ <td>
102
+ label: <?php $nc->text('sex'); ?>
103
+ "female": <?php $nc->text('sex_female'); ?>
104
+ "male": <?php $nc->text('sex_male'); ?>
105
+ </td>
106
+ </tr>
107
+ <tr><td>Privacy checkbox</td><td><?php $nc->yesno('privacy_status'); ?></td>
108
+ <td>
109
+ text: <?php $nc->text('privacy', 50); ?><br />
110
+ unchecked message: <?php $nc->text('privacy_error', 50); ?>
111
+ </td>
112
+ </tr>
113
+ </table>
114
+ <div class="hints">
115
+ If sex field is disabled subscribers will be stored with unspecified sex. Privacy is applied only on subscription and is
116
+ a checkbox the use must check to proceed with subscription.
117
+ </div>
118
+ </td>
119
+ </tr>
120
+ <tr>
121
+ <th>Buttons</th>
122
+ <td>
123
+ "subscribe": <?php $nc->text('subscribe'); ?> "profile save": <?php $nc->text('save'); ?>
124
+ </td>
125
+ </tr>
126
+ </table>
127
+ <p class="submit"><?php $nc->button('save', 'Save'); ?></p>
128
+
129
+
130
+ <h3>Extra profile fields</h3>
131
+
132
+ <table class="form-table">
133
+ <tr>
134
+ <th>Generic profile fields</th>
135
+ <td>
136
+ <div class="hints">Fields of type "list" must be configured with a set of options, comma separated
137
+ like: "first option, second option, third option".
138
+ </div>
139
+ <table class="widefat">
140
+ <thead>
141
+ <tr>
142
+ <th>Field</th><th>Label</th><th>When/Where</th><th>Type</th><th>Configuration</th>
143
+ </tr>
144
+ </thead>
145
+ <?php for ($i=1; $i<=19; $i++) { ?>
146
+ <tr>
147
+ <td>Profile <?php echo $i; ?></td>
148
+ <td><?php $nc->text('profile_' . $i); ?></td>
149
+ <td><?php $nc->select('profile_' . $i . '_status', $status); ?></td>
150
+ <td><?php $nc->select('profile_' . $i . '_type', array('text'=>'Text', 'select'=>'List')); ?></td>
151
+ <td>
152
+ <?php $nc->textarea_fixed('profile_' . $i . '_options', '300px', '50px'); ?>
153
+ </td>
154
+ </tr>
155
+ <?php } ?>
156
+ </table>
157
+ <div class="hints">
158
+ Those fields are collected as texts, Newsletter Pro does not give meaning to them, it just stores them.
159
+ </div>
160
+ </td>
161
+ </tr>
162
+ </table>
163
+ <p class="submit"><?php $nc->button('save', 'Save'); ?></p>
164
+
165
+
166
+ <h3>List/Options/Topics</h3>
167
+ <p>
168
+ Remember that lists are not separate lists of users, they are options chose by subscriber and usually they refer
169
+ to topics of your emails.
170
+ </p>
171
+ <table class="form-table">
172
+ <tr>
173
+ <th>Lists/Options</th>
174
+ <td>
175
+ <table class="widefat">
176
+ <thead>
177
+ <tr>
178
+ <th>Field</th><th>When/Where</th><th>Configuration</th>
179
+ </tr>
180
+ </thead>
181
+ <?php for ($i=1; $i<=9; $i++) { ?>
182
+ <tr><td>List <?php echo $i; ?></td><td><?php $nc->select('list_' . $i . '_status', $status); ?></td><td>label: <?php $nc->text('list_' . $i); ?></td></tr>
183
+ <?php } ?>
184
+ </table>
185
+ <div class="hints">
186
+ Disabled lists are not selectable by users but they can be assigned from admin panels, so they can be
187
+ considered as private lists.
188
+ </div>
189
+ </td>
190
+ </tr>
191
+ </table>
192
+ <p class="submit"><?php $nc->button('save', 'Save'); ?></p>
193
+
194
+
195
+ </form>
196
+ </div>
readme.txt CHANGED
@@ -2,29 +2,38 @@
2
  === Newsletter ===
3
  Tags: newsletter,email,subscription,mass mail
4
  Requires at least: 2.7
5
- Tested up to: 2.9.2
6
  Stable tag: trunk
7
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2545483
8
  Contributors: satollo
9
 
10
- Newsletter is a plug-in to collect subscribers and send out newsletters.
11
 
12
  == Description ==
13
 
14
  This plug-in lets you collect subscribers on your blog with a single or double opt-in
15
- subscription process. Double opt-in means the user has to confirm a subscription
16
  following simple standard instructions sent to him via email.
17
 
18
- Each step of subscribe and unsubscribe process is fully configurable.
19
 
20
- The plug-in has a simple visual composer to create your newsletter
21
- and send it to subscribers. The newsletter message can be auto composed starting
22
- with blog content and themes.
23
 
24
- Emails are sent one-per-user, so subject and body can be customized
25
- with subscriber name.
26
 
27
- More on Newsletter plug-in official page (http://www.satollo.net/plugins/newsletter).
 
 
 
 
 
 
 
 
 
 
28
 
29
  == Installation ==
30
 
2
  === Newsletter ===
3
  Tags: newsletter,email,subscription,mass mail
4
  Requires at least: 2.7
5
+ Tested up to: 3.1.2
6
  Stable tag: trunk
7
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2545483
8
  Contributors: satollo
9
 
10
+ Add a real newsletter service to your blog. In seconds. For free.
11
 
12
  == Description ==
13
 
14
  This plug-in lets you collect subscribers on your blog with a single or double opt-in
15
+ subscription process. Double opt-in is law compliant and it means the user has to confirm the subscription
16
  following simple standard instructions sent to him via email.
17
 
18
+ Each step of subscribe and cancel process is fully configurable and translatable.
19
 
20
+ Subscription form and profile form are easily configurable from administrative panels and you
21
+ can translate every single label in your language.
 
22
 
23
+ Create e-mails with a visual editor with the auto compose function which extract content
24
+ for your blog. Auto composer themes can be customized.
25
 
26
+ Use the widget to let users to subscribe from anywhere in your blog or use a short code
27
+ to embed the subscription form on posts and pages.
28
+
29
+ Use the locked content feature to fire up the subscription rate.
30
+
31
+ Any option has a "hints" box with instruction to set it and the full user guide is
32
+ inside the administrative panels.
33
+
34
+ Version 2.5 is a major update and need to be reconfigured! Pay attention.
35
+
36
+ More about Newsletter plug-in official page (http://www.satollo.net/plugins/newsletter).
37
 
38
  == Installation ==
39
 
smtp.php DELETED
@@ -1,15 +0,0 @@
1
- <?php
2
- @include_once 'commons.php';
3
- ?>
4
-
5
- <div class="wrap">
6
-
7
- <h2><?php _e('Newsletter SMTP', 'newsletter'); ?></h2>
8
-
9
- <?php if (newsletter_has_extras('1.0.4')) { ?>
10
- <?php require_once ABSPATH . 'wp-content/plugins/newsletter-extras/smtp.php'; ?>
11
- <?php } else { ?>
12
- <strong>You need <a href="http://www.satollo.net/plugins/newsletter-extras">Newsletter Extras 1.0.4+</a> installed to configure SMTP</strong>
13
- <?php } ?>
14
-
15
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
statistics.php DELETED
@@ -1,15 +0,0 @@
1
- <?php
2
- @include_once 'commons.php';
3
- ?>
4
-
5
- <div class="wrap">
6
-
7
- <h2><?php _e('Newsletter Statistics', 'newsletter'); ?></h2>
8
-
9
- <?php if (!defined('NEWSLETTER_EXTRAS')) { ?>
10
- <strong>You need the <a href="http://www.satollo.net/plugins/newsletter-extras">Newsletter Extras</a> installed to view statistics</strong>
11
- <?php } else { ?>
12
- <?php require_once ABSPATH . 'wp-content/plugins/newsletter-extras/statistics.php'; ?>
13
- <?php } ?>
14
-
15
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
style.css CHANGED
@@ -1,48 +1,128 @@
1
-
2
- h3 {
3
- margin-bottom: 0px;
4
- margin-top: 30px;
5
- font-family: Georgia;
6
- font-size: 15px;
7
- }
8
- h4 {
9
- font-size: 1.3em;
10
- border-bottom: 1px solid #999;
11
- }
12
- .form-table {
13
- border: 1px solid #ccc;
14
- background-color: #fff;
15
- }
16
-
17
- .form-table th {
18
- text-align: right;
19
- font-weight: bold;
20
- border-right: 1px solid #ccc;
21
- }
22
- .form-table th small {
23
- font-weight: normal;
24
- }
25
-
26
- p.submit {
27
- margin-top: 5px;
28
- padding: 5px;
29
- }
30
-
31
- .bordered-table {
32
- border-collapse: collapse;
33
- }
34
-
35
- .bordered-table td, .bordered-table th {
36
- border: 1px solid #ccc;
37
- padding: 3px;
38
- }
39
-
40
- table.clicks td {
41
- border: 1px solid #666;
42
- padding: 2px;
43
- font-size: 10px;
44
- }
45
-
46
- table.clicks {
47
- border-collapse: collapse;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  }
1
+ .wrap h3
2
+ {
3
+ margin-bottom: 0px;
4
+ margin-top: 40px;
5
+ font-family: Georgia;
6
+ font-size: 20px;
7
+ font-style: italic;
8
+ font-weight: normal;
9
+ cursor: pointer;
10
+ cursor: hand;
11
+ }
12
+ h4 {
13
+ font-size: 1.1em;
14
+ font-weight: bold;
15
+ font-family: Georgia;
16
+ font-style: italic;
17
+ /* border-bottom: 1px solid #999;*/
18
+ }
19
+ .form-table {
20
+ xborder: 1px solid #ccc;
21
+ background-color: #fff;
22
+ border: 3px solid #ddd;
23
+ }
24
+
25
+ .form-table th {
26
+ text-align: right;
27
+ font-weight: bold;
28
+ border-right: 1px solid #ddd;
29
+ }
30
+ .form-table th small {
31
+ font-weight: normal;
32
+ }
33
+
34
+ .widefat th {
35
+ text-align: left;
36
+ }
37
+
38
+
39
+ p.submit {
40
+ margin-top: 5px;
41
+ padding: 5px;
42
+ }
43
+
44
+ .bordered-table {
45
+ border-collapse: collapse;
46
+ }
47
+
48
+ .bordered-table td, .bordered-table th {
49
+ border: 1px solid #ccc;
50
+ padding: 3px;
51
+ }
52
+
53
+ .newsletter-button {
54
+ font-size: 10px;
55
+ }
56
+ table.clicks td {
57
+ border: 1px solid #666;
58
+ padding: 2px;
59
+ font-size: 10px;
60
+ }
61
+
62
+ table.clicks {
63
+ border-collapse: collapse;
64
+ }
65
+
66
+ .grid {
67
+ border-collapse: collapse;
68
+ }
69
+ .grid td, .grid th {
70
+ padding: 10px;
71
+ border: 1px solid #ddd;
72
+ margin: 0;
73
+ }
74
+ .grid th {
75
+ background-color: #aaa;
76
+ }
77
+
78
+ .form-table textarea {
79
+ width: 100%;
80
+ }
81
+
82
+ .hints {
83
+ border: 1px solid #aaf;
84
+ background-color: #fafaff;
85
+ padding: 5px;
86
+ margin-top: 10px;
87
+ border-radius: 4px 4px;
88
+ -moz-border-radius: 4px;
89
+ -webkit-border-radius: 4px;
90
+ }
91
+
92
+ .intro {
93
+ font-size: 11px;
94
+ margin: 6px 6px 8px;
95
+ }
96
+
97
+ .inside p, .inside li {
98
+ font-size: 12px;
99
+ margin: 10px;
100
+ }
101
+
102
+ .inside ul {
103
+ list-style-type: circle;
104
+ list-style-position: inside;
105
+ }
106
+
107
+ .nl-box {
108
+ border-bottom-left-radius: 4px 4px;
109
+ border-bottom-right-radius: 4px 4px;
110
+ border-top-left-radius: 4px 4px;
111
+ border-top-right-radius: 4px 4px;
112
+ border: 1px solid #aaf;
113
+ background-color: #fff;
114
+ }
115
+
116
+ .user-guide {
117
+ background-color: #fff;
118
+ border: 1px solid #000;
119
+ padding: 20px;
120
+ font-family: verdana;
121
+ line-height: 20px;
122
+ font-size: 12px;
123
+ }
124
+
125
+ .user-guide ul {
126
+ list-style-type: disc;
127
+ margin-left: 20px;
128
  }
themes-page/page-1/theme.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // This theme is used to show subscription messages to users along the various
3
+ // subscription and unsubscription steps.
4
+ // This theme is used to show feed by mail and follow up unsubscription messages too.
5
+ //
6
+ // The theme is used ONLY IF, on main configutation, you have NOT set a specific
7
+ // WordPress page to be used to show messages.
8
+ //
9
+ // The theme MUST contain the {message} place holder.
10
+
11
+ ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html40/strict.dtd">
12
+ <html>
13
+ <head>
14
+ <style type="text/css">
15
+ body {
16
+ font-family: sans-serif;
17
+ }
18
+ </style>
19
+ </head>
20
+
21
+ <body style="background-color: #ddd">
22
+ <div style="margin: 40px auto 0 auto; width: 600px; border: 3px solid #666; background-color: #fff; padding: 20px">
23
+ <h2><?php echo get_option('blogname'); ?></h2>
24
+ {message}
25
+ </div>
26
+ </body>
27
+ </html>
themes/blank/theme.php DELETED
@@ -1 +0,0 @@
1
- Blank theme, use your fantasy!
 
themes/default/it_IT.php DELETED
@@ -1,5 +0,0 @@
1
- <?php
2
- $texts['footer'] = '<p>Per non ricevere più questa newsletter <a href="{unsubscription_url}">clicca qui</a>.</p>';
3
- $texts['header'] = '<p>Ciao {name},</p>
4
- <p>ecco le ultime dal sito:</p>';
5
- ?>
 
 
 
 
 
themes/default/style.css DELETED
@@ -1,5 +0,0 @@
1
- body, td {
2
- font-family: verdana;
3
- font-size: 12px;
4
- }
5
-
 
 
 
 
 
themes/default/theme.php DELETED
@@ -1,30 +0,0 @@
1
- <?php
2
- global $post;
3
-
4
- $texts['footer'] = '<p>To unsubscribe <a href="{unsubscription_url}">click here</a>.</p>';
5
- $texts['header'] = '<p>Hi {name},</p>
6
- <p>here the lastest news:</p>';
7
-
8
- //$posts = get_posts('numberposts=10');
9
- query_posts('showposts=' . nt_option('posts', 10) . '&post_status=publish');
10
- ?>
11
- <div style="font-family: sans-serif; font-size: 24px; color: #999"><?php echo get_option('blogname'); ?></div>
12
-
13
- <?php echo $texts['header']; ?>
14
-
15
- <?php
16
- while (have_posts())
17
- {
18
- the_post();
19
-
20
- ?>
21
- <div><a style="font-size: 16px; text-decoration: none; color: #369" href="<?php echo get_permalink(); ?>"><?php the_title(); ?></a></div>
22
- <div><?php echo the_excerpt(); ?></div>
23
- <div style="height: 30px; clear: both"></div>
24
- <?php
25
- }
26
- ?>
27
-
28
- <?php echo $texts['footer']; ?>
29
-
30
- <?php wp_reset_query(); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
themes/feed-by-mail/style.css DELETED
@@ -1,5 +0,0 @@
1
- body, td {
2
- font-family: verdana;
3
- font-size: 12px;
4
- }
5
-
 
 
 
 
 
themes/feed-by-mail/theme.php DELETED
@@ -1,24 +0,0 @@
1
- <?php
2
- $posts = new WP_Query();
3
- $posts->query(array('showposts'=>10, 'post_status'=>'publish'));
4
- ?>
5
-
6
- <h1><?php echo get_option('blogname'); ?></h1>
7
-
8
- <?php
9
- while ($posts->have_posts())
10
- {
11
- $posts->the_post();
12
- $image = nt_post_image(get_the_ID());
13
- ?>
14
- <h2><a href="<?php echo get_permalink(); ?>"><?php the_title(); ?></a></h2>
15
- <?php if ($image != null) { ?>
16
- <img src="<?php echo $image; ?>" alt="COOL PHOTO" align="left" width="100" hspace="10"/>
17
- <?php } ?>
18
- <?php the_excerpt(); ?>
19
- <br clear="both"/>
20
- <?php
21
- }
22
- ?>
23
-
24
- <p><small>To unsubscribe this newsletter, <a href="{unsubscription_url}">click here</a>.</small></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
themes/messages/theme.php DELETED
@@ -1,9 +0,0 @@
1
- <div style="background-color: #999; padding: 30px;">
2
- <div style="background-color: #fff; border: 3px solid #666; padding: 20px;">
3
-
4
- <div style="font-family: sans-serif; font-size: 24px; color: #999"><?php echo get_option('blogname'); ?></div>
5
-
6
- {message}
7
-
8
- </div>
9
- </div>
 
 
 
 
 
 
 
 
 
themes/theme-1/theme.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // If you want to translate or customize this theme, just copy the file inside the folder
3
+ // wp-content/plugins/newsletter-pro-custom/themes
4
+ // (create it if it does not exist) and the a new theme called "theme-1" will appear
5
+ // on autocompose menu. You can rename the file if you want.
6
+
7
+ $posts = new WP_Query();
8
+ $posts->query(array('showposts'=>10, 'post_status'=>'publish'));
9
+ ?>
10
+ <table bgcolor="#c0c0c0" width="100%" cellpadding="20" cellspacing="0" border="0">
11
+ <tr>
12
+ <td align="center">
13
+ <table width="500" bgcolor="#ffffff" align="center" cellspacing="10" cellpadding="0" style="border: 1px solid #666;">
14
+ <tr>
15
+ <td style="font-size: 30px">
16
+ <i><?php echo get_option('blogname'); ?></i>
17
+ </td>
18
+ </tr>
19
+ <tr>
20
+ <td style="border-top: 1px solid #eee; border-bottom: 1px solid #eee; font-size: 12px; color: #999">
21
+ <br />NEWSLETTER<br /><br />
22
+ </td>
23
+ </tr>
24
+ <tr>
25
+ <td style="font-size: 14px; color: #666">
26
+ <p>Dear {name}, here an update from <?php echo get_option('blogname'); ?>.</p>
27
+ </td>
28
+ </tr>
29
+ <?php
30
+ while ($posts->have_posts())
31
+ {
32
+ $posts->the_post();
33
+ $image = nt_post_image(get_the_ID());
34
+ ?>
35
+ <tr>
36
+ <td style="font-size: 14px; color: #666">
37
+ <p><a href="<?php echo get_permalink(); ?>" style="font-size: 16px; color: #000; text-decoration: none"><?php the_title(); ?></a></p>
38
+
39
+ <?php the_excerpt(); ?>
40
+ </td>
41
+ </tr>
42
+ <?php
43
+ }
44
+ ?>
45
+ <tr>
46
+ <td style="border-top: 1px solid #eee; border-bottom: 1px solid #eee; font-size: 12px; color: #999">
47
+ You received this email because you subscribed for it as {email}. If you'd like, you can <a href="{unsubscription_url}">unsubscribe</a>.
48
+ </td>
49
+ </tr>
50
+ </table>
51
+ </td>
52
+ </tr>
53
+ </table>
themes/theme-2/theme-2.php ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ query_posts('showposts=' . nt_option('posts', 10) . '&post_status=publish');
4
+
5
+ $text_css = 'font-family: Lucida Sans Unicode, Lucida Grande, sans-serif; font-size: 11px;';
6
+ $title_css = 'font-family: Trebuchet MS, Helvetica, sans-serif; font-size: 20px; text-transform: uppercase;';
7
+
8
+ ?>
9
+
10
+ <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
11
+ <tr>
12
+ <td align="left"><table width="600" align="center" cellpadding="0" cellspacing="0" style="border-width:1px;border-style:solid;border-color:#cccccc;" >
13
+ <tr>
14
+ <td bgcolor="#ffffff" height="10"></td>
15
+ </tr>
16
+ <tr>
17
+ <td bgcolor="#ffffff" style="padding-top:0;padding-bottom:0;padding-right:15px;padding-left:15px;"><font size="1" face="Lucida Sans Unicode, Lucida Grande, sans-serif" color="#999999">
18
+ <span style="font-size:11px;">You have received this email because you are subscribed to <?php echo get_option('blogname'); ?></span></font>
19
+ </td>
20
+ </tr>
21
+ <tr>
22
+ <td bgcolor="#ffffff" height="10"></td>
23
+ </tr>
24
+ <tr>
25
+ <td height="3" bgcolor="#75af2d"></td>
26
+ </tr>
27
+ <tr>
28
+ <td height="30" bgcolor="#ffffff"></td>
29
+ </tr>
30
+ <tr>
31
+ <td bgcolor="#ffffff"><table width="100%" border="0" cellspacing="0" cellpadding="0">
32
+ <tr>
33
+ <td width="25" valign="top"></td>
34
+ <td valign="top" width="262" height="48"><span style="font-size: 38px; color:silver"><?php echo get_option('blogname'); ?></span></td>
35
+ <td width="25" valign="top"></td>
36
+ </tr>
37
+ <tr>
38
+ <td width="25" height="20" valign="top"></td>
39
+ <td height="20" valign="top"></td>
40
+ <td width="25" height="20" valign="top"></td>
41
+ </tr>
42
+ <tr>
43
+ <td width="25" height="1" valign="top"></td>
44
+ <td height="1" valign="top" bgcolor="#e1e1e1"></td>
45
+ <td width="25" height="1" valign="top"></td>
46
+ </tr>
47
+ <tr>
48
+ <td width="25" height="20" valign="top"></td>
49
+ <td height="20" valign="top"></td>
50
+ <td width="25" height="20" valign="top"></td>
51
+ </tr>
52
+ <tr>
53
+ <td width="25" valign="top"></td>
54
+ <td valign="top">
55
+ <p><strong>Hi {name},</strong></p>
56
+ <p>Here a little bit of intgroduction text...</p>
57
+ <p>A second line...</p>
58
+ <p>Cheers, YOUR NAME</p>
59
+ </td>
60
+ <td width="25" valign="top"></td>
61
+ </tr>
62
+
63
+ <?php while (have_posts()) { the_post(); ?>
64
+
65
+ <tr>
66
+ <td width="25" height="20" valign="top"></td>
67
+ <td height="20" valign="top" style="border-bottom: 1px solid #e1e1e1"></td>
68
+ <td width="25" height="20" valign="top"></td>
69
+ </tr>
70
+ <!--
71
+ <tr>
72
+ <td width="25" height="1" valign="top"></td>
73
+ <td height="1" valign="top" bgcolor="#e1e1e1"></td>
74
+ <td width="25" height="1" valign="top"></td>
75
+ </tr>
76
+ -->
77
+ <tr>
78
+ <td width="25" height="20" valign="top"></td>
79
+ <td height="20" valign="top"></td>
80
+ <td width="25" height="20" valign="top"></td>
81
+ </tr>
82
+ <tr>
83
+ <td width="25" valign="top"></td>
84
+ <td valign="top" style="<?php echo $text_css; ?>">
85
+ <h2 style="<?php echo $title_css; ?>"><?php the_title(); ?></h2>
86
+ <?php $img = nt_post_image($post->ID, 'thumbnail'); ?>
87
+ <?php if ($img != null) { ?>
88
+ <p><img src="<?php echo $img; ?>" alt=""/></p>
89
+ <?php } ?>
90
+ <?php echo the_excerpt(); ?>
91
+ <p><a href="<?php echo get_permalink(); ?>">Read more...</a></p>
92
+ </td>
93
+ <td width="25" valign="top"></td>
94
+ </tr>
95
+ <?php } ?>
96
+
97
+ </table></td>
98
+ </tr>
99
+ <tr>
100
+ <td height="25"></td>
101
+ </tr>
102
+
103
+ <tr>
104
+ <td height="40" bgcolor="#e9eee8" style="padding-top:10px;padding-bottom:10px;padding-right:15px;padding-left:15px;">
105
+ <font size="1" face="Lucida Sans Unicode, Lucida Grande, sans-serif" color="#403f41">
106
+ <span style="font-size:10px;" >
107
+ If you do not wish to receive further
108
+ email notifications like this one, please
109
+ <a href="{unsubscription_url}" style="text-decoration:none; color:#959595">unsubscribe</a>
110
+ <br />
111
+ &copy; 2009, <?php echo get_option('blogname'); ?>
112
+ </span>
113
+ </font>
114
+ </td>
115
+ </tr>
116
+ </table></td>
117
+ </tr>
118
+ </table>
119
+
120
+
themes/theme-3/theme-3.php ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $posts = new WP_Query();
3
+ $posts->query(array('showposts'=>10, 'post_status'=>'publish'));
4
+
5
+ $texts['notice'] = 'You received this email because you are subscribed to ' . get_option('blogname');
6
+
7
+ $texts['header'] = '';
8
+
9
+ $empty_image = get_option('blogurl') . '/wp-content/plugins/newsletter/themes/with-picture/empty.gif';
10
+
11
+ @include(dirname(__FILE__) . '/' . WPLANG . '.php');
12
+ ?>
13
+
14
+ <table align="center" width="600" cellpadding="5" cellspacing="0" style="border-width:2px; border-style:solid; border-color:#aaa;" >
15
+ <!--<tr><td width="600" colspan="2"><div style="margin:10px;"><small><?php echo $texts['notice']; ?></small></div></td></tr>-->
16
+ <tr>
17
+ <td width="600" colspan="2">
18
+ <span style="font-size: 38px; color:silver"><?php echo get_option('blogname'); ?></span>
19
+ </td>
20
+ </tr>
21
+ <tr>
22
+ <td width="600" colspan="2">
23
+ <p>Hi {name},<br />
24
+ here the last news from my blog!</p>
25
+ </td>
26
+ </tr>
27
+ <tr>
28
+ <td width="150" valign="top" align="left" style="border-right: 1px solid #ccc">
29
+
30
+ <strong>Categories</strong><br />
31
+ <?php echo wp_list_categories(array('title_li'=>'', 'echo'=>0, 'style'=>'none')); ?>
32
+
33
+ <br /><br />
34
+
35
+ <strong>Tags</strong><br />
36
+ <?php echo wp_tag_cloud(array('title_li'=>'', 'echo'=>0, 'smallest'=>9, 'largest'=>'14', 'unit'=>'px')); ?>
37
+
38
+ <br /><br />
39
+
40
+
41
+ <strong>Pages</strong><br />
42
+ <?php wp_page_menu(array('link_after'=>'<br />')); ?>
43
+ </td>
44
+ <td width="450" valign="top" align="left">
45
+
46
+
47
+ <table cellspacing="10">
48
+ <?php
49
+ while ($posts->have_posts())
50
+ {
51
+ $posts->the_post();
52
+ ?>
53
+ <tr>
54
+ <!--
55
+ <td valign="top">
56
+ <a href="<?php echo get_permalink(); ?>"><img src="<?php echo nt_post_image($post->ID, 'thumbnail', $empty_image); ?>" width="100"/></a>
57
+ </td>
58
+ -->
59
+ <td valign="top" align="left">
60
+ <a href="<?php echo get_permalink(); ?>"><strong><?php the_title(); ?></strong></a><br />
61
+ <?php echo the_excerpt(); ?>
62
+ </td>
63
+ </tr>
64
+ <?php } ?>
65
+ </table>
66
+
67
+ </td>
68
+ </tr>
69
+ <tr>
70
+ <td colspan="2" height="40" bgcolor="#e9eee8">
71
+ <small>
72
+ If you want to unsubscribe <a href="{unsubscription_url}">unsubscribe click here</a>.
73
+ <br />
74
+ &copy; <?php echo get_option('blogname'); ?>
75
+ </small>
76
+ </td>
77
+ </tr>
78
+ </table>
79
+
80
+
81
+
themes/with-picture/empty.gif DELETED
Binary file
themes/with-picture/it_IT.php DELETED
@@ -1,5 +0,0 @@
1
- <?php
2
- $texts['footer'] = '<p>Per non ricevere più questa newsletter <a href="{unsubscription_url}">clicca qui</a>.</p>';
3
- $texts['header'] = '<p>Ciao {name},</p>
4
- <p>ecco le ultime dal sito:</p>';
5
- ?>
 
 
 
 
 
themes/with-picture/theme.php DELETED
@@ -1,39 +0,0 @@
1
- <?php
2
- global $post;
3
-
4
- $texts['footer'] = '<p>To unsubscribe <a href="{unsubscription_url}">click here</a>.</p>';
5
- $texts['header'] = '<p>Hi {name},</p>
6
- <p>here the lastest news:</p>';
7
-
8
- @include(dirname(__FILE__) . '/' . WPLANG . '.php');
9
-
10
- query_posts('showposts=' . nt_option('posts', 10) . '&post_status=publish');
11
- $empty_image = get_option('blogurl') . '/wp-content/plugins/newsletter/themes/with-picture/empty.gif';
12
- ?>
13
-
14
- <div style="background-color: #444444;">
15
-
16
- <table width="550" cellpadding="10" align="center" style="margin-top: 30px; background-color: #ffffff; border: 5px solid #3B3B3B; ">
17
- <tr><td>
18
- <?php echo $texts['header']; ?>
19
-
20
- <table cellspacing="10">
21
- <?php while (have_posts()) { the_post(); ?>
22
- <tr>
23
- <td valign="top">
24
- <a href="<?php echo get_permalink(); ?>"><img src="<?php echo nt_post_image($post->ID, 'thumbnail', $empty_image); ?>" width="100"/></a>
25
- </td>
26
- <td valign="top" align="left">
27
- <a href="<?php echo get_permalink(); ?>"><strong><?php the_title(); ?></strong></a><br />
28
- <?php echo the_excerpt(); ?>
29
- </td>
30
- </tr>
31
- <?php } ?>
32
- </table>
33
-
34
- <?php echo $texts['footer']; ?>
35
- </td></tr>
36
- </table>
37
- </div>
38
-
39
- <?php wp_reset_query(); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
tiny_mce/plugins/fullscreen/fullscreen.htm CHANGED
@@ -2,7 +2,6 @@
2
  <html xmlns="http://www.w3.org/1999/xhtml">
3
  <head>
4
  <title></title>
5
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
6
  <script type="text/javascript" src="../../tiny_mce.js"></script>
7
  <script type="text/javascript">
8
  function patchCallback(settings, key) {
2
  <html xmlns="http://www.w3.org/1999/xhtml">
3
  <head>
4
  <title></title>
 
5
  <script type="text/javascript" src="../../tiny_mce.js"></script>
6
  <script type="text/javascript">
7
  function patchCallback(settings, key) {
tiny_mce/plugins/table/cell.htm CHANGED
@@ -170,13 +170,8 @@
170
  </select>
171
  </div>
172
 
173
- <div style="float: left">
174
- <div><input type="submit" id="insert" name="insert" value="{#update}" /></div>
175
- </div>
176
-
177
- <div style="float: right">
178
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
179
- </div>
180
  </div>
181
  </form>
182
  </body>
170
  </select>
171
  </div>
172
 
173
+ <input type="submit" id="insert" name="insert" value="{#update}" />
174
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
 
 
 
 
 
175
  </div>
176
  </form>
177
  </body>
tiny_mce/plugins/table/editor_plugin.js CHANGED
@@ -1 +1 @@
1
- (function(){var a=tinymce.each;tinymce.create("tinymce.plugins.TablePlugin",{init:function(b,c){var d=this;d.editor=b;d.url=c;a([["table","table.desc","mceInsertTable",true],["delete_table","table.del","mceTableDelete"],["delete_col","table.delete_col_desc","mceTableDeleteCol"],["delete_row","table.delete_row_desc","mceTableDeleteRow"],["col_after","table.col_after_desc","mceTableInsertColAfter"],["col_before","table.col_before_desc","mceTableInsertColBefore"],["row_after","table.row_after_desc","mceTableInsertRowAfter"],["row_before","table.row_before_desc","mceTableInsertRowBefore"],["row_props","table.row_desc","mceTableRowProps",true],["cell_props","table.cell_desc","mceTableCellProps",true],["split_cells","table.split_cells_desc","mceTableSplitCells",true],["merge_cells","table.merge_cells_desc","mceTableMergeCells",true]],function(e){b.addButton(e[0],{title:e[1],cmd:e[2],ui:e[3]})});if(b.getParam("inline_styles")){b.onPreProcess.add(function(e,g){var f=e.dom;a(f.select("table",g.node),function(i){var h;if(h=f.getAttrib(i,"width")){f.setStyle(i,"width",h);f.setAttrib(i,"width")}if(h=f.getAttrib(i,"height")){f.setStyle(i,"height",h);f.setAttrib(i,"height")}})})}b.onInit.add(function(){if(b&&b.plugins.contextmenu){b.plugins.contextmenu.onContextMenu.add(function(h,f,j){var k,i=b.selection,g=i.getNode()||b.getBody();if(b.dom.getParent(j,"td")||b.dom.getParent(j,"th")){f.removeAll();if(g.nodeName=="A"&&!b.dom.getAttrib(g,"name")){f.add({title:"advanced.link_desc",icon:"link",cmd:b.plugins.advlink?"mceAdvLink":"mceLink",ui:true});f.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"});f.addSeparator()}if(g.nodeName=="IMG"&&g.className.indexOf("mceItem")==-1){f.add({title:"advanced.image_desc",icon:"image",cmd:b.plugins.advimage?"mceAdvImage":"mceImage",ui:true});f.addSeparator()}f.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",ui:true,value:{action:"insert"}});f.add({title:"table.props_desc",icon:"table_props",cmd:"mceInsertTable",ui:true});f.add({title:"table.del",icon:"delete_table",cmd:"mceTableDelete",ui:true});f.addSeparator();k=f.addMenu({title:"table.cell"});k.add({title:"table.cell_desc",icon:"cell_props",cmd:"mceTableCellProps",ui:true});k.add({title:"table.split_cells_desc",icon:"split_cells",cmd:"mceTableSplitCells",ui:true});k.add({title:"table.merge_cells_desc",icon:"merge_cells",cmd:"mceTableMergeCells",ui:true});k=f.addMenu({title:"table.row"});k.add({title:"table.row_desc",icon:"row_props",cmd:"mceTableRowProps",ui:true});k.add({title:"table.row_before_desc",icon:"row_before",cmd:"mceTableInsertRowBefore"});k.add({title:"table.row_after_desc",icon:"row_after",cmd:"mceTableInsertRowAfter"});k.add({title:"table.delete_row_desc",icon:"delete_row",cmd:"mceTableDeleteRow"});k.addSeparator();k.add({title:"table.cut_row_desc",icon:"cut",cmd:"mceTableCutRow"});k.add({title:"table.copy_row_desc",icon:"copy",cmd:"mceTableCopyRow"});k.add({title:"table.paste_row_before_desc",icon:"paste",cmd:"mceTablePasteRowBefore"});k.add({title:"table.paste_row_after_desc",icon:"paste",cmd:"mceTablePasteRowAfter"});k=f.addMenu({title:"table.col"});k.add({title:"table.col_before_desc",icon:"col_before",cmd:"mceTableInsertColBefore"});k.add({title:"table.col_after_desc",icon:"col_after",cmd:"mceTableInsertColAfter"});k.add({title:"table.delete_col_desc",icon:"delete_col",cmd:"mceTableDeleteCol"})}else{f.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",ui:true})}})}});b.onKeyDown.add(function(f,g){if(g.keyCode==9&&f.dom.getParent(f.selection.getNode(),"TABLE")){if(!tinymce.isGecko&&!tinymce.isOpera){tinyMCE.execInstanceCommand(f.editorId,"mceTableMoveToNextRow",true);return tinymce.dom.Event.cancel(g)}f.undoManager.add()}});if(!tinymce.isIE){if(b.getParam("table_selection",true)){b.onClick.add(function(f,g){g=g.target;if(g.nodeName==="TABLE"){f.selection.select(g)}})}}b.onNodeChange.add(function(f,e,h){var g=f.dom.getParent(h,"td,th,caption");e.setActive("table",h.nodeName==="TABLE"||!!g);if(g&&g.nodeName==="CAPTION"){g=null}e.setDisabled("delete_table",!g);e.setDisabled("delete_col",!g);e.setDisabled("delete_table",!g);e.setDisabled("delete_row",!g);e.setDisabled("col_after",!g);e.setDisabled("col_before",!g);e.setDisabled("row_after",!g);e.setDisabled("row_before",!g);e.setDisabled("row_props",!g);e.setDisabled("cell_props",!g);e.setDisabled("split_cells",!g||(parseInt(f.dom.getAttrib(g,"colspan","1"))<2&&parseInt(f.dom.getAttrib(g,"rowspan","1"))<2));e.setDisabled("merge_cells",!g)});if(!tinymce.isIE){b.onBeforeSetContent.add(function(e,f){if(f.initial){f.content=f.content.replace(/<(td|th)([^>]+|)>\s*<\/(td|th)>/g,tinymce.isOpera?"<$1$2>&nbsp;</$1>":'<$1$2><br mce_bogus="1" /></$1>')}})}},execCommand:function(f,e,g){var d=this.editor,c;switch(f){case"mceTableMoveToNextRow":case"mceInsertTable":case"mceTableRowProps":case"mceTableCellProps":case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":case"mceTableDelete":d.execCommand("mceBeginUndoLevel");this._doExecCommand(f,e,g);d.execCommand("mceEndUndoLevel");return true}return false},getInfo:function(){return{longname:"Tables",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/table",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_doExecCommand:function(r,Z,ae){var V=this.editor,au=V,g=this.url;var n=V.selection.getNode();var W=V.dom.getParent(n,"tr");var aq=V.dom.getParent(n,"td,th");var F=V.dom.getParent(n,"table");var k=V.contentWindow.document;var av=F?F.getAttribute("border"):"";if(W&&aq==null){aq=W.cells[0]}function ap(y,x){for(var ax=0;ax<y.length;ax++){if(y[ax].length>0&&ap(y[ax],x)){return true}if(y[ax]==x){return true}}return false}function aj(x,i){var y;ad=e(F);x=x||0;i=i||0;x=Math.max(o.cellindex+x,0);i=Math.max(o.rowindex+i,0);V.execCommand("mceRepaint");y=d(ad,i,x);if(y){V.selection.select(y.firstChild||y);V.selection.collapse(1)}}function ah(){var i=k.createElement("td");if(!tinymce.isIE){i.innerHTML='<br mce_bogus="1"/>'}}function j(y){var x=V.dom.getAttrib(y,"colspan");var i=V.dom.getAttrib(y,"rowspan");x=x==""?1:parseInt(x);i=i==""?1:parseInt(i);return{colspan:x,rowspan:i}}function al(ax,az){var i,ay;for(ay=0;ay<ax.length;ay++){for(i=0;i<ax[ay].length;i++){if(ax[ay][i]==az){return{cellindex:i,rowindex:ay}}}}return null}function d(x,y,i){if(x[y]&&x[y][i]){return x[y][i]}return null}function A(aC,ax){var az=[],y=0,aA,ay,ax,aB;for(aA=0;aA<aC.rows.length;aA++){for(ay=0;ay<aC.rows[aA].cells.length;ay++,y++){az[y]=aC.rows[aA].cells[ay]}}for(aA=0;aA<az.length;aA++){if(az[aA]==ax){if(aB=az[aA+1]){return aB}}}}function e(aE){var i=[],aF=aE.rows,aC,aB,ay,az,aD,ax,aA;for(aB=0;aB<aF.length;aB++){for(aC=0;aC<aF[aB].cells.length;aC++){ay=aF[aB].cells[aC];az=j(ay);for(aD=aC;i[aB]&&i[aB][aD];aD++){}for(aA=aB;aA<aB+az.rowspan;aA++){if(!i[aA]){i[aA]=[]}for(ax=aD;ax<aD+az.colspan;ax++){i[aA][ax]=ay}}}}return i}function m(aG,aD,ay,ax){var y=e(aG),aF=al(y,ay);var aH,aC;if(ax.cells.length!=aD.childNodes.length){aH=aD.childNodes;aC=null;for(var aE=0;ay=d(y,aF.rowindex,aE);aE++){var aA=true;var aB=j(ay);if(ap(aH,ay)){ax.childNodes[aE]._delete=true}else{if((aC==null||ay!=aC)&&aB.colspan>1){for(var az=aE;az<aE+ay.colSpan;az++){ax.childNodes[az]._delete=true}}}if((aC==null||ay!=aC)&&aB.rowspan>1){ay.rowSpan=aB.rowspan+1}aC=ay}B(F)}}function O(x,i){while((x=x.previousSibling)!=null){if(x.nodeName==i){return x}}return null}function af(ax,ay){var x=ay.split(",");while((ax=ax.nextSibling)!=null){for(var y=0;y<x.length;y++){if(ax.nodeName.toLowerCase()==x[y].toLowerCase()){return ax}}}return null}function B(ax){if(ax.rows==0){return}var y=ax.rows[0];do{var x=af(y,"TR");if(y._delete){y.parentNode.removeChild(y);continue}var ay=y.cells[0];if(ay.cells>1){do{var i=af(ay,"TD,TH");if(ay._delete){ay.parentNode.removeChild(ay)}}while((ay=i)!=null)}}while((y=x)!=null)}function p(ax,aA,az){ax.rowSpan=1;var x=af(aA,"TR");for(var ay=1;ay<az&&x;ay++){var y=k.createElement("td");if(!tinymce.isIE){y.innerHTML='<br mce_bogus="1"/>'}if(tinymce.isIE){x.insertBefore(y,x.cells(ax.cellIndex))}else{x.insertBefore(y,x.cells[ax.cellIndex])}x=af(x,"TR")}}function S(aF,aH,aB){var y=e(aH);var ax=aB.cloneNode(false);var aG=al(y,aB.cells[0]);var aC=null;var aA=V.dom.getAttrib(aH,"border");var az=null;for(var aE=0;az=d(y,aG.rowindex,aE);aE++){var aD=null;if(aC!=az){for(var ay=0;ay<aB.cells.length;ay++){if(az==aB.cells[ay]){aD=az.cloneNode(true);break}}}if(aD==null){aD=aF.createElement("td");if(!tinymce.isIE){aD.innerHTML='<br mce_bogus="1"/>'}}aD.colSpan=1;aD.rowSpan=1;ax.appendChild(aD);aC=az}return ax}switch(r){case"mceTableMoveToNextRow":var L=A(F,aq);if(!L){V.execCommand("mceTableInsertRowAfter",aq);L=A(F,aq)}V.selection.select(L);V.selection.collapse(true);return true;case"mceTableRowProps":if(W==null){return true}if(Z){V.windowManager.open({url:g+"/row.htm",width:400+parseInt(V.getLang("table.rowprops_delta_width",0)),height:295+parseInt(V.getLang("table.rowprops_delta_height",0)),inline:1},{plugin_url:g})}return true;case"mceTableCellProps":if(aq==null){return true}if(Z){V.windowManager.open({url:g+"/cell.htm",width:400+parseInt(V.getLang("table.cellprops_delta_width",0)),height:295+parseInt(V.getLang("table.cellprops_delta_height",0)),inline:1},{plugin_url:g})}return true;case"mceInsertTable":if(Z){V.windowManager.open({url:g+"/table.htm",width:400+parseInt(V.getLang("table.table_delta_width",0)),height:320+parseInt(V.getLang("table.table_delta_height",0)),inline:1},{plugin_url:g,action:ae?ae.action:0})}return true;case"mceTableDelete":var G=V.dom.getParent(V.selection.getNode(),"table");if(G){G.parentNode.removeChild(G);V.execCommand("mceRepaint")}return true;case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":if(!F){return true}if(W&&F!=W.parentNode){F=W.parentNode}if(F&&W){switch(r){case"mceTableCutRow":if(!W||!aq){return true}V.tableRowClipboard=S(k,F,W);V.execCommand("mceTableDeleteRow");break;case"mceTableCopyRow":if(!W||!aq){return true}V.tableRowClipboard=S(k,F,W);break;case"mceTablePasteRowBefore":if(!W||!aq){return true}var v=V.tableRowClipboard.cloneNode(true);var h=O(W,"TR");if(h!=null){m(F,h,h.cells[0],v)}W.parentNode.insertBefore(v,W);break;case"mceTablePasteRowAfter":if(!W||!aq){return true}var X=af(W,"TR");var v=V.tableRowClipboard.cloneNode(true);m(F,W,aq,v);if(X==null){W.parentNode.appendChild(v)}else{X.parentNode.insertBefore(v,X)}break;case"mceTableInsertRowBefore":if(!W||!aq){return true}var ad=e(F);var o=al(ad,aq);var v=k.createElement("tr");var u=null;o.rowindex--;if(o.rowindex<0){o.rowindex=0}for(var ac=0;aq=d(ad,o.rowindex,ac);ac++){if(aq!=u){var E=j(aq);if(E.rowspan==1){var J=k.createElement("td");if(!tinymce.isIE){J.innerHTML='<br mce_bogus="1"/>'}J.colSpan=aq.colSpan;v.appendChild(J)}else{aq.rowSpan=E.rowspan+1}u=aq}}W.parentNode.insertBefore(v,W);aj(0,1);break;case"mceTableInsertRowAfter":if(!W||!aq){return true}var ad=e(F);var o=al(ad,aq);var v=k.createElement("tr");var u=null;for(var ac=0;aq=d(ad,o.rowindex,ac);ac++){if(aq!=u){var E=j(aq);if(E.rowspan==1){var J=k.createElement("td");if(!tinymce.isIE){J.innerHTML='<br mce_bogus="1"/>'}J.colSpan=aq.colSpan;v.appendChild(J)}else{aq.rowSpan=E.rowspan+1}u=aq}}if(v.hasChildNodes()){var X=af(W,"TR");if(X){X.parentNode.insertBefore(v,X)}else{F.appendChild(v)}}aj(0,1);break;case"mceTableDeleteRow":if(!W||!aq){return true}var ad=e(F);var o=al(ad,aq);if(ad.length==1&&F.nodeName=="TBODY"){V.dom.remove(V.dom.getParent(F,"table"));return true}var D=W.cells;var X=af(W,"TR");for(var ac=0;ac<D.length;ac++){if(D[ac].rowSpan>1){var J=D[ac].cloneNode(true);var E=j(D[ac]);J.rowSpan=E.rowspan-1;var ak=X.cells[ac];if(ak==null){X.appendChild(J)}else{X.insertBefore(J,ak)}}}var u=null;for(var ac=0;aq=d(ad,o.rowindex,ac);ac++){if(aq!=u){var E=j(aq);if(E.rowspan>1){aq.rowSpan=E.rowspan-1}else{W=aq.parentNode;if(W.parentNode){W._delete=true}}u=aq}}B(F);aj(0,-1);break;case"mceTableInsertColBefore":if(!W||!aq){return true}var ad=e(V.dom.getParent(F,"table"));var o=al(ad,aq);var u=null;for(var aa=0;aq=d(ad,aa,o.cellindex);aa++){if(aq!=u){var E=j(aq);if(E.colspan==1){var J=k.createElement(aq.nodeName);if(!tinymce.isIE){J.innerHTML='<br mce_bogus="1"/>'}J.rowSpan=aq.rowSpan;aq.parentNode.insertBefore(J,aq)}else{aq.colSpan++}u=aq}}aj();break;case"mceTableInsertColAfter":if(!W||!aq){return true}var ad=e(V.dom.getParent(F,"table"));var o=al(ad,aq);var u=null;for(var aa=0;aq=d(ad,aa,o.cellindex);aa++){if(aq!=u){var E=j(aq);if(E.colspan==1){var J=k.createElement(aq.nodeName);if(!tinymce.isIE){J.innerHTML='<br mce_bogus="1"/>'}J.rowSpan=aq.rowSpan;var ak=af(aq,"TD,TH");if(ak==null){aq.parentNode.appendChild(J)}else{ak.parentNode.insertBefore(J,ak)}}else{aq.colSpan++}u=aq}}aj(1);break;case"mceTableDeleteCol":if(!W||!aq){return true}var ad=e(F);var o=al(ad,aq);var u=null;if((ad.length>1&&ad[0].length<=1)&&F.nodeName=="TBODY"){V.dom.remove(V.dom.getParent(F,"table"));return true}for(var aa=0;aq=d(ad,aa,o.cellindex);aa++){if(aq!=u){var E=j(aq);if(E.colspan>1){aq.colSpan=E.colspan-1}else{if(aq.parentNode){aq.parentNode.removeChild(aq)}}u=aq}}aj(-1);break;case"mceTableSplitCells":if(!W||!aq){return true}var l=j(aq);var C=l.colspan;var H=l.rowspan;if(C>1||H>1){aq.colSpan=1;for(var am=1;am<C;am++){var J=k.createElement("td");if(!tinymce.isIE){J.innerHTML='<br mce_bogus="1"/>'}W.insertBefore(J,af(aq,"TD,TH"));if(H>1){p(J,W,H)}}p(aq,W,H)}F=V.dom.getParent(V.selection.getNode(),"table");break;case"mceTableMergeCells":var ao=[];var R=V.selection.getSel();var ad=e(F);if(tinymce.isIE||R.rangeCount==1){if(Z){var t=j(aq);V.windowManager.open({url:g+"/merge_cells.htm",width:240+parseInt(V.getLang("table.merge_cells_delta_width",0)),height:110+parseInt(V.getLang("table.merge_cells_delta_height",0)),inline:1},{action:"update",numcols:t.colspan,numrows:t.rowspan,plugin_url:g});return true}else{var U=parseInt(ae.numrows);var c=parseInt(ae.numcols);var o=al(ad,aq);if((""+U)=="NaN"){U=1}if((""+c)=="NaN"){c=1}var b=F.rows;for(var aa=o.rowindex;aa<ad.length;aa++){var ag=[];for(var ac=o.cellindex;ac<ad[aa].length;ac++){var f=d(ad,aa,ac);if(f&&!ap(ao,f)&&!ap(ag,f)){var N=al(ad,f);if(N.cellindex<o.cellindex+c&&N.rowindex<o.rowindex+U){ag[ag.length]=f}}}if(ag.length>0){ao[ao.length]=ag}var f=d(ad,o.rowindex,o.cellindex);a(au.dom.select("br",f),function(y,x){if(x>0&&au.dom.getAttrib("mce_bogus")){au.dom.remove(y)}})}}}else{var D=[];var R=V.selection.getSel();var Y=null;var an=null;var z=-1,aw=-1,w,at;if(R.rangeCount<2){return true}for(var am=0;am<R.rangeCount;am++){var ai=R.getRangeAt(am);var aq=ai.startContainer.childNodes[ai.startOffset];if(!aq){break}if(aq.nodeName=="TD"||aq.nodeName=="TH"){D[D.length]=aq}}var b=F.rows;for(var aa=0;aa<b.length;aa++){var ag=[];for(var ac=0;ac<b[aa].cells.length;ac++){var f=b[aa].cells[ac];for(var am=0;am<D.length;am++){if(f==D[am]){ag[ag.length]=f}}}if(ag.length>0){ao[ao.length]=ag}}var an=[];var Y=null;for(var aa=0;aa<ad.length;aa++){for(var ac=0;ac<ad[aa].length;ac++){ad[aa][ac]._selected=false;for(var am=0;am<D.length;am++){if(ad[aa][ac]==D[am]){if(z==-1){z=ac;aw=aa}w=ac;at=aa;ad[aa][ac]._selected=true}}}}for(var aa=aw;aa<=at;aa++){for(var ac=z;ac<=w;ac++){if(!ad[aa][ac]._selected){alert("Invalid selection for merge.");return true}}}}var s=1,q=1;var T=-1;for(var aa=0;aa<ao.length;aa++){var I=0;for(var ac=0;ac<ao[aa].length;ac++){var E=j(ao[aa][ac]);I+=E.colspan;if(T!=-1&&E.rowspan!=T){alert("Invalid selection for merge.");return true}T=E.rowspan}if(I>q){q=I}T=-1}var Q=-1;for(var ac=0;ac<ao[0].length;ac++){var M=0;for(var aa=0;aa<ao.length;aa++){var E=j(ao[aa][ac]);M+=E.rowspan;if(Q!=-1&&E.colspan!=Q){alert("Invalid selection for merge.");return true}Q=E.colspan}if(M>s){s=M}Q=-1}aq=ao[0][0];aq.rowSpan=s;aq.colSpan=q;for(var aa=0;aa<ao.length;aa++){for(var ac=0;ac<ao[aa].length;ac++){var P=ao[aa][ac].innerHTML;var K=P.replace(/[ \t\r\n]/g,"");if(K!="<br/>"&&K!="<br>"&&K!='<br mce_bogus="1"/>'&&(ac+aa>0)){aq.innerHTML+=P}if(ao[aa][ac]!=aq&&!ao[aa][ac]._deleted){var o=al(ad,ao[aa][ac]);var ar=ao[aa][ac].parentNode;ar.removeChild(ao[aa][ac]);ao[aa][ac]._deleted=true;if(!ar.hasChildNodes()){ar.parentNode.removeChild(ar);var ab=null;for(var ac=0;cellElm=d(ad,o.rowindex,ac);ac++){if(cellElm!=ab&&cellElm.rowSpan>1){cellElm.rowSpan--}ab=cellElm}if(aq.rowSpan>1){aq.rowSpan--}}}}}a(au.dom.select("br",aq),function(y,x){if(x>0&&au.dom.getAttrib(y,"mce_bogus")){au.dom.remove(y)}});break}F=V.dom.getParent(V.selection.getNode(),"table");V.addVisual(F);V.nodeChanged()}return true}return false}});tinymce.PluginManager.add("table",tinymce.plugins.TablePlugin)})();
1
+ (function(b){var c=b.each;function a(E,D,H){var e,I,A,n;r();n=D.getParent(H.getStart(),"th,td");if(n){I=C(n);A=F();n=v(I.x,I.y)}function r(){var J=0;e=[];c(["thead","tbody","tfoot"],function(K){var L=D.select(K+" tr",E);c(L,function(M,N){N+=J;c(D.select("td,th",M),function(T,O){var P,Q,R,S;if(e[N]){while(e[N][O]){O++}}R=g(T,"rowspan");S=g(T,"colspan");for(Q=N;Q<N+R;Q++){if(!e[Q]){e[Q]=[]}for(P=O;P<O+S;P++){e[Q][P]={part:K,real:Q==N&&P==O,elm:T,rowspan:R,colspan:S}}}})});J+=L.length})}function v(J,L){var K;K=e[L];if(K){return K[J]}}function g(K,J){return parseInt(K.getAttribute(J)||1)}function h(J){return D.hasClass(J.elm,"mceSelected")||J==n}function j(){var J=[];c(E.rows,function(K){c(K.cells,function(L){if(D.hasClass(L,"mceSelected")||L==n.elm){J.push(K);return false}})});return J}function q(){var J=D.createRng();J.setStartAfter(E);J.setEndAfter(E);H.setRng(J);D.remove(E)}function d(J){var K;b.walk(J,function(M){var L;if(M.nodeType==3){c(D.getParents(M.parentNode,null,J).reverse(),function(N){N=N.cloneNode(false);if(!K){K=L=N}else{if(L){L.appendChild(N)}}L=N});if(L){L.innerHTML=b.isIE?"&nbsp;":'<br _mce_bogus="1" />'}return false}},"childNodes");J=J.cloneNode(false);J.rowSpan=J.colSpan=1;if(K){J.appendChild(K)}else{if(!b.isIE){J.innerHTML='<br _mce_bogus="1" />'}}return J}function p(){var J=D.createRng();c(D.select("tr",E),function(K){if(K.cells.length==0){D.remove(K)}});if(D.select("tr",E).length==0){J.setStartAfter(E);J.setEndAfter(E);H.setRng(J);D.remove(E);return}c(D.select("thead,tbody,tfoot",E),function(K){if(K.rows.length==0){D.remove(K)}});r();row=e[Math.min(e.length-1,I.y)];if(row){H.select(row[Math.min(row.length-1,I.x)].elm,true);H.collapse(true)}}function s(P,N,R,O){var M,K,J,L,Q;M=e[N][P].elm.parentNode;for(J=1;J<=R;J++){M=D.getNext(M,"tr");if(M){for(K=P;K>=0;K--){Q=e[N+J][K].elm;if(Q.parentNode==M){for(L=1;L<=O;L++){D.insertAfter(d(Q),Q)}break}}if(K==-1){for(L=1;L<=O;L++){M.insertBefore(d(M.cells[0]),M.cells[0])}}}}}function z(){c(e,function(J,K){c(J,function(M,L){var P,O,Q,N;if(h(M)){M=M.elm;P=g(M,"colspan");O=g(M,"rowspan");if(P>1||O>1){M.colSpan=M.rowSpan=1;for(N=0;N<P-1;N++){D.insertAfter(d(M),M)}s(L,K,O-1,P)}}})})}function o(R,O,U){var M,L,T,S,Q,N,P,J,R,K;if(R){pos=C(R);M=pos.x;L=pos.y;T=M+(O-1);S=L+(U-1)}else{M=I.x;L=I.y;T=A.x;S=A.y}P=v(M,L);J=v(T,S);if(P&&J&&P.part==J.part){z();r();P=v(M,L).elm;P.colSpan=(T-M)+1;P.rowSpan=(S-L)+1;for(N=L;N<=S;N++){for(Q=M;Q<=T;Q++){R=e[N][Q].elm;if(R!=P){K=b.grep(R.childNodes);c(K,function(W,V){if(W.nodeName!="BR"||V!=K.length-1){P.appendChild(W)}});D.remove(R)}}}p()}}function k(M){var J,O,L,N,P,Q,K,R;c(e,function(S,T){c(S,function(V,U){if(h(V)){V=V.elm;P=V.parentNode;Q=P.cloneNode(false);J=T;if(M){return false}}});if(M){return !J}});for(N=0;N<e[0].length;N++){O=e[J][N].elm;if(O!=L){if(!M){rowSpan=g(O,"rowspan");if(rowSpan>1){O.rowSpan=rowSpan+1;continue}}else{if(J>0&&e[J-1][N]){R=e[J-1][N].elm;rowSpan=g(R,"rowspan");if(rowSpan>1){R.rowSpan=rowSpan+1;continue}}}K=d(O);K.colSpan=O.colSpan;Q.appendChild(K);L=O}}if(Q.hasChildNodes()){if(!M){D.insertAfter(Q,P)}else{P.parentNode.insertBefore(Q,P)}}}function f(K){var L,J;c(e,function(M,N){c(M,function(P,O){if(h(P)){L=O;if(K){return false}}});if(K){return !L}});c(e,function(P,Q){var M=P[L].elm,N,O;if(M!=J){O=g(M,"colspan");N=g(M,"rowspan");if(O==1){if(!K){D.insertAfter(d(M),M);s(L,Q,N-1,O)}else{M.parentNode.insertBefore(d(M),M);s(L,Q,N-1,O)}}else{M.colSpan++}J=M}})}function m(){var J=[];c(e,function(K,L){c(K,function(N,M){if(h(N)&&b.inArray(J,M)===-1){c(e,function(Q){var O=Q[M].elm,P;P=g(O,"colspan");if(P>1){O.colSpan=P-1}else{D.remove(O)}});J.push(M)}})});p()}function l(){var K;function J(N){var M,O,L;M=D.getNext(N,"tr");c(N.cells,function(P){var Q=g(P,"rowspan");if(Q>1){P.rowSpan=Q-1;O=C(P);s(O.x,O.y,1,1)}});O=C(N.cells[0]);c(e[O.y],function(P){var Q;P=P.elm;if(P!=L){Q=g(P,"rowspan");if(Q<=1){D.remove(P)}else{P.rowSpan=Q-1}L=P}})}K=j();c(K.reverse(),function(L){J(L)});p()}function B(){var J=j();D.remove(J);p();return J}function G(){var J=j();c(J,function(L,K){J[K]=L.cloneNode(true)});return J}function w(L,K){var M=j(),J=M[K?0:M.length-1],N=J.cells.length;c(e,function(P){var O;N=0;c(P,function(R,Q){if(R.real){N+=R.colspan}if(R.elm.parentNode==J){O=1}});if(O){return false}});if(!K){L.reverse()}c(L,function(Q){var P=Q.cells.length,O;for(i=0;i<P;i++){O=Q.cells[i];O.colSpan=O.rowSpan=1}for(i=P;i<N;i++){Q.appendChild(d(Q.cells[P-1]))}for(i=N;i<P;i++){D.remove(Q.cells[i])}if(K){J.parentNode.insertBefore(Q,J)}else{D.insertAfter(Q,J)}})}function C(J){var K;c(e,function(L,M){c(L,function(O,N){if(O.elm==J){K={x:N,y:M};return false}});return !K});return K}function u(J){I=C(J)}function F(){var L,K,J;K=J=0;c(e,function(M,N){c(M,function(P,O){var R,Q;if(h(P)){P=e[N][O];if(O>K){K=O}if(N>J){J=N}if(P.real){R=P.colspan-1;Q=P.rowspan-1;if(R){if(O+R>K){K=O+R}}if(Q){if(N+Q>J){J=N+Q}}}}})});return{x:K,y:J}}function t(P){var M,L,R,Q,K,J,N,O;A=C(P);if(I&&A){M=Math.min(I.x,A.x);L=Math.min(I.y,A.y);R=Math.max(I.x,A.x);Q=Math.max(I.y,A.y);K=R;J=Q;for(y=L;y<=J;y++){P=e[y][M];if(!P.real){if(M-(P.colspan-1)<M){M-=P.colspan-1}}}for(x=M;x<=K;x++){P=e[L][x];if(!P.real){if(L-(P.rowspan-1)<L){L-=P.rowspan-1}}}for(y=L;y<=Q;y++){for(x=M;x<=R;x++){P=e[y][x];if(P.real){N=P.colspan-1;O=P.rowspan-1;if(N){if(x+N>K){K=x+N}}if(O){if(y+O>J){J=y+O}}}}}D.removeClass(D.select("td.mceSelected,th.mceSelected"),"mceSelected");for(y=L;y<=J;y++){for(x=M;x<=K;x++){D.addClass(e[y][x].elm,"mceSelected")}}}}b.extend(this,{deleteTable:q,split:z,merge:o,insertRow:k,insertCol:f,deleteCols:m,deleteRows:l,cutRows:B,copyRows:G,pasteRows:w,getPos:C,setStartCell:u,setEndCell:t})}b.create("tinymce.plugins.TablePlugin",{init:function(e,f){var d,j;function h(m){var l=e.selection,k=e.dom.getParent(m||l.getNode(),"table");if(k){return new a(k,e.dom,l)}}function g(){e.getBody().style.webkitUserSelect="";e.dom.removeClass(e.dom.select("td.mceSelected,th.mceSelected"),"mceSelected")}c([["table","table.desc","mceInsertTable",true],["delete_table","table.del","mceTableDelete"],["delete_col","table.delete_col_desc","mceTableDeleteCol"],["delete_row","table.delete_row_desc","mceTableDeleteRow"],["col_after","table.col_after_desc","mceTableInsertColAfter"],["col_before","table.col_before_desc","mceTableInsertColBefore"],["row_after","table.row_after_desc","mceTableInsertRowAfter"],["row_before","table.row_before_desc","mceTableInsertRowBefore"],["row_props","table.row_desc","mceTableRowProps",true],["cell_props","table.cell_desc","mceTableCellProps",true],["split_cells","table.split_cells_desc","mceTableSplitCells",true],["merge_cells","table.merge_cells_desc","mceTableMergeCells",true]],function(k){e.addButton(k[0],{title:k[1],cmd:k[2],ui:k[3]})});if(!b.isIE){e.onClick.add(function(k,l){l=l.target;if(l.nodeName==="TABLE"){k.selection.select(l)}})}e.onNodeChange.add(function(l,k,o){var m;o=l.selection.getStart();m=l.dom.getParent(o,"td,th,caption");k.setActive("table",o.nodeName==="TABLE"||!!m);if(m&&m.nodeName==="CAPTION"){m=0}k.setDisabled("delete_table",!m);k.setDisabled("delete_col",!m);k.setDisabled("delete_table",!m);k.setDisabled("delete_row",!m);k.setDisabled("col_after",!m);k.setDisabled("col_before",!m);k.setDisabled("row_after",!m);k.setDisabled("row_before",!m);k.setDisabled("row_props",!m);k.setDisabled("cell_props",!m);k.setDisabled("split_cells",!m);k.setDisabled("merge_cells",!m)});e.onInit.add(function(l){var k,o,p=l.dom,m;d=l.windowManager;l.onMouseDown.add(function(q,r){if(r.button!=2){g();o=p.getParent(r.target,"td,th");k=p.getParent(o,"table")}});p.bind(l.getDoc(),"mouseover",function(t){var r,q,s=t.target;if(o&&(m||s!=o)&&(s.nodeName=="TD"||s.nodeName=="TH")){q=p.getParent(s,"table");if(q==k){if(!m){m=h(q);m.setStartCell(o);l.getBody().style.webkitUserSelect="none"}m.setEndCell(s)}r=l.selection.getSel();if(r.removeAllRanges){r.removeAllRanges()}else{r.empty()}t.preventDefault()}});l.onMouseUp.add(function(z,A){var r,t=z.selection,B,C=t.getSel(),q,u,s,w;if(o){if(m){z.getBody().style.webkitUserSelect=""}function v(D,F){var E=new b.dom.TreeWalker(D,D);do{if(D.nodeType==3&&b.trim(D.nodeValue).length!=0){if(F){r.setStart(D,0)}else{r.setEnd(D,D.nodeValue.length)}return}if(D.nodeName=="BR"){if(F){r.setStartBefore(D)}else{r.setEndBefore(D)}return}}while(D=(F?E.next():E.prev()))}B=p.select("td.mceSelected,th.mceSelected");if(B.length>0){r=p.createRng();u=B[0];w=B[B.length-1];v(u,1);q=new b.dom.TreeWalker(u,p.getParent(B[0],"table"));do{if(u.nodeName=="TD"||u.nodeName=="TH"){if(!p.hasClass(u,"mceSelected")){break}s=u}}while(u=q.next());v(s);t.setRng(r)}z.nodeChanged();o=m=k=null}});l.onKeyUp.add(function(q,r){g()});if(l&&l.plugins.contextmenu){l.plugins.contextmenu.onContextMenu.add(function(s,q,u){var v,t=l.selection,r=t.getNode()||l.getBody();if(l.dom.getParent(u,"td")||l.dom.getParent(u,"th")){q.removeAll();if(r.nodeName=="A"&&!l.dom.getAttrib(r,"name")){q.add({title:"advanced.link_desc",icon:"link",cmd:l.plugins.advlink?"mceAdvLink":"mceLink",ui:true});q.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"});q.addSeparator()}if(r.nodeName=="IMG"&&r.className.indexOf("mceItem")==-1){q.add({title:"advanced.image_desc",icon:"image",cmd:l.plugins.advimage?"mceAdvImage":"mceImage",ui:true});q.addSeparator()}q.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",value:{action:"insert"}});q.add({title:"table.props_desc",icon:"table_props",cmd:"mceInsertTable"});q.add({title:"table.del",icon:"delete_table",cmd:"mceTableDelete"});q.addSeparator();v=q.addMenu({title:"table.cell"});v.add({title:"table.cell_desc",icon:"cell_props",cmd:"mceTableCellProps"});v.add({title:"table.split_cells_desc",icon:"split_cells",cmd:"mceTableSplitCells"});v.add({title:"table.merge_cells_desc",icon:"merge_cells",cmd:"mceTableMergeCells"});v=q.addMenu({title:"table.row"});v.add({title:"table.row_desc",icon:"row_props",cmd:"mceTableRowProps"});v.add({title:"table.row_before_desc",icon:"row_before",cmd:"mceTableInsertRowBefore"});v.add({title:"table.row_after_desc",icon:"row_after",cmd:"mceTableInsertRowAfter"});v.add({title:"table.delete_row_desc",icon:"delete_row",cmd:"mceTableDeleteRow"});v.addSeparator();v.add({title:"table.cut_row_desc",icon:"cut",cmd:"mceTableCutRow"});v.add({title:"table.copy_row_desc",icon:"copy",cmd:"mceTableCopyRow"});v.add({title:"table.paste_row_before_desc",icon:"paste",cmd:"mceTablePasteRowBefore"}).setDisabled(!j);v.add({title:"table.paste_row_after_desc",icon:"paste",cmd:"mceTablePasteRowAfter"}).setDisabled(!j);v=q.addMenu({title:"table.col"});v.add({title:"table.col_before_desc",icon:"col_before",cmd:"mceTableInsertColBefore"});v.add({title:"table.col_after_desc",icon:"col_after",cmd:"mceTableInsertColAfter"});v.add({title:"table.delete_col_desc",icon:"delete_col",cmd:"mceTableDeleteCol"})}else{q.add({title:"table.desc",icon:"table",cmd:"mceInsertTable"})}})}if(!b.isIE){function n(){var q;for(q=l.getBody().lastChild;q&&q.nodeType==3&&!q.nodeValue.length;q=q.previousSibling){}if(q&&q.nodeName=="TABLE"){l.dom.add(l.getBody(),"p",null,'<br mce_bogus="1" />')}}if(b.isGecko){l.onKeyDown.add(function(r,t){var q,s,u=r.dom;if(t.keyCode==37||t.keyCode==38){q=r.selection.getRng();s=u.getParent(q.startContainer,"table");if(s&&r.getBody().firstChild==s){if(isAtStart(q,s)){q=u.createRng();q.setStartBefore(s);q.setEndBefore(s);r.selection.setRng(q);t.preventDefault()}}}})}l.onKeyUp.add(n);l.onSetContent.add(n);l.onVisualAid.add(n);l.onPreProcess.add(function(q,s){var r=s.node.lastChild;if(r&&r.childNodes.length==1&&r.firstChild.nodeName=="BR"){q.dom.remove(r)}});n()}});c({mceTableSplitCells:function(k){k.split()},mceTableMergeCells:function(l){var m,n,k;k=e.dom.getParent(e.selection.getNode(),"th,td");if(k){m=k.rowSpan;n=k.colSpan}if(!e.dom.select("td.mceSelected,th.mceSelected").length){d.open({url:f+"/merge_cells.htm",width:240+parseInt(e.getLang("table.merge_cells_delta_width",0)),height:110+parseInt(e.getLang("table.merge_cells_delta_height",0)),inline:1},{rows:m,cols:n,onaction:function(o){l.merge(k,o.cols,o.rows)},plugin_url:f})}else{l.merge()}},mceTableInsertRowBefore:function(k){k.insertRow(true)},mceTableInsertRowAfter:function(k){k.insertRow()},mceTableInsertColBefore:function(k){k.insertCol(true)},mceTableInsertColAfter:function(k){k.insertCol()},mceTableDeleteCol:function(k){k.deleteCols()},mceTableDeleteRow:function(k){k.deleteRows()},mceTableCutRow:function(k){j=k.cutRows()},mceTableCopyRow:function(k){j=k.copyRows()},mceTablePasteRowBefore:function(k){k.pasteRows(j,true)},mceTablePasteRowAfter:function(k){k.pasteRows(j)},mceTableDelete:function(k){k.deleteTable()}},function(l,k){e.addCommand(k,function(){var m=h();if(m){l(m);e.execCommand("mceRepaint");g()}})});c({mceInsertTable:function(k){d.open({url:f+"/table.htm",width:400+parseInt(e.getLang("table.table_delta_width",0)),height:320+parseInt(e.getLang("table.table_delta_height",0)),inline:1},{plugin_url:f,action:k?k.action:0})},mceTableRowProps:function(){d.open({url:f+"/row.htm",width:400+parseInt(e.getLang("table.rowprops_delta_width",0)),height:295+parseInt(e.getLang("table.rowprops_delta_height",0)),inline:1},{plugin_url:f})},mceTableCellProps:function(){d.open({url:f+"/cell.htm",width:400+parseInt(e.getLang("table.cellprops_delta_width",0)),height:295+parseInt(e.getLang("table.cellprops_delta_height",0)),inline:1},{plugin_url:f})}},function(l,k){e.addCommand(k,function(m,n){l(n)})})}});b.PluginManager.add("table",b.plugins.TablePlugin)})(tinymce);
tiny_mce/plugins/table/editor_plugin_src.js ADDED
@@ -0,0 +1,1118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * editor_plugin_src.js
3
+ *
4
+ * Copyright 2009, Moxiecode Systems AB
5
+ * Released under LGPL License.
6
+ *
7
+ * License: http://tinymce.moxiecode.com/license
8
+ * Contributing: http://tinymce.moxiecode.com/contributing
9
+ */
10
+
11
+ (function(tinymce) {
12
+ var each = tinymce.each;
13
+
14
+ /**
15
+ * Table Grid class.
16
+ */
17
+ function TableGrid(table, dom, selection) {
18
+ var grid, startPos, endPos, selectedCell;
19
+
20
+ buildGrid();
21
+ selectedCell = dom.getParent(selection.getStart(), 'th,td');
22
+ if (selectedCell) {
23
+ startPos = getPos(selectedCell);
24
+ endPos = findEndPos();
25
+ selectedCell = getCell(startPos.x, startPos.y);
26
+ }
27
+
28
+ function buildGrid() {
29
+ var startY = 0;
30
+
31
+ grid = [];
32
+
33
+ each(['thead', 'tbody', 'tfoot'], function(part) {
34
+ var rows = dom.select(part + ' tr', table);
35
+
36
+ each(rows, function(tr, y) {
37
+ y += startY;
38
+
39
+ each(dom.select('td,th', tr), function(td, x) {
40
+ var x2, y2, rowspan, colspan;
41
+
42
+ // Skip over existing cells produced by rowspan
43
+ if (grid[y]) {
44
+ while (grid[y][x])
45
+ x++;
46
+ }
47
+
48
+ // Get col/rowspan from cell
49
+ rowspan = getSpanVal(td, 'rowspan');
50
+ colspan = getSpanVal(td, 'colspan');
51
+
52
+ // Fill out rowspan/colspan right and down
53
+ for (y2 = y; y2 < y + rowspan; y2++) {
54
+ if (!grid[y2])
55
+ grid[y2] = [];
56
+
57
+ for (x2 = x; x2 < x + colspan; x2++) {
58
+ grid[y2][x2] = {
59
+ part : part,
60
+ real : y2 == y && x2 == x,
61
+ elm : td,
62
+ rowspan : rowspan,
63
+ colspan : colspan
64
+ };
65
+ }
66
+ }
67
+ });
68
+ });
69
+
70
+ startY += rows.length;
71
+ });
72
+ };
73
+
74
+ function getCell(x, y) {
75
+ var row;
76
+
77
+ row = grid[y];
78
+ if (row)
79
+ return row[x];
80
+ };
81
+
82
+ function getSpanVal(td, name) {
83
+ return parseInt(td.getAttribute(name) || 1);
84
+ };
85
+
86
+ function isCellSelected(cell) {
87
+ return dom.hasClass(cell.elm, 'mceSelected') || cell == selectedCell;
88
+ };
89
+
90
+ function getSelectedRows() {
91
+ var rows = [];
92
+
93
+ each(table.rows, function(row) {
94
+ each(row.cells, function(cell) {
95
+ if (dom.hasClass(cell, 'mceSelected') || cell == selectedCell.elm) {
96
+ rows.push(row);
97
+ return false;
98
+ }
99
+ });
100
+ });
101
+
102
+ return rows;
103
+ };
104
+
105
+ function deleteTable() {
106
+ var rng = dom.createRng();
107
+
108
+ rng.setStartAfter(table);
109
+ rng.setEndAfter(table);
110
+
111
+ selection.setRng(rng);
112
+
113
+ dom.remove(table);
114
+ };
115
+
116
+ function cloneCell(cell) {
117
+ var formatNode;
118
+
119
+ // Clone formats
120
+ tinymce.walk(cell, function(node) {
121
+ var curNode;
122
+
123
+ if (node.nodeType == 3) {
124
+ each(dom.getParents(node.parentNode, null, cell).reverse(), function(node) {
125
+ node = node.cloneNode(false);
126
+
127
+ if (!formatNode)
128
+ formatNode = curNode = node;
129
+ else if (curNode)
130
+ curNode.appendChild(node);
131
+
132
+ curNode = node;
133
+ });
134
+
135
+ // Add something to the inner node
136
+ if (curNode)
137
+ curNode.innerHTML = tinymce.isIE ? '&nbsp;' : '<br _mce_bogus="1" />';
138
+
139
+ return false;
140
+ }
141
+ }, 'childNodes');
142
+
143
+ cell = cell.cloneNode(false);
144
+ cell.rowSpan = cell.colSpan = 1;
145
+
146
+ if (formatNode) {
147
+ cell.appendChild(formatNode);
148
+ } else {
149
+ if (!tinymce.isIE)
150
+ cell.innerHTML = '<br _mce_bogus="1" />';
151
+ }
152
+
153
+ return cell;
154
+ };
155
+
156
+ function cleanup() {
157
+ var rng = dom.createRng();
158
+
159
+ // Empty rows
160
+ each(dom.select('tr', table), function(tr) {
161
+ if (tr.cells.length == 0)
162
+ dom.remove(tr);
163
+ });
164
+
165
+ // Empty table
166
+ if (dom.select('tr', table).length == 0) {
167
+ rng.setStartAfter(table);
168
+ rng.setEndAfter(table);
169
+ selection.setRng(rng);
170
+ dom.remove(table);
171
+ return;
172
+ }
173
+
174
+ // Empty header/body/footer
175
+ each(dom.select('thead,tbody,tfoot', table), function(part) {
176
+ if (part.rows.length == 0)
177
+ dom.remove(part);
178
+ });
179
+
180
+ // Restore selection to start position if it still exists
181
+ buildGrid();
182
+
183
+ // Restore the selection to the closest table position
184
+ row = grid[Math.min(grid.length - 1, startPos.y)];
185
+ if (row) {
186
+ selection.select(row[Math.min(row.length - 1, startPos.x)].elm, true);
187
+ selection.collapse(true);
188
+ }
189
+ };
190
+
191
+ function fillLeftDown(x, y, rows, cols) {
192
+ var tr, x2, r, c, cell;
193
+
194
+ tr = grid[y][x].elm.parentNode;
195
+ for (r = 1; r <= rows; r++) {
196
+ tr = dom.getNext(tr, 'tr');
197
+
198
+ if (tr) {
199
+ // Loop left to find real cell
200
+ for (x2 = x; x2 >= 0; x2--) {
201
+ cell = grid[y + r][x2].elm;
202
+
203
+ if (cell.parentNode == tr) {
204
+ // Append clones after
205
+ for (c = 1; c <= cols; c++)
206
+ dom.insertAfter(cloneCell(cell), cell);
207
+
208
+ break;
209
+ }
210
+ }
211
+
212
+ if (x2 == -1) {
213
+ // Insert nodes before first cell
214
+ for (c = 1; c <= cols; c++)
215
+ tr.insertBefore(cloneCell(tr.cells[0]), tr.cells[0]);
216
+ }
217
+ }
218
+ }
219
+ };
220
+
221
+ function split() {
222
+ each(grid, function(row, y) {
223
+ each(row, function(cell, x) {
224
+ var colSpan, rowSpan, newCell, i;
225
+
226
+ if (isCellSelected(cell)) {
227
+ cell = cell.elm;
228
+ colSpan = getSpanVal(cell, 'colspan');
229
+ rowSpan = getSpanVal(cell, 'rowspan');
230
+
231
+ if (colSpan > 1 || rowSpan > 1) {
232
+ cell.colSpan = cell.rowSpan = 1;
233
+
234
+ // Insert cells right
235
+ for (i = 0; i < colSpan - 1; i++)
236
+ dom.insertAfter(cloneCell(cell), cell);
237
+
238
+ fillLeftDown(x, y, rowSpan - 1, colSpan);
239
+ }
240
+ }
241
+ });
242
+ });
243
+ };
244
+
245
+ function merge(cell, cols, rows) {
246
+ var startX, startY, endX, endY, x, y, startCell, endCell, cell, children;
247
+
248
+ // Use specified cell and cols/rows
249
+ if (cell) {
250
+ pos = getPos(cell);
251
+ startX = pos.x;
252
+ startY = pos.y;
253
+ endX = startX + (cols - 1);
254
+ endY = startY + (rows - 1);
255
+ } else {
256
+ // Use selection
257
+ startX = startPos.x;
258
+ startY = startPos.y;
259
+ endX = endPos.x;
260
+ endY = endPos.y;
261
+ }
262
+
263
+ // Find start/end cells
264
+ startCell = getCell(startX, startY);
265
+ endCell = getCell(endX, endY);
266
+
267
+ // Check if the cells exists and if they are of the same part for example tbody = tbody
268
+ if (startCell && endCell && startCell.part == endCell.part) {
269
+ // Split and rebuild grid
270
+ split();
271
+ buildGrid();
272
+
273
+ // Set row/col span to start cell
274
+ startCell = getCell(startX, startY).elm;
275
+ startCell.colSpan = (endX - startX) + 1;
276
+ startCell.rowSpan = (endY - startY) + 1;
277
+
278
+ // Remove other cells and add it's contents to the start cell
279
+ for (y = startY; y <= endY; y++) {
280
+ for (x = startX; x <= endX; x++) {
281
+ cell = grid[y][x].elm;
282
+
283
+ if (cell != startCell) {
284
+ // Move children to startCell
285
+ children = tinymce.grep(cell.childNodes);
286
+ each(children, function(node, i) {
287
+ // Jump over last BR element
288
+ if (node.nodeName != 'BR' || i != children.length - 1)
289
+ startCell.appendChild(node);
290
+ });
291
+
292
+ // Remove cell
293
+ dom.remove(cell);
294
+ }
295
+ }
296
+ }
297
+
298
+ // Remove empty rows etc and restore caret location
299
+ cleanup();
300
+ }
301
+ };
302
+
303
+ function insertRow(before) {
304
+ var posY, cell, lastCell, x, rowElm, newRow, newCell, otherCell;
305
+
306
+ // Find first/last row
307
+ each(grid, function(row, y) {
308
+ each(row, function(cell, x) {
309
+ if (isCellSelected(cell)) {
310
+ cell = cell.elm;
311
+ rowElm = cell.parentNode;
312
+ newRow = rowElm.cloneNode(false);
313
+ posY = y;
314
+
315
+ if (before)
316
+ return false;
317
+ }
318
+ });
319
+
320
+ if (before)
321
+ return !posY;
322
+ });
323
+
324
+ for (x = 0; x < grid[0].length; x++) {
325
+ cell = grid[posY][x].elm;
326
+
327
+ if (cell != lastCell) {
328
+ if (!before) {
329
+ rowSpan = getSpanVal(cell, 'rowspan');
330
+ if (rowSpan > 1) {
331
+ cell.rowSpan = rowSpan + 1;
332
+ continue;
333
+ }
334
+ } else {
335
+ // Check if cell above can be expanded
336
+ if (posY > 0 && grid[posY - 1][x]) {
337
+ otherCell = grid[posY - 1][x].elm;
338
+ rowSpan = getSpanVal(otherCell, 'rowspan');
339
+ if (rowSpan > 1) {
340
+ otherCell.rowSpan = rowSpan + 1;
341
+ continue;
342
+ }
343
+ }
344
+ }
345
+
346
+ // Insert new cell into new row
347
+ newCell = cloneCell(cell)
348
+ newCell.colSpan = cell.colSpan;
349
+ newRow.appendChild(newCell);
350
+
351
+ lastCell = cell;
352
+ }
353
+ }
354
+
355
+ if (newRow.hasChildNodes()) {
356
+ if (!before)
357
+ dom.insertAfter(newRow, rowElm);
358
+ else
359
+ rowElm.parentNode.insertBefore(newRow, rowElm);
360
+ }
361
+ };
362
+
363
+ function insertCol(before) {
364
+ var posX, lastCell;
365
+
366
+ // Find first/last column
367
+ each(grid, function(row, y) {
368
+ each(row, function(cell, x) {
369
+ if (isCellSelected(cell)) {
370
+ posX = x;
371
+
372
+ if (before)
373
+ return false;
374
+ }
375
+ });
376
+
377
+ if (before)
378
+ return !posX;
379
+ });
380
+
381
+ each(grid, function(row, y) {
382
+ var cell = row[posX].elm, rowSpan, colSpan;
383
+
384
+ if (cell != lastCell) {
385
+ colSpan = getSpanVal(cell, 'colspan');
386
+ rowSpan = getSpanVal(cell, 'rowspan');
387
+
388
+ if (colSpan == 1) {
389
+ if (!before) {
390
+ dom.insertAfter(cloneCell(cell), cell);
391
+ fillLeftDown(posX, y, rowSpan - 1, colSpan);
392
+ } else {
393
+ cell.parentNode.insertBefore(cloneCell(cell), cell);
394
+ fillLeftDown(posX, y, rowSpan - 1, colSpan);
395
+ }
396
+ } else
397
+ cell.colSpan++;
398
+
399
+ lastCell = cell;
400
+ }
401
+ });
402
+ };
403
+
404
+ function deleteCols() {
405
+ var cols = [];
406
+
407
+ // Get selected column indexes
408
+ each(grid, function(row, y) {
409
+ each(row, function(cell, x) {
410
+ if (isCellSelected(cell) && tinymce.inArray(cols, x) === -1) {
411
+ each(grid, function(row) {
412
+ var cell = row[x].elm, colSpan;
413
+
414
+ colSpan = getSpanVal(cell, 'colspan');
415
+
416
+ if (colSpan > 1)
417
+ cell.colSpan = colSpan - 1;
418
+ else
419
+ dom.remove(cell);
420
+ });
421
+
422
+ cols.push(x);
423
+ }
424
+ });
425
+ });
426
+
427
+ cleanup();
428
+ };
429
+
430
+ function deleteRows() {
431
+ var rows;
432
+
433
+ function deleteRow(tr) {
434
+ var nextTr, pos, lastCell;
435
+
436
+ nextTr = dom.getNext(tr, 'tr');
437
+
438
+ // Move down row spanned cells
439
+ each(tr.cells, function(cell) {
440
+ var rowSpan = getSpanVal(cell, 'rowspan');
441
+
442
+ if (rowSpan > 1) {
443
+ cell.rowSpan = rowSpan - 1;
444
+ pos = getPos(cell);
445
+ fillLeftDown(pos.x, pos.y, 1, 1);
446
+ }
447
+ });
448
+
449
+ // Delete cells
450
+ pos = getPos(tr.cells[0]);
451
+ each(grid[pos.y], function(cell) {
452
+ var rowSpan;
453
+
454
+ cell = cell.elm;
455
+
456
+ if (cell != lastCell) {
457
+ rowSpan = getSpanVal(cell, 'rowspan');
458
+
459
+ if (rowSpan <= 1)
460
+ dom.remove(cell);
461
+ else
462
+ cell.rowSpan = rowSpan - 1;
463
+
464
+ lastCell = cell;
465
+ }
466
+ });
467
+ };
468
+
469
+ // Get selected rows and move selection out of scope
470
+ rows = getSelectedRows();
471
+
472
+ // Delete all selected rows
473
+ each(rows.reverse(), function(tr) {
474
+ deleteRow(tr);
475
+ });
476
+
477
+ cleanup();
478
+ };
479
+
480
+ function cutRows() {
481
+ var rows = getSelectedRows();
482
+
483
+ dom.remove(rows);
484
+ cleanup();
485
+
486
+ return rows;
487
+ };
488
+
489
+ function copyRows() {
490
+ var rows = getSelectedRows();
491
+
492
+ each(rows, function(row, i) {
493
+ rows[i] = row.cloneNode(true);
494
+ });
495
+
496
+ return rows;
497
+ };
498
+
499
+ function pasteRows(rows, before) {
500
+ var selectedRows = getSelectedRows(),
501
+ targetRow = selectedRows[before ? 0 : selectedRows.length - 1],
502
+ targetCellCount = targetRow.cells.length;
503
+
504
+ // Calc target cell count
505
+ each(grid, function(row) {
506
+ var match;
507
+
508
+ targetCellCount = 0;
509
+ each(row, function(cell, x) {
510
+ if (cell.real)
511
+ targetCellCount += cell.colspan;
512
+
513
+ if (cell.elm.parentNode == targetRow)
514
+ match = 1;
515
+ });
516
+
517
+ if (match)
518
+ return false;
519
+ });
520
+
521
+ if (!before)
522
+ rows.reverse();
523
+
524
+ each(rows, function(row) {
525
+ var cellCount = row.cells.length, cell;
526
+
527
+ // Remove col/rowspans
528
+ for (i = 0; i < cellCount; i++) {
529
+ cell = row.cells[i];
530
+ cell.colSpan = cell.rowSpan = 1;
531
+ }
532
+
533
+ // Needs more cells
534
+ for (i = cellCount; i < targetCellCount; i++)
535
+ row.appendChild(cloneCell(row.cells[cellCount - 1]));
536
+
537
+ // Needs less cells
538
+ for (i = targetCellCount; i < cellCount; i++)
539
+ dom.remove(row.cells[i]);
540
+
541
+ // Add before/after
542
+ if (before)
543
+ targetRow.parentNode.insertBefore(row, targetRow);
544
+ else
545
+ dom.insertAfter(row, targetRow);
546
+ });
547
+ };
548
+
549
+ function getPos(target) {
550
+ var pos;
551
+
552
+ each(grid, function(row, y) {
553
+ each(row, function(cell, x) {
554
+ if (cell.elm == target) {
555
+ pos = {x : x, y : y};
556
+ return false;
557
+ }
558
+ });
559
+
560
+ return !pos;
561
+ });
562
+
563
+ return pos;
564
+ };
565
+
566
+ function setStartCell(cell) {
567
+ startPos = getPos(cell);
568
+ };
569
+
570
+ function findEndPos() {
571
+ var pos, maxX, maxY;
572
+
573
+ maxX = maxY = 0;
574
+
575
+ each(grid, function(row, y) {
576
+ each(row, function(cell, x) {
577
+ var colSpan, rowSpan;
578
+
579
+ if (isCellSelected(cell)) {
580
+ cell = grid[y][x];
581
+
582
+ if (x > maxX)
583
+ maxX = x;
584
+
585
+ if (y > maxY)
586
+ maxY = y;
587
+
588
+ if (cell.real) {
589
+ colSpan = cell.colspan - 1;
590
+ rowSpan = cell.rowspan - 1;
591
+
592
+ if (colSpan) {
593
+ if (x + colSpan > maxX)
594
+ maxX = x + colSpan;
595
+ }
596
+
597
+ if (rowSpan) {
598
+ if (y + rowSpan > maxY)
599
+ maxY = y + rowSpan;
600
+ }
601
+ }
602
+ }
603
+ });
604
+ });
605
+
606
+ return {x : maxX, y : maxY};
607
+ };
608
+
609
+ function setEndCell(cell) {
610
+ var startX, startY, endX, endY, maxX, maxY, colSpan, rowSpan;
611
+
612
+ endPos = getPos(cell);
613
+
614
+ if (startPos && endPos) {
615
+ // Get start/end positions
616
+ startX = Math.min(startPos.x, endPos.x);
617
+ startY = Math.min(startPos.y, endPos.y);
618
+ endX = Math.max(startPos.x, endPos.x);
619
+ endY = Math.max(startPos.y, endPos.y);
620
+
621
+ // Expand end positon to include spans
622
+ maxX = endX;
623
+ maxY = endY;
624
+
625
+ // Expand startX
626
+ for (y = startY; y <= maxY; y++) {
627
+ cell = grid[y][startX];
628
+
629
+ if (!cell.real) {
630
+ if (startX - (cell.colspan - 1) < startX)
631
+ startX -= cell.colspan - 1;
632
+ }
633
+ }
634
+
635
+ // Expand startY
636
+ for (x = startX; x <= maxX; x++) {
637
+ cell = grid[startY][x];
638
+
639
+ if (!cell.real) {
640
+ if (startY - (cell.rowspan - 1) < startY)
641
+ startY -= cell.rowspan - 1;
642
+ }
643
+ }
644
+
645
+ // Find max X, Y
646
+ for (y = startY; y <= endY; y++) {
647
+ for (x = startX; x <= endX; x++) {
648
+ cell = grid[y][x];
649
+
650
+ if (cell.real) {
651
+ colSpan = cell.colspan - 1;
652
+ rowSpan = cell.rowspan - 1;
653
+
654
+ if (colSpan) {
655
+ if (x + colSpan > maxX)
656
+ maxX = x + colSpan;
657
+ }
658
+
659
+ if (rowSpan) {
660
+ if (y + rowSpan > maxY)
661
+ maxY = y + rowSpan;
662
+ }
663
+ }
664
+ }
665
+ }
666
+
667
+ // Remove current selection
668
+ dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected');
669
+
670
+ // Add new selection
671
+ for (y = startY; y <= maxY; y++) {
672
+ for (x = startX; x <= maxX; x++)
673
+ dom.addClass(grid[y][x].elm, 'mceSelected');
674
+ }
675
+ }
676
+ };
677
+
678
+ // Expose to public
679
+ tinymce.extend(this, {
680
+ deleteTable : deleteTable,
681
+ split : split,
682
+ merge : merge,
683
+ insertRow : insertRow,
684
+ insertCol : insertCol,
685
+ deleteCols : deleteCols,
686
+ deleteRows : deleteRows,
687
+ cutRows : cutRows,
688
+ copyRows : copyRows,
689
+ pasteRows : pasteRows,
690
+ getPos : getPos,
691
+ setStartCell : setStartCell,
692
+ setEndCell : setEndCell
693
+ });
694
+ };
695
+
696
+ tinymce.create('tinymce.plugins.TablePlugin', {
697
+ init : function(ed, url) {
698
+ var winMan, clipboardRows;
699
+
700
+ function createTableGrid(node) {
701
+ var selection = ed.selection, tblElm = ed.dom.getParent(node || selection.getNode(), 'table');
702
+
703
+ if (tblElm)
704
+ return new TableGrid(tblElm, ed.dom, selection);
705
+ };
706
+
707
+ function cleanup() {
708
+ // Restore selection possibilities
709
+ ed.getBody().style.webkitUserSelect = '';
710
+ ed.dom.removeClass(ed.dom.select('td.mceSelected,th.mceSelected'), 'mceSelected');
711
+ };
712
+
713
+ // Register buttons
714
+ each([
715
+ ['table', 'table.desc', 'mceInsertTable', true],
716
+ ['delete_table', 'table.del', 'mceTableDelete'],
717
+ ['delete_col', 'table.delete_col_desc', 'mceTableDeleteCol'],
718
+ ['delete_row', 'table.delete_row_desc', 'mceTableDeleteRow'],
719
+ ['col_after', 'table.col_after_desc', 'mceTableInsertColAfter'],
720
+ ['col_before', 'table.col_before_desc', 'mceTableInsertColBefore'],
721
+ ['row_after', 'table.row_after_desc', 'mceTableInsertRowAfter'],
722
+ ['row_before', 'table.row_before_desc', 'mceTableInsertRowBefore'],
723
+ ['row_props', 'table.row_desc', 'mceTableRowProps', true],
724
+ ['cell_props', 'table.cell_desc', 'mceTableCellProps', true],
725
+ ['split_cells', 'table.split_cells_desc', 'mceTableSplitCells', true],
726
+ ['merge_cells', 'table.merge_cells_desc', 'mceTableMergeCells', true]
727
+ ], function(c) {
728
+ ed.addButton(c[0], {title : c[1], cmd : c[2], ui : c[3]});
729
+ });
730
+
731
+ // Select whole table is a table border is clicked
732
+ if (!tinymce.isIE) {
733
+ ed.onClick.add(function(ed, e) {
734
+ e = e.target;
735
+
736
+ if (e.nodeName === 'TABLE')
737
+ ed.selection.select(e);
738
+ });
739
+ }
740
+
741
+ // Handle node change updates
742
+ ed.onNodeChange.add(function(ed, cm, n) {
743
+ var p;
744
+
745
+ n = ed.selection.getStart();
746
+ p = ed.dom.getParent(n, 'td,th,caption');
747
+ cm.setActive('table', n.nodeName === 'TABLE' || !!p);
748
+
749
+ // Disable table tools if we are in caption
750
+ if (p && p.nodeName === 'CAPTION')
751
+ p = 0;
752
+
753
+ cm.setDisabled('delete_table', !p);
754
+ cm.setDisabled('delete_col', !p);
755
+ cm.setDisabled('delete_table', !p);
756
+ cm.setDisabled('delete_row', !p);
757
+ cm.setDisabled('col_after', !p);
758
+ cm.setDisabled('col_before', !p);
759
+ cm.setDisabled('row_after', !p);
760
+ cm.setDisabled('row_before', !p);
761
+ cm.setDisabled('row_props', !p);
762
+ cm.setDisabled('cell_props', !p);
763
+ cm.setDisabled('split_cells', !p);
764
+ cm.setDisabled('merge_cells', !p);
765
+ });
766
+
767
+ ed.onInit.add(function(ed) {
768
+ var startTable, startCell, dom = ed.dom, tableGrid;
769
+
770
+ winMan = ed.windowManager;
771
+
772
+ // Add cell selection logic
773
+ ed.onMouseDown.add(function(ed, e) {
774
+ if (e.button != 2) {
775
+ cleanup();
776
+
777
+ startCell = dom.getParent(e.target, 'td,th');
778
+ startTable = dom.getParent(startCell, 'table');
779
+ }
780
+ });
781
+
782
+ dom.bind(ed.getDoc(), 'mouseover', function(e) {
783
+ var sel, table, target = e.target;
784
+
785
+ if (startCell && (tableGrid || target != startCell) && (target.nodeName == 'TD' || target.nodeName == 'TH')) {
786
+ table = dom.getParent(target, 'table');
787
+ if (table == startTable) {
788
+ if (!tableGrid) {
789
+ tableGrid = createTableGrid(table);
790
+ tableGrid.setStartCell(startCell);
791
+
792
+ ed.getBody().style.webkitUserSelect = 'none';
793
+ }
794
+
795
+ tableGrid.setEndCell(target);
796
+ }
797
+
798
+ // Remove current selection
799
+ sel = ed.selection.getSel();
800
+
801
+ if (sel.removeAllRanges)
802
+ sel.removeAllRanges();
803
+ else
804
+ sel.empty();
805
+
806
+ e.preventDefault();
807
+ }
808
+ });
809
+
810
+ ed.onMouseUp.add(function(ed, e) {
811
+ var rng, sel = ed.selection, selectedCells, nativeSel = sel.getSel(), walker, node, lastNode, endNode;
812
+
813
+ // Move selection to startCell
814
+ if (startCell) {
815
+ if (tableGrid)
816
+ ed.getBody().style.webkitUserSelect = '';
817
+
818
+ function setPoint(node, start) {
819
+ var walker = new tinymce.dom.TreeWalker(node, node);
820
+
821
+ do {
822
+ // Text node
823
+ if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) {
824
+ if (start)
825
+ rng.setStart(node, 0);
826
+ else
827
+ rng.setEnd(node, node.nodeValue.length);
828
+
829
+ return;
830
+ }
831
+
832
+ // BR element
833
+ if (node.nodeName == 'BR') {
834
+ if (start)
835
+ rng.setStartBefore(node);
836
+ else
837
+ rng.setEndBefore(node);
838
+
839
+ return;
840
+ }
841
+ } while (node = (start ? walker.next() : walker.prev()));
842
+ };
843
+
844
+ // Try to expand text selection as much as we can only Gecko supports cell selection
845
+ selectedCells = dom.select('td.mceSelected,th.mceSelected');
846
+ if (selectedCells.length > 0) {
847
+ rng = dom.createRng();
848
+ node = selectedCells[0];
849
+ endNode = selectedCells[selectedCells.length - 1];
850
+
851
+ setPoint(node, 1);
852
+ walker = new tinymce.dom.TreeWalker(node, dom.getParent(selectedCells[0], 'table'));
853
+
854
+ do {
855
+ if (node.nodeName == 'TD' || node.nodeName == 'TH') {
856
+ if (!dom.hasClass(node, 'mceSelected'))
857
+ break;
858
+
859
+ lastNode = node;
860
+ }
861
+ } while (node = walker.next());
862
+
863
+ setPoint(lastNode);
864
+
865
+ sel.setRng(rng);
866
+ }
867
+
868
+ ed.nodeChanged();
869
+ startCell = tableGrid = startTable = null;
870
+ }
871
+ });
872
+
873
+ ed.onKeyUp.add(function(ed, e) {
874
+ cleanup();
875
+ });
876
+
877
+ // Add context menu
878
+ if (ed && ed.plugins.contextmenu) {
879
+ ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) {
880
+ var sm, se = ed.selection, el = se.getNode() || ed.getBody();
881
+
882
+ if (ed.dom.getParent(e, 'td') || ed.dom.getParent(e, 'th')) {
883
+ m.removeAll();
884
+
885
+ if (el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) {
886
+ m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true});
887
+ m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'});
888
+ m.addSeparator();
889
+ }
890
+
891
+ if (el.nodeName == 'IMG' && el.className.indexOf('mceItem') == -1) {
892
+ m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true});
893
+ m.addSeparator();
894
+ }
895
+
896
+ m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', value : {action : 'insert'}});
897
+ m.add({title : 'table.props_desc', icon : 'table_props', cmd : 'mceInsertTable'});
898
+ m.add({title : 'table.del', icon : 'delete_table', cmd : 'mceTableDelete'});
899
+ m.addSeparator();
900
+
901
+ // Cell menu
902
+ sm = m.addMenu({title : 'table.cell'});
903
+ sm.add({title : 'table.cell_desc', icon : 'cell_props', cmd : 'mceTableCellProps'});
904
+ sm.add({title : 'table.split_cells_desc', icon : 'split_cells', cmd : 'mceTableSplitCells'});
905
+ sm.add({title : 'table.merge_cells_desc', icon : 'merge_cells', cmd : 'mceTableMergeCells'});
906
+
907
+ // Row menu
908
+ sm = m.addMenu({title : 'table.row'});
909
+ sm.add({title : 'table.row_desc', icon : 'row_props', cmd : 'mceTableRowProps'});
910
+ sm.add({title : 'table.row_before_desc', icon : 'row_before', cmd : 'mceTableInsertRowBefore'});
911
+ sm.add({title : 'table.row_after_desc', icon : 'row_after', cmd : 'mceTableInsertRowAfter'});
912
+ sm.add({title : 'table.delete_row_desc', icon : 'delete_row', cmd : 'mceTableDeleteRow'});
913
+ sm.addSeparator();
914
+ sm.add({title : 'table.cut_row_desc', icon : 'cut', cmd : 'mceTableCutRow'});
915
+ sm.add({title : 'table.copy_row_desc', icon : 'copy', cmd : 'mceTableCopyRow'});
916
+ sm.add({title : 'table.paste_row_before_desc', icon : 'paste', cmd : 'mceTablePasteRowBefore'}).setDisabled(!clipboardRows);
917
+ sm.add({title : 'table.paste_row_after_desc', icon : 'paste', cmd : 'mceTablePasteRowAfter'}).setDisabled(!clipboardRows);
918
+
919
+ // Column menu
920
+ sm = m.addMenu({title : 'table.col'});
921
+ sm.add({title : 'table.col_before_desc', icon : 'col_before', cmd : 'mceTableInsertColBefore'});
922
+ sm.add({title : 'table.col_after_desc', icon : 'col_after', cmd : 'mceTableInsertColAfter'});
923
+ sm.add({title : 'table.delete_col_desc', icon : 'delete_col', cmd : 'mceTableDeleteCol'});
924
+ } else
925
+ m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable'});
926
+ });
927
+ }
928
+
929
+ // Fixes an issue on Gecko where it's impossible to place the caret behind a table
930
+ // This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled
931
+ if (!tinymce.isIE) {
932
+ function fixTableCaretPos() {
933
+ var last;
934
+
935
+ // Skip empty text nodes form the end
936
+ for (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling) ;
937
+
938
+ if (last && last.nodeName == 'TABLE')
939
+ ed.dom.add(ed.getBody(), 'p', null, '<br mce_bogus="1" />');
940
+ };
941
+
942
+ // Fixes an bug where it's impossible to place the caret before a table in Gecko
943
+ // this fix solves it by detecting when the caret is at the beginning of such a table
944
+ // and then manually moves the caret infront of the table
945
+ if (tinymce.isGecko) {
946
+ ed.onKeyDown.add(function(ed, e) {
947
+ var rng, table, dom = ed.dom;
948
+
949
+ // On gecko it's not possible to place the caret before a table
950
+ if (e.keyCode == 37 || e.keyCode == 38) {
951
+ rng = ed.selection.getRng();
952
+ table = dom.getParent(rng.startContainer, 'table');
953
+
954
+ if (table && ed.getBody().firstChild == table) {
955
+ if (isAtStart(rng, table)) {
956
+ rng = dom.createRng();
957
+
958
+ rng.setStartBefore(table);
959
+ rng.setEndBefore(table);
960
+
961
+ ed.selection.setRng(rng);
962
+
963
+ e.preventDefault();
964
+ }
965
+ }
966
+ }
967
+ });
968
+ }
969
+
970
+ ed.onKeyUp.add(fixTableCaretPos);
971
+ ed.onSetContent.add(fixTableCaretPos);
972
+ ed.onVisualAid.add(fixTableCaretPos);
973
+
974
+ ed.onPreProcess.add(function(ed, o) {
975
+ var last = o.node.lastChild;
976
+
977
+ if (last && last.childNodes.length == 1 && last.firstChild.nodeName == 'BR')
978
+ ed.dom.remove(last);
979
+ });
980
+
981
+ fixTableCaretPos();
982
+ }
983
+ });
984
+
985
+ // Register action commands
986
+ each({
987
+ mceTableSplitCells : function(grid) {
988
+ grid.split();
989
+ },
990
+
991
+ mceTableMergeCells : function(grid) {
992
+ var rowSpan, colSpan, cell;
993
+
994
+ cell = ed.dom.getParent(ed.selection.getNode(), 'th,td');
995
+ if (cell) {
996
+ rowSpan = cell.rowSpan;
997
+ colSpan = cell.colSpan;
998
+ }
999
+
1000
+ if (!ed.dom.select('td.mceSelected,th.mceSelected').length) {
1001
+ winMan.open({
1002
+ url : url + '/merge_cells.htm',
1003
+ width : 240 + parseInt(ed.getLang('table.merge_cells_delta_width', 0)),
1004
+ height : 110 + parseInt(ed.getLang('table.merge_cells_delta_height', 0)),
1005
+ inline : 1
1006
+ }, {
1007
+ rows : rowSpan,
1008
+ cols : colSpan,
1009
+ onaction : function(data) {
1010
+ grid.merge(cell, data.cols, data.rows);
1011
+ },
1012
+ plugin_url : url
1013
+ });
1014
+ } else
1015
+ grid.merge();
1016
+ },
1017
+
1018
+ mceTableInsertRowBefore : function(grid) {
1019
+ grid.insertRow(true);
1020
+ },
1021
+
1022
+ mceTableInsertRowAfter : function(grid) {
1023
+ grid.insertRow();
1024
+ },
1025
+
1026
+ mceTableInsertColBefore : function(grid) {
1027
+ grid.insertCol(true);
1028
+ },
1029
+
1030
+ mceTableInsertColAfter : function(grid) {
1031
+ grid.insertCol();
1032
+ },
1033
+
1034
+ mceTableDeleteCol : function(grid) {
1035
+ grid.deleteCols();
1036
+ },
1037
+
1038
+ mceTableDeleteRow : function(grid) {
1039
+ grid.deleteRows();
1040
+ },
1041
+
1042
+ mceTableCutRow : function(grid) {
1043
+ clipboardRows = grid.cutRows();
1044
+ },
1045
+
1046
+ mceTableCopyRow : function(grid) {
1047
+ clipboardRows = grid.copyRows();
1048
+ },
1049
+
1050
+ mceTablePasteRowBefore : function(grid) {
1051
+ grid.pasteRows(clipboardRows, true);
1052
+ },
1053
+
1054
+ mceTablePasteRowAfter : function(grid) {
1055
+ grid.pasteRows(clipboardRows);
1056
+ },
1057
+
1058
+ mceTableDelete : function(grid) {
1059
+ grid.deleteTable();
1060
+ }
1061
+ }, function(func, name) {
1062
+ ed.addCommand(name, function() {
1063
+ var grid = createTableGrid();
1064
+
1065
+ if (grid) {
1066
+ func(grid);
1067
+ ed.execCommand('mceRepaint');
1068
+ cleanup();
1069
+ }
1070
+ });
1071
+ });
1072
+
1073
+ // Register dialog commands
1074
+ each({
1075
+ mceInsertTable : function(val) {
1076
+ winMan.open({
1077
+ url : url + '/table.htm',
1078
+ width : 400 + parseInt(ed.getLang('table.table_delta_width', 0)),
1079
+ height : 320 + parseInt(ed.getLang('table.table_delta_height', 0)),
1080
+ inline : 1
1081
+ }, {
1082
+ plugin_url : url,
1083
+ action : val ? val.action : 0
1084
+ });
1085
+ },
1086
+
1087
+ mceTableRowProps : function() {
1088
+ winMan.open({
1089
+ url : url + '/row.htm',
1090
+ width : 400 + parseInt(ed.getLang('table.rowprops_delta_width', 0)),
1091
+ height : 295 + parseInt(ed.getLang('table.rowprops_delta_height', 0)),
1092
+ inline : 1
1093
+ }, {
1094
+ plugin_url : url
1095
+ });
1096
+ },
1097
+
1098
+ mceTableCellProps : function() {
1099
+ winMan.open({
1100
+ url : url + '/cell.htm',
1101
+ width : 400 + parseInt(ed.getLang('table.cellprops_delta_width', 0)),
1102
+ height : 295 + parseInt(ed.getLang('table.cellprops_delta_height', 0)),
1103
+ inline : 1
1104
+ }, {
1105
+ plugin_url : url
1106
+ });
1107
+ }
1108
+ }, function(func, name) {
1109
+ ed.addCommand(name, function(ui, val) {
1110
+ func(val);
1111
+ });
1112
+ });
1113
+ }
1114
+ });
1115
+
1116
+ // Register plugin
1117
+ tinymce.PluginManager.add('table', tinymce.plugins.TablePlugin);
1118
+ })(tinymce);
tiny_mce/plugins/table/js/cell.js CHANGED
@@ -11,7 +11,7 @@ function init() {
11
  document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor')
12
 
13
  var inst = ed;
14
- var tdElm = ed.dom.getParent(ed.selection.getNode(), "td,th");
15
  var formObj = document.forms[0];
16
  var st = ed.dom.parseStyle(ed.dom.getAttrib(tdElm, "style"));
17
 
@@ -34,38 +34,55 @@ function init() {
34
  addClassesToList('class', 'table_cell_styles');
35
  TinyMCE_EditableSelects.init();
36
 
37
- formObj.bordercolor.value = bordercolor;
38
- formObj.bgcolor.value = bgcolor;
39
- formObj.backgroundimage.value = backgroundimage;
40
- formObj.width.value = width;
41
- formObj.height.value = height;
42
- formObj.id.value = id;
43
- formObj.lang.value = lang;
44
- formObj.style.value = ed.dom.serializeStyle(st);
45
- selectByValue(formObj, 'align', align);
46
- selectByValue(formObj, 'valign', valign);
47
- selectByValue(formObj, 'class', className, true, true);
48
- selectByValue(formObj, 'celltype', celltype);
49
- selectByValue(formObj, 'dir', dir);
50
- selectByValue(formObj, 'scope', scope);
51
-
52
- // Resize some elements
53
- if (isVisible('backgroundimagebrowser'))
54
- document.getElementById('backgroundimage').style.width = '180px';
55
-
56
- updateColor('bordercolor_pick', 'bordercolor');
57
- updateColor('bgcolor_pick', 'bgcolor');
 
 
 
58
  }
59
 
60
  function updateAction() {
61
  var el, inst = ed, tdElm, trElm, tableElm, formObj = document.forms[0];
62
 
63
  tinyMCEPopup.restoreSelection();
64
- el = ed.selection.getNode();
65
  tdElm = ed.dom.getParent(el, "td,th");
66
  trElm = ed.dom.getParent(el, "tr");
67
  tableElm = ed.dom.getParent(el, "table");
68
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  ed.execCommand('mceBeginUndoLevel');
70
 
71
  switch (getSelectValue(formObj, 'action')) {
11
  document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor')
12
 
13
  var inst = ed;
14
+ var tdElm = ed.dom.getParent(ed.selection.getStart(), "td,th");
15
  var formObj = document.forms[0];
16
  var st = ed.dom.parseStyle(ed.dom.getAttrib(tdElm, "style"));
17
 
34
  addClassesToList('class', 'table_cell_styles');
35
  TinyMCE_EditableSelects.init();
36
 
37
+ if (!ed.dom.hasClass(tdElm, 'mceSelected')) {
38
+ formObj.bordercolor.value = bordercolor;
39
+ formObj.bgcolor.value = bgcolor;
40
+ formObj.backgroundimage.value = backgroundimage;
41
+ formObj.width.value = width;
42
+ formObj.height.value = height;
43
+ formObj.id.value = id;
44
+ formObj.lang.value = lang;
45
+ formObj.style.value = ed.dom.serializeStyle(st);
46
+ selectByValue(formObj, 'align', align);
47
+ selectByValue(formObj, 'valign', valign);
48
+ selectByValue(formObj, 'class', className, true, true);
49
+ selectByValue(formObj, 'celltype', celltype);
50
+ selectByValue(formObj, 'dir', dir);
51
+ selectByValue(formObj, 'scope', scope);
52
+
53
+ // Resize some elements
54
+ if (isVisible('backgroundimagebrowser'))
55
+ document.getElementById('backgroundimage').style.width = '180px';
56
+
57
+ updateColor('bordercolor_pick', 'bordercolor');
58
+ updateColor('bgcolor_pick', 'bgcolor');
59
+ } else
60
+ tinyMCEPopup.dom.hide('action');
61
  }
62
 
63
  function updateAction() {
64
  var el, inst = ed, tdElm, trElm, tableElm, formObj = document.forms[0];
65
 
66
  tinyMCEPopup.restoreSelection();
67
+ el = ed.selection.getStart();
68
  tdElm = ed.dom.getParent(el, "td,th");
69
  trElm = ed.dom.getParent(el, "tr");
70
  tableElm = ed.dom.getParent(el, "table");
71
 
72
+ // Cell is selected
73
+ if (ed.dom.hasClass(tdElm, 'mceSelected')) {
74
+ // Update all selected sells
75
+ tinymce.each(ed.dom.select('td.mceSelected,th.mceSelected'), function(td) {
76
+ updateCell(td);
77
+ });
78
+
79
+ ed.addVisual();
80
+ ed.nodeChanged();
81
+ inst.execCommand('mceEndUndoLevel');
82
+ tinyMCEPopup.close();
83
+ return;
84
+ }
85
+
86
  ed.execCommand('mceBeginUndoLevel');
87
 
88
  switch (getSelectValue(formObj, 'action')) {
tiny_mce/plugins/table/js/merge_cells.js CHANGED
@@ -1,29 +1,27 @@
1
  tinyMCEPopup.requireLangPack();
2
 
3
- function init() {
4
- var f = document.forms[0], v;
 
5
 
6
- tinyMCEPopup.resizeToInnerSize();
 
 
7
 
8
- f.numcols.value = tinyMCEPopup.getWindowArg('numcols', 1);
9
- f.numrows.value = tinyMCEPopup.getWindowArg('numrows', 1);
10
- }
11
 
12
- function mergeCells() {
13
- var args = [], f = document.forms[0];
14
 
15
- tinyMCEPopup.restoreSelection();
16
 
17
- if (!AutoValidator.validate(f)) {
18
- tinyMCEPopup.alert(tinyMCEPopup.getLang('invalid_data'));
19
- return false;
20
- }
21
-
22
- args["numcols"] = f.numcols.value;
23
- args["numrows"] = f.numrows.value;
24
 
25
- tinyMCEPopup.execCommand("mceTableMergeCells", false, args);
26
- tinyMCEPopup.close();
27
- }
28
 
29
- tinyMCEPopup.onInit.add(init);
1
  tinyMCEPopup.requireLangPack();
2
 
3
+ var MergeCellsDialog = {
4
+ init : function() {
5
+ var f = document.forms[0];
6
 
7
+ f.numcols.value = tinyMCEPopup.getWindowArg('cols', 1);
8
+ f.numrows.value = tinyMCEPopup.getWindowArg('rows', 1);
9
+ },
10
 
11
+ merge : function() {
12
+ var func, f = document.forms[0];
 
13
 
14
+ tinyMCEPopup.restoreSelection();
 
15
 
16
+ func = tinyMCEPopup.getWindowArg('onaction');
17
 
18
+ func({
19
+ cols : f.numcols.value,
20
+ rows : f.numrows.value
21
+ });
 
 
 
22
 
23
+ tinyMCEPopup.close();
24
+ }
25
+ };
26
 
27
+ tinyMCEPopup.onInit.add(MergeCellsDialog.init, MergeCellsDialog);
tiny_mce/plugins/table/js/row.js CHANGED
@@ -8,7 +8,7 @@ function init() {
8
 
9
  var inst = tinyMCEPopup.editor;
10
  var dom = inst.dom;
11
- var trElm = dom.getParent(inst.selection.getNode(), "tr");
12
  var formObj = document.forms[0];
13
  var st = dom.parseStyle(dom.getAttrib(trElm, "style"));
14
 
@@ -24,27 +24,32 @@ function init() {
24
  var lang = dom.getAttrib(trElm, 'lang');
25
  var dir = dom.getAttrib(trElm, 'dir');
26
 
27
- // Setup form
28
- addClassesToList('class', 'table_row_styles');
29
- TinyMCE_EditableSelects.init();
30
-
31
- formObj.bgcolor.value = bgcolor;
32
- formObj.backgroundimage.value = backgroundimage;
33
- formObj.height.value = height;
34
- formObj.id.value = id;
35
- formObj.lang.value = lang;
36
- formObj.style.value = dom.serializeStyle(st);
37
- selectByValue(formObj, 'align', align);
38
- selectByValue(formObj, 'valign', valign);
39
- selectByValue(formObj, 'class', className, true, true);
40
  selectByValue(formObj, 'rowtype', rowtype);
41
- selectByValue(formObj, 'dir', dir);
42
-
43
- // Resize some elements
44
- if (isVisible('backgroundimagebrowser'))
45
- document.getElementById('backgroundimage').style.width = '180px';
46
 
47
- updateColor('bgcolor_pick', 'bgcolor');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  }
49
 
50
  function updateAction() {
@@ -52,8 +57,28 @@ function updateAction() {
52
  var action = getSelectValue(formObj, 'action');
53
 
54
  tinyMCEPopup.restoreSelection();
55
- trElm = dom.getParent(inst.selection.getNode(), "tr");
56
- tableElm = dom.getParent(inst.selection.getNode(), "table");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
 
58
  inst.execCommand('mceBeginUndoLevel');
59
 
8
 
9
  var inst = tinyMCEPopup.editor;
10
  var dom = inst.dom;
11
+ var trElm = dom.getParent(inst.selection.getStart(), "tr");
12
  var formObj = document.forms[0];
13
  var st = dom.parseStyle(dom.getAttrib(trElm, "style"));
14
 
24
  var lang = dom.getAttrib(trElm, 'lang');
25
  var dir = dom.getAttrib(trElm, 'dir');
26
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  selectByValue(formObj, 'rowtype', rowtype);
 
 
 
 
 
28
 
29
+ // Any cells selected
30
+ if (dom.select('td.mceSelected,th.mceSelected', trElm).length == 0) {
31
+ // Setup form
32
+ addClassesToList('class', 'table_row_styles');
33
+ TinyMCE_EditableSelects.init();
34
+
35
+ formObj.bgcolor.value = bgcolor;
36
+ formObj.backgroundimage.value = backgroundimage;
37
+ formObj.height.value = height;
38
+ formObj.id.value = id;
39
+ formObj.lang.value = lang;
40
+ formObj.style.value = dom.serializeStyle(st);
41
+ selectByValue(formObj, 'align', align);
42
+ selectByValue(formObj, 'valign', valign);
43
+ selectByValue(formObj, 'class', className, true, true);
44
+ selectByValue(formObj, 'dir', dir);
45
+
46
+ // Resize some elements
47
+ if (isVisible('backgroundimagebrowser'))
48
+ document.getElementById('backgroundimage').style.width = '180px';
49
+
50
+ updateColor('bgcolor_pick', 'bgcolor');
51
+ } else
52
+ tinyMCEPopup.dom.hide('action');
53
  }
54
 
55
  function updateAction() {
57
  var action = getSelectValue(formObj, 'action');
58
 
59
  tinyMCEPopup.restoreSelection();
60
+ trElm = dom.getParent(inst.selection.getStart(), "tr");
61
+ tableElm = dom.getParent(inst.selection.getStart(), "table");
62
+
63
+ // Update all selected rows
64
+ if (dom.select('td.mceSelected,th.mceSelected', trElm).length > 0) {
65
+ tinymce.each(tableElm.rows, function(tr) {
66
+ var i;
67
+
68
+ for (i = 0; i < tr.cells.length; i++) {
69
+ if (dom.hasClass(tr.cells[i], 'mceSelected')) {
70
+ updateRow(tr, true);
71
+ return;
72
+ }
73
+ }
74
+ });
75
+
76
+ inst.addVisual();
77
+ inst.nodeChanged();
78
+ inst.execCommand('mceEndUndoLevel');
79
+ tinyMCEPopup.close();
80
+ return;
81
+ }
82
 
83
  inst.execCommand('mceBeginUndoLevel');
84
 
tiny_mce/plugins/table/js/table.js CHANGED
@@ -24,14 +24,14 @@ function insertTable() {
24
  border = formObj.elements['border'].value != "" ? formObj.elements['border'].value : 0;
25
  cellpadding = formObj.elements['cellpadding'].value != "" ? formObj.elements['cellpadding'].value : "";
26
  cellspacing = formObj.elements['cellspacing'].value != "" ? formObj.elements['cellspacing'].value : "";
27
- align = formObj.elements['align'].options[formObj.elements['align'].selectedIndex].value;
28
- frame = formObj.elements['frame'].options[formObj.elements['frame'].selectedIndex].value;
29
- rules = formObj.elements['rules'].options[formObj.elements['rules'].selectedIndex].value;
30
  width = formObj.elements['width'].value;
31
  height = formObj.elements['height'].value;
32
  bordercolor = formObj.elements['bordercolor'].value;
33
  bgcolor = formObj.elements['bgcolor'].value;
34
- className = formObj.elements['class'].options[formObj.elements['class'].selectedIndex].value;
35
  id = formObj.elements['id'].value;
36
  summary = formObj.elements['summary'].value;
37
  style = formObj.elements['style'].value;
@@ -82,7 +82,7 @@ function insertTable() {
82
  capEl = elm.ownerDocument.createElement('caption');
83
 
84
  if (!tinymce.isIE)
85
- capEl.innerHTML = '<br mce_bogus="1"/>';
86
 
87
  elm.insertBefore(capEl, elm.firstChild);
88
  }
@@ -151,6 +151,7 @@ function insertTable() {
151
  html += makeAttrib('border', border);
152
  html += makeAttrib('cellpadding', cellpadding);
153
  html += makeAttrib('cellspacing', cellspacing);
 
154
 
155
  if (width && inst.settings.inline_styles) {
156
  if (style)
@@ -186,7 +187,7 @@ function insertTable() {
186
 
187
  if (caption) {
188
  if (!tinymce.isIE)
189
- html += '<caption><br mce_bogus="1"/></caption>';
190
  else
191
  html += '<caption></caption>';
192
  }
@@ -196,7 +197,7 @@ function insertTable() {
196
 
197
  for (var x=0; x<cols; x++) {
198
  if (!tinymce.isIE)
199
- html += '<td><br mce_bogus="1"/></td>';
200
  else
201
  html += '<td></td>';
202
  }
@@ -210,9 +211,10 @@ function insertTable() {
210
 
211
  // Move table
212
  if (inst.settings.fix_table_elements) {
213
- var bm = inst.selection.getBookmark(), patt = '';
214
 
215
- inst.execCommand('mceInsertContent', false, '<br class="_mce_marker" />');
 
216
 
217
  tinymce.each('h1,h2,h3,h4,h5,h6,p'.split(','), function(n) {
218
  if (patt)
@@ -225,12 +227,19 @@ function insertTable() {
225
  inst.dom.split(inst.dom.getParent(n, 'h1,h2,h3,h4,h5,h6,p'), n);
226
  });
227
 
228
- dom.setOuterHTML(dom.select('._mce_marker')[0], html);
229
-
230
- inst.selection.moveToBookmark(bm);
231
  } else
232
  inst.execCommand('mceInsertContent', false, html);
233
 
 
 
 
 
 
 
 
 
 
234
  inst.addVisual();
235
  inst.execCommand('mceEndUndoLevel');
236
 
@@ -322,7 +331,7 @@ function init() {
322
 
323
  // Update form
324
  selectByValue(formObj, 'align', align);
325
- selectByValue(formObj, 'frame', frame);
326
  selectByValue(formObj, 'rules', rules);
327
  selectByValue(formObj, 'class', className, true, true);
328
  formObj.cols.value = cols;
24
  border = formObj.elements['border'].value != "" ? formObj.elements['border'].value : 0;
25
  cellpadding = formObj.elements['cellpadding'].value != "" ? formObj.elements['cellpadding'].value : "";
26
  cellspacing = formObj.elements['cellspacing'].value != "" ? formObj.elements['cellspacing'].value : "";
27
+ align = getSelectValue(formObj, "align");
28
+ frame = getSelectValue(formObj, "tframe");
29
+ rules = getSelectValue(formObj, "rules");
30
  width = formObj.elements['width'].value;
31
  height = formObj.elements['height'].value;
32
  bordercolor = formObj.elements['bordercolor'].value;
33
  bgcolor = formObj.elements['bgcolor'].value;
34
+ className = getSelectValue(formObj, "class");
35
  id = formObj.elements['id'].value;
36
  summary = formObj.elements['summary'].value;
37
  style = formObj.elements['style'].value;
82
  capEl = elm.ownerDocument.createElement('caption');
83
 
84
  if (!tinymce.isIE)
85
+ capEl.innerHTML = '<br _mce_bogus="1"/>';
86
 
87
  elm.insertBefore(capEl, elm.firstChild);
88
  }
151
  html += makeAttrib('border', border);
152
  html += makeAttrib('cellpadding', cellpadding);
153
  html += makeAttrib('cellspacing', cellspacing);
154
+ html += makeAttrib('_mce_new', '1');
155
 
156
  if (width && inst.settings.inline_styles) {
157
  if (style)
187
 
188
  if (caption) {
189
  if (!tinymce.isIE)
190
+ html += '<caption><br _mce_bogus="1"/></caption>';
191
  else
192
  html += '<caption></caption>';
193
  }
197
 
198
  for (var x=0; x<cols; x++) {
199
  if (!tinymce.isIE)
200
+ html += '<td><br _mce_bogus="1"/></td>';
201
  else
202
  html += '<td></td>';
203
  }
211
 
212
  // Move table
213
  if (inst.settings.fix_table_elements) {
214
+ var patt = '';
215
 
216
+ inst.focus();
217
+ inst.selection.setContent('<br class="_mce_marker" />');
218
 
219
  tinymce.each('h1,h2,h3,h4,h5,h6,p'.split(','), function(n) {
220
  if (patt)
227
  inst.dom.split(inst.dom.getParent(n, 'h1,h2,h3,h4,h5,h6,p'), n);
228
  });
229
 
230
+ dom.setOuterHTML(dom.select('br._mce_marker')[0], html);
 
 
231
  } else
232
  inst.execCommand('mceInsertContent', false, html);
233
 
234
+ tinymce.each(dom.select('table[_mce_new]'), function(node) {
235
+ var td = dom.select('td', node);
236
+
237
+ inst.selection.select(td[0], true);
238
+ inst.selection.collapse();
239
+
240
+ dom.setAttrib(node, '_mce_new', '');
241
+ });
242
+
243
  inst.addVisual();
244
  inst.execCommand('mceEndUndoLevel');
245
 
331
 
332
  // Update form
333
  selectByValue(formObj, 'align', align);
334
+ selectByValue(formObj, 'tframe', frame);
335
  selectByValue(formObj, 'rules', rules);
336
  selectByValue(formObj, 'class', className, true, true);
337
  formObj.cols.value = cols;
tiny_mce/plugins/table/merge_cells.htm CHANGED
@@ -8,7 +8,7 @@
8
  <script type="text/javascript" src="js/merge_cells.js"></script>
9
  </head>
10
  <body style="margin: 8px">
11
- <form onsubmit="mergeCells();return false;" action="#">
12
  <fieldset>
13
  <legend>{#table_dlg.merge_cells_title}</legend>
14
  <table border="0" cellpadding="0" cellspacing="3" width="100%">
@@ -24,13 +24,8 @@
24
  </fieldset>
25
 
26
  <div class="mceActionPanel">
27
- <div style="float: left">
28
- <input type="submit" id="insert" name="insert" value="{#update}" />
29
- </div>
30
-
31
- <div style="float: right">
32
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
33
- </div>
34
  </div>
35
  </form>
36
  </body>
8
  <script type="text/javascript" src="js/merge_cells.js"></script>
9
  </head>
10
  <body style="margin: 8px">
11
+ <form onsubmit="MergeCellsDialog.merge();return false;" action="#">
12
  <fieldset>
13
  <legend>{#table_dlg.merge_cells_title}</legend>
14
  <table border="0" cellpadding="0" cellspacing="3" width="100%">
24
  </fieldset>
25
 
26
  <div class="mceActionPanel">
27
+ <input type="submit" id="insert" name="insert" value="{#update}" />
28
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
 
 
 
 
 
29
  </div>
30
  </form>
31
  </body>
tiny_mce/plugins/table/row.htm CHANGED
@@ -147,13 +147,8 @@
147
  </select>
148
  </div>
149
 
150
- <div style="float: left">
151
- <div><input type="submit" id="insert" name="insert" value="{#update}" /></div>
152
- </div>
153
-
154
- <div style="float: right">
155
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
156
- </div>
157
  </div>
158
  </form>
159
  </body>
147
  </select>
148
  </div>
149
 
150
+ <input type="submit" id="insert" name="insert" value="{#update}" />
151
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
 
 
 
 
 
152
  </div>
153
  </form>
154
  </body>
tiny_mce/plugins/table/table.htm CHANGED
@@ -108,9 +108,9 @@
108
  </tr>
109
 
110
  <tr>
111
- <td class="column1"><label for="frame">{#table_dlg.frame}</label></td>
112
  <td>
113
- <select id="frame" name="frame" class="advfield">
114
  <option value="">{#not_set}</option>
115
  <option value="void">{#table_dlg.rules_void}</option>
116
  <option value="above">{#table_dlg.rules_above}</option>
@@ -179,13 +179,8 @@
179
  </div>
180
 
181
  <div class="mceActionPanel">
182
- <div style="float: left">
183
- <input type="submit" id="insert" name="insert" value="{#insert}" />
184
- </div>
185
-
186
- <div style="float: right">
187
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
188
- </div>
189
  </div>
190
  </form>
191
  </body>
108
  </tr>
109
 
110
  <tr>
111
+ <td class="column1"><label for="tframe">{#table_dlg.frame}</label></td>
112
  <td>
113
+ <select id="tframe" name="tframe" class="advfield">
114
  <option value="">{#not_set}</option>
115
  <option value="void">{#table_dlg.rules_void}</option>
116
  <option value="above">{#table_dlg.rules_above}</option>
179
  </div>
180
 
181
  <div class="mceActionPanel">
182
+ <input type="submit" id="insert" name="insert" value="{#insert}" />
183
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
 
 
 
 
 
184
  </div>
185
  </form>
186
  </body>
tiny_mce/themes/advanced/about.htm CHANGED
@@ -48,9 +48,7 @@
48
  </div>
49
 
50
  <div class="mceActionPanel">
51
- <div style="float: right">
52
- <input type="button" id="cancel" name="cancel" value="{#close}" onclick="tinyMCEPopup.close();" />
53
- </div>
54
  </div>
55
  </body>
56
  </html>
48
  </div>
49
 
50
  <div class="mceActionPanel">
51
+ <input type="button" id="cancel" name="cancel" value="{#close}" onclick="tinyMCEPopup.close();" />
 
 
52
  </div>
53
  </body>
54
  </html>
tiny_mce/themes/advanced/anchor.htm CHANGED
@@ -18,13 +18,8 @@
18
  </table>
19
 
20
  <div class="mceActionPanel">
21
- <div style="float: left">
22
- <input type="submit" id="insert" name="insert" value="{#update}" />
23
- </div>
24
-
25
- <div style="float: right">
26
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
27
- </div>
28
  </div>
29
  </form>
30
  </body>
18
  </table>
19
 
20
  <div class="mceActionPanel">
21
+ <input type="submit" id="insert" name="insert" value="{#update}" />
22
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
 
 
 
 
 
23
  </div>
24
  </form>
25
  </body>
tiny_mce/themes/advanced/color_picker.htm CHANGED
@@ -60,9 +60,7 @@
60
  </div>
61
 
62
  <div class="mceActionPanel">
63
- <div style="float: left">
64
- <input type="submit" id="insert" name="insert" value="{#apply}" />
65
- </div>
66
 
67
  <div id="preview"></div>
68
 
60
  </div>
61
 
62
  <div class="mceActionPanel">
63
+ <input type="submit" id="insert" name="insert" value="{#apply}" />
 
 
64
 
65
  <div id="preview"></div>
66
 
tiny_mce/themes/advanced/editor_template.js CHANGED
@@ -1 +1 @@
1
- (function(e){var d=e.DOM,b=e.dom.Event,h=e.extend,f=e.each,a=e.util.Cookie,g,c=e.explode;e.ThemeManager.requireLangPack("advanced");e.create("tinymce.themes.AdvancedTheme",{sizes:[8,10,12,14,18,24,36],controls:{bold:["bold_desc","Bold"],italic:["italic_desc","Italic"],underline:["underline_desc","Underline"],strikethrough:["striketrough_desc","Strikethrough"],justifyleft:["justifyleft_desc","JustifyLeft"],justifycenter:["justifycenter_desc","JustifyCenter"],justifyright:["justifyright_desc","JustifyRight"],justifyfull:["justifyfull_desc","JustifyFull"],bullist:["bullist_desc","InsertUnorderedList"],numlist:["numlist_desc","InsertOrderedList"],outdent:["outdent_desc","Outdent"],indent:["indent_desc","Indent"],cut:["cut_desc","Cut"],copy:["copy_desc","Copy"],paste:["paste_desc","Paste"],undo:["undo_desc","Undo"],redo:["redo_desc","Redo"],link:["link_desc","mceLink"],unlink:["unlink_desc","unlink"],image:["image_desc","mceImage"],cleanup:["cleanup_desc","mceCleanup"],help:["help_desc","mceHelp"],code:["code_desc","mceCodeEditor"],hr:["hr_desc","InsertHorizontalRule"],removeformat:["removeformat_desc","RemoveFormat"],sub:["sub_desc","subscript"],sup:["sup_desc","superscript"],forecolor:["forecolor_desc","ForeColor"],forecolorpicker:["forecolor_desc","mceForeColor"],backcolor:["backcolor_desc","HiliteColor"],backcolorpicker:["backcolor_desc","mceBackColor"],charmap:["charmap_desc","mceCharMap"],visualaid:["visualaid_desc","mceToggleVisualAid"],anchor:["anchor_desc","mceInsertAnchor"],newdocument:["newdocument_desc","mceNewDocument"],blockquote:["blockquote_desc","mceBlockQuote"]},stateControls:["bold","italic","underline","strikethrough","bullist","numlist","justifyleft","justifycenter","justifyright","justifyfull","sub","sup","blockquote"],init:function(j,k){var l=this,m,i,n;l.editor=j;l.url=k;l.onResolveName=new e.util.Dispatcher(this);l.settings=m=h({theme_advanced_path:true,theme_advanced_toolbar_location:"bottom",theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"center",theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1,theme_advanced_font_sizes:"1,2,3,4,5,6,7",readonly:j.settings.readonly},j.settings);if(!m.font_size_style_values){m.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt"}if(e.is(m.theme_advanced_font_sizes,"string")){m.font_size_style_values=e.explode(m.font_size_style_values);m.font_size_classes=e.explode(m.font_size_classes||"");n={};j.settings.theme_advanced_font_sizes=m.theme_advanced_font_sizes;f(j.getParam("theme_advanced_font_sizes","","hash"),function(q,p){var o;if(p==q&&q>=1&&q<=7){p=q+" ("+l.sizes[q-1]+"pt)";o=m.font_size_classes[q-1];q=m.font_size_style_values[q-1]||(l.sizes[q-1]+"pt")}if(/^\s*\./.test(q)){o=q.replace(/\./g,"")}n[p]=o?{"class":o}:{fontSize:q}});m.theme_advanced_font_sizes=n}if((i=m.theme_advanced_path_location)&&i!="none"){m.theme_advanced_statusbar_location=m.theme_advanced_path_location}if(m.theme_advanced_statusbar_location=="none"){m.theme_advanced_statusbar_location=0}j.onInit.add(function(){if(!j.settings.readonly){j.onNodeChange.add(l._nodeChanged,l)}if(j.settings.content_css!==false){j.dom.loadCSS(j.baseURI.toAbsolute("themes/advanced/skins/"+j.settings.skin+"/content.css"))}});j.onSetProgressState.add(function(q,o,r){var s,t=q.id,p;if(o){l.progressTimer=setTimeout(function(){s=q.getContainer();s=s.insertBefore(d.create("DIV",{style:"position:relative"}),s.firstChild);p=d.get(q.id+"_tbl");d.add(s,"div",{id:t+"_blocker","class":"mceBlocker",style:{width:p.clientWidth+2,height:p.clientHeight+2}});d.add(s,"div",{id:t+"_progress","class":"mceProgress",style:{left:p.clientWidth/2,top:p.clientHeight/2}})},r||0)}else{d.remove(t+"_blocker");d.remove(t+"_progress");clearTimeout(l.progressTimer)}});d.loadCSS(m.editor_css?j.documentBaseURI.toAbsolute(m.editor_css):k+"/skins/"+j.settings.skin+"/ui.css");if(m.skin_variant){d.loadCSS(k+"/skins/"+j.settings.skin+"/ui_"+m.skin_variant+".css")}},createControl:function(l,i){var j,k;if(k=i.createControl(l)){return k}switch(l){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu()}if((j=this.controls[l])){return i.createButton(l,{title:"advanced."+j[0],cmd:j[1],ui:j[2],value:j[3]})}},execCommand:function(k,j,l){var i=this["_"+k];if(i){i.call(this,j,l);return true}return false},_importClasses:function(k){var i=this.editor,j=i.controlManager.get("styleselect");if(j.getLength()==0){f(i.dom.getClasses(),function(n,l){var m="style_"+l;i.formatter.register(m,{inline:"span",classes:n["class"]});j.add(n["class"],m)})}},_createStyleSelect:function(m){var k=this,i=k.editor,j=i.controlManager,l;l=j.createListBox("styleselect",{title:"advanced.style_select",onselect:function(n){i.focus();i.formatter.toggle(n);return false}});i.onInit.add(function(){var o=0,n=i.getParam("style_formats");if(n){f(n,function(p){var q,r=0;f(p,function(){r++});if(r>1){q=p.name=p.name||"style_"+(o++);i.formatter.register(q,p);l.add(p.title,q)}else{l.add(p.title)}})}else{f(i.getParam("theme_advanced_styles","","hash"),function(r,q){var p;if(r){p="style_"+(o++);i.formatter.register(p,{inline:"span",classes:r});l.add(k.editor.translate(q),p)}})}});if(l.getLength()==0){l.onPostRender.add(function(o,p){if(!l.NativeListBox){b.add(p.id+"_text","focus",k._importClasses,k);b.add(p.id+"_text","mousedown",k._importClasses,k);b.add(p.id+"_open","focus",k._importClasses,k);b.add(p.id+"_open","mousedown",k._importClasses,k)}else{b.add(p.id,"focus",k._importClasses,k)}})}return l},_createFontSelect:function(){var k,j=this,i=j.editor;k=i.controlManager.createListBox("fontselect",{title:"advanced.fontdefault",onselect:function(l){i.execCommand("FontName",false,l);return false}});if(k){f(i.getParam("theme_advanced_fonts",j.settings.theme_advanced_fonts,"hash"),function(m,l){k.add(i.translate(l),m,{style:m.indexOf("dings")==-1?"font-family:"+m:""})})}return k},_createFontSizeSelect:function(){var m=this,k=m.editor,n,l=0,j=[];n=k.controlManager.createListBox("fontsizeselect",{title:"advanced.font_size",onselect:function(i){if(i.fontSize){k.execCommand("FontSize",false,i.fontSize)}else{f(m.settings.theme_advanced_font_sizes,function(p,o){if(p["class"]){j.push(p["class"])}});k.editorCommands._applyInlineStyle("span",{"class":i["class"]},{check_classes:j})}return false}});if(n){f(m.settings.theme_advanced_font_sizes,function(o,i){var p=o.fontSize;if(p>=1&&p<=7){p=m.sizes[parseInt(p)-1]+"pt"}n.add(i,o,{style:"font-size:"+p,"class":"mceFontSize"+(l++)+(" "+(o["class"]||""))})})}return n},_createBlockFormats:function(){var k,i={p:"advanced.paragraph",address:"advanced.address",pre:"advanced.pre",h1:"advanced.h1",h2:"advanced.h2",h3:"advanced.h3",h4:"advanced.h4",h5:"advanced.h5",h6:"advanced.h6",div:"advanced.div",blockquote:"advanced.blockquote",code:"advanced.code",dt:"advanced.dt",dd:"advanced.dd",samp:"advanced.samp"},j=this;k=j.editor.controlManager.createListBox("formatselect",{title:"advanced.block",cmd:"FormatBlock"});if(k){f(j.editor.getParam("theme_advanced_blockformats",j.settings.theme_advanced_blockformats,"hash"),function(m,l){k.add(j.editor.translate(l!=m?l:i[m]),m,{"class":"mce_formatPreview mce_"+m})})}return k},_createForeColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_text_colors){l.colors=i}if(k.theme_advanced_default_foreground_color){l.default_color=k.theme_advanced_default_foreground_color}l.title="advanced.forecolor_desc";l.cmd="ForeColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("forecolor",l);return m},_createBackColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_background_colors){l.colors=i}if(k.theme_advanced_default_background_color){l.default_color=k.theme_advanced_default_background_color}l.title="advanced.backcolor_desc";l.cmd="HiliteColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("backcolor",l);return m},renderUI:function(k){var m,l,q,v=this,r=v.editor,w=v.settings,u,j,i;m=j=d.create("span",{id:r.id+"_parent","class":"mceEditor "+r.settings.skin+"Skin"+(w.skin_variant?" "+r.settings.skin+"Skin"+v._ufirst(w.skin_variant):"")});if(!d.boxModel){m=d.add(m,"div",{"class":"mceOldBoxModel"})}m=u=d.add(m,"table",{id:r.id+"_tbl","class":"mceLayout",cellSpacing:0,cellPadding:0});m=q=d.add(m,"tbody");switch((w.theme_advanced_layout_manager||"").toLowerCase()){case"rowlayout":l=v._rowLayout(w,q,k);break;case"customlayout":l=r.execCallback("theme_advanced_custom_layout",w,q,k,j);break;default:l=v._simpleLayout(w,q,k,j)}m=k.targetNode;i=d.stdMode?u.getElementsByTagName("tr"):u.rows;d.addClass(i[0],"mceFirst");d.addClass(i[i.length-1],"mceLast");f(d.select("tr",q),function(o){d.addClass(o.firstChild,"mceFirst");d.addClass(o.childNodes[o.childNodes.length-1],"mceLast")});if(d.get(w.theme_advanced_toolbar_container)){d.get(w.theme_advanced_toolbar_container).appendChild(j)}else{d.insertAfter(j,m)}b.add(r.id+"_path_row","click",function(n){n=n.target;if(n.nodeName=="A"){v._sel(n.className.replace(/^.*mcePath_([0-9]+).*$/,"$1"));return b.cancel(n)}});if(!r.getParam("accessibility_focus")){b.add(d.add(j,"a",{href:"#"},"<!-- IE -->"),"focus",function(){tinyMCE.get(r.id).focus()})}if(w.theme_advanced_toolbar_location=="external"){k.deltaHeight=0}v.deltaHeight=k.deltaHeight;k.targetNode=null;return{iframeContainer:l,editorContainer:r.id+"_parent",sizeContainer:u,deltaHeight:k.deltaHeight}},getInfo:function(){return{longname:"Advanced theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:e.majorVersion+"."+e.minorVersion}},resizeBy:function(i,j){var k=d.get(this.editor.id+"_tbl");this.resizeTo(k.clientWidth+i,k.clientHeight+j)},resizeTo:function(i,l){var j=this.editor,k=j.settings,n=d.get(j.id+"_tbl"),o=d.get(j.id+"_ifr"),m;i=Math.max(k.theme_advanced_resizing_min_width||100,i);l=Math.max(k.theme_advanced_resizing_min_height||100,l);i=Math.min(k.theme_advanced_resizing_max_width||65535,i);l=Math.min(k.theme_advanced_resizing_max_height||65535,l);m=n.clientHeight-o.clientHeight;d.setStyle(o,"height",l-m);d.setStyles(n,{width:i,height:l})},destroy:function(){var i=this.editor.id;b.clear(i+"_resize");b.clear(i+"_path_row");b.clear(i+"_external_close")},_simpleLayout:function(y,r,k,i){var x=this,u=x.editor,v=y.theme_advanced_toolbar_location,m=y.theme_advanced_statusbar_location,l,j,q,w;if(y.readonly){l=d.add(r,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"});return j}if(v=="top"){x._addToolbars(r,k)}if(v=="external"){l=w=d.create("div",{style:"position:relative"});l=d.add(l,"div",{id:u.id+"_external","class":"mceExternalToolbar"});d.add(l,"a",{id:u.id+"_external_close",href:"javascript:;","class":"mceExternalClose"});l=d.add(l,"table",{id:u.id+"_tblext",cellSpacing:0,cellPadding:0});q=d.add(l,"tbody");if(i.firstChild.className=="mceOldBoxModel"){i.firstChild.appendChild(w)}else{i.insertBefore(w,i.firstChild)}x._addToolbars(q,k);u.onMouseUp.add(function(){var o=d.get(u.id+"_external");d.show(o);d.hide(g);var n=b.add(u.id+"_external_close","click",function(){d.hide(u.id+"_external");b.remove(u.id+"_external_close","click",n)});d.show(o);d.setStyle(o,"top",0-d.getRect(u.id+"_tblext").h-1);d.hide(o);d.show(o);o.style.filter="";g=u.id+"_external";o=null})}if(m=="top"){x._addStatusBar(r,k)}if(!y.theme_advanced_toolbar_container){l=d.add(r,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"})}if(v=="bottom"){x._addToolbars(r,k)}if(m=="bottom"){x._addStatusBar(r,k)}return j},_rowLayout:function(w,m,k){var v=this,p=v.editor,u,x,i=p.controlManager,l,j,r,q;u=w.theme_advanced_containers_default_class||"";x=w.theme_advanced_containers_default_align||"center";f(c(w.theme_advanced_containers||""),function(s,o){var n=w["theme_advanced_container_"+s]||"";switch(n.toLowerCase()){case"mceeditor":l=d.add(m,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"});break;case"mceelementpath":v._addStatusBar(m,k);break;default:q=(w["theme_advanced_container_"+s+"_align"]||x).toLowerCase();q="mce"+v._ufirst(q);l=d.add(d.add(m,"tr"),"td",{"class":"mceToolbar "+(w["theme_advanced_container_"+s+"_class"]||u)+" "+q||x});r=i.createToolbar("toolbar"+o);v._addControls(n,r);d.setHTML(l,r.renderHTML());k.deltaHeight-=w.theme_advanced_row_height}});return j},_addControls:function(j,i){var k=this,l=k.settings,m,n=k.editor.controlManager;if(l.theme_advanced_disable&&!k._disabled){m={};f(c(l.theme_advanced_disable),function(o){m[o]=1});k._disabled=m}else{m=k._disabled}f(c(j),function(p){var o;if(m&&m[p]){return}if(p=="tablecontrols"){f(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"],function(q){q=k.createControl(q,n);if(q){i.add(q)}});return}o=k.createControl(p,n);if(o){i.add(o)}})},_addToolbars:function(w,k){var z=this,p,m,r=z.editor,A=z.settings,y,j=r.controlManager,u,l,q=[],x;x=A.theme_advanced_toolbar_align.toLowerCase();x="mce"+z._ufirst(x);l=d.add(d.add(w,"tr"),"td",{"class":"mceToolbar "+x});if(!r.getParam("accessibility_focus")){q.push(d.createHTML("a",{href:"#",onfocus:"tinyMCE.get('"+r.id+"').focus();"},"<!-- IE -->"))}q.push(d.createHTML("a",{href:"#",accesskey:"q",title:r.getLang("advanced.toolbar_focus")},"<!-- IE -->"));for(p=1;(y=A["theme_advanced_buttons"+p]);p++){m=j.createToolbar("toolbar"+p,{"class":"mceToolbarRow"+p});if(A["theme_advanced_buttons"+p+"_add"]){y+=","+A["theme_advanced_buttons"+p+"_add"]}if(A["theme_advanced_buttons"+p+"_add_before"]){y=A["theme_advanced_buttons"+p+"_add_before"]+","+y}z._addControls(y,m);q.push(m.renderHTML());k.deltaHeight-=A.theme_advanced_row_height}q.push(d.createHTML("a",{href:"#",accesskey:"z",title:r.getLang("advanced.toolbar_focus"),onfocus:"tinyMCE.getInstanceById('"+r.id+"').focus();"},"<!-- IE -->"));d.setHTML(l,q.join(""))},_addStatusBar:function(m,j){var k,v=this,p=v.editor,w=v.settings,i,q,u,l;k=d.add(m,"tr");k=l=d.add(k,"td",{"class":"mceStatusbar"});k=d.add(k,"div",{id:p.id+"_path_row"},w.theme_advanced_path?p.translate("advanced.path")+": ":"&#160;");d.add(k,"a",{href:"#",accesskey:"x"});if(w.theme_advanced_resizing){d.add(l,"a",{id:p.id+"_resize",href:"javascript:;",onclick:"return false;","class":"mceResize"});if(w.theme_advanced_resizing_use_cookie){p.onPostRender.add(function(){var n=a.getHash("TinyMCE_"+p.id+"_size"),r=d.get(p.id+"_tbl");if(!n){return}if(w.theme_advanced_resize_horizontal){r.style.width=Math.max(10,n.cw)+"px"}r.style.height=Math.max(10,n.ch)+"px";d.get(p.id+"_ifr").style.height=Math.max(10,parseInt(n.ch)+v.deltaHeight)+"px"})}p.onPostRender.add(function(){b.add(p.id+"_resize","mousedown",function(x){var z,t,o,s,y,r;z=d.get(p.id+"_tbl");o=z.clientWidth;s=z.clientHeight;miw=w.theme_advanced_resizing_min_width||100;mih=w.theme_advanced_resizing_min_height||100;maw=w.theme_advanced_resizing_max_width||65535;mah=w.theme_advanced_resizing_max_height||65535;t=d.add(d.get(p.id+"_parent"),"div",{"class":"mcePlaceHolder"});d.setStyles(t,{width:o,height:s});d.hide(z);d.show(t);i={x:x.screenX,y:x.screenY,w:o,h:s,dx:null,dy:null};q=b.add(d.doc,"mousemove",function(B){var n,A;i.dx=B.screenX-i.x;i.dy=B.screenY-i.y;n=Math.max(miw,i.w+i.dx);A=Math.max(mih,i.h+i.dy);n=Math.min(maw,n);A=Math.min(mah,A);if(w.theme_advanced_resize_horizontal){t.style.width=n+"px"}t.style.height=A+"px";return b.cancel(B)});u=b.add(d.doc,"mouseup",function(n){var A;b.remove(d.doc,"mousemove",q);b.remove(d.doc,"mouseup",u);z.style.display="";d.remove(t);if(i.dx===null){return}A=d.get(p.id+"_ifr");if(w.theme_advanced_resize_horizontal){z.style.width=Math.max(10,i.w+i.dx)+"px"}z.style.height=Math.max(10,i.h+i.dy)+"px";A.style.height=Math.max(10,A.clientHeight+i.dy)+"px";if(w.theme_advanced_resizing_use_cookie){a.setHash("TinyMCE_"+p.id+"_size",{cw:i.w+i.dx,ch:i.h+i.dy})}});return b.cancel(x)})})}j.deltaHeight-=21;k=m=null},_nodeChanged:function(o,x,l,u,j){var A=this,i,w=0,z,q,B=A.settings,y,k,r;e.each(A.stateControls,function(n){x.setActive(n,o.queryCommandState(A.controls[n][1]))});function m(p){var s,n=j.parents,t=p;if(typeof(p)=="string"){t=function(v){return v.nodeName==p}}for(s=0;s<n.length;s++){if(t(n[s])){return n[s]}}}x.setActive("visualaid",o.hasVisual);x.setDisabled("undo",!o.undoManager.hasUndo()&&!o.typing);x.setDisabled("redo",!o.undoManager.hasRedo());x.setDisabled("outdent",!o.queryCommandState("Outdent"));i=m("A");if(q=x.get("link")){if(!i||!i.name){q.setDisabled(!i&&u);q.setActive(!!i)}}if(q=x.get("unlink")){q.setDisabled(!i&&u);q.setActive(!!i&&!i.name)}if(q=x.get("anchor")){q.setActive(!!i&&i.name);if(e.isWebKit){i=m("IMG");q.setActive(!!i&&d.getAttrib(i,"mce_name")=="a")}}i=m("IMG");if(q=x.get("image")){q.setActive(!!i&&l.className.indexOf("mceItem")==-1)}if(q=x.get("styleselect")){A._importClasses();q.select(function(n){return !!o.formatter.match(n)})}if(q=x.get("formatselect")){i=m(d.isBlock);if(i){q.select(i.nodeName.toLowerCase())}}m(function(p){if(p.nodeName==="SPAN"){if(!y&&p.className){y=p.className}if(!k&&p.style.fontSize){k=p.style.fontSize}if(!r&&p.style.fontFamily){r=p.style.fontFamily.replace(/[\"\']+/g,"").replace(/^([^,]+).*/,"$1").toLowerCase()}}return false});if(q=x.get("fontselect")){q.select(function(n){return n.replace(/^([^,]+).*/,"$1").toLowerCase()==r})}if(q=x.get("fontsizeselect")){if(B.theme_advanced_runtime_fontsize&&!k&&!y){k=o.dom.getStyle(l,"fontSize",true)}q.select(function(n){if(n.fontSize&&n.fontSize===k){return true}if(n["class"]&&n["class"]===y){return true}})}if(B.theme_advanced_path&&B.theme_advanced_statusbar_location){i=d.get(o.id+"_path")||d.add(o.id+"_path_row","span",{id:o.id+"_path"});d.setHTML(i,"");m(function(C){var p=C.nodeName.toLowerCase(),s,v,t="";if(C.nodeType!=1||C.nodeName==="BR"||(d.hasClass(C,"mceItemHidden")||d.hasClass(C,"mceItemRemoved"))){return}if(z=d.getAttrib(C,"mce_name")){p=z}if(e.isIE&&C.scopeName!=="HTML"){p=C.scopeName+":"+p}p=p.replace(/mce\:/g,"");switch(p){case"b":p="strong";break;case"i":p="em";break;case"img":if(z=d.getAttrib(C,"src")){t+="src: "+z+" "}break;case"a":if(z=d.getAttrib(C,"name")){t+="name: "+z+" ";p+="#"+z}if(z=d.getAttrib(C,"href")){t+="href: "+z+" "}break;case"font":if(z=d.getAttrib(C,"face")){t+="font: "+z+" "}if(z=d.getAttrib(C,"size")){t+="size: "+z+" "}if(z=d.getAttrib(C,"color")){t+="color: "+z+" "}break;case"span":if(z=d.getAttrib(C,"style")){t+="style: "+z+" "}break}if(z=d.getAttrib(C,"id")){t+="id: "+z+" "}if(z=C.className){z=z.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g,"");if(z){t+="class: "+z+" ";if(d.isBlock(C)||p=="img"||p=="span"){p+="."+z}}}p=p.replace(/(html:)/g,"");p={name:p,node:C,title:t};A.onResolveName.dispatch(A,p);t=p.title;p=p.name;v=d.create("a",{href:"javascript:;",onmousedown:"return false;",title:t,"class":"mcePath_"+(w++)},p);if(i.hasChildNodes()){i.insertBefore(d.doc.createTextNode(" \u00bb "),i.firstChild);i.insertBefore(v,i.firstChild)}else{i.appendChild(v)}},o.getBody())}},_sel:function(i){this.editor.execCommand("mceSelectNodeDepth",false,i)},_mceInsertAnchor:function(k,j){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/anchor.htm",width:320+parseInt(i.getLang("advanced.anchor_delta_width",0)),height:90+parseInt(i.getLang("advanced.anchor_delta_height",0)),inline:true},{theme_url:this.url})},_mceCharMap:function(){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/charmap.htm",width:550+parseInt(i.getLang("advanced.charmap_delta_width",0)),height:250+parseInt(i.getLang("advanced.charmap_delta_height",0)),inline:true},{theme_url:this.url})},_mceHelp:function(){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/about.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceColorPicker:function(k,j){var i=this.editor;j=j||{};i.windowManager.open({url:e.baseURL+"/themes/advanced/color_picker.htm",width:375+parseInt(i.getLang("advanced.colorpicker_delta_width",0)),height:250+parseInt(i.getLang("advanced.colorpicker_delta_height",0)),close_previous:false,inline:true},{input_color:j.color,func:j.func,theme_url:this.url})},_mceCodeEditor:function(j,k){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/source_editor.htm",width:parseInt(i.getParam("theme_advanced_source_editor_width",720)),height:parseInt(i.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url})},_mceImage:function(j,k){var i=this.editor;if(i.dom.getAttrib(i.selection.getNode(),"class").indexOf("mceItem")!=-1){return}i.windowManager.open({url:e.baseURL+"/themes/advanced/image.htm",width:355+parseInt(i.getLang("advanced.image_delta_width",0)),height:275+parseInt(i.getLang("advanced.image_delta_height",0)),inline:true},{theme_url:this.url})},_mceLink:function(j,k){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/link.htm",width:310+parseInt(i.getLang("advanced.link_delta_width",0)),height:200+parseInt(i.getLang("advanced.link_delta_height",0)),inline:true},{theme_url:this.url})},_mceNewDocument:function(){var i=this.editor;i.windowManager.confirm("advanced.newdocument",function(j){if(j){i.execCommand("mceSetContent",false,"")}})},_mceForeColor:function(){var i=this;this._mceColorPicker(0,{color:i.fgColor,func:function(j){i.fgColor=j;i.editor.execCommand("ForeColor",false,j)}})},_mceBackColor:function(){var i=this;this._mceColorPicker(0,{color:i.bgColor,func:function(j){i.bgColor=j;i.editor.execCommand("HiliteColor",false,j)}})},_ufirst:function(i){return i.substring(0,1).toUpperCase()+i.substring(1)}});e.ThemeManager.add("advanced",e.themes.AdvancedTheme)}(tinymce));
1
+ (function(e){var d=e.DOM,b=e.dom.Event,h=e.extend,f=e.each,a=e.util.Cookie,g,c=e.explode;e.ThemeManager.requireLangPack("advanced");e.create("tinymce.themes.AdvancedTheme",{sizes:[8,10,12,14,18,24,36],controls:{bold:["bold_desc","Bold"],italic:["italic_desc","Italic"],underline:["underline_desc","Underline"],strikethrough:["striketrough_desc","Strikethrough"],justifyleft:["justifyleft_desc","JustifyLeft"],justifycenter:["justifycenter_desc","JustifyCenter"],justifyright:["justifyright_desc","JustifyRight"],justifyfull:["justifyfull_desc","JustifyFull"],bullist:["bullist_desc","InsertUnorderedList"],numlist:["numlist_desc","InsertOrderedList"],outdent:["outdent_desc","Outdent"],indent:["indent_desc","Indent"],cut:["cut_desc","Cut"],copy:["copy_desc","Copy"],paste:["paste_desc","Paste"],undo:["undo_desc","Undo"],redo:["redo_desc","Redo"],link:["link_desc","mceLink"],unlink:["unlink_desc","unlink"],image:["image_desc","mceImage"],cleanup:["cleanup_desc","mceCleanup"],help:["help_desc","mceHelp"],code:["code_desc","mceCodeEditor"],hr:["hr_desc","InsertHorizontalRule"],removeformat:["removeformat_desc","RemoveFormat"],sub:["sub_desc","subscript"],sup:["sup_desc","superscript"],forecolor:["forecolor_desc","ForeColor"],forecolorpicker:["forecolor_desc","mceForeColor"],backcolor:["backcolor_desc","HiliteColor"],backcolorpicker:["backcolor_desc","mceBackColor"],charmap:["charmap_desc","mceCharMap"],visualaid:["visualaid_desc","mceToggleVisualAid"],anchor:["anchor_desc","mceInsertAnchor"],newdocument:["newdocument_desc","mceNewDocument"],blockquote:["blockquote_desc","mceBlockQuote"]},stateControls:["bold","italic","underline","strikethrough","bullist","numlist","justifyleft","justifycenter","justifyright","justifyfull","sub","sup","blockquote"],init:function(j,k){var l=this,m,i,n;l.editor=j;l.url=k;l.onResolveName=new e.util.Dispatcher(this);l.settings=m=h({theme_advanced_path:true,theme_advanced_toolbar_location:"bottom",theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"center",theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1,theme_advanced_font_sizes:"1,2,3,4,5,6,7",readonly:j.settings.readonly},j.settings);if(!m.font_size_style_values){m.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt"}if(e.is(m.theme_advanced_font_sizes,"string")){m.font_size_style_values=e.explode(m.font_size_style_values);m.font_size_classes=e.explode(m.font_size_classes||"");n={};j.settings.theme_advanced_font_sizes=m.theme_advanced_font_sizes;f(j.getParam("theme_advanced_font_sizes","","hash"),function(q,p){var o;if(p==q&&q>=1&&q<=7){p=q+" ("+l.sizes[q-1]+"pt)";o=m.font_size_classes[q-1];q=m.font_size_style_values[q-1]||(l.sizes[q-1]+"pt")}if(/^\s*\./.test(q)){o=q.replace(/\./g,"")}n[p]=o?{"class":o}:{fontSize:q}});m.theme_advanced_font_sizes=n}if((i=m.theme_advanced_path_location)&&i!="none"){m.theme_advanced_statusbar_location=m.theme_advanced_path_location}if(m.theme_advanced_statusbar_location=="none"){m.theme_advanced_statusbar_location=0}j.onInit.add(function(){if(!j.settings.readonly){j.onNodeChange.add(l._nodeChanged,l)}if(j.settings.content_css!==false){j.dom.loadCSS(j.baseURI.toAbsolute("themes/advanced/skins/"+j.settings.skin+"/content.css"))}});j.onSetProgressState.add(function(q,o,r){var s,t=q.id,p;if(o){l.progressTimer=setTimeout(function(){s=q.getContainer();s=s.insertBefore(d.create("DIV",{style:"position:relative"}),s.firstChild);p=d.get(q.id+"_tbl");d.add(s,"div",{id:t+"_blocker","class":"mceBlocker",style:{width:p.clientWidth+2,height:p.clientHeight+2}});d.add(s,"div",{id:t+"_progress","class":"mceProgress",style:{left:p.clientWidth/2,top:p.clientHeight/2}})},r||0)}else{d.remove(t+"_blocker");d.remove(t+"_progress");clearTimeout(l.progressTimer)}});d.loadCSS(m.editor_css?j.documentBaseURI.toAbsolute(m.editor_css):k+"/skins/"+j.settings.skin+"/ui.css");if(m.skin_variant){d.loadCSS(k+"/skins/"+j.settings.skin+"/ui_"+m.skin_variant+".css")}},createControl:function(l,i){var j,k;if(k=i.createControl(l)){return k}switch(l){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu()}if((j=this.controls[l])){return i.createButton(l,{title:"advanced."+j[0],cmd:j[1],ui:j[2],value:j[3]})}},execCommand:function(k,j,l){var i=this["_"+k];if(i){i.call(this,j,l);return true}return false},_importClasses:function(k){var i=this.editor,j=i.controlManager.get("styleselect");if(j.getLength()==0){f(i.dom.getClasses(),function(n,l){var m="style_"+l;i.formatter.register(m,{inline:"span",classes:n["class"]});j.add(n["class"],m)})}},_createStyleSelect:function(m){var k=this,i=k.editor,j=i.controlManager,l;l=j.createListBox("styleselect",{title:"advanced.style_select",onselect:function(n){i.focus();i.formatter.toggle(n);return false}});i.onInit.add(function(){var o=0,n=i.getParam("style_formats");if(n){f(n,function(p){var q,r=0;f(p,function(){r++});if(r>1){q=p.name=p.name||"style_"+(o++);i.formatter.register(q,p);l.add(p.title,q)}else{l.add(p.title)}})}else{f(i.getParam("theme_advanced_styles","","hash"),function(r,q){var p;if(r){p="style_"+(o++);i.formatter.register(p,{inline:"span",classes:r});l.add(k.editor.translate(q),p)}})}});if(l.getLength()==0){l.onPostRender.add(function(o,p){if(!l.NativeListBox){b.add(p.id+"_text","focus",k._importClasses,k);b.add(p.id+"_text","mousedown",k._importClasses,k);b.add(p.id+"_open","focus",k._importClasses,k);b.add(p.id+"_open","mousedown",k._importClasses,k)}else{b.add(p.id,"focus",k._importClasses,k)}})}return l},_createFontSelect:function(){var k,j=this,i=j.editor;k=i.controlManager.createListBox("fontselect",{title:"advanced.fontdefault",onselect:function(l){i.execCommand("FontName",false,l);return false}});if(k){f(i.getParam("theme_advanced_fonts",j.settings.theme_advanced_fonts,"hash"),function(m,l){k.add(i.translate(l),m,{style:m.indexOf("dings")==-1?"font-family:"+m:""})})}return k},_createFontSizeSelect:function(){var m=this,k=m.editor,n,l=0,j=[];n=k.controlManager.createListBox("fontsizeselect",{title:"advanced.font_size",onselect:function(i){if(i.fontSize){k.execCommand("FontSize",false,i.fontSize)}else{f(m.settings.theme_advanced_font_sizes,function(p,o){if(p["class"]){j.push(p["class"])}});k.editorCommands._applyInlineStyle("span",{"class":i["class"]},{check_classes:j})}return false}});if(n){f(m.settings.theme_advanced_font_sizes,function(o,i){var p=o.fontSize;if(p>=1&&p<=7){p=m.sizes[parseInt(p)-1]+"pt"}n.add(i,o,{style:"font-size:"+p,"class":"mceFontSize"+(l++)+(" "+(o["class"]||""))})})}return n},_createBlockFormats:function(){var k,i={p:"advanced.paragraph",address:"advanced.address",pre:"advanced.pre",h1:"advanced.h1",h2:"advanced.h2",h3:"advanced.h3",h4:"advanced.h4",h5:"advanced.h5",h6:"advanced.h6",div:"advanced.div",blockquote:"advanced.blockquote",code:"advanced.code",dt:"advanced.dt",dd:"advanced.dd",samp:"advanced.samp"},j=this;k=j.editor.controlManager.createListBox("formatselect",{title:"advanced.block",cmd:"FormatBlock"});if(k){f(j.editor.getParam("theme_advanced_blockformats",j.settings.theme_advanced_blockformats,"hash"),function(m,l){k.add(j.editor.translate(l!=m?l:i[m]),m,{"class":"mce_formatPreview mce_"+m})})}return k},_createForeColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_text_colors){l.colors=i}if(k.theme_advanced_default_foreground_color){l.default_color=k.theme_advanced_default_foreground_color}l.title="advanced.forecolor_desc";l.cmd="ForeColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("forecolor",l);return m},_createBackColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_background_colors){l.colors=i}if(k.theme_advanced_default_background_color){l.default_color=k.theme_advanced_default_background_color}l.title="advanced.backcolor_desc";l.cmd="HiliteColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("backcolor",l);return m},renderUI:function(k){var m,l,q,v=this,r=v.editor,w=v.settings,u,j,i;m=j=d.create("span",{id:r.id+"_parent","class":"mceEditor "+r.settings.skin+"Skin"+(w.skin_variant?" "+r.settings.skin+"Skin"+v._ufirst(w.skin_variant):"")});if(!d.boxModel){m=d.add(m,"div",{"class":"mceOldBoxModel"})}m=u=d.add(m,"table",{id:r.id+"_tbl","class":"mceLayout",cellSpacing:0,cellPadding:0});m=q=d.add(m,"tbody");switch((w.theme_advanced_layout_manager||"").toLowerCase()){case"rowlayout":l=v._rowLayout(w,q,k);break;case"customlayout":l=r.execCallback("theme_advanced_custom_layout",w,q,k,j);break;default:l=v._simpleLayout(w,q,k,j)}m=k.targetNode;i=d.stdMode?u.getElementsByTagName("tr"):u.rows;d.addClass(i[0],"mceFirst");d.addClass(i[i.length-1],"mceLast");f(d.select("tr",q),function(o){d.addClass(o.firstChild,"mceFirst");d.addClass(o.childNodes[o.childNodes.length-1],"mceLast")});if(d.get(w.theme_advanced_toolbar_container)){d.get(w.theme_advanced_toolbar_container).appendChild(j)}else{d.insertAfter(j,m)}b.add(r.id+"_path_row","click",function(n){n=n.target;if(n.nodeName=="A"){v._sel(n.className.replace(/^.*mcePath_([0-9]+).*$/,"$1"));return b.cancel(n)}});if(!r.getParam("accessibility_focus")){b.add(d.add(j,"a",{href:"#"},"<!-- IE -->"),"focus",function(){tinyMCE.get(r.id).focus()})}if(w.theme_advanced_toolbar_location=="external"){k.deltaHeight=0}v.deltaHeight=k.deltaHeight;k.targetNode=null;return{iframeContainer:l,editorContainer:r.id+"_parent",sizeContainer:u,deltaHeight:k.deltaHeight}},getInfo:function(){return{longname:"Advanced theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:e.majorVersion+"."+e.minorVersion}},resizeBy:function(i,j){var k=d.get(this.editor.id+"_tbl");this.resizeTo(k.clientWidth+i,k.clientHeight+j)},resizeTo:function(i,l){var j=this.editor,k=j.settings,n=d.get(j.id+"_tbl"),o=d.get(j.id+"_ifr"),m;i=Math.max(k.theme_advanced_resizing_min_width||100,i);l=Math.max(k.theme_advanced_resizing_min_height||100,l);i=Math.min(k.theme_advanced_resizing_max_width||65535,i);l=Math.min(k.theme_advanced_resizing_max_height||65535,l);m=n.clientHeight-o.clientHeight;d.setStyle(o,"height",l-m);d.setStyles(n,{width:i,height:l})},destroy:function(){var i=this.editor.id;b.clear(i+"_resize");b.clear(i+"_path_row");b.clear(i+"_external_close")},_simpleLayout:function(y,r,k,i){var x=this,u=x.editor,v=y.theme_advanced_toolbar_location,m=y.theme_advanced_statusbar_location,l,j,q,w;if(y.readonly){l=d.add(r,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"});return j}if(v=="top"){x._addToolbars(r,k)}if(v=="external"){l=w=d.create("div",{style:"position:relative"});l=d.add(l,"div",{id:u.id+"_external","class":"mceExternalToolbar"});d.add(l,"a",{id:u.id+"_external_close",href:"javascript:;","class":"mceExternalClose"});l=d.add(l,"table",{id:u.id+"_tblext",cellSpacing:0,cellPadding:0});q=d.add(l,"tbody");if(i.firstChild.className=="mceOldBoxModel"){i.firstChild.appendChild(w)}else{i.insertBefore(w,i.firstChild)}x._addToolbars(q,k);u.onMouseUp.add(function(){var o=d.get(u.id+"_external");d.show(o);d.hide(g);var n=b.add(u.id+"_external_close","click",function(){d.hide(u.id+"_external");b.remove(u.id+"_external_close","click",n)});d.show(o);d.setStyle(o,"top",0-d.getRect(u.id+"_tblext").h-1);d.hide(o);d.show(o);o.style.filter="";g=u.id+"_external";o=null})}if(m=="top"){x._addStatusBar(r,k)}if(!y.theme_advanced_toolbar_container){l=d.add(r,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"})}if(v=="bottom"){x._addToolbars(r,k)}if(m=="bottom"){x._addStatusBar(r,k)}return j},_rowLayout:function(w,m,k){var v=this,p=v.editor,u,x,i=p.controlManager,l,j,r,q;u=w.theme_advanced_containers_default_class||"";x=w.theme_advanced_containers_default_align||"center";f(c(w.theme_advanced_containers||""),function(s,o){var n=w["theme_advanced_container_"+s]||"";switch(n.toLowerCase()){case"mceeditor":l=d.add(m,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"});break;case"mceelementpath":v._addStatusBar(m,k);break;default:q=(w["theme_advanced_container_"+s+"_align"]||x).toLowerCase();q="mce"+v._ufirst(q);l=d.add(d.add(m,"tr"),"td",{"class":"mceToolbar "+(w["theme_advanced_container_"+s+"_class"]||u)+" "+q||x});r=i.createToolbar("toolbar"+o);v._addControls(n,r);d.setHTML(l,r.renderHTML());k.deltaHeight-=w.theme_advanced_row_height}});return j},_addControls:function(j,i){var k=this,l=k.settings,m,n=k.editor.controlManager;if(l.theme_advanced_disable&&!k._disabled){m={};f(c(l.theme_advanced_disable),function(o){m[o]=1});k._disabled=m}else{m=k._disabled}f(c(j),function(p){var o;if(m&&m[p]){return}if(p=="tablecontrols"){f(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"],function(q){q=k.createControl(q,n);if(q){i.add(q)}});return}o=k.createControl(p,n);if(o){i.add(o)}})},_addToolbars:function(w,k){var z=this,p,m,r=z.editor,A=z.settings,y,j=r.controlManager,u,l,q=[],x;x=A.theme_advanced_toolbar_align.toLowerCase();x="mce"+z._ufirst(x);l=d.add(d.add(w,"tr"),"td",{"class":"mceToolbar "+x});if(!r.getParam("accessibility_focus")){q.push(d.createHTML("a",{href:"#",onfocus:"tinyMCE.get('"+r.id+"').focus();"},"<!-- IE -->"))}q.push(d.createHTML("a",{href:"#",accesskey:"q",title:r.getLang("advanced.toolbar_focus")},"<!-- IE -->"));for(p=1;(y=A["theme_advanced_buttons"+p]);p++){m=j.createToolbar("toolbar"+p,{"class":"mceToolbarRow"+p});if(A["theme_advanced_buttons"+p+"_add"]){y+=","+A["theme_advanced_buttons"+p+"_add"]}if(A["theme_advanced_buttons"+p+"_add_before"]){y=A["theme_advanced_buttons"+p+"_add_before"]+","+y}z._addControls(y,m);q.push(m.renderHTML());k.deltaHeight-=A.theme_advanced_row_height}q.push(d.createHTML("a",{href:"#",accesskey:"z",title:r.getLang("advanced.toolbar_focus"),onfocus:"tinyMCE.getInstanceById('"+r.id+"').focus();"},"<!-- IE -->"));d.setHTML(l,q.join(""))},_addStatusBar:function(m,j){var k,v=this,p=v.editor,w=v.settings,i,q,u,l;k=d.add(m,"tr");k=l=d.add(k,"td",{"class":"mceStatusbar"});k=d.add(k,"div",{id:p.id+"_path_row"},w.theme_advanced_path?p.translate("advanced.path")+": ":"&#160;");d.add(k,"a",{href:"#",accesskey:"x"});if(w.theme_advanced_resizing){d.add(l,"a",{id:p.id+"_resize",href:"javascript:;",onclick:"return false;","class":"mceResize"});if(w.theme_advanced_resizing_use_cookie){p.onPostRender.add(function(){var n=a.getHash("TinyMCE_"+p.id+"_size"),r=d.get(p.id+"_tbl");if(!n){return}if(w.theme_advanced_resize_horizontal){r.style.width=Math.max(10,n.cw)+"px"}r.style.height=Math.max(10,n.ch)+"px";d.get(p.id+"_ifr").style.height=Math.max(10,parseInt(n.ch)+v.deltaHeight)+"px"})}p.onPostRender.add(function(){b.add(p.id+"_resize","mousedown",function(x){var z,t,o,s,y,r;z=d.get(p.id+"_tbl");o=z.clientWidth;s=z.clientHeight;miw=w.theme_advanced_resizing_min_width||100;mih=w.theme_advanced_resizing_min_height||100;maw=w.theme_advanced_resizing_max_width||65535;mah=w.theme_advanced_resizing_max_height||65535;t=d.add(d.get(p.id+"_parent"),"div",{"class":"mcePlaceHolder"});d.setStyles(t,{width:o,height:s});d.hide(z);d.show(t);i={x:x.screenX,y:x.screenY,w:o,h:s,dx:null,dy:null};q=b.add(d.doc,"mousemove",function(B){var n,A;i.dx=B.screenX-i.x;i.dy=B.screenY-i.y;n=Math.max(miw,i.w+i.dx);A=Math.max(mih,i.h+i.dy);n=Math.min(maw,n);A=Math.min(mah,A);if(w.theme_advanced_resize_horizontal){t.style.width=n+"px"}t.style.height=A+"px";return b.cancel(B)});u=b.add(d.doc,"mouseup",function(n){var A;b.remove(d.doc,"mousemove",q);b.remove(d.doc,"mouseup",u);z.style.display="";d.remove(t);if(i.dx===null){return}A=d.get(p.id+"_ifr");if(w.theme_advanced_resize_horizontal){z.style.width=Math.max(10,i.w+i.dx)+"px"}z.style.height=Math.max(10,i.h+i.dy)+"px";A.style.height=Math.max(10,A.clientHeight+i.dy)+"px";if(w.theme_advanced_resizing_use_cookie){a.setHash("TinyMCE_"+p.id+"_size",{cw:i.w+i.dx,ch:i.h+i.dy})}});return b.cancel(x)})})}j.deltaHeight-=21;k=m=null},_nodeChanged:function(o,x,l,u,j){var A=this,i,w=0,z,q,B=A.settings,y,k,r;e.each(A.stateControls,function(n){x.setActive(n,o.queryCommandState(A.controls[n][1]))});function m(p){var s,n=j.parents,t=p;if(typeof(p)=="string"){t=function(v){return v.nodeName==p}}for(s=0;s<n.length;s++){if(t(n[s])){return n[s]}}}x.setActive("visualaid",o.hasVisual);x.setDisabled("undo",!o.undoManager.hasUndo()&&!o.typing);x.setDisabled("redo",!o.undoManager.hasRedo());x.setDisabled("outdent",!o.queryCommandState("Outdent"));i=m("A");if(q=x.get("link")){if(!i||!i.name){q.setDisabled(!i&&u);q.setActive(!!i)}}if(q=x.get("unlink")){q.setDisabled(!i&&u);q.setActive(!!i&&!i.name)}if(q=x.get("anchor")){q.setActive(!!i&&i.name)}i=m("IMG");if(q=x.get("image")){q.setActive(!!i&&l.className.indexOf("mceItem")==-1)}if(q=x.get("styleselect")){A._importClasses();q.select(function(n){return !!o.formatter.match(n)})}if(q=x.get("formatselect")){i=m(d.isBlock);if(i){q.select(i.nodeName.toLowerCase())}}m(function(p){if(p.nodeName==="SPAN"){if(!y&&p.className){y=p.className}if(!k&&p.style.fontSize){k=p.style.fontSize}if(!r&&p.style.fontFamily){r=p.style.fontFamily.replace(/[\"\']+/g,"").replace(/^([^,]+).*/,"$1").toLowerCase()}}return false});if(q=x.get("fontselect")){q.select(function(n){return n.replace(/^([^,]+).*/,"$1").toLowerCase()==r})}if(q=x.get("fontsizeselect")){if(B.theme_advanced_runtime_fontsize&&!k&&!y){k=o.dom.getStyle(l,"fontSize",true)}q.select(function(n){if(n.fontSize&&n.fontSize===k){return true}if(n["class"]&&n["class"]===y){return true}})}if(B.theme_advanced_path&&B.theme_advanced_statusbar_location){i=d.get(o.id+"_path")||d.add(o.id+"_path_row","span",{id:o.id+"_path"});d.setHTML(i,"");m(function(C){var p=C.nodeName.toLowerCase(),s,v,t="";if(C.nodeType!=1||C.nodeName==="BR"||(d.hasClass(C,"mceItemHidden")||d.hasClass(C,"mceItemRemoved"))){return}if(z=d.getAttrib(C,"mce_name")){p=z}if(e.isIE&&C.scopeName!=="HTML"){p=C.scopeName+":"+p}p=p.replace(/mce\:/g,"");switch(p){case"b":p="strong";break;case"i":p="em";break;case"img":if(z=d.getAttrib(C,"src")){t+="src: "+z+" "}break;case"a":if(z=d.getAttrib(C,"name")){t+="name: "+z+" ";p+="#"+z}if(z=d.getAttrib(C,"href")){t+="href: "+z+" "}break;case"font":if(z=d.getAttrib(C,"face")){t+="font: "+z+" "}if(z=d.getAttrib(C,"size")){t+="size: "+z+" "}if(z=d.getAttrib(C,"color")){t+="color: "+z+" "}break;case"span":if(z=d.getAttrib(C,"style")){t+="style: "+z+" "}break}if(z=d.getAttrib(C,"id")){t+="id: "+z+" "}if(z=C.className){z=z.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g,"");if(z){t+="class: "+z+" ";if(d.isBlock(C)||p=="img"||p=="span"){p+="."+z}}}p=p.replace(/(html:)/g,"");p={name:p,node:C,title:t};A.onResolveName.dispatch(A,p);t=p.title;p=p.name;v=d.create("a",{href:"javascript:;",onmousedown:"return false;",title:t,"class":"mcePath_"+(w++)},p);if(i.hasChildNodes()){i.insertBefore(d.doc.createTextNode(" \u00bb "),i.firstChild);i.insertBefore(v,i.firstChild)}else{i.appendChild(v)}},o.getBody())}},_sel:function(i){this.editor.execCommand("mceSelectNodeDepth",false,i)},_mceInsertAnchor:function(k,j){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/anchor.htm",width:320+parseInt(i.getLang("advanced.anchor_delta_width",0)),height:90+parseInt(i.getLang("advanced.anchor_delta_height",0)),inline:true},{theme_url:this.url})},_mceCharMap:function(){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/charmap.htm",width:550+parseInt(i.getLang("advanced.charmap_delta_width",0)),height:250+parseInt(i.getLang("advanced.charmap_delta_height",0)),inline:true},{theme_url:this.url})},_mceHelp:function(){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/about.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceColorPicker:function(k,j){var i=this.editor;j=j||{};i.windowManager.open({url:e.baseURL+"/themes/advanced/color_picker.htm",width:375+parseInt(i.getLang("advanced.colorpicker_delta_width",0)),height:250+parseInt(i.getLang("advanced.colorpicker_delta_height",0)),close_previous:false,inline:true},{input_color:j.color,func:j.func,theme_url:this.url})},_mceCodeEditor:function(j,k){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/source_editor.htm",width:parseInt(i.getParam("theme_advanced_source_editor_width",720)),height:parseInt(i.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url})},_mceImage:function(j,k){var i=this.editor;if(i.dom.getAttrib(i.selection.getNode(),"class").indexOf("mceItem")!=-1){return}i.windowManager.open({url:e.baseURL+"/themes/advanced/image.htm",width:355+parseInt(i.getLang("advanced.image_delta_width",0)),height:275+parseInt(i.getLang("advanced.image_delta_height",0)),inline:true},{theme_url:this.url})},_mceLink:function(j,k){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/link.htm",width:310+parseInt(i.getLang("advanced.link_delta_width",0)),height:200+parseInt(i.getLang("advanced.link_delta_height",0)),inline:true},{theme_url:this.url})},_mceNewDocument:function(){var i=this.editor;i.windowManager.confirm("advanced.newdocument",function(j){if(j){i.execCommand("mceSetContent",false,"")}})},_mceForeColor:function(){var i=this;this._mceColorPicker(0,{color:i.fgColor,func:function(j){i.fgColor=j;i.editor.execCommand("ForeColor",false,j)}})},_mceBackColor:function(){var i=this;this._mceColorPicker(0,{color:i.bgColor,func:function(j){i.bgColor=j;i.editor.execCommand("HiliteColor",false,j)}})},_ufirst:function(i){return i.substring(0,1).toUpperCase()+i.substring(1)}});e.ThemeManager.add("advanced",e.themes.AdvancedTheme)}(tinymce));
tiny_mce/themes/advanced/editor_template_src.js CHANGED
@@ -892,11 +892,6 @@
892
 
893
  if (c = cm.get('anchor')) {
894
  c.setActive(!!p && p.name);
895
-
896
- if (tinymce.isWebKit) {
897
- p = getParent('IMG');
898
- c.setActive(!!p && DOM.getAttrib(p, 'mce_name') == 'a');
899
- }
900
  }
901
 
902
  p = getParent('IMG');
892
 
893
  if (c = cm.get('anchor')) {
894
  c.setActive(!!p && p.name);
 
 
 
 
 
895
  }
896
 
897
  p = getParent('IMG');
tiny_mce/themes/advanced/image.htm CHANGED
@@ -72,13 +72,8 @@
72
  </div>
73
 
74
  <div class="mceActionPanel">
75
- <div style="float: left">
76
- <input type="submit" id="insert" name="insert" value="{#insert}" />
77
- </div>
78
-
79
- <div style="float: right">
80
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
81
- </div>
82
  </div>
83
  </form>
84
  </body>
72
  </div>
73
 
74
  <div class="mceActionPanel">
75
+ <input type="submit" id="insert" name="insert" value="{#insert}" />
76
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
 
 
 
 
 
77
  </div>
78
  </form>
79
  </body>
tiny_mce/themes/advanced/js/anchor.js CHANGED
@@ -5,7 +5,7 @@ var AnchorDialog = {
5
  var action, elm, f = document.forms[0];
6
 
7
  this.editor = ed;
8
- elm = ed.dom.getParent(ed.selection.getNode(), 'A,IMG');
9
  v = ed.dom.getAttrib(elm, 'name');
10
 
11
  if (v) {
@@ -17,18 +17,18 @@ var AnchorDialog = {
17
  },
18
 
19
  update : function() {
20
- var ed = this.editor;
21
-
22
  tinyMCEPopup.restoreSelection();
23
 
24
  if (this.action != 'update')
25
  ed.selection.collapse(1);
26
 
27
- // Webkit acts weird if empty inline element is inserted so we need to use a image instead
28
- if (tinymce.isWebKit)
29
- ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('img', {_mce_name : 'a', name : document.forms[0].anchorName.value, 'class' : 'mceItemAnchor'}));
30
  else
31
- ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : document.forms[0].anchorName.value, 'class' : 'mceItemAnchor'}, ''));
32
 
33
  tinyMCEPopup.close();
34
  }
5
  var action, elm, f = document.forms[0];
6
 
7
  this.editor = ed;
8
+ elm = ed.dom.getParent(ed.selection.getNode(), 'A');
9
  v = ed.dom.getAttrib(elm, 'name');
10
 
11
  if (v) {
17
  },
18
 
19
  update : function() {
20
+ var ed = this.editor, elm, name = document.forms[0].anchorName.value;
21
+
22
  tinyMCEPopup.restoreSelection();
23
 
24
  if (this.action != 'update')
25
  ed.selection.collapse(1);
26
 
27
+ elm = ed.dom.getParent(ed.selection.getNode(), 'A');
28
+ if (elm)
29
+ elm.name = name;
30
  else
31
+ ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : name, 'class' : 'mceItemAnchor'}, ''));
32
 
33
  tinyMCEPopup.close();
34
  }
tiny_mce/themes/advanced/link.htm CHANGED
@@ -50,13 +50,8 @@
50
  </div>
51
 
52
  <div class="mceActionPanel">
53
- <div style="float: left">
54
- <input type="submit" id="insert" name="insert" value="{#insert}" />
55
- </div>
56
-
57
- <div style="float: right">
58
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
59
- </div>
60
  </div>
61
  </form>
62
  </body>
50
  </div>
51
 
52
  <div class="mceActionPanel">
53
+ <input type="submit" id="insert" name="insert" value="{#insert}" />
54
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
 
 
 
 
 
55
  </div>
56
  </form>
57
  </body>
tiny_mce/themes/advanced/skins/default/content.css CHANGED
@@ -8,9 +8,8 @@ h4 {font-size: 1em}
8
  h5 {font-size: .83em}
9
  h6 {font-size: .75em}
10
  .mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;}
11
- a.mceItemAnchor {width:12px; line-height:6px; overflow:hidden; padding-left:12px; background:url(img/items.gif) no-repeat bottom left;}
12
- img.mceItemAnchor {width:12px; height:12px; background:url(img/items.gif) no-repeat;}
13
- td.mceSelected, th.mceSelected {background-color:#3399ff}
14
  img {border:0;}
15
  table {cursor:default}
16
  table td, table th {cursor:text}
@@ -18,7 +17,7 @@ ins {border-bottom:1px solid green; text-decoration: none; color:green}
18
  del {color:red; text-decoration:line-through}
19
  cite {border-bottom:1px dashed blue}
20
  acronym {border-bottom:1px dotted #CCC; cursor:help}
21
- abbr, html\:abbr {border-bottom:1px dashed #CCC; cursor:help}
22
 
23
  /* IE */
24
  * html body {
8
  h5 {font-size: .83em}
9
  h6 {font-size: .75em}
10
  .mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;}
11
+ a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(img/items.gif) no-repeat 0 0;}
12
+ td.mceSelected, th.mceSelected {background-color:#3399ff !important}
 
13
  img {border:0;}
14
  table {cursor:default}
15
  table td, table th {cursor:text}
17
  del {color:red; text-decoration:line-through}
18
  cite {border-bottom:1px dashed blue}
19
  acronym {border-bottom:1px dotted #CCC; cursor:help}
20
+ abbr {border-bottom:1px dashed #CCC; cursor:help}
21
 
22
  /* IE */
23
  * html body {
tiny_mce/themes/advanced/skins/default/dialog.css CHANGED
@@ -42,10 +42,11 @@ width:94px; height:26px;
42
  background:url(img/buttons.png) 0 -26px;
43
  cursor:pointer;
44
  padding-bottom:2px;
 
45
  }
46
 
47
- #insert {background:url(img/buttons.png) 0 -52px;}
48
- #cancel {background:url(img/buttons.png) 0 0;}
49
 
50
  /* Browse */
51
  a.pickcolor, a.browse {text-decoration:none}
@@ -113,4 +114,4 @@ h3 {font-size:14px;}
113
  #colorpicker #namedcolors {width:150px;}
114
  #colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}
115
  #colorpicker #colornamecontainer {margin-top:5px;}
116
- #colorpicker #picker_panel fieldset {margin:auto;width:325px;}
42
  background:url(img/buttons.png) 0 -26px;
43
  cursor:pointer;
44
  padding-bottom:2px;
45
+ float:left;
46
  }
47
 
48
+ #insert {background:url(img/buttons.png) 0 -52px}
49
+ #cancel {background:url(img/buttons.png) 0 0; float:right}
50
 
51
  /* Browse */
52
  a.pickcolor, a.browse {text-decoration:none}
114
  #colorpicker #namedcolors {width:150px;}
115
  #colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}
116
  #colorpicker #colornamecontainer {margin-top:5px;}
117
+ #colorpicker #picker_panel fieldset {margin:auto;width:325px;}
tiny_mce/themes/advanced/skins/default/ui.css CHANGED
@@ -4,7 +4,7 @@
4
  .defaultSkin table td {vertical-align:middle}
5
 
6
  /* Containers */
7
- .defaultSkin table {background:#F0F0EE}
8
  .defaultSkin iframe {display:block; background:#FFF}
9
  .defaultSkin .mceToolbar {height:26px}
10
  .defaultSkin .mceLeft {text-align:left}
@@ -47,7 +47,6 @@
47
  .defaultSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:2px 2px 0 4px}
48
 
49
  /* ListBox */
50
- .defaultSkin .mceListBox {direction:ltr}
51
  .defaultSkin .mceListBox, .defaultSkin .mceListBox a {display:block}
52
  .defaultSkin .mceListBox .mceText {padding-left:4px; width:70px; text-align:left; border:1px solid #CCC; border-right:0; background:#FFF; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden}
53
  .defaultSkin .mceListBox .mceOpen {width:9px; height:20px; background:url(../../img/icons.gif) -741px 0; margin-right:2px; border:1px solid #CCC;}
4
  .defaultSkin table td {vertical-align:middle}
5
 
6
  /* Containers */
7
+ .defaultSkin table {direction:ltr; background:#F0F0EE}
8
  .defaultSkin iframe {display:block; background:#FFF}
9
  .defaultSkin .mceToolbar {height:26px}
10
  .defaultSkin .mceLeft {text-align:left}
47
  .defaultSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:2px 2px 0 4px}
48
 
49
  /* ListBox */
 
50
  .defaultSkin .mceListBox, .defaultSkin .mceListBox a {display:block}
51
  .defaultSkin .mceListBox .mceText {padding-left:4px; width:70px; text-align:left; border:1px solid #CCC; border-right:0; background:#FFF; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden}
52
  .defaultSkin .mceListBox .mceOpen {width:9px; height:20px; background:url(../../img/icons.gif) -741px 0; margin-right:2px; border:1px solid #CCC;}
tiny_mce/themes/advanced/skins/o2k7/content.css CHANGED
@@ -8,8 +8,8 @@ h4 {font-size: 1em}
8
  h5 {font-size: .83em}
9
  h6 {font-size: .75em}
10
  .mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;}
11
- a.mceItemAnchor {width:12px; line-height:6px; overflow:hidden; padding-left:12px; background:url(../default/img/items.gif) no-repeat bottom left;}
12
- img.mceItemAnchor {width:12px; height:12px; background:url(../default/img/items.gif) no-repeat;}
13
  img {border:0;}
14
  table {cursor:default}
15
  table td, table th {cursor:text}
@@ -17,7 +17,7 @@ ins {border-bottom:1px solid green; text-decoration: none; color:green}
17
  del {color:red; text-decoration:line-through}
18
  cite {border-bottom:1px dashed blue}
19
  acronym {border-bottom:1px dotted #CCC; cursor:help}
20
- abbr, html\:abbr {border-bottom:1px dashed #CCC; cursor:help}
21
 
22
  /* IE */
23
  * html body {
8
  h5 {font-size: .83em}
9
  h6 {font-size: .75em}
10
  .mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;}
11
+ a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;}
12
+ td.mceSelected, th.mceSelected {background-color:#3399ff !important}
13
  img {border:0;}
14
  table {cursor:default}
15
  table td, table th {cursor:text}
17
  del {color:red; text-decoration:line-through}
18
  cite {border-bottom:1px dashed blue}
19
  acronym {border-bottom:1px dotted #CCC; cursor:help}
20
+ abbr {border-bottom:1px dashed #CCC; cursor:help}
21
 
22
  /* IE */
23
  * html body {
tiny_mce/themes/advanced/skins/o2k7/dialog.css CHANGED
@@ -42,10 +42,11 @@ width:94px; height:26px;
42
  background:url(../default/img/buttons.png) 0 -26px;
43
  cursor:pointer;
44
  padding-bottom:2px;
 
45
  }
46
 
47
- #insert {background:url(../default/img/buttons.png) 0 -52px;}
48
- #cancel {background:url(../default/img/buttons.png) 0 0;}
49
 
50
  /* Browse */
51
  a.pickcolor, a.browse {text-decoration:none}
42
  background:url(../default/img/buttons.png) 0 -26px;
43
  cursor:pointer;
44
  padding-bottom:2px;
45
+ float:left;
46
  }
47
 
48
+ #insert {background:url(../default/img/buttons.png) 0 -52px}
49
+ #cancel {background:url(../default/img/buttons.png) 0 0; float:right}
50
 
51
  /* Browse */
52
  a.pickcolor, a.browse {text-decoration:none}
tiny_mce/themes/advanced/source_editor.htm CHANGED
@@ -18,13 +18,8 @@
18
  <textarea name="htmlSource" id="htmlSource" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,monospace; font-size: 12px;" dir="ltr" wrap="off" class="mceFocus"></textarea>
19
 
20
  <div class="mceActionPanel">
21
- <div style="float: left">
22
- <input type="submit" name="insert" value="{#update}" id="insert" />
23
- </div>
24
-
25
- <div style="float: right">
26
- <input type="button" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" id="cancel" />
27
- </div>
28
  </div>
29
  </form>
30
  </body>
18
  <textarea name="htmlSource" id="htmlSource" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,monospace; font-size: 12px;" dir="ltr" wrap="off" class="mceFocus"></textarea>
19
 
20
  <div class="mceActionPanel">
21
+ <input type="submit" name="insert" value="{#update}" id="insert" />
22
+ <input type="button" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" id="cancel" />
 
 
 
 
 
23
  </div>
24
  </form>
25
  </body>
tiny_mce/themes/simple/editor_template.js ADDED
@@ -0,0 +1 @@
 
1
+ (function(){var a=tinymce.DOM;tinymce.ThemeManager.requireLangPack("simple");tinymce.create("tinymce.themes.SimpleTheme",{init:function(c,d){var e=this,b=["Bold","Italic","Underline","Strikethrough","InsertUnorderedList","InsertOrderedList"],f=c.settings;e.editor=c;c.onInit.add(function(){c.onNodeChange.add(function(h,g){tinymce.each(b,function(i){g.get(i.toLowerCase()).setActive(h.queryCommandState(i))})});c.dom.loadCSS(d+"/skins/"+f.skin+"/content.css")});a.loadCSS((f.editor_css?c.documentBaseURI.toAbsolute(f.editor_css):"")||d+"/skins/"+f.skin+"/ui.css")},renderUI:function(h){var e=this,i=h.targetNode,b,c,d=e.editor,f=d.controlManager,g;i=a.insertAfter(a.create("span",{id:d.id+"_container","class":"mceEditor "+d.settings.skin+"SimpleSkin"}),i);i=g=a.add(i,"table",{cellPadding:0,cellSpacing:0,"class":"mceLayout"});i=c=a.add(i,"tbody");i=a.add(c,"tr");i=b=a.add(a.add(i,"td"),"div",{"class":"mceIframeContainer"});i=a.add(a.add(c,"tr",{"class":"last"}),"td",{"class":"mceToolbar mceLast",align:"center"});c=e.toolbar=f.createToolbar("tools1");c.add(f.createButton("bold",{title:"simple.bold_desc",cmd:"Bold"}));c.add(f.createButton("italic",{title:"simple.italic_desc",cmd:"Italic"}));c.add(f.createButton("underline",{title:"simple.underline_desc",cmd:"Underline"}));c.add(f.createButton("strikethrough",{title:"simple.striketrough_desc",cmd:"Strikethrough"}));c.add(f.createSeparator());c.add(f.createButton("undo",{title:"simple.undo_desc",cmd:"Undo"}));c.add(f.createButton("redo",{title:"simple.redo_desc",cmd:"Redo"}));c.add(f.createSeparator());c.add(f.createButton("cleanup",{title:"simple.cleanup_desc",cmd:"mceCleanup"}));c.add(f.createSeparator());c.add(f.createButton("insertunorderedlist",{title:"simple.bullist_desc",cmd:"InsertUnorderedList"}));c.add(f.createButton("insertorderedlist",{title:"simple.numlist_desc",cmd:"InsertOrderedList"}));c.renderTo(i);return{iframeContainer:b,editorContainer:d.id+"_container",sizeContainer:g,deltaHeight:-20}},getInfo:function(){return{longname:"Simple theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.ThemeManager.add("simple",tinymce.themes.SimpleTheme)})();
tiny_mce/themes/simple/editor_template_src.js ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * editor_template_src.js
3
+ *
4
+ * Copyright 2009, Moxiecode Systems AB
5
+ * Released under LGPL License.
6
+ *
7
+ * License: http://tinymce.moxiecode.com/license
8
+ * Contributing: http://tinymce.moxiecode.com/contributing
9
+ */
10
+
11
+ (function() {
12
+ var DOM = tinymce.DOM;
13
+
14
+ // Tell it to load theme specific language pack(s)
15
+ tinymce.ThemeManager.requireLangPack('simple');
16
+
17
+ tinymce.create('tinymce.themes.SimpleTheme', {
18
+ init : function(ed, url) {
19
+ var t = this, states = ['Bold', 'Italic', 'Underline', 'Strikethrough', 'InsertUnorderedList', 'InsertOrderedList'], s = ed.settings;
20
+
21
+ t.editor = ed;
22
+
23
+ ed.onInit.add(function() {
24
+ ed.onNodeChange.add(function(ed, cm) {
25
+ tinymce.each(states, function(c) {
26
+ cm.get(c.toLowerCase()).setActive(ed.queryCommandState(c));
27
+ });
28
+ });
29
+
30
+ ed.dom.loadCSS(url + "/skins/" + s.skin + "/content.css");
31
+ });
32
+
33
+ DOM.loadCSS((s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : '') || url + "/skins/" + s.skin + "/ui.css");
34
+ },
35
+
36
+ renderUI : function(o) {
37
+ var t = this, n = o.targetNode, ic, tb, ed = t.editor, cf = ed.controlManager, sc;
38
+
39
+ n = DOM.insertAfter(DOM.create('span', {id : ed.id + '_container', 'class' : 'mceEditor ' + ed.settings.skin + 'SimpleSkin'}), n);
40
+ n = sc = DOM.add(n, 'table', {cellPadding : 0, cellSpacing : 0, 'class' : 'mceLayout'});
41
+ n = tb = DOM.add(n, 'tbody');
42
+
43
+ // Create iframe container
44
+ n = DOM.add(tb, 'tr');
45
+ n = ic = DOM.add(DOM.add(n, 'td'), 'div', {'class' : 'mceIframeContainer'});
46
+
47
+ // Create toolbar container
48
+ n = DOM.add(DOM.add(tb, 'tr', {'class' : 'last'}), 'td', {'class' : 'mceToolbar mceLast', align : 'center'});
49
+
50
+ // Create toolbar
51
+ tb = t.toolbar = cf.createToolbar("tools1");
52
+ tb.add(cf.createButton('bold', {title : 'simple.bold_desc', cmd : 'Bold'}));
53
+ tb.add(cf.createButton('italic', {title : 'simple.italic_desc', cmd : 'Italic'}));
54
+ tb.add(cf.createButton('underline', {title : 'simple.underline_desc', cmd : 'Underline'}));
55
+ tb.add(cf.createButton('strikethrough', {title : 'simple.striketrough_desc', cmd : 'Strikethrough'}));
56
+ tb.add(cf.createSeparator());
57
+ tb.add(cf.createButton('undo', {title : 'simple.undo_desc', cmd : 'Undo'}));
58
+ tb.add(cf.createButton('redo', {title : 'simple.redo_desc', cmd : 'Redo'}));
59
+ tb.add(cf.createSeparator());
60
+ tb.add(cf.createButton('cleanup', {title : 'simple.cleanup_desc', cmd : 'mceCleanup'}));
61
+ tb.add(cf.createSeparator());
62
+ tb.add(cf.createButton('insertunorderedlist', {title : 'simple.bullist_desc', cmd : 'InsertUnorderedList'}));
63
+ tb.add(cf.createButton('insertorderedlist', {title : 'simple.numlist_desc', cmd : 'InsertOrderedList'}));
64
+ tb.renderTo(n);
65
+
66
+ return {
67
+ iframeContainer : ic,
68
+ editorContainer : ed.id + '_container',
69
+ sizeContainer : sc,
70
+ deltaHeight : -20
71
+ };
72
+ },
73
+
74
+ getInfo : function() {
75
+ return {
76
+ longname : 'Simple theme',
77
+ author : 'Moxiecode Systems AB',
78
+ authorurl : 'http://tinymce.moxiecode.com',
79
+ version : tinymce.majorVersion + "." + tinymce.minorVersion
80
+ }
81
+ }
82
+ });
83
+
84
+ tinymce.ThemeManager.add('simple', tinymce.themes.SimpleTheme);
85
+ })();
tiny_mce/themes/simple/img/icons.gif ADDED
Binary file
tiny_mce/themes/simple/langs/en.js ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ tinyMCE.addI18n('en.simple',{
2
+ bold_desc:"Bold (Ctrl+B)",
3
+ italic_desc:"Italic (Ctrl+I)",
4
+ underline_desc:"Underline (Ctrl+U)",
5
+ striketrough_desc:"Strikethrough",
6
+ bullist_desc:"Unordered list",
7
+ numlist_desc:"Ordered list",
8
+ undo_desc:"Undo (Ctrl+Z)",
9
+ redo_desc:"Redo (Ctrl+Y)",
10
+ cleanup_desc:"Cleanup messy code"
11
+ });
tiny_mce/themes/simple/skins/default/content.css ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ body, td, pre {
2
+ font-family: Verdana, Arial, Helvetica, sans-serif;
3
+ font-size: 10px;
4
+ }
5
+
6
+ body {
7
+ background-color: #FFFFFF;
8
+ }
9
+
10
+ .mceVisualAid {
11
+ border: 1px dashed #BBBBBB;
12
+ }
13
+
14
+ /* MSIE specific */
15
+
16
+ * html body {
17
+ scrollbar-3dlight-color: #F0F0EE;
18
+ scrollbar-arrow-color: #676662;
19
+ scrollbar-base-color: #F0F0EE;
20
+ scrollbar-darkshadow-color: #DDDDDD;
21
+ scrollbar-face-color: #E0E0DD;
22
+ scrollbar-highlight-color: #F0F0EE;
23
+ scrollbar-shadow-color: #F0F0EE;
24
+ scrollbar-track-color: #F5F5F5;
25
+ }
tiny_mce/themes/simple/skins/default/ui.css ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Reset */
2
+ .defaultSimpleSkin table, .defaultSimpleSkin tbody, .defaultSimpleSkin a, .defaultSimpleSkin img, .defaultSimpleSkin tr, .defaultSimpleSkin div, .defaultSimpleSkin td, .defaultSimpleSkin iframe, .defaultSimpleSkin span, .defaultSimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000}
3
+
4
+ /* Containers */
5
+ .defaultSimpleSkin {position:relative}
6
+ .defaultSimpleSkin table.mceLayout {background:#F0F0EE; border:1px solid #CCC;}
7
+ .defaultSimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #CCC;}
8
+ .defaultSimpleSkin .mceToolbar {height:24px;}
9
+
10
+ /* Layout */
11
+ .defaultSimpleSkin span.mceIcon, .defaultSimpleSkin img.mceIcon {display:block; width:20px; height:20px}
12
+ .defaultSimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px}
13
+
14
+ /* Button */
15
+ .defaultSimpleSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px}
16
+ .defaultSimpleSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0}
17
+ .defaultSimpleSkin a.mceButtonActive {border:1px solid #0A246A; background-color:#C2CBE0}
18
+ .defaultSimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
19
+
20
+ /* Separator */
21
+ .defaultSimpleSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:0 2px 0 4px}
22
+
23
+ /* Theme */
24
+ .defaultSimpleSkin span.mce_bold {background-position:0 0}
25
+ .defaultSimpleSkin span.mce_italic {background-position:-60px 0}
26
+ .defaultSimpleSkin span.mce_underline {background-position:-140px 0}
27
+ .defaultSimpleSkin span.mce_strikethrough {background-position:-120px 0}
28
+ .defaultSimpleSkin span.mce_undo {background-position:-160px 0}
29
+ .defaultSimpleSkin span.mce_redo {background-position:-100px 0}
30
+ .defaultSimpleSkin span.mce_cleanup {background-position:-40px 0}
31
+ .defaultSimpleSkin span.mce_insertunorderedlist {background-position:-20px 0}
32
+ .defaultSimpleSkin span.mce_insertorderedlist {background-position:-80px 0}
tiny_mce/themes/simple/skins/o2k7/content.css ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ body, td, pre {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
2
+
3
+ body {background: #FFF;}
4
+ .mceVisualAid {border: 1px dashed #BBB;}
5
+
6
+ /* IE */
7
+
8
+ * html body {
9
+ scrollbar-3dlight-color: #F0F0EE;
10
+ scrollbar-arrow-color: #676662;
11
+ scrollbar-base-color: #F0F0EE;
12
+ scrollbar-darkshadow-color: #DDDDDD;
13
+ scrollbar-face-color: #E0E0DD;
14
+ scrollbar-highlight-color: #F0F0EE;
15
+ scrollbar-shadow-color: #F0F0EE;
16
+ scrollbar-track-color: #F5F5F5;
17
+ }
tiny_mce/themes/simple/skins/o2k7/img/button_bg.png ADDED
Binary file
tiny_mce/themes/simple/skins/o2k7/ui.css ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Reset */
2
+ .o2k7SimpleSkin table, .o2k7SimpleSkin tbody, .o2k7SimpleSkin a, .o2k7SimpleSkin img, .o2k7SimpleSkin tr, .o2k7SimpleSkin div, .o2k7SimpleSkin td, .o2k7SimpleSkin iframe, .o2k7SimpleSkin span, .o2k7SimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000}
3
+
4
+ /* Containers */
5
+ .o2k7SimpleSkin {position:relative}
6
+ .o2k7SimpleSkin table.mceLayout {background:#E5EFFD; border:1px solid #ABC6DD;}
7
+ .o2k7SimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #ABC6DD;}
8
+ .o2k7SimpleSkin .mceToolbar {height:26px;}
9
+
10
+ /* Layout */
11
+ .o2k7SimpleSkin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; }
12
+ .o2k7SimpleSkin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px}
13
+ .o2k7SimpleSkin span.mceIcon, .o2k7SimpleSkin img.mceIcon {display:block; width:20px; height:20px}
14
+ .o2k7SimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px}
15
+
16
+ /* Button */
17
+ .o2k7SimpleSkin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px}
18
+ .o2k7SimpleSkin a.mceButton span, .o2k7SimpleSkin a.mceButton img {margin:1px 0 0 1px}
19
+ .o2k7SimpleSkin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px}
20
+ .o2k7SimpleSkin a.mceButtonActive {background-position:0 -44px}
21
+ .o2k7SimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
22
+
23
+ /* Separator */
24
+ .o2k7SimpleSkin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px}
25
+
26
+ /* Theme */
27
+ .o2k7SimpleSkin span.mce_bold {background-position:0 0}
28
+ .o2k7SimpleSkin span.mce_italic {background-position:-60px 0}
29
+ .o2k7SimpleSkin span.mce_underline {background-position:-140px 0}
30
+ .o2k7SimpleSkin span.mce_strikethrough {background-position:-120px 0}
31
+ .o2k7SimpleSkin span.mce_undo {background-position:-160px 0}
32
+ .o2k7SimpleSkin span.mce_redo {background-position:-100px 0}
33
+ .o2k7SimpleSkin span.mce_cleanup {background-position:-40px 0}
34
+ .o2k7SimpleSkin span.mce_insertunorderedlist {background-position:-20px 0}
35
+ .o2k7SimpleSkin span.mce_insertorderedlist {background-position:-80px 0}
tiny_mce/tiny_mce.js CHANGED
@@ -1 +1 @@
1
- (function(b){var a=/^\s*|\s*$/g,c;b.tinymce=b.tinyMCE={majorVersion:"3",minorVersion:"3b2",releaseDate:"2010-02-04",_init:function(){var r=this,o=document,m=navigator,f=m.userAgent,l,e,k,j,h,q;r.isOpera=b.opera&&opera.buildNumber;r.isWebKit=/WebKit/.test(f);r.isIE=!r.isWebKit&&!r.isOpera&&(/MSIE/gi).test(f)&&(/Explorer/gi).test(m.appName);r.isIE6=r.isIE&&/MSIE [56]/.test(f);r.isGecko=!r.isWebKit&&/Gecko/.test(f);r.isMac=f.indexOf("Mac")!=-1;r.isAir=/adobeair/i.test(f);if(b.tinyMCEPreInit){r.suffix=tinyMCEPreInit.suffix;r.baseURL=tinyMCEPreInit.base;r.query=tinyMCEPreInit.query;return}r.suffix="";e=o.getElementsByTagName("base");for(l=0;l<e.length;l++){if(q=e[l].href){if(/^https?:\/\/[^\/]+$/.test(q)){q+="/"}j=q?q.match(/.*\//)[0]:""}}function g(d){if(d.src&&/tiny_mce(|_gzip|_jquery|_prototype)(_dev|_src)?.js/.test(d.src)){if(/_(src|dev)\.js/g.test(d.src)){r.suffix="_src"}if((h=d.src.indexOf("?"))!=-1){r.query=d.src.substring(h+1)}r.baseURL=d.src.substring(0,d.src.lastIndexOf("/"));if(j&&r.baseURL.indexOf("://")==-1&&r.baseURL.indexOf("/")!==0){r.baseURL=j+r.baseURL}return r.baseURL}return null}e=o.getElementsByTagName("script");for(l=0;l<e.length;l++){if(g(e[l])){return}}k=o.getElementsByTagName("head")[0];if(k){e=k.getElementsByTagName("script");for(l=0;l<e.length;l++){if(g(e[l])){return}}}return},is:function(e,d){if(!d){return e!==c}if(d=="array"&&(e.hasOwnProperty&&e instanceof Array)){return true}return typeof(e)==d},each:function(g,d,f){var h,e;if(!g){return 0}f=f||g;if(g.length!==c){for(h=0,e=g.length;h<e;h++){if(d.call(f,g[h],h,g)===false){return 0}}}else{for(h in g){if(g.hasOwnProperty(h)){if(d.call(f,g[h],h,g)===false){return 0}}}}return 1},map:function(d,e){var g=[];tinymce.each(d,function(f){g.push(e(f))});return g},grep:function(d,e){var g=[];tinymce.each(d,function(f){if(!e||e(f)){g.push(f)}});return g},inArray:function(e,f){var g,d;if(e){for(g=0,d=e.length;g<d;g++){if(e[g]===f){return g}}}return -1},extend:function(j,h){var g,f,d=arguments;for(g=1,f=d.length;g<f;g++){h=d[g];tinymce.each(h,function(e,i){if(e!==c){j[i]=e}})}return j},trim:function(d){return(d?""+d:"").replace(a,"")},create:function(l,d){var k=this,e,g,h,i,f,j=0;l=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(l);h=l[3].match(/(^|\.)(\w+)$/i)[2];g=k.createNS(l[3].replace(/\.\w+$/,""));if(g[h]){return}if(l[2]=="static"){g[h]=d;if(this.onCreate){this.onCreate(l[2],l[3],g[h])}return}if(!d[h]){d[h]=function(){};j=1}g[h]=d[h];k.extend(g[h].prototype,d);if(l[5]){e=k.resolve(l[5]).prototype;i=l[5].match(/\.(\w+)$/i)[1];f=g[h];if(j){g[h]=function(){return e[i].apply(this,arguments)}}else{g[h]=function(){this.parent=e[i];return f.apply(this,arguments)}}g[h].prototype[h]=g[h];k.each(e,function(m,o){g[h].prototype[o]=e[o]});k.each(d,function(m,o){if(e[o]){g[h].prototype[o]=function(){this.parent=e[o];return m.apply(this,arguments)}}else{if(o!=h){g[h].prototype[o]=m}}})}k.each(d["static"],function(m,o){g[h][o]=m});if(this.onCreate){this.onCreate(l[2],l[3],g[h].prototype)}},walk:function(g,e,h,d){d=d||this;if(g){if(h){g=g[h]}tinymce.each(g,function(j,f){if(e.call(d,j,f,h)===false){return false}tinymce.walk(j,e,h,d)})}},createNS:function(g,f){var e,d;f=f||window;g=g.split(".");for(e=0;e<g.length;e++){d=g[e];if(!f[d]){f[d]={}}f=f[d]}return f},resolve:function(g,f){var e,d;f=f||b;g=g.split(".");for(e=0,d=g.length;e<d;e++){f=f[g[e]];if(!f){break}}return f},addUnload:function(h,g){var e=this;h={func:h,scope:g||this};if(!e.unloads){function d(){var f=e.unloads,j,k;if(f){for(k in f){j=f[k];if(j&&j.func){j.func.call(j.scope,1)}}if(b.detachEvent){b.detachEvent("onbeforeunload",i);b.detachEvent("onunload",d)}else{if(b.removeEventListener){b.removeEventListener("unload",d,false)}}e.unloads=j=f=w=d=0;if(b.CollectGarbage){CollectGarbage()}}}function i(){var j=document;if(j.readyState=="interactive"){function f(){j.detachEvent("onstop",f);if(d){d()}j=0}if(j){j.attachEvent("onstop",f)}b.setTimeout(function(){if(j){j.detachEvent("onstop",f)}},0)}}if(b.attachEvent){b.attachEvent("onunload",d);b.attachEvent("onbeforeunload",i)}else{if(b.addEventListener){b.addEventListener("unload",d,false)}}e.unloads=[h]}else{e.unloads.push(h)}return h},removeUnload:function(g){var d=this.unloads,e=null;tinymce.each(d,function(h,f){if(h&&h.func==g){d.splice(f,1);e=g;return false}});return e},explode:function(e,f){return e?tinymce.map(e.split(f||","),tinymce.trim):e},_addVer:function(e){var d;if(!this.query){return e}d=(e.indexOf("?")==-1?"?":"&")+this.query;if(e.indexOf("#")==-1){return e+d}return e.replace("#",d+"#")}};tinymce._init()})(window);tinymce.create("tinymce.util.Dispatcher",{scope:null,listeners:null,Dispatcher:function(a){this.scope=a||this;this.listeners=[]},add:function(a,b){this.listeners.push({cb:a,scope:b||this.scope});return a},addToTop:function(a,b){this.listeners.unshift({cb:a,scope:b||this.scope});return a},remove:function(a){var b=this.listeners,c=null;tinymce.each(b,function(e,d){if(a==e.cb){c=a;b.splice(d,1);return false}});return c},dispatch:function(){var f,d=arguments,e,b=this.listeners,g;for(e=0;e<b.length;e++){g=b[e];f=g.cb.apply(g.scope,d);if(f===false){break}}return f}});(function(){var a=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(e,g){var f=this,h,d,c;e=tinymce.trim(e);g=f.settings=g||{};if(/^(mailto|tel|news|javascript|about|data):/i.test(e)||/^\s*#/.test(e)){f.source=e;return}if(e.indexOf("/")===0&&e.indexOf("//")!==0){e=(g.base_uri?g.base_uri.protocol||"http":"http")+"://mce_host"+e}if(!/^\w*:?\/\//.test(e)){e=(g.base_uri.protocol||"http")+"://mce_host"+f.toAbsPath(g.base_uri.path,e)}e=e.replace(/@@/g,"(mce_at)");e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);a(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(b,j){var k=e[j];if(k){k=k.replace(/\(mce_at\)/g,"@@")}f[b]=k});if(c=g.base_uri){if(!f.protocol){f.protocol=c.protocol}if(!f.userInfo){f.userInfo=c.userInfo}if(!f.port&&f.host=="mce_host"){f.port=c.port}if(!f.host||f.host=="mce_host"){f.host=c.host}f.source=""}},setPath:function(c){var b=this;c=/^(.*?)\/?(\w+)?$/.exec(c);b.path=c[0];b.directory=c[1];b.file=c[2];b.source="";b.getURI()},toRelative:function(b){var c=this,d;if(b==="./"){return b}b=new tinymce.util.URI(b,{base_uri:c});if((b.host!="mce_host"&&c.host!=b.host&&b.host)||c.port!=b.port||c.protocol!=b.protocol){return b.getURI()}d=c.toRelPath(c.path,b.path);if(b.query){d+="?"+b.query}if(b.anchor){d+="#"+b.anchor}return d},toAbsolute:function(b,c){var b=new tinymce.util.URI(b,{base_uri:this});return b.getURI(this.host==b.host&&this.protocol==b.protocol?c:0)},toRelPath:function(g,h){var c,f=0,d="",e,b;g=g.substring(0,g.lastIndexOf("/"));g=g.split("/");c=h.split("/");if(g.length>=c.length){for(e=0,b=g.length;e<b;e++){if(e>=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length<c.length){for(e=0,b=c.length;e<b;e++){if(e>=g.length||g[e]!=c[e]){f=e+1;break}}}if(f==1){return h}for(e=0,b=g.length-(f-1);e<b;e++){d+="../"}for(e=f-1,b=c.length;e<b;e++){if(e!=f-1){d+="/"+c[e]}else{d+=c[e]}}return d},toAbsPath:function(e,f){var c,b=0,h=[],d,g;d=/\/$/.test(f)?"/":"";e=e.split("/");f=f.split("/");a(e,function(i){if(i){h.push(i)}});e=h;for(c=f.length-1,h=[];c>=0;c--){if(f[c].length==0||f[c]=="."){continue}if(f[c]==".."){b++;continue}if(b>0){b--;continue}h.push(f[c])}c=e.length-b;if(c<=0){g=h.reverse().join("/")}else{g=e.slice(0,c).join("/")+"/"+h.reverse().join("/")}if(g.indexOf("/")!==0){g="/"+g}if(d&&g.lastIndexOf("/")!==g.length-1){g+=d}return g},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!=0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(e,b){var c=new Date();c.setTime(c.getTime()-1000);this.set(e,"",c,b,c)}})})();tinymce.create("static tinymce.util.JSON",{serialize:function(e){var c,a,d=tinymce.util.JSON.serialize,b;if(e==null){return"null"}b=typeof e;if(b=="string"){a="\bb\tt\nn\ff\rr\"\"''\\\\";return'"'+e.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g,function(g,f){c=a.indexOf(f);if(c+1){return"\\"+a.charAt(c+1)}g=f.charCodeAt().toString(16);return"\\u"+"0000".substring(g.length)+g})+'"'}if(b=="object"){if(e.hasOwnProperty&&e instanceof Array){for(c=0,a="[";c<e.length;c++){a+=(c>0?",":"")+d(e[c])}return a+"]"}a="{";for(c in e){a+=typeof e[c]!="function"?(a.length>1?',"':'"')+c+'":'+d(e[c]):""}return a+"}"}return""+e},parse:function(s){try{return eval("("+s+")")}catch(ex){}}});tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.send(g.data);function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){e.call(f.error_scope||f.scope,h,g)};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(m){var k=m.each,j=m.is,i=m.isWebKit,d=m.isIE,a=/^(H[1-6R]|P|DIV|ADDRESS|PRE|FORM|T(ABLE|BODY|HEAD|FOOT|H|R|D)|LI|OL|UL|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|MENU|ISINDEX|SAMP)$/,e=g("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"),f=g("src,href,style,coords,shape"),c={"&":"&amp;",'"':"&quot;","<":"&lt;",">":"&gt;"},n=/[<>&\"]/g,b=/^([a-z0-9],?)+$/i,h=/<(\w+)((?:\s+\w+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)(\s*\/?)>/g,l=/(\w+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;function g(q){var p={},o;q=q.split(",");for(o=q.length;o>=0;o--){p[q[o]]=1}return p}m.create("tinymce.dom.DOMUtils",{doc:null,root:null,files:null,pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},DOMUtils:function(u,q){var p=this,o;p.doc=u;p.win=window;p.files={};p.cssFlicker=false;p.counter=0;p.boxModel=!m.isIE||u.compatMode=="CSS1Compat";p.stdMode=u.documentMode===8;p.settings=q=m.extend({keep_values:false,hex_colors:1,process_html:1},q);if(m.isIE6){try{u.execCommand("BackgroundImageCache",false,true)}catch(r){p.cssFlicker=true}}if(q.valid_styles){p._styles={};k(q.valid_styles,function(t,s){p._styles[s]=m.explode(t)})}m.addUnload(p.destroy,p)},getRoot:function(){var o=this,p=o.settings;return(p&&o.get(p.root_element))||o.doc.body},getViewPort:function(p){var q,o;p=!p?this.win:p;q=p.document;o=this.boxModel?q.documentElement:q.body;return{x:p.pageXOffset||o.scrollLeft,y:p.pageYOffset||o.scrollTop,w:p.innerWidth||o.clientWidth,h:p.innerHeight||o.clientHeight}},getRect:function(s){var r,o=this,q;s=o.get(s);r=o.getPos(s);q=o.getSize(s);return{x:r.x,y:r.y,w:q.w,h:q.h}},getSize:function(r){var p=this,o,q;r=p.get(r);o=p.getStyle(r,"width");q=p.getStyle(r,"height");if(o.indexOf("px")===-1){o=0}if(q.indexOf("px")===-1){q=0}return{w:parseInt(o)||r.offsetWidth||r.clientWidth,h:parseInt(q)||r.offsetHeight||r.clientHeight}},getParent:function(q,p,o){return this.getParents(q,p,o,false)},getParents:function(z,v,s,y){var q=this,p,u=q.settings,x=[];z=q.get(z);y=y===undefined;if(u.strict_root){s=s||q.getRoot()}if(j(v,"string")){p=v;if(v==="*"){v=function(o){return o.nodeType==1}}else{v=function(o){return q.is(o,p)}}}while(z){if(z==s||!z.nodeType||z.nodeType===9){break}if(!v||v(z)){if(y){x.push(z)}else{return z}}z=z.parentNode}return y?x:null},get:function(o){var p;if(o&&this.doc&&typeof(o)=="string"){p=o;o=this.doc.getElementById(o);if(o&&o.id!==p){return this.doc.getElementsByName(p)[1]}}return o},getNext:function(p,o){return this._findSib(p,o,"nextSibling")},getPrev:function(p,o){return this._findSib(p,o,"previousSibling")},select:function(q,p){var o=this;return m.dom.Sizzle(q,o.get(p)||o.get(o.settings.root_element)||o.doc,[])},is:function(q,o){var p;if(q.length===undefined){if(o==="*"){return q.nodeType==1}if(b.test(o)){o=o.toLowerCase().split(/,/);q=q.nodeName.toLowerCase();for(p=o.length-1;p>=0;p--){if(o[p]==q){return true}}return false}}return m.dom.Sizzle.matches(o,q.nodeType?[q]:q).length>0},add:function(s,v,o,r,u){var q=this;return this.run(s,function(y){var x,t;x=j(v,"string")?q.doc.createElement(v):v;q.setAttribs(x,o);if(r){if(r.nodeType){x.appendChild(r)}else{q.setHTML(x,r)}}return !u?y.appendChild(x):x})},create:function(q,o,p){return this.add(this.doc.createElement(q),q,o,p,1)},createHTML:function(v,p,s){var u="",r=this,q;u+="<"+v;for(q in p){if(p.hasOwnProperty(q)){u+=" "+q+'="'+r.encode(p[q])+'"'}}if(m.is(s)){return u+">"+s+"</"+v+">"}return u+" />"},remove:function(q,o){var p=this;return this.run(q,function(u){var t,s,r;t=u.parentNode;if(!t){return null}if(o){for(r=u.childNodes.length-1;r>=0;r--){p.insertAfter(u.childNodes[r],u)}}if(p.fixPsuedoLeaks){t=u.cloneNode(true);o="IELeakGarbageBin";s=p.get(o)||p.add(p.doc.body,"div",{id:o,style:"display:none"});s.appendChild(u);s.innerHTML="";return t}return t.removeChild(u)})},setStyle:function(r,o,p){var q=this;return q.run(r,function(v){var u,t;u=v.style;o=o.replace(/-(\D)/g,function(x,s){return s.toUpperCase()});if(q.pixelStyles.test(o)&&(m.is(p,"number")||/^[\-0-9\.]+$/.test(p))){p+="px"}switch(o){case"opacity":if(d){u.filter=p===""?"":"alpha(opacity="+(p*100)+")";if(!r.currentStyle||!r.currentStyle.hasLayout){u.display="inline-block"}}u[o]=u["-moz-opacity"]=u["-khtml-opacity"]=p||"";break;case"float":d?u.styleFloat=p:u.cssFloat=p;break;default:u[o]=p||""}if(q.settings.update_styles){q.setAttrib(v,"_mce_style")}})},getStyle:function(r,o,q){r=this.get(r);if(!r){return false}if(this.doc.defaultView&&q){o=o.replace(/[A-Z]/g,function(s){return"-"+s});try{return this.doc.defaultView.getComputedStyle(r,null).getPropertyValue(o)}catch(p){return null}}o=o.replace(/-(\D)/g,function(t,s){return s.toUpperCase()});if(o=="float"){o=d?"styleFloat":"cssFloat"}if(r.currentStyle&&q){return r.currentStyle[o]}return r.style[o]},setStyles:function(u,v){var q=this,r=q.settings,p;p=r.update_styles;r.update_styles=0;k(v,function(o,s){q.setStyle(u,s,o)});r.update_styles=p;if(r.update_styles){q.setAttrib(u,r.cssText)}},setAttrib:function(q,r,o){var p=this;if(!q||!r){return}if(p.settings.strict){r=r.toLowerCase()}return this.run(q,function(u){var t=p.settings;switch(r){case"style":if(!j(o,"string")){k(o,function(s,x){p.setStyle(u,x,s)});return}if(t.keep_values){if(o&&!p._isRes(o)){u.setAttribute("_mce_style",o,2)}else{u.removeAttribute("_mce_style",2)}}u.style.cssText=o;break;case"class":u.className=o||"";break;case"src":case"href":if(t.keep_values){if(t.url_converter){o=t.url_converter.call(t.url_converter_scope||p,o,r,u)}p.setAttrib(u,"_mce_"+r,o,2)}break;case"shape":u.setAttribute("_mce_style",o);break}if(j(o)&&o!==null&&o.length!==0){u.setAttribute(r,""+o,2)}else{u.removeAttribute(r,2)}})},setAttribs:function(q,r){var p=this;return this.run(q,function(o){k(r,function(s,t){p.setAttrib(o,t,s)})})},getAttrib:function(r,s,q){var o,p=this;r=p.get(r);if(!r||r.nodeType!==1){return false}if(!j(q)){q=""}if(/^(src|href|style|coords|shape)$/.test(s)){o=r.getAttribute("_mce_"+s);if(o){return o}}if(d&&p.props[s]){o=r[p.props[s]];o=o&&o.nodeValue?o.nodeValue:o}if(!o){o=r.getAttribute(s,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(s)){if(r[p.props[s]]===true&&o===""){return s}return o?s:""}if(r.nodeName==="FORM"&&r.getAttributeNode(s)){return r.getAttributeNode(s).nodeValue}if(s==="style"){o=o||r.style.cssText;if(o){o=p.serializeStyle(p.parseStyle(o),r.nodeName);if(p.settings.keep_values&&!p._isRes(o)){r.setAttribute("_mce_style",o)}}}if(i&&s==="class"&&o){o=o.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(d){switch(s){case"rowspan":case"colspan":if(o===1){o=""}break;case"size":if(o==="+0"||o===20||o===0){o=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(o===0){o=""}break;case"hspace":if(o===-1){o=""}break;case"maxlength":case"tabindex":if(o===32768||o===2147483647||o==="32768"){o=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(o===65535){return s}return q;case"shape":o=o.toLowerCase();break;default:if(s.indexOf("on")===0&&o){o=(""+o).replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1")}}}return(o!==undefined&&o!==null&&o!=="")?""+o:q},getPos:function(A,s){var p=this,o=0,z=0,u,v=p.doc,q;A=p.get(A);s=s||v.body;if(A){if(d&&!p.stdMode){A=A.getBoundingClientRect();u=p.boxModel?v.documentElement:v.body;o=p.getStyle(p.select("html")[0],"borderWidth");o=(o=="medium"||p.boxModel&&!p.isIE6)&&2||o;A.top+=p.win.self!=p.win.top?2:0;return{x:A.left+u.scrollLeft-o,y:A.top+u.scrollTop-o}}q=A;while(q&&q!=s&&q.nodeType){o+=q.offsetLeft||0;z+=q.offsetTop||0;q=q.offsetParent}q=A.parentNode;while(q&&q!=s&&q.nodeType){o-=q.scrollLeft||0;z-=q.scrollTop||0;q=q.parentNode}}return{x:o,y:z}},parseStyle:function(r){var u=this,v=u.settings,x={};if(!r){return x}function p(D,A,C){var z,B,o,y;z=x[D+"-top"+A];if(!z){return}B=x[D+"-right"+A];if(z!=B){return}o=x[D+"-bottom"+A];if(B!=o){return}y=x[D+"-left"+A];if(o!=y){return}x[C]=y;delete x[D+"-top"+A];delete x[D+"-right"+A];delete x[D+"-bottom"+A];delete x[D+"-left"+A]}function q(y,s,o,A){var z;z=x[s];if(!z){return}z=x[o];if(!z){return}z=x[A];if(!z){return}x[y]=x[s]+" "+x[o]+" "+x[A];delete x[s];delete x[o];delete x[A]}r=r.replace(/&(#?[a-z0-9]+);/g,"&$1_MCE_SEMI_");k(r.split(";"),function(s){var o,t=[];if(s){s=s.replace(/_MCE_SEMI_/g,";");s=s.replace(/url\([^\)]+\)/g,function(y){t.push(y);return"url("+t.length+")"});s=s.split(":");o=m.trim(s[1]);o=o.replace(/url\(([^\)]+)\)/g,function(z,y){return t[parseInt(y)-1]});o=o.replace(/rgb\([^\)]+\)/g,function(y){return u.toHex(y)});if(v.url_converter){o=o.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g,function(y,z){return"url("+v.url_converter.call(v.url_converter_scope||u,u.decode(z),"style",null)+")"})}x[m.trim(s[0]).toLowerCase()]=o}});p("border","","border");p("border","-width","border-width");p("border","-color","border-color");p("border","-style","border-style");p("padding","","padding");p("margin","","margin");q("border","border-width","border-style","border-color");if(d){if(x.border=="medium none"){x.border=""}}return x},serializeStyle:function(v,p){var q=this,r="";function u(s,o){if(o&&s){if(o.indexOf("-")===0){return}switch(o){case"font-weight":if(s==700){s="bold"}break;case"color":case"background-color":s=s.toLowerCase();break}r+=(r?" ":"")+o+": "+s+";"}}if(p&&q._styles){k(q._styles["*"],function(o){u(v[o],o)});k(q._styles[p.toLowerCase()],function(o){u(v[o],o)})}else{k(v,u)}return r},loadCSS:function(o){var q=this,r=q.doc,p;if(!o){o=""}p=q.select("head")[0];k(o.split(","),function(s){var t;if(q.files[s]){return}q.files[s]=true;t=q.create("link",{rel:"stylesheet",href:m._addVer(s)});if(d&&r.documentMode){t.onload=function(){r.recalc();t.onload=null}}p.appendChild(t)})},addClass:function(o,p){return this.run(o,function(q){var r;if(!p){return 0}if(this.hasClass(q,p)){return q.className}r=this.removeClass(q,p);return q.className=(r!=""?(r+" "):"")+p})},removeClass:function(q,r){var o=this,p;return o.run(q,function(t){var s;if(o.hasClass(t,r)){if(!p){p=new RegExp("(^|\\s+)"+r+"(\\s+|$)","g")}s=t.className.replace(p," ");s=m.trim(s!=" "?s:"");t.className=s;if(!s){t.removeAttribute("class")}return s}return t.className})},hasClass:function(p,o){p=this.get(p);if(!p||!o){return false}return(" "+p.className+" ").indexOf(" "+o+" ")!==-1},show:function(o){return this.setStyle(o,"display","block")},hide:function(o){return this.setStyle(o,"display","none")},isHidden:function(o){o=this.get(o);return !o||o.style.display=="none"||this.getStyle(o,"display")=="none"},uniqueId:function(o){return(!o?"mce_":o)+(this.counter++)},setHTML:function(q,p){var o=this;return this.run(q,function(v){var r,t,s,z,u,r;p=o.processHTML(p);if(d){function y(){while(v.firstChild){v.firstChild.removeNode()}try{v.innerHTML="<br />"+p;v.removeChild(v.firstChild)}catch(x){r=o.create("div");r.innerHTML="<br />"+p;k(r.childNodes,function(B,A){if(A){v.appendChild(B)}})}}if(o.settings.fix_ie_paragraphs){p=p.replace(/<p><\/p>|<p([^>]+)><\/p>|<p[^\/+]\/>/gi,'<p$1 _mce_keep="true">&nbsp;</p>')}y();if(o.settings.fix_ie_paragraphs){s=v.getElementsByTagName("p");for(t=s.length-1,r=0;t>=0;t--){z=s[t];if(!z.hasChildNodes()){if(!z._mce_keep){r=1;break}z.removeAttribute("_mce_keep")}}}if(r){p=p.replace(/<p ([^>]+)>|<p>/ig,'<div $1 _mce_tmp="1">');p=p.replace(/<\/p>/g,"</div>");y();if(o.settings.fix_ie_paragraphs){s=v.getElementsByTagName("DIV");for(t=s.length-1;t>=0;t--){z=s[t];if(z._mce_tmp){u=o.doc.createElement("p");z.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi,function(A,x){var B;if(x!=="_mce_tmp"){B=z.getAttribute(x);if(!B&&x==="class"){B=z.className}u.setAttribute(x,B)}});for(r=0;r<z.childNodes.length;r++){u.appendChild(z.childNodes[r].cloneNode(true))}z.swapNode(u)}}}}}else{v.innerHTML=p}return p})},processHTML:function(r){var p=this,q=p.settings,v=[];if(!q.process_html){return r}if(d){r=r.replace(/&apos;/g,"&#39;");r=r.replace(/\s+(disabled|checked|readonly|selected)\s*=\s*[\"\']?(false|0)[\"\']?/gi,"")}r=r.replace(/<a( )([^>]+)\/>|<a\/>/gi,"<a$1$2></a>");if(q.keep_values){if(/<script|noscript|style/i.test(r)){function o(t){t=t.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n");t=t.replace(/^[\r\n]*|[\r\n]*$/g,"");t=t.replace(/^\s*(\/\/\s*<!--|\/\/\s*<!\[CDATA\[|<!--|<!\[CDATA\[)[\r\n]*/g,"");t=t.replace(/\s*(\/\/\s*\]\]>|\/\/\s*-->|\]\]>|-->|\]\]-->)\s*$/g,"");return t}r=r.replace(/<script([^>]+|)>([\s\S]*?)<\/script>/gi,function(s,x,t){if(!x){x=' type="text/javascript"'}x=x.replace(/src=\"([^\"]+)\"?/i,function(y,z){if(q.url_converter){z=p.encode(q.url_converter.call(q.url_converter_scope||p,p.decode(z),"src","script"))}return'_mce_src="'+z+'"'});if(m.trim(t)){v.push(o(t));t="<!--\nMCE_SCRIPT:"+(v.length-1)+"\n// -->"}return"<mce:script"+x+">"+t+"</mce:script>"});r=r.replace(/<style([^>]+|)>([\s\S]*?)<\/style>/gi,function(s,x,t){if(t){v.push(o(t));t="<!--\nMCE_SCRIPT:"+(v.length-1)+"\n-->"}return"<mce:style"+x+">"+t+"</mce:style><style "+x+' _mce_bogus="1">'+t+"</style>"});r=r.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g,function(s,x,t){return"<mce:noscript"+x+"><!--"+p.encode(t).replace(/--/g,"&#45;&#45;")+"--></mce:noscript>"})}r=r.replace(/<!\[CDATA\[([\s\S]+)\]\]>/g,"<!--[CDATA[$1]]-->");function u(s){return s.replace(h,function(y,z,x,t){return"<"+z+x.replace(l,function(B,A,E,D,C){var F;A=A.toLowerCase();E=E||D||C||"";if(e[A]){if(E==="false"||E==="0"){return}return A+'="'+A+'"'}if(f[A]&&x.indexOf("_mce_"+A)==-1){F=p.decode(E);if(q.url_converter&&(A=="src"||A=="href")){F=q.url_converter.call(q.url_converter_scope||p,F,A,z)}if(A=="style"){F=p.serializeStyle(p.parseStyle(F),A)}return A+'="'+E+'" _mce_'+A+'="'+p.encode(F)+'"'}return B})+t+">"})}r=u(r);r=r.replace(/MCE_SCRIPT:([0-9]+)/g,function(t,s){return v[s]})}return r},getOuterHTML:function(o){var p;o=this.get(o);if(!o){return null}if(o.outerHTML!==undefined){return o.outerHTML}p=(o.ownerDocument||this.doc).createElement("body");p.appendChild(o.cloneNode(true));return p.innerHTML},setOuterHTML:function(r,p,s){var o=this;function q(u,t,x){var y,v;v=x.createElement("body");v.innerHTML=t;y=v.lastChild;while(y){o.insertAfter(y.cloneNode(true),u);y=y.previousSibling}o.remove(u)}return this.run(r,function(u){u=o.get(u);if(u.nodeType==1){s=s||u.ownerDocument||o.doc;if(d){try{if(d&&u.nodeType==1){u.outerHTML=p}else{q(u,p,s)}}catch(t){q(u,p,s)}}else{q(u,p,s)}}})},decode:function(p){var q,r,o;if(/&[\w#]+;/.test(p)){q=this.doc.createElement("div");q.innerHTML=p;r=q.firstChild;o="";if(r){do{o+=r.nodeValue}while(r=r.nextSibling)}return o||p}return p},encode:function(o){return(""+o).replace(n,function(p){return c[p]})},insertAfter:function(q,p){var o=this;p=o.get(p);return this.run(q,function(t){var s,r;s=p.parentNode;r=p.nextSibling;if(r){s.insertBefore(t,r)}else{s.appendChild(t)}return t})},isBlock:function(o){if(o.nodeType&&o.nodeType!==1){return false}o=o.nodeName||o;return a.test(o)},replace:function(s,r,p){var q=this;if(j(r,"array")){s=s.cloneNode(true)}return q.run(r,function(t){if(p){k(m.grep(t.childNodes),function(o){s.appendChild(o)})}if(q.fixPsuedoLeaks&&t.nodeType===1){t.parentNode.insertBefore(s,t);q.remove(t);return s}return t.parentNode.replaceChild(s,t)})},rename:function(r,o){var q=this,p;if(r.nodeName!=o.toUpperCase()){p=q.create(o);k(q.getAttribs(r),function(s){q.setAttrib(p,s.nodeName,q.getAttrib(r,s.nodeName))});q.replace(p,r,1)}return p||r},findCommonAncestor:function(q,o){var r=q,p;while(r){p=o;while(p&&r!=p){p=p.parentNode}if(r==p){break}r=r.parentNode}if(!r&&q.ownerDocument){return q.ownerDocument.documentElement}return r},toHex:function(o){var q=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(o);function p(r){r=parseInt(r).toString(16);return r.length>1?r:"0"+r}if(q){o="#"+p(q[1])+p(q[2])+p(q[3]);return o}return o},getClasses:function(){var s=this,o=[],r,u={},v=s.settings.class_filter,q;if(s.classes){return s.classes}function x(t){k(t.imports,function(y){x(y)});k(t.cssRules||t.rules,function(y){switch(y.type||1){case 1:if(y.selectorText){k(y.selectorText.split(","),function(z){z=z.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(z)||!/\.[\w\-]+$/.test(z)){return}q=z;z=z.replace(/.*\.([a-z0-9_\-]+).*/i,"$1");if(v&&!(z=v(z,q))){return}if(!u[z]){o.push({"class":z});u[z]=1}})}break;case 3:x(y.styleSheet);break}})}try{k(s.doc.styleSheets,x)}catch(p){}if(o.length>0){s.classes=o}return o},run:function(u,r,q){var p=this,v;if(p.doc&&typeof(u)==="string"){u=p.get(u)}if(!u){return false}q=q||this;if(!u.nodeType&&(u.length||u.length===0)){v=[];k(u,function(s,o){if(s){if(typeof(s)=="string"){s=p.doc.getElementById(s)}v.push(r.call(q,s,o))}});return v}return r.call(q,u)},getAttribs:function(q){var p;q=this.get(q);if(!q){return[]}if(d){p=[];if(q.nodeName=="OBJECT"){return q.attributes}if(q.nodeName==="OPTION"&&this.getAttrib(q,"selected")){p.push({specified:1,nodeName:"selected"})}q.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(o){p.push({specified:1,nodeName:o})});return p}return q.attributes},destroy:function(p){var o=this;if(o.events){o.events.destroy()}o.win=o.doc=o.root=o.events=null;if(!p){m.removeUnload(o.destroy)}},createRng:function(){var o=this.doc;return o.createRange?o.createRange():new m.dom.Range(this)},nodeIndex:function(r,s){var o=0,q,p;if(r){for(r=r.previousSibling,q=r;r;r=r.previousSibling){p=r.nodeType;if(s&&p==3){if(r.nodeValue.length>0&&(q.nodeType!=p||q.nodeValue.length===0)){o++}}else{o++}q=r}}return o},split:function(u,s,y){var z=this,o=z.createRng(),v,q,x;function p(A){var t,r=A.childNodes;if(A.nodeType==1&&A.getAttribute("_mce_type")=="bookmark"){return}for(t=r.length-1;t>=0;t--){p(r[t])}if(A.nodeType!=9){if(A.nodeType==3&&A.nodeValue.length>0){return}if(A.nodeType==1){r=A.childNodes;if(r.length==1&&r[0]&&r[0].nodeType==1&&r[0].getAttribute("_mce_type")=="bookmark"){A.parentNode.insertBefore(r[0],A)}if(r.length||/^(br|hr|input|img)$/i.test(A.nodeName)){return}}z.remove(A)}return A}if(u&&s){o.setStart(u.parentNode,z.nodeIndex(u));o.setEnd(s.parentNode,z.nodeIndex(s));v=o.extractContents();o=z.createRng();o.setStart(s.parentNode,z.nodeIndex(s)+1);o.setEnd(u.parentNode,z.nodeIndex(u)+1);q=o.extractContents();x=u.parentNode;x.insertBefore(p(v),u);if(y){x.replaceChild(y,s)}else{x.insertBefore(s,u)}x.insertBefore(p(q),u);z.remove(u);return y||s}},bind:function(s,o,r,q){var p=this;if(!p.events){p.events=new m.dom.EventUtils()}return p.events.add(s,o,r,q||this)},unbind:function(r,o,q){var p=this;if(!p.events){p.events=new m.dom.EventUtils()}return p.events.remove(r,o,q)},_findSib:function(r,o,p){var q=this,s=o;if(r){if(j(s,"string")){s=function(t){return q.is(t,o)}}for(r=r[p];r;r=r[p]){if(s(r)){return r}}}return null},_isRes:function(o){return/^(top|left|bottom|right|width|height)/i.test(o)||/;\s*(top|left|bottom|right|width|height)/i.test(o)}});m.DOM=new m.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(a){function b(c){var N=this,e=c.doc,S=0,E=1,j=2,D=true,R=false,U="startOffset",h="startContainer",P="endContainer",z="endOffset",k=tinymce.extend,n=c.nodeIndex;k(N,{startContainer:e,startOffset:0,endContainer:e,endOffset:0,collapsed:D,commonAncestorContainer:e,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:q,setEnd:s,setStartBefore:g,setStartAfter:I,setEndBefore:J,setEndAfter:u,collapse:A,selectNode:x,selectNodeContents:F,compareBoundaryPoints:v,deleteContents:p,extractContents:H,cloneContents:d,insertNode:C,surroundContents:M,cloneRange:K});function q(V,t){B(D,V,t)}function s(V,t){B(R,V,t)}function g(t){q(t.parentNode,n(t))}function I(t){q(t.parentNode,n(t)+1)}function J(t){s(t.parentNode,n(t))}function u(t){s(t.parentNode,n(t)+1)}function A(t){if(t){N[P]=N[h];N[z]=N[U]}else{N[h]=N[P];N[U]=N[z]}N.collapsed=D}function x(t){g(t);u(t)}function F(t){q(t,0);s(t,t.nodeType===1?t.childNodes.length:t.nodeValue.length)}function v(W,X){var Z=N[h],Y=N[U],V=N[P],t=N[z];if(W===0){return G(Z,Y,Z,Y)}if(W===1){return G(Z,Y,V,t)}if(W===2){return G(V,t,V,t)}if(W===3){return G(V,t,Z,Y)}}function p(){m(j)}function H(){return m(S)}function d(){return m(E)}function C(Y){var V=this[h],t=this[U],X,W;if((V.nodeType===3||V.nodeType===4)&&V.nodeValue){if(!t){V.parentNode.insertBefore(Y,V)}else{if(t>=V.nodeValue.length){c.insertAfter(Y,V)}else{X=V.splitText(t);V.parentNode.insertBefore(Y,X)}}}else{if(V.childNodes.length>0){W=V.childNodes[t]}if(W){V.insertBefore(Y,W)}else{V.appendChild(Y)}}}function M(V){var t=N.extractContents();N.insertNode(V);V.appendChild(t);N.selectNode(V)}function K(){return k(new b(c),{startContainer:N[h],startOffset:N[U],endContainer:N[P],endOffset:N[z],collapsed:N.collapsed,commonAncestorContainer:N.commonAncestorContainer})}function O(t,V){var W;if(t.nodeType==3){return t}if(V<0){return t}W=t.firstChild;while(W&&V>0){--V;W=W.nextSibling}if(W){return W}return t}function l(){return(N[h]==N[P]&&N[U]==N[z])}function G(X,Z,V,Y){var aa,W,t,ab,ad,ac;if(X==V){if(Z==Y){return 0}if(Z<Y){return -1}return 1}aa=V;while(aa&&aa.parentNode!=X){aa=aa.parentNode}if(aa){W=0;t=X.firstChild;while(t!=aa&&W<Z){W++;t=t.nextSibling}if(Z<=W){return -1}return 1}aa=X;while(aa&&aa.parentNode!=V){aa=aa.parentNode}if(aa){W=0;t=V.firstChild;while(t!=aa&&W<Y){W++;t=t.nextSibling}if(W<Y){return -1}return 1}ab=c.findCommonAncestor(X,V);ad=X;while(ad&&ad.parentNode!=ab){ad=ad.parentNode}if(!ad){ad=ab}ac=V;while(ac&&ac.parentNode!=ab){ac=ac.parentNode}if(!ac){ac=ab}if(ad==ac){return 0}t=ab.firstChild;while(t){if(t==ad){return -1}if(t==ac){return 1}t=t.nextSibling}}function B(V,Y,X){var t,W;if(V){N[h]=Y;N[U]=X}else{N[P]=Y;N[z]=X}t=N[P];while(t.parentNode){t=t.parentNode}W=N[h];while(W.parentNode){W=W.parentNode}if(W==t){if(G(N[h],N[U],N[P],N[z])>0){N.collapse(V)}}else{N.collapse(V)}N.collapsed=l();N.commonAncestorContainer=c.findCommonAncestor(N[h],N[P])}function m(ab){var aa,X=0,ad=0,V,Z,W,Y,t,ac;if(N[h]==N[P]){return f(ab)}for(aa=N[P],V=aa.parentNode;V;aa=V,V=V.parentNode){if(V==N[h]){return r(aa,ab)}++X}for(aa=N[h],V=aa.parentNode;V;aa=V,V=V.parentNode){if(V==N[P]){return T(aa,ab)}++ad}Z=ad-X;W=N[h];while(Z>0){W=W.parentNode;Z--}Y=N[P];while(Z<0){Y=Y.parentNode;Z++}for(t=W.parentNode,ac=Y.parentNode;t!=ac;t=t.parentNode,ac=ac.parentNode){W=t;Y=ac}return o(W,Y,ab)}function f(Z){var ab,Y,X,aa,t,W,V;if(Z!=j){ab=e.createDocumentFragment()}if(N[U]==N[z]){return ab}if(N[h].nodeType==3){Y=N[h].nodeValue;X=Y.substring(N[U],N[z]);if(Z!=E){N[h].deleteData(N[U],N[z]-N[U]);N.collapse(D)}if(Z==j){return}ab.appendChild(e.createTextNode(X));return ab}aa=O(N[h],N[U]);t=N[z]-N[U];while(t>0){W=aa.nextSibling;V=y(aa,Z);if(ab){ab.appendChild(V)}--t;aa=W}if(Z!=E){N.collapse(D)}return ab}function r(ab,Y){var aa,Z,V,t,X,W;if(Y!=j){aa=e.createDocumentFragment()}Z=i(ab,Y);if(aa){aa.appendChild(Z)}V=n(ab);t=V-N[U];if(t<=0){if(Y!=E){N.setEndBefore(ab);N.collapse(R)}return aa}Z=ab.previousSibling;while(t>0){X=Z.previousSibling;W=y(Z,Y);if(aa){aa.insertBefore(W,aa.firstChild)}--t;Z=X}if(Y!=E){N.setEndBefore(ab);N.collapse(R)}return aa}function T(Z,Y){var ab,V,aa,t,X,W;if(Y!=j){ab=e.createDocumentFragment()}aa=Q(Z,Y);if(ab){ab.appendChild(aa)}V=n(Z);++V;t=N[z]-V;aa=Z.nextSibling;while(t>0){X=aa.nextSibling;W=y(aa,Y);if(ab){ab.appendChild(W)}--t;aa=X}if(Y!=E){N.setStartAfter(Z);N.collapse(D)}return ab}function o(Z,t,ac){var W,ae,Y,aa,ab,V,ad,X;if(ac!=j){ae=e.createDocumentFragment()}W=Q(Z,ac);if(ae){ae.appendChild(W)}Y=Z.parentNode;aa=n(Z);ab=n(t);++aa;V=ab-aa;ad=Z.nextSibling;while(V>0){X=ad.nextSibling;W=y(ad,ac);if(ae){ae.appendChild(W)}ad=X;--V}W=i(t,ac);if(ae){ae.appendChild(W)}if(ac!=E){N.setStartAfter(Z);N.collapse(D)}return ae}function i(aa,ab){var W=O(N[P],N[z]-1),ac,Z,Y,t,V,X=W!=N[P];if(W==aa){return L(W,X,R,ab)}ac=W.parentNode;Z=L(ac,R,R,ab);while(ac){while(W){Y=W.previousSibling;t=L(W,X,R,ab);if(ab!=j){Z.insertBefore(t,Z.firstChild)}X=D;W=Y}if(ac==aa){return Z}W=ac.previousSibling;ac=ac.parentNode;V=L(ac,R,R,ab);if(ab!=j){V.appendChild(Z)}Z=V}}function Q(aa,ab){var X=O(N[h],N[U]),Y=X!=N[h],ac,Z,W,t,V;if(X==aa){return L(X,Y,D,ab)}ac=X.parentNode;Z=L(ac,R,D,ab);while(ac){while(X){W=X.nextSibling;t=L(X,Y,D,ab);if(ab!=j){Z.appendChild(t)}Y=D;X=W}if(ac==aa){return Z}X=ac.nextSibling;ac=ac.parentNode;V=L(ac,R,D,ab);if(ab!=j){V.appendChild(Z)}Z=V}}function L(t,Y,ab,ac){var X,W,Z,V,aa;if(Y){return y(t,ac)}if(t.nodeType==3){X=t.nodeValue;if(ab){V=N[U];W=X.substring(V);Z=X.substring(0,V)}else{V=N[z];W=X.substring(0,V);Z=X.substring(V)}if(ac!=E){t.nodeValue=Z}if(ac==j){return}aa=t.cloneNode(R);aa.nodeValue=W;return aa}if(ac==j){return}return t.cloneNode(R)}function y(V,t){if(t!=j){return t==E?V.cloneNode(D):V}V.parentNode.removeChild(V)}}a.Range=b})(tinymce.dom);(function(){function a(e){var d=this,i="\uFEFF",b,h,g=e.dom;function c(k,j){if(k&&j){if(k.item&&j.item&&k.item(0)===j.item(0)){return 1}if(k.isEqual&&j.isEqual&&j.isEqual(k)){return 1}}return 0}function f(){var n=e.getRng(),j=g.createRng(),k,l,p,o;l=n.item?n.item(0):n.parentElement();if(l.ownerDocument!=g.doc){return j}if(n.item||!l.hasChildNodes()){j.setStart(l.parentNode,g.nodeIndex(l));j.setEnd(j.startContainer,j.startOffset+1);return j}k=n.duplicate();p=e.isCollapsed();n.collapse();n.pasteHTML('<span id="_mce_start" style="display:none;line-height:0">\uFEFF</span>');if(!p){k.collapse(false);k.pasteHTML('<span id="_mce_end" style="display:none;line-height:0">\uFEFF</span>')}function m(u){var r,t,q,s;q=g.get("_mce_"+(u?"start":"end"));s=q.previousSibling;if(s&&s.nodeType==3){r=s;t=r.nodeValue.length;g.remove(q);s=r.nextSibling;if(s&&s.nodeType==3){o=true;r.appendData(s.nodeValue);g.remove(s)}}else{s=q.nextSibling;if(s&&s.nodeType==3){r=s;t=0}else{if(s){t=g.nodeIndex(s)-1}else{t=g.nodeIndex(q)}r=q.parentNode}g.remove(q)}if(u){j.setStart(r,t)}if(!u||p){j.setEnd(r,t)}}m(true);if(!p){m(false)}if(o){d.addRange(j)}return j}this.addRange=function(k){var s,y,x=e.dom.doc,q=x.body,t,m,v,n,r,j,o,p,u,l;this.destroy();v=k.startContainer;n=k.startOffset;r=k.endContainer;j=k.endOffset;s=q.createTextRange();if(v==x||r==x){s=q.createTextRange();s.collapse();s.select();return}if(v.nodeType==1&&v.hasChildNodes()){p=v.childNodes.length-1;if(n>p){u=1;v=v.childNodes[p]}else{v=v.childNodes[n]}if(v.nodeType==3){n=0}}if(r.nodeType==1&&r.hasChildNodes()){p=r.childNodes.length-1;if(j==0){l=1;r=r.childNodes[0]}else{r=r.childNodes[Math.min(p,j-1)];if(r.nodeType==3){j=r.nodeValue.length}}}if(v==r&&v.nodeType==1){if(/^(IMG|TABLE)$/.test(v.nodeName)&&n!=j){s=q.createControlRange();s.addElement(v)}else{s=q.createTextRange();if(!v.hasChildNodes()&&v.canHaveHTML){v.innerHTML=i}s.moveToElementText(v);if(v.innerHTML==i){s.collapse(true);v.removeChild(v.firstChild)}}if(n==j){s.collapse(j<=k.endContainer.childNodes.length-1)}s.select();s.scrollIntoView();return}s=q.createTextRange();o=x.createElement("span");o.innerHTML=" ";if(v.nodeType==3){if(u){g.insertAfter(o,v)}else{v.parentNode.insertBefore(o,v)}s.moveToElementText(o);o.parentNode.removeChild(o);s.move("character",n)}else{s.moveToElementText(v);if(u){s.collapse(false)}}if(v==r&&v.nodeType==3){s.moveEnd("character",j-n);s.select();s.scrollIntoView();return}y=q.createTextRange();if(r.nodeType==3){r.parentNode.insertBefore(o,r);y.moveToElementText(o);o.parentNode.removeChild(o);y.move("character",j);s.setEndPoint("EndToStart",y)}else{y.moveToElementText(r);y.collapse(!!l);s.setEndPoint("EndToEnd",y)}s.select();s.scrollIntoView()};this.getRangeAt=function(){if(!b||!c(h,e.getRng())){b=f();h=e.getRng()}return b};this.destroy=function(){h=b=null};if(e.dom.boxModel){(function(){var p=g.doc,k=p.body,m,n;p.documentElement.unselectable=true;function o(q,t){var r=k.createTextRange();try{r.moveToPoint(q,t)}catch(s){r=null}return r}function l(r){var q;if(r.button){q=o(r.x,r.y);if(q){if(q.compareEndPoints("StartToStart",n)>0){q.setEndPoint("StartToStart",n)}else{q.setEndPoint("EndToEnd",n)}q.select()}}else{j()}}function j(){g.unbind(p,"mouseup",j);g.unbind(p,"mousemove",l);m=0}g.bind(p,"mousedown",function(q){if(q.target.nodeName==="HTML"){if(m){j()}m=1;n=o(q.x,q.y);if(n){g.bind(p,"mouseup",j);g.bind(p,"mousemove",l);n.select()}}})})()}}tinymce.dom.TridentSelection=a})();(function(){var p=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,i=0,d=Object.prototype.toString,n=false;var b=function(E,t,B,v){B=B||[];var e=t=t||document;if(t.nodeType!==1&&t.nodeType!==9){return[]}if(!E||typeof E!=="string"){return B}var C=[],D,z,H,G,A,s,r=true,x=o(t);p.lastIndex=0;while((D=p.exec(E))!==null){C.push(D[1]);if(D[2]){s=RegExp.rightContext;break}}if(C.length>1&&j.exec(E)){if(C.length===2&&f.relative[C[0]]){z=g(C[0]+C[1],t)}else{z=f.relative[C[0]]?[t]:b(C.shift(),t);while(C.length){E=C.shift();if(f.relative[E]){E+=C.shift()}z=g(E,z)}}}else{if(!v&&C.length>1&&t.nodeType===9&&!x&&f.match.ID.test(C[0])&&!f.match.ID.test(C[C.length-1])){var I=b.find(C.shift(),t,x);t=I.expr?b.filter(I.expr,I.set)[0]:I.set[0]}if(t){var I=v?{expr:C.pop(),set:a(v)}:b.find(C.pop(),C.length===1&&(C[0]==="~"||C[0]==="+")&&t.parentNode?t.parentNode:t,x);z=I.expr?b.filter(I.expr,I.set):I.set;if(C.length>0){H=a(z)}else{r=false}while(C.length){var u=C.pop(),y=u;if(!f.relative[u]){u=""}else{y=C.pop()}if(y==null){y=t}f.relative[u](H,y,x)}}else{H=C=[]}}if(!H){H=z}if(!H){throw"Syntax error, unrecognized expression: "+(u||E)}if(d.call(H)==="[object Array]"){if(!r){B.push.apply(B,H)}else{if(t&&t.nodeType===1){for(var F=0;H[F]!=null;F++){if(H[F]&&(H[F]===true||H[F].nodeType===1&&h(t,H[F]))){B.push(z[F])}}}else{for(var F=0;H[F]!=null;F++){if(H[F]&&H[F].nodeType===1){B.push(z[F])}}}}}else{a(H,B)}if(s){b(s,e,B,v);b.uniqueSort(B)}return B};b.uniqueSort=function(r){if(c){n=false;r.sort(c);if(n){for(var e=1;e<r.length;e++){if(r[e]===r[e-1]){r.splice(e--,1)}}}}};b.matches=function(e,r){return b(e,null,null,r)};b.find=function(y,e,z){var x,u;if(!y){return[]}for(var t=0,s=f.order.length;t<s;t++){var v=f.order[t],u;if((u=f.match[v].exec(y))){var r=RegExp.leftContext;if(r.substr(r.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");x=f.find[v](u,e,z);if(x!=null){y=y.replace(f.match[v],"");break}}}}if(!x){x=e.getElementsByTagName("*")}return{set:x,expr:y}};b.filter=function(B,A,E,t){var s=B,G=[],y=A,v,e,x=A&&A[0]&&o(A[0]);while(B&&A.length){for(var z in f.filter){if((v=f.match[z].exec(B))!=null){var r=f.filter[z],F,D;e=false;if(y==G){G=[]}if(f.preFilter[z]){v=f.preFilter[z](v,y,E,G,t,x);if(!v){e=F=true}else{if(v===true){continue}}}if(v){for(var u=0;(D=y[u])!=null;u++){if(D){F=r(D,v,u,y);var C=t^!!F;if(E&&F!=null){if(C){e=true}else{y[u]=false}}else{if(C){G.push(D);e=true}}}}}if(F!==undefined){if(!E){y=G}B=B.replace(f.match[z],"");if(!e){return[]}break}}}if(B==s){if(e==null){throw"Syntax error, unrecognized expression: "+B}else{break}}s=B}return y};var f=b.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")}},relative:{"+":function(y,e,x){var u=typeof e==="string",z=u&&!/\W/.test(e),v=u&&!z;if(z&&!x){e=e.toUpperCase()}for(var t=0,s=y.length,r;t<s;t++){if((r=y[t])){while((r=r.previousSibling)&&r.nodeType!==1){}y[t]=v||r&&r.nodeName===e?r||false:r===e}}if(v){b.filter(e,y,true)}},">":function(x,r,y){var u=typeof r==="string";if(u&&!/\W/.test(r)){r=y?r:r.toUpperCase();for(var s=0,e=x.length;s<e;s++){var v=x[s];if(v){var t=v.parentNode;x[s]=t.nodeName===r?t:false}}}else{for(var s=0,e=x.length;s<e;s++){var v=x[s];if(v){x[s]=u?v.parentNode:v.parentNode===r}}if(u){b.filter(r,x,true)}}},"":function(t,r,v){var s=i++,e=q;if(!r.match(/\W/)){var u=r=v?r:r.toUpperCase();e=m}e("parentNode",r,s,t,u,v)},"~":function(t,r,v){var s=i++,e=q;if(typeof r==="string"&&!r.match(/\W/)){var u=r=v?r:r.toUpperCase();e=m}e("previousSibling",r,s,t,u,v)}},find:{ID:function(r,s,t){if(typeof s.getElementById!=="undefined"&&!t){var e=s.getElementById(r[1]);return e?[e]:[]}},NAME:function(s,v,x){if(typeof v.getElementsByName!=="undefined"){var r=[],u=v.getElementsByName(s[1]);for(var t=0,e=u.length;t<e;t++){if(u[t].getAttribute("name")===s[1]){r.push(u[t])}}return r.length===0?null:r}},TAG:function(e,r){return r.getElementsByTagName(e[1])}},preFilter:{CLASS:function(t,r,s,e,x,y){t=" "+t[1].replace(/\\/g,"")+" ";if(y){return t}for(var u=0,v;(v=r[u])!=null;u++){if(v){if(x^(v.className&&(" "+v.className+" ").indexOf(t)>=0)){if(!s){e.push(v)}}else{if(s){r[u]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(r,e){for(var s=0;e[s]===false;s++){}return e[s]&&o(e[s])?r[1]:r[1].toUpperCase()},CHILD:function(e){if(e[1]=="nth"){var r=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]=="even"&&"2n"||e[2]=="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(r[1]+(r[2]||1))-0;e[3]=r[3]-0}e[0]=i++;return e},ATTR:function(u,r,s,e,v,x){var t=u[1].replace(/\\/g,"");if(!x&&f.attrMap[t]){u[1]=f.attrMap[t]}if(u[2]==="~="){u[4]=" "+u[4]+" "}return u},PSEUDO:function(u,r,s,e,v){if(u[1]==="not"){if(u[3].match(p).length>1||/^\w/.test(u[3])){u[3]=b(u[3],null,null,r)}else{var t=b.filter(u[3],r,s,true^v);if(!s){e.push.apply(e,t)}return false}}else{if(f.match.POS.test(u[0])||f.match.CHILD.test(u[0])){return true}}return u},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(s,r,e){return !!b(e[3],s).length},header:function(e){return/h\d/i.test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toUpperCase()==="BUTTON"},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)}},setFilters:{first:function(r,e){return e===0},last:function(s,r,e,t){return r===t.length-1},even:function(r,e){return e%2===0},odd:function(r,e){return e%2===1},lt:function(s,r,e){return r<e[3]-0},gt:function(s,r,e){return r>e[3]-0},nth:function(s,r,e){return e[3]-0==r},eq:function(s,r,e){return e[3]-0==r}},filter:{PSEUDO:function(x,s,t,y){var r=s[1],u=f.filters[r];if(u){return u(x,t,s,y)}else{if(r==="contains"){return(x.textContent||x.innerText||"").indexOf(s[3])>=0}else{if(r==="not"){var v=s[3];for(var t=0,e=v.length;t<e;t++){if(v[t]===x){return false}}return true}}}},CHILD:function(e,t){var x=t[1],r=e;switch(x){case"only":case"first":while(r=r.previousSibling){if(r.nodeType===1){return false}}if(x=="first"){return true}r=e;case"last":while(r=r.nextSibling){if(r.nodeType===1){return false}}return true;case"nth":var s=t[2],A=t[3];if(s==1&&A==0){return true}var v=t[0],z=e.parentNode;if(z&&(z.sizcache!==v||!e.nodeIndex)){var u=0;for(r=z.firstChild;r;r=r.nextSibling){if(r.nodeType===1){r.nodeIndex=++u}}z.sizcache=v}var y=e.nodeIndex-A;if(s==0){return y==0}else{return(y%s==0&&y/s>=0)}}},ID:function(r,e){return r.nodeType===1&&r.getAttribute("id")===e},TAG:function(r,e){return(e==="*"&&r.nodeType===1)||r.nodeName===e},CLASS:function(r,e){return(" "+(r.className||r.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(v,t){var s=t[1],e=f.attrHandle[s]?f.attrHandle[s](v):v[s]!=null?v[s]:v.getAttribute(s),x=e+"",u=t[2],r=t[4];return e==null?u==="!=":u==="="?x===r:u==="*="?x.indexOf(r)>=0:u==="~="?(" "+x+" ").indexOf(r)>=0:!r?x&&e!==false:u==="!="?x!=r:u==="^="?x.indexOf(r)===0:u==="$="?x.substr(x.length-r.length)===r:u==="|="?x===r||x.substr(0,r.length+1)===r+"-":false},POS:function(u,r,s,v){var e=r[2],t=f.setFilters[e];if(t){return t(u,s,r,v)}}}};var j=f.match.POS;for(var l in f.match){f.match[l]=new RegExp(f.match[l].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var a=function(r,e){r=Array.prototype.slice.call(r);if(e){e.push.apply(e,r);return e}return r};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(k){a=function(u,t){var r=t||[];if(d.call(u)==="[object Array]"){Array.prototype.push.apply(r,u)}else{if(typeof u.length==="number"){for(var s=0,e=u.length;s<e;s++){r.push(u[s])}}else{for(var s=0;u[s];s++){r.push(u[s])}}}return r}}var c;if(document.documentElement.compareDocumentPosition){c=function(r,e){var s=r.compareDocumentPosition(e)&4?-1:r===e?0:1;if(s===0){n=true}return s}}else{if("sourceIndex" in document.documentElement){c=function(r,e){var s=r.sourceIndex-e.sourceIndex;if(s===0){n=true}return s}}else{if(document.createRange){c=function(t,r){var s=t.ownerDocument.createRange(),e=r.ownerDocument.createRange();s.setStart(t,0);s.setEnd(t,0);e.setStart(r,0);e.setEnd(r,0);var u=s.compareBoundaryPoints(Range.START_TO_END,e);if(u===0){n=true}return u}}}}(function(){var r=document.createElement("div"),s="script"+(new Date).getTime();r.innerHTML="<a name='"+s+"'/>";var e=document.documentElement;e.insertBefore(r,e.firstChild);if(!!document.getElementById(s)){f.find.ID=function(u,v,x){if(typeof v.getElementById!=="undefined"&&!x){var t=v.getElementById(u[1]);return t?t.id===u[1]||typeof t.getAttributeNode!=="undefined"&&t.getAttributeNode("id").nodeValue===u[1]?[t]:undefined:[]}};f.filter.ID=function(v,t){var u=typeof v.getAttributeNode!=="undefined"&&v.getAttributeNode("id");return v.nodeType===1&&u&&u.nodeValue===t}}e.removeChild(r)})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){f.find.TAG=function(r,v){var u=v.getElementsByTagName(r[1]);if(r[1]==="*"){var t=[];for(var s=0;u[s];s++){if(u[s].nodeType===1){t.push(u[s])}}u=t}return u}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){f.attrHandle.href=function(r){return r.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var e=b,s=document.createElement("div");s.innerHTML="<p class='TEST'></p>";if(s.querySelectorAll&&s.querySelectorAll(".TEST").length===0){return}b=function(x,v,t,u){v=v||document;if(!u&&v.nodeType===9&&!o(v)){try{return a(v.querySelectorAll(x),t)}catch(y){}}return e(x,v,t,u)};for(var r in e){b[r]=e[r]}})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var e=document.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}f.order.splice(1,0,"CLASS");f.find.CLASS=function(r,s,t){if(typeof s.getElementsByClassName!=="undefined"&&!t){return s.getElementsByClassName(r[1])}}})()}function m(r,x,v,B,y,A){var z=r=="previousSibling"&&!A;for(var t=0,s=B.length;t<s;t++){var e=B[t];if(e){if(z&&e.nodeType===1){e.sizcache=v;e.sizset=t}e=e[r];var u=false;while(e){if(e.sizcache===v){u=B[e.sizset];break}if(e.nodeType===1&&!A){e.sizcache=v;e.sizset=t}if(e.nodeName===x){u=e;break}e=e[r]}B[t]=u}}}function q(r,x,v,B,y,A){var z=r=="previousSibling"&&!A;for(var t=0,s=B.length;t<s;t++){var e=B[t];if(e){if(z&&e.nodeType===1){e.sizcache=v;e.sizset=t}e=e[r];var u=false;while(e){if(e.sizcache===v){u=B[e.sizset];break}if(e.nodeType===1){if(!A){e.sizcache=v;e.sizset=t}if(typeof x!=="string"){if(e===x){u=true;break}}else{if(b.filter(x,[e]).length>0){u=e;break}}}e=e[r]}B[t]=u}}}var h=document.compareDocumentPosition?function(r,e){return r.compareDocumentPosition(e)&16}:function(r,e){return r!==e&&(r.contains?r.contains(e):true)};var o=function(e){return e.nodeType===9&&e.documentElement.nodeName!=="HTML"||!!e.ownerDocument&&e.ownerDocument.documentElement.nodeName!=="HTML"};var g=function(e,y){var t=[],u="",v,s=y.nodeType?[y]:y;while((v=f.match.PSEUDO.exec(e))){u+=v[0];e=e.replace(f.match.PSEUDO,"")}e=f.relative[e]?e+"*":e;for(var x=0,r=s.length;x<r;x++){b(e,s[x],t)}return b.filter(u,t)};window.tinymce.dom.Sizzle=b})();(function(d){var f=d.each,c=d.DOM,b=d.isIE,e=d.isWebKit,a;d.create("tinymce.dom.EventUtils",{EventUtils:function(){this.inits=[];this.events=[]},add:function(m,p,l,j){var g,h=this,i=h.events,k;if(p instanceof Array){k=[];f(p,function(o){k.push(h.add(m,o,l,j))});return k}if(m&&m.hasOwnProperty&&m instanceof Array){k=[];f(m,function(n){n=c.get(n);k.push(h.add(n,p,l,j))});return k}m=c.get(m);if(!m){return}g=function(n){if(h.disabled){return}n=n||window.event;if(n&&b){if(!n.target){n.target=n.srcElement}d.extend(n,h._stoppers)}if(!j){return l(n)}return l.call(j,n)};if(p=="unload"){d.unloads.unshift({func:g});return g}if(p=="init"){if(h.domLoaded){g()}else{h.inits.push(g)}return g}i.push({obj:m,name:p,func:l,cfunc:g,scope:j});h._add(m,p,g);return l},remove:function(l,m,k){var h=this,g=h.events,i=false,j;if(l&&l.hasOwnProperty&&l instanceof Array){j=[];f(l,function(n){n=c.get(n);j.push(h.remove(n,m,k))});return j}l=c.get(l);f(g,function(o,n){if(o.obj==l&&o.name==m&&(!k||(o.func==k||o.cfunc==k))){g.splice(n,1);h._remove(l,m,o.cfunc);i=true;return false}});return i},clear:function(l){var j=this,g=j.events,h,k;if(l){l=c.get(l);for(h=g.length-1;h>=0;h--){k=g[h];if(k.obj===l){j._remove(k.obj,k.name,k.cfunc);k.obj=k.cfunc=null;g.splice(h,1)}}}},cancel:function(g){if(!g){return false}this.stop(g);return this.prevent(g)},stop:function(g){if(g.stopPropagation){g.stopPropagation()}else{g.cancelBubble=true}return false},prevent:function(g){if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}return false},destroy:function(){var g=this;f(g.events,function(j,h){g._remove(j.obj,j.name,j.cfunc);j.obj=j.cfunc=null});g.events=[];g=null},_add:function(h,i,g){if(h.attachEvent){h.attachEvent("on"+i,g)}else{if(h.addEventListener){h.addEventListener(i,g,false)}else{h["on"+i]=g}}},_remove:function(i,j,h){if(i){try{if(i.detachEvent){i.detachEvent("on"+j,h)}else{if(i.removeEventListener){i.removeEventListener(j,h,false)}else{i["on"+j]=null}}}catch(g){}}},_pageInit:function(h){var g=this;if(g.domLoaded){return}g.domLoaded=true;f(g.inits,function(i){i()});g.inits=[]},_wait:function(i){var g=this,h=i.document;if(i.tinyMCE_GZ&&tinyMCE_GZ.loaded){g.domLoaded=1;return}if(h.attachEvent){h.attachEvent("onreadystatechange",function(){if(h.readyState==="complete"){h.detachEvent("onreadystatechange",arguments.callee);g._pageInit(i)}});if(h.documentElement.doScroll&&i==i.top){(function(){if(g.domLoaded){return}try{h.documentElement.doScroll("left")}catch(j){setTimeout(arguments.callee,0);return}g._pageInit(i)})()}}else{if(h.addEventListener){g._add(i,"DOMContentLoaded",function(){g._pageInit(i)})}}g._add(i,"load",function(){g._pageInit(i)})},_stoppers:{preventDefault:function(){this.returnValue=false},stopPropagation:function(){this.cancelBubble=true}}});a=d.dom.Event=new d.dom.EventUtils();a._wait(window);d.addUnload(function(){a.destroy()})})(tinymce);(function(a){a.dom.Element=function(f,d){var b=this,e,c;b.settings=d=d||{};b.id=f;b.dom=e=d.dom||a.DOM;if(!a.isIE){c=e.get(b.id)}a.each(("getPos,getRect,getParent,add,setStyle,getStyle,setStyles,setAttrib,setAttribs,getAttrib,addClass,removeClass,hasClass,getOuterHTML,setOuterHTML,remove,show,hide,isHidden,setHTML,get").split(/,/),function(g){b[g]=function(){var h=[f],j;for(j=0;j<arguments.length;j++){h.push(arguments[j])}h=e[g].apply(e,h);b.update(g);return h}});a.extend(b,{on:function(i,h,g){return a.dom.Event.add(b.id,i,h,g)},getXY:function(){return{x:parseInt(b.getStyle("left")),y:parseInt(b.getStyle("top"))}},getSize:function(){var g=e.get(b.id);return{w:parseInt(b.getStyle("width")||g.clientWidth),h:parseInt(b.getStyle("height")||g.clientHeight)}},moveTo:function(g,h){b.setStyles({left:g,top:h})},moveBy:function(g,i){var h=b.getXY();b.moveTo(h.x+g,h.y+i)},resizeTo:function(g,i){b.setStyles({width:g,height:i})},resizeBy:function(g,j){var i=b.getSize();b.resizeTo(i.w+g,i.h+j)},update:function(h){var g;if(a.isIE6&&d.blocker){h=h||"";if(h.indexOf("get")===0||h.indexOf("has")===0||h.indexOf("is")===0){return}if(h=="remove"){e.remove(b.blocker);return}if(!b.blocker){b.blocker=e.uniqueId();g=e.add(d.container||e.getRoot(),"iframe",{id:b.blocker,style:"position:absolute;",frameBorder:0,src:'javascript:""'});e.setStyle(g,"opacity",0)}else{g=e.get(b.blocker)}e.setStyles(g,{left:b.getStyle("left",1),top:b.getStyle("top",1),width:b.getStyle("width",1),height:b.getStyle("height",1),display:b.getStyle("display",1),zIndex:parseInt(b.getStyle("zIndex",1)||0)-1})}}})}})(tinymce);(function(c){function e(f){return f.replace(/[\n\r]+/g,"")}var b=c.is,a=c.isIE,d=c.each;c.create("tinymce.dom.Selection",{Selection:function(i,h,g){var f=this;f.dom=i;f.win=h;f.serializer=g;d(["onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent"],function(j){f[j]=new c.util.Dispatcher(f)});if(!f.win.getSelection){f.tridentSel=new c.dom.TridentSelection(f)}c.addUnload(f.destroy,f)},getContent:function(g){var f=this,h=f.getRng(),l=f.dom.create("body"),j=f.getSel(),i,k,m;g=g||{};i=k="";g.get=true;g.format=g.format||"html";f.onBeforeGetContent.dispatch(f,g);if(g.format=="text"){return f.isCollapsed()?"":(h.text||(j.toString?j.toString():""))}if(h.cloneContents){m=h.cloneContents();if(m){l.appendChild(m)}}else{if(b(h.item)||b(h.htmlText)){l.innerHTML=h.item?h.item(0).outerHTML:h.htmlText}else{l.innerHTML=h.toString()}}if(/^\s/.test(l.innerHTML)){i=" "}if(/\s+$/.test(l.innerHTML)){k=" "}g.getInner=true;g.content=f.isCollapsed()?"":i+f.serializer.serialize(l,g)+k;f.onGetContent.dispatch(f,g);return g.content},setContent:function(i,g){var f=this,j=f.getRng(),l,k=f.win.document;g=g||{format:"html"};g.set=true;i=g.content=f.dom.processHTML(i);f.onBeforeSetContent.dispatch(f,g);i=g.content;if(j.insertNode){i+='<span id="__caret">_</span>';if(j.startContainer==k&&j.endContainer==k){k.body.innerHTML=i}else{j.deleteContents();j.insertNode(f.getRng().createContextualFragment(i))}l=f.dom.get("__caret");j=k.createRange();j.setStartBefore(l);j.setEndBefore(l);f.setRng(j);f.dom.remove("__caret")}else{if(j.item){k.execCommand("Delete",false,null);j=f.getRng()}j.pasteHTML(i)}f.onSetContent.dispatch(f,g)},getStart:function(){var f=this,g=f.getRng(),h;if(a){if(g.item){return g.item(0)}g=g.duplicate();g.collapse(1);h=g.parentElement();if(h&&h.nodeName=="BODY"){return h.firstChild||h}return h}else{h=g.startContainer;if(h.nodeType==1&&h.hasChildNodes()){h=h.childNodes[Math.min(h.childNodes.length-1,g.startOffset)]}if(h&&h.nodeType==3){return h.parentNode}return h}},getEnd:function(){var g=this,h=g.getRng(),i,f;if(a){if(h.item){return h.item(0)}h=h.duplicate();h.collapse(0);i=h.parentElement();if(i&&i.nodeName=="BODY"){return i.lastChild||i}return i}else{i=h.endContainer;f=h.endOffset;if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[f>0?f-1:f]}if(i&&i.nodeType==3){return i.parentNode}return i}},getBookmark:function(q,r){var u=this,m=u.dom,g,j,i,n,h,o,p,l="\uFEFF",s;function f(v,x){var t=0;d(m.select(v),function(z,y){if(z==x){t=y}});return t}if(q==2){function k(){var v=u.getRng(true),t=m.getRoot(),x={};function y(z,B){var F=[],D,H,A=z[B?"startContainer":"endContainer"],E=z[B?"startOffset":"endOffset"],C,G={};if(A.nodeType==1&&A.hasChildNodes()){H=A.childNodes.length-1;G.exclude=(B&&E>H)||(!B&&E==0);if(!B&&E){E--}A=A.childNodes[E>H?H:E];if(A.nodeType==3){E=B?0:A.nodeValue.length}}if(A.nodeType==3){if(r){for(D=A.previousSibling;D&&D.nodeType==3;D=D.previousSibling){E+=D.nodeValue.length}}G.offset=E}for(;A&&A!=t;A=A.parentNode){F.push(u.dom.nodeIndex(A,r))}G.indexes=F;return G}x.start=y(v,true);if(!u.isCollapsed()){x.end=y(v)}return x}return k()}if(q){return{rng:u.getRng()}}g=u.getRng();i=m.uniqueId();n=tinyMCE.activeEditor.selection.isCollapsed();s="overflow:hidden;line-height:0px";if(g.duplicate||g.item){if(!g.item){j=g.duplicate();g.collapse();g.pasteHTML('<span _mce_type="bookmark" id="'+i+'_start" style="'+s+'">'+l+"</span>");if(!n){j.collapse(false);j.pasteHTML('<span _mce_type="bookmark" id="'+i+'_end" style="'+s+'">'+l+"</span>")}}else{o=g.item(0);h=o.nodeName;return{name:h,index:f(h,o)}}}else{o=u.getNode();h=o.nodeName;if(h=="IMG"){return{name:h,index:f(h,o)}}j=g.cloneRange();if(!n){j.collapse(false);j.insertNode(m.create("span",{_mce_type:"bookmark",id:i+"_end",style:s},l))}g.collapse(true);g.insertNode(m.create("span",{_mce_type:"bookmark",id:i+"_start",style:s},l))}u.moveToBookmark({id:i,keep:1});return{id:i}},moveToBookmark:function(l){var n=this,k=n.dom,i,h,f,m;if(n.tridentSel){n.tridentSel.destroy()}if(l){if(l.start){f=k.createRng();m=k.getRoot();function g(s){var o=l[s?"start":"end"],p,q,r;if(o){for(q=m,p=o.indexes.length-1;p>=0;p--){q=q.childNodes[o.indexes[p]]||q}if(s){if(q.nodeType==3&&o.offset){f.setStart(q,o.offset)}else{if(o.exclude){f.setStartAfter(q)}else{f.setStartBefore(q)}}}else{if(q.nodeType==3&&o.offset){f.setEnd(q,o.offset)}else{if(o.exclude){f.setEndBefore(q)}else{f.setEndAfter(q)}}}}}g(true);g();n.setRng(f)}else{if(l.id){f=k.createRng();function j(u){var p=k.get(l.id+"_"+u),t,o,r,s,q=l.keep;if(p){t=p.parentNode;if(u=="start"){if(!q){o=k.nodeIndex(p);if(o>0){o++}}else{t=p;o=1}f.setStart(t,o);f.setEnd(t,o)}else{if(!q){o=k.nodeIndex(p)}else{t=p;o=1}f.setEnd(t,o)}if(!q){s=p.previousSibling;r=p.nextSibling;d(c.grep(p.childNodes),function(v){if(v.nodeType==3){v.nodeValue=v.nodeValue.replace(/\uFEFF/g,"")}});while(p=k.get(l.id+"_"+u)){k.remove(p,1)}if(s&&r&&s.nodeType==r.nodeType&&s.nodeType==3){o=s.nodeValue.length;s.appendData(r.nodeValue);k.remove(r);if(u=="start"){f.setStart(s,o);f.setEnd(s,o)}else{f.setEnd(s,o)}}}}}j("start");j("end");n.setRng(f)}else{if(l.name){n.select(k.select(l.name)[l.index])}else{if(l.rng){n.setRng(l.rng)}}}}}},select:function(k,j){var i=this,l=i.dom,g=l.createRng(),f;f=l.nodeIndex(k);g.setStart(k.parentNode,f);g.setEnd(k.parentNode,f+1);if(j){function h(m,o){var n=new c.dom.TreeWalker(m,m);do{if(m.nodeType==3&&c.trim(m.nodeValue).length!=0){if(o){g.setStart(m,0)}else{g.setEnd(m,m.nodeValue.length)}return}if(m.nodeName=="BR"){if(o){g.setStartBefore(m)}else{g.setEndBefore(m)}return}}while(m=(o?n.next():n.prev()))}h(k,1);h(k)}i.setRng(g);return k},isCollapsed:function(){var f=this,h=f.getRng(),g=f.getSel();if(!h||h.item){return false}if(h.compareEndPoints){return h.compareEndPoints("StartToEnd",h)===0}return !g||h.collapsed},collapse:function(f){var g=this,h=g.getRng(),i;if(h.item){i=h.item(0);h=this.win.document.body.createTextRange();h.moveToElementText(i)}h.collapse(!!f);g.setRng(h)},getSel:function(){var g=this,f=this.win;return f.getSelection?f.getSelection():f.document.selection},getRng:function(j){var g=this,h,i;if(j&&g.tridentSel){return g.tridentSel.getRangeAt(0)}try{if(h=g.getSel()){i=h.rangeCount>0?h.getRangeAt(0):(h.createRange?h.createRange():g.win.document.createRange())}}catch(f){}if(!i){i=a?g.win.document.body.createTextRange():g.win.document.createRange()}return i},setRng:function(i){var h,g=this;if(!g.tridentSel){h=g.getSel();if(h){h.removeAllRanges();h.addRange(i)}}else{if(i.cloneRange){g.tridentSel.addRange(i);return}try{i.select()}catch(f){}}},setNode:function(g){var f=this;f.setContent(f.dom.getOuterHTML(g));return g},getNode:function(){var g=this,f=g.getRng(),h=g.getSel(),i;if(!a){if(!f){return g.dom.getRoot()}i=f.commonAncestorContainer;if(!f.collapsed){if(f.startContainer==f.endContainer){if(f.startOffset-f.endOffset<2){if(f.startContainer.hasChildNodes()){i=f.startContainer.childNodes[f.startOffset]}}}if(c.isWebKit&&h.anchorNode&&h.anchorNode.nodeType==1){return h.anchorNode.childNodes[h.anchorOffset]}}if(i&&i.nodeType==3){return i.parentNode}return i}return f.item?f.item(0):f.parentElement()},getSelectedBlocks:function(g,f){var i=this,j=i.dom,m,h,l,k=[];m=j.getParent(g||i.getStart(),j.isBlock);h=j.getParent(f||i.getEnd(),j.isBlock);if(m){k.push(m)}if(m&&h&&m!=h){l=m;while((l=l.nextSibling)&&l!=h){if(j.isBlock(l)){k.push(l)}}}if(h&&m!=h){k.push(h)}return k},destroy:function(g){var f=this;f.win=null;if(f.tridentSel){f.tridentSel.destroy()}if(!g){c.removeUnload(f.destroy)}}})})(tinymce);(function(a){a.create("tinymce.dom.XMLWriter",{node:null,XMLWriter:function(c){function b(){var e=document.implementation;if(!e||!e.createDocument){try{return new ActiveXObject("MSXML2.DOMDocument")}catch(d){}try{return new ActiveXObject("Microsoft.XmlDom")}catch(d){}}else{return e.createDocument("","",null)}}this.doc=b();this.valid=a.isOpera||a.isWebKit;this.reset()},reset:function(){var b=this,c=b.doc;if(c.firstChild){c.removeChild(c.firstChild)}b.node=c.appendChild(c.createElement("html"))},writeStartElement:function(c){var b=this;b.node=b.node.appendChild(b.doc.createElement(c))},writeAttribute:function(c,b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.setAttribute(c,b)},writeEndElement:function(){this.node=this.node.parentNode},writeFullEndElement:function(){var b=this,c=b.node;c.appendChild(b.doc.createTextNode(""));b.node=c.parentNode},writeText:function(b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.appendChild(this.doc.createTextNode(b))},writeCDATA:function(b){this.node.appendChild(this.doc.createCDATASection(b))},writeComment:function(b){if(a.isIE){b=b.replace(/^\-|\-$/g," ")}this.node.appendChild(this.doc.createComment(b.replace(/\-\-/g," ")))},getContent:function(){var b;b=this.doc.xml||new XMLSerializer().serializeToString(this.doc);b=b.replace(/<\?[^?]+\?>|<html>|<\/html>|<html\/>|<!DOCTYPE[^>]+>/g,"");b=b.replace(/ ?\/>/g," />");if(this.valid){b=b.replace(/\%MCGT%/g,"&gt;")}return b}})})(tinymce);(function(a){a.create("tinymce.dom.StringWriter",{str:null,tags:null,count:0,settings:null,indent:null,StringWriter:function(b){this.settings=a.extend({indent_char:" ",indentation:0},b);this.reset()},reset:function(){this.indent="";this.str="";this.tags=[];this.count=0},writeStartElement:function(b){this._writeAttributesEnd();this.writeRaw("<"+b);this.tags.push(b);this.inAttr=true;this.count++;this.elementCount=this.count},writeAttribute:function(d,b){var c=this;c.writeRaw(" "+c.encode(d)+'="'+c.encode(b)+'"')},writeEndElement:function(){var b;if(this.tags.length>0){b=this.tags.pop();if(this._writeAttributesEnd(1)){this.writeRaw("</"+b+">")}if(this.settings.indentation>0){this.writeRaw("\n")}}},writeFullEndElement:function(){if(this.tags.length>0){this._writeAttributesEnd();this.writeRaw("</"+this.tags.pop()+">");if(this.settings.indentation>0){this.writeRaw("\n")}}},writeText:function(b){this._writeAttributesEnd();this.writeRaw(this.encode(b));this.count++},writeCDATA:function(b){this._writeAttributesEnd();this.writeRaw("<![CDATA["+b+"]]>");this.count++},writeComment:function(b){this._writeAttributesEnd();this.writeRaw("<!-- "+b+"-->");this.count++},writeRaw:function(b){this.str+=b},encode:function(b){return b.replace(/[<>&"]/g,function(c){switch(c){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";case'"':return"&quot;"}return c})},getContent:function(){return this.str},_writeAttributesEnd:function(b){if(!this.inAttr){return}this.inAttr=false;if(b&&this.elementCount==this.count){this.writeRaw(" />");return false}this.writeRaw(">");return true}})})(tinymce);(function(e){var g=e.extend,f=e.each,b=e.util.Dispatcher,d=e.isIE,a=e.isGecko;function c(h){return h.replace(/([?+*])/g,".$1")}e.create("tinymce.dom.Serializer",{Serializer:function(j){var i=this;i.key=0;i.onPreProcess=new b(i);i.onPostProcess=new b(i);try{i.writer=new e.dom.XMLWriter()}catch(h){i.writer=new e.dom.StringWriter()}i.settings=j=g({dom:e.DOM,valid_nodes:0,node_filter:0,attr_filter:0,invalid_attrs:/^(_mce_|_moz_|sizset|sizcache)/,closed:/^(br|hr|input|meta|img|link|param|area)$/,entity_encoding:"named",entities:"160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro",valid_elements:"*[*]",extended_valid_elements:0,invalid_elements:0,fix_table_elements:1,fix_list_elements:true,fix_content_duplication:true,convert_fonts_to_spans:false,font_size_classes:0,apply_source_formatting:0,indent_mode:"simple",indent_char:"\t",indent_levels:1,remove_linebreaks:1,remove_redundant_brs:1,element_format:"xhtml"},j);i.dom=j.dom;i.schema=j.schema;if(j.entity_encoding=="named"&&!j.entities){j.entity_encoding="raw"}if(j.remove_redundant_brs){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/(<br \/>\s*)+<\/(p|h[1-6]|div|li)>/gi,function(n,m,o){if(/^<br \/>\s*<\//.test(n)){return"</"+o+">"}return n})})}if(j.element_format=="html"){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/<([^>]+) \/>/g,"<$1>")})}if(j.fix_list_elements){i.onPreProcess.add(function(v,s){var l,z,y=["ol","ul"],u,t,q,k=/^(OL|UL)$/,A;function m(r,x){var o=x.split(","),p;while((r=r.previousSibling)!=null){for(p=0;p<o.length;p++){if(r.nodeName==o[p]){return r}}}return null}for(z=0;z<y.length;z++){l=i.dom.select(y[z],s.node);for(u=0;u<l.length;u++){t=l[u];q=t.parentNode;if(k.test(q.nodeName)){A=m(t,"LI");if(!A){A=i.dom.create("li");A.innerHTML="&nbsp;";A.appendChild(t);q.insertBefore(A,q.firstChild)}else{A.appendChild(t)}}}}})}if(j.fix_table_elements){i.onPreProcess.add(function(k,l){if(!e.isOpera||opera.buildNumber()>=1767){f(i.dom.select("p table",l.node).reverse(),function(p){var o=i.dom.getParent(p.parentNode,"table,p");if(o.nodeName!="TABLE"){try{i.dom.split(o,p)}catch(m){}}})}})}},setEntities:function(o){var n=this,j,m,h={},k;if(n.entityLookup){return}j=o.split(",");for(m=0;m<j.length;m+=2){k=j[m];if(k==34||k==38||k==60||k==62){continue}h[String.fromCharCode(j[m])]=j[m+1];k=parseInt(j[m]).toString(16)}n.entityLookup=h},setRules:function(i){var h=this;h._setup();h.rules={};h.wildRules=[];h.validElements={};return h.addRules(i)},addRules:function(i){var h=this,j;if(!i){return}h._setup();f(i.split(","),function(m){var q=m.split(/\[|\]/),l=q[0].split("/"),r,k,o,n=[];if(j){k=e.extend([],j.attribs)}if(q.length>1){f(q[1].split("|"),function(u){var p={},t;k=k||[];u=u.replace(/::/g,"~");u=/^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/.exec(u);u[2]=u[2].replace(/~/g,":");if(u[1]=="!"){r=r||[];r.push(u[2])}if(u[1]=="-"){for(t=0;t<k.length;t++){if(k[t].name==u[2]){k.splice(t,1);return}}}switch(u[3]){case"=":p.defaultVal=u[4]||"";break;case":":p.forcedVal=u[4];break;case"<":p.validVals=u[4].split("?");break}if(/[*.?]/.test(u[2])){o=o||[];p.nameRE=new RegExp("^"+c(u[2])+"$");o.push(p)}else{p.name=u[2];k.push(p)}n.push(u[2])})}f(l,function(v,u){var y=v.charAt(0),t=1,p={};if(j){if(j.noEmpty){p.noEmpty=j.noEmpty}if(j.fullEnd){p.fullEnd=j.fullEnd}if(j.padd){p.padd=j.padd}}switch(y){case"-":p.noEmpty=true;break;case"+":p.fullEnd=true;break;case"#":p.padd=true;break;default:t=0}l[u]=v=v.substring(t);h.validElements[v]=1;if(/[*.?]/.test(l[0])){p.nameRE=new RegExp("^"+c(l[0])+"$");h.wildRules=h.wildRules||{};h.wildRules.push(p)}else{p.name=l[0];if(l[0]=="@"){j=p}h.rules[v]=p}p.attribs=k;if(r){p.requiredAttribs=r}if(o){v="";f(n,function(s){if(v){v+="|"}v+="("+c(s)+")"});p.validAttribsRE=new RegExp("^"+v.toLowerCase()+"$");p.wildAttribs=o}})});i="";f(h.validElements,function(m,l){if(i){i+="|"}if(l!="@"){i+=l}});h.validElementsRE=new RegExp("^("+c(i.toLowerCase())+")$")},findRule:function(m){var j=this,l=j.rules,h,k;j._setup();k=l[m];if(k){return k}l=j.wildRules;for(h=0;h<l.length;h++){if(l[h].nameRE.test(m)){return l[h]}}return null},findAttribRule:function(h,l){var j,k=h.wildAttribs;for(j=0;j<k.length;j++){if(k[j].nameRE.test(l)){return k[j]}}return null},serialize:function(r,q){var m,k=this,p,i,j,l;k._setup();q=q||{};q.format=q.format||"html";k.processObj=q;if(d){l=[];f(r.getElementsByTagName("option"),function(o){var h=k.dom.getAttrib(o,"selected");l.push(h?h:null)})}r=r.cloneNode(true);if(d){f(r.getElementsByTagName("option"),function(o,h){k.dom.setAttrib(o,"selected",l[h])})}j=r.ownerDocument.implementation;if(j.createHTMLDocument&&(e.isOpera&&opera.buildNumber()>=1767)){p=j.createHTMLDocument("");f(r.nodeName=="BODY"?r.childNodes:[r],function(h){p.body.appendChild(p.importNode(h,true))});if(r.nodeName!="BODY"){r=p.body.firstChild}else{r=p.body}i=k.dom.doc;k.dom.doc=p}k.key=""+(parseInt(k.key)+1);if(!q.no_events){q.node=r;k.onPreProcess.dispatch(k,q)}k.writer.reset();k._info=q;k._serializeNode(r,q.getInner);q.content=k.writer.getContent();if(i){k.dom.doc=i}if(!q.no_events){k.onPostProcess.dispatch(k,q)}k._postProcess(q);q.node=null;return e.trim(q.content)},_postProcess:function(n){var i=this,k=i.settings,j=n.content,m=[],l;if(n.format=="html"){l=i._protect({content:j,patterns:[{pattern:/(<script[^>]*>)(.*?)(<\/script>)/g},{pattern:/(<noscript[^>]*>)(.*?)(<\/noscript>)/g},{pattern:/(<style[^>]*>)(.*?)(<\/style>)/g},{pattern:/(<pre[^>]*>)(.*?)(<\/pre>)/g,encode:1},{pattern:/(<!--\[CDATA\[)(.*?)(\]\]-->)/g}]});j=l.content;if(k.entity_encoding!=="raw"){j=i._encode(j)}if(!n.set){j=j.replace(/<p>\s+<\/p>|<p([^>]+)>\s+<\/p>/g,k.entity_encoding=="numeric"?"<p$1>&#160;</p>":"<p$1>&nbsp;</p>");if(k.remove_linebreaks){j=j.replace(/\r?\n|\r/g," ");j=j.replace(/(<[^>]+>)\s+/g,"$1 ");j=j.replace(/\s+(<\/[^>]+>)/g," $1");j=j.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object) ([^>]+)>\s+/g,"<$1 $2>");j=j.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>\s+/g,"<$1>");j=j.replace(/\s+<\/(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g,"</$1>")}if(k.apply_source_formatting&&k.indent_mode=="simple"){j=j.replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g,"\n<$1$2$3>\n");j=j.replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g,"\n<$1$2>");j=j.replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g,"</$1>\n");j=j.replace(/\n\n/g,"\n")}}j=i._unprotect(j,l);j=j.replace(/<!--\[CDATA\[([\s\S]+)\]\]-->/g,"<![CDATA[$1]]>");if(k.entity_encoding=="raw"){j=j.replace(/<p>&nbsp;<\/p>|<p([^>]+)>&nbsp;<\/p>/g,"<p$1>\u00a0</p>")}j=j.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g,function(h,p,o){return"<noscript"+p+">"+i.dom.decode(o.replace(/<!--|-->/g,""))+"</noscript>"})}n.content=j},_serializeNode:function(D,I){var z=this,A=z.settings,x=z.writer,q,j,u,F,E,H,B,h,y,k,r,C,p,m,G,o;if(!A.node_filter||A.node_filter(D)){switch(D.nodeType){case 1:if(D.hasAttribute?D.hasAttribute("_mce_bogus"):D.getAttribute("_mce_bogus")){return}p=G=false;q=D.hasChildNodes();k=D.getAttribute("_mce_name")||D.nodeName.toLowerCase();o=D.getAttribute("_mce_type");if(o){if(!z._info.cleanup){p=true;return}else{G=1}}if(d){if(D.scopeName!=="HTML"&&D.scopeName!=="html"){k=D.scopeName+":"+k}}if(k.indexOf("mce:")===0){k=k.substring(4)}if(!G){if(!z.validElementsRE||!z.validElementsRE.test(k)||(z.invalidElementsRE&&z.invalidElementsRE.test(k))||I){p=true;break}}if(d){if(A.fix_content_duplication){if(D._mce_serialized==z.key){return}D._mce_serialized=z.key}if(k.charAt(0)=="/"){k=k.substring(1)}}else{if(a){if(D.nodeName==="BR"&&D.getAttribute("type")=="_moz"){return}}}if(A.validate_children){if(z.elementName&&!z.schema.isValid(z.elementName,k)){p=true;break}z.elementName=k}r=z.findRule(k);k=r.name||k;m=A.closed.test(k);if((!q&&r.noEmpty)||(d&&!k)){p=true;break}if(r.requiredAttribs){H=r.requiredAttribs;for(F=H.length-1;F>=0;F--){if(this.dom.getAttrib(D,H[F])!==""){break}}if(F==-1){p=true;break}}x.writeStartElement(k);if(r.attribs){for(F=0,B=r.attribs,E=B.length;F<E;F++){H=B[F];y=z._getAttrib(D,H);if(y!==null){x.writeAttribute(H.name,y)}}}if(r.validAttribsRE){B=z.dom.getAttribs(D);for(F=B.length-1;F>-1;F--){h=B[F];if(h.specified){H=h.nodeName.toLowerCase();if(A.invalid_attrs.test(H)||!r.validAttribsRE.test(H)){continue}C=z.findAttribRule(r,H);y=z._getAttrib(D,C,H);if(y!==null){x.writeAttribute(H,y)}}}}if(o&&G){x.writeAttribute("_mce_type",o)}if(k==="script"&&e.trim(D.innerHTML)){x.writeText("// ");x.writeCDATA(D.innerHTML.replace(/<!--|-->|<\[CDATA\[|\]\]>/g,""));q=false;break}if(r.padd){if(q&&(u=D.firstChild)&&u.nodeType===1&&D.childNodes.length===1){if(u.hasAttribute?u.hasAttribute("_mce_bogus"):u.getAttribute("_mce_bogus")){x.writeText("\u00a0")}}else{if(!q){x.writeText("\u00a0")}}}break;case 3:if(A.validate_children&&z.elementName&&!z.schema.isValid(z.elementName,"#text")){return}return x.writeText(D.nodeValue);case 4:return x.writeCDATA(D.nodeValue);case 8:return x.writeComment(D.nodeValue)}}else{if(D.nodeType==1){q=D.hasChildNodes()}}if(q&&!m){u=D.firstChild;while(u){z._serializeNode(u);z.elementName=k;u=u.nextSibling}}if(!p){if(!m){x.writeFullEndElement()}else{x.writeEndElement()}}},_protect:function(j){var i=this;j.items=j.items||[];function h(l){return l.replace(/[\r\n\\]/g,function(m){if(m==="\n"){return"\\n"}else{if(m==="\\"){return"\\\\"}}return"\\r"})}function k(l){return l.replace(/\\[\\rn]/g,function(m){if(m==="\\n"){return"\n"}else{if(m==="\\\\"){return"\\"}}return"\r"})}f(j.patterns,function(l){j.content=k(h(j.content).replace(l.pattern,function(n,o,m,p){m=k(m);if(l.encode){m=i._encode(m)}j.items.push(m);return o+"<!--mce:"+(j.items.length-1)+"-->"+p}))});return j},_unprotect:function(i,j){i=i.replace(/\<!--mce:([0-9]+)--\>/g,function(k,h){return j.items[parseInt(h)]});j.items=[];return i},_encode:function(m){var j=this,k=j.settings,i;if(k.entity_encoding!=="raw"){if(k.entity_encoding.indexOf("named")!=-1){j.setEntities(k.entities);i=j.entityLookup;m=m.replace(/[\u007E-\uFFFF]/g,function(h){var l;if(l=i[h]){h="&"+l+";"}return h})}if(k.entity_encoding.indexOf("numeric")!=-1){m=m.replace(/[\u007E-\uFFFF]/g,function(h){return"&#"+h.charCodeAt(0)+";"})}}return m},_setup:function(){var h=this,i=this.settings;if(h.done){return}h.done=1;h.setRules(i.valid_elements);h.addRules(i.extended_valid_elements);if(i.invalid_elements){h.invalidElementsRE=new RegExp("^("+c(i.invalid_elements.replace(/,/g,"|").toLowerCase())+")$")}if(i.attrib_value_filter){h.attribValueFilter=i.attribValueFilter}},_getAttrib:function(m,j,h){var l,k;h=h||j.name;if(j.forcedVal&&(k=j.forcedVal)){if(k==="{$uid}"){return this.dom.uniqueId()}return k}k=this.dom.getAttrib(m,h);switch(h){case"rowspan":case"colspan":if(k=="1"){k=""}break}if(this.attribValueFilter){k=this.attribValueFilter(h,k,m)}if(j.validVals){for(l=j.validVals.length-1;l>=0;l--){if(k==j.validVals[l]){break}}if(l==-1){return null}}if(k===""&&typeof(j.defaultVal)!="undefined"){k=j.defaultVal;if(k==="{$uid}"){return this.dom.uniqueId()}return k}else{if(h=="class"&&this.processObj.get){k=k.replace(/\s?mceItem\w+\s?/g,"")}}if(k===""){return null}return k}})})(tinymce);(function(a){a.dom.ScriptLoader=function(h){var c=0,k=1,i=2,l={},j=[],f={},d=[],g=0,e;function b(m,u){var v=this,q=a.DOM,s,o,r,n;function p(){q.remove(n);if(s){s.onreadystatechange=s.onload=s=null}u()}n=q.uniqueId();if(a.isIE6){o=new a.util.URI(m);r=location;if(o.host==r.hostname&&o.port==r.port&&(o.protocol+":")==r.protocol){a.util.XHR.send({url:a._addVer(o.getURI()),success:function(x){var t=q.create("script",{type:"text/javascript"});t.text=x;document.getElementsByTagName("head")[0].appendChild(t);q.remove(t);p()}});return}}s=q.create("script",{id:n,type:"text/javascript",src:a._addVer(m)});s.onload=p;s.onreadystatechange=function(){var t=s.readyState;if(t=="complete"||t=="loaded"){p()}};(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}this.isDone=function(m){return l[m]==i};this.markDone=function(m){l[m]=i};this.add=this.load=function(m,q,n){var o,p=l[m];if(p==e){j.push(m);l[m]=c}if(q){if(!f[m]){f[m]=[]}f[m].push({func:q,scope:n||this})}};this.loadQueue=function(n,m){this.loadScripts(j,n,m)};this.loadScripts=function(m,q,p){function n(r){a.each(f[r],function(s){s.func.call(s.scope)});f[r]=e}d.push({func:q,scope:p||this});(function o(){var r=a.grep(m);m.length=0;a.each(r,function(s){if(l[s]==i){n(s);return}if(l[s]!=k){l[s]=k;g++;b(s,function(){l[s]=i;g--;n(s);o()})}});if(!g){a.each(d,function(s){s.func.call(s.scope)});d.length=0}})()}};a.ScriptLoader=new a.dom.ScriptLoader()})(tinymce);tinymce.dom.TreeWalker=function(a,c){var b=a;function d(i,f,e,j){var h,g;if(i){if(!j&&i[f]){return i[f]}if(i!=c){h=i[e];if(h){return h}for(g=i.parentNode;g&&g!=c;g=g.parentNode){h=g[e];if(h){return h}}}}}this.current=function(){return b};this.next=function(e){return(b=d(b,"firstChild","nextSibling",e))};this.prev=function(e){return(b=d(b,"lastChild","lastSibling",e))}};(function(){var a={};function b(f,e){var d;function c(g){return g.replace(/[A-Z]+/g,function(h){return c(f[h])})}for(d in f){if(f.hasOwnProperty(d)){f[d]=c(f[d])}}c(e).replace(/#/g,"#text").replace(/(\w+)\[([^\]]+)\]/g,function(l,g,j){var h,k={};j=j.split(/\|/);for(h=j.length-1;h>=0;h--){k[j[h]]=1}a[g]=k})}b({Z:"#|H|K|N|O|P",Y:"#|X|form|R|Q",X:"p|T|div|U|W|isindex|fieldset|table",W:"pre|hr|blockquote|address|center|noframes",U:"ul|ol|dl|menu|dir",ZC:"#|p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q",T:"h1|h2|h3|h4|h5|h6",ZB:"#|X|S|Q",S:"R|P",ZA:"#|a|G|J|M|O|P",R:"#|a|H|K|N|O",Q:"noscript|P",P:"ins|del|script",O:"input|select|textarea|label|button",N:"M|L",M:"em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym",L:"sub|sup",K:"J|I",J:"tt|i|b|u|s|strike",I:"big|small|font|basefont",H:"G|F",G:"br|span|bdo",F:"object|applet|img|map|iframe"},"script[]style[]object[#|param|X|form|a|H|K|N|O|Q]param[]p[S]a[Z]br[]span[S]bdo[S]applet[#|param|X|form|a|H|K|N|O|Q]h1[S]img[]map[X|form|Q|area]h2[S]iframe[#|X|form|a|H|K|N|O|Q]h3[S]tt[S]i[S]b[S]u[S]s[S]strike[S]big[S]small[S]font[S]basefont[]em[S]strong[S]dfn[S]code[S]q[S]samp[S]kbd[S]var[S]cite[S]abbr[S]acronym[S]sub[S]sup[S]input[]select[optgroup|option]optgroup[option]option[]textarea[]label[S]button[#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]h4[S]ins[#|X|form|a|H|K|N|O|Q]h5[S]del[#|X|form|a|H|K|N|O|Q]h6[S]div[#|X|form|a|H|K|N|O|Q]ul[li]li[#|X|form|a|H|K|N|O|Q]ol[li]dl[dt|dd]dt[S]dd[#|X|form|a|H|K|N|O|Q]menu[li]dir[li]pre[ZA]hr[]blockquote[#|X|form|a|H|K|N|O|Q]address[S|p]center[#|X|form|a|H|K|N|O|Q]noframes[#|X|form|a|H|K|N|O|Q]isindex[]fieldset[#|legend|X|form|a|H|K|N|O|Q]legend[S]table[caption|col|colgroup|thead|tfoot|tbody|tr]caption[S]col[]colgroup[col]thead[tr]tr[th|td]th[#|X|form|a|H|K|N|O|Q]form[#|X|a|H|K|N|O|Q]noscript[#|X|form|a|H|K|N|O|Q]td[#|X|form|a|H|K|N|O|Q]tfoot[tr]tbody[tr]area[]base[]body[#|X|form|a|H|K|N|O|Q]");tinymce.dom.Schema=function(){var c=this,d=a;c.isValid=function(f,e){var g=d[f];return !!(g&&(!e||g[e]))}}})();(function(a){a.dom.RangeUtils=function(c){var b="\uFEFF";this.walk=function(d,r){var h=d.startContainer,k=d.startOffset,s=d.endContainer,l=d.endOffset,i,f,n,g,q,p,e;e=c.select("td.mceSelected,th.mceSelected");if(e.length>0){a.each(e,function(t){r([t])});return}function o(v,u,t){var x=[];for(;v&&v!=t;v=v[u]){x.push(v)}return x}function m(u,t){do{if(u.parentNode==t){return u}u=u.parentNode}while(u)}function j(v,u,x){var t=x?"nextSibling":"previousSibling";for(g=v,q=g.parentNode;g&&g!=u;g=q){q=g.parentNode;p=o(g==v?g:g[t],t);if(p.length){if(!x){p.reverse()}r(p)}}}if(h.nodeType==1&&h.hasChildNodes()){h=h.childNodes[k]}if(s.nodeType==1&&s.hasChildNodes()){s=s.childNodes[Math.min(k==l?l:l-1,s.childNodes.length-1)]}i=c.findCommonAncestor(h,s);if(h==s){return r([h])}for(g=h;g;g=g.parentNode){if(g==s){return j(h,i,true)}if(g==i){break}}for(g=s;g;g=g.parentNode){if(g==h){return j(s,i)}if(g==i){break}}f=m(h,i)||h;n=m(s,i)||s;j(h,f,true);p=o(f==h?f:f.nextSibling,"nextSibling",n==s?n.nextSibling:n);if(p.length){r(p)}j(s,n)}}})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(e,d){this.id=e;this.settings=d=d||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=d.scope||this;this.disabled=0;this.active=0},setDisabled:function(d){var f;if(d!=this.disabled){f=b.get(this.id);if(f&&this.settings.unavailable_prefix){if(d){this.prevTitle=f.title;f.title=this.settings.unavailable_prefix+": "+f.title}else{f.title=this.prevTitle}}this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(b,a){this.parent(b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator"},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(j){var h=this,i=h.settings,g;j.container=j.container||i.container;j.parent=h;j.constrain=j.constrain||i.constrain;j["class"]=j["class"]||i["class"];j.vp_offset_x=j.vp_offset_x||i.vp_offset_x;j.vp_offset_y=j.vp_offset_y||i.vp_offset_y;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},update:function(){var i=this,j=i.settings,g=c.get("menu_"+i.id+"_tbl"),l=c.get("menu_"+i.id+"_co"),h,k;h=j.max_width?Math.min(g.clientWidth,j.max_width):g.clientWidth;k=j.max_height?Math.min(g.clientHeight,j.max_height):g.clientHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.element.setStyles({width:h,height:k})}if(j.max_width){c.setStyle(l,"width",h)}if(j.max_height){c.setStyle(l,"height",k);if(g.clientHeight<j.max_height){c.setStyle(l,"overflow","hidden")}}},showMenu:function(p,n,r){var z=this,A=z.settings,o,g=c.getViewPort(),u,l,v,q,i=2,k,j,m=z.classPrefix;z.collapse(1);if(z.isMenuVisible){return}if(!z.rendered){o=c.add(z.settings.container,z.renderNode());f(z.items,function(h){h.postRender()});z.element=new b("menu_"+z.id,{blocker:1,container:A.container})}else{o=c.get("menu_"+z.id)}if(!e.isOpera){c.setStyles(o,{left:-65535,top:-65535})}c.show(o);z.update();p+=A.offset_x||0;n+=A.offset_y||0;g.w-=4;g.h-=4;if(A.constrain){u=o.clientWidth-i;l=o.clientHeight-i;v=g.x+g.w;q=g.y+g.h;if((p+A.vp_offset_x+u)>v){p=r?r-u:Math.max(0,(v-A.vp_offset_x)-u)}if((n+A.vp_offset_y+l)>q){n=Math.max(0,(q-A.vp_offset_y)-l)}}c.setStyles(o,{left:p,top:n});z.element.update();z.isMenuVisible=1;z.mouseClickFunc=a.add(o,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,m+"ItemSub")){h=z.items[s.id];if(h.isDisabled()){return}k=z;while(k){if(k.hideMenu){k.hideMenu()}k=k.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return a.cancel(s)}});if(z.hasMenus()){z.mouseOverFunc=a.add(o,"mouseover",function(x){var h,t,s;x=x.target;if(x&&(x=c.getParent(x,"tr"))){h=z.items[x.id];if(z.lastMenu){z.lastMenu.collapse(1)}if(h.isDisabled()){return}if(x&&c.hasClass(x,m+"ItemSub")){t=c.getRect(x);h.showMenu((t.x+t.w-i),t.y-i,t.x);z.lastMenu=h;c.addClass(c.get(h.id).firstChild,m+"ItemActive")}}})}z.onShowMenu.dispatch(z);if(A.keyboard_focus){a.add(o,"keydown",z._keyHandler,z);c.select("a","menu_"+z.id)[0].focus();z._focusIdx=0}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}a.remove(i,"mouseover",g.mouseOverFunc);a.remove(i,"click",g.mouseClickFunc);a.remove(i,"keydown",g._keyHandler);c.hide(i);g.isMenuVisible=0;if(!j){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(i){var g=this,h;i=g.parent(i);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],i)}return i},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);a.remove(h,"mouseover",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var i=this,j=i.settings,l,h,k,g;g=c.create("div",{id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000"});k=c.add(g,"div",{id:"menu_"+i.id+"_co","class":i.classPrefix+(j["class"]?" "+j["class"]:"")});i.element=new b("menu_"+i.id,{blocker:1,container:j.container});if(j.menu_line){c.add(k,"span",{"class":i.classPrefix+"Line"})}l=c.add(k,"table",{id:"menu_"+i.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(l,"tbody");f(i.items,function(m){i._add(h,m)});i.rendered=true;return g},_keyHandler:function(j){var i=this,h=j.keyCode;function g(m){var k=i._focusIdx+m,l=c.select("a","menu_"+i.id)[k];if(l){i._focusIdx=k;l.focus()}}switch(h){case 38:g(-1);return;case 40:g(1);return;case 13:return;case 27:return this.hideMenu()}},_add:function(j,h){var i,q=h.settings,p,l,k,m=this.classPrefix,g;if(q.separator){l=c.add(j,"tr",{id:h.id,"class":m+"ItemSeparator"});c.add(l,"td",{"class":m+"ItemSeparator"});if(i=l.previousSibling){c.addClass(i,"mceLast")}return}i=l=c.add(j,"tr",{id:h.id,"class":m+"Item "+m+"ItemEnabled"});i=k=c.add(i,"td");i=p=c.add(i,"a",{href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});c.addClass(k,q["class"]);g=c.add(i,"span",{"class":"mceIcon"+(q.icon?" mce_"+q.icon:"")});if(q.icon_src){c.add(g,"img",{src:q.icon_src})}i=c.add(i,q.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){c.setAttrib(i,"style",h.settings.style)}if(j.childNodes.length==1){c.addClass(l,"mceFirst")}if((i=l.previousSibling)&&c.hasClass(i,m+"ItemSeparator")){c.addClass(l,"mceFirst")}if(h.collapse){c.addClass(l,m+"ItemSub")}if(i=l.previousSibling){c.removeClass(i,"mceLast")}c.addClass(l,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(d,c){this.parent(d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='<a id="'+this.id+'" href="javascript:;" class="'+f+" "+f+"Enabled "+e["class"]+(c?" "+f+"Labeled":"")+'" onmousedown="return false;" onclick="return false;" title="'+a.encode(e.title)+'">';if(e.image){d+='<img class="mceIcon" src="'+e.image+'" />'+c+"</a>"}else{d+='<span class="mceIcon '+e["class"]+'"></span>'+(c?'<span class="'+f+'Label">'+c+"</span>":"")+"</a>"}return d},postRender:function(){var c=this,d=c.settings;b.dom.Event.add(c.id,"click",function(f){if(!c.isDisabled()){return d.onclick.call(d.scope,f)}})}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(h,g){var f=this;f.parent(h,g);f.items=[];f.onChange=new a(f);f.onPostRender=new a(f);f.onAdd=new a(f);f.onRenderMenu=new d.util.Dispatcher(this);f.classPrefix="mceListBox"},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){var g=this,h,i;if(f!=g.selectedIndex){h=c.get(g.id+"_text");i=g.items[f];if(i){g.selectedValue=i.value;g.selectedIndex=f;c.setHTML(h,c.encode(i.title));c.removeClass(h,"mceTitle")}else{c.setHTML(h,c.encode(g.settings.title));c.addClass(h,"mceTitle");g.selectedValue=g.selectedIndex=null}h=0}},add:function(i,f,h){var g=this;h=h||{};h=d.extend(h,{title:i,value:f});g.items.push(h);g.onAdd.dispatch(g,h)},getLength:function(){return this.items.length},renderHTML:function(){var i="",f=this,g=f.settings,j=f.classPrefix;i='<table id="'+f.id+'" cellpadding="0" cellspacing="0" class="'+j+" "+j+"Enabled"+(g["class"]?(" "+g["class"]):"")+'"><tbody><tr>';i+="<td>"+c.createHTML("a",{id:f.id+"_text",href:"javascript:;","class":"mceText",onclick:"return false;",onmousedown:"return false;"},c.encode(f.settings.title))+"</td>";i+="<td>"+c.createHTML("a",{id:f.id+"_open",tabindex:-1,href:"javascript:;","class":"mceOpen",onclick:"return false;",onmousedown:"return false;"},"<span></span>")+"</td>";i+="</tr></tbody></table>";return i},showMenu:function(){var g=this,j,i,h=c.get(this.id),f;if(g.isDisabled()||g.items.length==0){return}if(g.menu&&g.menu.isMenuVisible){return g.hideMenu()}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}j=c.getPos(this.settings.menu_container);i=c.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.keyboard_focus=!d.isOpera;if(g.oldID){f.items[g.oldID].setSelected(0)}e(g.items,function(k){if(k.value===g.selectedValue){f.items[k.id].setSelected(1);g.oldID=k.id}});f.showMenu(0,h.clientHeight);b.add(c.doc,"mousedown",g.hideMenu,g);c.addClass(g.id,g.classPrefix+"Selected")},hideMenu:function(g){var f=this;if(f.menu&&f.menu.isMenuVisible){if(g&&g.type=="mousedown"&&(g.target.id==f.id+"_text"||g.target.id==f.id+"_open")){return}if(!g||!c.getParent(g.target,".mceMenu")){c.removeClass(f.id,f.classPrefix+"Selected");b.remove(c.doc,"mousedown",f.hideMenu,f);f.menu.hideMenu()}}},renderMenu:function(){var g=this,f;f=g.settings.control_manager.createDropMenu(g.id+"_menu",{menu_line:1,"class":g.classPrefix+"Menu mceNoIcons",max_width:150,max_height:150});f.onHideMenu.add(g.hideMenu,g);f.add({title:g.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}});e(g.items,function(h){if(h.value===undefined){f.add({title:h.title,"class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}})}else{h.id=c.uniqueId();h.onclick=function(){if(g.settings.onselect(h.value)!==false){g.select(h.value)}};f.add(h)}});g.onRenderMenu.dispatch(g,f);g.menu=f},postRender:function(){var f=this,g=f.classPrefix;b.add(f.id,"click",f.showMenu,f);b.add(f.id+"_text","focus",function(h){if(!f._focused){f.keyDownHandler=b.add(f.id+"_text","keydown",function(l){var i=-1,j,k=l.keyCode;e(f.items,function(m,n){if(f.selectedValue==m.value){i=n}});if(k==38){j=f.items[i-1]}else{if(k==40){j=f.items[i+1]}else{if(k==13){j=f.selectedValue;f.selectedValue=null;f.settings.onselect(j);return b.cancel(l)}}}if(j){f.hideMenu();f.select(j.value)}})}f._focused=1});b.add(f.id+"_text","blur",function(){b.remove(f.id+"_text","keydown",f.keyDownHandler);f._focused=0});if(d.isIE6||!c.boxModel){b.add(f.id,"mouseover",function(){if(!c.hasClass(f.id,g+"Disabled")){c.addClass(f.id,g+"Hover")}});b.add(f.id,"mouseout",function(){if(!c.hasClass(f.id,g+"Disabled")){c.removeClass(f.id,g+"Hover")}})}f.onPostRender.dispatch(f,c.get(f.id))},destroy:function(){this.parent();b.clear(this.id+"_text");b.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(g,f){this.parent(g,f);this.classPrefix="mceNativeListBox"},setDisabled:function(f){c.get(this.id).disabled=f},isDisabled:function(){return c.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){c.get(this.id).selectedIndex=f+1;this.selectedValue=this.items[f]?this.items[f].value:null},add:function(j,g,f){var i,h=this;f=f||{};f.value=g;if(h.isRendered()){c.add(c.get(this.id),"option",f,j)}i={title:j,value:g,attribs:f};h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return c.get(this.id).options.length-1},renderHTML:function(){var g,f=this;g=c.createHTML("option",{value:""},"-- "+f.settings.title+" --");e(f.items,function(h){g+=c.createHTML("option",{value:h.value},h.title)});g=c.createHTML("select",{id:f.id,"class":"mceNativeListBox"},g);return g},postRender:function(){var g=this,h;g.rendered=true;function f(j){var i=g.items[j.target.selectedIndex-1];if(i&&(i=i.value)){g.onChange.dispatch(g,i);if(g.settings.onselect){g.settings.onselect(i)}}}b.add(g.id,"change",f);b.add(g.id,"keydown",function(j){var i;b.remove(g.id,"change",h);i=b.add(g.id,"blur",function(){b.add(g.id,"change",f);b.remove(g.id,"blur",i)});if(j.keyCode==13||j.keyCode==32){f(j);return b.cancel(j)}});g.onPostRender.dispatch(g,c.get(g.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(f,e){this.parent(f,e);this.onRenderMenu=new c.util.Dispatcher(this);e.menu_container=e.menu_container||b.doc.body},showMenu:function(){var g=this,j,i,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}j=b.getPos(g.settings.menu_container);i=b.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.vp_offset_x=i.x;f.settings.vp_offset_y=i.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:f.settings.icons});e.onHideMenu.add(f.hideMenu,f);f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(f,e){this.parent(f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="<tbody><tr>";if(g.image){e=b.createHTML("img ",{src:g.image,"class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}i+="<td>"+b.createHTML("a",{id:f.id+"_action",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";e=b.createHTML("span",{"class":"mceOpen "+g["class"]});i+="<td>"+b.createHTML("a",{id:f.id+"_open",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";i+="</tr></tbody>";return b.createHTML("table",{id:f.id,"class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",onmousedown:"return false;",title:g.title},i)},postRender:function(){var e=this,f=e.settings;if(f.onclick){a.add(e.id+"_action","click",function(){if(!e.isDisabled()){f.onclick(e.value)}})}a.add(e.id+"_open","click",e.showMenu,e);a.add(e.id+"_open","focus",function(){e._focused=1});a.add(e.id+"_open","blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHover")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(h,g){var f=this;f.parent(h,g);f.settings=g=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},f.settings);f.onShowMenu=new d.util.Dispatcher(f);f.onHideMenu=new d.util.Dispatcher(f);f.value=g.default_color},showMenu:function(){var f=this,g,j,i,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=true}if(f.isMenuVisible){return f.hideMenu()}i=c.get(f.id);c.show(f.id+"_menu");c.addClass(i,"mceSplitButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.clientHeight,zIndex:200000});i=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(k){if(k.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.isMenuVisible=1},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.onHideMenu.dispatch(f);f.isMenuVisible=0},renderMenu:function(){var k=this,f,j=0,l=k.settings,p,h,o,g;g=c.add(l.menu_container,"div",{id:k.id+"_menu","class":l.menu_class+" "+l["class"],style:"position:absolute;left:0;top:-1000px;"});f=c.add(g,"div",{"class":l["class"]+" mceSplitButtonMenu"});c.add(f,"span",{"class":"mceMenuLine"});p=c.add(f,"table",{"class":"mceColorSplitMenu"});h=c.add(p,"tbody");j=0;e(b(l.colors,"array")?l.colors:l.colors.split(","),function(i){i=i.replace(/^#/,"");if(!j--){o=c.add(h,"tr");j=l.grid_width-1}p=c.add(o,"td");p=c.add(p,"a",{href:"javascript:;",style:{backgroundColor:"#"+i},_mce_color:"#"+i})});if(l.more_colors_func){p=c.add(h,"tr");p=c.add(p,"td",{colspan:l.grid_width,"class":"mceMoreColors"});p=c.add(p,"a",{id:k.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},l.more_colors_title);a.add(p,"click",function(i){l.more_colors_func.call(l.more_colors_scope||this);return a.cancel(i)})}c.addClass(f,"mceColorSplitMenu");a.add(k.id+"_menu","click",function(i){var m;i=i.target;if(i.nodeName=="A"&&(m=i.getAttribute("_mce_color"))){k.setColor(m)}return a.cancel(i)});return g},setColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=g;f.hideMenu();f.settings.onselect(g)},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){this.parent();a.clear(this.id+"_menu");a.clear(this.id+"_more");c.remove(this.id+"_menu")}})})(tinymce);tinymce.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var l=this,e="",g,j,b=tinymce.DOM,m=l.settings,d,a,f,k;k=l.controls;for(d=0;d<k.length;d++){j=k[d];a=k[d-1];f=k[d+1];if(d===0){g="mceToolbarStart";if(j.Button){g+=" mceToolbarStartButton"}else{if(j.SplitButton){g+=" mceToolbarStartSplitButton"}else{if(j.ListBox){g+=" mceToolbarStartListBox"}}}e+=b.createHTML("td",{"class":g},b.createHTML("span",null,"<!-- IE -->"))}if(a&&j.ListBox){if(a.Button||a.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarEnd"},b.createHTML("span",null,"<!-- IE -->"))}}if(b.stdMode){e+='<td style="position: relative">'+j.renderHTML()+"</td>"}else{e+="<td>"+j.renderHTML()+"</td>"}if(f&&j.ListBox){if(f.Button||f.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarStart"},b.createHTML("span",null,"<!-- IE -->"))}}}g="mceToolbarEnd";if(j.Button){g+=" mceToolbarEndButton"}else{if(j.SplitButton){g+=" mceToolbarEndSplitButton"}else{if(j.ListBox){g+=" mceToolbarEndListBox"}}}e+=b.createHTML("td",{"class":g},b.createHTML("span",null,"<!-- IE -->"));return b.createHTML("table",{id:l.id,"class":"mceToolbar"+(m["class"]?" "+m["class"]:""),cellpadding:"0",cellspacing:"0",align:l.settings.align||""},"<tbody><tr>"+e+"</tr></tbody>")}});(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{items:[],urls:{},lookup:{},onAdd:new a(this),get:function(d){return this.lookup[d]},requireLangPack:function(e){var d=b.settings;if(d&&d.language){b.ScriptLoader.add(this.urls[e]+"/langs/"+d.language+".js")}},add:function(e,d){this.items.push(d);this.lookup[e]=d;this.onAdd.dispatch(this,e,d);return d},load:function(h,e,d,g){var f=this;if(f.urls[h]){return}if(e.indexOf("/")!=0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}f.urls[h]=e.substring(0,e.lastIndexOf("/"));b.ScriptLoader.add(e,d,g)}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(j){var g=j.each,d=j.extend,k=j.DOM,i=j.dom.Event,f=j.ThemeManager,b=j.PluginManager,e=j.explode,h=j.util.Dispatcher,a,c=0;j.documentBaseURL=window.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(j.documentBaseURL)){j.documentBaseURL+="/"}j.baseURL=new j.util.URI(j.documentBaseURL).toAbsolute(j.baseURL);j.baseURI=new j.util.URI(j.baseURL);j.onBeforeUnload=new h(j);i.add(window,"beforeunload",function(l){j.onBeforeUnload.dispatch(j,l)});j.onAddEditor=new h(j);j.onRemoveEditor=new h(j);j.EditorManager=d(j,{editors:[],i18n:{},activeEditor:null,init:function(q){var n=this,p,l=j.ScriptLoader,u,o=[],m;function r(x,y,t){var v=x[y];if(!v){return}if(j.is(v,"string")){t=v.replace(/\.\w+$/,"");t=t?j.resolve(t):0;v=j.resolve(v)}return v.apply(t||this,Array.prototype.slice.call(arguments,2))}q=d({theme:"simple",language:"en"},q);n.settings=q;i.add(document,"init",function(){var s,v;r(q,"onpageload");switch(q.mode){case"exact":s=q.elements||"";if(s.length>0){g(e(s),function(x){if(k.get(x)){m=new j.Editor(x,q);o.push(m);m.render(1)}else{g(document.forms,function(y){g(y.elements,function(z){if(z.name===x){x="mce_editor_"+c++;k.setAttrib(z,"id",x);m=new j.Editor(x,q);o.push(m);m.render(1)}})})}})}break;case"textareas":case"specific_textareas":function t(y,x){return x.constructor===RegExp?x.test(y.className):k.hasClass(y,x)}g(k.select("textarea"),function(x){if(q.editor_deselector&&t(x,q.editor_deselector)){return}if(!q.editor_selector||t(x,q.editor_selector)){u=k.get(x.name);if(!x.id&&!u){x.id=x.name}if(!x.id||n.get(x.id)){x.id=k.uniqueId()}m=new j.Editor(x.id,q);o.push(m);m.render(1)}});break}if(q.oninit){s=v=0;g(o,function(x){v++;if(!x.initialized){x.onInit.add(function(){s++;if(s==v){r(q,"oninit")}})}else{s++}if(s==v){r(q,"oninit")}})}})},get:function(l){if(l===a){return this.editors}return this.editors[l]},getInstanceById:function(l){return this.get(l)},add:function(m){var l=this,n=l.editors;n[m.id]=m;n.push(m);l._setActive(m);l.onAddEditor.dispatch(l,m);return m},remove:function(n){var m=this,l,o=m.editors;if(!o[n.id]){return null}delete o[n.id];for(l=0;l<o.length;l++){if(o[l]==n){o.splice(l,1);break}}if(m.activeEditor==n){m._setActive(o[0])}n.destroy();m.onRemoveEditor.dispatch(m,n);return n},execCommand:function(r,p,o){var q=this,n=q.get(o),l;switch(r){case"mceFocus":n.focus();return true;case"mceAddEditor":case"mceAddControl":if(!q.get(o)){new j.Editor(o,q.settings).render()}return true;case"mceAddFrameControl":l=o.window;l.tinyMCE=tinyMCE;l.tinymce=j;j.DOM.doc=l.document;j.DOM.win=l;n=new j.Editor(o.element_id,o);n.render();if(j.isIE){function m(){n.destroy();l.detachEvent("onunload",m);l=l.tinyMCE=l.tinymce=null}l.attachEvent("onunload",m)}o.page_window=null;return true;case"mceRemoveEditor":case"mceRemoveControl":if(n){n.remove()}return true;case"mceToggleEditor":if(!n){q.execCommand("mceAddControl",0,o);return true}if(n.isHidden()){n.show()}else{n.hide()}return true}if(q.activeEditor){return q.activeEditor.execCommand(r,p,o)}return false},execInstanceCommand:function(p,o,n,m){var l=this.get(p);if(l){return l.execCommand(o,n,m)}return false},triggerSave:function(){g(this.editors,function(l){l.save()})},addI18n:function(n,q){var l,m=this.i18n;if(!j.is(n,"string")){g(n,function(r,p){g(r,function(t,s){g(t,function(v,u){if(s==="common"){m[p+"."+u]=v}else{m[p+"."+s+"."+u]=v}})})})}else{g(q,function(r,p){m[n+"."+p]=r})}},_setActive:function(l){this.selectedInstance=this.activeEditor=l}})})(tinymce);(function(m){var n=m.DOM,j=m.dom.Event,f=m.extend,k=m.util.Dispatcher,i=m.each,a=m.isGecko,b=m.isIE,e=m.isWebKit,d=m.is,h=m.ThemeManager,c=m.PluginManager,o=m.inArray,l=m.grep,g=m.explode;m.create("tinymce.Editor",{Editor:function(r,q){var p=this;p.id=p.editorId=r;p.execCommands={};p.queryStateCommands={};p.queryValueCommands={};p.isNotDirty=false;p.plugins={};i(["onPreInit","onBeforeRenderUI","onPostRender","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState"],function(s){p[s]=new k(p)});p.settings=q=f({id:r,language:"en",docs_language:"en",theme:"simple",skin:"default",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:m.documentBaseURL,add_form_submit_trigger:1,submit_patch:1,add_unload_trigger:1,convert_urls:1,relative_urls:1,remove_script_host:1,table_inline_editing:0,object_resizing:1,cleanup:1,accessibility_focus:1,custom_shortcuts:1,custom_undo_redo_keyboard_shortcuts:1,custom_undo_redo_restore_selection:1,custom_undo_redo:1,doctype:"<!DOCTYPE>",visual_table_class:"mceItemTable",visual:1,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",apply_source_formatting:1,directionality:"ltr",forced_root_block:"p",valid_elements:"@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,#p,-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote[cite],-table[border|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value],embed[type|width|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value|tabindex|accesskey],kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],q[cite],samp,select[disabled|multiple|name|size],small,textarea[cols|rows|disabled|name|readonly],tt,var,big",hidden_input:1,padd_empty_editor:1,render_ui:1,init_theme:1,force_p_newlines:1,indentation:"30px",keep_styles:1,fix_table_elements:1,inline_styles:1,convert_fonts_to_spans:true},q);p.documentBaseURI=new m.util.URI(q.document_base_url||m.documentBaseURL,{base_uri:tinyMCE.baseURI});p.baseURI=m.baseURI;p.execCallback("setup",p)},render:function(r){var u=this,v=u.settings,x=u.id,p=m.ScriptLoader;if(!j.domLoaded){j.add(document,"init",function(){u.render()});return}tinyMCE.settings=v;if(!u.getElement()){return}if(!/TEXTAREA|INPUT/i.test(u.getElement().nodeName)&&v.hidden_input&&n.getParent(x,"form")){n.insertAfter(n.create("input",{type:"hidden",name:x}),x)}if(m.WindowManager){u.windowManager=new m.WindowManager(u)}if(v.encoding=="xml"){u.onGetContent.add(function(s,t){if(t.save){t.content=n.encode(t.content)}})}if(v.add_form_submit_trigger){u.onSubmit.addToTop(function(){if(u.initialized){u.save();u.isNotDirty=1}})}if(v.add_unload_trigger){u._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(u.initialized&&!u.destroyed&&!u.isHidden()){u.save({format:"raw",no_events:true})}})}m.addUnload(u.destroy,u);if(v.submit_patch){u.onBeforeRenderUI.add(function(){var s=u.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){u.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){m.triggerSave();u.isNotDirty=1;return u.formElement._mceOldSubmit(u.formElement)}}s=null})}function q(){if(v.language){p.add(m.baseURL+"/langs/"+v.language+".js")}if(v.theme&&v.theme.charAt(0)!="-"&&!h.urls[v.theme]){h.load(v.theme,"themes/"+v.theme+"/editor_template"+m.suffix+".js")}i(g(v.plugins),function(s){if(s&&s.charAt(0)!="-"&&!c.urls[s]){if(s=="safari"){return}c.load(s,"plugins/"+s+"/editor_plugin"+m.suffix+".js")}});p.loadQueue(function(){if(!u.removed){u.init()}})}q()},init:function(){var r,E=this,F=E.settings,B,y,A=E.getElement(),q,p,C,x,z,D;m.add(E);if(F.theme){F.theme=F.theme.replace(/-/,"");q=h.get(F.theme);E.theme=new q();if(E.theme.init&&F.init_theme){E.theme.init(E,h.urls[F.theme]||m.documentBaseURL.replace(/\/$/,""))}}i(g(F.plugins.replace(/\-/g,"")),function(G){var H=c.get(G),t=c.urls[G]||m.documentBaseURL.replace(/\/$/,""),s;if(H){s=new H(E,t);E.plugins[G]=s;if(s.init){s.init(E,t)}}});if(F.popup_css!==false){if(F.popup_css){F.popup_css=E.documentBaseURI.toAbsolute(F.popup_css)}else{F.popup_css=E.baseURI.toAbsolute("themes/"+F.theme+"/skins/"+F.skin+"/dialog.css")}}if(F.popup_css_add){F.popup_css+=","+E.documentBaseURI.toAbsolute(F.popup_css_add)}E.controlManager=new m.ControlManager(E);if(F.custom_undo_redo){E.onBeforeExecCommand.add(function(t,G,u,H,s){if(G!="Undo"&&G!="Redo"&&G!="mceRepaint"&&(!s||!s.skip_undo)){if(!E.undoManager.hasUndo()){E.undoManager.add()}}});E.onExecCommand.add(function(t,G,u,H,s){if(G!="Undo"&&G!="Redo"&&G!="mceRepaint"&&(!s||!s.skip_undo)){E.undoManager.add()}})}E.onExecCommand.add(function(s,t){if(!/^(FontName|FontSize)$/.test(t)){E.nodeChanged()}});if(a){function v(s,t){if(!t||!t.initial){E.execCommand("mceRepaint")}}E.onUndo.add(v);E.onRedo.add(v);E.onSetContent.add(v)}E.onBeforeRenderUI.dispatch(E,E.controlManager);if(F.render_ui){B=F.width||A.style.width||A.offsetWidth;y=F.height||A.style.height||A.offsetHeight;E.orgDisplay=A.style.display;D=/^[0-9\.]+(|px)$/i;if(D.test(""+B)){B=Math.max(parseInt(B)+(q.deltaWidth||0),100)}if(D.test(""+y)){y=Math.max(parseInt(y)+(q.deltaHeight||0),100)}q=E.theme.renderUI({targetNode:A,width:B,height:y,deltaWidth:F.delta_width,deltaHeight:F.delta_height});E.editorContainer=q.editorContainer}if(document.domain&&location.hostname!=document.domain){m.relaxedDomain=document.domain}n.setStyles(q.sizeContainer||q.editorContainer,{width:B,height:y});y=(q.iframeHeight||y)+(typeof(y)=="number"?(q.deltaHeight||0):"");if(y<100){y=100}E.iframeHTML=F.doctype+'<html><head xmlns="http://www.w3.org/1999/xhtml">';if(F.document_base_url!=m.documentBaseURL){E.iframeHTML+='<base href="'+E.documentBaseURI.getURI()+'" />'}E.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=7" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';if(m.relaxedDomain){E.iframeHTML+='<script type="text/javascript">document.domain = "'+m.relaxedDomain+'";<\/script>'}x=F.body_id||"tinymce";if(x.indexOf("=")!=-1){x=E.getParam("body_id","","hash");x=x[E.id]||x}z=F.body_class||"";if(z.indexOf("=")!=-1){z=E.getParam("body_class","","hash");z=z[E.id]||""}E.iframeHTML+='</head><body id="'+x+'" class="mceContentBody '+z+'"></body></html>';if(m.relaxedDomain){if(b||(m.isOpera&&parseFloat(opera.version())>=9.5)){C='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+E.id+'");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'}else{if(m.isOpera){C='javascript:(function(){document.open();document.domain="'+document.domain+'";document.close();ed.setupIframe();})()'}}}r=n.add(q.iframeContainer,"iframe",{id:E.id+"_ifr",src:C||'javascript:""',frameBorder:"0",style:{width:"100%",height:y}});E.contentAreaContainer=q.iframeContainer;n.get(q.editorContainer).style.display=E.orgDisplay;n.get(E.id).style.display="none";if(!b||!m.relaxedDomain){E.setupIframe()}A=r=q=null},setupIframe:function(){var z=this,A=z.settings,r=n.get(z.id),u=z.getDoc(),q,x;if(!b||!m.relaxedDomain){u.open();u.write(z.iframeHTML);u.close()}if(!b){try{if(!A.readonly){u.designMode="On"}}catch(v){}}if(b){x=z.getBody();n.hide(x);if(!A.readonly){x.contentEditable=true}n.show(x)}z.dom=new m.dom.DOMUtils(z.getDoc(),{keep_values:true,url_converter:z.convertURL,url_converter_scope:z,hex_colors:A.force_hex_style_colors,class_filter:A.class_filter,update_styles:1,fix_ie_paragraphs:1,valid_styles:A.valid_styles});z.schema=new m.dom.Schema();z.serializer=new m.dom.Serializer(f(A,{valid_elements:A.verify_html===false?"*[*]":A.valid_elements,dom:z.dom,schema:z.schema}));z.selection=new m.dom.Selection(z.dom,z.getWin(),z.serializer);z.formatter=new m.Formatter(this);z.formatter.register({alignleft:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"left"}},{selector:"img,table",styles:{"float":"left"}}],aligncenter:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"center"}},{selector:"img",styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"right"}},{selector:"img,table",styles:{"float":"right"}}],alignfull:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"justify"}}],bold:[{inline:"strong"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b"}],italic:[{inline:"em"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:true},{inline:"u"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:true},{inline:"u"}],forecolor:{inline:"span",styles:{color:"%value"}},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"}},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},blockquote:{block:"blockquote",wrapper:1},removeformat:[{selector:"b,strong,em,i,font,u,strike",remove:"all",split:true,expand:false,block_expand:true,deep:true},{selector:"span",attributes:["style","class"],remove:"empty",split:true,expand:false,deep:true},{selector:"*",attributes:["style","class"],expand:false,deep:true}]});i("p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp".split(/\s/),function(s){z.formatter.register(s,{block:s})});z.formatter.register(z.settings.formats);z.undoManager=new m.UndoManager(z);z.undoManager.onAdd.add(function(t,s){if(!s.initial){return z.onChange.dispatch(z,s,t)}});z.undoManager.onUndo.add(function(t,s){return z.onUndo.dispatch(z,s,t)});z.undoManager.onRedo.add(function(t,s){return z.onRedo.dispatch(z,s,t)});z.forceBlocks=new m.ForceBlocks(z,{forced_root_block:A.forced_root_block});z.editorCommands=new m.EditorCommands(z);z.serializer.onPreProcess.add(function(s,t){return z.onPreProcess.dispatch(z,t,s)});z.serializer.onPostProcess.add(function(s,t){return z.onPostProcess.dispatch(z,t,s)});z.onPreInit.dispatch(z);if(!A.gecko_spellcheck){z.getBody().spellcheck=0}if(!A.readonly){z._addEvents()}z.controlManager.onPostRender.dispatch(z,z.controlManager);z.onPostRender.dispatch(z);if(A.directionality){z.getBody().dir=A.directionality}if(A.nowrap){z.getBody().style.whiteSpace="nowrap"}if(A.custom_elements){function y(s,t){i(g(A.custom_elements),function(B){var C;if(B.indexOf("~")===0){B=B.substring(1);C="span"}else{C="div"}t.content=t.content.replace(new RegExp("<("+B+")([^>]*)>","g"),"<"+C+' _mce_name="$1"$2>');t.content=t.content.replace(new RegExp("</("+B+")>","g"),"</"+C+">")})}z.onBeforeSetContent.add(y);z.onPostProcess.add(function(s,t){if(t.set){y(s,t)}})}if(A.handle_node_change_callback){z.onNodeChange.add(function(t,s,B){z.execCallback("handle_node_change_callback",z.id,B,-1,-1,true,z.selection.isCollapsed())})}if(A.save_callback){z.onSaveContent.add(function(s,B){var t=z.execCallback("save_callback",z.id,B.content,z.getBody());if(t){B.content=t}})}if(A.onchange_callback){z.onChange.add(function(t,s){z.execCallback("onchange_callback",z,s)})}if(A.convert_newlines_to_brs){z.onBeforeSetContent.add(function(s,t){if(t.initial){t.content=t.content.replace(/\r?\n/g,"<br />")}})}if(A.fix_nesting&&b){z.onBeforeSetContent.add(function(s,t){t.content=z._fixNesting(t.content)})}if(A.preformatted){z.onPostProcess.add(function(s,t){t.content=t.content.replace(/^\s*<pre.*?>/,"");t.content=t.content.replace(/<\/pre>\s*$/,"");if(t.set){t.content='<pre class="mceItemHidden">'+t.content+"</pre>"}})}if(A.verify_css_classes){z.serializer.attribValueFilter=function(D,B){var C,t;if(D=="class"){if(!z.classesRE){t=z.dom.getClasses();if(t.length>0){C="";i(t,function(s){C+=(C?"|":"")+s["class"]});z.classesRE=new RegExp("("+C+")","gi")}}return !z.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(B)||z.classesRE.test(B)?B:""}return B}}if(A.cleanup_callback){z.onBeforeSetContent.add(function(s,t){t.content=z.execCallback("cleanup_callback","insert_to_editor",t.content,t)});z.onPreProcess.add(function(s,t){if(t.set){z.execCallback("cleanup_callback","insert_to_editor_dom",t.node,t)}if(t.get){z.execCallback("cleanup_callback","get_from_editor_dom",t.node,t)}});z.onPostProcess.add(function(s,t){if(t.set){t.content=z.execCallback("cleanup_callback","insert_to_editor",t.content,t)}if(t.get){t.content=z.execCallback("cleanup_callback","get_from_editor",t.content,t)}})}if(A.save_callback){z.onGetContent.add(function(s,t){if(t.save){t.content=z.execCallback("save_callback",z.id,t.content,z.getBody())}})}if(A.handle_event_callback){z.onEvent.add(function(s,t,B){if(z.execCallback("handle_event_callback",t,s,B)===false){j.cancel(t)}})}z.onSetContent.add(function(){z.addVisual(z.getBody())});if(A.padd_empty_editor){z.onPostProcess.add(function(s,t){t.content=t.content.replace(/^(<p[^>]*>(&nbsp;|&#160;|\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")})}if(a){function p(s,t){i(s.dom.select("a"),function(C){var B=C.parentNode;if(s.dom.isBlock(B)&&B.lastChild===C){s.dom.add(B,"br",{_mce_bogus:1})}})}z.onExecCommand.add(function(s,t){if(t==="CreateLink"){p(s)}});z.onSetContent.add(z.selection.onSetContent.add(p));if(!A.readonly){try{u.designMode="Off";u.designMode="On"}catch(v){}}}setTimeout(function(){if(z.removed){return}z.load({initial:true,format:(A.cleanup_on_startup?"html":"raw")});z.startContent=z.getContent({format:"raw"});z.initialized=true;z.onInit.dispatch(z);z.execCallback("setupcontent_callback",z.id,z.getBody(),z.getDoc());z.execCallback("init_instance_callback",z);z.focus(true);z.nodeChanged({initial:1});if(A.content_css){m.each(g(A.content_css),function(s){z.dom.loadCSS(z.documentBaseURI.toAbsolute(s))})}if(A.auto_focus){setTimeout(function(){var s=m.get(A.auto_focus);s.selection.select(s.getBody(),1);s.selection.collapse(1);s.getWin().focus()},100)}},1);r=null},focus:function(q){var s,p=this,r=p.settings.content_editable;if(!q){if(!r&&(!b||p.selection.getNode().ownerDocument!=p.getDoc())){p.getWin().focus()}}if(m.activeEditor!=p){if((s=m.activeEditor)!=null){s.onDeactivate.dispatch(s,p)}p.onActivate.dispatch(p,s)}m._setActive(p)},execCallback:function(u){var p=this,r=p.settings[u],q;if(!r){return}if(p.callbackLookup&&(q=p.callbackLookup[u])){r=q.func;q=q.scope}if(d(r,"string")){q=r.replace(/\.\w+$/,"");q=q?m.resolve(q):0;r=m.resolve(r);p.callbackLookup=p.callbackLookup||{};p.callbackLookup[u]={func:r,scope:q}}return r.apply(q||p,Array.prototype.slice.call(arguments,1))},translate:function(p){var r=this.settings.language||"en",q=m.i18n;if(!p){return""}return q[r+"."+p]||p.replace(/{\#([^}]+)\}/g,function(t,s){return q[r+"."+s]||"{#"+s+"}"})},getLang:function(q,p){return m.i18n[(this.settings.language||"en")+"."+q]||(d(p)?p:"{#"+q+"}")},getParam:function(u,r,p){var s=m.trim,q=d(this.settings[u])?this.settings[u]:r,t;if(p==="hash"){t={};if(d(q,"string")){i(q.indexOf("=")>0?q.split(/[;,](?![^=;,]*(?:[;,]|$))/):q.split(","),function(x){x=x.split("=");if(x.length>1){t[s(x[0])]=s(x[1])}else{t[s(x[0])]=s(x)}})}else{t=q}return t}return q},nodeChanged:function(r){var p=this,q=p.selection,u=q.getNode()||p.getBody();if(p.initialized){r=r||{};u=b&&u.ownerDocument!=p.getDoc()?p.getBody():u;r.parents=[];p.dom.getParent(u,function(s){if(s.nodeName=="BODY"){return true}r.parents.push(s)});p.onNodeChange.dispatch(p,r?r.controlManager||p.controlManager:p.controlManager,u,q.isCollapsed(),r)}},addButton:function(r,q){var p=this;p.buttons=p.buttons||{};p.buttons[r]=q},addCommand:function(r,q,p){this.execCommands[r]={func:q,scope:p||this}},addQueryStateHandler:function(r,q,p){this.queryStateCommands[r]={func:q,scope:p||this}},addQueryValueHandler:function(r,q,p){this.queryValueCommands[r]={func:q,scope:p||this}},addShortcut:function(r,u,p,s){var q=this,v;if(!q.settings.custom_shortcuts){return false}q.shortcuts=q.shortcuts||{};if(d(p,"string")){v=p;p=function(){q.execCommand(v,false,null)}}if(d(p,"object")){v=p;p=function(){q.execCommand(v[0],v[1],v[2])}}i(g(r),function(t){var x={func:p,scope:s||this,desc:u,alt:false,ctrl:false,shift:false};i(g(t,"+"),function(y){switch(y){case"alt":case"ctrl":case"shift":x[y]=true;break;default:x.charCode=y.charCodeAt(0);x.keyCode=y.toUpperCase().charCodeAt(0)}});q.shortcuts[(x.ctrl?"ctrl":"")+","+(x.alt?"alt":"")+","+(x.shift?"shift":"")+","+x.keyCode]=x});return true},execCommand:function(x,v,z,p){var r=this,u=0,y,q;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(x)&&(!p||!p.skip_focus)){r.focus()}y={};r.onBeforeExecCommand.dispatch(r,x,v,z,y);if(y.terminate){return false}if(r.execCallback("execcommand_callback",r.id,r.selection.getNode(),x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}if(y=r.execCommands[x]){q=y.func.call(y.scope,v,z);if(q!==true){r.onExecCommand.dispatch(r,x,v,z,p);return q}}i(r.plugins,function(s){if(s.execCommand&&s.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);u=1;return false}});if(u){return true}if(r.theme&&r.theme.execCommand&&r.theme.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}if(m.GlobalCommands.execCommand(r,x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}if(r.editorCommands.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}r.getDoc().execCommand(x,v,z);r.onExecCommand.dispatch(r,x,v,z,p)},queryCommandState:function(u){var q=this,v,r;if(q._isHidden()){return}if(v=q.queryStateCommands[u]){r=v.func.call(v.scope);if(r!==true){return r}}v=q.editorCommands.queryCommandState(u);if(v!==-1){return v}try{return this.getDoc().queryCommandState(u)}catch(p){}},queryCommandValue:function(v){var q=this,u,r;if(q._isHidden()){return}if(u=q.queryValueCommands[v]){r=u.func.call(u.scope);if(r!==true){return r}}u=q.editorCommands.queryCommandValue(v);if(d(u)){return u}try{return this.getDoc().queryCommandValue(v)}catch(p){}},show:function(){var p=this;n.show(p.getContainer());n.hide(p.id);p.load()},hide:function(){var p=this,q=p.getDoc();if(b&&q){q.execCommand("SelectAll")}p.save();n.hide(p.getContainer());n.setStyle(p.id,"display",p.orgDisplay)},isHidden:function(){return !n.isHidden(this.id)},setProgressState:function(p,q,r){this.onSetProgressState.dispatch(this,p,q,r);return p},load:function(s){var p=this,r=p.getElement(),q;if(r){s=s||{};s.load=true;q=p.setContent(d(r.value)?r.value:r.innerHTML,s);s.element=r;if(!s.no_events){p.onLoadContent.dispatch(p,s)}s.element=r=null;return q}},save:function(u){var p=this,s=p.getElement(),q,r;if(!s||!p.initialized){return}u=u||{};u.save=true;if(!u.no_events){p.undoManager.typing=0;p.undoManager.add()}u.element=s;q=u.content=p.getContent(u);if(!u.no_events){p.onSaveContent.dispatch(p,u)}q=u.content;if(!/TEXTAREA|INPUT/i.test(s.nodeName)){s.innerHTML=q;if(r=n.getParent(p.id,"form")){i(r.elements,function(t){if(t.name==p.id){t.value=q;return false}})}}else{s.value=q}u.element=s=null;return q},setContent:function(q,r){var p=this;r=r||{};r.format=r.format||"html";r.set=true;r.content=q;if(!r.no_events){p.onBeforeSetContent.dispatch(p,r)}if(!m.isIE&&(q.length===0||/^\s+$/.test(q))){r.content=p.dom.setHTML(p.getBody(),'<br _mce_bogus="1" />');r.format="raw"}r.content=p.dom.setHTML(p.getBody(),m.trim(r.content));if(r.format!="raw"&&p.settings.cleanup){r.getInner=true;r.content=p.dom.setHTML(p.getBody(),p.serializer.serialize(p.getBody(),r))}if(!r.no_events){p.onSetContent.dispatch(p,r)}return r.content},getContent:function(r){var p=this,q;r=r||{};r.format=r.format||"html";r.get=true;if(!r.no_events){p.onBeforeGetContent.dispatch(p,r)}if(r.format!="raw"&&p.settings.cleanup){r.getInner=true;q=p.serializer.serialize(p.getBody(),r)}else{q=p.getBody().innerHTML}q=q.replace(/^\s*|\s*$/g,"");r.content=q;if(!r.no_events){p.onGetContent.dispatch(p,r)}return r.content},isDirty:function(){var p=this;return m.trim(p.startContent)!=m.trim(p.getContent({format:"raw",no_events:1}))&&!p.isNotDirty},getContainer:function(){var p=this;if(!p.container){p.container=n.get(p.editorContainer||p.id+"_parent")}return p.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return n.get(this.settings.content_element||this.id)},getWin:function(){var p=this,q;if(!p.contentWindow){q=n.get(p.id+"_ifr");if(q){p.contentWindow=q.contentWindow}}return p.contentWindow},getDoc:function(){var q=this,p;if(!q.contentDocument){p=q.getWin();if(p){q.contentDocument=p.document}}return q.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(p,x,v){var q=this,r=q.settings;if(r.urlconverter_callback){return q.execCallback("urlconverter_callback",p,v,true,x)}if(!r.convert_urls||(v&&v.nodeName=="LINK")||p.indexOf("file:")===0){return p}if(r.relative_urls){return q.documentBaseURI.toRelative(p)}p=q.documentBaseURI.toAbsolute(p,r.remove_script_host);return p},addVisual:function(r){var p=this,q=p.settings;r=r||p.getBody();if(!d(p.hasVisual)){p.hasVisual=q.visual}i(p.dom.select("table,a",r),function(t){var s;switch(t.nodeName){case"TABLE":s=p.dom.getAttrib(t,"border");if(!s||s=="0"){if(p.hasVisual){p.dom.addClass(t,q.visual_table_class)}else{p.dom.removeClass(t,q.visual_table_class)}}return;case"A":s=p.dom.getAttrib(t,"name");if(s){if(p.hasVisual){p.dom.addClass(t,"mceItemAnchor")}else{p.dom.removeClass(t,"mceItemAnchor")}}return}});p.onVisualAid.dispatch(p,r,p.hasVisual)},remove:function(){var p=this,q=p.getContainer();p.removed=1;p.hide();p.execCallback("remove_instance_callback",p);p.onRemove.dispatch(p);p.onExecCommand.listeners=[];m.remove(p);n.remove(q)},destroy:function(q){var p=this;if(p.destroyed){return}if(!q){m.removeUnload(p.destroy);tinyMCE.onBeforeUnload.remove(p._beforeUnload);if(p.theme&&p.theme.destroy){p.theme.destroy()}p.controlManager.destroy();p.selection.destroy();p.dom.destroy();if(!p.settings.content_editable){j.clear(p.getWin());j.clear(p.getDoc())}j.clear(p.getBody());j.clear(p.formElement)}if(p.formElement){p.formElement.submit=p.formElement._mceOldSubmit;p.formElement._mceOldSubmit=null}p.contentAreaContainer=p.formElement=p.container=p.settings.content_element=p.bodyElement=p.contentDocument=p.contentWindow=null;if(p.selection){p.selection=p.selection.win=p.selection.dom=p.selection.dom.doc=null}p.destroyed=1},_addEvents:function(){var v=this,u,y=v.settings,x={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function r(t,A){var s=t.type;if(v.removed){return}if(v.onEvent.dispatch(v,t,A)!==false){v[x[t.fakeType||t.type]].dispatch(v,t,A)}}i(x,function(t,s){switch(s){case"contextmenu":if(m.isOpera){v.dom.bind(v.getBody(),"mousedown",function(A){if(A.ctrlKey){A.fakeType="contextmenu";r(A)}})}else{v.dom.bind(v.getBody(),s,r)}break;case"paste":v.dom.bind(v.getBody(),s,function(A){r(A)});break;case"submit":case"reset":v.dom.bind(v.getElement().form||n.getParent(v.id,"form"),s,r);break;default:v.dom.bind(y.content_editable?v.getBody():v.getDoc(),s,r)}});v.dom.bind(y.content_editable?v.getBody():(a?v.getDoc():v.getWin()),"focus",function(s){v.focus(true)});if(m.isGecko){v.dom.bind(v.getDoc(),"DOMNodeInserted",function(t){var s;t=t.target;if(t.nodeType===1&&t.nodeName==="IMG"&&(s=t.getAttribute("_mce_src"))){t.src=v.documentBaseURI.toAbsolute(s)}})}if(a){function p(){var B=this,D=B.getDoc(),C=B.settings;if(a&&!C.readonly){if(B._isHidden()){try{if(!C.content_editable){D.designMode="On"}}catch(A){}}try{D.execCommand("styleWithCSS",0,false)}catch(A){if(!B._isHidden()){try{D.execCommand("useCSS",0,true)}catch(A){}}}if(!C.table_inline_editing){try{D.execCommand("enableInlineTableEditing",false,false)}catch(A){}}if(!C.object_resizing){try{D.execCommand("enableObjectResizing",false,false)}catch(A){}}}}v.onBeforeExecCommand.add(p);v.onMouseDown.add(p)}if(m.isWebKit){v.onClick.add(function(s,t){t=t.target;if(t.nodeName=="IMG"){v.selection.getSel().setBaseAndExtent(t,0,t,1)}})}v.onMouseUp.add(v.nodeChanged);v.onClick.add(v.nodeChanged);v.onKeyUp.add(function(s,t){var A=t.keyCode;if((A>=33&&A<=36)||(A>=37&&A<=40)||A==13||A==45||A==46||A==8||(m.isMac&&(A==91||A==93))||t.ctrlKey){v.nodeChanged()}});v.onReset.add(function(){v.setContent(v.startContent,{format:"raw"})});if(y.custom_shortcuts){if(y.custom_undo_redo_keyboard_shortcuts){v.addShortcut("ctrl+z",v.getLang("undo_desc"),"Undo");v.addShortcut("ctrl+y",v.getLang("redo_desc"),"Redo")}if(a){v.addShortcut("ctrl+b",v.getLang("bold_desc"),"Bold");v.addShortcut("ctrl+i",v.getLang("italic_desc"),"Italic");v.addShortcut("ctrl+u",v.getLang("underline_desc"),"Underline")}for(u=1;u<=6;u++){v.addShortcut("ctrl+"+u,"",["FormatBlock",false,"h"+u])}v.addShortcut("ctrl+7","",["FormatBlock",false,"<p>"]);v.addShortcut("ctrl+8","",["FormatBlock",false,"<div>"]);v.addShortcut("ctrl+9","",["FormatBlock",false,"<address>"]);function z(t){var s=null;if(!t.altKey&&!t.ctrlKey&&!t.metaKey){return s}i(v.shortcuts,function(A){if(m.isMac&&A.ctrl!=t.metaKey){return}else{if(!m.isMac&&A.ctrl!=t.ctrlKey){return}}if(A.alt!=t.altKey){return}if(A.shift!=t.shiftKey){return}if(t.keyCode==A.keyCode||(t.charCode&&t.charCode==A.charCode)){s=A;return false}});return s}v.onKeyUp.add(function(s,t){var A=z(t);if(A){return j.cancel(t)}});v.onKeyPress.add(function(s,t){var A=z(t);if(A){return j.cancel(t)}});v.onKeyDown.add(function(s,t){var A=z(t);if(A){A.func.call(A.scope);return j.cancel(t)}})}if(m.isIE){v.dom.bind(v.getDoc(),"controlselect",function(A){var t=v.resizeInfo,s;A=A.target;if(A.nodeName!=="IMG"){return}if(t){v.dom.unbind(t.node,t.ev,t.cb)}if(!v.dom.hasClass(A,"mceItemNoResize")){ev="resizeend";s=v.dom.bind(A,ev,function(C){var B;C=C.target;if(B=v.dom.getStyle(C,"width")){v.dom.setAttrib(C,"width",B.replace(/[^0-9%]+/g,""));v.dom.setStyle(C,"width","")}if(B=v.dom.getStyle(C,"height")){v.dom.setAttrib(C,"height",B.replace(/[^0-9%]+/g,""));v.dom.setStyle(C,"height","")}})}else{ev="resizestart";s=v.dom.bind(A,"resizestart",j.cancel,j)}t=v.resizeInfo={node:A,ev:ev,cb:s}});v.onKeyDown.add(function(s,t){switch(t.keyCode){case 8:if(v.selection.getRng().item){v.selection.getRng().item(0).removeNode();return j.cancel(t)}}})}if(m.isOpera){v.onClick.add(function(s,t){j.prevent(t)})}if(y.custom_undo_redo){function q(){v.undoManager.typing=0;v.undoManager.add()}v.dom.bind(v.getDoc(),"focusout",function(s){if(!v.removed&&v.undoManager.typing){q()}});v.onKeyUp.add(function(s,t){if((t.keyCode>=33&&t.keyCode<=36)||(t.keyCode>=37&&t.keyCode<=40)||t.keyCode==13||t.keyCode==45||t.ctrlKey){q()}});v.onKeyDown.add(function(s,t){if((t.keyCode>=33&&t.keyCode<=36)||(t.keyCode>=37&&t.keyCode<=40)||t.keyCode==13||t.keyCode==45){if(v.undoManager.typing){q()}return}if(!v.undoManager.typing){v.undoManager.add();v.undoManager.typing=1}});v.onMouseDown.add(function(){if(v.undoManager.typing){q()}})}},_isHidden:function(){var p;if(!a){return 0}p=this.selection.getSel();return(!p||!p.rangeCount||p.rangeCount==0)},_fixNesting:function(q){var r=[],p;q=q.replace(/<(\/)?([^\s>]+)[^>]*?>/g,function(t,s,v){var u;if(s==="/"){if(!r.length){return""}if(v!==r[r.length-1].tag){for(p=r.length-1;p>=0;p--){if(r[p].tag===v){r[p].close=1;break}}return""}else{r.pop();if(r.length&&r[r.length-1].close){t=t+"</"+r[r.length-1].tag+">";r.pop()}}}else{if(/^(br|hr|input|meta|img|link|param)$/i.test(v)){return t}if(/\/>$/.test(t)){return t}r.push({tag:v})}return t});for(p=r.length-1;p>=0;p--){q+="</"+r[p].tag+">"}return q}})})(tinymce);(function(c){var d=c.each,e,a=true,b=false;c.EditorCommands=function(n){var l=n.dom,p=n.selection,j={state:{},exec:{},value:{}},k=n.settings,o;function q(y,x,v){var u;y=y.toLowerCase();if(u=j.exec[y]){u(y,x,v);return a}return b}function m(v){var u;v=v.toLowerCase();if(u=j.state[v]){return u(v)}return -1}function h(v){var u;v=v.toLowerCase();if(u=j.value[v]){return u(v)}return b}function t(u,v){v=v||"exec";d(u,function(y,x){d(x.toLowerCase().split(","),function(z){j[v][z]=y})})}c.extend(this,{execCommand:q,queryCommandState:m,queryCommandValue:h,addCommands:t});function f(x,v,u){if(v===e){v=b}if(u===e){u=null}return n.getDoc().execCommand(x,v,u)}function s(u){return n.formatter.match(u)}function r(u,v){n.formatter.toggle(u,v?{value:v}:e)}function i(u){o=p.getBookmark(u)}function g(){p.moveToBookmark(o)}t({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(y){var x=n.getDoc(),u;try{f(y)}catch(v){u=a}if(u||!x.queryCommandEnabled(y)){if(c.isGecko){n.windowManager.confirm(n.getLang("clipboard_msg"),function(z){if(z){open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","_blank")}})}else{n.windowManager.alert(n.getLang("clipboard_no_support"))}}},unlink:function(u){if(p.isCollapsed()){p.select(p.getNode())}f(u);p.collapse(b)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(u){var v=u.substring(7);d("left,center,right,full".split(","),function(x){if(v!=x){n.formatter.remove("align"+x)}});r("align"+v)},"InsertUnorderedList,InsertOrderedList":function(x){var u,v;f(x);u=l.getParent(p.getNode(),"ol,ul");if(u){v=u.parentNode;if(/^(H[1-6]|P|ADDRESS|PRE)$/.test(v.nodeName)){i();l.split(v,u);g()}}},"Bold,Italic,Underline,Strikethrough":function(u){r(u)},"ForeColor,HiliteColor,FontName":function(x,v,u){r(x,u)},FontSize:function(y,x,v){var u,z;if(v>=1&&v<=7){z=c.explode(k.font_size_style_values);u=c.explode(k.font_size_classes);if(u){v=u[v-1]||v}else{v=z[v-1]||v}}r(y,v)},RemoveFormat:function(u){n.formatter.remove(u)},mceBlockQuote:function(u){r("blockquote")},FormatBlock:function(x,v,u){return r(u)},mceCleanup:function(){i();n.setContent(n.getContent({cleanup:a}),{cleanup:a});g()},mceRemoveNode:function(y,x,v){var u=v||p.getNode();if(u!=ed.getBody()){i();n.dom.remove(u,a);g()}},mceSelectNodeDepth:function(y,x,v){var u=0;l.getParent(p.getNode(),function(z){if(z.nodeType==1&&u++==v){p.select(z);return b}},n.getBody())},mceSelectNode:function(x,v,u){p.select(u)},mceInsertContent:function(x,v,u){p.setContent(u)},mceInsertRawHTML:function(x,v,u){p.setContent("tiny_mce_marker");n.setContent(n.getContent().replace(/tiny_mce_marker/g,u))},mceSetContent:function(x,v,u){n.setContent(u)},"Indent,Outdent":function(y){var v,u,x;v=k.indentation;u=/[a-z%]+$/i.exec(v);v=parseInt(v);if(!m("InsertUnorderedList")&&!m("InsertOrderedList")){d(p.getSelectedBlocks(),function(z){if(y=="outdent"){x=Math.max(0,parseInt(z.style.paddingLeft||0)-v);l.setStyle(z,"paddingLeft",x?x+u:"")}else{l.setStyle(z,"paddingLeft",(parseInt(z.style.paddingLeft||0)+v)+u)}})}else{f(y)}},mceRepaint:function(){var v;if(c.isGecko){try{i(a);if(p.getSel()){p.getSel().selectAllChildren(n.getBody())}p.collapse(a);g()}catch(u){}}},InsertHorizontalRule:function(){p.setContent("<hr />")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual;n.addVisual()},mceReplaceContent:function(x,v,u){p.setContent(u.replace(/\{\$selection\}/g,p.getContent({format:"text"})))},mceInsertLink:function(y,x,v){var u=l.getParent(p.getNode(),"a");if(c.is(v,"string")){v={href:v}}if(!u){f("CreateLink",b,"javascript:mctmp(0);");d(l.select("a[href=javascript:mctmp(0);]"),function(z){l.setAttribs(z,v)})}else{if(v.href){l.setAttribs(u,v)}else{ed.dom.remove(u,a)}}}});t({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(u){return s("align"+u.substring(7))},"Bold,Italic,Underline,Strikethrough":function(u){return s(u)},mceBlockQuote:function(){return s("blockquote")},Outdent:function(){var u;if(k.inline_styles){if((u=l.getParent(p.getStart(),l.isBlock))&&parseInt(u.style.paddingLeft)>0){return a}if((u=l.getParent(p.getEnd(),l.isBlock))&&parseInt(u.style.paddingLeft)>0){return a}}return m("InsertUnorderedList")||m("InsertOrderedList")||(!k.inline_styles&&!!l.getParent(p.getNode(),"BLOCKQUOTE"))},"InsertUnorderedList,InsertOrderedList":function(u){return l.getParent(p.getNode(),u=="insertunorderedlist"?"UL":"OL")}},"state");t({"FontSize,FontName":function(x){var v=0,u;if(u=l.getParent(p.getNode(),"span")){if(x=="fontsize"){v=u.style.fontSize}else{v=u.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}}return v}},"value");if(k.custom_undo_redo){t({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}}})(tinymce);(function(a){a.create("tinymce.UndoManager",{index:0,data:null,typing:0,UndoManager:function(c){var d=this,b=a.util.Dispatcher;d.editor=c;d.data=[];d.onAdd=new b(this);d.onUndo=new b(this);d.onRedo=new b(this)},add:function(d){var g=this,f,e=g.editor,c,h=e.settings,j;d=d||{};d.content=d.content||e.getContent({format:"raw",no_events:1});d.content=d.content.replace(/^\s*|\s*$/g,"");j=g.data[g.index];if(j&&j.content==d.content){if(g.index>0||g.data.length==1){return null}}if(h.custom_undo_redo_levels){if(g.data.length>h.custom_undo_redo_levels){for(f=0;f<g.data.length-1;f++){g.data[f]=g.data[f+1]}g.data.length--;g.index=g.data.length}}if(h.custom_undo_redo_restore_selection){d.bookmark=c=d.bookmark||e.selection.getBookmark(2,true)}if(g.index<g.data.length-1){if(g.index==0){g.data=[]}else{g.data.length=g.index+1}}g.data.push(d);g.index=g.data.length-1;g.onAdd.dispatch(g,d);e.isNotDirty=0;return d},undo:function(){var e=this,c=e.editor,b=b,d;if(e.typing){e.add();e.typing=0}if(e.index>0){b=e.data[--e.index];c.setContent(b.content,{format:"raw"});c.selection.moveToBookmark(b.bookmark);e.onUndo.dispatch(e,b)}return b},redo:function(){var d=this,c=d.editor,b=null;if(d.index<d.data.length-1){b=d.data[++d.index];c.setContent(b.content,{format:"raw"});c.selection.moveToBookmark(b.bookmark);d.onRedo.dispatch(d,b)}return b},clear:function(){var b=this;b.data=[];b.index=0;b.typing=0},hasUndo:function(){return this.index>0||this.typing},hasRedo:function(){return this.index<this.data.length-1}})})(tinymce);(function(l){var k=l.dom.Event,c=l.isIE,a=l.isGecko,b=l.isOpera,j=l.each,i=l.extend,d=true,h=false;function g(n,o){var m=o.ownerDocument.createRange();m.setStart(n.endContainer,n.endOffset);m.setEndAfter(o);return m.cloneContents().textContent.length==0}function f(m){m=m.innerHTML;m=m.replace(/<(img|hr|table|input|select|textarea)[ \>]/gi,"-");m=m.replace(/<[^>]+>/g,"");return m.replace(/[ \u00a0\t\r\n]+/g,"")==""}function e(o,q,m){var n,p;if(f(m)){n=q.getParent(m,"ul,ol");if(!q.getParent(n.parentNode,"ul,ol")){q.split(n,m);p=q.create("p",0,'<br _mce_bogus="1" />');q.replace(p,m);o.select(p,1)}return h}return d}l.create("tinymce.ForceBlocks",{ForceBlocks:function(n){var o=this,p=n.settings,q;o.editor=n;o.dom=n.dom;q=(p.forced_root_block||"p").toLowerCase();p.element=q.toUpperCase();n.onPreInit.add(o.setup,o);o.reOpera=new RegExp("(\\u00a0|&#160;|&nbsp;)</"+q+">","gi");o.rePadd=new RegExp("<p( )([^>]+)><\\/p>|<p( )([^>]+)\\/>|<p( )([^>]+)>\\s+<\\/p>|<p><\\/p>|<p\\/>|<p>\\s+<\\/p>".replace(/p/g,q),"gi");o.reNbsp2BR1=new RegExp("<p( )([^>]+)>[\\s\\u00a0]+<\\/p>|<p>[\\s\\u00a0]+<\\/p>".replace(/p/g,q),"gi");o.reNbsp2BR2=new RegExp("<%p()([^>]+)>(&nbsp;|&#160;)<\\/%p>|<%p>(&nbsp;|&#160;)<\\/%p>".replace(/%p/g,q),"gi");o.reBR2Nbsp=new RegExp("<p( )([^>]+)>\\s*<br \\/>\\s*<\\/p>|<p>\\s*<br \\/>\\s*<\\/p>".replace(/p/g,q),"gi");function m(r,s){if(b){s.content=s.content.replace(o.reOpera,"</"+q+">")}s.content=s.content.replace(o.rePadd,"<"+q+"$1$2$3$4$5$6>\u00a0</"+q+">");if(!c&&!b&&s.set){s.content=s.content.replace(o.reNbsp2BR1,"<"+q+"$1$2><br /></"+q+">");s.content=s.content.replace(o.reNbsp2BR2,"<"+q+"$1$2><br /></"+q+">")}else{s.content=s.content.replace(o.reBR2Nbsp,"<"+q+"$1$2>\u00a0</"+q+">")}}n.onBeforeSetContent.add(m);n.onPostProcess.add(m);if(p.forced_root_block){n.onInit.add(o.forceRoots,o);n.onSetContent.add(o.forceRoots,o);n.onBeforeGetContent.add(o.forceRoots,o)}},setup:function(){var n=this,m=n.editor,p=m.settings,r=m.dom,o=m.selection;if(p.forced_root_block){m.onBeforeExecCommand.add(n.forceRoots,n);m.onKeyUp.add(n.forceRoots,n);m.onPreProcess.add(n.forceRoots,n)}if(p.force_br_newlines){if(c){m.onKeyPress.add(function(s,t){var u;if(t.keyCode==13&&o.getNode().nodeName!="LI"){o.setContent('<br id="__" /> ',{format:"raw"});u=r.get("__");u.removeAttribute("id");o.select(u);o.collapse();return k.cancel(t)}})}}if(!c&&p.force_p_newlines){m.onKeyPress.add(function(s,t){if(t.keyCode==13&&!t.shiftKey&&!n.insertPara(t)){k.cancel(t)}});if(a){m.onKeyDown.add(function(s,t){if((t.keyCode==8||t.keyCode==46)&&!t.shiftKey){n.backspaceDelete(t,t.keyCode==8)}})}}if(l.isWebKit){function q(t){var s=o.getRng(),u;s.insertNode(u=r.create("br"));s.setStartAfter(u);s.setEndAfter(u);o.setRng(s);if(o.getSel().focusNode==u.previousSibling){o.select(r.insertAfter(r.doc.createTextNode("\u00a0"),u));o.collapse(d)}t.getWin().scrollTo(0,r.getPos(o.getRng().startContainer).y)}m.onKeyPress.add(function(s,t){if(t.keyCode==13&&(t.shiftKey||p.force_br_newlines)){q(s);k.cancel(t)}})}m.onPreProcess.add(function(s,t){j(r.select("p,h1,h2,h3,h4,h5,h6,div",t.node),function(u){if(f(u)){j(r.select("span,em,strong,b,i",t.node),function(v){if(!v.hasChildNodes()){v.appendChild(s.getDoc().createTextNode("\u00a0"));return h}})}})});if(c){if(p.element!="P"){m.onKeyPress.add(function(s,t){n.lastElm=o.getNode().nodeName});m.onKeyUp.add(function(t,u){var x,v=o.getNode(),s=t.getBody();if(s.childNodes.length===1&&v.nodeName=="P"){v=r.rename(v,p.element);o.select(v);o.collapse();t.nodeChanged()}else{if(u.keyCode==13&&!u.shiftKey&&n.lastElm!="P"){x=r.getParent(v,"p");if(x){r.rename(x,p.element);t.nodeChanged()}}}})}}},find:function(u,p,q){var o=this.editor,m=o.getDoc().createTreeWalker(u,4,null,h),r=-1;while(u=m.nextNode()){r++;if(p==0&&u==q){return r}if(p==1&&r==q){return u}}return -1},forceRoots:function(v,H){var y=this,v=y.editor,L=v.getBody(),I=v.getDoc(),O=v.selection,z=O.getSel(),A=O.getRng(),M=-2,u,F,m,o,J=-16777215;var K,p,N,E,B,q=L.childNodes,D,C,x;for(D=q.length-1;D>=0;D--){K=q[D];if(K.nodeType===1&&K.getAttribute("_mce_type")){p=null;continue}if(K.nodeType===3||(!y.dom.isBlock(K)&&K.nodeType!==8&&!/^(script|mce:script|style|mce:style)$/i.test(K.nodeName))){if(!p){if(K.nodeType!=3||/[^\s]/g.test(K.nodeValue)){if(M==-2&&A){if(!c){if(A.startContainer.nodeType==1&&(C=A.startContainer.childNodes[A.startOffset])&&C.nodeType==1){x=C.getAttribute("id");C.setAttribute("id","__mce")}else{if(v.dom.getParent(A.startContainer,function(n){return n===L})){F=A.startOffset;m=A.endOffset;M=y.find(L,0,A.startContainer);u=y.find(L,0,A.endContainer)}}}else{o=I.body.createTextRange();o.moveToElementText(L);o.collapse(1);N=o.move("character",J)*-1;o=A.duplicate();o.collapse(1);E=o.move("character",J)*-1;o=A.duplicate();o.collapse(0);B=(o.move("character",J)*-1)-E;M=E-N;u=B}}p=v.dom.create(v.settings.forced_root_block);K.parentNode.replaceChild(p,K);p.appendChild(K)}}else{if(p.hasChildNodes()){p.insertBefore(K,p.firstChild)}else{p.appendChild(K)}}}else{p=null}}if(M!=-2){if(!c){p=L.getElementsByTagName(v.settings.element)[0];A=I.createRange();if(M!=-1){A.setStart(y.find(L,1,M),F)}else{A.setStart(p,0)}if(u!=-1){A.setEnd(y.find(L,1,u),m)}else{A.setEnd(p,0)}if(z){z.removeAllRanges();z.addRange(A)}}else{try{A=z.createRange();A.moveToElementText(L);A.collapse(1);A.moveStart("character",M);A.moveEnd("character",u);A.select()}catch(G){}}}else{if(!c&&(C=v.dom.get("__mce"))){if(x){C.setAttribute("id",x)}else{C.removeAttribute("id")}A=I.createRange();A.setStartBefore(C);A.setEndBefore(C);O.setRng(A)}}},getParentBlock:function(o){var m=this.dom;return m.getParent(o,m.isBlock)},insertPara:function(R){var F=this,v=F.editor,N=v.dom,S=v.getDoc(),W=v.settings,G=v.selection.getSel(),H=G.getRangeAt(0),V=S.body;var K,L,I,P,O,q,o,u,z,m,D,U,p,x,J,M=N.getViewPort(v.getWin()),C,E,B;K=S.createRange();K.setStart(G.anchorNode,G.anchorOffset);K.collapse(d);L=S.createRange();L.setStart(G.focusNode,G.focusOffset);L.collapse(d);I=K.compareBoundaryPoints(K.START_TO_END,L)<0;P=I?G.anchorNode:G.focusNode;O=I?G.anchorOffset:G.focusOffset;q=I?G.focusNode:G.anchorNode;o=I?G.focusOffset:G.anchorOffset;if(P===q&&/^(TD|TH)$/.test(P.nodeName)){if(P.firstChild.nodeName=="BR"){N.remove(P.firstChild)}if(P.childNodes.length==0){v.dom.add(P,W.element,null,"<br />");U=v.dom.add(P,W.element,null,"<br />")}else{J=P.innerHTML;P.innerHTML="";v.dom.add(P,W.element,null,J);U=v.dom.add(P,W.element,null,"<br />")}H=S.createRange();H.selectNodeContents(U);H.collapse(1);v.selection.setRng(H);return h}if(P==V&&q==V&&V.firstChild&&v.dom.isBlock(V.firstChild)){P=q=P.firstChild;O=o=0;K=S.createRange();K.setStart(P,0);L=S.createRange();L.setStart(q,0)}P=P.nodeName=="HTML"?S.body:P;P=P.nodeName=="BODY"?P.firstChild:P;q=q.nodeName=="HTML"?S.body:q;q=q.nodeName=="BODY"?q.firstChild:q;u=F.getParentBlock(P);z=F.getParentBlock(q);m=u?u.nodeName:W.element;if(J=F.dom.getParent(u,"li,pre")){if(J.nodeName=="LI"){return e(v.selection,F.dom,J)}return d}if(u&&(u.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(N.getStyle(u,"position",1)))){m=W.element;u=null}if(z&&(z.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(N.getStyle(u,"position",1)))){m=W.element;z=null}if(/(TD|TABLE|TH|CAPTION)/.test(m)||(u&&m=="DIV"&&/left|right/gi.test(N.getStyle(u,"float",1)))){m=W.element;u=z=null}D=(u&&u.nodeName==m)?u.cloneNode(0):v.dom.create(m);U=(z&&z.nodeName==m)?z.cloneNode(0):v.dom.create(m);U.removeAttribute("id");if(/^(H[1-6])$/.test(m)&&g(H,u)){U=v.dom.create(W.element)}J=p=P;do{if(J==V||J.nodeType==9||F.dom.isBlock(J)||/(TD|TABLE|TH|CAPTION)/.test(J.nodeName)){break}p=J}while((J=J.previousSibling?J.previousSibling:J.parentNode));J=x=q;do{if(J==V||J.nodeType==9||F.dom.isBlock(J)||/(TD|TABLE|TH|CAPTION)/.test(J.nodeName)){break}x=J}while((J=J.nextSibling?J.nextSibling:J.parentNode));if(p.nodeName==m){K.setStart(p,0)}else{K.setStartBefore(p)}K.setEnd(P,O);D.appendChild(K.cloneContents()||S.createTextNode(""));try{L.setEndAfter(x)}catch(Q){}L.setStart(q,o);U.appendChild(L.cloneContents()||S.createTextNode(""));H=S.createRange();if(!p.previousSibling&&p.parentNode.nodeName==m){H.setStartBefore(p.parentNode)}else{if(K.startContainer.nodeName==m&&K.startOffset==0){H.setStartBefore(K.startContainer)}else{H.setStart(K.startContainer,K.startOffset)}}if(!x.nextSibling&&x.parentNode.nodeName==m){H.setEndAfter(x.parentNode)}else{H.setEnd(L.endContainer,L.endOffset)}H.deleteContents();if(b){v.getWin().scrollTo(0,M.y)}if(D.firstChild&&D.firstChild.nodeName==m){D.innerHTML=D.firstChild.innerHTML}if(U.firstChild&&U.firstChild.nodeName==m){U.innerHTML=U.firstChild.innerHTML}if(f(D)){D.innerHTML="<br />"}function T(y,s){var r=[],Y,X,t;y.innerHTML="";if(W.keep_styles){X=s;do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(X.nodeName)){Y=X.cloneNode(h);N.setAttrib(Y,"id","");r.push(Y)}}while(X=X.parentNode)}if(r.length>0){for(t=r.length-1,Y=y;t>=0;t--){Y=Y.appendChild(r[t])}r[0].innerHTML=b?"&nbsp;":"<br />";return r[0]}else{y.innerHTML=b?"&nbsp;":"<br />"}}if(f(U)){B=T(U,q)}if(b&&parseFloat(opera.version())<9.5){H.insertNode(D);H.insertNode(U)}else{H.insertNode(U);H.insertNode(D)}U.normalize();D.normalize();function A(r){return S.createTreeWalker(r,NodeFilter.SHOW_TEXT,null,h).nextNode()||r}H=S.createRange();H.selectNodeContents(a?A(B||U):B||U);H.collapse(1);G.removeAllRanges();G.addRange(H);C=v.dom.getPos(U).y;E=U.clientHeight;if(C<M.y||C+E>M.y+M.h){v.getWin().scrollTo(0,C<M.y?C:C-M.h+25)}return h},backspaceDelete:function(s,A){var C=this,q=C.editor,x=q.getBody(),p=q.dom,o,u=q.selection,m=u.getRng(),v=m.startContainer,o,y,z;if(v&&q.dom.isBlock(v)&&!/^(TD|TH)$/.test(v.nodeName)&&A){if(v.childNodes.length==0||(v.childNodes.length==1&&v.firstChild.nodeName=="BR")){o=v;while((o=o.previousSibling)&&!q.dom.isBlock(o)){}if(o){if(v!=x.firstChild){y=q.dom.doc.createTreeWalker(o,NodeFilter.SHOW_TEXT,null,h);while(z=y.nextNode()){o=z}m=q.getDoc().createRange();m.setStart(o,o.nodeValue?o.nodeValue.length:0);m.setEnd(o,o.nodeValue?o.nodeValue.length:0);u.setRng(m);q.dom.remove(v)}return k.cancel(s)}}}function B(n){var r;n=n.target;if(n&&n.parentNode&&n.nodeName=="BR"&&(o=C.getParentBlock(n))){r=n.previousSibling;k.remove(x,"DOMNodeInserted",B);if(r&&r.nodeType==3&&/\s+$/.test(r.nodeValue)){return}if(n.previousSibling||n.nextSibling){q.dom.remove(n)}}}k._add(x,"DOMNodeInserted",B);window.setTimeout(function(){k._remove(x,"DOMNodeInserted",B)},1)}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each,e=c.extend;c.create("tinymce.ControlManager",{ControlManager:function(f,j){var h=this,g;j=j||{};h.editor=f;h.controls={};h.onAdd=new c.util.Dispatcher(h);h.onPostRender=new c.util.Dispatcher(h);h.prefix=j.prefix||f.id+"_";h._cls={};h.onPostRender.add(function(){d(h.controls,function(i){i.postRender()})})},get:function(f){return this.controls[this.prefix+f]||this.controls[f]},setActive:function(h,f){var g=null;if(g=this.get(h)){g.setActive(f)}return g},setDisabled:function(h,f){var g=null;if(g=this.get(h)){g.setDisabled(f)}return g},add:function(g){var f=this;if(g){f.controls[g.id]=g;f.onAdd.dispatch(g,f)}return g},createControl:function(i){var h,g=this,f=g.editor;d(f.plugins,function(j){if(j.createControl){h=j.createControl(i,g);if(h){return false}}});switch(i){case"|":case"separator":return g.createSeparator()}if(!h&&f.buttons&&(h=f.buttons[i])){return g.createButton(i,h)}return g.add(h)},createDropMenu:function(f,n,h){var m=this,i=m.editor,j,g,k,l;n=e({"class":"mceDropDown",constrain:i.settings.constrain_menus},n);n["class"]=n["class"]+" "+i.getParam("skin")+"Skin";if(k=i.getParam("skin_variant")){n["class"]+=" "+i.getParam("skin")+"Skin"+k.substring(0,1).toUpperCase()+k.substring(1)}f=m.prefix+f;l=h||m._cls.dropmenu||c.ui.DropMenu;j=m.controls[f]=new l(f,n);j.onAddItem.add(function(r,q){var p=q.settings;p.title=i.getLang(p.title,p.title);if(!p.onclick){p.onclick=function(o){if(p.cmd){i.execCommand(p.cmd,p.ui||false,p.value)}}}});i.onRemove.add(function(){j.destroy()});if(c.isIE){j.onShowMenu.add(function(){i.focus();g=i.selection.getBookmark(1)});j.onHideMenu.add(function(){if(g){i.selection.moveToBookmark(g);g=0}})}return m.add(j)},createListBox:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;if(g.settings.use_native_selects){k=new c.ui.NativeListBox(m,i)}else{f=l||h._cls.listbox||c.ui.ListBox;k=new f(m,i)}h.controls[m]=k;if(c.isWebKit){k.onPostRender.add(function(p,o){a.add(o,"mousedown",function(){g.bookmark=g.selection.getBookmark(1)});a.add(o,"focus",function(){g.selection.moveToBookmark(g.bookmark);g.bookmark=null})})}if(k.hideMenu){g.onMouseDown.add(k.hideMenu,k)}return h.add(k)},createButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.label=g.translate(i.label);i.scope=i.scope||g;if(!i.onclick&&!i.menu_button){i.onclick=function(){g.execCommand(i.cmd,i.ui||false,i.value)}}i=e({title:i.title,"class":"mce_"+m,unavailable_prefix:g.getLang("unavailable",""),scope:i.scope,control_manager:h},i);m=h.prefix+m;if(i.menu_button){f=l||h._cls.menubutton||c.ui.MenuButton;k=new f(m,i);g.onMouseDown.add(k.hideMenu,k)}else{f=h._cls.button||c.ui.Button;k=new f(m,i)}return h.add(k)},createMenuButton:function(h,f,g){f=f||{};f.menu_button=1;return this.createButton(h,f,g)},createSplitButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onclick){i.onclick=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;f=l||h._cls.splitbutton||c.ui.SplitButton;k=h.add(new f(m,i));g.onMouseDown.add(k.hideMenu,k);return k},createColorSplitButton:function(f,n,h){var l=this,j=l.editor,i,k,m,g;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onclick){n.onclick=function(o){if(c.isIE){g=j.selection.getBookmark(1)}j.execCommand(n.cmd,n.ui||false,o||n.value)}}if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,menu_class:j.getParam("skin")+"Skin",scope:n.scope,more_colors_title:j.getLang("more_colors")},n);f=l.prefix+f;m=h||l._cls.colorsplitbutton||c.ui.ColorSplitButton;k=new m(f,n);j.onMouseDown.add(k.hideMenu,k);j.onRemove.add(function(){k.destroy()});if(c.isIE){k.onShowMenu.add(function(){j.focus();g=j.selection.getBookmark(1)});k.onHideMenu.add(function(){if(g){j.selection.moveToBookmark(g);g=0}})}return l.add(k)},createToolbar:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||g._cls.toolbar||c.ui.Toolbar;i=new f(k,h);if(g.get(k)){return null}return g.add(i)},createSeparator:function(g){var f=g||this._cls.separator||c.ui.Separator;return new f()},setControlType:function(g,f){return this._cls[g.toLowerCase()]=f},destroy:function(){d(this.controls,function(f){f.destroy()});this.controls=null}})})(tinymce);(function(d){var a=d.util.Dispatcher,e=d.each,c=d.isIE,b=d.isOpera;d.create("tinymce.WindowManager",{WindowManager:function(f){var g=this;g.editor=f;g.onOpen=new a(g);g.onClose=new a(g);g.params={};g.features={}},open:function(z,h){var v=this,k="",n,m,i=v.editor.settings.dialog_type=="modal",q,o,j,g=d.DOM.getViewPort(),r;z=z||{};h=h||{};o=b?g.w:screen.width;j=b?g.h:screen.height;z.name=z.name||"mc_"+new Date().getTime();z.width=parseInt(z.width||320);z.height=parseInt(z.height||240);z.resizable=true;z.left=z.left||parseInt(o/2)-(z.width/2);z.top=z.top||parseInt(j/2)-(z.height/2);h.inline=false;h.mce_width=z.width;h.mce_height=z.height;h.mce_auto_focus=z.auto_focus;if(i){if(c){z.center=true;z.help=false;z.dialogWidth=z.width+"px";z.dialogHeight=z.height+"px";z.scroll=z.scrollbars||false}}e(z,function(p,f){if(d.is(p,"boolean")){p=p?"yes":"no"}if(!/^(name|url)$/.test(f)){if(c&&i){k+=(k?";":"")+f+":"+p}else{k+=(k?",":"")+f+"="+p}}});v.features=z;v.params=h;v.onOpen.dispatch(v,z,h);r=z.url||z.file;r=d._addVer(r);try{if(c&&i){q=1;window.showModalDialog(r,window,k)}else{q=window.open(r,z.name,k)}}catch(l){}if(!q){alert(v.editor.getLang("popup_blocked"))}},close:function(f){f.close();this.onClose.dispatch(this)},createInstance:function(i,h,g,m,l,k){var j=d.resolve(i);return new j(h,g,m,l,k)},confirm:function(h,f,i,g){g=g||window;f.call(i||this,g.confirm(this._decode(this.editor.getLang(h,h))))},alert:function(h,f,j,g){var i=this;g=g||window;g.alert(i._decode(i.editor.getLang(h,h)));if(f){f.call(j||i)}},_decode:function(f){return d.DOM.decode(f).replace(/\\n/g,"\n")}})}(tinymce));(function(a){function b(){var d={},c={},e={};function f(j,i,h,g){if(typeof(i)=="string"){i=[i]}a.each(i,function(k){j[k.toLowerCase()]={func:h,scope:g}})}a.extend(this,{add:function(i,h,g){f(d,i,h,g)},addQueryStateHandler:function(i,h,g){f(c,i,h,g)},addQueryValueHandler:function(i,h,g){f(e,i,h,g)},execCommand:function(h,k,j,i,g){if(k=d[k.toLowerCase()]){if(k.func.call(h||k.scope,j,i,g)!==false){return true}}},queryCommandValue:function(){if(cmd=e[cmd.toLowerCase()]){return cmd.func.call(scope||cmd.scope,ui,value,args)}},queryCommandState:function(){if(cmd=c[cmd.toLowerCase()]){return cmd.func.call(scope||cmd.scope,ui,value,args)}}})}a.GlobalCommands=new b()})(tinymce);(function(a){a.Formatter=function(Q){var H={},J=a.each,b=Q.dom,n=Q.selection,q=a.dom.TreeWalker,F=new a.dom.RangeUtils(b),c=Q.schema.isValid,A=b.isBlock,i=Q.settings.forced_root_block,p=b.nodeIndex,z="\uFEFF",N=false,v=true,m,R,K;function j(T,S){return b.getParents(T,S,b.getRoot())}function C(){if(!K||K.apply.length||K.remove.length){K={apply:[],remove:[]}}}Q.onMouseUp.add(C);C();function M(S){return S?H[S]:H}function h(S,T){if(S){if(typeof(S)!=="string"){J(S,function(V,U){h(U,V)})}else{T=T.length?T:[T];J(T,function(U){if(U.deep===m){U.deep=!U.selector}if(U.split===m){U.split=!U.selector}if(U.remove===m&&U.selector){U.remove="none"}if(typeof(U.classes)==="string"){U.classes=U.classes.split(/\s+/)}});H[S]=T}}}function O(U,aa,W){var X=M(U),ab=X[0],Z,T,Y;function V(ae){var ad=ae.startContainer,ah=ae.startOffset,ag,af;if(ad.nodeType==1||ad.nodeValue===""){ag=new q(ad.childNodes[ah]);for(af=ag.current();af;af=ag.next()){if(af.nodeType==3&&!A(af.parentNode)&&!d(af)){ae.setStart(af,0);break}}}return ae}function S(ae,ad){ad=ad||ab;if(ae){J(ad.styles,function(ag,af){b.setStyle(ae,af,o(ag,aa))});J(ad.attributes,function(ag,af){b.setAttrib(ae,af,o(ag,aa))});J(ad.classes,function(af){af=o(af,aa);if(!b.hasClass(ae,af)){b.addClass(ae,af)}})}}function ac(ae){var ad=[],ag,af;ag=ab.inline||ab.block;af=b.create(ag);S(af);F.walk(ae,function(ah){var ai;function aj(ak){var am=ak.nodeName.toLowerCase(),al=ak.parentNode.nodeName.toLowerCase();if(e(am,"br")){ai=0;if(ab.block){b.remove(ak)}return}if(ab.wrapper&&s(ak,U,aa)){ai=0;return}if(ab.block&&!ab.wrapper&&B(am)){ak=b.rename(ak,ag);S(ak);ad.push(ak);ai=0;return}if(ab.selector){J(X,function(an){if(b.is(ak,an.selector)){S(ak,an)}});return}if(c(ag,am)&&c(al,ag)){if(!ai){ai=af.cloneNode(N);ak.parentNode.insertBefore(ai,ak);ad.push(ai)}ai.appendChild(ak)}else{ai=0;J(a.grep(ak.childNodes),aj);ai=0}}J(ah,aj)});J(ad,function(aj){var ah;function ak(am){var al=0;J(am.childNodes,function(an){if(!d(an)&&!D(an)){al++}});return al}function ai(al){var an,am;J(al.childNodes,function(ao){if(ao.nodeType==1&&!D(ao)){an=ao;return N}});if(an&&f(an,ab)){am=an.cloneNode(N);S(am);b.replace(am,al,v);b.remove(an,1);return v}}ah=ak(aj);if(ah===0){b.remove(aj,1);return}if(ab.inline||ab.wrapper){if(!ab.exact&&ah===1){if(ai(aj)){return}}J(X,function(al){J(b.select(al.inline,aj),function(am){P(al,aa,am,al.exact?am:null)})});b.getParent(aj.parentNode,function(al){if(s(al,U,aa)){b.remove(aj,1);aj=0;return v}});if(aj){aj=r(x(aj),aj);aj=r(aj,x(aj,v))}}})}if(ab){if(W){T=b.createRng();T.setStartBefore(W);T.setEndAfter(W);ac(T)}else{if(!n.isCollapsed()||!ab.inline){Z=n.getBookmark();ac(l(n.getRng(v),X));n.moveToBookmark(Z);n.setRng(V(n.getRng(v)));Q.nodeChanged()}else{L("apply",U,aa)}}}}function u(U,ac,W){var X=M(U),ae=X[0],ab,aa,T;function V(ah){var ag;ag=a.grep(ah.childNodes);J(X,function(ai){if(P(ai,ac,ah,ah)){return N}});if(ae.deep){J(X,function(ai){J(ag,function(aj){V(aj)})})}}function Y(ag){var ah;J(j(ag.parentNode).reverse(),function(ai){if(!ah&&ai.id!="_start"&&ai.id!="_end"){if(!A(ai)&&s(ai,U,ac)){ah=ai}}});return ah}function S(aj,ag,al,ao){var ap,an,am,ai,ak,ah;if(aj){ah=aj.parentNode;for(ap=ag.parentNode;ap&&ap!=ah;ap=ap.parentNode){an=ap.cloneNode(N);for(ak=0;ak<X.length;ak++){if(P(X[ak],ac,an,an)){an=0;break}}if(an){if(am){an.appendChild(am)}if(!ai){ai=an}am=an}}if(ao){ag=b.split(aj,ag)}if(am){al.parentNode.insertBefore(am,al);ai.appendChild(al)}}return ag}function ad(ag){return S(Y(ag),ag,ag,true)}function Z(ai){var ah=b.get(ai?"_start":"_end"),ag=ah[ai?"firstChild":"lastChild"];b.remove(ah,1);return ag}function af(ag){var ah,ai;ag=l(ag,X,v);if(ae.split){ah=E(ag,v);ai=E(ag);if(ah!=ai){ah=I(ah,"span",{id:"_start",_mce_type:"bookmark"});ai=I(ai,"span",{id:"_end",_mce_type:"bookmark"});ad(ah);ad(ai);ah=Z(v);ai=Z()}else{ah=ai=ad(ah)}ag.startContainer=ah.parentNode;ag.startOffset=p(ah);ag.endContainer=ai.parentNode;ag.endOffset=p(ai)+1}F.walk(ag,function(aj){J(aj,function(ak){V(ak)})})}if(W){T=b.createRng();T.setStartBefore(W);T.setEndAfter(W);af(T);return}if(!n.isCollapsed()||!ae.inline){ab=n.getBookmark();af(n.getRng(v));n.moveToBookmark(ab);Q.nodeChanged()}else{L("remove",U,ac)}}function y(S,U,T){if(g(S,U,T)){u(S,U,T)}else{O(S,U,T)}}function s(V,S,X){var Y=M(S),W,U,T;function Z(ad,af,ag){var ac,ae,aa=af[ag],ab;if(aa){if(aa.length===m){for(ac in aa){if(aa.hasOwnProperty(ac)){if(ag==="attributes"){ae=b.getAttrib(ad,ac)}else{ae=G(ad,ac)}if(!e(ae,o(aa[ac],X))){return}}}}else{for(ab=0;ab<aa.length;ab++){if(ag==="attributes"?b.getAttrib(ad,aa[ab]):G(ad,aa[ab])){return v}}}}return v}if(Y&&V){for(U=0;U<Y.length;U++){W=Y[U];if(f(V,W)&&Z(V,W,"attributes")&&Z(V,W,"styles")){if(T=W.classes){for(U=0;U<T.length;U++){if(!b.hasClass(V,T[U])){return}}}return v}}}}function g(U,X,W){var T,V;function S(Y){Y=b.getParent(Y,function(Z){return !!s(Z,U,X)});return s(Y,U,X)}if(W){return S(W)}if(n.isCollapsed()){for(V=K.apply.length-1;V>=0;V--){if(K.apply[V].name==U){return true}}for(V=K.remove.length-1;V>=0;V--){if(K.remove[V].name==U){return false}}return S(n.getNode())}W=n.getNode();if(S(W)){return v}T=n.getStart();if(T!=W){if(S(T)){return v}}return N}function t(W){var Y=M(W),V,U,X,T,S;if(Y){V=n.getStart();U=j(V);for(T=Y.length-1;T>=0;T--){S=Y[T].selector;if(!S){return v}for(X=U.length-1;X>=0;X--){if(b.is(U[X],S)){return v}}}}return N}a.extend(this,{get:M,register:h,apply:O,remove:u,toggle:y,match:g,matchNode:s,canApply:t});function f(S,T){if(e(S,T.inline)){return v}if(e(S,T.block)){return v}if(T.selector){return b.is(S,T.selector)}}function e(T,S){T=T||"";S=S||"";T=T.nodeName||T;S=S.nodeName||S;return T.toLowerCase()==S.toLowerCase()}function G(T,S){var U=b.getStyle(T,S);if(S=="color"||S=="backgroundColor"){U=b.toHex(U)}if(S=="fontWeight"&&U==700){U="bold"}return""+U}function o(S,T){if(typeof(S)!="string"){S=S(T)}else{if(T){S=S.replace(/%(\w+)/g,function(V,U){return T[U]||V})}}return S}function d(S){return S&&S.nodeType===3&&/^\s*$/.test(S.nodeValue)}function I(U,T,S){var V=b.create(T,S);U.parentNode.insertBefore(V,U);V.appendChild(U);return V}function l(S,aa,V){var U=S.startContainer,X=S.startOffset,ad=S.endContainer,Y=S.endOffset,ac,Z;function ab(ag,ah,ae,af){var ai,aj;af=af||b.getRoot();for(;;){ai=ag.parentNode;if(ai==af||(!aa[0].block_expand&&A(ai))){return ag}for(ac=ai[ah];ac&&ac!=ag;ac=ac[ae]){if(ac.nodeType==1&&!D(ac)){return ag}if(ac.nodeType==3&&!d(ac)){return ag}}ag=ag.parentNode}return ag}if(U.nodeType==1&&U.hasChildNodes()){Z=U.childNodes.length-1;U=U.childNodes[X>Z?Z:X];if(U.nodeType==3){X=0}}if(ad.nodeType==1&&ad.hasChildNodes()){Z=ad.childNodes.length-1;ad=ad.childNodes[Y>Z?Z:Y-1];if(ad.nodeType==3){Y=ad.nodeValue.length}}if(D(U.parentNode)){U=U.parentNode}if(D(U)){U=U.nextSibling||U}if(D(ad.parentNode)){ad=ad.parentNode}if(D(ad)){ad=ad.previousSibling||ad}if(aa[0].inline||aa[0].block_expand){U=ab(U,"firstChild","nextSibling");ad=ab(ad,"lastChild","previousSibling")}if(aa[0].selector&&aa[0].expand!==N){function W(af,ae){var ag,ah,ai;if(af.nodeType==3&&af.nodeValue.length==0&&af[ae]){af=af[ae]}ag=j(af);for(ah=0;ah<ag.length;ah++){for(ai=0;ai<aa.length;ai++){if(b.is(ag[ah],aa[ai].selector)){return ag[ah]}}}return af}U=W(U,"previousSibling");ad=W(ad,"nextSibling")}if(aa[0].block||aa[0].selector){function T(af,ae,ah){var ag;if(!aa[0].wrapper){ag=b.getParent(af,aa[0].block)}if(!ag){ag=b.getParent(af.nodeType==3?af.parentNode:af,A)}if(ag&&aa[0].wrapper){ag=j(ag,"ul,ol").reverse()[0]||ag}if(!ag){ag=af;while(ag[ae]&&!A(ag[ae])){ag=ag[ae];if(e(ag,"br")){break}}}return ag||af}U=T(U,"previousSibling");ad=T(ad,"nextSibling");if(!A(U)){U=ab(U,"firstChild","nextSibling")}if(!A(ad)){ad=ab(ad,"lastChild","previousSibling")}}if(U.nodeType==1){X=p(U);U=U.parentNode}if(ad.nodeType==1){Y=p(ad)+1;ad=ad.parentNode}return{startContainer:U,startOffset:X,endContainer:ad,endOffset:Y}}function P(Y,X,V,S){var U,T,W;if(!f(V,Y)){return N}if(Y.remove!="all"){J(Y.styles,function(aa,Z){aa=o(aa,X);if(typeof(Z)==="number"){Z=aa;S=0}if(!S||e(G(S,Z),aa)){b.setStyle(V,Z,"")}W=1});if(W&&b.getAttrib(V,"style")==""){V.removeAttribute("style");V.removeAttribute("_mce_style")}J(Y.attributes,function(ab,Z){var aa;ab=o(ab,X);if(typeof(Z)==="number"){Z=ab;S=0}if(!S||e(b.getAttrib(S,Z),ab)){if(Z=="class"){ab=b.getAttrib(V,Z);if(ab){aa="";J(ab.split(/\s+/),function(ac){if(/mce\w+/.test(ac)){aa+=(aa?" ":"")+ac}});if(aa){b.setAttrib(V,Z,aa);return}}}if(Z=="class"){V.removeAttribute("className")}V.removeAttribute(Z)}});J(Y.classes,function(Z){Z=o(Z,X);if(!S||b.hasClass(S,Z)){b.removeClass(V,Z)}});T=b.getAttribs(V);for(U=0;U<T.length;U++){if(T[U].nodeName.indexOf("_")!==0){return N}}}if(Y.remove!="none"){k(V,Y);return v}}function k(U,V){var S=U.parentNode,T;if(V.block){if(!i){function W(Y,X,Z){Y=x(Y,X,Z);return !Y||(Y.nodeName=="BR"||A(Y))}if(A(U)&&!A(S)){if(!W(U,N)&&!W(U.firstChild,v,1)){U.insertBefore(b.create("br"),U.firstChild)}if(!W(U,v)&&!W(U.lastChild,N,1)){U.appendChild(b.create("br"))}}}else{if(S==b.getRoot()){if(!V.list_block||!e(U,V.list_block)){J(a.grep(U.childNodes),function(X){if(c(i,X.nodeName.toLowerCase())){if(!T){T=I(X,i)}else{T.appendChild(X)}}else{T=0}})}}}}b.remove(U,1)}function x(T,S,U){if(T){S=S?"nextSibling":"previousSibling";for(T=U?T:T[S];T;T=T[S]){if(T.nodeType==1||!d(T)){return T}}}}function D(S){return S&&S.nodeType==1&&S.getAttribute("_mce_type")=="bookmark"}function r(W,V){var S,U,T;function Y(ab,aa){if(ab.nodeName!=aa.nodeName){return N}function Z(ad){var ae={};J(b.getAttribs(ad),function(af){var ag=af.nodeName.toLowerCase();if(ag.indexOf("_")!==0&&ag!=="class"&&ag!=="style"){ae[ag]=b.getAttrib(ad,ag)}});return ae}function ac(ag,af){var ae,ad;for(ad in ag){if(ag.hasOwnProperty(ad)){ae=af[ad];if(ae===m){return N}if(ag[ad]!=ae){return N}delete af[ad]}}for(ad in af){if(af.hasOwnProperty(ad)){return N}}return v}if(!ac(Z(ab),Z(aa))){return N}if(!ac(b.parseStyle(b.getAttrib(ab,"style")),b.parseStyle(b.getAttrib(aa,"style")))){return N}return v}if(W&&V){function X(aa,Z){for(U=aa;U;U=U[Z]){if(U.nodeType==3&&!d(U)){return aa}if(U.nodeType==1&&!D(U)){return U}}return aa}W=X(W,"previousSibling");V=X(V,"nextSibling");if(Y(W,V)){for(U=W.nextSibling;U&&U!=V;){T=U;U=U.nextSibling;W.appendChild(T)}b.remove(V);J(a.grep(V.childNodes),function(Z){W.appendChild(Z)});return W}}return V}function B(S){return/^(h[1-6]|p|div|pre|address)$/.test(S)}function E(T,W){var S,V,U;S=T[W?"startContainer":"endContainer"];V=T[W?"startOffset":"endOffset"];if(S.nodeType==1){U=S.childNodes.length-1;if(!W&&V){V--}S=S.childNodes[V>U?U:V]}return S}function L(aa,V,Z){var W,T,Y=n.getNode().parentNode,ac=Q.getDoc(),X="mceinline",af=["onKeyDown","onKeyUp","onKeyPress"],U=K[aa],ab=K[aa=="apply"?"remove":"apply"];for(W=U.length-1;W>=0;W--){if(U[W].name==V){return}}U.push({name:V,vars:Z});for(W=ab.length-1;W>=0;W--){if(ab[W].name==V){ab.splice(W,1)}}function ae(){if(R){J(af,function(ag){Q[ag].remove(R)});R=0}}function ad(ag){J(K.apply.reverse(),function(ah){O(ah.name,ah.vars,ag)});J(K.remove.reverse(),function(ah){u(ah.name,ah.vars,ag)});b.remove(ag,1);C()}function S(ag){return ag.face==X||ag.style.fontFamily==X}ae();ac.execCommand("FontName",false,X);J(b.select("font,span",Y),function(ah){var ag;if(S(ah)){ag=n.getBookmark();ad(ah);n.moveToBookmark(ag);Q.nodeChanged();Y=0}});if(Y){R=function(ag,ah){J(b.select("font,span",Y),function(aj){var ai,ak;if(aj.face==X||aj.style.fontFamily==X){ak=aj.firstChild;ad(aj);T=b.createRng();T.setStart(ak,ak.nodeValue.length);T.setEnd(ak,ak.nodeValue.length);n.setRng(T);ag.nodeChanged();ae()}});if(ah.type=="keyup"){ae();C()}};J(af,function(ag){Q[ag].addToTop(R)})}}}})(tinymce);tinymce.onAddEditor.add(function(e,a){var d,h,g,c=a.settings;if(c.inline_styles){h=e.explode(c.font_size_style_values);function b(j,i){g.replace(g.create("span",{style:i}),j,1)}d={font:function(j,i){b(i,{backgroundColor:i.style.backgroundColor,color:i.color,fontFamily:i.face,fontSize:h[parseInt(i.size)-1]})},u:function(j,i){b(i,{textDecoration:"underline"})},strike:function(j,i){b(i,{textDecoration:"line-through"})}};function f(i,j){g=i.dom;if(c.convert_fonts_to_spans){e.each(g.select("font,u,strike",j.node),function(k){d[k.nodeName.toLowerCase()](a.dom,k)})}}a.onPreProcess.add(f);a.onInit.add(function(){a.selection.onSetContent.add(f)})}});
1
+ (function(c){var a=/^\s*|\s*$/g,d;var b={majorVersion:"3",minorVersion:"3",releaseDate:"2010-03-10",_init:function(){var r=this,o=document,m=navigator,f=m.userAgent,l,e,k,j,h,q;r.isOpera=c.opera&&opera.buildNumber;r.isWebKit=/WebKit/.test(f);r.isIE=!r.isWebKit&&!r.isOpera&&(/MSIE/gi).test(f)&&(/Explorer/gi).test(m.appName);r.isIE6=r.isIE&&/MSIE [56]/.test(f);r.isGecko=!r.isWebKit&&/Gecko/.test(f);r.isMac=f.indexOf("Mac")!=-1;r.isAir=/adobeair/i.test(f);if(c.tinyMCEPreInit){r.suffix=tinyMCEPreInit.suffix;r.baseURL=tinyMCEPreInit.base;r.query=tinyMCEPreInit.query;return}r.suffix="";e=o.getElementsByTagName("base");for(l=0;l<e.length;l++){if(q=e[l].href){if(/^https?:\/\/[^\/]+$/.test(q)){q+="/"}j=q?q.match(/.*\//)[0]:""}}function g(i){if(i.src&&/tiny_mce(|_gzip|_jquery|_prototype)(_dev|_src)?.js/.test(i.src)){if(/_(src|dev)\.js/g.test(i.src)){r.suffix="_src"}if((h=i.src.indexOf("?"))!=-1){r.query=i.src.substring(h+1)}r.baseURL=i.src.substring(0,i.src.lastIndexOf("/"));if(j&&r.baseURL.indexOf("://")==-1&&r.baseURL.indexOf("/")!==0){r.baseURL=j+r.baseURL}return r.baseURL}return null}e=o.getElementsByTagName("script");for(l=0;l<e.length;l++){if(g(e[l])){return}}k=o.getElementsByTagName("head")[0];if(k){e=k.getElementsByTagName("script");for(l=0;l<e.length;l++){if(g(e[l])){return}}}return},is:function(f,e){if(!e){return f!==d}if(e=="array"&&(f.hasOwnProperty&&f instanceof Array)){return true}return typeof(f)==e},each:function(h,e,g){var i,f;if(!h){return 0}g=g||h;if(h.length!==d){for(i=0,f=h.length;i<f;i++){if(e.call(g,h[i],i,h)===false){return 0}}}else{for(i in h){if(h.hasOwnProperty(i)){if(e.call(g,h[i],i,h)===false){return 0}}}}return 1},map:function(e,g){var h=[];b.each(e,function(f){h.push(g(f))});return h},grep:function(e,g){var h=[];b.each(e,function(f){if(!g||g(f)){h.push(f)}});return h},inArray:function(f,g){var h,e;if(f){for(h=0,e=f.length;h<e;h++){if(f[h]===g){return h}}}return -1},extend:function(k,j){var h,g,f=arguments;for(h=1,g=f.length;h<g;h++){j=f[h];b.each(j,function(e,i){if(e!==d){k[i]=e}})}return k},trim:function(e){return(e?""+e:"").replace(a,"")},create:function(m,e){var l=this,f,h,i,j,g,k=0;m=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(m);i=m[3].match(/(^|\.)(\w+)$/i)[2];h=l.createNS(m[3].replace(/\.\w+$/,""));if(h[i]){return}if(m[2]=="static"){h[i]=e;if(this.onCreate){this.onCreate(m[2],m[3],h[i])}return}if(!e[i]){e[i]=function(){};k=1}h[i]=e[i];l.extend(h[i].prototype,e);if(m[5]){f=l.resolve(m[5]).prototype;j=m[5].match(/\.(\w+)$/i)[1];g=h[i];if(k){h[i]=function(){return f[j].apply(this,arguments)}}else{h[i]=function(){this.parent=f[j];return g.apply(this,arguments)}}h[i].prototype[i]=h[i];l.each(f,function(o,p){h[i].prototype[p]=f[p]});l.each(e,function(o,p){if(f[p]){h[i].prototype[p]=function(){this.parent=f[p];return o.apply(this,arguments)}}else{if(p!=i){h[i].prototype[p]=o}}})}l.each(e["static"],function(o,p){h[i][p]=o});if(this.onCreate){this.onCreate(m[2],m[3],h[i].prototype)}},walk:function(h,g,i,e){e=e||this;if(h){if(i){h=h[i]}b.each(h,function(j,f){if(g.call(e,j,f,i)===false){return false}b.walk(j,g,i,e)})}},createNS:function(h,g){var f,e;g=g||c;h=h.split(".");for(f=0;f<h.length;f++){e=h[f];if(!g[e]){g[e]={}}g=g[e]}return g},resolve:function(h,g){var f,e;g=g||c;h=h.split(".");for(f=0,e=h.length;f<e;f++){g=g[h[f]];if(!g){break}}return g},addUnload:function(i,h){var g=this;i={func:i,scope:h||this};if(!g.unloads){function e(){var f=g.unloads,k,l;if(f){for(l in f){k=f[l];if(k&&k.func){k.func.call(k.scope,1)}}if(c.detachEvent){c.detachEvent("onbeforeunload",j);c.detachEvent("onunload",e)}else{if(c.removeEventListener){c.removeEventListener("unload",e,false)}}g.unloads=k=f=w=e=0;if(c.CollectGarbage){CollectGarbage()}}}function j(){var k=document;if(k.readyState=="interactive"){function f(){k.detachEvent("onstop",f);if(e){e()}k=0}if(k){k.attachEvent("onstop",f)}c.setTimeout(function(){if(k){k.detachEvent("onstop",f)}},0)}}if(c.attachEvent){c.attachEvent("onunload",e);c.attachEvent("onbeforeunload",j)}else{if(c.addEventListener){c.addEventListener("unload",e,false)}}g.unloads=[i]}else{g.unloads.push(i)}return i},removeUnload:function(h){var e=this.unloads,g=null;b.each(e,function(j,f){if(j&&j.func==h){e.splice(f,1);g=h;return false}});return g},explode:function(e,f){return e?b.map(e.split(f||","),b.trim):e},_addVer:function(f){var e;if(!this.query){return f}e=(f.indexOf("?")==-1?"?":"&")+this.query;if(f.indexOf("#")==-1){return f+e}return f.replace("#",e+"#")}};b._init();c.tinymce=c.tinyMCE=b})(window);tinymce.create("tinymce.util.Dispatcher",{scope:null,listeners:null,Dispatcher:function(a){this.scope=a||this;this.listeners=[]},add:function(a,b){this.listeners.push({cb:a,scope:b||this.scope});return a},addToTop:function(a,b){this.listeners.unshift({cb:a,scope:b||this.scope});return a},remove:function(a){var b=this.listeners,c=null;tinymce.each(b,function(e,d){if(a==e.cb){c=a;b.splice(d,1);return false}});return c},dispatch:function(){var f,d=arguments,e,b=this.listeners,g;for(e=0;e<b.length;e++){g=b[e];f=g.cb.apply(g.scope,d);if(f===false){break}}return f}});(function(){var a=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(e,g){var f=this,h,d,c;e=tinymce.trim(e);g=f.settings=g||{};if(/^(mailto|tel|news|javascript|about|data):/i.test(e)||/^\s*#/.test(e)){f.source=e;return}if(e.indexOf("/")===0&&e.indexOf("//")!==0){e=(g.base_uri?g.base_uri.protocol||"http":"http")+"://mce_host"+e}if(!/^\w*:?\/\//.test(e)){e=(g.base_uri.protocol||"http")+"://mce_host"+f.toAbsPath(g.base_uri.path,e)}e=e.replace(/@@/g,"(mce_at)");e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);a(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(b,j){var k=e[j];if(k){k=k.replace(/\(mce_at\)/g,"@@")}f[b]=k});if(c=g.base_uri){if(!f.protocol){f.protocol=c.protocol}if(!f.userInfo){f.userInfo=c.userInfo}if(!f.port&&f.host=="mce_host"){f.port=c.port}if(!f.host||f.host=="mce_host"){f.host=c.host}f.source=""}},setPath:function(c){var b=this;c=/^(.*?)\/?(\w+)?$/.exec(c);b.path=c[0];b.directory=c[1];b.file=c[2];b.source="";b.getURI()},toRelative:function(b){var c=this,d;if(b==="./"){return b}b=new tinymce.util.URI(b,{base_uri:c});if((b.host!="mce_host"&&c.host!=b.host&&b.host)||c.port!=b.port||c.protocol!=b.protocol){return b.getURI()}d=c.toRelPath(c.path,b.path);if(b.query){d+="?"+b.query}if(b.anchor){d+="#"+b.anchor}return d},toAbsolute:function(b,c){var b=new tinymce.util.URI(b,{base_uri:this});return b.getURI(this.host==b.host&&this.protocol==b.protocol?c:0)},toRelPath:function(g,h){var c,f=0,d="",e,b;g=g.substring(0,g.lastIndexOf("/"));g=g.split("/");c=h.split("/");if(g.length>=c.length){for(e=0,b=g.length;e<b;e++){if(e>=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length<c.length){for(e=0,b=c.length;e<b;e++){if(e>=g.length||g[e]!=c[e]){f=e+1;break}}}if(f==1){return h}for(e=0,b=g.length-(f-1);e<b;e++){d+="../"}for(e=f-1,b=c.length;e<b;e++){if(e!=f-1){d+="/"+c[e]}else{d+=c[e]}}return d},toAbsPath:function(e,f){var c,b=0,h=[],d,g;d=/\/$/.test(f)?"/":"";e=e.split("/");f=f.split("/");a(e,function(i){if(i){h.push(i)}});e=h;for(c=f.length-1,h=[];c>=0;c--){if(f[c].length==0||f[c]=="."){continue}if(f[c]==".."){b++;continue}if(b>0){b--;continue}h.push(f[c])}c=e.length-b;if(c<=0){g=h.reverse().join("/")}else{g=e.slice(0,c).join("/")+"/"+h.reverse().join("/")}if(g.indexOf("/")!==0){g="/"+g}if(d&&g.lastIndexOf("/")!==g.length-1){g+=d}return g},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!=0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(e,b){var c=new Date();c.setTime(c.getTime()-1000);this.set(e,"",c,b,c)}})})();tinymce.create("static tinymce.util.JSON",{serialize:function(e){var c,a,d=tinymce.util.JSON.serialize,b;if(e==null){return"null"}b=typeof e;if(b=="string"){a="\bb\tt\nn\ff\rr\"\"''\\\\";return'"'+e.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g,function(g,f){c=a.indexOf(f);if(c+1){return"\\"+a.charAt(c+1)}g=f.charCodeAt().toString(16);return"\\u"+"0000".substring(g.length)+g})+'"'}if(b=="object"){if(e.hasOwnProperty&&e instanceof Array){for(c=0,a="[";c<e.length;c++){a+=(c>0?",":"")+d(e[c])}return a+"]"}a="{";for(c in e){a+=typeof e[c]!="function"?(a.length>1?',"':'"')+c+'":'+d(e[c]):""}return a+"}"}return""+e},parse:function(s){try{return eval("("+s+")")}catch(ex){}}});tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.send(g.data);function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){e.call(f.error_scope||f.scope,h,g)};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(m){var k=m.each,j=m.is,i=m.isWebKit,d=m.isIE,a=/^(H[1-6R]|P|DIV|ADDRESS|PRE|FORM|T(ABLE|BODY|HEAD|FOOT|H|R|D)|LI|OL|UL|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|MENU|ISINDEX|SAMP)$/,e=g("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"),f=g("src,href,style,coords,shape"),c={"&":"&amp;",'"':"&quot;","<":"&lt;",">":"&gt;"},n=/[<>&\"]/g,b=/^([a-z0-9],?)+$/i,h=/<(\w+)((?:\s+\w+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)(\s*\/?)>/g,l=/(\w+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;function g(q){var p={},o;q=q.split(",");for(o=q.length;o>=0;o--){p[q[o]]=1}return p}m.create("tinymce.dom.DOMUtils",{doc:null,root:null,files:null,pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},DOMUtils:function(u,q){var p=this,o;p.doc=u;p.win=window;p.files={};p.cssFlicker=false;p.counter=0;p.boxModel=!m.isIE||u.compatMode=="CSS1Compat";p.stdMode=u.documentMode===8;p.settings=q=m.extend({keep_values:false,hex_colors:1,process_html:1},q);if(m.isIE6){try{u.execCommand("BackgroundImageCache",false,true)}catch(r){p.cssFlicker=true}}if(q.valid_styles){p._styles={};k(q.valid_styles,function(t,s){p._styles[s]=m.explode(t)})}m.addUnload(p.destroy,p)},getRoot:function(){var o=this,p=o.settings;return(p&&o.get(p.root_element))||o.doc.body},getViewPort:function(p){var q,o;p=!p?this.win:p;q=p.document;o=this.boxModel?q.documentElement:q.body;return{x:p.pageXOffset||o.scrollLeft,y:p.pageYOffset||o.scrollTop,w:p.innerWidth||o.clientWidth,h:p.innerHeight||o.clientHeight}},getRect:function(s){var r,o=this,q;s=o.get(s);r=o.getPos(s);q=o.getSize(s);return{x:r.x,y:r.y,w:q.w,h:q.h}},getSize:function(r){var p=this,o,q;r=p.get(r);o=p.getStyle(r,"width");q=p.getStyle(r,"height");if(o.indexOf("px")===-1){o=0}if(q.indexOf("px")===-1){q=0}return{w:parseInt(o)||r.offsetWidth||r.clientWidth,h:parseInt(q)||r.offsetHeight||r.clientHeight}},getParent:function(q,p,o){return this.getParents(q,p,o,false)},getParents:function(z,v,s,y){var q=this,p,u=q.settings,x=[];z=q.get(z);y=y===undefined;if(u.strict_root){s=s||q.getRoot()}if(j(v,"string")){p=v;if(v==="*"){v=function(o){return o.nodeType==1}}else{v=function(o){return q.is(o,p)}}}while(z){if(z==s||!z.nodeType||z.nodeType===9){break}if(!v||v(z)){if(y){x.push(z)}else{return z}}z=z.parentNode}return y?x:null},get:function(o){var p;if(o&&this.doc&&typeof(o)=="string"){p=o;o=this.doc.getElementById(o);if(o&&o.id!==p){return this.doc.getElementsByName(p)[1]}}return o},getNext:function(p,o){return this._findSib(p,o,"nextSibling")},getPrev:function(p,o){return this._findSib(p,o,"previousSibling")},select:function(q,p){var o=this;return m.dom.Sizzle(q,o.get(p)||o.get(o.settings.root_element)||o.doc,[])},is:function(q,o){var p;if(q.length===undefined){if(o==="*"){return q.nodeType==1}if(b.test(o)){o=o.toLowerCase().split(/,/);q=q.nodeName.toLowerCase();for(p=o.length-1;p>=0;p--){if(o[p]==q){return true}}return false}}return m.dom.Sizzle.matches(o,q.nodeType?[q]:q).length>0},add:function(s,v,o,r,u){var q=this;return this.run(s,function(y){var x,t;x=j(v,"string")?q.doc.createElement(v):v;q.setAttribs(x,o);if(r){if(r.nodeType){x.appendChild(r)}else{q.setHTML(x,r)}}return !u?y.appendChild(x):x})},create:function(q,o,p){return this.add(this.doc.createElement(q),q,o,p,1)},createHTML:function(v,p,s){var u="",r=this,q;u+="<"+v;for(q in p){if(p.hasOwnProperty(q)){u+=" "+q+'="'+r.encode(p[q])+'"'}}if(m.is(s)){return u+">"+s+"</"+v+">"}return u+" />"},remove:function(o,p){return this.run(o,function(r){var q,s;q=r.parentNode;if(!q){return null}if(p){while(s=r.firstChild){if(s.nodeType!==3||s.nodeValue){q.insertBefore(s,r)}else{r.removeChild(s)}}}return q.removeChild(r)})},setStyle:function(r,o,p){var q=this;return q.run(r,function(v){var u,t;u=v.style;o=o.replace(/-(\D)/g,function(x,s){return s.toUpperCase()});if(q.pixelStyles.test(o)&&(m.is(p,"number")||/^[\-0-9\.]+$/.test(p))){p+="px"}switch(o){case"opacity":if(d){u.filter=p===""?"":"alpha(opacity="+(p*100)+")";if(!r.currentStyle||!r.currentStyle.hasLayout){u.display="inline-block"}}u[o]=u["-moz-opacity"]=u["-khtml-opacity"]=p||"";break;case"float":d?u.styleFloat=p:u.cssFloat=p;break;default:u[o]=p||""}if(q.settings.update_styles){q.setAttrib(v,"_mce_style")}})},getStyle:function(r,o,q){r=this.get(r);if(!r){return false}if(this.doc.defaultView&&q){o=o.replace(/[A-Z]/g,function(s){return"-"+s});try{return this.doc.defaultView.getComputedStyle(r,null).getPropertyValue(o)}catch(p){return null}}o=o.replace(/-(\D)/g,function(t,s){return s.toUpperCase()});if(o=="float"){o=d?"styleFloat":"cssFloat"}if(r.currentStyle&&q){return r.currentStyle[o]}return r.style[o]},setStyles:function(u,v){var q=this,r=q.settings,p;p=r.update_styles;r.update_styles=0;k(v,function(o,s){q.setStyle(u,s,o)});r.update_styles=p;if(r.update_styles){q.setAttrib(u,r.cssText)}},setAttrib:function(q,r,o){var p=this;if(!q||!r){return}if(p.settings.strict){r=r.toLowerCase()}return this.run(q,function(u){var t=p.settings;switch(r){case"style":if(!j(o,"string")){k(o,function(s,x){p.setStyle(u,x,s)});return}if(t.keep_values){if(o&&!p._isRes(o)){u.setAttribute("_mce_style",o,2)}else{u.removeAttribute("_mce_style",2)}}u.style.cssText=o;break;case"class":u.className=o||"";break;case"src":case"href":if(t.keep_values){if(t.url_converter){o=t.url_converter.call(t.url_converter_scope||p,o,r,u)}p.setAttrib(u,"_mce_"+r,o,2)}break;case"shape":u.setAttribute("_mce_style",o);break}if(j(o)&&o!==null&&o.length!==0){u.setAttribute(r,""+o,2)}else{u.removeAttribute(r,2)}})},setAttribs:function(q,r){var p=this;return this.run(q,function(o){k(r,function(s,t){p.setAttrib(o,t,s)})})},getAttrib:function(r,s,q){var o,p=this;r=p.get(r);if(!r||r.nodeType!==1){return false}if(!j(q)){q=""}if(/^(src|href|style|coords|shape)$/.test(s)){o=r.getAttribute("_mce_"+s);if(o){return o}}if(d&&p.props[s]){o=r[p.props[s]];o=o&&o.nodeValue?o.nodeValue:o}if(!o){o=r.getAttribute(s,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(s)){if(r[p.props[s]]===true&&o===""){return s}return o?s:""}if(r.nodeName==="FORM"&&r.getAttributeNode(s)){return r.getAttributeNode(s).nodeValue}if(s==="style"){o=o||r.style.cssText;if(o){o=p.serializeStyle(p.parseStyle(o),r.nodeName);if(p.settings.keep_values&&!p._isRes(o)){r.setAttribute("_mce_style",o)}}}if(i&&s==="class"&&o){o=o.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(d){switch(s){case"rowspan":case"colspan":if(o===1){o=""}break;case"size":if(o==="+0"||o===20||o===0){o=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(o===0){o=""}break;case"hspace":if(o===-1){o=""}break;case"maxlength":case"tabindex":if(o===32768||o===2147483647||o==="32768"){o=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(o===65535){return s}return q;case"shape":o=o.toLowerCase();break;default:if(s.indexOf("on")===0&&o){o=(""+o).replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1")}}}return(o!==undefined&&o!==null&&o!=="")?""+o:q},getPos:function(A,s){var p=this,o=0,z=0,u,v=p.doc,q;A=p.get(A);s=s||v.body;if(A){if(d&&!p.stdMode){A=A.getBoundingClientRect();u=p.boxModel?v.documentElement:v.body;o=p.getStyle(p.select("html")[0],"borderWidth");o=(o=="medium"||p.boxModel&&!p.isIE6)&&2||o;A.top+=p.win.self!=p.win.top?2:0;return{x:A.left+u.scrollLeft-o,y:A.top+u.scrollTop-o}}q=A;while(q&&q!=s&&q.nodeType){o+=q.offsetLeft||0;z+=q.offsetTop||0;q=q.offsetParent}q=A.parentNode;while(q&&q!=s&&q.nodeType){o-=q.scrollLeft||0;z-=q.scrollTop||0;q=q.parentNode}}return{x:o,y:z}},parseStyle:function(r){var u=this,v=u.settings,x={};if(!r){return x}function p(D,A,C){var z,B,o,y;z=x[D+"-top"+A];if(!z){return}B=x[D+"-right"+A];if(z!=B){return}o=x[D+"-bottom"+A];if(B!=o){return}y=x[D+"-left"+A];if(o!=y){return}x[C]=y;delete x[D+"-top"+A];delete x[D+"-right"+A];delete x[D+"-bottom"+A];delete x[D+"-left"+A]}function q(y,s,o,A){var z;z=x[s];if(!z){return}z=x[o];if(!z){return}z=x[A];if(!z){return}x[y]=x[s]+" "+x[o]+" "+x[A];delete x[s];delete x[o];delete x[A]}r=r.replace(/&(#?[a-z0-9]+);/g,"&$1_MCE_SEMI_");k(r.split(";"),function(s){var o,t=[];if(s){s=s.replace(/_MCE_SEMI_/g,";");s=s.replace(/url\([^\)]+\)/g,function(y){t.push(y);return"url("+t.length+")"});s=s.split(":");o=m.trim(s[1]);o=o.replace(/url\(([^\)]+)\)/g,function(z,y){return t[parseInt(y)-1]});o=o.replace(/rgb\([^\)]+\)/g,function(y){return u.toHex(y)});if(v.url_converter){o=o.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g,function(y,z){return"url("+v.url_converter.call(v.url_converter_scope||u,u.decode(z),"style",null)+")"})}x[m.trim(s[0]).toLowerCase()]=o}});p("border","","border");p("border","-width","border-width");p("border","-color","border-color");p("border","-style","border-style");p("padding","","padding");p("margin","","margin");q("border","border-width","border-style","border-color");if(d){if(x.border=="medium none"){x.border=""}}return x},serializeStyle:function(v,p){var q=this,r="";function u(s,o){if(o&&s){if(o.indexOf("-")===0){return}switch(o){case"font-weight":if(s==700){s="bold"}break;case"color":case"background-color":s=s.toLowerCase();break}r+=(r?" ":"")+o+": "+s+";"}}if(p&&q._styles){k(q._styles["*"],function(o){u(v[o],o)});k(q._styles[p.toLowerCase()],function(o){u(v[o],o)})}else{k(v,u)}return r},loadCSS:function(o){var q=this,r=q.doc,p;if(!o){o=""}p=q.select("head")[0];k(o.split(","),function(s){var t;if(q.files[s]){return}q.files[s]=true;t=q.create("link",{rel:"stylesheet",href:m._addVer(s)});if(d&&r.documentMode){t.onload=function(){r.recalc();t.onload=null}}p.appendChild(t)})},addClass:function(o,p){return this.run(o,function(q){var r;if(!p){return 0}if(this.hasClass(q,p)){return q.className}r=this.removeClass(q,p);return q.className=(r!=""?(r+" "):"")+p})},removeClass:function(q,r){var o=this,p;return o.run(q,function(t){var s;if(o.hasClass(t,r)){if(!p){p=new RegExp("(^|\\s+)"+r+"(\\s+|$)","g")}s=t.className.replace(p," ");s=m.trim(s!=" "?s:"");t.className=s;if(!s){t.removeAttribute("class")}return s}return t.className})},hasClass:function(p,o){p=this.get(p);if(!p||!o){return false}return(" "+p.className+" ").indexOf(" "+o+" ")!==-1},show:function(o){return this.setStyle(o,"display","block")},hide:function(o){return this.setStyle(o,"display","none")},isHidden:function(o){o=this.get(o);return !o||o.style.display=="none"||this.getStyle(o,"display")=="none"},uniqueId:function(o){return(!o?"mce_":o)+(this.counter++)},setHTML:function(q,p){var o=this;return this.run(q,function(v){var r,t,s,z,u,r;p=o.processHTML(p);if(d){function y(){while(v.firstChild){v.firstChild.removeNode()}try{v.innerHTML="<br />"+p;v.removeChild(v.firstChild)}catch(x){r=o.create("div");r.innerHTML="<br />"+p;k(r.childNodes,function(B,A){if(A){v.appendChild(B)}})}}if(o.settings.fix_ie_paragraphs){p=p.replace(/<p><\/p>|<p([^>]+)><\/p>|<p[^\/+]\/>/gi,'<p$1 _mce_keep="true">&nbsp;</p>')}y();if(o.settings.fix_ie_paragraphs){s=v.getElementsByTagName("p");for(t=s.length-1,r=0;t>=0;t--){z=s[t];if(!z.hasChildNodes()){if(!z._mce_keep){r=1;break}z.removeAttribute("_mce_keep")}}}if(r){p=p.replace(/<p ([^>]+)>|<p>/ig,'<div $1 _mce_tmp="1">');p=p.replace(/<\/p>/g,"</div>");y();if(o.settings.fix_ie_paragraphs){s=v.getElementsByTagName("DIV");for(t=s.length-1;t>=0;t--){z=s[t];if(z._mce_tmp){u=o.doc.createElement("p");z.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi,function(A,x){var B;if(x!=="_mce_tmp"){B=z.getAttribute(x);if(!B&&x==="class"){B=z.className}u.setAttribute(x,B)}});for(r=0;r<z.childNodes.length;r++){u.appendChild(z.childNodes[r].cloneNode(true))}z.swapNode(u)}}}}}else{v.innerHTML=p}return p})},processHTML:function(r){var p=this,q=p.settings,v=[];if(!q.process_html){return r}if(d){r=r.replace(/&apos;/g,"&#39;");r=r.replace(/\s+(disabled|checked|readonly|selected)\s*=\s*[\"\']?(false|0)[\"\']?/gi,"")}r=r.replace(/<a( )([^>]+)\/>|<a\/>/gi,"<a$1$2></a>");if(q.keep_values){if(/<script|noscript|style/i.test(r)){function o(t){t=t.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n");t=t.replace(/^[\r\n]*|[\r\n]*$/g,"");t=t.replace(/^\s*(\/\/\s*<!--|\/\/\s*<!\[CDATA\[|<!--|<!\[CDATA\[)[\r\n]*/g,"");t=t.replace(/\s*(\/\/\s*\]\]>|\/\/\s*-->|\]\]>|-->|\]\]-->)\s*$/g,"");return t}r=r.replace(/<script([^>]+|)>([\s\S]*?)<\/script>/gi,function(s,x,t){if(!x){x=' type="text/javascript"'}x=x.replace(/src=\"([^\"]+)\"?/i,function(y,z){if(q.url_converter){z=p.encode(q.url_converter.call(q.url_converter_scope||p,p.decode(z),"src","script"))}return'_mce_src="'+z+'"'});if(m.trim(t)){v.push(o(t));t="<!--\nMCE_SCRIPT:"+(v.length-1)+"\n// -->"}return"<mce:script"+x+">"+t+"</mce:script>"});r=r.replace(/<style([^>]+|)>([\s\S]*?)<\/style>/gi,function(s,x,t){if(t){v.push(o(t));t="<!--\nMCE_SCRIPT:"+(v.length-1)+"\n-->"}return"<mce:style"+x+">"+t+"</mce:style><style "+x+' _mce_bogus="1">'+t+"</style>"});r=r.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g,function(s,x,t){return"<mce:noscript"+x+"><!--"+p.encode(t).replace(/--/g,"&#45;&#45;")+"--></mce:noscript>"})}r=r.replace(/<!\[CDATA\[([\s\S]+)\]\]>/g,"<!--[CDATA[$1]]-->");function u(s){return s.replace(h,function(y,z,x,t){return"<"+z+x.replace(l,function(B,A,E,D,C){var F;A=A.toLowerCase();E=E||D||C||"";if(e[A]){if(E==="false"||E==="0"){return}return A+'="'+A+'"'}if(f[A]&&x.indexOf("_mce_"+A)==-1){F=p.decode(E);if(q.url_converter&&(A=="src"||A=="href")){F=q.url_converter.call(q.url_converter_scope||p,F,A,z)}if(A=="style"){F=p.serializeStyle(p.parseStyle(F),A)}return A+'="'+E+'" _mce_'+A+'="'+p.encode(F)+'"'}return B})+t+">"})}r=u(r);r=r.replace(/MCE_SCRIPT:([0-9]+)/g,function(t,s){return v[s]})}return r},getOuterHTML:function(o){var p;o=this.get(o);if(!o){return null}if(o.outerHTML!==undefined){return o.outerHTML}p=(o.ownerDocument||this.doc).createElement("body");p.appendChild(o.cloneNode(true));return p.innerHTML},setOuterHTML:function(r,p,s){var o=this;function q(u,t,x){var y,v;v=x.createElement("body");v.innerHTML=t;y=v.lastChild;while(y){o.insertAfter(y.cloneNode(true),u);y=y.previousSibling}o.remove(u)}return this.run(r,function(u){u=o.get(u);if(u.nodeType==1){s=s||u.ownerDocument||o.doc;if(d){try{if(d&&u.nodeType==1){u.outerHTML=p}else{q(u,p,s)}}catch(t){q(u,p,s)}}else{q(u,p,s)}}})},decode:function(p){var q,r,o;if(/&[\w#]+;/.test(p)){q=this.doc.createElement("div");q.innerHTML=p;r=q.firstChild;o="";if(r){do{o+=r.nodeValue}while(r=r.nextSibling)}return o||p}return p},encode:function(o){return(""+o).replace(n,function(p){return c[p]})},insertAfter:function(o,p){p=this.get(p);return this.run(o,function(r){var q,s;q=p.parentNode;s=p.nextSibling;if(s){q.insertBefore(r,s)}else{q.appendChild(r)}return r})},isBlock:function(o){if(o.nodeType&&o.nodeType!==1){return false}o=o.nodeName||o;return a.test(o)},replace:function(s,r,p){var q=this;if(j(r,"array")){s=s.cloneNode(true)}return q.run(r,function(t){if(p){k(m.grep(t.childNodes),function(o){s.appendChild(o)})}return t.parentNode.replaceChild(s,t)})},rename:function(r,o){var q=this,p;if(r.nodeName!=o.toUpperCase()){p=q.create(o);k(q.getAttribs(r),function(s){q.setAttrib(p,s.nodeName,q.getAttrib(r,s.nodeName))});q.replace(p,r,1)}return p||r},findCommonAncestor:function(q,o){var r=q,p;while(r){p=o;while(p&&r!=p){p=p.parentNode}if(r==p){break}r=r.parentNode}if(!r&&q.ownerDocument){return q.ownerDocument.documentElement}return r},toHex:function(o){var q=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(o);function p(r){r=parseInt(r).toString(16);return r.length>1?r:"0"+r}if(q){o="#"+p(q[1])+p(q[2])+p(q[3]);return o}return o},getClasses:function(){var s=this,o=[],r,u={},v=s.settings.class_filter,q;if(s.classes){return s.classes}function x(t){k(t.imports,function(y){x(y)});k(t.cssRules||t.rules,function(y){switch(y.type||1){case 1:if(y.selectorText){k(y.selectorText.split(","),function(z){z=z.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(z)||!/\.[\w\-]+$/.test(z)){return}q=z;z=z.replace(/.*\.([a-z0-9_\-]+).*/i,"$1");if(v&&!(z=v(z,q))){return}if(!u[z]){o.push({"class":z});u[z]=1}})}break;case 3:x(y.styleSheet);break}})}try{k(s.doc.styleSheets,x)}catch(p){}if(o.length>0){s.classes=o}return o},run:function(u,r,q){var p=this,v;if(p.doc&&typeof(u)==="string"){u=p.get(u)}if(!u){return false}q=q||this;if(!u.nodeType&&(u.length||u.length===0)){v=[];k(u,function(s,o){if(s){if(typeof(s)=="string"){s=p.doc.getElementById(s)}v.push(r.call(q,s,o))}});return v}return r.call(q,u)},getAttribs:function(q){var p;q=this.get(q);if(!q){return[]}if(d){p=[];if(q.nodeName=="OBJECT"){return q.attributes}if(q.nodeName==="OPTION"&&this.getAttrib(q,"selected")){p.push({specified:1,nodeName:"selected"})}q.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(o){p.push({specified:1,nodeName:o})});return p}return q.attributes},destroy:function(p){var o=this;if(o.events){o.events.destroy()}o.win=o.doc=o.root=o.events=null;if(!p){m.removeUnload(o.destroy)}},createRng:function(){var o=this.doc;return o.createRange?o.createRange():new m.dom.Range(this)},nodeIndex:function(r,s){var o=0,q,p;if(r){for(r=r.previousSibling,q=r;r;r=r.previousSibling){p=r.nodeType;if(s&&p==3){if(r.nodeValue.length>0&&(q.nodeType!=p||q.nodeValue.length===0)){o++}}else{o++}q=r}}return o},split:function(u,s,y){var z=this,o=z.createRng(),v,q,x;function p(A){var t,r=A.childNodes;if(A.nodeType==1&&A.getAttribute("_mce_type")=="bookmark"){return}for(t=r.length-1;t>=0;t--){p(r[t])}if(A.nodeType!=9){if(A.nodeType==3&&A.nodeValue.length>0){return}if(A.nodeType==1){r=A.childNodes;if(r.length==1&&r[0]&&r[0].nodeType==1&&r[0].getAttribute("_mce_type")=="bookmark"){A.parentNode.insertBefore(r[0],A)}if(r.length||/^(br|hr|input|img)$/i.test(A.nodeName)){return}}z.remove(A)}return A}if(u&&s){o.setStart(u.parentNode,z.nodeIndex(u));o.setEnd(s.parentNode,z.nodeIndex(s));v=o.extractContents();o=z.createRng();o.setStart(s.parentNode,z.nodeIndex(s)+1);o.setEnd(u.parentNode,z.nodeIndex(u)+1);q=o.extractContents();x=u.parentNode;x.insertBefore(p(v),u);if(y){x.replaceChild(y,s)}else{x.insertBefore(s,u)}x.insertBefore(p(q),u);z.remove(u);return y||s}},bind:function(s,o,r,q){var p=this;if(!p.events){p.events=new m.dom.EventUtils()}return p.events.add(s,o,r,q||this)},unbind:function(r,o,q){var p=this;if(!p.events){p.events=new m.dom.EventUtils()}return p.events.remove(r,o,q)},_findSib:function(r,o,p){var q=this,s=o;if(r){if(j(s,"string")){s=function(t){return q.is(t,o)}}for(r=r[p];r;r=r[p]){if(s(r)){return r}}}return null},_isRes:function(o){return/^(top|left|bottom|right|width|height)/i.test(o)||/;\s*(top|left|bottom|right|width|height)/i.test(o)}});m.DOM=new m.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(a){function b(c){var N=this,e=c.doc,S=0,E=1,j=2,D=true,R=false,U="startOffset",h="startContainer",P="endContainer",z="endOffset",k=tinymce.extend,n=c.nodeIndex;k(N,{startContainer:e,startOffset:0,endContainer:e,endOffset:0,collapsed:D,commonAncestorContainer:e,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:q,setEnd:s,setStartBefore:g,setStartAfter:I,setEndBefore:J,setEndAfter:u,collapse:A,selectNode:x,selectNodeContents:F,compareBoundaryPoints:v,deleteContents:p,extractContents:H,cloneContents:d,insertNode:C,surroundContents:M,cloneRange:K});function q(V,t){B(D,V,t)}function s(V,t){B(R,V,t)}function g(t){q(t.parentNode,n(t))}function I(t){q(t.parentNode,n(t)+1)}function J(t){s(t.parentNode,n(t))}function u(t){s(t.parentNode,n(t)+1)}function A(t){if(t){N[P]=N[h];N[z]=N[U]}else{N[h]=N[P];N[U]=N[z]}N.collapsed=D}function x(t){g(t);u(t)}function F(t){q(t,0);s(t,t.nodeType===1?t.childNodes.length:t.nodeValue.length)}function v(W,X){var Z=N[h],Y=N[U],V=N[P],t=N[z];if(W===0){return G(Z,Y,Z,Y)}if(W===1){return G(Z,Y,V,t)}if(W===2){return G(V,t,V,t)}if(W===3){return G(V,t,Z,Y)}}function p(){m(j)}function H(){return m(S)}function d(){return m(E)}function C(Y){var V=this[h],t=this[U],X,W;if((V.nodeType===3||V.nodeType===4)&&V.nodeValue){if(!t){V.parentNode.insertBefore(Y,V)}else{if(t>=V.nodeValue.length){c.insertAfter(Y,V)}else{X=V.splitText(t);V.parentNode.insertBefore(Y,X)}}}else{if(V.childNodes.length>0){W=V.childNodes[t]}if(W){V.insertBefore(Y,W)}else{V.appendChild(Y)}}}function M(V){var t=N.extractContents();N.insertNode(V);V.appendChild(t);N.selectNode(V)}function K(){return k(new b(c),{startContainer:N[h],startOffset:N[U],endContainer:N[P],endOffset:N[z],collapsed:N.collapsed,commonAncestorContainer:N.commonAncestorContainer})}function O(t,V){var W;if(t.nodeType==3){return t}if(V<0){return t}W=t.firstChild;while(W&&V>0){--V;W=W.nextSibling}if(W){return W}return t}function l(){return(N[h]==N[P]&&N[U]==N[z])}function G(X,Z,V,Y){var aa,W,t,ab,ad,ac;if(X==V){if(Z==Y){return 0}if(Z<Y){return -1}return 1}aa=V;while(aa&&aa.parentNode!=X){aa=aa.parentNode}if(aa){W=0;t=X.firstChild;while(t!=aa&&W<Z){W++;t=t.nextSibling}if(Z<=W){return -1}return 1}aa=X;while(aa&&aa.parentNode!=V){aa=aa.parentNode}if(aa){W=0;t=V.firstChild;while(t!=aa&&W<Y){W++;t=t.nextSibling}if(W<Y){return -1}return 1}ab=c.findCommonAncestor(X,V);ad=X;while(ad&&ad.parentNode!=ab){ad=ad.parentNode}if(!ad){ad=ab}ac=V;while(ac&&ac.parentNode!=ab){ac=ac.parentNode}if(!ac){ac=ab}if(ad==ac){return 0}t=ab.firstChild;while(t){if(t==ad){return -1}if(t==ac){return 1}t=t.nextSibling}}function B(V,Y,X){var t,W;if(V){N[h]=Y;N[U]=X}else{N[P]=Y;N[z]=X}t=N[P];while(t.parentNode){t=t.parentNode}W=N[h];while(W.parentNode){W=W.parentNode}if(W==t){if(G(N[h],N[U],N[P],N[z])>0){N.collapse(V)}}else{N.collapse(V)}N.collapsed=l();N.commonAncestorContainer=c.findCommonAncestor(N[h],N[P])}function m(ab){var aa,X=0,ad=0,V,Z,W,Y,t,ac;if(N[h]==N[P]){return f(ab)}for(aa=N[P],V=aa.parentNode;V;aa=V,V=V.parentNode){if(V==N[h]){return r(aa,ab)}++X}for(aa=N[h],V=aa.parentNode;V;aa=V,V=V.parentNode){if(V==N[P]){return T(aa,ab)}++ad}Z=ad-X;W=N[h];while(Z>0){W=W.parentNode;Z--}Y=N[P];while(Z<0){Y=Y.parentNode;Z++}for(t=W.parentNode,ac=Y.parentNode;t!=ac;t=t.parentNode,ac=ac.parentNode){W=t;Y=ac}return o(W,Y,ab)}function f(Z){var ab,Y,X,aa,t,W,V;if(Z!=j){ab=e.createDocumentFragment()}if(N[U]==N[z]){return ab}if(N[h].nodeType==3){Y=N[h].nodeValue;X=Y.substring(N[U],N[z]);if(Z!=E){N[h].deleteData(N[U],N[z]-N[U]);N.collapse(D)}if(Z==j){return}ab.appendChild(e.createTextNode(X));return ab}aa=O(N[h],N[U]);t=N[z]-N[U];while(t>0){W=aa.nextSibling;V=y(aa,Z);if(ab){ab.appendChild(V)}--t;aa=W}if(Z!=E){N.collapse(D)}return ab}function r(ab,Y){var aa,Z,V,t,X,W;if(Y!=j){aa=e.createDocumentFragment()}Z=i(ab,Y);if(aa){aa.appendChild(Z)}V=n(ab);t=V-N[U];if(t<=0){if(Y!=E){N.setEndBefore(ab);N.collapse(R)}return aa}Z=ab.previousSibling;while(t>0){X=Z.previousSibling;W=y(Z,Y);if(aa){aa.insertBefore(W,aa.firstChild)}--t;Z=X}if(Y!=E){N.setEndBefore(ab);N.collapse(R)}return aa}function T(Z,Y){var ab,V,aa,t,X,W;if(Y!=j){ab=e.createDocumentFragment()}aa=Q(Z,Y);if(ab){ab.appendChild(aa)}V=n(Z);++V;t=N[z]-V;aa=Z.nextSibling;while(t>0){X=aa.nextSibling;W=y(aa,Y);if(ab){ab.appendChild(W)}--t;aa=X}if(Y!=E){N.setStartAfter(Z);N.collapse(D)}return ab}function o(Z,t,ac){var W,ae,Y,aa,ab,V,ad,X;if(ac!=j){ae=e.createDocumentFragment()}W=Q(Z,ac);if(ae){ae.appendChild(W)}Y=Z.parentNode;aa=n(Z);ab=n(t);++aa;V=ab-aa;ad=Z.nextSibling;while(V>0){X=ad.nextSibling;W=y(ad,ac);if(ae){ae.appendChild(W)}ad=X;--V}W=i(t,ac);if(ae){ae.appendChild(W)}if(ac!=E){N.setStartAfter(Z);N.collapse(D)}return ae}function i(aa,ab){var W=O(N[P],N[z]-1),ac,Z,Y,t,V,X=W!=N[P];if(W==aa){return L(W,X,R,ab)}ac=W.parentNode;Z=L(ac,R,R,ab);while(ac){while(W){Y=W.previousSibling;t=L(W,X,R,ab);if(ab!=j){Z.insertBefore(t,Z.firstChild)}X=D;W=Y}if(ac==aa){return Z}W=ac.previousSibling;ac=ac.parentNode;V=L(ac,R,R,ab);if(ab!=j){V.appendChild(Z)}Z=V}}function Q(aa,ab){var X=O(N[h],N[U]),Y=X!=N[h],ac,Z,W,t,V;if(X==aa){return L(X,Y,D,ab)}ac=X.parentNode;Z=L(ac,R,D,ab);while(ac){while(X){W=X.nextSibling;t=L(X,Y,D,ab);if(ab!=j){Z.appendChild(t)}Y=D;X=W}if(ac==aa){return Z}X=ac.nextSibling;ac=ac.parentNode;V=L(ac,R,D,ab);if(ab!=j){V.appendChild(Z)}Z=V}}function L(t,Y,ab,ac){var X,W,Z,V,aa;if(Y){return y(t,ac)}if(t.nodeType==3){X=t.nodeValue;if(ab){V=N[U];W=X.substring(V);Z=X.substring(0,V)}else{V=N[z];W=X.substring(0,V);Z=X.substring(V)}if(ac!=E){t.nodeValue=Z}if(ac==j){return}aa=t.cloneNode(R);aa.nodeValue=W;return aa}if(ac==j){return}return t.cloneNode(R)}function y(V,t){if(t!=j){return t==E?V.cloneNode(D):V}V.parentNode.removeChild(V)}}a.Range=b})(tinymce.dom);(function(){function a(h){var j=this,k="\uFEFF",f,i,e=h.dom,d=true,g=false;function c(m,l){if(m&&l){if(m.item&&l.item&&m.item(0)===l.item(0)){return d}if(m.isEqual&&l.isEqual&&l.isEqual(m)){try{f.startContainer.nextSibling;return d}catch(n){}}}return g}function b(){var p=h.getRng(),l=e.createRng(),m,n,r,q;n=p.item?p.item(0):p.parentElement();if(n.ownerDocument!=e.doc){return l}if(p.item||!n.hasChildNodes()){l.setStart(n.parentNode,e.nodeIndex(n));l.setEnd(l.startContainer,l.startOffset+1);return l}m=p.duplicate();r=h.isCollapsed();p.collapse();p.pasteHTML('<span id="_mce_start" style="display:none;line-height:0">'+k+"</span>");if(!r){m.collapse(g);m.pasteHTML('<span id="_mce_end" style="display:none;line-height:0">'+k+"</span>")}function o(x){var t,v,s,u;s=e.get("_mce_"+(x?"start":"end"));u=s.previousSibling;if(u&&u.nodeType==3){t=u;v=t.nodeValue.length;e.remove(s);u=t.nextSibling;if(u&&u.nodeType==3){q=d;t.appendData(u.nodeValue);e.remove(u)}}else{u=s.nextSibling;if(u&&u.nodeType==3){t=u;v=0}else{if(u){v=e.nodeIndex(u)-1}else{v=e.nodeIndex(s)}t=s.parentNode}e.remove(s)}if(x){l.setStart(t,v)}if(!x||r){l.setEnd(t,v)}}o(d);if(!r){o(g)}if(q){j.addRange(l)}return l}this.addRange=function(m){var u,A,z=h.dom.doc,s=z.body,v,o,y,p,t,l,q,r,x,n;this.destroy();y=m.startContainer;p=m.startOffset;t=m.endContainer;l=m.endOffset;u=s.createTextRange();if(y==z||t==z){u=s.createTextRange();u.collapse();u.select();return}if(y.nodeType==1&&y.hasChildNodes()){r=y.childNodes.length-1;if(p>r){x=1;y=y.childNodes[r]}else{y=y.childNodes[p]}if(y.nodeType==3){p=0}}if(t.nodeType==1&&t.hasChildNodes()){r=t.childNodes.length-1;if(l==0){n=1;t=t.childNodes[0]}else{t=t.childNodes[Math.min(r,l-1)];if(t.nodeType==3){l=t.nodeValue.length}}}if(y==t&&y.nodeType==1){if(/^(IMG|TABLE)$/.test(y.nodeName)&&p!=l){u=s.createControlRange();u.addElement(y)}else{u=s.createTextRange();if(!y.hasChildNodes()&&y.canHaveHTML){y.innerHTML=k}u.moveToElementText(y);if(y.innerHTML==k){u.collapse(d);y.removeChild(y.firstChild)}}if(p==l){u.collapse(l<=m.endContainer.childNodes.length-1)}u.select();u.scrollIntoView();return}u=s.createTextRange();q=z.createElement("span");q.innerHTML=" ";if(y.nodeType==3){if(x){e.insertAfter(q,y)}else{y.parentNode.insertBefore(q,y)}u.moveToElementText(q);q.parentNode.removeChild(q);u.move("character",p)}else{u.moveToElementText(y);if(x){u.collapse(g)}}if(y==t&&y.nodeType==3){u.moveEnd("character",l-p);u.select();u.scrollIntoView();return}A=s.createTextRange();if(t.nodeType==3){t.parentNode.insertBefore(q,t);A.moveToElementText(q);q.parentNode.removeChild(q);A.move("character",l);u.setEndPoint("EndToStart",A)}else{A.moveToElementText(t);A.collapse(!!n);u.setEndPoint("EndToEnd",A)}u.select();u.scrollIntoView()};this.getRangeAt=function(){if(!f||!c(i,h.getRng())){f=b();i=h.getRng()}return f};this.destroy=function(){i=f=null};if(h.dom.boxModel){(function(){var r=e.doc,m=r.body,o,p;r.documentElement.unselectable=d;function q(s,v){var t=m.createTextRange();try{t.moveToPoint(s,v)}catch(u){t=null}return t}function n(t){var s;if(t.button){s=q(t.x,t.y);if(s){if(s.compareEndPoints("StartToStart",p)>0){s.setEndPoint("StartToStart",p)}else{s.setEndPoint("EndToEnd",p)}s.select()}}else{l()}}function l(){e.unbind(r,"mouseup",l);e.unbind(r,"mousemove",n);o=0}e.bind(r,"mousedown",function(s){if(s.target.nodeName==="HTML"){if(o){l()}o=1;p=q(s.x,s.y);if(p){e.bind(r,"mouseup",l);e.bind(r,"mousemove",n);p.select()}}})})()}}tinymce.dom.TridentSelection=a})();(function(){var p=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,i=0,d=Object.prototype.toString,n=false;var b=function(E,t,B,v){B=B||[];var e=t=t||document;if(t.nodeType!==1&&t.nodeType!==9){return[]}if(!E||typeof E!=="string"){return B}var C=[],D,z,H,G,A,s,r=true,x=o(t);p.lastIndex=0;while((D=p.exec(E))!==null){C.push(D[1]);if(D[2]){s=RegExp.rightContext;break}}if(C.length>1&&j.exec(E)){if(C.length===2&&f.relative[C[0]]){z=g(C[0]+C[1],t)}else{z=f.relative[C[0]]?[t]:b(C.shift(),t);while(C.length){E=C.shift();if(f.relative[E]){E+=C.shift()}z=g(E,z)}}}else{if(!v&&C.length>1&&t.nodeType===9&&!x&&f.match.ID.test(C[0])&&!f.match.ID.test(C[C.length-1])){var I=b.find(C.shift(),t,x);t=I.expr?b.filter(I.expr,I.set)[0]:I.set[0]}if(t){var I=v?{expr:C.pop(),set:a(v)}:b.find(C.pop(),C.length===1&&(C[0]==="~"||C[0]==="+")&&t.parentNode?t.parentNode:t,x);z=I.expr?b.filter(I.expr,I.set):I.set;if(C.length>0){H=a(z)}else{r=false}while(C.length){var u=C.pop(),y=u;if(!f.relative[u]){u=""}else{y=C.pop()}if(y==null){y=t}f.relative[u](H,y,x)}}else{H=C=[]}}if(!H){H=z}if(!H){throw"Syntax error, unrecognized expression: "+(u||E)}if(d.call(H)==="[object Array]"){if(!r){B.push.apply(B,H)}else{if(t&&t.nodeType===1){for(var F=0;H[F]!=null;F++){if(H[F]&&(H[F]===true||H[F].nodeType===1&&h(t,H[F]))){B.push(z[F])}}}else{for(var F=0;H[F]!=null;F++){if(H[F]&&H[F].nodeType===1){B.push(z[F])}}}}}else{a(H,B)}if(s){b(s,e,B,v);b.uniqueSort(B)}return B};b.uniqueSort=function(r){if(c){n=false;r.sort(c);if(n){for(var e=1;e<r.length;e++){if(r[e]===r[e-1]){r.splice(e--,1)}}}}};b.matches=function(e,r){return b(e,null,null,r)};b.find=function(y,e,z){var x,u;if(!y){return[]}for(var t=0,s=f.order.length;t<s;t++){var v=f.order[t],u;if((u=f.match[v].exec(y))){var r=RegExp.leftContext;if(r.substr(r.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");x=f.find[v](u,e,z);if(x!=null){y=y.replace(f.match[v],"");break}}}}if(!x){x=e.getElementsByTagName("*")}return{set:x,expr:y}};b.filter=function(B,A,E,t){var s=B,G=[],y=A,v,e,x=A&&A[0]&&o(A[0]);while(B&&A.length){for(var z in f.filter){if((v=f.match[z].exec(B))!=null){var r=f.filter[z],F,D;e=false;if(y==G){G=[]}if(f.preFilter[z]){v=f.preFilter[z](v,y,E,G,t,x);if(!v){e=F=true}else{if(v===true){continue}}}if(v){for(var u=0;(D=y[u])!=null;u++){if(D){F=r(D,v,u,y);var C=t^!!F;if(E&&F!=null){if(C){e=true}else{y[u]=false}}else{if(C){G.push(D);e=true}}}}}if(F!==undefined){if(!E){y=G}B=B.replace(f.match[z],"");if(!e){return[]}break}}}if(B==s){if(e==null){throw"Syntax error, unrecognized expression: "+B}else{break}}s=B}return y};var f=b.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")}},relative:{"+":function(y,e,x){var u=typeof e==="string",z=u&&!/\W/.test(e),v=u&&!z;if(z&&!x){e=e.toUpperCase()}for(var t=0,s=y.length,r;t<s;t++){if((r=y[t])){while((r=r.previousSibling)&&r.nodeType!==1){}y[t]=v||r&&r.nodeName===e?r||false:r===e}}if(v){b.filter(e,y,true)}},">":function(x,r,y){var u=typeof r==="string";if(u&&!/\W/.test(r)){r=y?r:r.toUpperCase();for(var s=0,e=x.length;s<e;s++){var v=x[s];if(v){var t=v.parentNode;x[s]=t.nodeName===r?t:false}}}else{for(var s=0,e=x.length;s<e;s++){var v=x[s];if(v){x[s]=u?v.parentNode:v.parentNode===r}}if(u){b.filter(r,x,true)}}},"":function(t,r,v){var s=i++,e=q;if(!r.match(/\W/)){var u=r=v?r:r.toUpperCase();e=m}e("parentNode",r,s,t,u,v)},"~":function(t,r,v){var s=i++,e=q;if(typeof r==="string"&&!r.match(/\W/)){var u=r=v?r:r.toUpperCase();e=m}e("previousSibling",r,s,t,u,v)}},find:{ID:function(r,s,t){if(typeof s.getElementById!=="undefined"&&!t){var e=s.getElementById(r[1]);return e?[e]:[]}},NAME:function(s,v,x){if(typeof v.getElementsByName!=="undefined"){var r=[],u=v.getElementsByName(s[1]);for(var t=0,e=u.length;t<e;t++){if(u[t].getAttribute("name")===s[1]){r.push(u[t])}}return r.length===0?null:r}},TAG:function(e,r){return r.getElementsByTagName(e[1])}},preFilter:{CLASS:function(t,r,s,e,x,y){t=" "+t[1].replace(/\\/g,"")+" ";if(y){return t}for(var u=0,v;(v=r[u])!=null;u++){if(v){if(x^(v.className&&(" "+v.className+" ").indexOf(t)>=0)){if(!s){e.push(v)}}else{if(s){r[u]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(r,e){for(var s=0;e[s]===false;s++){}return e[s]&&o(e[s])?r[1]:r[1].toUpperCase()},CHILD:function(e){if(e[1]=="nth"){var r=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]=="even"&&"2n"||e[2]=="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(r[1]+(r[2]||1))-0;e[3]=r[3]-0}e[0]=i++;return e},ATTR:function(u,r,s,e,v,x){var t=u[1].replace(/\\/g,"");if(!x&&f.attrMap[t]){u[1]=f.attrMap[t]}if(u[2]==="~="){u[4]=" "+u[4]+" "}return u},PSEUDO:function(u,r,s,e,v){if(u[1]==="not"){if(u[3].match(p).length>1||/^\w/.test(u[3])){u[3]=b(u[3],null,null,r)}else{var t=b.filter(u[3],r,s,true^v);if(!s){e.push.apply(e,t)}return false}}else{if(f.match.POS.test(u[0])||f.match.CHILD.test(u[0])){return true}}return u},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(s,r,e){return !!b(e[3],s).length},header:function(e){return/h\d/i.test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toUpperCase()==="BUTTON"},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)}},setFilters:{first:function(r,e){return e===0},last:function(s,r,e,t){return r===t.length-1},even:function(r,e){return e%2===0},odd:function(r,e){return e%2===1},lt:function(s,r,e){return r<e[3]-0},gt:function(s,r,e){return r>e[3]-0},nth:function(s,r,e){return e[3]-0==r},eq:function(s,r,e){return e[3]-0==r}},filter:{PSEUDO:function(x,s,t,y){var r=s[1],u=f.filters[r];if(u){return u(x,t,s,y)}else{if(r==="contains"){return(x.textContent||x.innerText||"").indexOf(s[3])>=0}else{if(r==="not"){var v=s[3];for(var t=0,e=v.length;t<e;t++){if(v[t]===x){return false}}return true}}}},CHILD:function(e,t){var x=t[1],r=e;switch(x){case"only":case"first":while(r=r.previousSibling){if(r.nodeType===1){return false}}if(x=="first"){return true}r=e;case"last":while(r=r.nextSibling){if(r.nodeType===1){return false}}return true;case"nth":var s=t[2],A=t[3];if(s==1&&A==0){return true}var v=t[0],z=e.parentNode;if(z&&(z.sizcache!==v||!e.nodeIndex)){var u=0;for(r=z.firstChild;r;r=r.nextSibling){if(r.nodeType===1){r.nodeIndex=++u}}z.sizcache=v}var y=e.nodeIndex-A;if(s==0){return y==0}else{return(y%s==0&&y/s>=0)}}},ID:function(r,e){return r.nodeType===1&&r.getAttribute("id")===e},TAG:function(r,e){return(e==="*"&&r.nodeType===1)||r.nodeName===e},CLASS:function(r,e){return(" "+(r.className||r.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(v,t){var s=t[1],e=f.attrHandle[s]?f.attrHandle[s](v):v[s]!=null?v[s]:v.getAttribute(s),x=e+"",u=t[2],r=t[4];return e==null?u==="!=":u==="="?x===r:u==="*="?x.indexOf(r)>=0:u==="~="?(" "+x+" ").indexOf(r)>=0:!r?x&&e!==false:u==="!="?x!=r:u==="^="?x.indexOf(r)===0:u==="$="?x.substr(x.length-r.length)===r:u==="|="?x===r||x.substr(0,r.length+1)===r+"-":false},POS:function(u,r,s,v){var e=r[2],t=f.setFilters[e];if(t){return t(u,s,r,v)}}}};var j=f.match.POS;for(var l in f.match){f.match[l]=new RegExp(f.match[l].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var a=function(r,e){r=Array.prototype.slice.call(r);if(e){e.push.apply(e,r);return e}return r};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(k){a=function(u,t){var r=t||[];if(d.call(u)==="[object Array]"){Array.prototype.push.apply(r,u)}else{if(typeof u.length==="number"){for(var s=0,e=u.length;s<e;s++){r.push(u[s])}}else{for(var s=0;u[s];s++){r.push(u[s])}}}return r}}var c;if(document.documentElement.compareDocumentPosition){c=function(r,e){var s=r.compareDocumentPosition(e)&4?-1:r===e?0:1;if(s===0){n=true}return s}}else{if("sourceIndex" in document.documentElement){c=function(r,e){var s=r.sourceIndex-e.sourceIndex;if(s===0){n=true}return s}}else{if(document.createRange){c=function(t,r){var s=t.ownerDocument.createRange(),e=r.ownerDocument.createRange();s.setStart(t,0);s.setEnd(t,0);e.setStart(r,0);e.setEnd(r,0);var u=s.compareBoundaryPoints(Range.START_TO_END,e);if(u===0){n=true}return u}}}}(function(){var r=document.createElement("div"),s="script"+(new Date).getTime();r.innerHTML="<a name='"+s+"'/>";var e=document.documentElement;e.insertBefore(r,e.firstChild);if(!!document.getElementById(s)){f.find.ID=function(u,v,x){if(typeof v.getElementById!=="undefined"&&!x){var t=v.getElementById(u[1]);return t?t.id===u[1]||typeof t.getAttributeNode!=="undefined"&&t.getAttributeNode("id").nodeValue===u[1]?[t]:undefined:[]}};f.filter.ID=function(v,t){var u=typeof v.getAttributeNode!=="undefined"&&v.getAttributeNode("id");return v.nodeType===1&&u&&u.nodeValue===t}}e.removeChild(r)})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){f.find.TAG=function(r,v){var u=v.getElementsByTagName(r[1]);if(r[1]==="*"){var t=[];for(var s=0;u[s];s++){if(u[s].nodeType===1){t.push(u[s])}}u=t}return u}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){f.attrHandle.href=function(r){return r.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var e=b,s=document.createElement("div");s.innerHTML="<p class='TEST'></p>";if(s.querySelectorAll&&s.querySelectorAll(".TEST").length===0){return}b=function(x,v,t,u){v=v||document;if(!u&&v.nodeType===9&&!o(v)){try{return a(v.querySelectorAll(x),t)}catch(y){}}return e(x,v,t,u)};for(var r in e){b[r]=e[r]}})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var e=document.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}f.order.splice(1,0,"CLASS");f.find.CLASS=function(r,s,t){if(typeof s.getElementsByClassName!=="undefined"&&!t){return s.getElementsByClassName(r[1])}}})()}function m(r,x,v,B,y,A){var z=r=="previousSibling"&&!A;for(var t=0,s=B.length;t<s;t++){var e=B[t];if(e){if(z&&e.nodeType===1){e.sizcache=v;e.sizset=t}e=e[r];var u=false;while(e){if(e.sizcache===v){u=B[e.sizset];break}if(e.nodeType===1&&!A){e.sizcache=v;e.sizset=t}if(e.nodeName===x){u=e;break}e=e[r]}B[t]=u}}}function q(r,x,v,B,y,A){var z=r=="previousSibling"&&!A;for(var t=0,s=B.length;t<s;t++){var e=B[t];if(e){if(z&&e.nodeType===1){e.sizcache=v;e.sizset=t}e=e[r];var u=false;while(e){if(e.sizcache===v){u=B[e.sizset];break}if(e.nodeType===1){if(!A){e.sizcache=v;e.sizset=t}if(typeof x!=="string"){if(e===x){u=true;break}}else{if(b.filter(x,[e]).length>0){u=e;break}}}e=e[r]}B[t]=u}}}var h=document.compareDocumentPosition?function(r,e){return r.compareDocumentPosition(e)&16}:function(r,e){return r!==e&&(r.contains?r.contains(e):true)};var o=function(e){return e.nodeType===9&&e.documentElement.nodeName!=="HTML"||!!e.ownerDocument&&e.ownerDocument.documentElement.nodeName!=="HTML"};var g=function(e,y){var t=[],u="",v,s=y.nodeType?[y]:y;while((v=f.match.PSEUDO.exec(e))){u+=v[0];e=e.replace(f.match.PSEUDO,"")}e=f.relative[e]?e+"*":e;for(var x=0,r=s.length;x<r;x++){b(e,s[x],t)}return b.filter(u,t)};window.tinymce.dom.Sizzle=b})();(function(d){var f=d.each,c=d.DOM,b=d.isIE,e=d.isWebKit,a;d.create("tinymce.dom.EventUtils",{EventUtils:function(){this.inits=[];this.events=[]},add:function(m,p,l,j){var g,h=this,i=h.events,k;if(p instanceof Array){k=[];f(p,function(o){k.push(h.add(m,o,l,j))});return k}if(m&&m.hasOwnProperty&&m instanceof Array){k=[];f(m,function(n){n=c.get(n);k.push(h.add(n,p,l,j))});return k}m=c.get(m);if(!m){return}g=function(n){if(h.disabled){return}n=n||window.event;if(n&&b){if(!n.target){n.target=n.srcElement}d.extend(n,h._stoppers)}if(!j){return l(n)}return l.call(j,n)};if(p=="unload"){d.unloads.unshift({func:g});return g}if(p=="init"){if(h.domLoaded){g()}else{h.inits.push(g)}return g}i.push({obj:m,name:p,func:l,cfunc:g,scope:j});h._add(m,p,g);return l},remove:function(l,m,k){var h=this,g=h.events,i=false,j;if(l&&l.hasOwnProperty&&l instanceof Array){j=[];f(l,function(n){n=c.get(n);j.push(h.remove(n,m,k))});return j}l=c.get(l);f(g,function(o,n){if(o.obj==l&&o.name==m&&(!k||(o.func==k||o.cfunc==k))){g.splice(n,1);h._remove(l,m,o.cfunc);i=true;return false}});return i},clear:function(l){var j=this,g=j.events,h,k;if(l){l=c.get(l);for(h=g.length-1;h>=0;h--){k=g[h];if(k.obj===l){j._remove(k.obj,k.name,k.cfunc);k.obj=k.cfunc=null;g.splice(h,1)}}}},cancel:function(g){if(!g){return false}this.stop(g);return this.prevent(g)},stop:function(g){if(g.stopPropagation){g.stopPropagation()}else{g.cancelBubble=true}return false},prevent:function(g){if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}return false},destroy:function(){var g=this;f(g.events,function(j,h){g._remove(j.obj,j.name,j.cfunc);j.obj=j.cfunc=null});g.events=[];g=null},_add:function(h,i,g){if(h.attachEvent){h.attachEvent("on"+i,g)}else{if(h.addEventListener){h.addEventListener(i,g,false)}else{h["on"+i]=g}}},_remove:function(i,j,h){if(i){try{if(i.detachEvent){i.detachEvent("on"+j,h)}else{if(i.removeEventListener){i.removeEventListener(j,h,false)}else{i["on"+j]=null}}}catch(g){}}},_pageInit:function(h){var g=this;if(g.domLoaded){return}g.domLoaded=true;f(g.inits,function(i){i()});g.inits=[]},_wait:function(i){var g=this,h=i.document;if(i.tinyMCE_GZ&&tinyMCE_GZ.loaded){g.domLoaded=1;return}if(h.attachEvent){h.attachEvent("onreadystatechange",function(){if(h.readyState==="complete"){h.detachEvent("onreadystatechange",arguments.callee);g._pageInit(i)}});if(h.documentElement.doScroll&&i==i.top){(function(){if(g.domLoaded){return}try{h.documentElement.doScroll("left")}catch(j){setTimeout(arguments.callee,0);return}g._pageInit(i)})()}}else{if(h.addEventListener){g._add(i,"DOMContentLoaded",function(){g._pageInit(i)})}}g._add(i,"load",function(){g._pageInit(i)})},_stoppers:{preventDefault:function(){this.returnValue=false},stopPropagation:function(){this.cancelBubble=true}}});a=d.dom.Event=new d.dom.EventUtils();a._wait(window);d.addUnload(function(){a.destroy()})})(tinymce);(function(a){a.dom.Element=function(f,d){var b=this,e,c;b.settings=d=d||{};b.id=f;b.dom=e=d.dom||a.DOM;if(!a.isIE){c=e.get(b.id)}a.each(("getPos,getRect,getParent,add,setStyle,getStyle,setStyles,setAttrib,setAttribs,getAttrib,addClass,removeClass,hasClass,getOuterHTML,setOuterHTML,remove,show,hide,isHidden,setHTML,get").split(/,/),function(g){b[g]=function(){var h=[f],j;for(j=0;j<arguments.length;j++){h.push(arguments[j])}h=e[g].apply(e,h);b.update(g);return h}});a.extend(b,{on:function(i,h,g){return a.dom.Event.add(b.id,i,h,g)},getXY:function(){return{x:parseInt(b.getStyle("left")),y:parseInt(b.getStyle("top"))}},getSize:function(){var g=e.get(b.id);return{w:parseInt(b.getStyle("width")||g.clientWidth),h:parseInt(b.getStyle("height")||g.clientHeight)}},moveTo:function(g,h){b.setStyles({left:g,top:h})},moveBy:function(g,i){var h=b.getXY();b.moveTo(h.x+g,h.y+i)},resizeTo:function(g,i){b.setStyles({width:g,height:i})},resizeBy:function(g,j){var i=b.getSize();b.resizeTo(i.w+g,i.h+j)},update:function(h){var g;if(a.isIE6&&d.blocker){h=h||"";if(h.indexOf("get")===0||h.indexOf("has")===0||h.indexOf("is")===0){return}if(h=="remove"){e.remove(b.blocker);return}if(!b.blocker){b.blocker=e.uniqueId();g=e.add(d.container||e.getRoot(),"iframe",{id:b.blocker,style:"position:absolute;",frameBorder:0,src:'javascript:""'});e.setStyle(g,"opacity",0)}else{g=e.get(b.blocker)}e.setStyles(g,{left:b.getStyle("left",1),top:b.getStyle("top",1),width:b.getStyle("width",1),height:b.getStyle("height",1),display:b.getStyle("display",1),zIndex:parseInt(b.getStyle("zIndex",1)||0)-1})}}})}})(tinymce);(function(c){function e(f){return f.replace(/[\n\r]+/g,"")}var b=c.is,a=c.isIE,d=c.each;c.create("tinymce.dom.Selection",{Selection:function(i,h,g){var f=this;f.dom=i;f.win=h;f.serializer=g;d(["onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent"],function(j){f[j]=new c.util.Dispatcher(f)});if(!f.win.getSelection){f.tridentSel=new c.dom.TridentSelection(f)}c.addUnload(f.destroy,f)},getContent:function(g){var f=this,h=f.getRng(),l=f.dom.create("body"),j=f.getSel(),i,k,m;g=g||{};i=k="";g.get=true;g.format=g.format||"html";f.onBeforeGetContent.dispatch(f,g);if(g.format=="text"){return f.isCollapsed()?"":(h.text||(j.toString?j.toString():""))}if(h.cloneContents){m=h.cloneContents();if(m){l.appendChild(m)}}else{if(b(h.item)||b(h.htmlText)){l.innerHTML=h.item?h.item(0).outerHTML:h.htmlText}else{l.innerHTML=h.toString()}}if(/^\s/.test(l.innerHTML)){i=" "}if(/\s+$/.test(l.innerHTML)){k=" "}g.getInner=true;g.content=f.isCollapsed()?"":i+f.serializer.serialize(l,g)+k;f.onGetContent.dispatch(f,g);return g.content},setContent:function(i,g){var f=this,j=f.getRng(),l,k=f.win.document;g=g||{format:"html"};g.set=true;i=g.content=f.dom.processHTML(i);f.onBeforeSetContent.dispatch(f,g);i=g.content;if(j.insertNode){i+='<span id="__caret">_</span>';if(j.startContainer==k&&j.endContainer==k){k.body.innerHTML=i}else{j.deleteContents();j.insertNode(f.getRng().createContextualFragment(i))}l=f.dom.get("__caret");j=k.createRange();j.setStartBefore(l);j.setEndBefore(l);f.setRng(j);f.dom.remove("__caret")}else{if(j.item){k.execCommand("Delete",false,null);j=f.getRng()}j.pasteHTML(i)}f.onSetContent.dispatch(f,g)},getStart:function(){var f=this,g=f.getRng(),h;if(a){if(g.item){return g.item(0)}g=g.duplicate();g.collapse(1);h=g.parentElement();if(h&&h.nodeName=="BODY"){return h.firstChild||h}return h}else{h=g.startContainer;if(h.nodeType==1&&h.hasChildNodes()){h=h.childNodes[Math.min(h.childNodes.length-1,g.startOffset)]}if(h&&h.nodeType==3){return h.parentNode}return h}},getEnd:function(){var g=this,h=g.getRng(),i,f;if(a){if(h.item){return h.item(0)}h=h.duplicate();h.collapse(0);i=h.parentElement();if(i&&i.nodeName=="BODY"){return i.lastChild||i}return i}else{i=h.endContainer;f=h.endOffset;if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[f>0?f-1:f]}if(i&&i.nodeType==3){return i.parentNode}return i}},getBookmark:function(q,r){var u=this,m=u.dom,g,j,i,n,h,o,p,l="\uFEFF",s;function f(v,x){var t=0;d(m.select(v),function(z,y){if(z==x){t=y}});return t}if(q==2){function k(){var v=u.getRng(true),t=m.getRoot(),x={};function y(z,B){var F=[],D,H,A=z[B?"startContainer":"endContainer"],E=z[B?"startOffset":"endOffset"],C,G={};if(A.nodeType==1&&A.hasChildNodes()){H=A.childNodes.length-1;G.exclude=(B&&E>H)||(!B&&E==0);if(!B&&E){E--}A=A.childNodes[E>H?H:E];if(A.nodeType==3){E=B?0:A.nodeValue.length}}if(A.nodeType==3){if(r){for(D=A.previousSibling;D&&D.nodeType==3;D=D.previousSibling){E+=D.nodeValue.length}}G.offset=E}for(;A&&A!=t;A=A.parentNode){F.push(u.dom.nodeIndex(A,r))}G.indexes=F;return G}x.start=y(v,true);if(!u.isCollapsed()){x.end=y(v)}return x}return k()}if(q){return{rng:u.getRng()}}g=u.getRng();i=m.uniqueId();n=tinyMCE.activeEditor.selection.isCollapsed();s="overflow:hidden;line-height:0px";if(g.duplicate||g.item){if(!g.item){j=g.duplicate();g.collapse();g.pasteHTML('<span _mce_type="bookmark" id="'+i+'_start" style="'+s+'">'+l+"</span>");if(!n){j.collapse(false);j.pasteHTML('<span _mce_type="bookmark" id="'+i+'_end" style="'+s+'">'+l+"</span>")}}else{o=g.item(0);h=o.nodeName;return{name:h,index:f(h,o)}}}else{o=u.getNode();h=o.nodeName;if(h=="IMG"){return{name:h,index:f(h,o)}}j=g.cloneRange();if(!n){j.collapse(false);j.insertNode(m.create("span",{_mce_type:"bookmark",id:i+"_end",style:s},l))}g.collapse(true);g.insertNode(m.create("span",{_mce_type:"bookmark",id:i+"_start",style:s},l))}u.moveToBookmark({id:i,keep:1});return{id:i}},moveToBookmark:function(l){var n=this,k=n.dom,i,h,f,m;if(n.tridentSel){n.tridentSel.destroy()}if(l){if(l.start){f=k.createRng();m=k.getRoot();function g(s){var o=l[s?"start":"end"],p,q,r;if(o){for(q=m,p=o.indexes.length-1;p>=0;p--){q=q.childNodes[o.indexes[p]]||q}if(s){if(q.nodeType==3&&o.offset){f.setStart(q,o.offset)}else{if(o.exclude){f.setStartAfter(q)}else{f.setStartBefore(q)}}}else{if(q.nodeType==3&&o.offset){f.setEnd(q,o.offset)}else{if(o.exclude){f.setEndBefore(q)}else{f.setEndAfter(q)}}}}}g(true);g();n.setRng(f)}else{if(l.id){f=k.createRng();function j(u){var p=k.get(l.id+"_"+u),t,o,r,s,q=l.keep;if(p){t=p.parentNode;if(u=="start"){if(!q){o=k.nodeIndex(p)}else{t=p;o=1}f.setStart(t,o);f.setEnd(t,o)}else{if(!q){o=k.nodeIndex(p)}else{t=p;o=1}f.setEnd(t,o)}if(!q){s=p.previousSibling;r=p.nextSibling;d(c.grep(p.childNodes),function(v){if(v.nodeType==3){v.nodeValue=v.nodeValue.replace(/\uFEFF/g,"")}});while(p=k.get(l.id+"_"+u)){k.remove(p,1)}if(s&&r&&s.nodeType==r.nodeType&&s.nodeType==3){o=s.nodeValue.length;s.appendData(r.nodeValue);k.remove(r);if(u=="start"){f.setStart(s,o);f.setEnd(s,o)}else{f.setEnd(s,o)}}}}}j("start");j("end");n.setRng(f)}else{if(l.name){n.select(k.select(l.name)[l.index])}else{if(l.rng){n.setRng(l.rng)}}}}}},select:function(k,j){var i=this,l=i.dom,g=l.createRng(),f;f=l.nodeIndex(k);g.setStart(k.parentNode,f);g.setEnd(k.parentNode,f+1);if(j){function h(m,o){var n=new c.dom.TreeWalker(m,m);do{if(m.nodeType==3&&c.trim(m.nodeValue).length!=0){if(o){g.setStart(m,0)}else{g.setEnd(m,m.nodeValue.length)}return}if(m.nodeName=="BR"){if(o){g.setStartBefore(m)}else{g.setEndBefore(m)}return}}while(m=(o?n.next():n.prev()))}h(k,1);h(k)}i.setRng(g);return k},isCollapsed:function(){var f=this,h=f.getRng(),g=f.getSel();if(!h||h.item){return false}if(h.compareEndPoints){return h.compareEndPoints("StartToEnd",h)===0}return !g||h.collapsed},collapse:function(f){var g=this,h=g.getRng(),i;if(h.item){i=h.item(0);h=this.win.document.body.createTextRange();h.moveToElementText(i)}h.collapse(!!f);g.setRng(h)},getSel:function(){var g=this,f=this.win;return f.getSelection?f.getSelection():f.document.selection},getRng:function(j){var g=this,h,i;if(j&&g.tridentSel){return g.tridentSel.getRangeAt(0)}try{if(h=g.getSel()){i=h.rangeCount>0?h.getRangeAt(0):(h.createRange?h.createRange():g.win.document.createRange())}}catch(f){}if(!i){i=a?g.win.document.body.createTextRange():g.win.document.createRange()}return i},setRng:function(i){var h,g=this;if(!g.tridentSel){h=g.getSel();if(h){h.removeAllRanges();h.addRange(i)}}else{if(i.cloneRange){g.tridentSel.addRange(i);return}try{i.select()}catch(f){}}},setNode:function(g){var f=this;f.setContent(f.dom.getOuterHTML(g));return g},getNode:function(){var g=this,f=g.getRng(),h=g.getSel(),i;if(!a){if(!f){return g.dom.getRoot()}i=f.commonAncestorContainer;if(!f.collapsed){if(f.startContainer==f.endContainer){if(f.startOffset-f.endOffset<2){if(f.startContainer.hasChildNodes()){i=f.startContainer.childNodes[f.startOffset]}}}if(c.isWebKit&&h.anchorNode&&h.anchorNode.nodeType==1){return h.anchorNode.childNodes[h.anchorOffset]}}if(i&&i.nodeType==3){return i.parentNode}return i}return f.item?f.item(0):f.parentElement()},getSelectedBlocks:function(g,f){var i=this,j=i.dom,m,h,l,k=[];m=j.getParent(g||i.getStart(),j.isBlock);h=j.getParent(f||i.getEnd(),j.isBlock);if(m){k.push(m)}if(m&&h&&m!=h){l=m;while((l=l.nextSibling)&&l!=h){if(j.isBlock(l)){k.push(l)}}}if(h&&m!=h){k.push(h)}return k},destroy:function(g){var f=this;f.win=null;if(f.tridentSel){f.tridentSel.destroy()}if(!g){c.removeUnload(f.destroy)}}})})(tinymce);(function(a){a.create("tinymce.dom.XMLWriter",{node:null,XMLWriter:function(c){function b(){var e=document.implementation;if(!e||!e.createDocument){try{return new ActiveXObject("MSXML2.DOMDocument")}catch(d){}try{return new ActiveXObject("Microsoft.XmlDom")}catch(d){}}else{return e.createDocument("","",null)}}this.doc=b();this.valid=a.isOpera||a.isWebKit;this.reset()},reset:function(){var b=this,c=b.doc;if(c.firstChild){c.removeChild(c.firstChild)}b.node=c.appendChild(c.createElement("html"))},writeStartElement:function(c){var b=this;b.node=b.node.appendChild(b.doc.createElement(c))},writeAttribute:function(c,b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.setAttribute(c,b)},writeEndElement:function(){this.node=this.node.parentNode},writeFullEndElement:function(){var b=this,c=b.node;c.appendChild(b.doc.createTextNode(""));b.node=c.parentNode},writeText:function(b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.appendChild(this.doc.createTextNode(b))},writeCDATA:function(b){this.node.appendChild(this.doc.createCDATASection(b))},writeComment:function(b){if(a.isIE){b=b.replace(/^\-|\-$/g," ")}this.node.appendChild(this.doc.createComment(b.replace(/\-\-/g," ")))},getContent:function(){var b;b=this.doc.xml||new XMLSerializer().serializeToString(this.doc);b=b.replace(/<\?[^?]+\?>|<html>|<\/html>|<html\/>|<!DOCTYPE[^>]+>/g,"");b=b.replace(/ ?\/>/g," />");if(this.valid){b=b.replace(/\%MCGT%/g,"&gt;")}return b}})})(tinymce);(function(a){a.create("tinymce.dom.StringWriter",{str:null,tags:null,count:0,settings:null,indent:null,StringWriter:function(b){this.settings=a.extend({indent_char:" ",indentation:0},b);this.reset()},reset:function(){this.indent="";this.str="";this.tags=[];this.count=0},writeStartElement:function(b){this._writeAttributesEnd();this.writeRaw("<"+b);this.tags.push(b);this.inAttr=true;this.count++;this.elementCount=this.count},writeAttribute:function(d,b){var c=this;c.writeRaw(" "+c.encode(d)+'="'+c.encode(b)+'"')},writeEndElement:function(){var b;if(this.tags.length>0){b=this.tags.pop();if(this._writeAttributesEnd(1)){this.writeRaw("</"+b+">")}if(this.settings.indentation>0){this.writeRaw("\n")}}},writeFullEndElement:function(){if(this.tags.length>0){this._writeAttributesEnd();this.writeRaw("</"+this.tags.pop()+">");if(this.settings.indentation>0){this.writeRaw("\n")}}},writeText:function(b){this._writeAttributesEnd();this.writeRaw(this.encode(b));this.count++},writeCDATA:function(b){this._writeAttributesEnd();this.writeRaw("<![CDATA["+b+"]]>");this.count++},writeComment:function(b){this._writeAttributesEnd();this.writeRaw("<!-- "+b+"-->");this.count++},writeRaw:function(b){this.str+=b},encode:function(b){return b.replace(/[<>&"]/g,function(c){switch(c){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";case'"':return"&quot;"}return c})},getContent:function(){return this.str},_writeAttributesEnd:function(b){if(!this.inAttr){return}this.inAttr=false;if(b&&this.elementCount==this.count){this.writeRaw(" />");return false}this.writeRaw(">");return true}})})(tinymce);(function(e){var g=e.extend,f=e.each,b=e.util.Dispatcher,d=e.isIE,a=e.isGecko;function c(h){return h.replace(/([?+*])/g,".$1")}e.create("tinymce.dom.Serializer",{Serializer:function(j){var i=this;i.key=0;i.onPreProcess=new b(i);i.onPostProcess=new b(i);try{i.writer=new e.dom.XMLWriter()}catch(h){i.writer=new e.dom.StringWriter()}i.settings=j=g({dom:e.DOM,valid_nodes:0,node_filter:0,attr_filter:0,invalid_attrs:/^(_mce_|_moz_|sizset|sizcache)/,closed:/^(br|hr|input|meta|img|link|param|area)$/,entity_encoding:"named",entities:"160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro",valid_elements:"*[*]",extended_valid_elements:0,invalid_elements:0,fix_table_elements:1,fix_list_elements:true,fix_content_duplication:true,convert_fonts_to_spans:false,font_size_classes:0,apply_source_formatting:0,indent_mode:"simple",indent_char:"\t",indent_levels:1,remove_linebreaks:1,remove_redundant_brs:1,element_format:"xhtml"},j);i.dom=j.dom;i.schema=j.schema;if(j.entity_encoding=="named"&&!j.entities){j.entity_encoding="raw"}if(j.remove_redundant_brs){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/(<br \/>\s*)+<\/(p|h[1-6]|div|li)>/gi,function(n,m,o){if(/^<br \/>\s*<\//.test(n)){return"</"+o+">"}return n})})}if(j.element_format=="html"){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/<([^>]+) \/>/g,"<$1>")})}if(j.fix_list_elements){i.onPreProcess.add(function(v,s){var l,z,y=["ol","ul"],u,t,q,k=/^(OL|UL)$/,A;function m(r,x){var o=x.split(","),p;while((r=r.previousSibling)!=null){for(p=0;p<o.length;p++){if(r.nodeName==o[p]){return r}}}return null}for(z=0;z<y.length;z++){l=i.dom.select(y[z],s.node);for(u=0;u<l.length;u++){t=l[u];q=t.parentNode;if(k.test(q.nodeName)){A=m(t,"LI");if(!A){A=i.dom.create("li");A.innerHTML="&nbsp;";A.appendChild(t);q.insertBefore(A,q.firstChild)}else{A.appendChild(t)}}}}})}if(j.fix_table_elements){i.onPreProcess.add(function(k,l){if(!e.isOpera||opera.buildNumber()>=1767){f(i.dom.select("p table",l.node).reverse(),function(p){var o=i.dom.getParent(p.parentNode,"table,p");if(o.nodeName!="TABLE"){try{i.dom.split(o,p)}catch(m){}}})}})}},setEntities:function(o){var n=this,j,m,h={},k;if(n.entityLookup){return}j=o.split(",");for(m=0;m<j.length;m+=2){k=j[m];if(k==34||k==38||k==60||k==62){continue}h[String.fromCharCode(j[m])]=j[m+1];k=parseInt(j[m]).toString(16)}n.entityLookup=h},setRules:function(i){var h=this;h._setup();h.rules={};h.wildRules=[];h.validElements={};return h.addRules(i)},addRules:function(i){var h=this,j;if(!i){return}h._setup();f(i.split(","),function(m){var q=m.split(/\[|\]/),l=q[0].split("/"),r,k,o,n=[];if(j){k=e.extend([],j.attribs)}if(q.length>1){f(q[1].split("|"),function(u){var p={},t;k=k||[];u=u.replace(/::/g,"~");u=/^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/.exec(u);u[2]=u[2].replace(/~/g,":");if(u[1]=="!"){r=r||[];r.push(u[2])}if(u[1]=="-"){for(t=0;t<k.length;t++){if(k[t].name==u[2]){k.splice(t,1);return}}}switch(u[3]){case"=":p.defaultVal=u[4]||"";break;case":":p.forcedVal=u[4];break;case"<":p.validVals=u[4].split("?");break}if(/[*.?]/.test(u[2])){o=o||[];p.nameRE=new RegExp("^"+c(u[2])+"$");o.push(p)}else{p.name=u[2];k.push(p)}n.push(u[2])})}f(l,function(v,u){var y=v.charAt(0),t=1,p={};if(j){if(j.noEmpty){p.noEmpty=j.noEmpty}if(j.fullEnd){p.fullEnd=j.fullEnd}if(j.padd){p.padd=j.padd}}switch(y){case"-":p.noEmpty=true;break;case"+":p.fullEnd=true;break;case"#":p.padd=true;break;default:t=0}l[u]=v=v.substring(t);h.validElements[v]=1;if(/[*.?]/.test(l[0])){p.nameRE=new RegExp("^"+c(l[0])+"$");h.wildRules=h.wildRules||{};h.wildRules.push(p)}else{p.name=l[0];if(l[0]=="@"){j=p}h.rules[v]=p}p.attribs=k;if(r){p.requiredAttribs=r}if(o){v="";f(n,function(s){if(v){v+="|"}v+="("+c(s)+")"});p.validAttribsRE=new RegExp("^"+v.toLowerCase()+"$");p.wildAttribs=o}})});i="";f(h.validElements,function(m,l){if(i){i+="|"}if(l!="@"){i+=l}});h.validElementsRE=new RegExp("^("+c(i.toLowerCase())+")$")},findRule:function(m){var j=this,l=j.rules,h,k;j._setup();k=l[m];if(k){return k}l=j.wildRules;for(h=0;h<l.length;h++){if(l[h].nameRE.test(m)){return l[h]}}return null},findAttribRule:function(h,l){var j,k=h.wildAttribs;for(j=0;j<k.length;j++){if(k[j].nameRE.test(l)){return k[j]}}return null},serialize:function(r,q){var m,k=this,p,i,j,l;k._setup();q=q||{};q.format=q.format||"html";k.processObj=q;if(d){l=[];f(r.getElementsByTagName("option"),function(o){var h=k.dom.getAttrib(o,"selected");l.push(h?h:null)})}r=r.cloneNode(true);if(d){f(r.getElementsByTagName("option"),function(o,h){k.dom.setAttrib(o,"selected",l[h])})}j=r.ownerDocument.implementation;if(j.createHTMLDocument&&(e.isOpera&&opera.buildNumber()>=1767)){p=j.createHTMLDocument("");f(r.nodeName=="BODY"?r.childNodes:[r],function(h){p.body.appendChild(p.importNode(h,true))});if(r.nodeName!="BODY"){r=p.body.firstChild}else{r=p.body}i=k.dom.doc;k.dom.doc=p}k.key=""+(parseInt(k.key)+1);if(!q.no_events){q.node=r;k.onPreProcess.dispatch(k,q)}k.writer.reset();k._info=q;k._serializeNode(r,q.getInner);q.content=k.writer.getContent();if(i){k.dom.doc=i}if(!q.no_events){k.onPostProcess.dispatch(k,q)}k._postProcess(q);q.node=null;return e.trim(q.content)},_postProcess:function(n){var i=this,k=i.settings,j=n.content,m=[],l;if(n.format=="html"){l=i._protect({content:j,patterns:[{pattern:/(<script[^>]*>)(.*?)(<\/script>)/g},{pattern:/(<noscript[^>]*>)(.*?)(<\/noscript>)/g},{pattern:/(<style[^>]*>)(.*?)(<\/style>)/g},{pattern:/(<pre[^>]*>)(.*?)(<\/pre>)/g,encode:1},{pattern:/(<!--\[CDATA\[)(.*?)(\]\]-->)/g}]});j=l.content;if(k.entity_encoding!=="raw"){j=i._encode(j)}if(!n.set){j=j.replace(/<p>\s+<\/p>|<p([^>]+)>\s+<\/p>/g,k.entity_encoding=="numeric"?"<p$1>&#160;</p>":"<p$1>&nbsp;</p>");if(k.remove_linebreaks){j=j.replace(/\r?\n|\r/g," ");j=j.replace(/(<[^>]+>)\s+/g,"$1 ");j=j.replace(/\s+(<\/[^>]+>)/g," $1");j=j.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object) ([^>]+)>\s+/g,"<$1 $2>");j=j.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>\s+/g,"<$1>");j=j.replace(/\s+<\/(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g,"</$1>")}if(k.apply_source_formatting&&k.indent_mode=="simple"){j=j.replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g,"\n<$1$2$3>\n");j=j.replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g,"\n<$1$2>");j=j.replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g,"</$1>\n");j=j.replace(/\n\n/g,"\n")}}j=i._unprotect(j,l);j=j.replace(/<!--\[CDATA\[([\s\S]+)\]\]-->/g,"<![CDATA[$1]]>");if(k.entity_encoding=="raw"){j=j.replace(/<p>&nbsp;<\/p>|<p([^>]+)>&nbsp;<\/p>/g,"<p$1>\u00a0</p>")}j=j.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g,function(h,p,o){return"<noscript"+p+">"+i.dom.decode(o.replace(/<!--|-->/g,""))+"</noscript>"})}n.content=j},_serializeNode:function(D,I){var z=this,A=z.settings,x=z.writer,q,j,u,F,E,H,B,h,y,k,r,C,p,m,G,o;if(!A.node_filter||A.node_filter(D)){switch(D.nodeType){case 1:if(D.hasAttribute?D.hasAttribute("_mce_bogus"):D.getAttribute("_mce_bogus")){return}p=G=false;q=D.hasChildNodes();k=D.getAttribute("_mce_name")||D.nodeName.toLowerCase();o=D.getAttribute("_mce_type");if(o){if(!z._info.cleanup){p=true;return}else{G=1}}if(d){if(D.scopeName!=="HTML"&&D.scopeName!=="html"){k=D.scopeName+":"+k}}if(k.indexOf("mce:")===0){k=k.substring(4)}if(!G){if(!z.validElementsRE||!z.validElementsRE.test(k)||(z.invalidElementsRE&&z.invalidElementsRE.test(k))||I){p=true;break}}if(d){if(A.fix_content_duplication){if(D._mce_serialized==z.key){return}D._mce_serialized=z.key}if(k.charAt(0)=="/"){k=k.substring(1)}}else{if(a){if(D.nodeName==="BR"&&D.getAttribute("type")=="_moz"){return}}}if(A.validate_children){if(z.elementName&&!z.schema.isValid(z.elementName,k)){p=true;break}z.elementName=k}r=z.findRule(k);k=r.name||k;m=A.closed.test(k);if((!q&&r.noEmpty)||(d&&!k)){p=true;break}if(r.requiredAttribs){H=r.requiredAttribs;for(F=H.length-1;F>=0;F--){if(this.dom.getAttrib(D,H[F])!==""){break}}if(F==-1){p=true;break}}x.writeStartElement(k);if(r.attribs){for(F=0,B=r.attribs,E=B.length;F<E;F++){H=B[F];y=z._getAttrib(D,H);if(y!==null){x.writeAttribute(H.name,y)}}}if(r.validAttribsRE){B=z.dom.getAttribs(D);for(F=B.length-1;F>-1;F--){h=B[F];if(h.specified){H=h.nodeName.toLowerCase();if(A.invalid_attrs.test(H)||!r.validAttribsRE.test(H)){continue}C=z.findAttribRule(r,H);y=z._getAttrib(D,C,H);if(y!==null){x.writeAttribute(H,y)}}}}if(o&&G){x.writeAttribute("_mce_type",o)}if(k==="script"&&e.trim(D.innerHTML)){x.writeText("// ");x.writeCDATA(D.innerHTML.replace(/<!--|-->|<\[CDATA\[|\]\]>/g,""));q=false;break}if(r.padd){if(q&&(u=D.firstChild)&&u.nodeType===1&&D.childNodes.length===1){if(u.hasAttribute?u.hasAttribute("_mce_bogus"):u.getAttribute("_mce_bogus")){x.writeText("\u00a0")}}else{if(!q){x.writeText("\u00a0")}}}break;case 3:if(A.validate_children&&z.elementName&&!z.schema.isValid(z.elementName,"#text")){return}return x.writeText(D.nodeValue);case 4:return x.writeCDATA(D.nodeValue);case 8:return x.writeComment(D.nodeValue)}}else{if(D.nodeType==1){q=D.hasChildNodes()}}if(q&&!m){u=D.firstChild;while(u){z._serializeNode(u);z.elementName=k;u=u.nextSibling}}if(!p){if(!m){x.writeFullEndElement()}else{x.writeEndElement()}}},_protect:function(j){var i=this;j.items=j.items||[];function h(l){return l.replace(/[\r\n\\]/g,function(m){if(m==="\n"){return"\\n"}else{if(m==="\\"){return"\\\\"}}return"\\r"})}function k(l){return l.replace(/\\[\\rn]/g,function(m){if(m==="\\n"){return"\n"}else{if(m==="\\\\"){return"\\"}}return"\r"})}f(j.patterns,function(l){j.content=k(h(j.content).replace(l.pattern,function(n,o,m,p){m=k(m);if(l.encode){m=i._encode(m)}j.items.push(m);return o+"<!--mce:"+(j.items.length-1)+"-->"+p}))});return j},_unprotect:function(i,j){i=i.replace(/\<!--mce:([0-9]+)--\>/g,function(k,h){return j.items[parseInt(h)]});j.items=[];return i},_encode:function(m){var j=this,k=j.settings,i;if(k.entity_encoding!=="raw"){if(k.entity_encoding.indexOf("named")!=-1){j.setEntities(k.entities);i=j.entityLookup;m=m.replace(/[\u007E-\uFFFF]/g,function(h){var l;if(l=i[h]){h="&"+l+";"}return h})}if(k.entity_encoding.indexOf("numeric")!=-1){m=m.replace(/[\u007E-\uFFFF]/g,function(h){return"&#"+h.charCodeAt(0)+";"})}}return m},_setup:function(){var h=this,i=this.settings;if(h.done){return}h.done=1;h.setRules(i.valid_elements);h.addRules(i.extended_valid_elements);if(i.invalid_elements){h.invalidElementsRE=new RegExp("^("+c(i.invalid_elements.replace(/,/g,"|").toLowerCase())+")$")}if(i.attrib_value_filter){h.attribValueFilter=i.attribValueFilter}},_getAttrib:function(m,j,h){var l,k;h=h||j.name;if(j.forcedVal&&(k=j.forcedVal)){if(k==="{$uid}"){return this.dom.uniqueId()}return k}k=this.dom.getAttrib(m,h);switch(h){case"rowspan":case"colspan":if(k=="1"){k=""}break}if(this.attribValueFilter){k=this.attribValueFilter(h,k,m)}if(j.validVals){for(l=j.validVals.length-1;l>=0;l--){if(k==j.validVals[l]){break}}if(l==-1){return null}}if(k===""&&typeof(j.defaultVal)!="undefined"){k=j.defaultVal;if(k==="{$uid}"){return this.dom.uniqueId()}return k}else{if(h=="class"&&this.processObj.get){k=k.replace(/\s?mceItem\w+\s?/g,"")}}if(k===""){return null}return k}})})(tinymce);(function(a){a.dom.ScriptLoader=function(h){var c=0,k=1,i=2,l={},j=[],f={},d=[],g=0,e;function b(m,u){var v=this,q=a.DOM,s,o,r,n;function p(){q.remove(n);if(s){s.onreadystatechange=s.onload=s=null}u()}n=q.uniqueId();if(a.isIE6){o=new a.util.URI(m);r=location;if(o.host==r.hostname&&o.port==r.port&&(o.protocol+":")==r.protocol){a.util.XHR.send({url:a._addVer(o.getURI()),success:function(x){var t=q.create("script",{type:"text/javascript"});t.text=x;document.getElementsByTagName("head")[0].appendChild(t);q.remove(t);p()}});return}}s=q.create("script",{id:n,type:"text/javascript",src:a._addVer(m)});s.onload=p;s.onreadystatechange=function(){var t=s.readyState;if(t=="complete"||t=="loaded"){p()}};(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}this.isDone=function(m){return l[m]==i};this.markDone=function(m){l[m]=i};this.add=this.load=function(m,q,n){var o,p=l[m];if(p==e){j.push(m);l[m]=c}if(q){if(!f[m]){f[m]=[]}f[m].push({func:q,scope:n||this})}};this.loadQueue=function(n,m){this.loadScripts(j,n,m)};this.loadScripts=function(m,q,p){var o;function n(r){a.each(f[r],function(s){s.func.call(s.scope)});f[r]=e}d.push({func:q,scope:p||this});o=function(){var r=a.grep(m);m.length=0;a.each(r,function(s){if(l[s]==i){n(s);return}if(l[s]!=k){l[s]=k;g++;b(s,function(){l[s]=i;g--;n(s);o()})}});if(!g){a.each(d,function(s){s.func.call(s.scope)});d.length=0}};o()}};a.ScriptLoader=new a.dom.ScriptLoader()})(tinymce);tinymce.dom.TreeWalker=function(a,c){var b=a;function d(i,f,e,j){var h,g;if(i){if(!j&&i[f]){return i[f]}if(i!=c){h=i[e];if(h){return h}for(g=i.parentNode;g&&g!=c;g=g.parentNode){h=g[e];if(h){return h}}}}}this.current=function(){return b};this.next=function(e){return(b=d(b,"firstChild","nextSibling",e))};this.prev=function(e){return(b=d(b,"lastChild","lastSibling",e))}};(function(){var a={};function b(f,e){var d;function c(g){return g.replace(/[A-Z]+/g,function(h){return c(f[h])})}for(d in f){if(f.hasOwnProperty(d)){f[d]=c(f[d])}}c(e).replace(/#/g,"#text").replace(/(\w+)\[([^\]]+)\]/g,function(l,g,j){var h,k={};j=j.split(/\|/);for(h=j.length-1;h>=0;h--){k[j[h]]=1}a[g]=k})}b({Z:"#|H|K|N|O|P",Y:"#|X|form|R|Q",X:"p|T|div|U|W|isindex|fieldset|table",W:"pre|hr|blockquote|address|center|noframes",U:"ul|ol|dl|menu|dir",ZC:"#|p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q",T:"h1|h2|h3|h4|h5|h6",ZB:"#|X|S|Q",S:"R|P",ZA:"#|a|G|J|M|O|P",R:"#|a|H|K|N|O",Q:"noscript|P",P:"ins|del|script",O:"input|select|textarea|label|button",N:"M|L",M:"em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym",L:"sub|sup",K:"J|I",J:"tt|i|b|u|s|strike",I:"big|small|font|basefont",H:"G|F",G:"br|span|bdo",F:"object|applet|img|map|iframe"},"script[]style[]object[#|param|X|form|a|H|K|N|O|Q]param[]p[S]a[Z]br[]span[S]bdo[S]applet[#|param|X|form|a|H|K|N|O|Q]h1[S]img[]map[X|form|Q|area]h2[S]iframe[#|X|form|a|H|K|N|O|Q]h3[S]tt[S]i[S]b[S]u[S]s[S]strike[S]big[S]small[S]font[S]basefont[]em[S]strong[S]dfn[S]code[S]q[S]samp[S]kbd[S]var[S]cite[S]abbr[S]acronym[S]sub[S]sup[S]input[]select[optgroup|option]optgroup[option]option[]textarea[]label[S]button[#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]h4[S]ins[#|X|form|a|H|K|N|O|Q]h5[S]del[#|X|form|a|H|K|N|O|Q]h6[S]div[#|X|form|a|H|K|N|O|Q]ul[li]li[#|X|form|a|H|K|N|O|Q]ol[li]dl[dt|dd]dt[S]dd[#|X|form|a|H|K|N|O|Q]menu[li]dir[li]pre[ZA]hr[]blockquote[#|X|form|a|H|K|N|O|Q]address[S|p]center[#|X|form|a|H|K|N|O|Q]noframes[#|X|form|a|H|K|N|O|Q]isindex[]fieldset[#|legend|X|form|a|H|K|N|O|Q]legend[S]table[caption|col|colgroup|thead|tfoot|tbody|tr]caption[S]col[]colgroup[col]thead[tr]tr[th|td]th[#|X|form|a|H|K|N|O|Q]form[#|X|a|H|K|N|O|Q]noscript[#|X|form|a|H|K|N|O|Q]td[#|X|form|a|H|K|N|O|Q]tfoot[tr]tbody[tr]area[]base[]body[#|X|form|a|H|K|N|O|Q]");tinymce.dom.Schema=function(){var c=this,d=a;c.isValid=function(f,e){var g=d[f];return !!(g&&(!e||g[e]))}}})();(function(a){a.dom.RangeUtils=function(c){var b="\uFEFF";this.walk=function(d,r){var h=d.startContainer,k=d.startOffset,s=d.endContainer,l=d.endOffset,i,f,n,g,q,p,e;e=c.select("td.mceSelected,th.mceSelected");if(e.length>0){a.each(e,function(t){r([t])});return}function o(v,u,t){var x=[];for(;v&&v!=t;v=v[u]){x.push(v)}return x}function m(u,t){do{if(u.parentNode==t){return u}u=u.parentNode}while(u)}function j(v,u,x){var t=x?"nextSibling":"previousSibling";for(g=v,q=g.parentNode;g&&g!=u;g=q){q=g.parentNode;p=o(g==v?g:g[t],t);if(p.length){if(!x){p.reverse()}r(p)}}}if(h.nodeType==1&&h.hasChildNodes()){h=h.childNodes[k]}if(s.nodeType==1&&s.hasChildNodes()){s=s.childNodes[Math.min(k==l?l:l-1,s.childNodes.length-1)]}i=c.findCommonAncestor(h,s);if(h==s){return r([h])}for(g=h;g;g=g.parentNode){if(g==s){return j(h,i,true)}if(g==i){break}}for(g=s;g;g=g.parentNode){if(g==h){return j(s,i)}if(g==i){break}}f=m(h,i)||h;n=m(s,i)||s;j(h,f,true);p=o(f==h?f:f.nextSibling,"nextSibling",n==s?n.nextSibling:n);if(p.length){r(p)}j(s,n)}}})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(e,d){this.id=e;this.settings=d=d||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=d.scope||this;this.disabled=0;this.active=0},setDisabled:function(d){var f;if(d!=this.disabled){f=b.get(this.id);if(f&&this.settings.unavailable_prefix){if(d){this.prevTitle=f.title;f.title=this.settings.unavailable_prefix+": "+f.title}else{f.title=this.prevTitle}}this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(b,a){this.parent(b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator"},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(j){var h=this,i=h.settings,g;j.container=j.container||i.container;j.parent=h;j.constrain=j.constrain||i.constrain;j["class"]=j["class"]||i["class"];j.vp_offset_x=j.vp_offset_x||i.vp_offset_x;j.vp_offset_y=j.vp_offset_y||i.vp_offset_y;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},update:function(){var i=this,j=i.settings,g=c.get("menu_"+i.id+"_tbl"),l=c.get("menu_"+i.id+"_co"),h,k;h=j.max_width?Math.min(g.clientWidth,j.max_width):g.clientWidth;k=j.max_height?Math.min(g.clientHeight,j.max_height):g.clientHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.element.setStyles({width:h,height:k})}if(j.max_width){c.setStyle(l,"width",h)}if(j.max_height){c.setStyle(l,"height",k);if(g.clientHeight<j.max_height){c.setStyle(l,"overflow","hidden")}}},showMenu:function(p,n,r){var z=this,A=z.settings,o,g=c.getViewPort(),u,l,v,q,i=2,k,j,m=z.classPrefix;z.collapse(1);if(z.isMenuVisible){return}if(!z.rendered){o=c.add(z.settings.container,z.renderNode());f(z.items,function(h){h.postRender()});z.element=new b("menu_"+z.id,{blocker:1,container:A.container})}else{o=c.get("menu_"+z.id)}if(!e.isOpera){c.setStyles(o,{left:-65535,top:-65535})}c.show(o);z.update();p+=A.offset_x||0;n+=A.offset_y||0;g.w-=4;g.h-=4;if(A.constrain){u=o.clientWidth-i;l=o.clientHeight-i;v=g.x+g.w;q=g.y+g.h;if((p+A.vp_offset_x+u)>v){p=r?r-u:Math.max(0,(v-A.vp_offset_x)-u)}if((n+A.vp_offset_y+l)>q){n=Math.max(0,(q-A.vp_offset_y)-l)}}c.setStyles(o,{left:p,top:n});z.element.update();z.isMenuVisible=1;z.mouseClickFunc=a.add(o,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,m+"ItemSub")){h=z.items[s.id];if(h.isDisabled()){return}k=z;while(k){if(k.hideMenu){k.hideMenu()}k=k.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return a.cancel(s)}});if(z.hasMenus()){z.mouseOverFunc=a.add(o,"mouseover",function(x){var h,t,s;x=x.target;if(x&&(x=c.getParent(x,"tr"))){h=z.items[x.id];if(z.lastMenu){z.lastMenu.collapse(1)}if(h.isDisabled()){return}if(x&&c.hasClass(x,m+"ItemSub")){t=c.getRect(x);h.showMenu((t.x+t.w-i),t.y-i,t.x);z.lastMenu=h;c.addClass(c.get(h.id).firstChild,m+"ItemActive")}}})}z.onShowMenu.dispatch(z);if(A.keyboard_focus){a.add(o,"keydown",z._keyHandler,z);c.select("a","menu_"+z.id)[0].focus();z._focusIdx=0}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}a.remove(i,"mouseover",g.mouseOverFunc);a.remove(i,"click",g.mouseClickFunc);a.remove(i,"keydown",g._keyHandler);c.hide(i);g.isMenuVisible=0;if(!j){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(i){var g=this,h;i=g.parent(i);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],i)}return i},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);a.remove(h,"mouseover",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var i=this,j=i.settings,l,h,k,g;g=c.create("div",{id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000"});k=c.add(g,"div",{id:"menu_"+i.id+"_co","class":i.classPrefix+(j["class"]?" "+j["class"]:"")});i.element=new b("menu_"+i.id,{blocker:1,container:j.container});if(j.menu_line){c.add(k,"span",{"class":i.classPrefix+"Line"})}l=c.add(k,"table",{id:"menu_"+i.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(l,"tbody");f(i.items,function(m){i._add(h,m)});i.rendered=true;return g},_keyHandler:function(j){var i=this,h=j.keyCode;function g(m){var k=i._focusIdx+m,l=c.select("a","menu_"+i.id)[k];if(l){i._focusIdx=k;l.focus()}}switch(h){case 38:g(-1);return;case 40:g(1);return;case 13:return;case 27:return this.hideMenu()}},_add:function(j,h){var i,q=h.settings,p,l,k,m=this.classPrefix,g;if(q.separator){l=c.add(j,"tr",{id:h.id,"class":m+"ItemSeparator"});c.add(l,"td",{"class":m+"ItemSeparator"});if(i=l.previousSibling){c.addClass(i,"mceLast")}return}i=l=c.add(j,"tr",{id:h.id,"class":m+"Item "+m+"ItemEnabled"});i=k=c.add(i,"td");i=p=c.add(i,"a",{href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});c.addClass(k,q["class"]);g=c.add(i,"span",{"class":"mceIcon"+(q.icon?" mce_"+q.icon:"")});if(q.icon_src){c.add(g,"img",{src:q.icon_src})}i=c.add(i,q.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){c.setAttrib(i,"style",h.settings.style)}if(j.childNodes.length==1){c.addClass(l,"mceFirst")}if((i=l.previousSibling)&&c.hasClass(i,m+"ItemSeparator")){c.addClass(l,"mceFirst")}if(h.collapse){c.addClass(l,m+"ItemSub")}if(i=l.previousSibling){c.removeClass(i,"mceLast")}c.addClass(l,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(d,c){this.parent(d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='<a id="'+this.id+'" href="javascript:;" class="'+f+" "+f+"Enabled "+e["class"]+(c?" "+f+"Labeled":"")+'" onmousedown="return false;" onclick="return false;" title="'+a.encode(e.title)+'">';if(e.image){d+='<img class="mceIcon" src="'+e.image+'" />'+c+"</a>"}else{d+='<span class="mceIcon '+e["class"]+'"></span>'+(c?'<span class="'+f+'Label">'+c+"</span>":"")+"</a>"}return d},postRender:function(){var c=this,d=c.settings;b.dom.Event.add(c.id,"click",function(f){if(!c.isDisabled()){return d.onclick.call(d.scope,f)}})}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(h,g){var f=this;f.parent(h,g);f.items=[];f.onChange=new a(f);f.onPostRender=new a(f);f.onAdd=new a(f);f.onRenderMenu=new d.util.Dispatcher(this);f.classPrefix="mceListBox"},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){var g=this,h,i;if(f!=g.selectedIndex){h=c.get(g.id+"_text");i=g.items[f];if(i){g.selectedValue=i.value;g.selectedIndex=f;c.setHTML(h,c.encode(i.title));c.removeClass(h,"mceTitle")}else{c.setHTML(h,c.encode(g.settings.title));c.addClass(h,"mceTitle");g.selectedValue=g.selectedIndex=null}h=0}},add:function(i,f,h){var g=this;h=h||{};h=d.extend(h,{title:i,value:f});g.items.push(h);g.onAdd.dispatch(g,h)},getLength:function(){return this.items.length},renderHTML:function(){var i="",f=this,g=f.settings,j=f.classPrefix;i='<table id="'+f.id+'" cellpadding="0" cellspacing="0" class="'+j+" "+j+"Enabled"+(g["class"]?(" "+g["class"]):"")+'"><tbody><tr>';i+="<td>"+c.createHTML("a",{id:f.id+"_text",href:"javascript:;","class":"mceText",onclick:"return false;",onmousedown:"return false;"},c.encode(f.settings.title))+"</td>";i+="<td>"+c.createHTML("a",{id:f.id+"_open",tabindex:-1,href:"javascript:;","class":"mceOpen",onclick:"return false;",onmousedown:"return false;"},"<span></span>")+"</td>";i+="</tr></tbody></table>";return i},showMenu:function(){var g=this,j,i,h=c.get(this.id),f;if(g.isDisabled()||g.items.length==0){return}if(g.menu&&g.menu.isMenuVisible){return g.hideMenu()}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}j=c.getPos(this.settings.menu_container);i=c.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.keyboard_focus=!d.isOpera;if(g.oldID){f.items[g.oldID].setSelected(0)}e(g.items,function(k){if(k.value===g.selectedValue){f.items[k.id].setSelected(1);g.oldID=k.id}});f.showMenu(0,h.clientHeight);b.add(c.doc,"mousedown",g.hideMenu,g);c.addClass(g.id,g.classPrefix+"Selected")},hideMenu:function(g){var f=this;if(f.menu&&f.menu.isMenuVisible){if(g&&g.type=="mousedown"&&(g.target.id==f.id+"_text"||g.target.id==f.id+"_open")){return}if(!g||!c.getParent(g.target,".mceMenu")){c.removeClass(f.id,f.classPrefix+"Selected");b.remove(c.doc,"mousedown",f.hideMenu,f);f.menu.hideMenu()}}},renderMenu:function(){var g=this,f;f=g.settings.control_manager.createDropMenu(g.id+"_menu",{menu_line:1,"class":g.classPrefix+"Menu mceNoIcons",max_width:150,max_height:150});f.onHideMenu.add(g.hideMenu,g);f.add({title:g.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}});e(g.items,function(h){if(h.value===undefined){f.add({title:h.title,"class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}})}else{h.id=c.uniqueId();h.onclick=function(){if(g.settings.onselect(h.value)!==false){g.select(h.value)}};f.add(h)}});g.onRenderMenu.dispatch(g,f);g.menu=f},postRender:function(){var f=this,g=f.classPrefix;b.add(f.id,"click",f.showMenu,f);b.add(f.id+"_text","focus",function(h){if(!f._focused){f.keyDownHandler=b.add(f.id+"_text","keydown",function(l){var i=-1,j,k=l.keyCode;e(f.items,function(m,n){if(f.selectedValue==m.value){i=n}});if(k==38){j=f.items[i-1]}else{if(k==40){j=f.items[i+1]}else{if(k==13){j=f.selectedValue;f.selectedValue=null;f.settings.onselect(j);return b.cancel(l)}}}if(j){f.hideMenu();f.select(j.value)}})}f._focused=1});b.add(f.id+"_text","blur",function(){b.remove(f.id+"_text","keydown",f.keyDownHandler);f._focused=0});if(d.isIE6||!c.boxModel){b.add(f.id,"mouseover",function(){if(!c.hasClass(f.id,g+"Disabled")){c.addClass(f.id,g+"Hover")}});b.add(f.id,"mouseout",function(){if(!c.hasClass(f.id,g+"Disabled")){c.removeClass(f.id,g+"Hover")}})}f.onPostRender.dispatch(f,c.get(f.id))},destroy:function(){this.parent();b.clear(this.id+"_text");b.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(g,f){this.parent(g,f);this.classPrefix="mceNativeListBox"},setDisabled:function(f){c.get(this.id).disabled=f},isDisabled:function(){return c.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){c.get(this.id).selectedIndex=f+1;this.selectedValue=this.items[f]?this.items[f].value:null},add:function(j,g,f){var i,h=this;f=f||{};f.value=g;if(h.isRendered()){c.add(c.get(this.id),"option",f,j)}i={title:j,value:g,attribs:f};h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return c.get(this.id).options.length-1},renderHTML:function(){var g,f=this;g=c.createHTML("option",{value:""},"-- "+f.settings.title+" --");e(f.items,function(h){g+=c.createHTML("option",{value:h.value},h.title)});g=c.createHTML("select",{id:f.id,"class":"mceNativeListBox"},g);return g},postRender:function(){var g=this,h;g.rendered=true;function f(j){var i=g.items[j.target.selectedIndex-1];if(i&&(i=i.value)){g.onChange.dispatch(g,i);if(g.settings.onselect){g.settings.onselect(i)}}}b.add(g.id,"change",f);b.add(g.id,"keydown",function(j){var i;b.remove(g.id,"change",h);i=b.add(g.id,"blur",function(){b.add(g.id,"change",f);b.remove(g.id,"blur",i)});if(j.keyCode==13||j.keyCode==32){f(j);return b.cancel(j)}});g.onPostRender.dispatch(g,c.get(g.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(f,e){this.parent(f,e);this.onRenderMenu=new c.util.Dispatcher(this);e.menu_container=e.menu_container||b.doc.body},showMenu:function(){var g=this,j,i,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}j=b.getPos(g.settings.menu_container);i=b.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.vp_offset_x=i.x;f.settings.vp_offset_y=i.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:f.settings.icons});e.onHideMenu.add(f.hideMenu,f);f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(f,e){this.parent(f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="<tbody><tr>";if(g.image){e=b.createHTML("img ",{src:g.image,"class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}i+="<td>"+b.createHTML("a",{id:f.id+"_action",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";e=b.createHTML("span",{"class":"mceOpen "+g["class"]});i+="<td>"+b.createHTML("a",{id:f.id+"_open",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";i+="</tr></tbody>";return b.createHTML("table",{id:f.id,"class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",onmousedown:"return false;",title:g.title},i)},postRender:function(){var e=this,f=e.settings;if(f.onclick){a.add(e.id+"_action","click",function(){if(!e.isDisabled()){f.onclick(e.value)}})}a.add(e.id+"_open","click",e.showMenu,e);a.add(e.id+"_open","focus",function(){e._focused=1});a.add(e.id+"_open","blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHover")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(h,g){var f=this;f.parent(h,g);f.settings=g=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},f.settings);f.onShowMenu=new d.util.Dispatcher(f);f.onHideMenu=new d.util.Dispatcher(f);f.value=g.default_color},showMenu:function(){var f=this,g,j,i,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=true}if(f.isMenuVisible){return f.hideMenu()}i=c.get(f.id);c.show(f.id+"_menu");c.addClass(i,"mceSplitButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.clientHeight,zIndex:200000});i=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(k){if(k.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.isMenuVisible=1},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.onHideMenu.dispatch(f);f.isMenuVisible=0},renderMenu:function(){var k=this,f,j=0,l=k.settings,p,h,o,g;g=c.add(l.menu_container,"div",{id:k.id+"_menu","class":l.menu_class+" "+l["class"],style:"position:absolute;left:0;top:-1000px;"});f=c.add(g,"div",{"class":l["class"]+" mceSplitButtonMenu"});c.add(f,"span",{"class":"mceMenuLine"});p=c.add(f,"table",{"class":"mceColorSplitMenu"});h=c.add(p,"tbody");j=0;e(b(l.colors,"array")?l.colors:l.colors.split(","),function(i){i=i.replace(/^#/,"");if(!j--){o=c.add(h,"tr");j=l.grid_width-1}p=c.add(o,"td");p=c.add(p,"a",{href:"javascript:;",style:{backgroundColor:"#"+i},_mce_color:"#"+i})});if(l.more_colors_func){p=c.add(h,"tr");p=c.add(p,"td",{colspan:l.grid_width,"class":"mceMoreColors"});p=c.add(p,"a",{id:k.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},l.more_colors_title);a.add(p,"click",function(i){l.more_colors_func.call(l.more_colors_scope||this);return a.cancel(i)})}c.addClass(f,"mceColorSplitMenu");a.add(k.id+"_menu","click",function(i){var m;i=i.target;if(i.nodeName=="A"&&(m=i.getAttribute("_mce_color"))){k.setColor(m)}return a.cancel(i)});return g},setColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=g;f.hideMenu();f.settings.onselect(g)},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){this.parent();a.clear(this.id+"_menu");a.clear(this.id+"_more");c.remove(this.id+"_menu")}})})(tinymce);tinymce.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var l=this,e="",g,j,b=tinymce.DOM,m=l.settings,d,a,f,k;k=l.controls;for(d=0;d<k.length;d++){j=k[d];a=k[d-1];f=k[d+1];if(d===0){g="mceToolbarStart";if(j.Button){g+=" mceToolbarStartButton"}else{if(j.SplitButton){g+=" mceToolbarStartSplitButton"}else{if(j.ListBox){g+=" mceToolbarStartListBox"}}}e+=b.createHTML("td",{"class":g},b.createHTML("span",null,"<!-- IE -->"))}if(a&&j.ListBox){if(a.Button||a.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarEnd"},b.createHTML("span",null,"<!-- IE -->"))}}if(b.stdMode){e+='<td style="position: relative">'+j.renderHTML()+"</td>"}else{e+="<td>"+j.renderHTML()+"</td>"}if(f&&j.ListBox){if(f.Button||f.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarStart"},b.createHTML("span",null,"<!-- IE -->"))}}}g="mceToolbarEnd";if(j.Button){g+=" mceToolbarEndButton"}else{if(j.SplitButton){g+=" mceToolbarEndSplitButton"}else{if(j.ListBox){g+=" mceToolbarEndListBox"}}}e+=b.createHTML("td",{"class":g},b.createHTML("span",null,"<!-- IE -->"));return b.createHTML("table",{id:l.id,"class":"mceToolbar"+(m["class"]?" "+m["class"]:""),cellpadding:"0",cellspacing:"0",align:l.settings.align||""},"<tbody><tr>"+e+"</tr></tbody>")}});(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{items:[],urls:{},lookup:{},onAdd:new a(this),get:function(d){return this.lookup[d]},requireLangPack:function(e){var d=b.settings;if(d&&d.language){b.ScriptLoader.add(this.urls[e]+"/langs/"+d.language+".js")}},add:function(e,d){this.items.push(d);this.lookup[e]=d;this.onAdd.dispatch(this,e,d);return d},load:function(h,e,d,g){var f=this;if(f.urls[h]){return}if(e.indexOf("/")!=0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}f.urls[h]=e.substring(0,e.lastIndexOf("/"));b.ScriptLoader.add(e,d,g)}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(j){var g=j.each,d=j.extend,k=j.DOM,i=j.dom.Event,f=j.ThemeManager,b=j.PluginManager,e=j.explode,h=j.util.Dispatcher,a,c=0;j.documentBaseURL=window.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(j.documentBaseURL)){j.documentBaseURL+="/"}j.baseURL=new j.util.URI(j.documentBaseURL).toAbsolute(j.baseURL);j.baseURI=new j.util.URI(j.baseURL);j.onBeforeUnload=new h(j);i.add(window,"beforeunload",function(l){j.onBeforeUnload.dispatch(j,l)});j.onAddEditor=new h(j);j.onRemoveEditor=new h(j);j.EditorManager=d(j,{editors:[],i18n:{},activeEditor:null,init:function(q){var n=this,p,l=j.ScriptLoader,u,o=[],m;function r(x,y,t){var v=x[y];if(!v){return}if(j.is(v,"string")){t=v.replace(/\.\w+$/,"");t=t?j.resolve(t):0;v=j.resolve(v)}return v.apply(t||this,Array.prototype.slice.call(arguments,2))}q=d({theme:"simple",language:"en"},q);n.settings=q;i.add(document,"init",function(){var s,v;r(q,"onpageload");switch(q.mode){case"exact":s=q.elements||"";if(s.length>0){g(e(s),function(x){if(k.get(x)){m=new j.Editor(x,q);o.push(m);m.render(1)}else{g(document.forms,function(y){g(y.elements,function(z){if(z.name===x){x="mce_editor_"+c++;k.setAttrib(z,"id",x);m=new j.Editor(x,q);o.push(m);m.render(1)}})})}})}break;case"textareas":case"specific_textareas":function t(y,x){return x.constructor===RegExp?x.test(y.className):k.hasClass(y,x)}g(k.select("textarea"),function(x){if(q.editor_deselector&&t(x,q.editor_deselector)){return}if(!q.editor_selector||t(x,q.editor_selector)){u=k.get(x.name);if(!x.id&&!u){x.id=x.name}if(!x.id||n.get(x.id)){x.id=k.uniqueId()}m=new j.Editor(x.id,q);o.push(m);m.render(1)}});break}if(q.oninit){s=v=0;g(o,function(x){v++;if(!x.initialized){x.onInit.add(function(){s++;if(s==v){r(q,"oninit")}})}else{s++}if(s==v){r(q,"oninit")}})}})},get:function(l){if(l===a){return this.editors}return this.editors[l]},getInstanceById:function(l){return this.get(l)},add:function(m){var l=this,n=l.editors;n[m.id]=m;n.push(m);l._setActive(m);l.onAddEditor.dispatch(l,m);return m},remove:function(n){var m=this,l,o=m.editors;if(!o[n.id]){return null}delete o[n.id];for(l=0;l<o.length;l++){if(o[l]==n){o.splice(l,1);break}}if(m.activeEditor==n){m._setActive(o[0])}n.destroy();m.onRemoveEditor.dispatch(m,n);return n},execCommand:function(r,p,o){var q=this,n=q.get(o),l;switch(r){case"mceFocus":n.focus();return true;case"mceAddEditor":case"mceAddControl":if(!q.get(o)){new j.Editor(o,q.settings).render()}return true;case"mceAddFrameControl":l=o.window;l.tinyMCE=tinyMCE;l.tinymce=j;j.DOM.doc=l.document;j.DOM.win=l;n=new j.Editor(o.element_id,o);n.render();if(j.isIE){function m(){n.destroy();l.detachEvent("onunload",m);l=l.tinyMCE=l.tinymce=null}l.attachEvent("onunload",m)}o.page_window=null;return true;case"mceRemoveEditor":case"mceRemoveControl":if(n){n.remove()}return true;case"mceToggleEditor":if(!n){q.execCommand("mceAddControl",0,o);return true}if(n.isHidden()){n.show()}else{n.hide()}return true}if(q.activeEditor){return q.activeEditor.execCommand(r,p,o)}return false},execInstanceCommand:function(p,o,n,m){var l=this.get(p);if(l){return l.execCommand(o,n,m)}return false},triggerSave:function(){g(this.editors,function(l){l.save()})},addI18n:function(n,q){var l,m=this.i18n;if(!j.is(n,"string")){g(n,function(r,p){g(r,function(t,s){g(t,function(v,u){if(s==="common"){m[p+"."+u]=v}else{m[p+"."+s+"."+u]=v}})})})}else{g(q,function(r,p){m[n+"."+p]=r})}},_setActive:function(l){this.selectedInstance=this.activeEditor=l}})})(tinymce);(function(m){var n=m.DOM,j=m.dom.Event,f=m.extend,k=m.util.Dispatcher,i=m.each,a=m.isGecko,b=m.isIE,e=m.isWebKit,d=m.is,h=m.ThemeManager,c=m.PluginManager,o=m.inArray,l=m.grep,g=m.explode;m.create("tinymce.Editor",{Editor:function(r,q){var p=this;p.id=p.editorId=r;p.execCommands={};p.queryStateCommands={};p.queryValueCommands={};p.isNotDirty=false;p.plugins={};i(["onPreInit","onBeforeRenderUI","onPostRender","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState"],function(s){p[s]=new k(p)});p.settings=q=f({id:r,language:"en",docs_language:"en",theme:"simple",skin:"default",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:m.documentBaseURL,add_form_submit_trigger:1,submit_patch:1,add_unload_trigger:1,convert_urls:1,relative_urls:1,remove_script_host:1,table_inline_editing:0,object_resizing:1,cleanup:1,accessibility_focus:1,custom_shortcuts:1,custom_undo_redo_keyboard_shortcuts:1,custom_undo_redo_restore_selection:1,custom_undo_redo:1,doctype:m.isIE6?'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">':"<!DOCTYPE>",visual_table_class:"mceItemTable",visual:1,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",apply_source_formatting:1,directionality:"ltr",forced_root_block:"p",valid_elements:"@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,#p,-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote[cite],-table[border|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value],embed[type|width|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value|tabindex|accesskey],kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],q[cite],samp,select[disabled|multiple|name|size],small,textarea[cols|rows|disabled|name|readonly],tt,var,big",hidden_input:1,padd_empty_editor:1,render_ui:1,init_theme:1,force_p_newlines:1,indentation:"30px",keep_styles:1,fix_table_elements:1,inline_styles:1,convert_fonts_to_spans:true},q);p.documentBaseURI=new m.util.URI(q.document_base_url||m.documentBaseURL,{base_uri:tinyMCE.baseURI});p.baseURI=m.baseURI;p.execCallback("setup",p)},render:function(r){var u=this,v=u.settings,x=u.id,p=m.ScriptLoader;if(!j.domLoaded){j.add(document,"init",function(){u.render()});return}tinyMCE.settings=v;if(!u.getElement()){return}if(!/TEXTAREA|INPUT/i.test(u.getElement().nodeName)&&v.hidden_input&&n.getParent(x,"form")){n.insertAfter(n.create("input",{type:"hidden",name:x}),x)}if(m.WindowManager){u.windowManager=new m.WindowManager(u)}if(v.encoding=="xml"){u.onGetContent.add(function(s,t){if(t.save){t.content=n.encode(t.content)}})}if(v.add_form_submit_trigger){u.onSubmit.addToTop(function(){if(u.initialized){u.save();u.isNotDirty=1}})}if(v.add_unload_trigger){u._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(u.initialized&&!u.destroyed&&!u.isHidden()){u.save({format:"raw",no_events:true})}})}m.addUnload(u.destroy,u);if(v.submit_patch){u.onBeforeRenderUI.add(function(){var s=u.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){u.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){m.triggerSave();u.isNotDirty=1;return u.formElement._mceOldSubmit(u.formElement)}}s=null})}function q(){if(v.language){p.add(m.baseURL+"/langs/"+v.language+".js")}if(v.theme&&v.theme.charAt(0)!="-"&&!h.urls[v.theme]){h.load(v.theme,"themes/"+v.theme+"/editor_template"+m.suffix+".js")}i(g(v.plugins),function(s){if(s&&s.charAt(0)!="-"&&!c.urls[s]){if(s=="safari"){return}c.load(s,"plugins/"+s+"/editor_plugin"+m.suffix+".js")}});p.loadQueue(function(){if(!u.removed){u.init()}})}q()},init:function(){var r,E=this,F=E.settings,B,y,A=E.getElement(),q,p,C,x,z,D;m.add(E);if(F.theme){F.theme=F.theme.replace(/-/,"");q=h.get(F.theme);E.theme=new q();if(E.theme.init&&F.init_theme){E.theme.init(E,h.urls[F.theme]||m.documentBaseURL.replace(/\/$/,""))}}i(g(F.plugins.replace(/\-/g,"")),function(G){var H=c.get(G),t=c.urls[G]||m.documentBaseURL.replace(/\/$/,""),s;if(H){s=new H(E,t);E.plugins[G]=s;if(s.init){s.init(E,t)}}});if(F.popup_css!==false){if(F.popup_css){F.popup_css=E.documentBaseURI.toAbsolute(F.popup_css)}else{F.popup_css=E.baseURI.toAbsolute("themes/"+F.theme+"/skins/"+F.skin+"/dialog.css")}}if(F.popup_css_add){F.popup_css+=","+E.documentBaseURI.toAbsolute(F.popup_css_add)}E.controlManager=new m.ControlManager(E);if(F.custom_undo_redo){E.onBeforeExecCommand.add(function(t,G,u,H,s){if(G!="Undo"&&G!="Redo"&&G!="mceRepaint"&&(!s||!s.skip_undo)){if(!E.undoManager.hasUndo()){E.undoManager.add()}}});E.onExecCommand.add(function(t,G,u,H,s){if(G!="Undo"&&G!="Redo"&&G!="mceRepaint"&&(!s||!s.skip_undo)){E.undoManager.add()}})}E.onExecCommand.add(function(s,t){if(!/^(FontName|FontSize)$/.test(t)){E.nodeChanged()}});if(a){function v(s,t){if(!t||!t.initial){E.execCommand("mceRepaint")}}E.onUndo.add(v);E.onRedo.add(v);E.onSetContent.add(v)}E.onBeforeRenderUI.dispatch(E,E.controlManager);if(F.render_ui){B=F.width||A.style.width||A.offsetWidth;y=F.height||A.style.height||A.offsetHeight;E.orgDisplay=A.style.display;D=/^[0-9\.]+(|px)$/i;if(D.test(""+B)){B=Math.max(parseInt(B)+(q.deltaWidth||0),100)}if(D.test(""+y)){y=Math.max(parseInt(y)+(q.deltaHeight||0),100)}q=E.theme.renderUI({targetNode:A,width:B,height:y,deltaWidth:F.delta_width,deltaHeight:F.delta_height});E.editorContainer=q.editorContainer}if(document.domain&&location.hostname!=document.domain){m.relaxedDomain=document.domain}n.setStyles(q.sizeContainer||q.editorContainer,{width:B,height:y});y=(q.iframeHeight||y)+(typeof(y)=="number"?(q.deltaHeight||0):"");if(y<100){y=100}E.iframeHTML=F.doctype+'<html><head xmlns="http://www.w3.org/1999/xhtml">';if(F.document_base_url!=m.documentBaseURL){E.iframeHTML+='<base href="'+E.documentBaseURI.getURI()+'" />'}E.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=7" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';if(m.relaxedDomain){E.iframeHTML+='<script type="text/javascript">document.domain = "'+m.relaxedDomain+'";<\/script>'}x=F.body_id||"tinymce";if(x.indexOf("=")!=-1){x=E.getParam("body_id","","hash");x=x[E.id]||x}z=F.body_class||"";if(z.indexOf("=")!=-1){z=E.getParam("body_class","","hash");z=z[E.id]||""}E.iframeHTML+='</head><body id="'+x+'" class="mceContentBody '+z+'"></body></html>';if(m.relaxedDomain){if(b||(m.isOpera&&parseFloat(opera.version())>=9.5)){C='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+E.id+'");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'}else{if(m.isOpera){C='javascript:(function(){document.open();document.domain="'+document.domain+'";document.close();ed.setupIframe();})()'}}}r=n.add(q.iframeContainer,"iframe",{id:E.id+"_ifr",src:C||'javascript:""',frameBorder:"0",style:{width:"100%",height:y}});E.contentAreaContainer=q.iframeContainer;n.get(q.editorContainer).style.display=E.orgDisplay;n.get(E.id).style.display="none";if(!b||!m.relaxedDomain){E.setupIframe()}A=r=q=null},setupIframe:function(){var z=this,A=z.settings,r=n.get(z.id),u=z.getDoc(),q,x;if(!b||!m.relaxedDomain){u.open();u.write(z.iframeHTML);u.close()}if(!b){try{if(!A.readonly){u.designMode="On"}}catch(v){}}if(b){x=z.getBody();n.hide(x);if(!A.readonly){x.contentEditable=true}n.show(x)}z.dom=new m.dom.DOMUtils(z.getDoc(),{keep_values:true,url_converter:z.convertURL,url_converter_scope:z,hex_colors:A.force_hex_style_colors,class_filter:A.class_filter,update_styles:1,fix_ie_paragraphs:1,valid_styles:A.valid_styles});z.schema=new m.dom.Schema();z.serializer=new m.dom.Serializer(f(A,{valid_elements:A.verify_html===false?"*[*]":A.valid_elements,dom:z.dom,schema:z.schema}));z.selection=new m.dom.Selection(z.dom,z.getWin(),z.serializer);z.formatter=new m.Formatter(this);z.formatter.register({alignleft:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"left"}},{selector:"img,table",styles:{"float":"left"}}],aligncenter:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"center"}},{selector:"img",styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"right"}},{selector:"img,table",styles:{"float":"right"}}],alignfull:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"justify"}}],bold:[{inline:"strong"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b"}],italic:[{inline:"em"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:true},{inline:"u"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:true},{inline:"u"}],forecolor:{inline:"span",styles:{color:"%value"}},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"}},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},blockquote:{block:"blockquote",wrapper:1},removeformat:[{selector:"b,strong,em,i,font,u,strike",remove:"all",split:true,expand:false,block_expand:true,deep:true},{selector:"span",attributes:["style","class"],remove:"empty",split:true,expand:false,deep:true},{selector:"*",attributes:["style","class"],expand:false,deep:true}]});i("p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp".split(/\s/),function(s){z.formatter.register(s,{block:s})});z.formatter.register(z.settings.formats);z.undoManager=new m.UndoManager(z);z.undoManager.onAdd.add(function(t,s){if(!s.initial){return z.onChange.dispatch(z,s,t)}});z.undoManager.onUndo.add(function(t,s){return z.onUndo.dispatch(z,s,t)});z.undoManager.onRedo.add(function(t,s){return z.onRedo.dispatch(z,s,t)});z.forceBlocks=new m.ForceBlocks(z,{forced_root_block:A.forced_root_block});z.editorCommands=new m.EditorCommands(z);z.serializer.onPreProcess.add(function(s,t){return z.onPreProcess.dispatch(z,t,s)});z.serializer.onPostProcess.add(function(s,t){return z.onPostProcess.dispatch(z,t,s)});z.onPreInit.dispatch(z);if(!A.gecko_spellcheck){z.getBody().spellcheck=0}if(!A.readonly){z._addEvents()}z.controlManager.onPostRender.dispatch(z,z.controlManager);z.onPostRender.dispatch(z);if(A.directionality){z.getBody().dir=A.directionality}if(A.nowrap){z.getBody().style.whiteSpace="nowrap"}if(A.custom_elements){function y(s,t){i(g(A.custom_elements),function(B){var C;if(B.indexOf("~")===0){B=B.substring(1);C="span"}else{C="div"}t.content=t.content.replace(new RegExp("<("+B+")([^>]*)>","g"),"<"+C+' _mce_name="$1"$2>');t.content=t.content.replace(new RegExp("</("+B+")>","g"),"</"+C+">")})}z.onBeforeSetContent.add(y);z.onPostProcess.add(function(s,t){if(t.set){y(s,t)}})}if(A.handle_node_change_callback){z.onNodeChange.add(function(t,s,B){z.execCallback("handle_node_change_callback",z.id,B,-1,-1,true,z.selection.isCollapsed())})}if(A.save_callback){z.onSaveContent.add(function(s,B){var t=z.execCallback("save_callback",z.id,B.content,z.getBody());if(t){B.content=t}})}if(A.onchange_callback){z.onChange.add(function(t,s){z.execCallback("onchange_callback",z,s)})}if(A.convert_newlines_to_brs){z.onBeforeSetContent.add(function(s,t){if(t.initial){t.content=t.content.replace(/\r?\n/g,"<br />")}})}if(A.fix_nesting&&b){z.onBeforeSetContent.add(function(s,t){t.content=z._fixNesting(t.content)})}if(A.preformatted){z.onPostProcess.add(function(s,t){t.content=t.content.replace(/^\s*<pre.*?>/,"");t.content=t.content.replace(/<\/pre>\s*$/,"");if(t.set){t.content='<pre class="mceItemHidden">'+t.content+"</pre>"}})}if(A.verify_css_classes){z.serializer.attribValueFilter=function(D,B){var C,t;if(D=="class"){if(!z.classesRE){t=z.dom.getClasses();if(t.length>0){C="";i(t,function(s){C+=(C?"|":"")+s["class"]});z.classesRE=new RegExp("("+C+")","gi")}}return !z.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(B)||z.classesRE.test(B)?B:""}return B}}if(A.cleanup_callback){z.onBeforeSetContent.add(function(s,t){t.content=z.execCallback("cleanup_callback","insert_to_editor",t.content,t)});z.onPreProcess.add(function(s,t){if(t.set){z.execCallback("cleanup_callback","insert_to_editor_dom",t.node,t)}if(t.get){z.execCallback("cleanup_callback","get_from_editor_dom",t.node,t)}});z.onPostProcess.add(function(s,t){if(t.set){t.content=z.execCallback("cleanup_callback","insert_to_editor",t.content,t)}if(t.get){t.content=z.execCallback("cleanup_callback","get_from_editor",t.content,t)}})}if(A.save_callback){z.onGetContent.add(function(s,t){if(t.save){t.content=z.execCallback("save_callback",z.id,t.content,z.getBody())}})}if(A.handle_event_callback){z.onEvent.add(function(s,t,B){if(z.execCallback("handle_event_callback",t,s,B)===false){j.cancel(t)}})}z.onSetContent.add(function(){z.addVisual(z.getBody())});if(A.padd_empty_editor){z.onPostProcess.add(function(s,t){t.content=t.content.replace(/^(<p[^>]*>(&nbsp;|&#160;|\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")})}if(a){function p(s,t){i(s.dom.select("a"),function(C){var B=C.parentNode;if(s.dom.isBlock(B)&&B.lastChild===C){s.dom.add(B,"br",{_mce_bogus:1})}})}z.onExecCommand.add(function(s,t){if(t==="CreateLink"){p(s)}});z.onSetContent.add(z.selection.onSetContent.add(p));if(!A.readonly){try{u.designMode="Off";u.designMode="On"}catch(v){}}}setTimeout(function(){if(z.removed){return}z.load({initial:true,format:(A.cleanup_on_startup?"html":"raw")});z.startContent=z.getContent({format:"raw"});z.initialized=true;z.onInit.dispatch(z);z.execCallback("setupcontent_callback",z.id,z.getBody(),z.getDoc());z.execCallback("init_instance_callback",z);z.focus(true);z.nodeChanged({initial:1});if(A.content_css){m.each(g(A.content_css),function(s){z.dom.loadCSS(z.documentBaseURI.toAbsolute(s))})}if(A.auto_focus){setTimeout(function(){var s=m.get(A.auto_focus);s.selection.select(s.getBody(),1);s.selection.collapse(1);s.getWin().focus()},100)}},1);r=null},focus:function(q){var s,p=this,r=p.settings.content_editable;if(!q){if(!r&&(!b||p.selection.getNode().ownerDocument!=p.getDoc())){p.getWin().focus()}}if(m.activeEditor!=p){if((s=m.activeEditor)!=null){s.onDeactivate.dispatch(s,p)}p.onActivate.dispatch(p,s)}m._setActive(p)},execCallback:function(u){var p=this,r=p.settings[u],q;if(!r){return}if(p.callbackLookup&&(q=p.callbackLookup[u])){r=q.func;q=q.scope}if(d(r,"string")){q=r.replace(/\.\w+$/,"");q=q?m.resolve(q):0;r=m.resolve(r);p.callbackLookup=p.callbackLookup||{};p.callbackLookup[u]={func:r,scope:q}}return r.apply(q||p,Array.prototype.slice.call(arguments,1))},translate:function(p){var r=this.settings.language||"en",q=m.i18n;if(!p){return""}return q[r+"."+p]||p.replace(/{\#([^}]+)\}/g,function(t,s){return q[r+"."+s]||"{#"+s+"}"})},getLang:function(q,p){return m.i18n[(this.settings.language||"en")+"."+q]||(d(p)?p:"{#"+q+"}")},getParam:function(u,r,p){var s=m.trim,q=d(this.settings[u])?this.settings[u]:r,t;if(p==="hash"){t={};if(d(q,"string")){i(q.indexOf("=")>0?q.split(/[;,](?![^=;,]*(?:[;,]|$))/):q.split(","),function(x){x=x.split("=");if(x.length>1){t[s(x[0])]=s(x[1])}else{t[s(x[0])]=s(x)}})}else{t=q}return t}return q},nodeChanged:function(r){var p=this,q=p.selection,u=q.getNode()||p.getBody();if(p.initialized){r=r||{};u=b&&u.ownerDocument!=p.getDoc()?p.getBody():u;r.parents=[];p.dom.getParent(u,function(s){if(s.nodeName=="BODY"){return true}r.parents.push(s)});p.onNodeChange.dispatch(p,r?r.controlManager||p.controlManager:p.controlManager,u,q.isCollapsed(),r)}},addButton:function(r,q){var p=this;p.buttons=p.buttons||{};p.buttons[r]=q},addCommand:function(r,q,p){this.execCommands[r]={func:q,scope:p||this}},addQueryStateHandler:function(r,q,p){this.queryStateCommands[r]={func:q,scope:p||this}},addQueryValueHandler:function(r,q,p){this.queryValueCommands[r]={func:q,scope:p||this}},addShortcut:function(r,u,p,s){var q=this,v;if(!q.settings.custom_shortcuts){return false}q.shortcuts=q.shortcuts||{};if(d(p,"string")){v=p;p=function(){q.execCommand(v,false,null)}}if(d(p,"object")){v=p;p=function(){q.execCommand(v[0],v[1],v[2])}}i(g(r),function(t){var x={func:p,scope:s||this,desc:u,alt:false,ctrl:false,shift:false};i(g(t,"+"),function(y){switch(y){case"alt":case"ctrl":case"shift":x[y]=true;break;default:x.charCode=y.charCodeAt(0);x.keyCode=y.toUpperCase().charCodeAt(0)}});q.shortcuts[(x.ctrl?"ctrl":"")+","+(x.alt?"alt":"")+","+(x.shift?"shift":"")+","+x.keyCode]=x});return true},execCommand:function(x,v,z,p){var r=this,u=0,y,q;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(x)&&(!p||!p.skip_focus)){r.focus()}y={};r.onBeforeExecCommand.dispatch(r,x,v,z,y);if(y.terminate){return false}if(r.execCallback("execcommand_callback",r.id,r.selection.getNode(),x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}if(y=r.execCommands[x]){q=y.func.call(y.scope,v,z);if(q!==true){r.onExecCommand.dispatch(r,x,v,z,p);return q}}i(r.plugins,function(s){if(s.execCommand&&s.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);u=1;return false}});if(u){return true}if(r.theme&&r.theme.execCommand&&r.theme.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}if(m.GlobalCommands.execCommand(r,x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}if(r.editorCommands.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}r.getDoc().execCommand(x,v,z);r.onExecCommand.dispatch(r,x,v,z,p)},queryCommandState:function(u){var q=this,v,r;if(q._isHidden()){return}if(v=q.queryStateCommands[u]){r=v.func.call(v.scope);if(r!==true){return r}}v=q.editorCommands.queryCommandState(u);if(v!==-1){return v}try{return this.getDoc().queryCommandState(u)}catch(p){}},queryCommandValue:function(v){var q=this,u,r;if(q._isHidden()){return}if(u=q.queryValueCommands[v]){r=u.func.call(u.scope);if(r!==true){return r}}u=q.editorCommands.queryCommandValue(v);if(d(u)){return u}try{return this.getDoc().queryCommandValue(v)}catch(p){}},show:function(){var p=this;n.show(p.getContainer());n.hide(p.id);p.load()},hide:function(){var p=this,q=p.getDoc();if(b&&q){q.execCommand("SelectAll")}p.save();n.hide(p.getContainer());n.setStyle(p.id,"display",p.orgDisplay)},isHidden:function(){return !n.isHidden(this.id)},setProgressState:function(p,q,r){this.onSetProgressState.dispatch(this,p,q,r);return p},load:function(s){var p=this,r=p.getElement(),q;if(r){s=s||{};s.load=true;q=p.setContent(d(r.value)?r.value:r.innerHTML,s);s.element=r;if(!s.no_events){p.onLoadContent.dispatch(p,s)}s.element=r=null;return q}},save:function(u){var p=this,s=p.getElement(),q,r;if(!s||!p.initialized){return}u=u||{};u.save=true;if(!u.no_events){p.undoManager.typing=0;p.undoManager.add()}u.element=s;q=u.content=p.getContent(u);if(!u.no_events){p.onSaveContent.dispatch(p,u)}q=u.content;if(!/TEXTAREA|INPUT/i.test(s.nodeName)){s.innerHTML=q;if(r=n.getParent(p.id,"form")){i(r.elements,function(t){if(t.name==p.id){t.value=q;return false}})}}else{s.value=q}u.element=s=null;return q},setContent:function(q,r){var p=this;r=r||{};r.format=r.format||"html";r.set=true;r.content=q;if(!r.no_events){p.onBeforeSetContent.dispatch(p,r)}if(!m.isIE&&(q.length===0||/^\s+$/.test(q))){r.content=p.dom.setHTML(p.getBody(),'<br _mce_bogus="1" />');r.format="raw"}r.content=p.dom.setHTML(p.getBody(),m.trim(r.content));if(r.format!="raw"&&p.settings.cleanup){r.getInner=true;r.content=p.dom.setHTML(p.getBody(),p.serializer.serialize(p.getBody(),r))}if(!r.no_events){p.onSetContent.dispatch(p,r)}return r.content},getContent:function(r){var p=this,q;r=r||{};r.format=r.format||"html";r.get=true;if(!r.no_events){p.onBeforeGetContent.dispatch(p,r)}if(r.format!="raw"&&p.settings.cleanup){r.getInner=true;q=p.serializer.serialize(p.getBody(),r)}else{q=p.getBody().innerHTML}q=q.replace(/^\s*|\s*$/g,"");r.content=q;if(!r.no_events){p.onGetContent.dispatch(p,r)}return r.content},isDirty:function(){var p=this;return m.trim(p.startContent)!=m.trim(p.getContent({format:"raw",no_events:1}))&&!p.isNotDirty},getContainer:function(){var p=this;if(!p.container){p.container=n.get(p.editorContainer||p.id+"_parent")}return p.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return n.get(this.settings.content_element||this.id)},getWin:function(){var p=this,q;if(!p.contentWindow){q=n.get(p.id+"_ifr");if(q){p.contentWindow=q.contentWindow}}return p.contentWindow},getDoc:function(){var q=this,p;if(!q.contentDocument){p=q.getWin();if(p){q.contentDocument=p.document}}return q.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(p,x,v){var q=this,r=q.settings;if(r.urlconverter_callback){return q.execCallback("urlconverter_callback",p,v,true,x)}if(!r.convert_urls||(v&&v.nodeName=="LINK")||p.indexOf("file:")===0){return p}if(r.relative_urls){return q.documentBaseURI.toRelative(p)}p=q.documentBaseURI.toAbsolute(p,r.remove_script_host);return p},addVisual:function(r){var p=this,q=p.settings;r=r||p.getBody();if(!d(p.hasVisual)){p.hasVisual=q.visual}i(p.dom.select("table,a",r),function(t){var s;switch(t.nodeName){case"TABLE":s=p.dom.getAttrib(t,"border");if(!s||s=="0"){if(p.hasVisual){p.dom.addClass(t,q.visual_table_class)}else{p.dom.removeClass(t,q.visual_table_class)}}return;case"A":s=p.dom.getAttrib(t,"name");if(s){if(p.hasVisual){p.dom.addClass(t,"mceItemAnchor")}else{p.dom.removeClass(t,"mceItemAnchor")}}return}});p.onVisualAid.dispatch(p,r,p.hasVisual)},remove:function(){var p=this,q=p.getContainer();p.removed=1;p.hide();p.execCallback("remove_instance_callback",p);p.onRemove.dispatch(p);p.onExecCommand.listeners=[];m.remove(p);n.remove(q)},destroy:function(q){var p=this;if(p.destroyed){return}if(!q){m.removeUnload(p.destroy);tinyMCE.onBeforeUnload.remove(p._beforeUnload);if(p.theme&&p.theme.destroy){p.theme.destroy()}p.controlManager.destroy();p.selection.destroy();p.dom.destroy();if(!p.settings.content_editable){j.clear(p.getWin());j.clear(p.getDoc())}j.clear(p.getBody());j.clear(p.formElement)}if(p.formElement){p.formElement.submit=p.formElement._mceOldSubmit;p.formElement._mceOldSubmit=null}p.contentAreaContainer=p.formElement=p.container=p.settings.content_element=p.bodyElement=p.contentDocument=p.contentWindow=null;if(p.selection){p.selection=p.selection.win=p.selection.dom=p.selection.dom.doc=null}p.destroyed=1},_addEvents:function(){var v=this,u,y=v.settings,x={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function r(t,A){var s=t.type;if(v.removed){return}if(v.onEvent.dispatch(v,t,A)!==false){v[x[t.fakeType||t.type]].dispatch(v,t,A)}}i(x,function(t,s){switch(s){case"contextmenu":if(m.isOpera){v.dom.bind(v.getBody(),"mousedown",function(A){if(A.ctrlKey){A.fakeType="contextmenu";r(A)}})}else{v.dom.bind(v.getBody(),s,r)}break;case"paste":v.dom.bind(v.getBody(),s,function(A){r(A)});break;case"submit":case"reset":v.dom.bind(v.getElement().form||n.getParent(v.id,"form"),s,r);break;default:v.dom.bind(y.content_editable?v.getBody():v.getDoc(),s,r)}});v.dom.bind(y.content_editable?v.getBody():(a?v.getDoc():v.getWin()),"focus",function(s){v.focus(true)});if(m.isGecko){v.dom.bind(v.getDoc(),"DOMNodeInserted",function(t){var s;t=t.target;if(t.nodeType===1&&t.nodeName==="IMG"&&(s=t.getAttribute("_mce_src"))){t.src=v.documentBaseURI.toAbsolute(s)}})}if(a){function p(){var B=this,D=B.getDoc(),C=B.settings;if(a&&!C.readonly){if(B._isHidden()){try{if(!C.content_editable){D.designMode="On"}}catch(A){}}try{D.execCommand("styleWithCSS",0,false)}catch(A){if(!B._isHidden()){try{D.execCommand("useCSS",0,true)}catch(A){}}}if(!C.table_inline_editing){try{D.execCommand("enableInlineTableEditing",false,false)}catch(A){}}if(!C.object_resizing){try{D.execCommand("enableObjectResizing",false,false)}catch(A){}}}}v.onBeforeExecCommand.add(p);v.onMouseDown.add(p)}if(m.isWebKit){v.onClick.add(function(s,t){t=t.target;if(t.nodeName=="IMG"||(t.nodeName=="A"&&v.dom.hasClass(t,"mceItemAnchor"))){v.selection.getSel().setBaseAndExtent(t,0,t,1)}})}v.onMouseUp.add(v.nodeChanged);v.onClick.add(v.nodeChanged);v.onKeyUp.add(function(s,t){var A=t.keyCode;if((A>=33&&A<=36)||(A>=37&&A<=40)||A==13||A==45||A==46||A==8||(m.isMac&&(A==91||A==93))||t.ctrlKey){v.nodeChanged()}});v.onReset.add(function(){v.setContent(v.startContent,{format:"raw"})});if(y.custom_shortcuts){if(y.custom_undo_redo_keyboard_shortcuts){v.addShortcut("ctrl+z",v.getLang("undo_desc"),"Undo");v.addShortcut("ctrl+y",v.getLang("redo_desc"),"Redo")}if(a){v.addShortcut("ctrl+b",v.getLang("bold_desc"),"Bold");v.addShortcut("ctrl+i",v.getLang("italic_desc"),"Italic");v.addShortcut("ctrl+u",v.getLang("underline_desc"),"Underline")}for(u=1;u<=6;u++){v.addShortcut("ctrl+"+u,"",["FormatBlock",false,"h"+u])}v.addShortcut("ctrl+7","",["FormatBlock",false,"<p>"]);v.addShortcut("ctrl+8","",["FormatBlock",false,"<div>"]);v.addShortcut("ctrl+9","",["FormatBlock",false,"<address>"]);function z(t){var s=null;if(!t.altKey&&!t.ctrlKey&&!t.metaKey){return s}i(v.shortcuts,function(A){if(m.isMac&&A.ctrl!=t.metaKey){return}else{if(!m.isMac&&A.ctrl!=t.ctrlKey){return}}if(A.alt!=t.altKey){return}if(A.shift!=t.shiftKey){return}if(t.keyCode==A.keyCode||(t.charCode&&t.charCode==A.charCode)){s=A;return false}});return s}v.onKeyUp.add(function(s,t){var A=z(t);if(A){return j.cancel(t)}});v.onKeyPress.add(function(s,t){var A=z(t);if(A){return j.cancel(t)}});v.onKeyDown.add(function(s,t){var A=z(t);if(A){A.func.call(A.scope);return j.cancel(t)}})}if(m.isIE){v.dom.bind(v.getDoc(),"controlselect",function(A){var t=v.resizeInfo,s;A=A.target;if(A.nodeName!=="IMG"){return}if(t){v.dom.unbind(t.node,t.ev,t.cb)}if(!v.dom.hasClass(A,"mceItemNoResize")){ev="resizeend";s=v.dom.bind(A,ev,function(C){var B;C=C.target;if(B=v.dom.getStyle(C,"width")){v.dom.setAttrib(C,"width",B.replace(/[^0-9%]+/g,""));v.dom.setStyle(C,"width","")}if(B=v.dom.getStyle(C,"height")){v.dom.setAttrib(C,"height",B.replace(/[^0-9%]+/g,""));v.dom.setStyle(C,"height","")}})}else{ev="resizestart";s=v.dom.bind(A,"resizestart",j.cancel,j)}t=v.resizeInfo={node:A,ev:ev,cb:s}});v.onKeyDown.add(function(s,t){switch(t.keyCode){case 8:if(v.selection.getRng().item){s.dom.remove(v.selection.getRng().item(0));return j.cancel(t)}}})}if(m.isOpera){v.onClick.add(function(s,t){j.prevent(t)})}if(y.custom_undo_redo){function q(){v.undoManager.typing=0;v.undoManager.add()}v.dom.bind(v.getDoc(),"focusout",function(s){if(!v.removed&&v.undoManager.typing){q()}});v.onKeyUp.add(function(s,t){if((t.keyCode>=33&&t.keyCode<=36)||(t.keyCode>=37&&t.keyCode<=40)||t.keyCode==13||t.keyCode==45||t.ctrlKey){q()}});v.onKeyDown.add(function(s,t){if((t.keyCode>=33&&t.keyCode<=36)||(t.keyCode>=37&&t.keyCode<=40)||t.keyCode==13||t.keyCode==45){if(v.undoManager.typing){q()}return}if(!v.undoManager.typing){v.undoManager.add();v.undoManager.typing=1}});v.onMouseDown.add(function(){if(v.undoManager.typing){q()}})}},_isHidden:function(){var p;if(!a){return 0}p=this.selection.getSel();return(!p||!p.rangeCount||p.rangeCount==0)},_fixNesting:function(q){var r=[],p;q=q.replace(/<(\/)?([^\s>]+)[^>]*?>/g,function(t,s,v){var u;if(s==="/"){if(!r.length){return""}if(v!==r[r.length-1].tag){for(p=r.length-1;p>=0;p--){if(r[p].tag===v){r[p].close=1;break}}return""}else{r.pop();if(r.length&&r[r.length-1].close){t=t+"</"+r[r.length-1].tag+">";r.pop()}}}else{if(/^(br|hr|input|meta|img|link|param)$/i.test(v)){return t}if(/\/>$/.test(t)){return t}r.push({tag:v})}return t});for(p=r.length-1;p>=0;p--){q+="</"+r[p].tag+">"}return q}})})(tinymce);(function(c){var d=c.each,e,a=true,b=false;c.EditorCommands=function(n){var l=n.dom,p=n.selection,j={state:{},exec:{},value:{}},k=n.settings,o;function q(y,x,v){var u;y=y.toLowerCase();if(u=j.exec[y]){u(y,x,v);return a}return b}function m(v){var u;v=v.toLowerCase();if(u=j.state[v]){return u(v)}return -1}function h(v){var u;v=v.toLowerCase();if(u=j.value[v]){return u(v)}return b}function t(u,v){v=v||"exec";d(u,function(y,x){d(x.toLowerCase().split(","),function(z){j[v][z]=y})})}c.extend(this,{execCommand:q,queryCommandState:m,queryCommandValue:h,addCommands:t});function f(x,v,u){if(v===e){v=b}if(u===e){u=null}return n.getDoc().execCommand(x,v,u)}function s(u){return n.formatter.match(u)}function r(u,v){n.formatter.toggle(u,v?{value:v}:e)}function i(u){o=p.getBookmark(u)}function g(){p.moveToBookmark(o)}t({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(y){var x=n.getDoc(),u;try{f(y)}catch(v){u=a}if(u||!x.queryCommandEnabled(y)){if(c.isGecko){n.windowManager.confirm(n.getLang("clipboard_msg"),function(z){if(z){open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","_blank")}})}else{n.windowManager.alert(n.getLang("clipboard_no_support"))}}},unlink:function(u){if(p.isCollapsed()){p.select(p.getNode())}f(u);p.collapse(b)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(u){var v=u.substring(7);d("left,center,right,full".split(","),function(x){if(v!=x){n.formatter.remove("align"+x)}});r("align"+v)},"InsertUnorderedList,InsertOrderedList":function(x){var u,v;f(x);u=l.getParent(p.getNode(),"ol,ul");if(u){v=u.parentNode;if(/^(H[1-6]|P|ADDRESS|PRE)$/.test(v.nodeName)){i();l.split(v,u);g()}}},"Bold,Italic,Underline,Strikethrough":function(u){r(u)},"ForeColor,HiliteColor,FontName":function(x,v,u){r(x,u)},FontSize:function(y,x,v){var u,z;if(v>=1&&v<=7){z=c.explode(k.font_size_style_values);u=c.explode(k.font_size_classes);if(u){v=u[v-1]||v}else{v=z[v-1]||v}}r(y,v)},RemoveFormat:function(u){n.formatter.remove(u)},mceBlockQuote:function(u){r("blockquote")},FormatBlock:function(x,v,u){return r(u)},mceCleanup:function(){i();n.setContent(n.getContent({cleanup:a}),{cleanup:a});g()},mceRemoveNode:function(y,x,v){var u=v||p.getNode();if(u!=ed.getBody()){i();n.dom.remove(u,a);g()}},mceSelectNodeDepth:function(y,x,v){var u=0;l.getParent(p.getNode(),function(z){if(z.nodeType==1&&u++==v){p.select(z);return b}},n.getBody())},mceSelectNode:function(x,v,u){p.select(u)},mceInsertContent:function(x,v,u){p.setContent(u)},mceInsertRawHTML:function(x,v,u){p.setContent("tiny_mce_marker");n.setContent(n.getContent().replace(/tiny_mce_marker/g,u))},mceSetContent:function(x,v,u){n.setContent(u)},"Indent,Outdent":function(y){var v,u,x;v=k.indentation;u=/[a-z%]+$/i.exec(v);v=parseInt(v);if(!m("InsertUnorderedList")&&!m("InsertOrderedList")){d(p.getSelectedBlocks(),function(z){if(y=="outdent"){x=Math.max(0,parseInt(z.style.paddingLeft||0)-v);l.setStyle(z,"paddingLeft",x?x+u:"")}else{l.setStyle(z,"paddingLeft",(parseInt(z.style.paddingLeft||0)+v)+u)}})}else{f(y)}},mceRepaint:function(){var v;if(c.isGecko){try{i(a);if(p.getSel()){p.getSel().selectAllChildren(n.getBody())}p.collapse(a);g()}catch(u){}}},InsertHorizontalRule:function(){p.setContent("<hr />")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual;n.addVisual()},mceReplaceContent:function(x,v,u){p.setContent(u.replace(/\{\$selection\}/g,p.getContent({format:"text"})))},mceInsertLink:function(y,x,v){var u=l.getParent(p.getNode(),"a");if(c.is(v,"string")){v={href:v}}if(!u){f("CreateLink",b,"javascript:mctmp(0);");d(l.select("a[href=javascript:mctmp(0);]"),function(z){l.setAttribs(z,v)})}else{if(v.href){l.setAttribs(u,v)}else{ed.dom.remove(u,a)}}}});t({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(u){return s("align"+u.substring(7))},"Bold,Italic,Underline,Strikethrough":function(u){return s(u)},mceBlockQuote:function(){return s("blockquote")},Outdent:function(){var u;if(k.inline_styles){if((u=l.getParent(p.getStart(),l.isBlock))&&parseInt(u.style.paddingLeft)>0){return a}if((u=l.getParent(p.getEnd(),l.isBlock))&&parseInt(u.style.paddingLeft)>0){return a}}return m("InsertUnorderedList")||m("InsertOrderedList")||(!k.inline_styles&&!!l.getParent(p.getNode(),"BLOCKQUOTE"))},"InsertUnorderedList,InsertOrderedList":function(u){return l.getParent(p.getNode(),u=="insertunorderedlist"?"UL":"OL")}},"state");t({"FontSize,FontName":function(x){var v=0,u;if(u=l.getParent(p.getNode(),"span")){if(x=="fontsize"){v=u.style.fontSize}else{v=u.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}}return v}},"value");if(k.custom_undo_redo){t({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}}})(tinymce);(function(a){a.create("tinymce.UndoManager",{index:0,data:null,typing:0,UndoManager:function(c){var d=this,b=a.util.Dispatcher;d.editor=c;d.data=[];d.onAdd=new b(this);d.onUndo=new b(this);d.onRedo=new b(this)},add:function(d){var g=this,f,e=g.editor,c,h=e.settings,j;d=d||{};d.content=d.content||e.getContent({format:"raw",no_events:1});d.content=d.content.replace(/^\s*|\s*$/g,"");j=g.data[g.index];if(j&&j.content==d.content){if(g.index>0||g.data.length==1){return null}}if(h.custom_undo_redo_levels){if(g.data.length>h.custom_undo_redo_levels){for(f=0;f<g.data.length-1;f++){g.data[f]=g.data[f+1]}g.data.length--;g.index=g.data.length}}if(h.custom_undo_redo_restore_selection){d.bookmark=c=d.bookmark||e.selection.getBookmark(2,true)}if(g.index<g.data.length-1){if(g.index==0){g.data=[]}else{g.data.length=g.index+1}}g.data.push(d);g.index=g.data.length-1;g.onAdd.dispatch(g,d);e.isNotDirty=0;return d},undo:function(){var e=this,c=e.editor,b=b,d;if(e.typing){e.add();e.typing=0}if(e.index>0){b=e.data[--e.index];c.setContent(b.content,{format:"raw"});c.selection.moveToBookmark(b.bookmark);e.onUndo.dispatch(e,b)}return b},redo:function(){var d=this,c=d.editor,b=null;if(d.index<d.data.length-1){b=d.data[++d.index];c.setContent(b.content,{format:"raw"});c.selection.moveToBookmark(b.bookmark);d.onRedo.dispatch(d,b)}return b},clear:function(){var b=this;b.data=[];b.index=0;b.typing=0},hasUndo:function(){return this.index>0||this.typing},hasRedo:function(){return this.index<this.data.length-1}})})(tinymce);(function(l){var k=l.dom.Event,c=l.isIE,a=l.isGecko,b=l.isOpera,j=l.each,i=l.extend,d=true,h=false;function g(n,o){var m=o.ownerDocument.createRange();m.setStart(n.endContainer,n.endOffset);m.setEndAfter(o);return m.cloneContents().textContent.length==0}function f(m){m=m.innerHTML;m=m.replace(/<(img|hr|table|input|select|textarea)[ \>]/gi,"-");m=m.replace(/<[^>]+>/g,"");return m.replace(/[ \u00a0\t\r\n]+/g,"")==""}function e(o,q,m){var n,p;if(f(m)){n=q.getParent(m,"ul,ol");if(!q.getParent(n.parentNode,"ul,ol")){q.split(n,m);p=q.create("p",0,'<br _mce_bogus="1" />');q.replace(p,m);o.select(p,1)}return h}return d}l.create("tinymce.ForceBlocks",{ForceBlocks:function(n){var o=this,p=n.settings,q;o.editor=n;o.dom=n.dom;q=(p.forced_root_block||"p").toLowerCase();p.element=q.toUpperCase();n.onPreInit.add(o.setup,o);o.reOpera=new RegExp("(\\u00a0|&#160;|&nbsp;)</"+q+">","gi");o.rePadd=new RegExp("<p( )([^>]+)><\\/p>|<p( )([^>]+)\\/>|<p( )([^>]+)>\\s+<\\/p>|<p><\\/p>|<p\\/>|<p>\\s+<\\/p>".replace(/p/g,q),"gi");o.reNbsp2BR1=new RegExp("<p( )([^>]+)>[\\s\\u00a0]+<\\/p>|<p>[\\s\\u00a0]+<\\/p>".replace(/p/g,q),"gi");o.reNbsp2BR2=new RegExp("<%p()([^>]+)>(&nbsp;|&#160;)<\\/%p>|<%p>(&nbsp;|&#160;)<\\/%p>".replace(/%p/g,q),"gi");o.reBR2Nbsp=new RegExp("<p( )([^>]+)>\\s*<br \\/>\\s*<\\/p>|<p>\\s*<br \\/>\\s*<\\/p>".replace(/p/g,q),"gi");function m(r,s){if(b){s.content=s.content.replace(o.reOpera,"</"+q+">")}s.content=s.content.replace(o.rePadd,"<"+q+"$1$2$3$4$5$6>\u00a0</"+q+">");if(!c&&!b&&s.set){s.content=s.content.replace(o.reNbsp2BR1,"<"+q+"$1$2><br /></"+q+">");s.content=s.content.replace(o.reNbsp2BR2,"<"+q+"$1$2><br /></"+q+">")}else{s.content=s.content.replace(o.reBR2Nbsp,"<"+q+"$1$2>\u00a0</"+q+">")}}n.onBeforeSetContent.add(m);n.onPostProcess.add(m);if(p.forced_root_block){n.onInit.add(o.forceRoots,o);n.onSetContent.add(o.forceRoots,o);n.onBeforeGetContent.add(o.forceRoots,o)}},setup:function(){var n=this,m=n.editor,p=m.settings,r=m.dom,o=m.selection;if(p.forced_root_block){m.onBeforeExecCommand.add(n.forceRoots,n);m.onKeyUp.add(n.forceRoots,n);m.onPreProcess.add(n.forceRoots,n)}if(p.force_br_newlines){if(c){m.onKeyPress.add(function(s,t){var u;if(t.keyCode==13&&o.getNode().nodeName!="LI"){o.setContent('<br id="__" /> ',{format:"raw"});u=r.get("__");u.removeAttribute("id");o.select(u);o.collapse();return k.cancel(t)}})}}if(!c&&p.force_p_newlines){m.onKeyPress.add(function(s,t){if(t.keyCode==13&&!t.shiftKey&&!n.insertPara(t)){k.cancel(t)}});if(a){m.onKeyDown.add(function(s,t){if((t.keyCode==8||t.keyCode==46)&&!t.shiftKey){n.backspaceDelete(t,t.keyCode==8)}})}}if(l.isWebKit){function q(t){var s=o.getRng(),u,y=r.create("div",null," "),x,v=r.getViewPort(t.getWin()).h;s.insertNode(u=r.create("br"));s.setStartAfter(u);s.setEndAfter(u);o.setRng(s);if(o.getSel().focusNode==u.previousSibling){o.select(r.insertAfter(r.doc.createTextNode("\u00a0"),u));o.collapse(d)}r.insertAfter(y,u);x=r.getPos(y).y;r.remove(y);if(x>v){t.getWin().scrollTo(0,x)}}m.onKeyPress.add(function(s,t){if(t.keyCode==13&&(t.shiftKey||p.force_br_newlines)){q(s);k.cancel(t)}})}m.onPreProcess.add(function(s,t){j(r.select("p,h1,h2,h3,h4,h5,h6,div",t.node),function(u){if(f(u)){j(r.select("span,em,strong,b,i",t.node),function(v){if(!v.hasChildNodes()){v.appendChild(s.getDoc().createTextNode("\u00a0"));return h}})}})});if(c){if(p.element!="P"){m.onKeyPress.add(function(s,t){n.lastElm=o.getNode().nodeName});m.onKeyUp.add(function(t,u){var x,v=o.getNode(),s=t.getBody();if(s.childNodes.length===1&&v.nodeName=="P"){v=r.rename(v,p.element);o.select(v);o.collapse();t.nodeChanged()}else{if(u.keyCode==13&&!u.shiftKey&&n.lastElm!="P"){x=r.getParent(v,"p");if(x){r.rename(x,p.element);t.nodeChanged()}}}})}}},find:function(u,p,q){var o=this.editor,m=o.getDoc().createTreeWalker(u,4,null,h),r=-1;while(u=m.nextNode()){r++;if(p==0&&u==q){return r}if(p==1&&r==q){return u}}return -1},forceRoots:function(v,H){var y=this,v=y.editor,L=v.getBody(),I=v.getDoc(),O=v.selection,z=O.getSel(),A=O.getRng(),M=-2,u,F,m,o,J=-16777215;var K,p,N,E,B,q=L.childNodes,D,C,x;for(D=q.length-1;D>=0;D--){K=q[D];if(K.nodeType===1&&K.getAttribute("_mce_type")){p=null;continue}if(K.nodeType===3||(!y.dom.isBlock(K)&&K.nodeType!==8&&!/^(script|mce:script|style|mce:style)$/i.test(K.nodeName))){if(!p){if(K.nodeType!=3||/[^\s]/g.test(K.nodeValue)){if(M==-2&&A){if(!c){if(A.startContainer.nodeType==1&&(C=A.startContainer.childNodes[A.startOffset])&&C.nodeType==1){x=C.getAttribute("id");C.setAttribute("id","__mce")}else{if(v.dom.getParent(A.startContainer,function(n){return n===L})){F=A.startOffset;m=A.endOffset;M=y.find(L,0,A.startContainer);u=y.find(L,0,A.endContainer)}}}else{o=I.body.createTextRange();o.moveToElementText(L);o.collapse(1);N=o.move("character",J)*-1;o=A.duplicate();o.collapse(1);E=o.move("character",J)*-1;o=A.duplicate();o.collapse(0);B=(o.move("character",J)*-1)-E;M=E-N;u=B}}p=v.dom.create(v.settings.forced_root_block);K.parentNode.replaceChild(p,K);p.appendChild(K)}}else{if(p.hasChildNodes()){p.insertBefore(K,p.firstChild)}else{p.appendChild(K)}}}else{p=null}}if(M!=-2){if(!c){p=L.getElementsByTagName(v.settings.element)[0];A=I.createRange();if(M!=-1){A.setStart(y.find(L,1,M),F)}else{A.setStart(p,0)}if(u!=-1){A.setEnd(y.find(L,1,u),m)}else{A.setEnd(p,0)}if(z){z.removeAllRanges();z.addRange(A)}}else{try{A=z.createRange();A.moveToElementText(L);A.collapse(1);A.moveStart("character",M);A.moveEnd("character",u);A.select()}catch(G){}}}else{if(!c&&(C=v.dom.get("__mce"))){if(x){C.setAttribute("id",x)}else{C.removeAttribute("id")}A=I.createRange();A.setStartBefore(C);A.setEndBefore(C);O.setRng(A)}}},getParentBlock:function(o){var m=this.dom;return m.getParent(o,m.isBlock)},insertPara:function(R){var F=this,v=F.editor,N=v.dom,S=v.getDoc(),W=v.settings,G=v.selection.getSel(),H=G.getRangeAt(0),V=S.body;var K,L,I,P,O,q,o,u,z,m,D,U,p,x,J,M=N.getViewPort(v.getWin()),C,E,B;K=S.createRange();K.setStart(G.anchorNode,G.anchorOffset);K.collapse(d);L=S.createRange();L.setStart(G.focusNode,G.focusOffset);L.collapse(d);I=K.compareBoundaryPoints(K.START_TO_END,L)<0;P=I?G.anchorNode:G.focusNode;O=I?G.anchorOffset:G.focusOffset;q=I?G.focusNode:G.anchorNode;o=I?G.focusOffset:G.anchorOffset;if(P===q&&/^(TD|TH)$/.test(P.nodeName)){if(P.firstChild.nodeName=="BR"){N.remove(P.firstChild)}if(P.childNodes.length==0){v.dom.add(P,W.element,null,"<br />");U=v.dom.add(P,W.element,null,"<br />")}else{J=P.innerHTML;P.innerHTML="";v.dom.add(P,W.element,null,J);U=v.dom.add(P,W.element,null,"<br />")}H=S.createRange();H.selectNodeContents(U);H.collapse(1);v.selection.setRng(H);return h}if(P==V&&q==V&&V.firstChild&&v.dom.isBlock(V.firstChild)){P=q=P.firstChild;O=o=0;K=S.createRange();K.setStart(P,0);L=S.createRange();L.setStart(q,0)}P=P.nodeName=="HTML"?S.body:P;P=P.nodeName=="BODY"?P.firstChild:P;q=q.nodeName=="HTML"?S.body:q;q=q.nodeName=="BODY"?q.firstChild:q;u=F.getParentBlock(P);z=F.getParentBlock(q);m=u?u.nodeName:W.element;if(J=F.dom.getParent(u,"li,pre")){if(J.nodeName=="LI"){return e(v.selection,F.dom,J)}return d}if(u&&(u.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(N.getStyle(u,"position",1)))){m=W.element;u=null}if(z&&(z.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(N.getStyle(u,"position",1)))){m=W.element;z=null}if(/(TD|TABLE|TH|CAPTION)/.test(m)||(u&&m=="DIV"&&/left|right/gi.test(N.getStyle(u,"float",1)))){m=W.element;u=z=null}D=(u&&u.nodeName==m)?u.cloneNode(0):v.dom.create(m);U=(z&&z.nodeName==m)?z.cloneNode(0):v.dom.create(m);U.removeAttribute("id");if(/^(H[1-6])$/.test(m)&&g(H,u)){U=v.dom.create(W.element)}J=p=P;do{if(J==V||J.nodeType==9||F.dom.isBlock(J)||/(TD|TABLE|TH|CAPTION)/.test(J.nodeName)){break}p=J}while((J=J.previousSibling?J.previousSibling:J.parentNode));J=x=q;do{if(J==V||J.nodeType==9||F.dom.isBlock(J)||/(TD|TABLE|TH|CAPTION)/.test(J.nodeName)){break}x=J}while((J=J.nextSibling?J.nextSibling:J.parentNode));if(p.nodeName==m){K.setStart(p,0)}else{K.setStartBefore(p)}K.setEnd(P,O);D.appendChild(K.cloneContents()||S.createTextNode(""));try{L.setEndAfter(x)}catch(Q){}L.setStart(q,o);U.appendChild(L.cloneContents()||S.createTextNode(""));H=S.createRange();if(!p.previousSibling&&p.parentNode.nodeName==m){H.setStartBefore(p.parentNode)}else{if(K.startContainer.nodeName==m&&K.startOffset==0){H.setStartBefore(K.startContainer)}else{H.setStart(K.startContainer,K.startOffset)}}if(!x.nextSibling&&x.parentNode.nodeName==m){H.setEndAfter(x.parentNode)}else{H.setEnd(L.endContainer,L.endOffset)}H.deleteContents();if(b){v.getWin().scrollTo(0,M.y)}if(D.firstChild&&D.firstChild.nodeName==m){D.innerHTML=D.firstChild.innerHTML}if(U.firstChild&&U.firstChild.nodeName==m){U.innerHTML=U.firstChild.innerHTML}if(f(D)){D.innerHTML="<br />"}function T(y,s){var r=[],Y,X,t;y.innerHTML="";if(W.keep_styles){X=s;do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(X.nodeName)){Y=X.cloneNode(h);N.setAttrib(Y,"id","");r.push(Y)}}while(X=X.parentNode)}if(r.length>0){for(t=r.length-1,Y=y;t>=0;t--){Y=Y.appendChild(r[t])}r[0].innerHTML=b?"&nbsp;":"<br />";return r[0]}else{y.innerHTML=b?"&nbsp;":"<br />"}}if(f(U)){B=T(U,q)}if(b&&parseFloat(opera.version())<9.5){H.insertNode(D);H.insertNode(U)}else{H.insertNode(U);H.insertNode(D)}U.normalize();D.normalize();function A(r){return S.createTreeWalker(r,NodeFilter.SHOW_TEXT,null,h).nextNode()||r}H=S.createRange();H.selectNodeContents(a?A(B||U):B||U);H.collapse(1);G.removeAllRanges();G.addRange(H);C=v.dom.getPos(U).y;E=U.clientHeight;if(C<M.y||C+E>M.y+M.h){v.getWin().scrollTo(0,C<M.y?C:C-M.h+25)}return h},backspaceDelete:function(s,A){var C=this,q=C.editor,x=q.getBody(),p=q.dom,o,u=q.selection,m=u.getRng(),v=m.startContainer,o,y,z;if(v&&q.dom.isBlock(v)&&!/^(TD|TH)$/.test(v.nodeName)&&A){if(v.childNodes.length==0||(v.childNodes.length==1&&v.firstChild.nodeName=="BR")){o=v;while((o=o.previousSibling)&&!q.dom.isBlock(o)){}if(o){if(v!=x.firstChild){y=q.dom.doc.createTreeWalker(o,NodeFilter.SHOW_TEXT,null,h);while(z=y.nextNode()){o=z}m=q.getDoc().createRange();m.setStart(o,o.nodeValue?o.nodeValue.length:0);m.setEnd(o,o.nodeValue?o.nodeValue.length:0);u.setRng(m);q.dom.remove(v)}return k.cancel(s)}}}function B(n){var r;n=n.target;if(n&&n.parentNode&&n.nodeName=="BR"&&(o=C.getParentBlock(n))){r=n.previousSibling;k.remove(x,"DOMNodeInserted",B);if(r&&r.nodeType==3&&/\s+$/.test(r.nodeValue)){return}if(n.previousSibling||n.nextSibling){q.dom.remove(n)}}}k._add(x,"DOMNodeInserted",B);window.setTimeout(function(){k._remove(x,"DOMNodeInserted",B)},1)}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each,e=c.extend;c.create("tinymce.ControlManager",{ControlManager:function(f,j){var h=this,g;j=j||{};h.editor=f;h.controls={};h.onAdd=new c.util.Dispatcher(h);h.onPostRender=new c.util.Dispatcher(h);h.prefix=j.prefix||f.id+"_";h._cls={};h.onPostRender.add(function(){d(h.controls,function(i){i.postRender()})})},get:function(f){return this.controls[this.prefix+f]||this.controls[f]},setActive:function(h,f){var g=null;if(g=this.get(h)){g.setActive(f)}return g},setDisabled:function(h,f){var g=null;if(g=this.get(h)){g.setDisabled(f)}return g},add:function(g){var f=this;if(g){f.controls[g.id]=g;f.onAdd.dispatch(g,f)}return g},createControl:function(i){var h,g=this,f=g.editor;d(f.plugins,function(j){if(j.createControl){h=j.createControl(i,g);if(h){return false}}});switch(i){case"|":case"separator":return g.createSeparator()}if(!h&&f.buttons&&(h=f.buttons[i])){return g.createButton(i,h)}return g.add(h)},createDropMenu:function(f,n,h){var m=this,i=m.editor,j,g,k,l;n=e({"class":"mceDropDown",constrain:i.settings.constrain_menus},n);n["class"]=n["class"]+" "+i.getParam("skin")+"Skin";if(k=i.getParam("skin_variant")){n["class"]+=" "+i.getParam("skin")+"Skin"+k.substring(0,1).toUpperCase()+k.substring(1)}f=m.prefix+f;l=h||m._cls.dropmenu||c.ui.DropMenu;j=m.controls[f]=new l(f,n);j.onAddItem.add(function(r,q){var p=q.settings;p.title=i.getLang(p.title,p.title);if(!p.onclick){p.onclick=function(o){if(p.cmd){i.execCommand(p.cmd,p.ui||false,p.value)}}}});i.onRemove.add(function(){j.destroy()});if(c.isIE){j.onShowMenu.add(function(){i.focus();g=i.selection.getBookmark(1)});j.onHideMenu.add(function(){if(g){i.selection.moveToBookmark(g);g=0}})}return m.add(j)},createListBox:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;if(g.settings.use_native_selects){k=new c.ui.NativeListBox(m,i)}else{f=l||h._cls.listbox||c.ui.ListBox;k=new f(m,i)}h.controls[m]=k;if(c.isWebKit){k.onPostRender.add(function(p,o){a.add(o,"mousedown",function(){g.bookmark=g.selection.getBookmark(1)});a.add(o,"focus",function(){g.selection.moveToBookmark(g.bookmark);g.bookmark=null})})}if(k.hideMenu){g.onMouseDown.add(k.hideMenu,k)}return h.add(k)},createButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.label=g.translate(i.label);i.scope=i.scope||g;if(!i.onclick&&!i.menu_button){i.onclick=function(){g.execCommand(i.cmd,i.ui||false,i.value)}}i=e({title:i.title,"class":"mce_"+m,unavailable_prefix:g.getLang("unavailable",""),scope:i.scope,control_manager:h},i);m=h.prefix+m;if(i.menu_button){f=l||h._cls.menubutton||c.ui.MenuButton;k=new f(m,i);g.onMouseDown.add(k.hideMenu,k)}else{f=h._cls.button||c.ui.Button;k=new f(m,i)}return h.add(k)},createMenuButton:function(h,f,g){f=f||{};f.menu_button=1;return this.createButton(h,f,g)},createSplitButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onclick){i.onclick=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;f=l||h._cls.splitbutton||c.ui.SplitButton;k=h.add(new f(m,i));g.onMouseDown.add(k.hideMenu,k);return k},createColorSplitButton:function(f,n,h){var l=this,j=l.editor,i,k,m,g;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onclick){n.onclick=function(o){if(c.isIE){g=j.selection.getBookmark(1)}j.execCommand(n.cmd,n.ui||false,o||n.value)}}if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,menu_class:j.getParam("skin")+"Skin",scope:n.scope,more_colors_title:j.getLang("more_colors")},n);f=l.prefix+f;m=h||l._cls.colorsplitbutton||c.ui.ColorSplitButton;k=new m(f,n);j.onMouseDown.add(k.hideMenu,k);j.onRemove.add(function(){k.destroy()});if(c.isIE){k.onShowMenu.add(function(){j.focus();g=j.selection.getBookmark(1)});k.onHideMenu.add(function(){if(g){j.selection.moveToBookmark(g);g=0}})}return l.add(k)},createToolbar:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||g._cls.toolbar||c.ui.Toolbar;i=new f(k,h);if(g.get(k)){return null}return g.add(i)},createSeparator:function(g){var f=g||this._cls.separator||c.ui.Separator;return new f()},setControlType:function(g,f){return this._cls[g.toLowerCase()]=f},destroy:function(){d(this.controls,function(f){f.destroy()});this.controls=null}})})(tinymce);(function(d){var a=d.util.Dispatcher,e=d.each,c=d.isIE,b=d.isOpera;d.create("tinymce.WindowManager",{WindowManager:function(f){var g=this;g.editor=f;g.onOpen=new a(g);g.onClose=new a(g);g.params={};g.features={}},open:function(z,h){var v=this,k="",n,m,i=v.editor.settings.dialog_type=="modal",q,o,j,g=d.DOM.getViewPort(),r;z=z||{};h=h||{};o=b?g.w:screen.width;j=b?g.h:screen.height;z.name=z.name||"mc_"+new Date().getTime();z.width=parseInt(z.width||320);z.height=parseInt(z.height||240);z.resizable=true;z.left=z.left||parseInt(o/2)-(z.width/2);z.top=z.top||parseInt(j/2)-(z.height/2);h.inline=false;h.mce_width=z.width;h.mce_height=z.height;h.mce_auto_focus=z.auto_focus;if(i){if(c){z.center=true;z.help=false;z.dialogWidth=z.width+"px";z.dialogHeight=z.height+"px";z.scroll=z.scrollbars||false}}e(z,function(p,f){if(d.is(p,"boolean")){p=p?"yes":"no"}if(!/^(name|url)$/.test(f)){if(c&&i){k+=(k?";":"")+f+":"+p}else{k+=(k?",":"")+f+"="+p}}});v.features=z;v.params=h;v.onOpen.dispatch(v,z,h);r=z.url||z.file;r=d._addVer(r);try{if(c&&i){q=1;window.showModalDialog(r,window,k)}else{q=window.open(r,z.name,k)}}catch(l){}if(!q){alert(v.editor.getLang("popup_blocked"))}},close:function(f){f.close();this.onClose.dispatch(this)},createInstance:function(i,h,g,m,l,k){var j=d.resolve(i);return new j(h,g,m,l,k)},confirm:function(h,f,i,g){g=g||window;f.call(i||this,g.confirm(this._decode(this.editor.getLang(h,h))))},alert:function(h,f,j,g){var i=this;g=g||window;g.alert(i._decode(i.editor.getLang(h,h)));if(f){f.call(j||i)}},resizeBy:function(f,g,h){h.resizeBy(f,g)},_decode:function(f){return d.DOM.decode(f).replace(/\\n/g,"\n")}})}(tinymce));(function(a){function b(){var d={},c={},e={};function f(j,i,h,g){if(typeof(i)=="string"){i=[i]}a.each(i,function(k){j[k.toLowerCase()]={func:h,scope:g}})}a.extend(this,{add:function(i,h,g){f(d,i,h,g)},addQueryStateHandler:function(i,h,g){f(c,i,h,g)},addQueryValueHandler:function(i,h,g){f(e,i,h,g)},execCommand:function(h,k,j,i,g){if(k=d[k.toLowerCase()]){if(k.func.call(h||k.scope,j,i,g)!==false){return true}}},queryCommandValue:function(){if(cmd=e[cmd.toLowerCase()]){return cmd.func.call(scope||cmd.scope,ui,value,args)}},queryCommandState:function(){if(cmd=c[cmd.toLowerCase()]){return cmd.func.call(scope||cmd.scope,ui,value,args)}}})}a.GlobalCommands=new b()})(tinymce);(function(a){a.Formatter=function(R){var I={},K=a.each,b=R.dom,o=R.selection,r=a.dom.TreeWalker,G=new a.dom.RangeUtils(b),c=R.schema.isValid,B=b.isBlock,j=R.settings.forced_root_block,q=b.nodeIndex,A="\uFEFF",d=/^(src|href|style)$/,O=false,x=true,n,S,L;function k(U,T){return b.getParents(U,T,b.getRoot())}function D(){if(!L||L.apply.length||L.remove.length){L={apply:[],remove:[]}}}R.onMouseUp.add(D);D();function N(T){return T?I[T]:I}function i(T,U){if(T){if(typeof(T)!=="string"){K(T,function(W,V){i(V,W)})}else{U=U.length?U:[U];K(U,function(V){if(V.deep===n){V.deep=!V.selector}if(V.split===n){V.split=!V.selector}if(V.remove===n&&V.selector){V.remove="none"}if(typeof(V.classes)==="string"){V.classes=V.classes.split(/\s+/)}});I[T]=U}}}function P(V,ab,X){var Y=N(V),ac=Y[0],aa,U,Z;function W(af){var ae=af.startContainer,ai=af.startOffset,ah,ag;if(ae.nodeType==1||ae.nodeValue===""){ah=new r(ae.childNodes[ai]);for(ag=ah.current();ag;ag=ah.next()){if(ag.nodeType==3&&!B(ag.parentNode)&&!e(ag)){af.setStart(ag,0);break}}}return af}function T(af,ae){ae=ae||ac;if(af){K(ae.styles,function(ah,ag){b.setStyle(af,ag,p(ah,ab))});K(ae.attributes,function(ah,ag){b.setAttrib(af,ag,p(ah,ab))});K(ae.classes,function(ag){ag=p(ag,ab);if(!b.hasClass(af,ag)){b.addClass(af,ag)}})}}function ad(af){var ae=[],ah,ag;ah=ac.inline||ac.block;ag=b.create(ah);T(ag);G.walk(af,function(ai){var aj;function ak(al){var an=al.nodeName.toLowerCase(),am=al.parentNode.nodeName.toLowerCase();if(f(an,"br")){aj=0;if(ac.block){b.remove(al)}return}if(ac.wrapper&&t(al,V,ab)){aj=0;return}if(ac.block&&!ac.wrapper&&C(an)){al=b.rename(al,ah);T(al);ae.push(al);aj=0;return}if(ac.selector){K(Y,function(ao){if(b.is(al,ao.selector)){T(al,ao)}});return}if(c(ah,an)&&c(am,ah)){if(!aj){aj=ag.cloneNode(O);al.parentNode.insertBefore(aj,al);ae.push(aj)}aj.appendChild(al)}else{aj=0;K(a.grep(al.childNodes),ak);aj=0}}K(ai,ak)});K(ae,function(ak){var ai;function al(an){var am=0;K(an.childNodes,function(ao){if(!e(ao)&&!E(ao)){am++}});return am}function aj(am){var ao,an;K(am.childNodes,function(ap){if(ap.nodeType==1&&!E(ap)){ao=ap;return O}});if(ao&&g(ao,ac)){an=ao.cloneNode(O);T(an);b.replace(an,am,x);b.remove(ao,1)}return an||am}ai=al(ak);if(ai===0){b.remove(ak,1);return}if(ac.inline||ac.wrapper){if(!ac.exact&&ai===1){ak=aj(ak)}K(Y,function(am){K(b.select(am.inline,ak),function(an){Q(am,ab,an,am.exact?an:null)})});b.getParent(ak.parentNode,function(am){if(t(am,V,ab)){b.remove(ak,1);ak=0;return x}});if(ak){ak=s(y(ak),ak);ak=s(ak,y(ak,x))}}})}if(ac){if(X){U=b.createRng();U.setStartBefore(X);U.setEndAfter(X);ad(U)}else{if(!o.isCollapsed()||!ac.inline){aa=o.getBookmark();ad(m(o.getRng(x),Y));o.moveToBookmark(aa);o.setRng(W(o.getRng(x)));R.nodeChanged()}else{M("apply",V,ab)}}}}function v(V,ad,X){var Y=N(V),af=Y[0],ac,ab,U;function W(ak){var aj,ai,ah;aj=a.grep(ak.childNodes);for(ai=0,ah=Y.length;ai<ah;ai++){if(Q(Y[ai],ad,ak,ak)){break}}if(af.deep){for(ai=0,ah=aj.length;ai<ah;ai++){W(aj[ai])}}}function Z(ah){var ai;K(k(ah.parentNode).reverse(),function(aj){if(!ai&&aj.id!="_start"&&aj.id!="_end"){if(!B(aj)&&t(aj,V,ad)){ai=aj}}});return ai}function T(ak,ah,am,ap){var aq,ao,an,aj,al,ai;if(ak){ai=ak.parentNode;for(aq=ah.parentNode;aq&&aq!=ai;aq=aq.parentNode){ao=aq.cloneNode(O);for(al=0;al<Y.length;al++){if(Q(Y[al],ad,ao,ao)){ao=0;break}}if(ao){if(an){ao.appendChild(an)}if(!aj){aj=ao}an=ao}}if(ap){ah=b.split(ak,ah)}if(an){am.parentNode.insertBefore(an,am);aj.appendChild(am)}}return ah}function ae(ah){return T(Z(ah),ah,ah,true)}function aa(aj){var ai=b.get(aj?"_start":"_end"),ah=ai[aj?"firstChild":"lastChild"];b.remove(ai,1);return ah}function ag(ah){var ai,aj;ah=m(ah,Y,x);if(af.split){ai=F(ah,x);aj=F(ah);if(ai!=aj){ai=J(ai,"span",{id:"_start",_mce_type:"bookmark"});aj=J(aj,"span",{id:"_end",_mce_type:"bookmark"});ae(ai);ae(aj);ai=aa(x);aj=aa()}else{ai=aj=ae(ai)}ah.startContainer=ai.parentNode;ah.startOffset=q(ai);ah.endContainer=aj.parentNode;ah.endOffset=q(aj)+1}G.walk(ah,function(ak){K(ak,function(al){W(al)})})}if(X){U=b.createRng();U.setStartBefore(X);U.setEndAfter(X);ag(U);return}if(!o.isCollapsed()||!af.inline){ac=o.getBookmark();ag(o.getRng(x));o.moveToBookmark(ac);R.nodeChanged()}else{M("remove",V,ad)}}function z(T,V,U){if(h(T,V,U)){v(T,V,U)}else{P(T,V,U)}}function t(W,T,Y){var Z=N(T),X,V,U;function aa(ae,ag,ah){var ad,af,ab=ag[ah],ac;if(ab){if(ab.length===n){for(ad in ab){if(ab.hasOwnProperty(ad)){if(ah==="attributes"){af=b.getAttrib(ae,ad)}else{af=H(ae,ad)}if(!f(af,p(ab[ad],Y))){return}}}}else{for(ac=0;ac<ab.length;ac++){if(ah==="attributes"?b.getAttrib(ae,ab[ac]):H(ae,ab[ac])){return x}}}}return x}if(Z&&W){for(V=0;V<Z.length;V++){X=Z[V];if(g(W,X)&&aa(W,X,"attributes")&&aa(W,X,"styles")){if(U=X.classes){for(V=0;V<U.length;V++){if(!b.hasClass(W,U[V])){return}}}return x}}}}function h(V,Y,X){var U,W;function T(Z){Z=b.getParent(Z,function(aa){return !!t(aa,V,Y)});return t(Z,V,Y)}if(X){return T(X)}if(o.isCollapsed()){for(W=L.apply.length-1;W>=0;W--){if(L.apply[W].name==V){return true}}for(W=L.remove.length-1;W>=0;W--){if(L.remove[W].name==V){return false}}return T(o.getNode())}X=o.getNode();if(T(X)){return x}U=o.getStart();if(U!=X){if(T(U)){return x}}return O}function u(X){var Z=N(X),W,V,Y,U,T;if(Z){W=o.getStart();V=k(W);for(U=Z.length-1;U>=0;U--){T=Z[U].selector;if(!T){return x}for(Y=V.length-1;Y>=0;Y--){if(b.is(V[Y],T)){return x}}}}return O}a.extend(this,{get:N,register:i,apply:P,remove:v,toggle:z,match:h,matchNode:t,canApply:u});function g(T,U){if(f(T,U.inline)){return x}if(f(T,U.block)){return x}if(U.selector){return b.is(T,U.selector)}}function f(U,T){U=U||"";T=T||"";U=U.nodeName||U;T=T.nodeName||T;return U.toLowerCase()==T.toLowerCase()}function H(U,T){var V=b.getStyle(U,T);if(T=="color"||T=="backgroundColor"){V=b.toHex(V)}if(T=="fontWeight"&&V==700){V="bold"}return""+V}function p(T,U){if(typeof(T)!="string"){T=T(U)}else{if(U){T=T.replace(/%(\w+)/g,function(W,V){return U[V]||W})}}return T}function e(T){return T&&T.nodeType===3&&/^\s*$/.test(T.nodeValue)}function J(V,U,T){var W=b.create(U,T);V.parentNode.insertBefore(W,V);W.appendChild(V);return W}function m(T,ab,W){var V=T.startContainer,Y=T.startOffset,ae=T.endContainer,Z=T.endOffset,ad,aa;function ac(ah,ai,af,ag){var aj,ak;ag=ag||b.getRoot();for(;;){aj=ah.parentNode;if(aj==ag||(!ab[0].block_expand&&B(aj))){return ah}for(ad=aj[ai];ad&&ad!=ah;ad=ad[af]){if(ad.nodeType==1&&!E(ad)){return ah}if(ad.nodeType==3&&!e(ad)){return ah}}ah=ah.parentNode}return ah}if(V.nodeType==1&&V.hasChildNodes()){aa=V.childNodes.length-1;V=V.childNodes[Y>aa?aa:Y];if(V.nodeType==3){Y=0}}if(ae.nodeType==1&&ae.hasChildNodes()){aa=ae.childNodes.length-1;ae=ae.childNodes[Z>aa?aa:Z-1];if(ae.nodeType==3){Z=ae.nodeValue.length}}if(E(V.parentNode)){V=V.parentNode}if(E(V)){V=V.nextSibling||V}if(E(ae.parentNode)){ae=ae.parentNode}if(E(ae)){ae=ae.previousSibling||ae}if(ab[0].inline||ab[0].block_expand){V=ac(V,"firstChild","nextSibling");ae=ac(ae,"lastChild","previousSibling")}if(ab[0].selector&&ab[0].expand!==O){function X(ag,af){var ah,ai,aj;if(ag.nodeType==3&&ag.nodeValue.length==0&&ag[af]){ag=ag[af]}ah=k(ag);for(ai=0;ai<ah.length;ai++){for(aj=0;aj<ab.length;aj++){if(b.is(ah[ai],ab[aj].selector)){return ah[ai]}}}return ag}V=X(V,"previousSibling");ae=X(ae,"nextSibling")}if(ab[0].block||ab[0].selector){function U(ag,af,ai){var ah;if(!ab[0].wrapper){ah=b.getParent(ag,ab[0].block)}if(!ah){ah=b.getParent(ag.nodeType==3?ag.parentNode:ag,B)}if(ah&&ab[0].wrapper){ah=k(ah,"ul,ol").reverse()[0]||ah}if(!ah){ah=ag;while(ah[af]&&!B(ah[af])){ah=ah[af];if(f(ah,"br")){break}}}return ah||ag}V=U(V,"previousSibling");ae=U(ae,"nextSibling");if(ab[0].block){if(!B(V)){V=ac(V,"firstChild","nextSibling")}if(!B(ae)){ae=ac(ae,"lastChild","previousSibling")}}}if(V.nodeType==1){Y=q(V);V=V.parentNode}if(ae.nodeType==1){Z=q(ae)+1;ae=ae.parentNode}return{startContainer:V,startOffset:Y,endContainer:ae,endOffset:Z}}function Q(Z,Y,W,T){var V,U,X;if(!g(W,Z)){return O}if(Z.remove!="all"){K(Z.styles,function(ab,aa){ab=p(ab,Y);if(typeof(aa)==="number"){aa=ab;T=0}if(!T||f(H(T,aa),ab)){b.setStyle(W,aa,"")}X=1});if(X&&b.getAttrib(W,"style")==""){W.removeAttribute("style");W.removeAttribute("_mce_style")}K(Z.attributes,function(ac,aa){var ab;ac=p(ac,Y);if(typeof(aa)==="number"){aa=ac;T=0}if(!T||f(b.getAttrib(T,aa),ac)){if(aa=="class"){ac=b.getAttrib(W,aa);if(ac){ab="";K(ac.split(/\s+/),function(ad){if(/mce\w+/.test(ad)){ab+=(ab?" ":"")+ad}});if(ab){b.setAttrib(W,aa,ab);return}}}if(aa=="class"){W.removeAttribute("className")}if(d.test(aa)){W.removeAttribute("_mce_"+aa)}W.removeAttribute(aa)}});K(Z.classes,function(aa){aa=p(aa,Y);if(!T||b.hasClass(T,aa)){b.removeClass(W,aa)}});U=b.getAttribs(W);for(V=0;V<U.length;V++){if(U[V].nodeName.indexOf("_")!==0){return O}}}if(Z.remove!="none"){l(W,Z);return x}}function l(V,W){var T=V.parentNode,U;if(W.block){if(!j){function X(Z,Y,aa){Z=y(Z,Y,aa);return !Z||(Z.nodeName=="BR"||B(Z))}if(B(V)&&!B(T)){if(!X(V,O)&&!X(V.firstChild,x,1)){V.insertBefore(b.create("br"),V.firstChild)}if(!X(V,x)&&!X(V.lastChild,O,1)){V.appendChild(b.create("br"))}}}else{if(T==b.getRoot()){if(!W.list_block||!f(V,W.list_block)){K(a.grep(V.childNodes),function(Y){if(c(j,Y.nodeName.toLowerCase())){if(!U){U=J(Y,j)}else{U.appendChild(Y)}}else{U=0}})}}}}b.remove(V,1)}function y(U,T,V){if(U){T=T?"nextSibling":"previousSibling";for(U=V?U:U[T];U;U=U[T]){if(U.nodeType==1||!e(U)){return U}}}}function E(T){return T&&T.nodeType==1&&T.getAttribute("_mce_type")=="bookmark"}function s(X,W){var T,V,U;function Z(ac,ab){if(ac.nodeName!=ab.nodeName){return O}function aa(ae){var af={};K(b.getAttribs(ae),function(ag){var ah=ag.nodeName.toLowerCase();if(ah.indexOf("_")!==0&&ah!=="style"){af[ah]=b.getAttrib(ae,ah)}});return af}function ad(ah,ag){var af,ae;for(ae in ah){if(ah.hasOwnProperty(ae)){af=ag[ae];if(af===n){return O}if(ah[ae]!=af){return O}delete ag[ae]}}for(ae in ag){if(ag.hasOwnProperty(ae)){return O}}return x}if(!ad(aa(ac),aa(ab))){return O}if(!ad(b.parseStyle(b.getAttrib(ac,"style")),b.parseStyle(b.getAttrib(ab,"style")))){return O}return x}if(X&&W){function Y(ab,aa){for(V=ab;V;V=V[aa]){if(V.nodeType==3&&!e(V)){return ab}if(V.nodeType==1&&!E(V)){return V}}return ab}X=Y(X,"previousSibling");W=Y(W,"nextSibling");if(Z(X,W)){for(V=X.nextSibling;V&&V!=W;){U=V;V=V.nextSibling;X.appendChild(U)}b.remove(W);K(a.grep(W.childNodes),function(aa){X.appendChild(aa)});return X}}return W}function C(T){return/^(h[1-6]|p|div|pre|address)$/.test(T)}function F(U,X){var T,W,V;T=U[X?"startContainer":"endContainer"];W=U[X?"startOffset":"endOffset"];if(T.nodeType==1){V=T.childNodes.length-1;if(!X&&W){W--}T=T.childNodes[W>V?V:W]}return T}function M(ab,W,aa){var X,U,Z=o.getNode().parentNode,ad=R.getDoc(),Y="mceinline",ag=["onKeyDown","onKeyUp","onKeyPress"],V=L[ab],ac=L[ab=="apply"?"remove":"apply"];for(X=V.length-1;X>=0;X--){if(V[X].name==W){return}}V.push({name:W,vars:aa});for(X=ac.length-1;X>=0;X--){if(ac[X].name==W){ac.splice(X,1)}}function af(){if(S){K(ag,function(ah){R[ah].remove(S)});S=0}}function ae(ah){K(L.apply.reverse(),function(ai){P(ai.name,ai.vars,ah)});K(L.remove.reverse(),function(ai){v(ai.name,ai.vars,ah)});b.remove(ah,1);D()}function T(ah){return ah.face==Y||ah.style.fontFamily==Y}af();ad.execCommand("FontName",false,Y);K(b.select("font,span",Z),function(ai){var ah;if(T(ai)){ah=o.getBookmark();ae(ai);o.moveToBookmark(ah);R.nodeChanged();Z=0}});if(Z){S=function(ah,ai){K(b.select("font,span",Z),function(ak){var aj,al;if(ak.face==Y||ak.style.fontFamily==Y){al=ak.firstChild;ae(ak);U=b.createRng();U.setStart(al,al.nodeValue.length);U.setEnd(al,al.nodeValue.length);o.setRng(U);ah.nodeChanged();af()}});if(ai.type=="keyup"){af();D()}};K(ag,function(ah){R[ah].addToTop(S)})}}}})(tinymce);tinymce.onAddEditor.add(function(e,a){var d,h,g,c=a.settings;if(c.inline_styles){h=e.explode(c.font_size_style_values);function b(j,i){g.replace(g.create("span",{style:i}),j,1)}d={font:function(j,i){b(i,{backgroundColor:i.style.backgroundColor,color:i.color,fontFamily:i.face,fontSize:h[parseInt(i.size)-1]})},u:function(j,i){b(i,{textDecoration:"underline"})},strike:function(j,i){b(i,{textDecoration:"line-through"})}};function f(i,j){g=i.dom;if(c.convert_fonts_to_spans){e.each(g.select("font,u,strike",j.node),function(k){d[k.nodeName.toLowerCase()](a.dom,k)})}}a.onPreProcess.add(f);a.onInit.add(function(){a.selection.onSetContent.add(f)})}});
tiny_mce/tiny_mce_popup.js CHANGED
@@ -2,4 +2,4 @@
2
  // Uncomment and change this document.domain value if you are loading the script cross subdomains
3
  // document.domain = 'moxiecode.com';
4
 
5
- var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var e=this,g,a=document.body,c=e.dom.getViewPort(window),d,f;d=e.getWindowArg("mce_width")-c.w;f=e.getWindowArg("mce_height")-c.h;if(e.isWindow){window.resizeBy(d,f)}else{e.editor.windowManager.resizeBy(d,f,e.id)}},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('<script type="text/javascript" src="'+tinymce._addVer(a)+'"><\/script>');tinymce.ScriptLoader.markDone(a)}}},pickColor:function(b,a){this.execCommand("mceColorPicker",true,{color:document.getElementById(a).value,func:function(e){document.getElementById(a).value=e;try{document.getElementById(a).onchange()}catch(d){}}})},openBrowser:function(a,c,b){tinyMCEPopup.restoreSelection();this.editor.execCallback("file_browser_callback",a,document.getElementById(a).value,c,window)},confirm:function(b,a,c){this.editor.windowManager.confirm(b,a,c,window)},alert:function(b,a,c){this.editor.windowManager.alert(b,a,c,window)},close:function(){var a=this;function b(){a.editor.windowManager.close(window);tinymce=tinyMCE=a.editor=a.params=a.dom=a.dom.doc=null}if(tinymce.isOpera){a.getWin().setTimeout(b,0)}else{b()}},_restoreSelection:function(){var a=window.event.srcElement;if(a.nodeName=="INPUT"&&(a.type=="submit"||a.type=="button")){tinyMCEPopup.restoreSelection()}},_onDOMLoaded:function(){var b=tinyMCEPopup,d=document.title,e,c,a;if(b.domLoaded){return}b.domLoaded=1;if(b.features.translate_i18n!==false){c=document.body.innerHTML;if(tinymce.isIE){c=c.replace(/ (value|title|alt)=([^"][^\s>]+)/gi,' $1="$2"')}document.dir=b.editor.getParam("directionality","");if((a=b.editor.translate(c))&&a!=c){document.body.innerHTML=a}if((a=b.editor.translate(d))&&a!=d){document.title=d=a}}document.body.style.display="";if(tinymce.isIE){document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection);b.dom.add(b.dom.select("head")[0],"base",{target:"_self"})}b.restoreSelection();b.resizeToInnerSize();if(!b.isWindow){b.editor.windowManager.setTitle(window,d)}else{window.focus()}if(!tinymce.isIE&&!b.isWindow){tinymce.dom.Event._add(document,"focus",function(){b.editor.windowManager.focus(b.id)})}tinymce.each(b.dom.select("select"),function(f){f.onkeydown=tinyMCEPopup._accessHandler});tinymce.each(b.listeners,function(f){f.func.call(f.scope,b.editor)});if(b.getWindowArg("mce_auto_focus",true)){window.focus();tinymce.each(document.forms,function(g){tinymce.each(g.elements,function(f){if(b.dom.hasClass(f,"mceFocus")&&!f.disabled){f.focus();return false}})})}document.onkeyup=tinyMCEPopup._closeWinKeyHandler},_accessHandler:function(a){a=a||window.event;if(a.keyCode==13||a.keyCode==32){a=a.target||a.srcElement;if(a.onchange){a.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_wait:function(){if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);tinyMCEPopup._onDOMLoaded()}});if(document.documentElement.doScroll&&window==window.top){(function(){if(tinyMCEPopup.domLoaded){return}try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}tinyMCEPopup._onDOMLoaded()})()}document.attachEvent("onload",tinyMCEPopup._onDOMLoaded)}else{if(document.addEventListener){window.addEventListener("DOMContentLoaded",tinyMCEPopup._onDOMLoaded,false);window.addEventListener("load",tinyMCEPopup._onDOMLoaded,false)}}}};tinyMCEPopup.init();tinyMCEPopup._wait();
2
  // Uncomment and change this document.domain value if you are loading the script cross subdomains
3
  // document.domain = 'moxiecode.com';
4
 
5
+ var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},0)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('<script type="text/javascript" src="'+tinymce._addVer(a)+'"><\/script>');tinymce.ScriptLoader.markDone(a)}}},pickColor:function(b,a){this.execCommand("mceColorPicker",true,{color:document.getElementById(a).value,func:function(e){document.getElementById(a).value=e;try{document.getElementById(a).onchange()}catch(d){}}})},openBrowser:function(a,c,b){tinyMCEPopup.restoreSelection();this.editor.execCallback("file_browser_callback",a,document.getElementById(a).value,c,window)},confirm:function(b,a,c){this.editor.windowManager.confirm(b,a,c,window)},alert:function(b,a,c){this.editor.windowManager.alert(b,a,c,window)},close:function(){var a=this;function b(){a.editor.windowManager.close(window);tinymce=tinyMCE=a.editor=a.params=a.dom=a.dom.doc=null}if(tinymce.isOpera){a.getWin().setTimeout(b,0)}else{b()}},_restoreSelection:function(){var a=window.event.srcElement;if(a.nodeName=="INPUT"&&(a.type=="submit"||a.type=="button")){tinyMCEPopup.restoreSelection()}},_onDOMLoaded:function(){var b=tinyMCEPopup,d=document.title,e,c,a;if(b.domLoaded){return}b.domLoaded=1;if(b.features.translate_i18n!==false){c=document.body.innerHTML;if(tinymce.isIE){c=c.replace(/ (value|title|alt)=([^"][^\s>]+)/gi,' $1="$2"')}document.dir=b.editor.getParam("directionality","");if((a=b.editor.translate(c))&&a!=c){document.body.innerHTML=a}if((a=b.editor.translate(d))&&a!=d){document.title=d=a}}document.body.style.display="";if(tinymce.isIE){document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection);b.dom.add(b.dom.select("head")[0],"base",{target:"_self"})}b.restoreSelection();b.resizeToInnerSize();if(!b.isWindow){b.editor.windowManager.setTitle(window,d)}else{window.focus()}if(!tinymce.isIE&&!b.isWindow){tinymce.dom.Event._add(document,"focus",function(){b.editor.windowManager.focus(b.id)})}tinymce.each(b.dom.select("select"),function(f){f.onkeydown=tinyMCEPopup._accessHandler});tinymce.each(b.listeners,function(f){f.func.call(f.scope,b.editor)});if(b.getWindowArg("mce_auto_focus",true)){window.focus();tinymce.each(document.forms,function(g){tinymce.each(g.elements,function(f){if(b.dom.hasClass(f,"mceFocus")&&!f.disabled){f.focus();return false}})})}document.onkeyup=tinyMCEPopup._closeWinKeyHandler},_accessHandler:function(a){a=a||window.event;if(a.keyCode==13||a.keyCode==32){a=a.target||a.srcElement;if(a.onchange){a.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_wait:function(){if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);tinyMCEPopup._onDOMLoaded()}});if(document.documentElement.doScroll&&window==window.top){(function(){if(tinyMCEPopup.domLoaded){return}try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}tinyMCEPopup._onDOMLoaded()})()}document.attachEvent("onload",tinyMCEPopup._onDOMLoaded)}else{if(document.addEventListener){window.addEventListener("DOMContentLoaded",tinyMCEPopup._onDOMLoaded,false);window.addEventListener("load",tinyMCEPopup._onDOMLoaded,false)}}}};tinyMCEPopup.init();tinyMCEPopup._wait();
users-edit.php ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ @include_once 'commons.php';
3
+ $nc = new NewsletterControls();
4
+
5
+ if (isset($_GET['id'])) {
6
+ $nc->load($wpdb->prefix . 'newsletter', $_GET['id']);
7
+ if (empty($nc->data['id'])) {
8
+ $nc->data['status'] = 'C';
9
+ $nc->data['token'] = md5(rand());
10
+ }
11
+ }
12
+ else {
13
+ if ($nc->is_action('save')) {
14
+ $nc->save($wpdb->prefix . 'newsletter');
15
+ }
16
+ }
17
+
18
+ $nc->errors($errors);
19
+ $nc->messages($messages);
20
+
21
+ $options_profile = get_option('newsletter_profile');
22
+ ?>
23
+ <div class="wrap">
24
+ <h2>Newsletter Subscriber Editing</h2>
25
+ <p><a href="admin.php?page=newsletter/users.php">Back to the list</a></p>
26
+ <form method="post" action="admin.php?page=newsletter/users-edit.php">
27
+ <?php $nc->init(); ?>
28
+ <?php $nc->hidden('id'); ?>
29
+ <?php $nc->hidden('token'); ?>
30
+
31
+ <table class="form-table">
32
+ <tr valign="top">
33
+ <th>&nbsp;</th>
34
+ <td>
35
+ id: <?php $nc->value('id'); ?>
36
+ created: <?php $nc->value('created'); ?>
37
+ ip: <?php $nc->value('ip'); ?>
38
+ token: <?php $nc->value('token'); ?>
39
+ </td>
40
+ </tr>
41
+ <tr valign="top">
42
+ <th>Name and email</th>
43
+ <td>
44
+ name: <?php $nc->text('name', 30); ?> surname: <?php $nc->text('surname', 30); ?>
45
+ email: <?php $nc->text('email', 40); ?> sex: <?php $nc->select('sex', array('n'=>'Not specified', 'f'=>'female', 'm'=>'male')); ?>
46
+ </td>
47
+ </tr>
48
+ <tr valign="top">
49
+ <th>Status</th>
50
+ <td>
51
+ <?php $nc->select('status', array('C'=>'Confirmed', 'S'=>'Not confirmed', 'B'=>'Bounce')); ?>
52
+ </td>
53
+ </tr>
54
+ <tr valign="top">
55
+ <th>Lists</th>
56
+ <td>
57
+ <table>
58
+ <tr>
59
+ <td valign="top">
60
+ <?php
61
+ for ($i=1; $i<=5; $i++) {
62
+ $nc->checkbox('list_' . $i, '(' . $i . ') ' . htmlspecialchars($options_profile['list_' . $i]) . '<br />');
63
+ }
64
+ ?>
65
+ </td>
66
+ <td valign="top">
67
+ <?php
68
+ for ($i=6; $i<=9; $i++) {
69
+ $nc->checkbox('list_' . $i, '(' . $i . ') ' . htmlspecialchars($options_profile['list_' . $i]) . '<br />');
70
+ }
71
+ ?>
72
+ </td>
73
+ </tr>
74
+ </table>
75
+ </td>
76
+ </tr>
77
+ <tr valign="top">
78
+ <th>Profiles</th>
79
+ <td>
80
+ <table>
81
+ <?php
82
+ for ($i=1; $i<20; $i++) {
83
+ echo '<tr><td>(' . $i . ') ';
84
+ echo $options_profile['profile_' . $i];
85
+ echo '</td><td>';
86
+ $nc->text('profile_' . $i, 50);
87
+ echo '</td></tr>';
88
+ }
89
+ ?>
90
+ </table>
91
+ </td>
92
+ </tr>
93
+ </table>
94
+
95
+ <p class="submit">
96
+ <?php $nc->button('save', 'Save'); ?>
97
+ </p>
98
+
99
+ </form>
100
+ </div>
users.php ADDED
@@ -0,0 +1,251 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ @include_once 'commons.php';
4
+
5
+ $options = stripslashes_deep($_POST['options']);
6
+ $options_lists = get_option('newsletter_profile');
7
+ $options_main = get_option('newsletter_main');
8
+
9
+ $lists = array();
10
+ for ($i=1; $i<=9; $i++)
11
+ {
12
+ $lists[''.$i] = '(' . $i . ') ' . $options_lists['list_' . $i];
13
+ }
14
+
15
+ if ($action == 'resend') {
16
+ $user = $newsletter->get_user($options['subscriber_id']);
17
+ $opts = get_option('newsletter');
18
+ $newsletter->mail($user->email, $newsletter->replace($opts['confirmation_subject'], $user), $newsletter->replace($opts['confirmation_message'], $user));
19
+ }
20
+
21
+ if ($action == 'resend_welcome') {
22
+ $user = $newsletter->get_user($options['subscriber_id']);
23
+ $opts = get_option('newsletter');
24
+ $newsletter->mail($user->email, $newsletter->replace($opts['confirmed_subject'], $user), $newsletter->replace($opts['confirmed_message'], $user));
25
+ }
26
+
27
+ if ($action == 'remove') {
28
+ $wpdb->query($wpdb->prepare("delete from " . $wpdb->prefix . "newsletter where id=%d", $options['subscriber_id']));
29
+ unset($options['subscriber_id']);
30
+ }
31
+
32
+ if ($action == 'remove_unconfirmed') {
33
+ $wpdb->query("delete from " . $wpdb->prefix . "newsletter where status='S'");
34
+ }
35
+
36
+ if ($action == 'remove_bounced') {
37
+ $wpdb->query("delete from " . $wpdb->prefix . "newsletter where status='B'");
38
+ }
39
+
40
+ if ($action == 'confirm_all') {
41
+ $wpdb->query("update " . $wpdb->prefix . "newsletter set status='C'");
42
+ }
43
+
44
+ if ($action == 'remove_all') {
45
+ $wpdb->query("delete from " . $wpdb->prefix . "newsletter");
46
+ }
47
+
48
+ if ($action == 'list_add') {
49
+ $wpdb->query("update " . $wpdb->prefix . "newsletter set list_" . $options['list'] . "=1");
50
+ }
51
+
52
+ if ($action == 'list_remove') {
53
+ $wpdb->query("update " . $wpdb->prefix . "newsletter set list_" . $options['list'] . "=0");
54
+ }
55
+
56
+ if ($action == 'list_delete') {
57
+ $wpdb->query("delete from " . $wpdb->prefix . "newsletter where list_" . $options['list'] . "<>0");
58
+ }
59
+
60
+ if ($action == 'status') {
61
+ newsletter_set_status($options['subscriber_id'], $options['subscriber_status']);
62
+ }
63
+
64
+ if ($action == 'list_manage') {
65
+ if ($options['list_action'] == 'move') {
66
+ echo 'move';
67
+ $wpdb->query("update " . $wpdb->prefix . 'newsletter set list_' . $options['list_1'] . '=0, list_' . $options['list_2'] . '=1' .
68
+ ' where list_' . $options['list_1'] . '=1');
69
+ }
70
+
71
+ if ($options['list_action'] == 'add') {
72
+ $wpdb->query("update " . $wpdb->prefix . 'newsletter set list_' . $options['list_2'] . '=1' .
73
+ ' where list_' . $options['list_1'] . '=1');
74
+ }
75
+ }
76
+
77
+
78
+
79
+ $list = newsletter_search($options['search_text'], $options['search_status'], $options['search_order'], $options['search_list'], $options['search_link']);
80
+
81
+ $nc = new NewsletterControls($options);
82
+ $nc->errors($errors);
83
+ $nc->messages($messages);
84
+
85
+ ?>
86
+ <script type="text/javascript">
87
+ function newsletter_remove(f, id)
88
+ {
89
+ f.elements["options[subscriber_id]"].value = id;
90
+ f.submit();
91
+ }
92
+
93
+ function newsletter_set_status(f, id, status)
94
+ {
95
+ f.elements["options[subscriber_id]"].value = id;
96
+ f.elements["options[subscriber_status]"].value = status;
97
+ f.submit();
98
+ }
99
+
100
+ function newsletter_resend(f, id)
101
+ {
102
+ if (!confirm("<?php _e('Resend the subscription confirmation email?', 'newsletter'); ?>")) return;
103
+ f.elements["options[subscriber_id]"].value = id;
104
+ f.submit();
105
+ }
106
+
107
+ function newsletter_resend_welcome(f, id)
108
+ {
109
+ if (!confirm("<?php _e('Resend the welcome email?', 'newsletter'); ?>")) return;
110
+ f.elements["options[subscriber_id]"].value = id;
111
+ f.submit();
112
+ }
113
+ </script>
114
+
115
+ <div class="wrap">
116
+ <h2>Newsletter Subscribers Management</h2>
117
+
118
+ <p><a href="admin.php?page=newsletter/users-edit.php&amp;id=0" class="button">Create a new user</a></p>
119
+
120
+ <form method="post" action="">
121
+ <?php $nc->init(); ?>
122
+ <h3>Massive actions</h3>
123
+ <table class="form-table">
124
+ <tr>
125
+ <th>General actions on subscribers</th>
126
+ <td>
127
+ <?php $nc->button_confirm('remove_unconfirmed', 'Delete all not confirmed', 'Are you sure you want to delete ALL not confirmed subscribers?'); ?>
128
+ <?php //$nc->button('remove_bounced', 'Remove bounced', 'Are you sure you want to remove bounced subscribers?'); ?>
129
+ <?php $nc->button_confirm('remove_all', 'Delete all', 'Are you sure you want to remove ALL subscribers?'); ?>
130
+ <?php $nc->button_confirm('confirm_all', 'Confirm all', 'Are you sure you want to mark ALL subscribers as confirmed?'); ?>
131
+ </td>
132
+ </tr>
133
+ <tr>
134
+ <th>Lists</th>
135
+ <td>
136
+ List <?php $nc->select('list', $lists); ?>:
137
+ <?php $nc->button_confirm('list_add', 'Add all to it', 'Are you sure?'); ?>
138
+ <?php $nc->button_confirm('list_remove', 'Cancel all from it', 'Are you sure?'); ?>
139
+ <?php $nc->button_confirm('list_delete', 'Delete subscribers of it', 'Are you really sure you want to delete those user from your database?'); ?>
140
+ <br /><br />
141
+ <?php $nc->select('list_action', array('move'=>'Move', 'add'=>'Add')); ?>
142
+ all subscribers of list <?php $nc->select('list_1', $lists); ?>
143
+ to list <?php $nc->select('list_2', $lists); ?>
144
+ <?php $nc->button_confirm('list_manage', 'Go!', 'Are you sure?'); ?>
145
+ <div class="hints">
146
+ Lists <strong>are not</strong> group of users, but options subscribers can have set or not. If you choose to <strong>delete</strong> users in a list, they will be
147
+ <strong>physically deleted</strong> from the database (no way back).
148
+ </div>
149
+ </td>
150
+ </tr>
151
+ </table>
152
+ </form>
153
+
154
+ <form id="channel" method="post" action="">
155
+ <?php $nc->init(); ?>
156
+ <input type="hidden" name="options[subscriber_id]"/>
157
+
158
+ <?php
159
+ $tmp = $wpdb->get_results($wpdb->prepare("select distinct newsletter, url from " . $wpdb->prefix . "newsletter_stats order by newsletter,url"));
160
+ $links = array(''=>'Unfiltered');
161
+ foreach ($tmp as $t) {
162
+ $links[$t->newsletter . '|' . $t->url] = $t->newsletter . ': ' . substr($t->url, 0, min(strlen($t->url), 50)) . '...';
163
+ }
164
+ ?>
165
+
166
+ <h3>Search</h3>
167
+ <table class="form-table">
168
+ <tr valign="top">
169
+ <td>
170
+ text: <?php $nc->text('search_text', 50); ?> (partial name, email, ...)<br />
171
+ <?php $nc->select('search_status', array(''=>'Any status', 'C'=>'Confirmed', 'S'=>'Not confirmed', 'B'=>'Bounced')); ?>
172
+ <?php $nc->select('search_order', array('id'=>'Order by id', 'email'=>'Order by email', 'name'=>'Order by name')); ?>
173
+ <?php $nc->select('search_list', $lists, 'Any'); ?>
174
+ <?php $nc->button('search', 'Search'); ?>
175
+
176
+ <div class="hints">
177
+ Press without filter to show all. Max 100 results will be shown. Use export panel to get all subscribers.
178
+ </div>
179
+ </td>
180
+ </tr>
181
+ </table>
182
+
183
+
184
+
185
+
186
+
187
+
188
+ <h3>Search results</h3>
189
+
190
+ <?php if ($list) { ?>
191
+
192
+ <table class="widefat">
193
+ <thead>
194
+ <tr>
195
+ <th>Id</th>
196
+ <th><?php _e('Email', 'newsletter'); ?>/<?php _e('Name', 'newsletter'); ?></th>
197
+ <th><?php _e('Status', 'newsletter'); ?></th>
198
+ <th>Lists</th>
199
+ <th><?php _e('Actions', 'newsletter'); ?></th>
200
+ <th><?php _e('Profile', 'newsletter'); ?></th>
201
+ <?php if ($options['search_clicks'] == 1) { ?>
202
+ <th><?php _e('Clicks', 'newsletter'); ?></th>
203
+ <?php } ?>
204
+ </tr>
205
+ </thead>
206
+ <?php foreach($list as $s) { ?>
207
+ <tr class="<?php echo ($i++%2==0)?'alternate':''; ?>">
208
+ <td><?php echo $s->id; ?></td>
209
+ <td>
210
+ <a href="admin.php?page=newsletter/users-edit.php&amp;id=<?php echo $s->id; ?>"><?php echo $s->email; ?><br /><?php echo $s->name; ?> <?php echo $s->surname; ?></a>
211
+ </td>
212
+ <td><small>
213
+ Confirmed:&nbsp;<?php echo ($s->status=='S'?'NO':'YES'); ?>
214
+ </small></td>
215
+
216
+ <td>
217
+ <small>
218
+ <?php
219
+ for ($i=1; $i<=NEWSLETTER_LIST_MAX; $i++) {
220
+ $l = 'list_' . $i;
221
+ if ($s->$l == 1) echo $lists['' . $i] . '<br />';
222
+ }
223
+ ?>
224
+ </small>
225
+ </td>
226
+
227
+ <td>
228
+ <?php $nc->button('remove', 'Remove', 'newsletter_remove(this.form,' . $s->id . ')'); ?>
229
+ <?php $nc->button('status', 'Confirm', 'newsletter_set_status(this.form,' . $s->id . ',\'C\')'); ?>
230
+ <?php $nc->button('status', 'Unconfirm', 'newsletter_set_status(this.form,' . $s->id . ',\'S\')'); ?>
231
+ <?php $nc->button('resend', 'Resend confirmation', 'newsletter_resend(this.form,' . $s->id . ')'); ?>
232
+ <?php $nc->button('resend_welcome', 'Resend welcome', 'newsletter_resend_welcome(this.form,' . $s->id . ')'); ?>
233
+ </td>
234
+ <td><small>
235
+ date: <?php echo $s->created; ?><br />
236
+ <?php
237
+ $query = $wpdb->prepare("select name,value from " . $wpdb->prefix . "newsletter_profiles where newsletter_id=%d", $s->id);
238
+ $profile = $wpdb->get_results($query);
239
+ foreach ($profile as $field) {
240
+ echo htmlspecialchars($field->name) . ': ' . htmlspecialchars($field->value) . '<br />';
241
+ }
242
+ echo 'Token: ' . $s->token;
243
+ ?>
244
+ </small></td>
245
+
246
+ </tr>
247
+ <?php } ?>
248
+ </table>
249
+ <?php } ?>
250
+ </form>
251
+ </div>
widget.php CHANGED
@@ -1,81 +1,87 @@
1
- <?php
2
-
3
- function widget_newsletter_init() {
4
- function widget_newsletter($args) {
5
- $options = get_option('newsletter');
6
-
7
- // $args is an array of strings that help widgets to conform to
8
- // the active theme: before_widget, before_title, after_widget,
9
- // and after_title are the array keys. Default tags: li and h2.
10
- extract($args);
11
-
12
- // Each widget can store its own options. We keep strings here.
13
- $optionsw = get_option('newsletter_widget');
14
- $title = $optionsw['title'];
15
- $text = $optionsw['text'];
16
- $form = $optionsw['form'];
17
-
18
- // These lines generate our output. Widgets can be very complex
19
- // but as you can see here, they can also be very, very simple.
20
- echo $before_widget . $before_title . $title . $after_title;
21
-
22
- if (newsletter_has_extras('1.0.2') && $form != '') {
23
- $buffer .= str_replace('{newsletter_url}', $options['url'], newsletter_extras_get_form($form));
24
- }
25
- else {
26
- if (isset($options['noname'])) {
27
- $buffer = str_replace('{newsletter_url}', $options['url'], newsletter_label('widget_form_noname'));
28
- }
29
- else {
30
- $buffer = str_replace('{newsletter_url}', $options['url'], newsletter_label('widget_form'));
31
- }
32
- }
33
- $buffer = str_replace('{text}', $optionsw['text'], $buffer);
34
- $buffer = str_replace('{count}', newsletter_subscribers_count(), $buffer);
35
-
36
- //if (defined('NEWSLETTER_EXTRAS')) echo $buffer;
37
- //else echo $buffer . '<div style="text-align:right;padding:0 10px;margin:0;"><a style="font-size:9px;color:#bbb;text-decoration:none" href="http://www.satollo.net">by satollo.net</a></div>';
38
-
39
- echo $buffer;
40
-
41
- echo $after_widget;
42
- }
43
-
44
- function widget_newsletter_control() {
45
- // Get our options and see if we're handling a form submission.
46
- $options = get_option('newsletter_widget');
47
- if (!is_array($options)) {
48
- $options = array('title'=>'Newsletter subscription');
49
- $options = array('text'=>'');
50
- }
51
-
52
- if ( $_POST['newsletter-submit'] ) {
53
- // Remember to sanitize and format use input appropriately.
54
- $options['title'] = strip_tags(stripslashes($_POST['newsletter-title']));
55
- $options['text'] = stripslashes($_POST['newsletter-text']);
56
- $options['form'] = stripslashes($_POST['newsletter-form']);
57
- update_option('newsletter_widget', $options);
58
- }
59
-
60
- // Be sure you format your options to be valid HTML attributes.
61
- $title = htmlspecialchars($options['title'], ENT_QUOTES);
62
- $text = htmlspecialchars($options['text'], ENT_QUOTES);
63
- $form = htmlspecialchars($options['form'], ENT_QUOTES);
64
-
65
- // Here is our little form segment. Notice that we don't need a
66
- // complete form. This will be embedded into the existing form.
67
- echo 'Title<br /><input id="newsletter-title" name="newsletter-title" type="text" value="'.$title.'" />';
68
- echo '<br /><br />';
69
- echo 'Introduction<br /><textarea style="width: 350px;" id="newsletter-text" name="newsletter-text">'.$text.'</textarea>';
70
- if (newsletter_has_extras('1.0.2')) {
71
- echo 'Form number<br /><input id="newsletter-form" name="newsletter-form" type="text" value="'.$form.'" />';
72
- }
73
- echo '<input type="hidden" id="newsletter-submit" name="newsletter-submit" value="1" />';
74
- }
75
-
76
- register_sidebar_widget('Newsletter', 'widget_newsletter');
77
- register_widget_control('Newsletter', 'widget_newsletter_control', 370, 200);
78
- }
79
-
80
- add_action('widgets_init', 'widget_newsletter_init');
81
- ?>
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Newsletter widget version 2.0: it'll replace the old version left for compatibility.
5
+ */
6
+ class NewsletterWidget extends WP_Widget {
7
+
8
+ function NewsletterWidget() {
9
+ parent::WP_Widget(false, $name = 'Newsletter',
10
+ array('description'=>'Newsletter widget to add subscription forms on sidebars'),
11
+ array('width'=>'350px'));
12
+ }
13
+
14
+ function widget($args, $instance) {
15
+ global $newsletter;
16
+ extract($args);
17
+
18
+ echo $before_widget;
19
+ if (!empty($instance['title'])) {
20
+ echo $before_title . $instance['title'] . $after_title;
21
+ }
22
+
23
+ $buffer = $instance['text'];
24
+ $options = get_option('newsletter');
25
+ $options_profile = get_option('newsletter_profile');
26
+ if (stripos($instance['text'], '<form') === false) {
27
+ $form .= '<div class="newsletter newsletter-widget"><form action="' . $newsletter->options_main['url'] . '" method="post">';
28
+ $form .= '<input type="hidden" name="na" value="s"/>';
29
+ $form .= '<input type="hidden" name="nr" value="widget"/>';
30
+ if ($options_profile['name_status'] == 2)
31
+ $form .= '<p><input type="text" name="nn" value="' . $options_profile['name'] . '" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/></p>';
32
+ if ($options_profile['surname_status'] == 2)
33
+ $form .= '<p><input type="text" name="ns" value="' . $options_profile['surname'] . '" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/></p>';
34
+ $form .= '<p><input type="text" name="ne" value="' . $options_profile['email'] . '" onclick="if (this.defaultValue==this.value) this.value=\'\'" onblur="if (this.value==\'\') this.value=this.defaultValue"/></p>';
35
+ if ($options_profile['sex_status'] == 2) {
36
+ $form .= '<p><select name="nx" class="newsletter-sex">';
37
+ $form .= '<option value="m">' . $options_profile['sex_male'] . '</option>';
38
+ $form .= '<option value="f">' . $options_profile['sex_female'] . '</option>';
39
+ $form .= '</select></p>';
40
+ }
41
+ $form .= '<p><input type="submit" value="' . $options_profile['subscribe'] . '"/></p>';
42
+ $form .= '</form></div>';
43
+ if (strpos($buffer, '{subscription_form}') !== false) $buffer = str_replace('{subscription_form}', $form, $buffer);
44
+ else $buffer .= $form;
45
+ }
46
+ else {
47
+ $buffer = str_ireplace('<form', '<form method="post" action="' . $newsletter->options_main['url'] . '"', $buffer);
48
+ $buffer = str_ireplace('</form>', '<input type="hidden" name="na" value="s"/></form>', $buffer);
49
+ }
50
+
51
+ echo $buffer;
52
+ echo $after_widget;
53
+ }
54
+
55
+ function update($new_instance, $old_instance) {
56
+ $instance = $old_instance;
57
+ $instance['title'] = strip_tags($new_instance['title']);
58
+ $instance['text'] = $new_instance['text'];
59
+ return $instance;
60
+ }
61
+
62
+ function form($instance) {
63
+ ?>
64
+ <p>
65
+ <label for="<?php echo $this->get_field_id('title'); ?>">
66
+ Title:
67
+ <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($instance['title']); ?>" />
68
+ </label>
69
+
70
+
71
+ <label for="<?php echo $this->get_field_id('text'); ?>">
72
+ Introduction:
73
+ <textarea class="widefat" rows="10" cols="20" id="<?php echo $this->get_field_id('text'); ?>" name="<?php echo $this->get_field_name('text'); ?>"><?php echo esc_html($instance['text']); ?></textarea>
74
+ </label>
75
+ The subscription form is created according the subscription panel configurations and appended at the end of the introduction text. If you
76
+ want to place the form in the middle of introduction text above, use the {subscription_form} tag.<br />
77
+ You can even create a full customized subscription on introduction text, it will be detected and the standard form not inserted.
78
+ Just add a &lt;form&gt; tag with wanted newsletter fields (see documentation on custom form building).
79
+ </p>
80
+ <?php
81
+ }
82
+
83
+ }
84
+
85
+ add_action('widgets_init', create_function('', 'return register_widget("NewsletterWidget");'));
86
+
87
+ ?>