You are here

function onlyone_theme_registry_alter in Allow a content type only once (Only One) 7

Implements hook_theme_registry_alter().

File

./onlyone.module, line 146
Allows to define if a content type must have more than one node in the site.

Code

function onlyone_theme_registry_alter(&$theme_registry) {

  // This is necessary due to:
  // https://www.drupal.org/project/drupal/issues/2965718 and will change once
  // this issue will be solved.
  if (variable_get('onlyone_new_menu_entry')) {
    $theme_registry['node_add_list']['file'] = 'onlyone.pages.inc';
    $theme_registry['node_add_list']['theme path'] = drupal_get_path('module', 'onlyone');
    $theme_registry['node_add_list']['function'] = 'onlyone_node_add_list';
  }
}