You are here

function node_limit_init in Node Limit 7

Implements hook_init().

File

./node_limit.module, line 121

Code

function node_limit_init() {
  if (arg(0) == 'node' && arg(1) == 'add' && ($type_url_str = arg(2))) {
    $type = str_replace('-', '_', $type_url_str);
    if (!node_limit_access($type)) {
      $nodetype = node_type_get_type($type);

      // Display message for user and redirect based on node limit settings.
      node_limit_message($nodetype);
    }
  }
}