INFRA-132 comments to end with full stops
[civicrm-core.git] / CRM / Core / Config / Variables.php
CommitLineData
6a488035
TO
1<?php
2/*
3 +--------------------------------------------------------------------+
39de6fd5 4 | CiviCRM version 4.6 |
6a488035 5 +--------------------------------------------------------------------+
06b69b18 6 | Copyright CiviCRM LLC (c) 2004-2014 |
6a488035
TO
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 +--------------------------------------------------------------------+
d25dd0ee 26 */
6a488035
TO
27
28/**
29 * Variables class contains definitions of all the core config settings that are allowed on
30 * CRM_Core_Config. If you want a config variable to be present in run time config object,
31 * it need to be defined here first.
32 *
33 * @package CRM
06b69b18 34 * @copyright CiviCRM LLC (c) 2004-2014
6a488035
TO
35 * $Id$
36 *
37 */
38class CRM_Core_Config_Variables extends CRM_Core_Config_Defaults {
39
40 /**
fe482240 41 * The debug level for civicrm.
6a488035
TO
42 * @var int
43 */
44 public $debug = 0;
45 public $backtrace = 0;
46
47 /**
fe482240 48 * The directory where Smarty and plugins are installed.
6a488035
TO
49 * @var string
50 */
51 public $smartyDir = NULL;
52 public $pluginsDir = NULL;
53
54 /**
fe482240 55 * The root directory of our template tree.
6a488035
TO
56 * @var string
57 */
58 public $templateDir = NULL;
59
60 /**
61 * The resourceBase of our application. Used when we want to compose
62 * url's for things like js/images/css
63 * @var string
64 */
65 public $resourceBase = NULL;
66
67 /**
68 * The directory to store uploaded files
69 */
70 public $uploadDir = NULL;
71
72 /**
73 * The directory to store uploaded image files
74 */
75 public $imageUploadDir = NULL;
76
77 /**
78 * The directory to store uploaded files in custom data
79 */
80 public $customFileUploadDir = NULL;
81
82 /**
83 * The url that we can use to display the uploaded images
84 */
85 public $imageUploadURL = NULL;
86
87 /**
88 * The local path to the default extension container
89 */
90 public $extensionsDir;
91
92 /**
93 * The url for resources defined by extensions
94 */
95 public $extensionsURL = NULL;
96
97 /**
98 * Are we generating clean url's and using mod_rewrite
99 * @var string
100 */
101 public $cleanURL = FALSE;
102
103 /**
104 * List of country codes limiting the country list.
105 * 1228 is an id for United States.
106 * @var string
107 */
108 public $countryLimit = array('1228');
109
110 /**
111 * Id of default state/province for contact.
112 * 1046 is an id for Washington(country:United States).
113 * @var int
114 */
115 public $defaultContactStateProvince;
116
117 /**
118 * List of country codes limiting the province list.
119 * 1228 is an id for United States.
120 * @var string
121 */
122 public $provinceLimit = array('1228');
123
124 /**
125 * ISO code of default country for contact.
126 * 1228 is an id for United States.
127 * @var int
128 */
129 public $defaultContactCountry = '1228';
130
131 /**
132 * ISO code of default currency.
133 * @var int
134 */
135 public $defaultCurrency = 'USD';
136
137 /**
138 * Locale for the application to run with.
139 * @var string
140 */
141 public $lcMessages = 'en_US';
142
143 /**
144 * String format for date+time
145 * @var string
146 */
147 public $dateformatDatetime = '%B %E%f, %Y %l:%M %P';
148
149 /**
150 * String format for a full date (one with day, month and year)
151 * @var string
152 */
153 public $dateformatFull = '%B %E%f, %Y';
154
155 /**
156 * String format for a partial date (one with month and year)
157 * @var string
158 */
159 public $dateformatPartial = '%B %Y';
160
161 /**
162 * String format for a year-only date
163 * @var string
164 */
165 public $dateformatYear = '%Y';
166
167 /**
168 * Display format for time
169 * @var string
170 */
171 public $dateformatTime = '%l:%M %P';
172
173 /**
174 * Input format for time
175 * @var string
176 */
177 public $timeInputFormat = 1;
178
179 /**
180 * Input format for date plugin
181 * @var string
182 */
183 public $dateInputFormat = 'mm/dd/yy';
184
185 /**
186 * Month and day on which fiscal year starts.
187 *
188 * @var array
189 */
190 public $fiscalYearStart = array(
191 'M' => 01,
192 'd' => 01,
193 );
194
195 /**
196 * String format for monetary amounts
197 * @var string
198 */
199 public $moneyformat = '%c %a';
200
201 /**
202 * String format for monetary values
203 * @var string
204 */
205 public $moneyvalueformat = '%!i';
206
207 /**
208 * Format for monetary amounts
209 * @var string
210 */
211 public $currencySymbols = '';
212
213 /**
214 * Format for monetary amounts
215 * @var string
216 */
217 public $defaultCurrencySymbol = '$';
218
219 /**
220 * Monetary decimal point character
221 * @var string
222 */
223 public $monetaryDecimalPoint = '.';
224
225 /**
226 * Monetary thousands separator
227 * @var string
228 */
229 public $monetaryThousandSeparator = ',';
230
231 /**
232 * Default encoding of strings returned by gettext
233 * @var string
234 */
235 public $gettextCodeset = 'utf-8';
236
237 /**
238 * Default name for gettext domain.
239 * @var string
240 */
241 public $gettextDomain = 'civicrm';
242
243 /**
244 * Default location of gettext resource files.
245 */
246 public $gettextResourceDir = './l10n/';
247
248 /**
249 * Default user framework. This basically makes Drupal 7 the default
250 */
251 public $userFramework = 'Drupal';
252 public $userFrameworkVersion = 'Unknown';
253 public $userFrameworkUsersTableName = 'users';
254 public $userFrameworkClass = 'CRM_Utils_System_Drupal';
255 public $userHookClass = 'CRM_Utils_Hook_Drupal';
4bf0b605
AH
256
257 /**
258 * @var string|CRM_Core_Permission_Base
259 */
6a488035 260 public $userPermissionClass = 'CRM_Core_Permission_Drupal';
4bf0b605 261
6a488035
TO
262 public $userFrameworkURLVar = 'q';
263 public $userFrameworkDSN = NULL;
264 public $userFrameworkBaseURL = NULL;
265 public $userFrameworkResourceURL = NULL;
266 public $userFrameworkFrontend = FALSE;
267 public $userFrameworkLogging = FALSE;
268
269 /**
100fef9d 270 * The handle for import file size
6a488035
TO
271 * @var int
272 */
273 public $maxImportFileSize = 1048576;
274 public $maxFileSize = 2;
275
276 /**
277 * The custom locale strings. Note that these locale strings are stored
278 * in a separate column in civicrm_domain
279 * @var array
280 */
281 public $localeCustomStrings = NULL;
282
283 /**
284 * Map Provider
285 *
286 * @var string
287 */
288 public $mapProvider = NULL;
289
290 /**
291 * Map API Key
292 *
293 * @var string
294 */
295 public $mapAPIKey = NULL;
296
297 /**
298 * Geocoding Provider
299 *
300 * @var string
301 */
302 public $geoProvider = NULL;
303
304 /**
305 * Geocoding API Key
306 *
307 * @var string
308 */
309 public $geoAPIKey = NULL;
310
311 /**
312 * How should we get geo code information if google map support needed
313 *
314 * @var string
315 */
316 public $geocodeMethod = '';
317
318 /**
319 *
320 *
321 * @var boolean
322 */
323 public $mapGeoCoding = 1;
324
325
326 /**
327 * Whether database-level logging should be performed
328 * @var boolean
329 */
330 public $logging = FALSE;
331
466913fc
AH
332 /**
333 * Whether public pages should display "empowered by CiviCRM"
334 *
335 * @var boolean
336 */
337 public $empoweredBy = TRUE;
338
6a488035
TO
339 /**
340 * Array of enabled add-on components (e.g. CiviContribute, CiviMail...)
341 *
342 * @var array
343 */
344 public $enableComponents = array(
353ffa53
TO
345 'CiviContribute',
346 'CiviPledge',
347 'CiviMember',
348 'CiviEvent',
349 'CiviMail',
350 'CiviReport',
6a488035
TO
351 );
352 public $enableComponentIDs = array(1, 6, 2, 3, 4, 8);
353
354 /**
355 * Should payments be accepted only via SSL?
356 *
357 * @var boolean
358 */
359 public $enableSSL = FALSE;
360
361 /**
100fef9d 362 * Error template to use for fatal errors
6a488035
TO
363 *
364 * @var string
365 */
366 public $fatalErrorTemplate = 'CRM/common/fatal.tpl';
367
368 /**
100fef9d 369 * Fatal error handler
6a488035
TO
370 *
371 * @var string
372 */
373 public $fatalErrorHandler = NULL;
374
375 /**
100fef9d 376 * Legacy encoding for file encoding conversion
6a488035
TO
377 *
378 * @var string
379 */
380 public $legacyEncoding = 'Windows-1252';
381
382 /**
100fef9d 383 * Field separator for import/export csv file
6a488035
TO
384 *
385 * @var string
386 */
387 public $fieldSeparator = ',';
388
389 /**
100fef9d 390 * Max location blocks in address
6a488035
TO
391 *
392 * @var integer
393 */
394 public $maxLocationBlocks = 2;
395
396 /**
100fef9d 397 * The font path where captcha fonts are stored
6a488035
TO
398 *
399 * @var string
400 */
401 public $captchaFontPath = '/usr/X11R6/lib/X11/fonts/';
402
403 /**
100fef9d 404 * The font to use for captcha
6a488035
TO
405 *
406 * @var string
407 */
408 public $captchaFont = 'HelveticaBold.ttf';
409
410 /**
411 * Some search settings
412 */
413 public $includeWildCardInName = 1;
414 public $includeEmailInName = 1;
415 public $includeNickNameInName = 0;
416
417 public $smartGroupCacheTimeout = 5;
418
419 public $defaultSearchProfileID = NULL;
420
421 /**
422 * Dashboard timeout
423 */
424 public $dashboardCacheTimeout = 1440;
425
426 /**
100fef9d 427 * Flag to indicate if acl cache is NOT to be reset
6a488035
TO
428 */
429 public $doNotResetCache = 0;
430
431 /**
432 * Optimization related variables
433 */
434 public $includeAlphabeticalPager = 1;
435 public $includeOrderByClause = 1;
436 public $oldInputStyle = 1;
437
438 /**
100fef9d 439 * Should we disable key generation for forms
6a488035
TO
440 *
441 * @var boolean
442 */
443 public $formKeyDisable = FALSE;
444
445 /**
dc195289 446 * determine whether the call is from cms or civicrm
6a488035
TO
447 */
448 public $inCiviCRM = FALSE;
449
450 /**
100fef9d 451 * Component registry object (of CRM_Core_Component type)
6a488035
TO
452 */
453 public $componentRegistry = NULL;
454
455 /**
69e84640 456 * PDF receipt as attachment is disabled by default (CRM-8350)
6a488035
TO
457 */
458 public $doNotAttachPDFReceipt = FALSE;
459
460 /**
461 * Path to wkhtmltopdf if available
462 */
463 public $wkhtmltopdfPath = FALSE;
2efcf0c2 464
d5f1ee75
DG
465 /**
466 * Allow second-degree relations permission to edit contacts
467 */
468 public $secondDegRelPermissions = FALSE;
2efcf0c2 469
97d5a31f 470
36b820ae
DL
471 /**
472 * Allow second-degree relations permission to edit contacts
473 */
474 public $wpBasePage = NULL;
6a488035
TO
475
476 /**
fe482240 477 * Provide addressSequence.
6a488035
TO
478 *
479 * @param
480 *
481 * @return string
482 */
483 public function addressSequence() {
484 $addressFormat = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
485 'address_format'
486 );
487
488 return CRM_Utils_Address::sequence($addressFormat);
489 }
490
491 /**
fe482240 492 * Provide cached default currency symbol.
6a488035
TO
493 *
494 * @param
495 *
496 * @return string
497 */
498 public function defaultCurrencySymbol($defaultCurrency = NULL) {
499 static $cachedSymbol = NULL;
500 if (!$cachedSymbol || $defaultCurrency) {
501 if ($this->defaultCurrency || $defaultCurrency) {
b6190c8b
CW
502 $this->currencySymbols = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'currency', array(
503 'labelColumn' => 'symbol',
c11164f3 504 'orderColumn' => TRUE,
b6190c8b 505 ));
6a488035
TO
506 $currency = $defaultCurrency ? $defaultCurrency : $this->defaultCurrency;
507 $cachedSymbol = CRM_Utils_Array::value($currency, $this->currencySymbols, '');
508 }
509 else {
510 $cachedSymbol = '$';
511 }
512 }
513 return $cachedSymbol;
514 }
515
516 /**
fe482240 517 * Provide cached default currency symbol.
6a488035
TO
518 *
519 * @param
520 *
521 * @return string
522 */
523 public function defaultContactCountry() {
524 static $cachedContactCountry = NULL;
525
526 if (!empty($this->defaultContactCountry) &&
527 !$cachedContactCountry
528 ) {
529 $countryIsoCodes = CRM_Core_PseudoConstant::countryIsoCode();
530 $cachedContactCountry = CRM_Utils_Array::value($this->defaultContactCountry,
531 $countryIsoCodes
532 );
533 }
534 return $cachedContactCountry;
535 }
536
537 /**
fe482240 538 * Provide cached default country name.
6a488035
TO
539 *
540 * @param
541 *
542 * @return string
543 */
544 public function defaultContactCountryName() {
545 static $cachedContactCountryName = NULL;
f3c2c514 546 if (!$cachedContactCountryName && $this->defaultContactCountry) {
6a488035
TO
547 $countryCodes = CRM_Core_PseudoConstant::country();
548 $cachedContactCountryName = $countryCodes[$this->defaultContactCountry];
549 }
550 return $cachedContactCountryName;
551 }
552
553 /**
fe482240 554 * Provide cached country limit translated to names.
6a488035
TO
555 *
556 * @param
557 *
558 * @return array
559 */
560 public function countryLimit() {
561 static $cachedCountryLimit = NULL;
562 if (!$cachedCountryLimit) {
563 $countryIsoCodes = CRM_Core_PseudoConstant::countryIsoCode();
564 $country = array();
565 if (is_array($this->countryLimit)) {
566 foreach ($this->countryLimit as $val) {
ebafea1d
DL
567 // CRM-12007
568 // some countries have disappeared and hence they might be in country limit
569 // but not in the country table
570 if (isset($countryIsoCodes[$val])) {
571 $country[] = $countryIsoCodes[$val];
572 }
6a488035
TO
573 }
574 }
575 else {
576 $country[] = $countryIsoCodes[$this->countryLimit];
577 }
578 $cachedCountryLimit = $country;
579 }
580 return $cachedCountryLimit;
581 }
582
583 /**
fe482240 584 * Provide cached province limit translated to names.
6a488035
TO
585 *
586 * @param
587 *
588 * @return array
589 */
590 public function provinceLimit() {
591 static $cachedProvinceLimit = NULL;
592 if (!$cachedProvinceLimit) {
593 $countryIsoCodes = CRM_Core_PseudoConstant::countryIsoCode();
594 $country = array();
595 if (is_array($this->provinceLimit)) {
596 foreach ($this->provinceLimit as $val) {
78eab63c
SD
597 // CRM-12007
598 // some countries have disappeared and hence they might be in country limit
599 // but not in the country table
600 if (isset($countryIsoCodes[$val])) {
601 $country[] = $countryIsoCodes[$val];
602 }
6a488035
TO
603 }
604 }
605 else {
606 $country[] = $countryIsoCodes[$this->provinceLimit];
607 }
608 $cachedProvinceLimit = $country;
609 }
610 return $cachedProvinceLimit;
611 }
96025800 612
6a488035
TO
613}
614// end CRM_Core_Config