Пример #1
0
                $logslib->insert_image($_REQUEST['galleryId'], $graph, $ext, $title, $period);
            }
        } else {
            $renderer = new GD_GRenderer($widthGroup, $height, $ext);
            $graph = new $graphType();
            $graph->setData($series);
            $graph->setTitle($title);
            $graph->draw($renderer);
            imagecopy($background->gd, $renderer->gd, 0, 7 * ($height + $space), 0, 0, $renderer->width, $renderer->height);
        }
    }
    if ($prefs['feature_jpgraph'] == 'y') {
        $background->Stroke();
    } else {
        ob_start();
        $background->httpOutput("graph.{$ext}");
        $content = ob_get_contents();
        ob_end_flush();
    }
    die;
} elseif ($prefs['feature_jpgraph'] == 'y') {
    $smarty->assign('bgcolors', array('white', 'gray', 'silver', 'ivory', 'whitesmoke', 'beige', 'darkgrey'));
    //get_strings tra('white'), tra('gray'), tra('silver'), tra('ivory'), tra('whitesmoke'), tra('beige'),tra('darkgrey')
    $smarty->assign('defaultBgcolor', 'whitesmoke');
    $smarty->assign('defaultLegendBgcolor', 'white');
    $imagegallib = TikiLib::lib('imagegal');
    $galleries = $imagegallib->list_galleries(0, -1, 'name_asc', $user, '');
    $smarty->assign('galleries', $galleries['data']);
}
if (empty($_REQUEST)) {
    $startDate = $tikilib->make_time(0, 0, 0, $tikilib->date_format('%m'), $tikilib->date_format('%d'), $tikilib->date_format('%Y'));
						$logslib->insert_image($_REQUEST['galleryId'], $graph, $ext, $title, $period);
					}
				} else {
					$renderer = new GD_GRenderer($widthGroup, $height, $ext);
					$graph = new $graphType;
					$graph->setData($series);
					$graph->setTitle($title);
					$graph->draw($renderer);
					imagecopy($background->gd, $renderer->gd, 0, 7 * ($height + $space), 0, 0, $renderer->width, $renderer->height);
				}
			}
			if ($prefs['feature_jpgraph'] == 'y') {
				$background->Stroke();
			} else {
				ob_start();
				$background->httpOutput("graph.$ext");
				$content = ob_get_contents();
				ob_end_flush();
			}
			die;
} elseif ($prefs['feature_jpgraph'] == 'y') {
	$smarty->assign(
					'bgcolors',
					array(
							'white',
							'gray',
							'silver',
							'ivory',
							'whitesmoke',
							'beige',
							'darkgrey'