PEEL Shopping
Open source ecommerce : PEEL Shopping
admin_haut.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: admin_haut.php 46935 2015-09-18 08:49:48Z gboussin $
14 if (!defined('IN_PEEL')) {
15  die();
16 }
17 
18 $tpl = $GLOBALS['tplEngine']->createTemplate('admin_haut.tpl');
19 $tpl->assign('lang', $_SESSION['session_langue']);
20 $tpl->assign('sortie_href', get_url('sortie'));
21 $tpl->assign('STR_ADMIN_DISCONNECT', $GLOBALS['STR_ADMIN_DISCONNECT']);
22 $tpl->assign('doc_title', String::ucfirst(String::str_shorten(trim(String::strip_tags(String::html_entity_decode_if_needed(str_replace(array("\r", "\n"), '', vb($GLOBALS['DOC_TITLE']))))), 80, '', '', 65)));
23 $tpl->assign('administrer_url', $GLOBALS['administrer_url']);
24 $tpl->assign('wwwroot_in_admin', $GLOBALS['wwwroot_in_admin']);
25 if($_SESSION['session_langue'] == 'fr') {
26  $tpl->assign('generator', 'https://www.peel.fr/');
27 } else {
28  $tpl->assign('generator', 'http://www.peel-shopping.com/');
29 }
30 if (!IN_INSTALLATION) {
31  $admin_welcome = $GLOBALS['STR_HELLO'] . '&nbsp;' . vb($_SESSION['session_utilisateur']['prenom']) . '';
32 } else {
33  $admin_welcome = $GLOBALS['STR_HELLO'];
34 }
35 if (String::strpos($GLOBALS['DOC_TITLE'], '<a ') === false) {
36  $tpl->assign('page_title', str_replace($GLOBALS['site'], '<a href="' . $GLOBALS['wwwroot'] . '/">' . $GLOBALS['site'] . '</a>', $GLOBALS['DOC_TITLE']));
37 } else {
38  // Un lien est déjà présent dans DOC_TITLE, il ne faut pas faire de remplacement de lien.
39  $tpl->assign('page_title', $GLOBALS['DOC_TITLE']);
40 }
41 $tpl->assign('admin_welcome', $admin_welcome);
42 $tpl->assign('logo_src', get_url('/images/logo-peel-admin.png'));
43 $tpl->assign('admin_menu', get_admin_menu());
44 $tpl->assign('is_demo_error', ((empty($_COOKIE['demo_warning_close']) || $_COOKIE['demo_warning_close']!='closed') && a_priv('demo')));
45 $tpl->assign('flags', affiche_flags(true, null, false, $GLOBALS['admin_lang_codes'], false, 26));
46 $tpl->assign('site', $GLOBALS['site']);
47 $tpl->assign('GENERAL_ENCODING', GENERAL_ENCODING);
48 $tpl->assign('IN_INSTALLATION', IN_INSTALLATION);
49 $tpl->assign('STR_ADMIN_DEMO_WARNING', $GLOBALS['STR_ADMIN_DEMO_WARNING']);
50 $tpl->assign('STR_ADMINISTRATION', $GLOBALS['STR_ADMINISTRATION']);
51 if (!empty($GLOBALS['site_parameters']['favicon'])) {
52  $tpl->assign('favicon_href', $GLOBALS['repertoire_upload'] . '/' . $GLOBALS['site_parameters']['favicon']);
53 }
54 $GLOBALS['js_files'][-10] = $GLOBALS['wwwroot_in_admin'] . '/lib/js/jquery.js';
55 $GLOBALS['js_files'][-5] = $GLOBALS['wwwroot_in_admin'] . '/lib/js/jquery-ui.js';
56 if (check_if_module_active('annonces')) {
57  $GLOBALS['css_files'][] = $GLOBALS['wwwroot_in_admin'] . '/modules/annonces/rating_bar/rating.css';
58  $GLOBALS['js_files'][] = $GLOBALS['wwwroot_in_admin'] . '/modules/annonces/rating_bar/js/rating.js';
59 }
60 $GLOBALS['js_files'][] = $GLOBALS['wwwroot_in_admin'] . '/lib/js/advisto.js';
61 $GLOBALS['js_files'][] = $GLOBALS['wwwroot_in_admin'] . '/lib/js/admin_all_functions.js';
62 if (vn($GLOBALS['site_parameters']['html_editor']) == '1') {
63  $GLOBALS['js_files'][] = $GLOBALS['wwwroot_in_admin'] . '/lib/nicEditor/nicEdit.js';
64 }
65 $GLOBALS['css_files'][] = $GLOBALS['wwwroot_in_admin'] . '/lib/css/jquery-ui.css';
66 if(file_exists($GLOBALS['dirroot'] . '/lib/js/jquery.ui.datepicker-'.$_SESSION['session_langue'].'.js')) {
67  // Configuration pour une langue donnée
68  $GLOBALS['js_files'][] = $GLOBALS['wwwroot_in_admin'] . '/lib/js/jquery.ui.datepicker-'.$_SESSION['session_langue'].'.js';
69 }
70 $GLOBALS['js_ready_content_array'][] = get_datepicker_javascript(!empty($GLOBALS['load_timepicker']));
71 
72 if (vb($GLOBALS['site_parameters']['enable_prototype']) == 1 && empty($GLOBALS['site_parameters']['bootstrap_enabled'])) {
73  // Attention, prototype.js a des incompatibilités avec Bootstrap
74  $GLOBALS['js_files'][] = $GLOBALS['wwwroot_in_admin'] . '/lib/js/prototype.js';
75  $GLOBALS['js_files'][] = $GLOBALS['wwwroot_in_admin'] . '/lib/js/effects.js';
76  $GLOBALS['js_files'][] = $GLOBALS['wwwroot_in_admin'] . '/lib/js/controls.js';
77 }
78 if (!IN_INSTALLATION) {
79  if (check_if_module_active('forum')) {
80  $GLOBALS['js_files'][] = $GLOBALS['wwwroot_in_admin'] . '/modules/forum/forum.js';
81  }
82  if (check_if_module_active('webmail')) {
83  $GLOBALS['js_files'][] = $GLOBALS['wwwroot_in_admin'] . '/modules/webmail/administrer/function.js';
84  }
85 }
86 if (vb($GLOBALS['site_parameters']['used_uploader']) == 'fineuploader') {
87  // Par défaut on peut utiliser fineuploader sur toutes les pages de l'administration
89 }
90 // Bootstrap obligatoire dans l'administration
91 $GLOBALS['css_files'][] = $GLOBALS['wwwroot_in_admin'] . '/lib/css/bootstrap.css';
92 $GLOBALS['js_files'][] = $GLOBALS['wwwroot_in_admin'] . '/lib/js/bootstrap.js';
93 // On met en dernier fichiers CSS du site pour qu'ils aient priorité
94 $GLOBALS['css_files'][] = $GLOBALS['repertoire_css'] . '/admin.css';
95 // Pour PHP 32 bits, les dates ne doivent pas aller avant 1902 et après 2038, car l'intervalle de validité d'un timestamp va du Vendredi 13 Décembre 1901 20:45:54 UTC au Mardi 19 Janvier 2038 03:14:07 UTC.
96 if(!empty($GLOBALS['sortable_rpc'])) {
97  $GLOBALS['js_ready_content_array'][] = '
98  $(".sortable").sortable({
99  placeholder: "highlight",
100  opacity: 0.6,
101  axis: "y",
102  delay: 150,
103  placeholder: "horizontal_placeholder",
104  forcePlaceholderSize: true,
105  helper: function(e, tr)
106  {
107  // Correctif pour la largeur de la ligne déplacée
108  var $originals = tr.children();
109  var $helper = tr.clone();
110  $helper.children().each(function(index)
111  {
112  // Set helper cell sizes to match the original sizes
113  $(this).width($originals.eq(index).width())
114  });
115  return $helper;
116  },
117  update: function() {
118  var order = $(this).sortable("serialize");
119  $.post("'.$GLOBALS['administrer_url'] . '/' . $GLOBALS['sortable_rpc'].'", order);
120  $(".position").fadeTo(600,0.2);
121  }
122  });
123  if ($(".admin_commande_details").length==0) {
124  $(".sortable").disableSelection(); // on désactive la possibilité au navigateur de faire des sélections, sauf dans la page de commande.
125  }
126 ';
127 }
128 $tpl->assign('output_create_or_update_order', vb($GLOBALS['output_create_or_update_order']));
129 $tpl->assign('notification_output', implode('', $GLOBALS['notification_output_array']));
130 $tpl->assign('css_files', get_css_files_to_load(!empty($GLOBALS['site_parameters']['minify_css'])));
131 // Les fichiers js sont traités dans le footer
132 $tpl->assign('js_files', null);
134 echo $tpl->fetch();
135 
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
output_general_http_header($page_encoding=null, $cache_duration_in_seconds=null)
Envoie les headers avant l'envoi du HTML.
Definition: fonctions.php:1528
get_admin_menu()
get_admin_menu()
static html_entity_decode_if_needed($string)
String::html_entity_decode_if_needed()
Definition: String.php:533
const IN_INSTALLATION
Definition: bdd.php:14
vb(&$var, $default=null)
Variable blanche if $var n'est pas défini, retourne $default, sinon retourne $var.
Definition: format.php:97
if(!empty($GLOBALS['site_parameters']['favicon'])) $GLOBALS['js_files'][-10]
Definition: admin_haut.php:54
vn(&$var, $default=0)
Variable nulle if $var n'est pas défini, retourne $default, sinon retourne $var.
Definition: format.php:110
get_css_files_to_load($minify=false)
get_css_files_to_load()
Definition: fonctions.php:1504
a_priv($requested_priv, $demo_allowed=false, $site_configuration_modification=false, $user_id=null)
Renvoie true si l'utilisateur de la session a le privilège $requested_priv ou un droit supérieur Des ...
Definition: user.php:63
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...
static str_shorten($string, $length_limit, $middle_separator= '', $ending_if_no_middle_separator= '...', $ideal_length_with_clean_cut_if_possible=null)
Raccourcit une chaine de caractère en insérant au milieu ou à la fin un séparateur.
Definition: String.php:233
static ucfirst($string)
Returns string with first letter uppercase.
Definition: String.php:173
get_datepicker_javascript($load_timepicker=false)
get_datepicker_javascript()
Definition: fonctions.php:1443
if(!defined('IN_PEEL')) $tpl
Definition: admin_haut.php:18
init_fineuploader_interface()
Définit les variables javascript nécessaires pour initialiser fineuploader.
Definition: fonctions.php:5388
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:41:22 - Peel ecommerce is a product of Agence web Advisto SAS. All rights reserved.