PEEL Shopping
Open source ecommerce : PEEL Shopping
email-templates.php
Go to the documentation of this file.
1 <?php
2 // This file should be in UTF8 without BOM - Accents examples: éèê
3 // +----------------------------------------------------------------------+
4 // | Copyright (c) 2004-2015 Advisto SAS, service PEEL - contact@peel.fr |
5 // +----------------------------------------------------------------------+
6 // | This file is part of PEEL Shopping 8.0.0, which is subject to an |
7 // | opensource GPL license: you are allowed to customize the code |
8 // | for your own needs, but must keep your changes under GPL |
9 // | More information: https://www.peel.fr/lire/licence-gpl-70.html |
10 // +----------------------------------------------------------------------+
11 // | Author: Advisto SAS, RCS 479 205 452, France, https://www.peel.fr/ |
12 // +----------------------------------------------------------------------+
13 // $Id: email-templates.php 46935 2015-09-18 08:49:48Z gboussin $
14 define('IN_PEEL_ADMIN', true);
15 include("../configuration.inc.php");
17 necessite_priv("admin_content");
18 
19 $GLOBALS['DOC_TITLE'] = $GLOBALS['STR_ADMIN_EMAIL_TEMPLATES_TITLE'];
20 
22 $report = '';
23 $output = '';
24 
25 // Modification d'un template
26 if (!empty($_GET['id'])) {
27  if (isset($_POST['form_name'], $_POST['form_subject'], $_POST['form_text'])) {
28  if ($_POST['form_id_cat'] == "0") $form_error_object->add('form_id_cat');
29  if (empty($_POST['form_name'])) $form_error_object->add('form_name');
30  if (empty($_POST['form_subject'])) $form_error_object->add('form_subject');
31  if (!verify_token('email-templates.php?id=' . $_GET['id'])) $form_error_object->add('token', $GLOBALS['STR_INVALID_TOKEN']);
32  if (empty($_POST['form_text'])) {
33  $form_error_object->add('form_text');
34  } elseif (String::strip_tags($_POST['form_text']) != $_POST['form_text']) {
35  // On corrige le HTML si nécessaire
36  if (String::strpos($_POST['form_text'], '<br>') === false && String::strpos($_POST['form_text'], '<br />') === false && String::strpos($_POST['form_text'], '</p>') === false && String::strpos($_POST['form_text'], '<table') === false) {
37  // Par exemple si on a mis des balises <b> ou <u> dans email sans mettre de <br /> nulle part, on rajoute <br /> en fin de ligne pour pouvoir nettoyer ensuite le HTML de manière cohérente
38  $added_br = true;
39  $_POST['form_text'] = str_replace(array("\n"), "<br />\n", str_replace(array("\r\n", "\r"), "\n", $_POST['form_text']));
40  }
41  $_POST['form_text'] = String::getCleanHTML($_POST['form_text'], null, true, true, true, null, false);
42  if (!empty($added_br)) {
43  $_POST['form_text'] = str_replace(array("<br />\n"), "\n", $_POST['form_text']);
44  }
45  }
46 
47  if ($form_error_object->count()) {
48  if ($form_error_object->has_error['token']) {
49  $action = $GLOBALS['tplEngine']->createTemplate('global_error.tpl', array('message' => $form_error_object->text['token']))->fetch();
50  } else {
51  $action = $GLOBALS['tplEngine']->createTemplate('global_error.tpl', array('message' => $GLOBALS['STR_ERR_FILL_IN_ALL']))->fetch();
52  }
53  $ok = false;
54  } else {
55  query('UPDATE peel_email_template SET
56  site_id="' . intval(vn($_POST['site_id'])) . '",
57  technical_code="' . trim(nohtml_real_escape_string($_POST['form_technical_code'])) . '",
58  name="' . trim(nohtml_real_escape_string($_POST['form_name'])) . '",
59  subject="' . trim(real_escape_string($_POST['form_subject'])) . '",
60  text="' . real_escape_string($_POST['form_text']) . '",
61  id_cat="' .intval($_POST['form_id_cat']) . '",
62  lang="' . trim(nohtml_real_escape_string($_POST['form_lang'])) . '",
63  default_signature_code ="' . nohtml_real_escape_string($_POST['default_signature_code']) . '"
64  WHERE id="' . intval($_GET['id']) . '"');
65  $action = $GLOBALS['tplEngine']->createTemplate('global_success.tpl', array('message' => $GLOBALS["STR_ADMIN_EMAIL_TEMPLATES_MSG_UPDATED"]))->fetch();
66  }
67  }
68 
69  $query_update = query('SELECT id, technical_code, name, subject, text, lang, id_cat, default_signature_code, site_id
70  FROM peel_email_template
71  WHERE id="' . intval($_GET['id']) . '" AND ' . get_filter_site_cond('email_template', null, true) . '
72  LIMIT 1');
73  $template_infos = fetch_assoc($query_update);
74  // On va chercher les catégories
75  $sql = 'SELECT id, name_' . $_SESSION['session_langue'] . ' AS name, site_id
76  FROM peel_email_template_cat
77  WHERE ' . get_filter_site_cond('email_template_cat', null) . '
78  ORDER BY name ASC';
79  $result_categories = query($sql);
80  $tpl_categories_list = $GLOBALS['tplEngine']->createTemplate('admin_email-templates_categories_list.tpl');
81  $tpl_categories_list->assign('STR_CHOOSE', $GLOBALS['STR_CHOOSE']);
82  $tpl_options = array();
83  while ($row_categories = fetch_assoc($result_categories)) {
84  $tpl_options[] = array('value' => intval($row_categories['id']),
85  'issel' => vb($_POST['form_id_cat']) == $row_categories['id'] || $row_categories['id'] == $template_infos['id_cat'],
86  'name' => get_site_info($row_categories) . $row_categories['name']
87  );
88  }
89  $tpl_categories_list->assign('options', $tpl_options);
90  $categories_list = $tpl_categories_list->fetch();
91 
92  $tpl = $GLOBALS['tplEngine']->createTemplate('admin_email-templates_output.tpl');
93  $tpl->assign('action_html', (isset($action) ? $action : ''));
94  $tpl->assign('href', $GLOBALS['administrer_url'] . '/email-templates.php');
95  $tpl->assign('id', $_GET['id']);
96  $tpl->assign('action', $GLOBALS['administrer_url'] . '/email-templates.php?id=' . $_GET['id']);
97  $tpl->assign('form_token', get_form_token_input('email-templates.php?id=' . $_GET['id'] . ''));
98  $tpl->assign('categories_list', $categories_list);
99  $tpl->assign('technical_code', (isset($_POST['form_technical_code']) ? $_POST['form_technical_code'] : vb($template_infos['technical_code'])));
100  $tpl->assign('name', (isset($_POST['form_name']) ? $_POST['form_name'] : vb($template_infos['name'])));
101  $tpl->assign('subject', vb($template_infos['subject']));
102  $tpl->assign('text', vb($template_infos['text']));
103  $tpl->assign('signature_template_options', get_email_template_options('technical_code', null, vb($template_infos['lang']), vb($template_infos['default_signature_code']), true));
104 
105  $tpl_langs = array();
106  $langs_array = $GLOBALS['admin_lang_codes'];
107  if (!empty($template_infos['lang']) && !in_array($template_infos['lang'], $GLOBALS['admin_lang_codes'])) {
108  $langs_array[] = $template_infos['lang'];
109  }
110  foreach ($langs_array as $lng) {
111  $tpl_langs[] = array('lng' => $lng,
112  'issel' => vb($template_infos['lang']) == $lng
113  );
114  }
115  $tpl->assign('site_id_select_options', get_site_id_select_options(vb($template_infos['site_id'])));
116  $tpl->assign('langs', $tpl_langs);
117  $tpl->assign('emailLinksExplanations', emailLinksExplanations());
118  $tpl->assign('STR_ADMIN_WEBSITE', $GLOBALS['STR_ADMIN_WEBSITE']);
119  $tpl->assign('STR_BEFORE_TWO_POINTS', $GLOBALS['STR_BEFORE_TWO_POINTS']);
120  $tpl->assign('STR_TEXT', $GLOBALS['STR_TEXT']);
121  $tpl->assign('STR_NUMBER', $GLOBALS['STR_NUMBER']);
122  $tpl->assign('STR_CLICK_HERE', $GLOBALS['STR_CLICK_HERE']);
123  $tpl->assign('STR_CATEGORY', $GLOBALS['STR_CATEGORY']);
124  $tpl->assign('STR_ADMIN_SUBJECT', $GLOBALS['STR_ADMIN_SUBJECT']);
125  $tpl->assign('STR_ADMIN_EMAIL_TEMPLATES_UPDATE_TEMPLATE', $GLOBALS['STR_ADMIN_EMAIL_TEMPLATES_UPDATE_TEMPLATE']);
126  $tpl->assign('STR_ADMIN_LANGUAGE', $GLOBALS['STR_ADMIN_LANGUAGE']);
127  $tpl->assign('STR_ADMIN_EMAIL_TEMPLATES_INSERT_TEMPLATE', $GLOBALS['STR_ADMIN_EMAIL_TEMPLATES_INSERT_TEMPLATE']);
128  $tpl->assign('STR_ADMIN_EMAIL_TEMPLATES_TAGS_TABLE_EXPLAIN', $GLOBALS['STR_ADMIN_EMAIL_TEMPLATES_TAGS_TABLE_EXPLAIN']);
129  $tpl->assign('STR_ADMIN_EMAIL_TEMPLATES_TEMPLATE_NAME', $GLOBALS['STR_ADMIN_EMAIL_TEMPLATES_TEMPLATE_NAME']);
130  $tpl->assign('STR_ADMIN_TECHNICAL_CODE', $GLOBALS['STR_ADMIN_TECHNICAL_CODE']);
131  $tpl->assign('STR_SIGNATURE', $GLOBALS['STR_SIGNATURE']);
132  $tpl->assign('STR_ADMIN_EMAIL_TEMPLATES_WARNING', $GLOBALS['STR_ADMIN_EMAIL_TEMPLATES_WARNING']);
133  $output .= $tpl->fetch();
134 }
135 // Insertion d'un nouveau template = requete sql
136 if (isset($_POST['form_name'], $_POST['form_subject'], $_POST['form_text'], $_POST['form_lang']) && empty($_GET['id'])) {
137  if (empty($_POST['form_name']) || empty($_POST['form_subject']) || empty($_POST['form_text']) || empty($_POST['form_lang']) || $_POST['form_id_cat'] == "0") {
138  $action = $GLOBALS['tplEngine']->createTemplate('global_error.tpl', array('message' => $GLOBALS['STR_ERR_FILL_IN_ALL']))->fetch();
139  }
140  if (!verify_token('email-templates.php-ajout')) {
141  $form_error_object->add('token', $GLOBALS['STR_INVALID_TOKEN']);
142  }
143  if (empty($_POST['form_subject'])) {
144  $form_error_object->add('form_subject');
145  }
146  if (empty($_POST['form_text'])) {
147  $form_error_object->add('form_text');
148  }
149  if (!$form_error_object->count()) {
150  query('INSERT INTO peel_email_template (site_id, technical_code, name, subject, text, lang, id_cat, default_signature_code ) VALUES(
151  "' . trim(nohtml_real_escape_string($_POST['site_id'])) . '",
152  "' . trim(nohtml_real_escape_string($_POST['form_technical_code'])) . '",
153  "' . trim(nohtml_real_escape_string($_POST['form_name'])) . '",
154  "' . trim(real_escape_string($_POST['form_subject'])) . '",
155  "' . trim(real_escape_string($_POST['form_text'])) . '",
156  "' . trim(nohtml_real_escape_string($_POST['form_lang'])) . '",
157  "' . intval($_POST['form_id_cat']) . '",
158  "' . trim(nohtml_real_escape_string($_POST['default_signature_code'])) . '")');
159  $action = $GLOBALS['tplEngine']->createTemplate('global_success.tpl', array('message' => $GLOBALS['STR_ADMIN_EMAIL_TEMPLATES_MSG_TEMPLATE_CREATED']))->fetch();
160  }
161 }
162 // Insertion d'un template
163 if (empty($_GET['id'])) {
164  // On va chercher les catégories
165  $result_categories = query('SELECT id, name_' . $_SESSION['session_langue'] . ' AS name, site_id
166  FROM peel_email_template_cat
167  WHERE ' . get_filter_site_cond('email_template_cat', null) . '
168  ORDER BY name ASC');
169  $tpl_categories_list = $GLOBALS['tplEngine']->createTemplate('admin_email-templates_categories_list.tpl');
170  $tpl_categories_list->assign('STR_CHOOSE', $GLOBALS['STR_CHOOSE']);
171  $tpl_options = array();
172  while ($row_categories = fetch_assoc($result_categories)) {
173  $tpl_options[] = array('value' => intval($row_categories['id']),
174  'issel' => vb($_POST['form_id_cat']) == $row_categories['id'],
175  'name' => get_site_info($row_categories) . $row_categories['name']
176  );
177  }
178  $tpl_categories_list->assign('options', $tpl_options);
179  $categories_list = $tpl_categories_list->fetch();
180 
181  $tpl = $GLOBALS['tplEngine']->createTemplate('admin_email-templates_output2.tpl');
182  $tpl->assign('action_html', (isset($action) ? $action : ''));
183  $tpl->assign('form_token', get_form_token_input('email-templates.php-ajout'));
184  $tpl->assign('categories_list', $categories_list);
185  $tpl->assign('form_technical_code', vb($_POST['form_technical_code']));
186  $tpl->assign('form_name', vb($_POST['form_name']));
187  $tpl->assign('form_subject', vb($_POST['form_subject']));
188  $tpl->assign('form_text', vb($_POST['form_text']));
189  $tpl_langs = array();
190  $langs_array = $GLOBALS['admin_lang_codes'];
191  if (!empty($_POST['form_lang']) && !in_array($_POST['form_lang'], $GLOBALS['admin_lang_codes'])) {
192  $langs_array[] = $_POST['form_lang'];
193  }
194  foreach ($langs_array as $lng) {
195  $tpl_langs[] = array('lng' => $lng,
196  'issel' => vb($_POST['form_lang']) == $lng
197  );
198  }
199  $tpl->assign('signature_template_options', get_email_template_options('technical_code', null, null, null, true));
200  $tpl->assign('langs', $tpl_langs);
201  $tpl->assign('emailLinksExplanations', emailLinksExplanations());
202  $tpl->assign('site_id_select_options', get_site_id_select_options(vb($template_infos['site_id'])));
203  $tpl->assign('STR_ADMIN_WEBSITE', $GLOBALS['STR_ADMIN_WEBSITE']);
204  $tpl->assign('STR_ADMIN_EMAIL_TEMPLATES_INSERT_TEMPLATE', $GLOBALS['STR_ADMIN_EMAIL_TEMPLATES_INSERT_TEMPLATE']);
205  $tpl->assign('STR_ADMIN_EMAIL_TEMPLATES_MSG_LAYOUT_EXPLAINATION', $GLOBALS['STR_ADMIN_EMAIL_TEMPLATES_MSG_LAYOUT_EXPLAINATION']);
206  $tpl->assign('STR_ADMIN_EMAIL_TEMPLATES_TAGS_TABLE_EXPLAIN', $GLOBALS['STR_ADMIN_EMAIL_TEMPLATES_TAGS_TABLE_EXPLAIN']);
207  $tpl->assign('STR_ADMIN_EMAIL_TEMPLATES_TAGS_EXPLAIN', $GLOBALS['STR_ADMIN_EMAIL_TEMPLATES_TAGS_EXPLAIN']);
208  $tpl->assign('STR_CATEGORY', $GLOBALS['STR_CATEGORY']);
209  $tpl->assign('STR_BEFORE_TWO_POINTS', $GLOBALS['STR_BEFORE_TWO_POINTS']);
210  $tpl->assign('STR_ADMIN_TECHNICAL_CODE', $GLOBALS['STR_ADMIN_TECHNICAL_CODE']);
211  $tpl->assign('STR_ADMIN_EMAIL_TEMPLATES_TEMPLATE_NAME', $GLOBALS['STR_ADMIN_EMAIL_TEMPLATES_TEMPLATE_NAME']);
212  $tpl->assign('STR_ADMIN_SUBJECT', $GLOBALS['STR_ADMIN_SUBJECT']);
213  $tpl->assign('STR_TEXT', $GLOBALS['STR_TEXT']);
214  $tpl->assign('STR_SIGNATURE', $GLOBALS['STR_SIGNATURE']);
215  $tpl->assign('STR_ADMIN_LANGUAGE', $GLOBALS['STR_ADMIN_LANGUAGE']);
216 
217  $output .= $tpl->fetch();
218 }
219 // Filtre de recherche de modèle d'email
220 $tpl = $GLOBALS['tplEngine']->createTemplate('admin_email-templates_search.tpl');
222 $tpl_options = array();
223 // Récupération des catégories de template email
224 $result = query('SELECT tc.id, tc.name_' . $_SESSION['session_langue'] . ' AS name, tc.site_id
225  FROM peel_email_template_cat tc
226  INNER JOIN peel_email_template t ON t.id_cat=tc.id AND t.active="TRUE" AND ' . get_filter_site_cond('email_template', 't', true) . '
227  WHERE ' . get_filter_site_cond('email_template_cat', 'tc') . '
228  GROUP BY tc.id
229  ORDER BY name');
230 while ($row_categories = fetch_assoc($result)) {
231  $tpl_options[] = array('value' => intval($row_categories['id']),
232  'issel' => vb($_GET['form_lang_template']) == $row_categories['id'],
233  'name' => get_site_info($row_categories) . $row_categories['name']
234  );
235 }
236 $tpl->assign('options', $tpl_options);
237 $tpl_langs = array();
238 foreach ($GLOBALS['admin_lang_codes'] as $lng) {
239  $tpl_langs[] = array('name' => $lng,
240  'value' => $lng,
241  'issel' => vb($_GET['form_lang_template']) == $lng
242  );
243 }
244 $tpl->assign('langs', $tpl_langs);
245 $tpl->assign('etat', vb($_GET['etat']));
246 $tpl->assign('STR_CHOOSE', $GLOBALS['STR_CHOOSE']);
247 $tpl->assign('STR_ADMIN_LANGUAGE', $GLOBALS['STR_ADMIN_LANGUAGE']);
248 $tpl->assign('STR_CATEGORY', $GLOBALS['STR_CATEGORY']);
249 $tpl->assign('STR_STATUS', $GLOBALS['STR_STATUS']);
250 $tpl->assign('STR_ADMIN_ACTIVATED', $GLOBALS['STR_ADMIN_ACTIVATED']);
251 $tpl->assign('STR_ADMIN_DEACTIVATED', $GLOBALS['STR_ADMIN_DEACTIVATED']);
252 $tpl->assign('STR_SEARCH', $GLOBALS['STR_SEARCH']);
253 $tpl->assign('STR_ADMIN_CHOOSE_SEARCH_CRITERIA', $GLOBALS['STR_ADMIN_CHOOSE_SEARCH_CRITERIA']);
254 $tpl->assign('STR_BEFORE_TWO_POINTS', $GLOBALS['STR_BEFORE_TWO_POINTS']);
255 $output .= $tpl->fetch();
256 
257 // Affichage de tous les templates
258 $sql = 'SELECT id, technical_code, name, subject, text, lang, active, id_cat, site_id
259  FROM peel_email_template
260  WHERE ' . get_filter_site_cond('email_template', null, true);
261 
262 if (!empty($_GET['form_lang_template'])) {
263  $sql .= ' AND lang = "' . nohtml_real_escape_string($_GET['form_lang_template']) . '"';
264 }
265 if (empty($_GET['form_lang_template'])) {
266  $sql .= '';
267 }
268 if (!empty($_GET['form_id_cat'])) {
269  $sql .= ' AND id_cat = "' . intval($_GET['form_id_cat']) . '"';
270 }
271 if (empty($_GET['form_id_cat'])) {
272  $sql .= '';
273 }
274 
275 if (isset($_GET['etat']) && empty($_GET['etat'])) {
276  $sql .= '';
277 }
278 if (isset($_GET['etat']) && $_GET['etat'] == "1") {
279  $sql .= ' AND active = "TRUE"';
280 }
281 if (isset($_GET['etat']) && $_GET['etat'] == "0") {
282  $sql .= ' AND active = "FALSE"';
283 }
284 
285 $sql .= ' ORDER BY technical_code ASC, lang ASC';
286 
287 $Links = new Multipage($sql, 'email_templates', 40);
289 
290 $tpl = $GLOBALS['tplEngine']->createTemplate('admin_email-templates_report.tpl');
291 $tpl->assign('links_multipage', $Links->GetMultipage());
292 if (!empty($results_array)) {
293  $tpl_results = array();
294  $i = 0;
295  $bold = 0;
296  foreach ($results_array as $this_template) {
297  // On récupère la catégorie du template (s'il en a une)
298  $category_name = '';
299  if ($this_template['id_cat'] != 0) {
300  $result_category = query('SELECT name_' . $_SESSION['session_langue'] . ' AS name, site_id
301  FROM peel_email_template_cat
302  WHERE id=' . intval($this_template['id_cat']) . ' AND ' . get_filter_site_cond('email_template_cat', null));
303  if($row_category = fetch_assoc($result_category)) {
304  $category_name = get_site_info($row_category) . $row_category['name'];
305  }else {
306  $category_name = '';
307  }
308  }
309  $tpl_results[] = array('tr_rollover' => tr_rollover($i, true),
310  'id' => $this_template["id"],
311  'technical_code' => String::str_shorten_words($this_template["technical_code"], 20, '<br />'),
312  'category_name' => $category_name,
313  'name' => $this_template["name"],
314  'subject' => String::str_shorten_words($this_template["subject"], 40),
315  'text' => String::str_shorten_words($this_template["text"], 40),
316  'lang' => $this_template["lang"],
317  'etat_onclick' => 'change_status("email-templates", "' . $this_template['id'] . '", this, "'.$GLOBALS['administrer_url'] . '")',
318  'etat_src' => $GLOBALS['administrer_url'] . '/images/' . ($this_template["active"] != "TRUE" ? 'puce-blanche.gif' : 'puce-verte.gif'),
319  'edit_href' => 'email-templates.php?id=' . $this_template['id'],
320  'site_name' => get_site_name($this_template['site_id'])
321  );
322  $i++;
323  }
324  $tpl->assign('results', $tpl_results);
325 }
326 $tpl->assign('STR_ADMIN_WEBSITE', $GLOBALS['STR_ADMIN_WEBSITE']);
327 $tpl->assign('STR_ADMIN_EMAIL_TEMPLATES_TITLE', $GLOBALS['STR_ADMIN_EMAIL_TEMPLATES_TITLE']);
328 $tpl->assign('STR_ADMIN_TECHNICAL_CODE', $GLOBALS['STR_ADMIN_TECHNICAL_CODE']);
329 $tpl->assign('STR_ADMIN_SUBJECT', $GLOBALS['STR_ADMIN_SUBJECT']);
330 $tpl->assign('STR_ADMIN_LANGUAGE', $GLOBALS['STR_ADMIN_LANGUAGE']);
331 $tpl->assign('STR_STATUS', $GLOBALS['STR_STATUS']);
332 $tpl->assign('STR_ADMIN_ACTION', $GLOBALS['STR_ADMIN_ACTION']);
333 $tpl->assign('STR_ADMIN_ID', $GLOBALS['STR_ADMIN_ID']);
334 $tpl->assign('STR_CATEGORY', $GLOBALS['STR_CATEGORY']);
335 $tpl->assign('STR_ADMIN_HTML_TEXT', $GLOBALS['STR_ADMIN_HTML_TEXT']);
336 $tpl->assign('STR_ADMIN_NAME', $GLOBALS['STR_ADMIN_NAME']);
337 $tpl->assign('STR_MODIFY', $GLOBALS['STR_MODIFY']);
338 
339 $report = $tpl->fetch();
340 
341 include($GLOBALS['repertoire_modele'] . "/admin_haut.php");
342 echo $output . $report;
343 include($GLOBALS['repertoire_modele'] . "/admin_bas.php");
344 
351 {
352  $tpl = $GLOBALS['tplEngine']->createTemplate('admin_emailLinksExplanations.tpl');
353  if(empty($_SESSION['session_admin_multisite']) || $_SESSION['session_admin_multisite'] != $GLOBALS['site_id']) {
354  $this_wwwroot = get_site_wwwroot($_SESSION['session_admin_multisite']);
355  } else {
356  $this_wwwroot = $GLOBALS['wwwroot'];
357  }
358  $tpl->assign('link', $this_wwwroot);
359  $tpl->assign('is_annonce_module_active', check_if_module_active('annonces'));
360  $tpl->assign('is_vitrine_module_active', check_if_module_active('vitrine'));
361 
362  if(check_if_module_active('vitrine')) {
363  $tpl->assign('explication_tag_windows', get_explication_tag_windows(true));
364  }
365  if(check_if_module_active('annonces')) {
366  $tpl->assign('explication_tag_last_ads_verified', get_explication_tag_last_ads_verified(true));
367  $tpl->assign('explication_tag_list_category_ads', get_explication_tag_list_category_ads(true));
368  $tpl->assign('explication_tag_list_ads_by_category', get_explication_tag_list_ads_by_category(true));
369  }
370  $tpl->assign('STR_ADMIN_EMAIL_TEMPLATES_EXAMPLES_TITLE', $GLOBALS['STR_ADMIN_EMAIL_TEMPLATES_EXAMPLES_TITLE']);
371  $tpl->assign('STR_ADMIN_EMAIL_TEMPLATES_TAGS_EXPLAIN', $GLOBALS['STR_ADMIN_EMAIL_TEMPLATES_TAGS_EXPLAIN']);
372  $tpl->assign('STR_BEFORE_TWO_POINTS', $GLOBALS['STR_BEFORE_TWO_POINTS']);
373  $tpl->assign('STR_ADMIN_WWWROOT', $GLOBALS['STR_ADMIN_WWWROOT']);
374  $tpl->assign('STR_ADMIN_EMAIL_TEMPLATES_TAG_SITE', $GLOBALS['STR_ADMIN_EMAIL_TEMPLATES_TAG_SITE']);
375  $tpl->assign('STR_ADMIN_EMAIL_TEMPLATES_TAG_PHP_SELF', $GLOBALS['STR_ADMIN_EMAIL_TEMPLATES_TAG_PHP_SELF']);
376  $tpl->assign('STR_ADMIN_REMOTE_ADDR', $GLOBALS['STR_ADMIN_REMOTE_ADDR']);
377  $tpl->assign('STR_ADMIN_EMAIL_TEMPLATES_TAG_DATETIME', $GLOBALS['STR_ADMIN_EMAIL_TEMPLATES_TAG_DATETIME']);
378  $tpl->assign('STR_ADMIN_EMAIL_TEMPLATES_TAG_NEWSLETTER', $GLOBALS['STR_ADMIN_EMAIL_TEMPLATES_TAG_NEWSLETTER']);
379  $tpl->assign('STR_ADMIN_EMAIL_TEMPLATES_TAG_LINK_EXPLAIN', $GLOBALS['STR_ADMIN_EMAIL_TEMPLATES_TAG_LINK_EXPLAIN']);
380  $tpl->assign('STR_ADMIN_EMAIL_TEMPLATES_TAG_LINK_EXAMPLE', $GLOBALS['STR_ADMIN_EMAIL_TEMPLATES_TAG_LINK_EXAMPLE']);
381  $tpl->assign('STR_ADMIN_EMAIL_TEMPLATES_TAG_OTHER_AVAILABLE', $GLOBALS['STR_ADMIN_EMAIL_TEMPLATES_TAG_OTHER_AVAILABLE']);
382  return $tpl->fetch();
383 }
384 
get_site_name($site_ids, $skip_rights_check=false)
Retourne le nom d'un ou de plusieurs sites à partir de l'id.
Definition: fonctions.php:4763
static strip_tags($string, $allowed_tags=null)
String::strip_tags()
Definition: String.php:548
static strpos($haystack, $needle, $offset=0)
Returns the numeric position of the first occurrence of needle in the haystack string.
Definition: String.php:54
static getCleanHTML($text, $max_width=null, $allow_form=false, $allow_object=false, $allow_class=false, $additional_config=null, $safe=true, $additional_elements=null, $max_caracters_length=50000, $max_octets_length=59000, $max_word_and_url_length=100)
Fonction qui nettoie le HTML.
Definition: String.php:651
emailLinksExplanations()
emailLinksExplanations()
$tpl_langs
get_site_id_select_options($selected_site_id=null, $selected_site_name=null, $display_first_option=null, $select_current_site_id_by_default=false)
Créer les options pour le select qui liste les noms de sites configurés en back office.
$GLOBALS['DOC_TITLE']
nohtml_real_escape_string($value, $allowed_tags=null)
Protège les données pour insertion dans MySQL ET supprime les tags HTML pour protéger de toute sorte ...
Definition: database.php:400
$results_array
if(!empty($_GET['id'])) if(isset($_POST['form_name'], $_POST['form_subject'], $_POST['form_text'], $_POST['form_lang'])&&empty($_GET['id'])) if(empty($_GET['id'])) $tpl
real_escape_string($value)
real_escape_string()
Definition: database.php:374
static str_shorten_words($string, $length_limit=100, $separator=" ", $force_shorten_if_special_content=false, $add_separator_instead_of_cutting=true)
On rajoute des espaces à l'intérieur des mots trop longs => à utiliser pour éviter de casser une mise...
Definition: String.php:305
$tpl_options
necessite_priv($priv, $demo_allowed=true, $configuration_modification=false)
Cette fonction vérifie si l'utilisateur a les privilèges de $priv.
Definition: fonctions.php:1575
get_filter_site_cond($table_technical_code, $table_alias=null, $use_strict_rights_if_in_admin=false, $specific_site_id=null, $exclude_public_items=false, $admin_force_multisite_if_allowed=false)
Retourne la condition SQL permettant de filtrer les données pour une table.
Definition: fonctions.php:4643
query($query, $die_if_error=false, $database_object=null, $silent_if_error=false, $security_sql_filter=true)
The query() function is meant to be called anywhere you want to make a query.
Definition: database.php:158
vb(&$var, $default=null)
Variable blanche if $var n'est pas défini, retourne $default, sinon retourne $var.
Definition: format.php:97
if(strlen($date2)== '10') if($type== 'users-by-age'&&a_priv('admin_users', true)) elseif($type== 'forums-count'&&a_priv('admin_content', true)) elseif($type== 'forums-categories'&&a_priv('admin_content', true)) elseif($type== 'users-count'&&a_priv('admin_users', true)) elseif($type== 'product-categories'&&a_priv('admin_products', true)) elseif($type== 'users-by-sex'&&a_priv('admin_users', true)) elseif($type== 'users-by-country'&&a_priv('admin_users', true)) elseif($type== 'sales'&&a_priv('admin_sales', true))
Definition: chart-data.php:160
necessite_identification()
Si l'utilisateur n'est pas connecté à un compte, on affiche une page d'identification et arrête le sc...
Definition: fonctions.php:1596
fetch_assoc($query_result)
fetch_assoc()
Definition: database.php:283
if(!function_exists('affiche_liste_produits_acommander')) if(!function_exists('affiche_liste_articles')) get_email_template_options($option_id_nature= 'id', $category_id=null, $lang=null, $value_select=null, $get_signature=null)
Fonction affichant la liste d'emails sur le compte utilisateur.
get_form_token_input($name= 'general', $use_existing_token=true, $return_as_input_form=true)
get_form_token_input()
Definition: fonctions.php:94
get_site_wwwroot($site_id, $lang=null)
Renvoie l'URL d'un site donné
Definition: fonctions.php:4873
vn(&$var, $default=0)
Variable nulle if $var n'est pas défini, retourne $default, sinon retourne $var.
Definition: format.php:110
$form_error_object
verify_token($name= 'general', $delay_in_minutes=60, $check_referer_if_set_by_server=true, $cancel_token=true, $minimum_wait_in_seconds_before_use=0)
Vérification de la validité d'un token Par défaut, un token est valide 1h, et utilisable 1 seule fois...
Definition: fonctions.php:118
check_if_module_active($module_name, $specific_file_name=null)
Renvoie si un module est présent et activé ou non - Peut être appelé avant ou après le chargement d'u...
get_site_info($array)
get_site_info()
if(defined('IN_PEEL_ADMIN')||IN_INSTALLATION) $_SESSION['session_langue']

This documentation for Open ecommerce PEEL Shopping and PEEL.fr has been generated by Doxygen on Thu Oct 15 2015 14:29:08 - Peel ecommerce is a product of Agence web Advisto SAS. All rights reserved.