14 define(
'IN_PEEL_ADMIN',
true);
15 include(
"../configuration.inc.php");
21 include(
$GLOBALS[
'repertoire_modele'] .
"/admin_haut.php");
26 switch (
vb($_REQUEST[
'mode'])) {
43 if(!empty($_GET[
'migrate'])) {
47 $query =
query(
"SELECT ps.*, pd.devise, pd.conversion, pd.symbole, pd.symbole_place, pd.code
49 LEFT JOIN peel_devises pd ON pd.id = ps.devise_defaut AND " .
get_filter_site_cond(
'devises') .
"
58 if(!in_array($this_key, array(
'id',
'devise',
'conversion',
'symbole',
'symbole_place',
'code'))) {
61 $frm[
'technical_code'] = $this_key;
62 $frm[
'string'] = $this_value;
63 $frm[
'origin'] =
'auto';
66 if(is_array($this_value)) {
67 $frm[
'type'] =
'array';
69 }
elseif(is_bool($this_value)) {
70 $frm[
'type'] =
'boolean';
72 $frm[
'string'] =
'true';
74 $frm[
'string'] =
'false';
76 }
elseif(is_int($this_value)) {
77 $frm[
'type'] =
'integer';
78 }
elseif(is_float($this_value)) {
79 $frm[
'type'] =
'float';
81 $frm[
'type'] =
'string';
83 $qid =
query(
"SELECT *
84 FROM peel_configuration
89 echo
'INSERTED '.$frm[
'technical_code'].
'<br />';
90 }
elseif(!empty($_GET[
'full'])) {
93 echo
'UPDATED '.$frm[
'technical_code'].
'<br />';
98 echo
$GLOBALS[
'tplEngine']->createTemplate(
'global_success.tpl', array(
'message' =>
'Generate OK'))->fetch();
107 echo
$GLOBALS[
'tplEngine']->createTemplate(
'global_success.tpl', array(
'message' => sprintf(
$GLOBALS[
'STR_ADMIN_CONFIGURATION_MSG_CREATED'],
vb($_POST[
'technical_code']))))->fetch();
118 if (!
verify_token($_SERVER[
'PHP_SELF'] . $frm[
'mode'] . $frm[
'id'])) {
123 echo
$GLOBALS[
'tplEngine']->createTemplate(
'global_success.tpl', array(
'message' => sprintf(
$GLOBALS[
'STR_ADMIN_CONFIGURATION_MSG_UPDATED'],
vn($_POST[
'id']))))->fetch();
138 include(
$GLOBALS[
'repertoire_modele'] .
"/admin_bas.php");
155 $frm[
'technical_code'] =
"";
160 $frm[
'site_id'] =
"";
162 $frm[
'nouveau_mode'] =
"insere";
181 $qid =
query(
"SELECT *
182 FROM peel_configuration
186 echo
$GLOBALS[
'tplEngine']->createTemplate(
'global_error.tpl', array(
'message' =>
$GLOBALS[
'STR_ADMIN_CONFIGURATION_ERR_NOT_FOUND']))->fetch();
191 $frm[
"nouveau_mode"] =
"maj";
192 $frm[
"titre_bouton"] =
$GLOBALS[
'STR_ADMIN_FORM_SAVE_CHANGES'];
205 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'admin_formulaire_configuration.tpl');
208 $tpl->assign(
'mode',
$frm[
"nouveau_mode"]);
209 $tpl->assign(
'id', intval(
$frm[
'id']));
212 'issel' =>
vb(
$frm[
'lang']) ==
'',
215 foreach (
$GLOBALS[
'admin_lang_codes'] as $lng) {
217 'issel' =>
vb(
$frm[
'lang']) == $lng,
218 'name' =>
$GLOBALS[
'lang_names'][$lng]
222 $tpl->assign(
'string_as_textarea',
true);
227 $tpl->assign(
'site_id_select_multiple', !empty(
$GLOBALS[
'site_parameters'][
'multisite_using_array_for_site_id']));
230 $tpl->assign(
'technical_code',
vb(
$frm[
'technical_code']));
233 $tpl->assign(
'STR_BEFORE_TWO_POINTS',
$GLOBALS[
'STR_BEFORE_TWO_POINTS']);
234 $tpl->assign(
'STR_ADMIN_WEBSITE',
$GLOBALS[
'STR_ADMIN_WEBSITE']);
235 $tpl->assign(
'STR_ADMIN_CONFIGURATION_FORM_TITLE',
$GLOBALS[
'STR_ADMIN_CONFIGURATION_FORM_TITLE']);
236 $tpl->assign(
'STR_ADMIN_LANGUAGE',
$GLOBALS[
'STR_ADMIN_LANGUAGE']);
238 $tpl->assign(
'STR_ADMIN_ONLINE',
$GLOBALS[
'STR_ADMIN_ONLINE']);
239 $tpl->assign(
'STR_ADMIN_OFFLINE',
$GLOBALS[
'STR_ADMIN_OFFLINE']);
240 $tpl->assign(
'STR_ADMIN_TECHNICAL_CODE',
$GLOBALS[
'STR_ADMIN_TECHNICAL_CODE']);
242 $tpl->assign(
'STR_ADMIN_CONFIGURATION_TEXT',
$GLOBALS[
'STR_ADMIN_CONFIGURATION_TEXT']);
243 $tpl->assign(
'STR_ADMIN_CONFIGURATION_ORIGIN',
$GLOBALS[
'STR_ADMIN_CONFIGURATION_ORIGIN']);
257 query(
"DELETE FROM peel_configuration
259 echo
$GLOBALS[
'tplEngine']->createTemplate(
'global_success.tpl', array(
'message' =>
$GLOBALS[
'STR_ADMIN_CONFIGURATION_MSG_DELETED']))->fetch();
269 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'admin_liste_configuration.tpl');
270 $tpl->assign(
'add_src',
$GLOBALS[
'administrer_url'] .
'/images/add.png');
272 $tpl->assign(
'drop_src',
$GLOBALS[
'administrer_url'] .
'/images/b_drop.png');
273 $tpl->assign(
'edit_src',
$GLOBALS[
'administrer_url'] .
'/images/b_edit.png');
275 FROM peel_configuration
278 $HeaderTitlesArray = array(
$GLOBALS[
'STR_ADMIN_ACTION'],
'lang' =>
$GLOBALS[
'STR_ADMIN_LANGUAGE'],
'type' =>
$GLOBALS[
'STR_TYPE'],
'technical_code' =>
$GLOBALS[
'STR_ADMIN_TECHNICAL_CODE'],
'string' =>
$GLOBALS[
'STR_VALUE'],
'last_update' =>
$GLOBALS[
'STR_DATE'],
'origin' =>
$GLOBALS[
'STR_ADMIN_CONFIGURATION_ORIGIN'],
'etat' =>
$GLOBALS[
'STR_STATUS'],
'site_id' =>
$GLOBALS[
'STR_ADMIN_SITE_ID']);
279 $Links->HeaderTitlesArray = $HeaderTitlesArray;
280 $Links->OrderDefault =
"site_id, technical_code, lang";
281 $Links->SortDefault =
"ASC";
284 $tpl_results = array();
287 $string = $ligne[
'string'];
289 $tpl->assign(
'HeaderRow',
$Links->getHeaderRow());
291 $comment .=
'<br /><span class="text-danger">(Current : ' . str_replace(array(
"Array,",
"),",
"(,",
",)"), array(
"Array ",
")",
"(",
")"), str_replace(array(
"\r\n",
"\n"),
',',
String::textEncode(print_r(
vb(
$GLOBALS[
'site_parameters'][$ligne[
'technical_code']]),
true)))).
')</span>';
293 $tpl_results[] = array(
'tr_rollover' => tr_rollover(
$i,
true),
295 'drop_href' =>
get_current_url(
false) .
'?mode=suppr&id=' . $ligne[
'id'],
296 'edit_href' =>
get_current_url(
false) .
'?mode=modif&id=' . $ligne[
'id'],
297 'lang' => $ligne[
'lang'],
299 'origin' => $ligne[
'origin'],
300 'site_id' => $ligne[
'site_id'],
301 'type' => $ligne[
'type'],
304 'etat_onclick' =>
'change_status("configuration", "' . $ligne[
'id'] .
'", this, "'.
$GLOBALS[
'administrer_url'] .
'")',
305 'etat_src' => $GLOBALS[
'administrer_url'] .
'/images/' . (empty($ligne[
'etat']) ?
'puce-blanche.gif' :
'puce-verte.gif')
309 $tpl->assign(
'results', $tpl_results);
311 $tpl->assign(
'Multipage',
$Links->GetMultipage());
313 $tpl->assign(
'is_welcome_ad_module_active',
true);
314 unset(
$_SESSION[
'session_info_inter_set']);
316 $tpl->assign(
'is_welcome_ad_module_active',
false);
318 $tpl->assign(
'STR_ADMIN_CONFIGURATION_TITLE',
$GLOBALS[
'STR_ADMIN_CONFIGURATION_TITLE']);
319 $tpl->assign(
'STR_ADMIN_CONFIGURATION_CREATE',
$GLOBALS[
'STR_ADMIN_CONFIGURATION_CREATE']);
320 $tpl->assign(
'STR_ADMIN_CONFIGURATION_EXPLAIN',
$GLOBALS[
'STR_ADMIN_CONFIGURATION_EXPLAIN']);
321 $tpl->assign(
'STR_BEFORE_TWO_POINTS',
$GLOBALS[
'STR_BEFORE_TWO_POINTS']);
322 $tpl->assign(
'STR_NOTA_BENE',
$GLOBALS[
'STR_NOTA_BENE']);
323 $tpl->assign(
'STR_ADMIN_ACTION',
$GLOBALS[
'STR_ADMIN_ACTION']);
324 $tpl->assign(
'STR_ADMIN_LANGUAGE',
$GLOBALS[
'STR_ADMIN_LANGUAGE']);
325 $tpl->assign(
'STR_ADMIN_TECHNICAL_CODE',
$GLOBALS[
'STR_ADMIN_TECHNICAL_CODE']);
330 $tpl->assign(
'STR_ADMIN_CONFIGURATION_ORIGIN',
$GLOBALS[
'STR_ADMIN_CONFIGURATION_ORIGIN']);
331 $tpl->assign(
'STR_ADMIN_DELETE_WARNING',
$GLOBALS[
'STR_ADMIN_DELETE_WARNING']);
333 $tpl->assign(
'STR_ADMIN_CONFIGURATION_UPDATE',
$GLOBALS[
'STR_ADMIN_CONFIGURATION_UPDATE']);
supprime_configuration($id)
Supprime la variable de configuration spécifiée par $id.
static textEncode($string, $suppr_endline=false, $encode_only_isolated_amperstands=false)
Méthode de compatibilité avec anciennes versions de PEEL utilisant textEncode au lieu de htmlentities...
static strpos($haystack, $needle, $offset=0)
Returns the numeric position of the first occurrence of needle in the haystack string.
get_current_url($with_get=true, $get_short_url=false, $take_away_get_args_array=null)
get_current_url()
affiche_formulaire_configuration(&$frm)
affiche_formulaire_configuration()
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.
real_escape_string($value)
real_escape_string()
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...
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.
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))
necessite_identification()
Si l'utilisateur n'est pas connecté à un compte, on affiche une page d'identification et arrête le sc...
affiche_liste_configuration()
Affiche la liste des variables de configuration pour tous les sites.
get_table_field_names($table_name, $link_identifier=null, $silent_if_error=false)
get_table_field_names()
affiche_formulaire_ajout_configuration(&$frm)
FONCTIONS.
fetch_assoc($query_result)
fetch_assoc()
update_configuration_variable($id_or_technical_code, $frm, $delete=false)
update_configuration_variable()
get_form_token_input($name= 'general', $use_existing_token=true, $return_as_input_form=true)
get_form_token_input()
affiche_formulaire_modif_configuration($id, &$frm)
Affiche le formulaire de modification pour la zone HTML sélectionnée.
set_configuration_variable($frm, $update_if_technical_code_exists=false, $allow_create=true)
Ajoute la zone HTML dans la table peel_configuration.
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...
static substr($string, $start, $length=null)
Returns the portion of string specified by the start and length parameters.
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']