14 define(
'IN_PEEL_ADMIN',
true);
15 include(
"../configuration.inc.php");
21 include(
$GLOBALS[
'repertoire_modele'] .
"/admin_haut.php");
26 switch (
vb($_REQUEST[
'mode'])) {
46 echo
$GLOBALS[
'tplEngine']->createTemplate(
'global_success.tpl', array(
'message' => sprintf(
$GLOBALS[
'STR_ADMIN_HTML_MSG_ZONE_CREATED'],
vb($_POST[
'titre']))))->fetch();
57 if (!
verify_token($_SERVER[
'PHP_SELF'] . $frm[
'mode'] . $frm[
'id'])) {
62 echo
$GLOBALS[
'tplEngine']->createTemplate(
'global_success.tpl', array(
'message' => sprintf(
$GLOBALS[
'STR_ADMIN_HTML_MSG_ZONE_UPDATED'],
vn($_POST[
'id']))))->fetch();
77 include(
$GLOBALS[
'repertoire_modele'] .
"/admin_bas.php");
95 $frm[
'contenu_html'] =
"";
97 if(!empty(
$GLOBALS[
'site_parameters'][
'site_country_allowed_array'])) {
98 $frm[
'site_country'] =
$GLOBALS[
'site_parameters'][
'site_country_allowed_array'];
102 $frm[
'nouveau_mode'] =
"insere";
104 $frm[
'emplacement'] =
"header";
122 $qid =
query(
"SELECT *
126 if(!empty(
$GLOBALS[
'site_parameters'][
'site_country_allowed_array'])) {
127 $frm[
'site_country'] = explode(
',',
vb(
$frm[
'site_country']));
130 echo
$GLOBALS[
'tplEngine']->createTemplate(
'global_error.tpl', array(
'message' =>
$GLOBALS[
'STR_ADMIN_HTML_ERR_ZONE_NOT_FOUND']))->fetch();
135 $frm[
"nouveau_mode"] =
"maj";
136 $frm[
"titre_bouton"] =
$GLOBALS[
'STR_ADMIN_FORM_SAVE_CHANGES'];
150 $emplacement_array[
'affiche_contenu_html_menu'] =
$GLOBALS[
'STR_ADMIN_HTML_PLACE_CONTENU_HTML_MENU'];
151 $emplacement_array[
'heade'] =
$GLOBALS[
'STR_ADMIN_HTML_PLACE_HEADER'];
152 $emplacement_array[
'footer'] =
$GLOBALS[
'STR_ADMIN_HTML_PLACE_FOOTER'];
153 $emplacement_array[
'home'] =
$GLOBALS[
'STR_ADMIN_HTML_PLACE_HOME'];
154 $emplacement_array[
'home_bottom'] =
$GLOBALS[
'STR_ADMIN_HTML_PLACE_HOME_BOTTOM'];
155 $emplacement_array[
'conversion_page'] =
$GLOBALS[
'STR_ADMIN_HTML_PLACE_CONVERSION_PAGE'];
156 $emplacement_array[
'footer_link'] =
$GLOBALS[
'STR_ADMIN_HTML_PLACE_FOOTER_LINK'];
157 $emplacement_array[
'interstitiel'] =
$GLOBALS[
'STR_ADMIN_HTML_PLACE_INTERSTITIEL'];
158 $emplacement_array[
'error404'] =
$GLOBALS[
'STR_ADMIN_HTML_PLACE_ERROR404'];
159 $emplacement_array[
'scrolling'] =
$GLOBALS[
'STR_ADMIN_HTML_PLACE_SCROLLING'];
160 $emplacement_array[
'contact_page'] =
$GLOBALS[
'STR_ADMIN_HTML_PLACE_CONTACT_PAGE'];
161 if(file_exists(
$GLOBALS[
'fonctionscarrousel'])){
162 $emplacement_array[
'entre_carrousel'] =
$GLOBALS[
'STR_ADMIN_HTML_PLACE_CARROUSEL_TOP'];
165 $emplacement_array[
'devenir_revendeur'] =
$GLOBALS[
'STR_ADMIN_HTML_PLACE_BECOME_RESELLER'];
167 if(file_exists(
$GLOBALS[
'fonctionspartenaires'])){
168 $emplacement_array[
'partner'] =
$GLOBALS[
'STR_ADMIN_HTML_PLACE_PARTNER'];
170 if(file_exists(
$GLOBALS[
'fonctionsresellermap'])){
171 $emplacement_array[
'reseller_map'] =
$GLOBALS[
'STR_ADMIN_HTML_PLACE_RESELLER_MAP'];
173 if(file_exists(
$GLOBALS[
'fonctionsannonces'])){
174 $emplacement_array[
'home_ad'] =
$GLOBALS[
'STR_ADMIN_HTML_PLACE_ADS_TOP'];
175 $emplacement_array[
'top_create_ad'] =
$GLOBALS[
'STR_ADMIN_HTML_PLACE_TOP_CREATE_AD'];
177 if(file_exists(
$GLOBALS[
'fonctionsparrain'])){
178 $emplacement_array[
'intro_parrainage'] =
$GLOBALS[
'STR_ADMIN_HTML_PLACE_INTRO_PARRAINAGE'];
180 if(!empty(
$GLOBALS[
'site_parameters'][
'short_order_process'])){
181 $emplacement_array[
'short_order_process'] =
$GLOBALS[
'STR_ADMIN_HTML_PLACE_END_SHORT_ORDER_PROCESS'];
183 if(empty($emplacement_array[
vb(
$frm[
'emplacement'])])){
184 $emplacement_array[
vb(
$frm[
'emplacement'])] = str_replace(
'_',
' ', ucfirst(
vb(
$frm[
'emplacement'])));
186 asort($emplacement_array);
188 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'admin_formulaire_home.tpl');
191 $tpl->assign(
'mode',
$frm[
"nouveau_mode"]);
192 $tpl->assign(
'id', intval(
$frm[
'id']));
194 $tpl->assign(
'site_id_select_multiple', !empty(
$GLOBALS[
'site_parameters'][
'multisite_using_array_for_site_id']));
195 if(!empty(
$GLOBALS[
'site_parameters'][
'site_country_allowed_array'])) {
199 foreach (
$GLOBALS[
'admin_lang_codes'] as $lng) {
201 'issel' =>
vb(
$frm[
'lang']) == $lng,
202 'name' =>
$GLOBALS[
'lang_names'][$lng]
207 $tpl->assign(
'emplacement',
vb(
$frm[
'emplacement']));
208 $tpl->assign(
'emplacement_array', $emplacement_array);
212 $tpl->assign(
'STR_ADMIN_WEBSITE',
$GLOBALS[
'STR_ADMIN_WEBSITE']);
213 if(!empty(
$GLOBALS[
'site_parameters'][
'site_country_allowed_array'])) {
214 $tpl->assign(
'STR_ADMIN_SITE_COUNTRY',
$GLOBALS[
'STR_ADMIN_SITE_COUNTRY']);
216 $tpl->assign(
'STR_BEFORE_TWO_POINTS',
$GLOBALS[
'STR_BEFORE_TWO_POINTS']);
217 $tpl->assign(
'STR_ADMIN_HTML_FORM_TITLE',
$GLOBALS[
'STR_ADMIN_HTML_FORM_TITLE']);
218 $tpl->assign(
'STR_ADMIN_LANGUAGE',
$GLOBALS[
'STR_ADMIN_LANGUAGE']);
220 $tpl->assign(
'STR_ADMIN_ONLINE',
$GLOBALS[
'STR_ADMIN_ONLINE']);
221 $tpl->assign(
'STR_ADMIN_OFFLINE',
$GLOBALS[
'STR_ADMIN_OFFLINE']);
222 $tpl->assign(
'STR_ADMIN_HTML_PLACE_END_SHORT_ORDER_PROCESS',
$GLOBALS[
'STR_ADMIN_HTML_PLACE_END_SHORT_ORDER_PROCESS']);
223 $tpl->assign(
'STR_ADMIN_HTML_PLACE',
$GLOBALS[
'STR_ADMIN_HTML_PLACE']);
224 $tpl->assign(
'STR_ADMIN_HTML_PLACE_CONTENU_HTML_MENU',
$GLOBALS[
'STR_ADMIN_HTML_PLACE_CONTENU_HTML_MENU']);
225 $tpl->assign(
'STR_ADMIN_HTML_PLACE_HEADER',
$GLOBALS[
'STR_ADMIN_HTML_PLACE_HEADER']);
226 $tpl->assign(
'STR_ADMIN_HTML_PLACE_FOOTER',
$GLOBALS[
'STR_ADMIN_HTML_PLACE_FOOTER']);
227 $tpl->assign(
'STR_ADMIN_HTML_PLACE_HOME',
$GLOBALS[
'STR_ADMIN_HTML_PLACE_HOME']);
228 $tpl->assign(
'STR_ADMIN_HTML_PLACE_HOME_BOTTOM',
$GLOBALS[
'STR_ADMIN_HTML_PLACE_HOME_BOTTOM']);
229 $tpl->assign(
'STR_ADMIN_HTML_PLACE_CONVERSION_PAGE',
$GLOBALS[
'STR_ADMIN_HTML_PLACE_CONVERSION_PAGE']);
230 $tpl->assign(
'STR_ADMIN_HTML_PLACE_FOOTER_LINK',
$GLOBALS[
'STR_ADMIN_HTML_PLACE_FOOTER_LINK']);
231 $tpl->assign(
'STR_ADMIN_HTML_PLACE_INTERSTITIEL',
$GLOBALS[
'STR_ADMIN_HTML_PLACE_INTERSTITIEL']);
232 $tpl->assign(
'STR_ADMIN_HTML_PLACE_ERROR404',
$GLOBALS[
'STR_ADMIN_HTML_PLACE_ERROR404']);
233 $tpl->assign(
'STR_ADMIN_HTML_PLACE_SCROLLING',
$GLOBALS[
'STR_ADMIN_HTML_PLACE_SCROLLING']);
234 $tpl->assign(
'STR_ADMIN_HTML_PLACE_CONTACT_PAGE',
$GLOBALS[
'STR_ADMIN_HTML_PLACE_CONTACT_PAGE']);
235 $tpl->assign(
'STR_ADMIN_HTML_PLACE_CARROUSEL_TOP',
$GLOBALS[
'STR_ADMIN_HTML_PLACE_CARROUSEL_TOP']);
236 $tpl->assign(
'STR_ADMIN_HTML_PLACE_BECOME_RESELLER',
$GLOBALS[
'STR_ADMIN_HTML_PLACE_BECOME_RESELLER']);
237 $tpl->assign(
'STR_ADMIN_HTML_PLACE_PARTNER',
$GLOBALS[
'STR_ADMIN_HTML_PLACE_PARTNER']);
238 $tpl->assign(
'STR_ADMIN_HTML_PLACE_RESELLER_MAP',
$GLOBALS[
'STR_ADMIN_HTML_PLACE_RESELLER_MAP']);
239 $tpl->assign(
'STR_ADMIN_HTML_PLACE_ADS_TOP',
$GLOBALS[
'STR_ADMIN_HTML_PLACE_ADS_TOP']);
240 $tpl->assign(
'STR_ADMIN_HTML_PLACE_TOP_CREATE_AD',
$GLOBALS[
'STR_ADMIN_HTML_PLACE_TOP_CREATE_AD']);
241 $tpl->assign(
'STR_ADMIN_HTML_PLACE_TOP_CREATE_AD',
$GLOBALS[
'STR_ADMIN_HTML_PLACE_TOP_CREATE_AD']);
242 $tpl->assign(
'STR_ADMIN_HTML_PLACE_INTRO_PARRAINAGE',
$GLOBALS[
'STR_ADMIN_HTML_PLACE_INTRO_PARRAINAGE']);
243 $tpl->assign(
'STR_ADMIN_TITLE_NOT_DISPLAYED',
$GLOBALS[
'STR_ADMIN_TITLE_NOT_DISPLAYED']);
244 $tpl->assign(
'STR_ADMIN_HTML_TEXT',
$GLOBALS[
'STR_ADMIN_HTML_TEXT']);
245 $tpl->assign(
'STR_ADMIN_HTML_PHOTOS_WARNING',
$GLOBALS[
'STR_ADMIN_HTML_PHOTOS_WARNING']);
259 echo
$GLOBALS[
'tplEngine']->createTemplate(
'global_success.tpl', array(
'message' =>
$GLOBALS[
'STR_ADMIN_HTML_MSG_ZONE_DELETED']))->fetch();
270 $sql =
"INSERT INTO peel_html (etat, titre, contenu_html, o_timestamp, a_timestamp, emplacement, lang, site_id";
271 if(!empty(
$GLOBALS[
'site_parameters'][
'site_country_allowed_array'])) {
272 $sql .=
", site_country";
276 if(!empty(
$GLOBALS[
'site_parameters'][
'site_country_allowed_array'])) {
292 $sql =
"UPDATE peel_html
293 SET etat = '" . intval(
$frm[
'etat']) .
"'
296 ".(!empty(
$GLOBALS[
'site_parameters'][
'site_country_allowed_array'])?
", site_country = '" .
real_escape_string(implode(
',',
vb(
$frm[
'site_country'], array()))) .
"'":
"").
"
299 , a_timestamp = '" . date(
'Y-m-d H:i:s', time()) .
"'
301 WHERE id = '" . intval(
$id) .
"'";
312 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'admin_liste_home.tpl');
313 $tpl->assign(
'add_src',
$GLOBALS[
'administrer_url'] .
'/images/add.png');
315 $tpl->assign(
'drop_src',
$GLOBALS[
'administrer_url'] .
'/images/b_drop.png');
316 $tpl->assign(
'edit_src',
$GLOBALS[
'administrer_url'] .
'/images/b_edit.png');
320 ORDER BY a_timestamp DESC");
322 $tpl_results = array();
325 $tmpLigne = array(
'tr_rollover' => tr_rollover(
$i,
true),
327 'titre' => $ligne[
'titre'],
328 'drop_href' =>
get_current_url(
false) .
'?mode=suppr&id=' . $ligne[
'id'],
329 'edit_href' =>
get_current_url(
false) .
'?mode=modif&id=' . $ligne[
'id'],
330 'lang' => $ligne[
'lang'],
332 'emplacement' => $ligne[
'emplacement'],
333 'etat_onclick' =>
'change_status("html", "' . $ligne[
'id'] .
'", this, "'.
$GLOBALS[
'administrer_url'] .
'")',
334 'etat_src' => $GLOBALS[
'administrer_url'] .
'/images/' . (empty($ligne[
'etat']) ?
'puce-blanche.gif' :
'puce-verte.gif')
336 if(!empty($GLOBALS[
'site_parameters'][
'site_country_allowed_array'])) {
339 $tpl_results[] = $tmpLigne;
342 $tpl->assign(
'results', $tpl_results);
345 $tpl->assign(
'is_welcome_ad_module_active',
true);
346 unset(
$_SESSION[
'session_info_inter_set']);
348 $tpl->assign(
'is_welcome_ad_module_active',
false);
350 $tpl->assign(
'STR_ADMIN_HTML_TITLE',
$GLOBALS[
'STR_ADMIN_HTML_TITLE']);
351 $tpl->assign(
'STR_ADMIN_HTML_CREATE',
$GLOBALS[
'STR_ADMIN_HTML_CREATE']);
352 $tpl->assign(
'STR_ADMIN_HTML_EXPLAIN',
$GLOBALS[
'STR_ADMIN_HTML_EXPLAIN']);
353 $tpl->assign(
'STR_ADMIN_WEBSITE',
$GLOBALS[
'STR_ADMIN_WEBSITE']);
354 if(!empty(
$GLOBALS[
'site_parameters'][
'site_country_allowed_array'])) {
355 $tpl->assign(
'STR_ADMIN_SITE_COUNTRY',
$GLOBALS[
'STR_ADMIN_SITE_COUNTRY']);
357 $tpl->assign(
'STR_BEFORE_TWO_POINTS',
$GLOBALS[
'STR_BEFORE_TWO_POINTS']);
358 $tpl->assign(
'STR_NOTA_BENE',
$GLOBALS[
'STR_NOTA_BENE']);
359 $tpl->assign(
'STR_ADMIN_ACTION',
$GLOBALS[
'STR_ADMIN_ACTION']);
360 $tpl->assign(
'STR_ADMIN_LANGUAGE',
$GLOBALS[
'STR_ADMIN_LANGUAGE']);
361 $tpl->assign(
'STR_ADMIN_TITLE',
$GLOBALS[
'STR_ADMIN_TITLE']);
365 $tpl->assign(
'STR_ADMIN_PLACE',
$GLOBALS[
'STR_ADMIN_PLACE']);
366 $tpl->assign(
'STR_ADMIN_DELETE_WARNING',
$GLOBALS[
'STR_ADMIN_DELETE_WARNING']);
368 $tpl->assign(
'STR_ADMIN_HTML_UPDATE',
$GLOBALS[
'STR_ADMIN_HTML_UPDATE']);
369 $tpl->assign(
'STR_ADMIN_HTML_DELETE_COOKIE_LINK',
$GLOBALS[
'STR_ADMIN_HTML_DELETE_COOKIE_LINK']);
get_site_name($site_ids, $skip_rights_check=false)
Retourne le nom d'un ou de plusieurs sites à partir de l'id.
getTextEditor($instance_name, $width, $height, $default_text, $default_path=null, $type_html_editor=0, $compter_char_max_if_enabled=255, $placeholder= '')
getTextEditor()
get_current_url($with_get=true, $get_short_url=false, $take_away_get_args_array=null)
get_current_url()
affiche_formulaire_ajout_home(&$frm)
FONCTIONS.
insere_home($frm)
Ajoute la zone HTML dans la table peel_html.
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.
static html_entity_decode_if_needed($string)
String::html_entity_decode_if_needed()
word_real_escape_string($value)
Applique real_escape_string dans le cas où on n'insère qu'un seul mot, de moins de 30 caractères...
supprime_home($id)
Supprime la zone HTML spécifié par $id.
get_site_country_checkboxes($selected_site_country_array=null, $field_name= 'site_country')
Créer les options pour le select qui liste les noms de pays de visiteurs configurés.
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 ...
affiche_formulaire_home(&$frm)
affiche_formulaire_home()
affiche_formulaire_modif_home($id, &$frm)
Affiche le formulaire de modification pour la zone HTML sélectionnée.
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()
necessite_priv($priv, $demo_allowed=true, $configuration_modification=false)
Cette fonction vérifie si l'utilisateur a les privilèges de $priv.
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.
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.
maj_home($id, $frm)
maj_home()
necessite_identification()
Si l'utilisateur n'est pas connecté à un compte, on affiche une page d'identification et arrête le sc...
num_rows($query_result)
num_rows()
fetch_assoc($query_result)
fetch_assoc()
affiche_liste_home()
affiche_liste_home()
get_form_token_input($name= 'general', $use_existing_token=true, $return_as_input_form=true)
get_form_token_input()
get_site_id_sql_set_value($site_ids)
Retourne la valeur SQL d'un champ INT ou SET suivant que ce soit un entier ou un tableau.
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...
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...
if(defined('IN_PEEL_ADMIN')||IN_INSTALLATION) $_SESSION['session_langue']
get_country_name($id)
Renvoie le nom d'un pays.