whitepace y, std is => array( on same line,
[civicrm-core.git] / CRM / Mailing / Form / Component.php
index d0cc253917520e6a79d9285a0a48a39696c59d82..653950d18d6ca4fc82cb097e2be68d1317fa76ae 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | 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.                                    |
  |                                                                    |
@@ -28,7 +28,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
  *
  */
@@ -59,7 +59,7 @@ class CRM_Mailing_Form_Component extends CRM_Core_Form {
   }
 
   /**
-   * Function to build the form
+   * Build the form object
    *
    * @return void
    * @access public
@@ -106,7 +106,7 @@ class CRM_Mailing_Form_Component extends CRM_Core_Form {
   }
 
   /**
-   * This function sets the default values for the form.
+   * Set default values for the form.
    *
    * @access public
    *
@@ -127,7 +127,7 @@ class CRM_Mailing_Form_Component extends CRM_Core_Form {
   }
 
   /**
-   * Function to process the form
+   * Process the form submission
    *
    * @access public
    *
@@ -137,21 +137,26 @@ class CRM_Mailing_Form_Component extends CRM_Core_Form {
     // store the submitted values in an array
     $params = $this->controller->exportValues($this->_name);
 
-    $ids = array();
-
     if ($this->_action & CRM_Core_Action::UPDATE) {
-      $ids['id'] = $this->_id;
+      $params['id'] = $this->_id;
     }
 
-    CRM_Mailing_BAO_Component::add($params, $ids);
+    $component = CRM_Mailing_BAO_Component::add($params);
+    CRM_Core_Session::setStatus(ts('The mailing component \'%1\' has been saved.', array(
+        1 => $component->name
+      )
+    ), ts('Saved'), 'success');
+
   }
-  //end of function
 
   /**
-   * Function for validation
+   * Validation
    *
    * @param array $params (ref.) an assoc array of name/value pairs
    *
+   * @param $files
+   * @param $options
+   *
    * @return mixed true or array of errors
    * @access public
    * @static