$widgetHTML = array(); $smarty = new vtigerCRM_Smarty(); $smarty->assign("MOD", $mod_strings); $smarty->assign("APP", $app_strings); $smarty->assign("THEME", $theme); $smarty->assign("IMAGE_PATH", $image_path); foreach ($widgetInfoList as $widgetInfo) { $widgetType = $widgetInfo['widgetType']; $widgetId = $widgetInfo['widgetId']; if ($widgetType == 'Tag Cloud') { $freetag = new freetag(); $smarty->assign("ALL_TAG", $freetag->get_tag_cloud_html("", $current_user->id)); $smarty->assign("USER_TAG_SHOWAS", getTagCloudShowAs($current_user->id)); $html = $smarty->fetch("Home/TagCloud.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") {
$smarty->assign("MOD", $mod_strings); $smarty->assign("APP", $app_strings); $smarty->assign("THEME", $theme); $smarty->assign("IMAGE_PATH", $image_path); if (!empty($_REQUEST['homestuffid'])) { $stuffid = $_REQUEST['homestuffid']; } if (!empty($_REQUEST['blockstufftype'])) { $stufftype = $_REQUEST['blockstufftype']; } if ($stufftype == 'Tag Cloud') { $freetag = new freetag(); $smarty->assign("ALL_TAG", $freetag->get_tag_cloud_html("", $current_user->id)); $smarty->display("Home/TagCloud.tpl"); } 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');
* ("License"); You may not use this file except in compliance with the License * The Original Code is: vtiger CRM Open Source * The Initial Developer of the Original Code is vtiger. * Portions created by vtiger are Copyright (C) vtiger. * All Rights Reserved. ********************************************************************************/ /** * Created on 10-Oct-08 * this file saves the notebook contents to database */ Zend_Json::$useBuiltinEncoderDecoder = true; $status = SaveNotebookContents(); if ($status == true) { require_once 'include/home.php'; $homeObj = new Homestuff(); $contents = $homeObj->getNoteBookContents($_REQUEST['notebookid']); } $returnvalue = array('status' => $status, 'contents' => $contents); echo Zend_Json::encode($returnvalue); function SaveNotebookContents() { if (empty($_REQUEST['notebookid'])) { return false; } else { $notebookid = $_REQUEST['notebookid']; } global $adb, $current_user; $contents = $_REQUEST['contents']; $sql = "update vtiger_notebook_contents set contents=? where userid=? and notebookid=?"; $adb->pquery($sql, array($contents, $current_user->id, $notebookid)); return true;