Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
6b7eb9df | 4 | | Copyright CiviCRM LLC. All rights reserved. | |
6a488035 | 5 | | | |
6b7eb9df TO |
6 | | This work is published under the GNU AGPLv3 license with some | |
7 | | permitted exceptions and without any warranty. For full license | | |
8 | | and copyright information, see https://civicrm.org/licensing | | |
6a488035 | 9 | +--------------------------------------------------------------------+ |
d25dd0ee | 10 | */ |
6a488035 TO |
11 | |
12 | /** | |
13 | * | |
14 | * @package CRM | |
ca5cec67 | 15 | * @copyright CiviCRM LLC https://civicrm.org/licensing |
6a488035 TO |
16 | */ |
17 | require_once '../civicrm.config.php'; | |
18 | require_once 'CRM/Core/Config.php'; | |
19 | ||
20 | $config = CRM_Core_Config::singleton(); | |
21 | $template = CRM_Core_Smarty::singleton(); | |
22 | ||
23 | require_once 'CRM/Utils/Request.php'; | |
a3d827a7 CW |
24 | $cpageId = CRM_Utils_Request::retrieve('cpageId', 'Positive'); |
25 | $widgetId = CRM_Utils_Request::retrieve('widgetId', 'Positive'); | |
26 | $format = CRM_Utils_Request::retrieve('format', 'Positive'); | |
27 | $includePending = CRM_Utils_Request::retrieve('includePending', 'Boolean'); | |
6a488035 TO |
28 | |
29 | require_once 'CRM/Contribute/BAO/Widget.php'; | |
30 | ||
31 | $jsonvar = 'jsondata'; | |
32 | if (isset($format)) { | |
33 | $jsonvar .= $cpageId; | |
34 | } | |
35 | ||
c6a8e7a3 | 36 | $data = CRM_Contribute_BAO_Widget::getContributionPageData($cpageId, $widgetId, $includePending); |
6a488035 TO |
37 | |
38 | $output = ' | |
39 | var ' . $jsonvar . ' = ' . json_encode($data) . '; | |
40 | '; | |
41 | ||
fc8c5c0b CW |
42 | // FIXME: Not using CRM_Core_Page_AJAX::setJsHeaders because CMS is not bootstrapped |
43 | header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 60)); | |
44 | header('Content-Type: application/javascript'); | |
45 | header("Cache-Control: max-age=60, public"); | |
46 | ||
6a488035 TO |
47 | echo $output; |
48 | CRM_Utils_System::civiExit(); |