You are here

function disable_breadcrumbs_operations in Disable breadcrumbs 6

Same name and namespace in other branches
  1. 7 disable_breadcrumbs.module \disable_breadcrumbs_operations()
1 string reference to 'disable_breadcrumbs_operations'
disable_breadcrumbs_node_operations in ./disable_breadcrumbs.module
Implementation of hook_node_operations().

File

./disable_breadcrumbs.module, line 149
Disable breadcrumbs

Code

function disable_breadcrumbs_operations($nodes, $action) {
  switch ($action) {
    case 'disable_breadcrumbs':
      foreach ($nodes as $node) {
        db_query("REPLACE INTO {disable_breadcrumbs} SET nid = %d, disable_breadcrumb = 1", $node);
      }
      drupal_set_message(t("Breadcrumbs have been disabled for nodes: %nodes", array(
        '%nodes' => implode(", ", $nodes),
      )));
      break;
    case 'enable_breadcrumbs':
      db_query("DELETE from {disable_breadcrumbs} WHERE nid IN (" . db_placeholders($nodes, 'int') . ")", $nodes);
      drupal_set_message(t("Disable breadcrumb status has been unchecked for nodes: %nodes", array(
        '%nodes' => implode(", ", $nodes),
      )));
      break;
  }
}