PEEL Shopping
Open source ecommerce : PEEL Shopping
open_flash_chart_object.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: open_flash_chart_object.php 46935 2015-09-18 08:49:48Z gboussin $
14 if (!defined('IN_PEEL')) {
15  die();
16 }
17 
28 function open_flash_chart_object_str($width, $height, $url, $use_swfobject = true, $base = '')
29 {
30  if(empty($base)){
31  $base = $GLOBALS['wwwroot'] . '/modules/chart/';
32  }
33  // return the HTML as a string
34 
35  return _ofc($width, $height, $url, $use_swfobject, $base);
36 }
37 
48 function open_flash_chart_object($width, $height, $url, $use_swfobject = true, $base = '')
49 {
50  if(empty($base)){
51  $base = $GLOBALS['wwwroot'] . '/modules/chart/';
52  }
53  // stream the HTML into the page
54 
55  echo _ofc($width, $height, $url, $use_swfobject, $base);
56 }
57 
68 function _ofc($width, $height, $url, $use_swfobject, $base)
69 {
70  // I think we may use swfobject for all browsers,
71  // not JUST for IE...
72 
73  // $ie = strstr(getenv('HTTP_USER_AGENT'), 'MSIE');
74 
75  // escape the & and stuff:
76  $url = urlencode($url);
77 
78  // output buffer
79  $out = array();
80 
81  // check for http or https:
82  if (isset ($_SERVER['HTTPS'])) {
83  if (strtoupper ($_SERVER['HTTPS']) == 'ON') {
84  $protocol = 'https';
85  } else {
86  $protocol = 'http';
87  }
88  } else {
89  $protocol = 'http';
90  }
91 
92  // if there are more than one charts on the
93  // page, give each a different ID
94 
95  global $open_flash_chart_seqno;
96  $obj_id = 'chart';
97  $div_name = 'flashcontent';
98  // $out[] = '<script src="'. $base .'js/ofc.js"></script>';
99  $tpl = $GLOBALS['tplEngine']->createTemplate('modules/chart_ofc.tpl');
100 
101  if (!isset($open_flash_chart_seqno)) {
102  $open_flash_chart_seqno = 1;
103  $tpl->assign('swfobject_src', get_url('/lib/js/swfobject.js'));
104  } else {
105  $open_flash_chart_seqno++;
106  $obj_id .= '_' . $open_flash_chart_seqno;
107  $div_name .= '_' . $open_flash_chart_seqno;
108  }
109 
110  $tpl->assign('use_swfobject', $use_swfobject);
111  $tpl->assign('div_name', $div_name);
112  $tpl->assign('base', $base);
113  $tpl->assign('obj_id', $obj_id);
114  $tpl->assign('width', $width);
115  $tpl->assign('height', $height);
116  $tpl->assign('url', $url);
117  $tpl->assign('protocol', $protocol);
118  return $tpl->fetch();
119 }
120 
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
_ofc($width, $height, $url, $use_swfobject, $base)
_ofc()
$GLOBALS['page_columns_count']
open_flash_chart_object($width, $height, $url, $use_swfobject=true, $base= '')
open_flash_chart_object()
if(!defined('IN_PEEL')) open_flash_chart_object_str($width, $height, $url, $use_swfobject=true, $base= '')
open_flash_chart_object_str()

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