Example #1
0
function showPanel($chart_id, $panel_id, $help_msg, $analysis_msg)
{
    $panel_db = new PanelDB();
    $p = $panel_db->selectPanel($panel_id);
    if ($p["ishide"] == 1) {
        return;
    }
    $panel = new Panel();
    $panel->data = $p;
    $panel->data["left"] = $p["x"] . "px";
    $panel->data["top"] = $p["y"] . "px";
    //截图不需要显示这些
    if (!isset($_GET["snap"])) {
        $permission = new Permission();
        $isEditable = $permission->checkBoardEditPermission(DASHBOARD_ID, $_SESSION["email"]);
        $panel->addOptionHelp();
        if ($isEditable) {
            $panel->addOptionEdit();
            $panel->addOptionDataLock();
            if ($panel->data["analysis_show"] == "1") {
                $panel->addOptionAnalysis(1);
            } else {
                $panel->addOptionAnalysis();
            }
            //$panel->addOptionChangeSize();
            //$panel->data["dragable"]='dragable';
        }
    }
    //data["analysis_show"]=="1" 表示显示分析数据 ,如果显示分析数据:chart宽度60%,图标为打开;否则:width默认,图标为折叠样式
    if ($panel->data["analysis_show"] == "1") {
        $panel->data["content"] = "<div class='ichart' style='width:70%' id='chart{$chart_id}'></div>";
        $panel->data["content"] .= "<div class='ichart_analysis_msg showing'>{$analysis_msg}</div>";
        $panel->data["content"] .= "<div class='ichart_help_msg' style='width:70%'>{$help_msg}</div>";
    } else {
        $panel->data["content"] = "<div class='ichart' id='chart{$chart_id}'></div>";
        $panel->data["content"] .= "<div class='ichart_analysis_msg' style='display:none;'>{$analysis_msg}</div>";
        $panel->data["content"] .= "<div class='ichart_help_msg'>{$help_msg}</div>";
    }
    $panel->show();
}