Merge pull request #3158 from eileenmcnaughton/tests
[civicrm-core.git] / api / v3 / Dashboard.php
index ae427790362077a141db29ecdd9e7afa871afa58..e17325e0750bcf40b0a694b947ae9bcc962226e3 100644 (file)
@@ -3,9 +3,9 @@
 
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.4                                                |
+ | CiviCRM version 4.5                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013                                |
+ | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -32,7 +32,7 @@
  *
  * @package CiviCRM_APIv3
  * @subpackage API_Activity
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
  * @version $Id: Activity.php 30486 2010-11-02 16:12:09Z shot $
  *
  */
  *
  */
 function civicrm_api3_dashboard_create($params) {
-  if (!CRM_Utils_Array::value('id', $params)) {
+  if (empty($params['id'])) {
     civicrm_api3_verify_one_mandatory($params,
       NULL,
       array(
-        'name', 'label', 'url', 'fullscreen_url',
+        'name',
+        'label',
+        'url',
+        'fullscreen_url',
       )
     );
   }
@@ -84,8 +87,8 @@ function _civicrm_api3_dashboard_create_spec(&$params) {
  */
 function civicrm_api3_dashboard_get($params) {
   $bao = new CRM_Core_BAO_Dashboard();
-  _civicrm_api3_dao_set_filter($bao, $params, true, 'Dashboard');
-  $dashlets = _civicrm_api3_dao_to_array($bao, $params, true,'Dashboard');
+  _civicrm_api3_dao_set_filter($bao, $params, TRUE, 'Dashboard');
+  $dashlets = _civicrm_api3_dao_to_array($bao, $params, TRUE, 'Dashboard');
   return civicrm_api3_create_success($dashlets, $params, 'dashboard', 'get', $bao);
 }
 
@@ -104,4 +107,4 @@ function civicrm_api3_dashboard_delete($params) {
   else {
     return civicrm_api3_create_error('Could not delete dashlet');
   }
-}
\ No newline at end of file
+}