예제 #1
0
} elseif ($stufftype == 'Notebook') {
    $contents = $homeObj->getNoteBookContents($stuffid);
    $smarty->assign("NOTEBOOK_CONTENTS", $contents);
    $smarty->assign("NOTEBOOKID", $stuffid);
    $smarty->display("Home/notebook.tpl");
} elseif ($stufftype == 'URL') {
    $url = $homeObj->getWidgetURL($stuffid);
    if (strpos($url, "://") === false) {
        $url = "http://" . trim($url);
    }
    $smarty->assign("URL", $url);
    $smarty->assign("WIDGETID", $stuffid);
    $smarty->display("Home/HomeWidgetURL.tpl");
} else {
    $homestuff_values = $homeObj->getHomePageStuff($stuffid, $stufftype);
    if ($stufftype == "DashBoard") {
        $homeObj->getDashDetails($stuffid, 'type');
        $dashdet = $homeObj->dashdetails;
    }
    if ($stufftype == "ReportCharts") {
        $homeObj->getReportChartDetails($stuffid, 'type');
        $dashdet = $homeObj->reportdetails;
    }
}
$smarty->assign("DASHDETAILS", $dashdet);
$smarty->assign("HOME_STUFFTYPE", $stufftype);
$smarty->assign("HOME_STUFFID", $stuffid);
$smarty->assign("HOME_STUFF", $homestuff_values);
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->display("Home/HomeBlock.tpl");
    } elseif ($widgetType == 'Notebook') {
        $contents = $homeObj->getNoteBookContents($widgetId);
        $smarty->assign("NOTEBOOK_CONTENTS", $contents);
        $smarty->assign("NOTEBOOKID", $widgetId);
        $html = $smarty->fetch("Home/notebook.tpl");
    } elseif ($widgetType == 'URL') {
        $url = $homeObj->getWidgetURL($widgetId);
        if (strpos($url, "://") === false) {
            $url = "http://" . trim($url);
        }
        $smarty->assign("URL", $url);
        $smarty->assign("WIDGETID", $widgetId);
        $html = $smarty->fetch("Home/HomeWidgetURL.tpl");
    } else {
        $homestuff_values = $homeObj->getHomePageStuff($widgetId, $widgetType);
        $html = '';
        if ($widgetType == "DashBoard") {
            $homeObj->getDashDetails($widgetId, 'type');
            $dashdet = $homeObj->dashdetails;
            $smarty->assign("DASHDETAILS", $dashdet);
        }
    }
    $smarty->assign("HOME_STUFFTYPE", $widgetType);
    $smarty->assign("HOME_STUFFID", $widgetId);
    $smarty->assign("HOME_STUFF", $homestuff_values);
    $smarty->assign("THEME", $theme);
    $smarty->assign("IMAGE_PATH", $image_path);
    $html .= $smarty->fetch("Home/HomeBlock.tpl");
    $widgetHTML[$widgetId] = $html;
}
echo Zend_JSON::encode($widgetHTML);