-
-
Notifications
You must be signed in to change notification settings - Fork 825
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dev/cloud-native#16 Migrate Contribution Page widget extern url to us…
…e the normal CMS routing mechanism Update test to test both endpoints
- Loading branch information
1 parent
ee523fb
commit a38da21
Showing
5 changed files
with
127 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
/* | ||
+--------------------------------------------------------------------+ | ||
| Copyright CiviCRM LLC. All rights reserved. | | ||
| | | ||
| This work is published under the GNU AGPLv3 license with some | | ||
| permitted exceptions and without any warranty. For full license | | ||
| and copyright information, see https://civicrm.org/licensing | | ||
+--------------------------------------------------------------------+ | ||
*/ | ||
|
||
/** | ||
* | ||
* @package CRM | ||
* @copyright CiviCRM LLC https://civicrm.org/licensing | ||
*/ | ||
class CRM_Contribute_Page_Widget extends CRM_Core_Page { | ||
|
||
/** | ||
* the main function that is called when the page | ||
* loads, it decides the which action has to be taken for the page. | ||
* | ||
* @throws \CRM_Core_Exception | ||
* @throws \CiviCRM_API3_Exception | ||
*/ | ||
public function run() { | ||
$config = CRM_Core_Config::singleton(); | ||
$template = CRM_Core_Smarty::singleton(); | ||
|
||
$cpageId = CRM_Utils_Request::retrieve('cpageId', 'Positive'); | ||
$widgetId = CRM_Utils_Request::retrieve('widgetId', 'Positive'); | ||
$format = CRM_Utils_Request::retrieve('format', 'Positive'); | ||
$includePending = CRM_Utils_Request::retrieve('includePending', 'Boolean'); | ||
|
||
$jsonvar = 'jsondata'; | ||
if (isset($format)) { | ||
$jsonvar .= $cpageId; | ||
} | ||
|
||
$data = CRM_Contribute_BAO_Widget::getContributionPageData($cpageId, $widgetId, $includePending); | ||
|
||
$output = ' | ||
var ' . $jsonvar . ' = ' . json_encode($data) . '; | ||
'; | ||
|
||
CRM_Core_Page_AJAX::setJsHeaders(60); | ||
echo $output; | ||
CRM_Utils_System::civiExit(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters