You are here

function clone_init in Node clone 6

Implementation of hook_init().

File

./clone.module, line 107
Allow users to make a copy of an item of content (a node) and then edit that copy.

Code

function clone_init() {

  // Support admin theme setting, based on system_init().
  // Only affect the menu path created by this module, and only if the node admin theme checkbox is set.
  if (variable_get('node_admin_theme', '0') && arg(0) == 'node' && arg(2) == 'clone') {
    global $custom_theme;

    // Use the chosen theme ID, or the front-end theme if one hasn't been selected.
    $custom_theme = variable_get('admin_theme', '0');

    // From system.module, this css file is required in the admin view.
    drupal_add_css(drupal_get_path('module', 'system') . '/admin.css', 'module');
  }
}