dataTableTemplate = 'UserSettings/templates/graph.tpl'; $this->disableOffsetInformation(); $this->disableExcludeLowPopulation(); $this->disableSearchBox(); } public function main() { if($this->mainAlreadyExecuted) { return; } $this->mainAlreadyExecuted = true; $view = new Piwik_View($this->dataTableTemplate); $this->id = $this->getUniqIdTable(); $view->id = $this->id; $view->method = $this->method; $mappingTypeToGenerator = array ( 'graphVerticalBar' => 'generateDataChartVerticalBar', 'graphPie' => 'generateDataChartPie', ); $parametersToModify = array( 'viewDataTable' => $mappingTypeToGenerator[$this->typeViewRequested]); $url = Piwik_Url::getCurrentQueryStringWithParametersModified($parametersToModify); $view->jsInvocationTag = $this->getFlashInvocationCode($url); // print($url);exit; $view->urlData = $url; $view->codeEmbed = $this->codeEmbed; $view->javascriptVariablesToSet = $this->getJavascriptVariablesToSet(); $this->view = $view; } protected function getCodeEmbed( $url ) { } protected function getFlashInvocationCode( $url = 'libs/open-flash-chart/data-files/nodata.txt', $width = 500, $height = 250, $use_swfobject = true ) { $libPathInPiwik = 'libs/open-flash-chart/'; $currentPath = Piwik_Url::getCurrentUrlWithoutFileName(); $pathToLibraryOpenChart = $currentPath . $libPathInPiwik; $url = $currentPath . $url; $div_name = $this->id; $obj_id = $this->id . "_chart"; $div_name = $this->id . "_flashContent"; // 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); $return = ''; if( $use_swfobject ) { // Using library for auto-enabling Flash object on IE, disabled-Javascript proof $return .= '
'; } return $return; } }