You are here

function node_convert_messages in Node Convert 6

Same name and namespace in other branches
  1. 7 node_convert.util.inc \node_convert_messages()

Displays error messages if any occured, otherwise the success message.

Parameters

$result: The result value of the node conversion. Possible values

  • FALSE Displays an error message.
  • Any other Displays success message.

$params: An array containing message parameters. Possible values

  • display_success If TRUE, the success message will be displayed, otherwise no message is displayed.

Default is TRUE.

3 calls to node_convert_messages()
node_convert_conversion_form_submit in ./node_convert.module
node_convert_convert_action in ./node_convert.module
node_convert_convert_nodes_using_template in ./node_convert.module
Converts a list of nodes using a given template

File

./node_convert.module, line 824
The node_convert module converts nodes from one type to another.

Code

function node_convert_messages($result, $params = array()) {
  $params += array(
    'display_success' => TRUE,
  );
  if ($result == FALSE) {
    drupal_set_message(t("Conversion failed. Node nid @nid doesn't exist.", array(
      '@nid' => $params['nid'],
    )), 'error');
  }
  elseif ($params['display_success'] == TRUE) {
    drupal_set_message(t("Node @nid has been converted successfully.", array(
      '@nid' => $params['nid'],
    )));
  }
}