You are here

function node_convert_help in Node Convert 6

Same name and namespace in other branches
  1. 5 node_convert.module \node_convert_help()
  2. 7 node_convert.module \node_convert_help()

Implementation of hook_help().

File

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

Code

function node_convert_help($path, $arg) {
  $output = '';
  switch ($path) {
    case "admin/help#node_convert":
      $output .= '<p>' . t("This module allows to convert one or many nodes between different node types. It can transfer most cck fields, and node-specific options for book and forum types. Support of more basic types will be in future releases. Also the module provides an API for converting nodes and cck fields, hooks for processing additional options of custom node types, integrates with hook_node_operations and Drupal's Action API.") . '</p>';
      $output .= '<p>' . t('<strong>I. Single node conversion:</strong>') . '</p>';
      $output .= t("<ol><li>Go to <a href=\"@permissions\">permissions page</a> and set 'administer conversion' and 'convert to x', 'convert from y' permissions.</li><li>Go to /node/x/convert and follow the provided steps to convert the node.</li></ol>", array(
        '@permissions' => url('admin/user/permissions'),
      ));
      $output .= '<p>' . t('<strong>II. Multiple node conversion (using hook_node_operations):</strong>') . '</p>';
      $output .= t('<ol><li>Set appropriate permissions.</li><li>Go to <a href="@node_convert_templates">Node Convert templates</a>.</li><li>Create a new template following the the provided steps.</li><li>Go to the <a href="@content">content page</a>.</li><li>Select the correct nodes.</li><li>Choose "Convert template: x" (based on the template name created above) from the update options.</li><li>Click Update.</li></ol>', array(
        '@node_convert_template' => url('admin/build/node_convert_template'),
        '@content' => url('admin/content/node'),
      ));
      $output .= '<p>' . t('<strong>III. Multiple node conversion (using Actions API + Views Bulk Operations):</strong><br />Note: This requires the contributed modules Views and Views Bulk Operations') . '</p>';
      $output .= t('<ol><li>Set appropriate permissions.</li><li>Go to <a href="@node_convert_templates">Node Convert templates</a>.</li><li>Create a new template following the the provided steps (also check Create Action).</li><li>Create a new <a href="@view">view</a> with the options you require.</li><li>Select Views Bulk Operations as the style.</li><li>Configure all options as necessary</li><li>Select as an operation one of the convert templates.<br />Note: Most probably there will be duplicates of the same template, this is because VBO uses both Actions API and hook_node_operations to show possible operations</li><li>Save the view. View it.</li><li>Select the necessary nodes and click the Convert x button.</li></ol>', array(
        '@node_convert_template' => url('admin/build/node_convert_template'),
        '@view' => url('admin/build/views'),
      ));
      $output .= '<p>' . t('Useful API calls:<br />node_convert_node_convert($nid, $dest_node_type, $source_fields, $dest_fields, $no_fields_flag, $hook_options = NULL);<br />node_convert_field_convert($nid, $source_field, $dest_field);<br />hook_node_convert_change($data, $op);') . '</p>';
      return $output;
  }
}