whitepace y, std is => array( on same line,
[civicrm-core.git] / CRM / Mailing / Form / Component.php
index e830dc3354b32968f9fe52007a09a9fa293ff943..653950d18d6ca4fc82cb097e2be68d1317fa76ae 100644 (file)
@@ -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