* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ function open_flash_chart_object_str( $width, $height, $url, $use_swfobject=true, $base='' ) { // // return the HTML as a string // return _ofc( $width, $height, $url, $use_swfobject, $base ); } function open_flash_chart_object( $width, $height, $url, $use_swfobject=true, $base='' ) { // // stream the HTML into the page // echo _ofc( $width, $height, $url, $use_swfobject, $base ); } function _ofc( $width, $height, $url, $use_swfobject, $base ) { // // I think we may use swfobject for all browsers, // not JUST for IE... // //$ie = strstr(getenv('HTTP_USER_AGENT'), 'MSIE'); // // escape the & and stuff: // $url = urlencode($url); // // output buffer // $out = array(); // // check for http or https: // if (isset ($_SERVER['HTTPS'])) { if (strtoupper ($_SERVER['HTTPS']) == 'ON') { $protocol = 'https'; } else { $protocol = 'http'; } } else { $protocol = 'http'; } // // if there are more than one charts on the // page, give each a different ID // global $open_flash_chart_seqno; $obj_id = 'chart'; $div_name = 'flashcontent'; //$out[] = ''; if( !isset( $open_flash_chart_seqno ) ) { $open_flash_chart_seqno = 1; $out[] = ''; } else { $open_flash_chart_seqno++; $obj_id .= '_'. $open_flash_chart_seqno; $div_name .= '_'. $open_flash_chart_seqno; } if( $use_swfobject ) { // Using library for auto-enabling Flash object on IE, disabled-Javascript proof $out[] = '
'; $out[] = ''; $out[] = ''; } return implode("\n",$out); }