Dupe improve custom data handling
[civicrm-core.git] / CRM / Event / Page / List.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
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 +--------------------------------------------------------------------+
10 */
11
12 /**
13 * Display a list of events on a page
14 */
15 class CRM_Event_Page_List extends CRM_Core_Page {
16
17 public function run() {
18 $id = CRM_Utils_Request::retrieveValue('id', 'Positive', NULL, FALSE, 'GET');
19 $type = CRM_Utils_Request::retrieveValue('type', 'Positive', 0);
20 $start = CRM_Utils_Request::retrieveValue('start', 'Positive', 0);
21 $end = CRM_Utils_Request::retrieveValue('end', 'Positive', 0);
22
23 $info = CRM_Event_BAO_Event::getCompleteInfo($start, $type, $id, $end);
24 $this->assign('events', $info);
25
26 // check if we're in shopping cart mode for events
27 $enable_cart = (bool) Civi::settings()->get('enable_cart');
28 $this->assign('eventCartEnabled', $enable_cart);
29
30 if ($enable_cart) {
31 $this->assign('registration_links', TRUE);
32 }
33 return parent::run();
34 }
35
36 }