3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
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 |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
17 class CRM_Contribute_Page_Widget
extends CRM_Core_Page
{
20 * the main function that is called when the page
21 * loads, it decides the which action has to be taken for the page.
23 * @throws \CRM_Core_Exception
24 * @throws \CiviCRM_API3_Exception
26 public function run() {
27 $config = CRM_Core_Config
::singleton();
28 $template = CRM_Core_Smarty
::singleton();
30 $cpageId = CRM_Utils_Request
::retrieve('cpageId', 'Positive');
31 $widgetId = CRM_Utils_Request
::retrieve('widgetId', 'Positive');
32 $format = CRM_Utils_Request
::retrieve('format', 'Positive');
33 $includePending = CRM_Utils_Request
::retrieve('includePending', 'Boolean');
35 $jsonvar = 'jsondata';
40 $data = CRM_Contribute_BAO_Widget
::getContributionPageData($cpageId, $widgetId, $includePending);
43 var ' . $jsonvar . ' = ' . json_encode($data) . ';
46 CRM_Core_Page_AJAX
::setJsHeaders(60);
48 CRM_Utils_System
::civiExit();