From b04baef1e1f24889810d6d8642dae0cf46bae9ff Mon Sep 17 00:00:00 2001 From: Jagadedes Date: Wed, 15 Oct 2014 14:04:42 +0530 Subject: [PATCH] #29763 client part --- extern/wciwidget.php | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/extern/wciwidget.php b/extern/wciwidget.php index 61efe54..a96273b 100644 --- a/extern/wciwidget.php +++ b/extern/wciwidget.php @@ -47,7 +47,7 @@ $template = CRM_Core_Smarty::singleton(); $widgetId = CRM_Utils_Request::retrieve('widgetId', 'Positive', CRM_Core_DAO::$_nullObject); $embed = CRM_Utils_Request::retrieve('embed', 'Positive', CRM_Core_DAO::$_nullObject); -$jsonvar = 'jsondata'; + if (isset($format)) { $jsonvar .= $cpageId; } @@ -59,21 +59,11 @@ if (isset($embed) && (true == $embed)) { $data = CRM_Wci_BAO_Widget::getWidgetData($widgetId); $template->assign('form', $data); -// $template->template_dir[] = "sites/all/modules/civicrm/extensions/civicrm-wci/templates/CRM/Wci/Page"; - $template->template_dir[] = "/var/www/F3/sites/all/modules/civicrm/extensions/civicrm-wci/templates/CRM/Wci/Page"; -// print_r($template->template_dir); -// $jsondata = $template->fetch('sites/all/modules/civicrm/extensions/civicrm-wci/templates/CRM/Wci/Page/Widget.tpl'); -// $jsondata = $template->fetch('wciwidget.tpl'); -// $output = 'var ' . $jsonvar . ' = ' . json_encode($jsondata) . ';'; -// echo json_encode($jsondata); -//echo $jsondata; -//echo $template->getTemplateVars('title'); -$template->display('wciwidget.tpl'); + $template->template_dir[] = $_SERVER['DOCUMENT_ROOT'] . "/F3/sites/all/modules/civicrm/extensions/civicrm-wci/templates/CRM/Wci/Page"; + $wcidata = $template->fetch('wciwidget.tpl'); + $output = 'var wciwidgetcode = ' . json_encode($wcidata) . ';'; + echo $output; + } -/* -$output = ' - var ' . $jsonvar . ' = ' . json_encode($data) . '; -'; -echo $output;*/ CRM_Utils_System::civiExit(); -- 2.25.1