Merge pull request #6812 from eileenmcnaughton/CRM-17075
[civicrm-core.git] / api / v3 / examples / Setting / GetFields.php
index ab680d810f070af245393d02c990934880a58e27..40036da3b562207c61cdaccea4bcb6ea8ca9a726 100644 (file)
@@ -1,12 +1,6 @@
 <?php
 /**
- * @file
- * Test Generated API Example.
- * See bottom of this file for more detail.
- */
-
-/**
- * Test Generated example of using setting getfields API.
+ * Test Generated example demonstrating the Setting.getfields API.
  *
  * Demonstrate return from getfields - see subfolder for variants
  *
@@ -17,7 +11,7 @@ function setting_getfields_example() {
   $params = array();
 
   try{
-    $result = civicrm_api3('setting', 'getfields', $params);
+    $result = civicrm_api3('Setting', 'getfields', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -645,11 +639,11 @@ function setting_getfields_expectedresult() {
         'config_only' => 1,
         'type' => 'String',
         'quick_form_type' => 'Element',
-        'html_type' => 'Text',
         'html_attributes' => array(
           'size' => 64,
           'maxlength' => 256,
         ),
+        'html_type' => 'Text',
         'default' => '',
         'add' => '4.3',
         'title' => 'Path to wkhtmltopdf executable',
@@ -666,11 +660,11 @@ function setting_getfields_expectedresult() {
         'config_only' => 1,
         'type' => 'String',
         'quick_form_type' => 'Element',
-        'html_type' => 'Text',
         'html_attributes' => array(
           'size' => 64,
           'maxlength' => 64,
         ),
+        'html_type' => 'Text',
         'default' => '',
         'add' => '4.3',
         'title' => 'Recaptcha Public Key',
@@ -687,11 +681,11 @@ function setting_getfields_expectedresult() {
         'config_only' => 1,
         'type' => 'String',
         'quick_form_type' => 'Element',
-        'html_type' => 'Text',
         'html_attributes' => array(
           'size' => 64,
           'maxlength' => 64,
         ),
+        'html_type' => 'Text',
         'default' => '',
         'add' => '4.3',
         'title' => 'Recaptcha Private Key',
@@ -708,11 +702,11 @@ function setting_getfields_expectedresult() {
         'config_only' => 1,
         'type' => 'Integer',
         'quick_form_type' => 'Element',
-        'html_type' => 'Text',
         'html_attributes' => array(
           'size' => 3,
           'maxlength' => 5,
         ),
+        'html_type' => 'Text',
         'default' => '',
         'add' => '4.3',
         'title' => 'Dashboard cache timeout',
@@ -728,11 +722,11 @@ function setting_getfields_expectedresult() {
         'prefetch' => 1,
         'type' => 'Integer',
         'quick_form_type' => 'Element',
-        'html_type' => 'Text',
         'html_attributes' => array(
           'size' => 2,
           'maxlength' => 8,
         ),
+        'html_type' => 'Text',
         'default' => 7,
         'add' => '4.3',
         'title' => 'Checksum Lifespan',
@@ -748,11 +742,11 @@ function setting_getfields_expectedresult() {
         'prefetch' => 0,
         'type' => 'String',
         'quick_form_type' => 'Element',
-        'html_type' => 'Text',
         'html_attributes' => array(
           'size' => 64,
           'maxlength' => 128,
         ),
+        'html_type' => 'Text',
         'default' => '*default*',
         'add' => '4.3',
         'title' => 'Blog Feed URL',
@@ -768,11 +762,11 @@ function setting_getfields_expectedresult() {
         'prefetch' => 0,
         'type' => 'String',
         'quick_form_type' => 'Element',
-        'html_type' => 'Text',
         'html_attributes' => array(
           'size' => 64,
           'maxlength' => 128,
         ),
+        'html_type' => 'Text',
         'default' => '*default*',
         'add' => '4.3',
         'title' => 'Community Messages URL',
@@ -789,11 +783,11 @@ function setting_getfields_expectedresult() {
         'config_only' => 1,
         'type' => 'String',
         'quick_form_type' => 'Element',
-        'html_type' => 'Text',
         'html_attributes' => array(
           'size' => 16,
           'maxlength' => 16,
         ),
+        'html_type' => 'Text',
         'default' => '',
         'add' => '4.3',
         'title' => 'Resource Cache Code',
@@ -874,14 +868,9 @@ function setting_getfields_expectedresult() {
         'description' => '',
         'help_text' => '',
         'on_change' => array(
-          '0' => array(
-            '0' => 'CRM_Case_Info',
-            '1' => 'onToggleComponents',
-          ),
-          '1' => array(
-            '0' => 'CRM_Core_Component',
-            '1' => 'flushEnabledComponents',
-          ),
+          '0' => 'CRM_Case_Info::onToggleComponents',
+          '1' => 'CRM_Core_Component::flushEnabledComponents',
+          '2' => 'call://resources/resetCacheCode',
         ),
       ),
       'disable_core_css' => array(
@@ -913,37 +902,36 @@ function setting_getfields_expectedresult() {
         'description' => 'When enabled, \"empowered by CiviCRM\" is displayed at the bottom of public forms.',
         'help_text' => '',
       ),
-      'debug_enabled' => array(
+      'userFrameworkLogging' => array(
         'group_name' => 'Developer Preferences',
         'group' => 'developer',
-        'name' => 'debug_enabled',
-        'config_key' => 'debug',
+        'name' => 'userFrameworkLogging',
         'type' => 'Boolean',
         'quick_form_type' => 'YesNo',
         'default' => 0,
         'add' => '4.3',
-        'title' => 'Enable Debugging',
+        'title' => 'Enable Drupal Watchdog Logging',
         'is_domain' => 1,
         'is_contact' => 0,
-        'description' => 'Set this value to Yes if you want to use one of CiviCRM\'s debugging tools. This feature should NOT be enabled for production sites',
+        'description' => 'Set this value to Yes if you want CiviCRM error/debugging messages to appear in the Drupal error logs',
         'prefetch' => 1,
-        'help_text' => 'Do not turn this on on production sites',
+        'help_text' => 'Set this value to Yes if you want CiviCRM error/debugging messages the appear in your CMS\' error log. In the case of Drupal, this will cause all CiviCRM error messages to appear in the watchdog (assuming you have Drupal\'s watchdog enabled)',
       ),
-      'userFrameworkLogging' => array(
+      'debug_enabled' => array(
         'group_name' => 'Developer Preferences',
         'group' => 'developer',
-        'name' => 'userFrameworkLogging',
+        'name' => 'debug_enabled',
+        'config_key' => 'debug',
         'type' => 'Boolean',
         'quick_form_type' => 'YesNo',
         'default' => 0,
         'add' => '4.3',
-        'title' => 'Enable Drupal Watchdog Logging',
+        'title' => 'Enable Debugging',
         'is_domain' => 1,
         'is_contact' => 0,
-        'description' => 'Set this value to Yes if you want CiviCRM error/debugging messages to also appear in Drupal error logs',
+        'description' => 'Set this value to Yes if you want to use one of CiviCRM\'s debugging tools. This feature should NOT be enabled for production sites',
         'prefetch' => 1,
-        'help_text' => 'Set this value to Yes if you want CiviCRM error/debugging messages the appear in your CMS\' error log.
-In the case of Drupal, this will cause all CiviCRM error messages to appear in the watchdog (assuming you have Drupal\'s watchdog enabled)',
+        'help_text' => 'Do not turn this on on production sites',
       ),
       'backtrace' => array(
         'group_name' => 'Developer Preferences',
@@ -959,21 +947,6 @@ In the case of Drupal, this will cause all CiviCRM error messages to appear in t
         'description' => 'Set this value to Yes if you want to display a backtrace listing when a fatal error is encountered. This feature should NOT be enabled for production sites',
         'prefetch' => 1,
       ),
-      'fatalErrorTemplate' => array(
-        'group_name' => 'Developer Preferences',
-        'group' => 'developer',
-        'name' => 'fatalErrorTemplate',
-        'type' => 'String',
-        'quick_form_type' => 'Element',
-        'html_type' => 'text',
-        'default' => 'CRM/common/fatal.tpl',
-        'add' => '4.3',
-        'title' => 'Fatal Error Template',
-        'is_domain' => 1,
-        'is_contact' => 0,
-        'description' => 'Enter the path and filename for a custom Smarty template if you want to define your own screen for displaying fatal errors.',
-        'prefetch' => 1,
-      ),
       'fatalErrorHandler' => array(
         'group_name' => 'Developer Preferences',
         'group' => 'developer',
@@ -1349,10 +1322,10 @@ In the case of Drupal, this will cause all CiviCRM error messages to appear in t
         'html_type' => 'checkbox',
         'default' => 0,
         'add' => '4.1',
-        'title' => 'Enable Double Opt-in for Profile Group(s) field',
+        'title' => 'Track replies using VERP in Reply-To header',
         'is_domain' => 1,
         'is_contact' => 0,
-        'description' => 'When CiviMail is enabled, users who \"subscribe\" to a group from a profile Group(s) checkbox will receive a confirmation email. They must respond (opt-in) before they are added to the group.',
+        'description' => 'If checked, mailings will default to tracking replies using VERP-ed Reply-To. ',
         'help_text' => '',
         'validate_callback' => 'CRM_Core_BAO_Setting::validateBoolSetting',
       ),
@@ -1571,11 +1544,11 @@ In the case of Drupal, this will cause all CiviCRM error messages to appear in t
         'prefetch' => 0,
         'type' => 'String',
         'quick_form_type' => 'Element',
-        'html_type' => 'Text',
         'html_attributes' => array(
           'size' => 64,
           'maxlength' => 64,
         ),
+        'html_type' => 'Text',
         'default' => 'simple',
         'add' => '4.5',
         'title' => 'How to handle full-tet queries',
@@ -1635,11 +1608,10 @@ In the case of Drupal, this will cause all CiviCRM error messages to appear in t
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetFields
-* and can be found in
+* The test that created it is called "testGetFields"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SettingTest.php
 *
 * You can see the outcome of the API tests at
@@ -1649,7 +1621,7 @@ In the case of Drupal, this will cause all CiviCRM error messages to appear in t
 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
 *
 * Browse the api on your own site with the api explorer
-* http://MYSITE.ORG/path/to/civicrm/api/explorer
+* http://MYSITE.ORG/path/to/civicrm/api
 *
 * Read more about testing here
 * http://wiki.civicrm.org/confluence/display/CRM/Testing