INFRA-132 - CRM/Admin - phpcbf
[civicrm-core.git] / CRM / Admin / Form / Preferences / Event.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2014 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13 | |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
18 | |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
26 */
27
28 /**
29 *
30 * @package CRM
31 * @copyright CiviCRM LLC (c) 2004-2014
32 * $Id: Display.php 36505 2011-10-03 14:19:56Z lobo $
33 *
34 */
35
36 /**
37 * This class generates form components for the display preferences
38 *
39 */
40 class CRM_Admin_Form_Preferences_Event extends CRM_Admin_Form_Preferences {
41 public function preProcess() {
42 CRM_Utils_System::setTitle(ts('CiviEvent Component Settings'));
43 // pass "wiki" as 6th param to docURL2 if you are linking to a page in wiki.civicrm.org
44 $docLink = CRM_Utils_System::docURL2("CiviEvent Cart Checkout", NULL, NULL, NULL, NULL, "wiki");
45 // build an array containing all selectable option values for show_events
46 $optionValues = array();
47 for ($i = 10; $i <= 100; $i += 10) {
48 $optionValues[$i] = $i;
49 }
50 $this->_varNames = array(
51 CRM_Core_BAO_Setting::EVENT_PREFERENCES_NAME => array(
52 'enable_cart' => array(
53 'html_type' => 'checkbox',
54 'title' => ts('Use Shopping Cart Style Event Registration'),
55 'weight' => 1,
56 'description' => ts('This feature allows users to register for more than one event at a time. When enabled, users will add event(s) to a "cart" and then pay for them all at once. Enabling this setting will affect online registration for all active events. The code is an alpha state, and you will potentially need to have developer resources to debug and fix sections of the codebase while testing and deploying it. %1',
57 array(1 => $docLink)),
58 ),
59 'show_events' => array(
60 'html_type' => 'select',
61 'title' => ts('Dashboard entries'),
62 'weight' => 2,
63 'description' => ts('Configure how many events should be shown on the dashboard. This overrides the default value of 10 entries.'),
64 'option_values' => array('' => ts('- select -')) + $optionValues + array(-1 => ts('show all'))
65 )
66 ),
67 );
68
69 parent::preProcess();
70 }
71 }