$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;
}
$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();