$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');
    global $imagegallib;
    include_once 'lib/imagegals/imagegallib.php';
    $galleries = $imagegallib->list_visible_galleries(0, -1, 'name_asc', $user, '');
    $smarty->assign('galleries', $galleries['data']);
}
$cookietab = 1;