You are here

function content_notify in Content Construction Kit (CCK) 6.2

Same name and namespace in other branches
  1. 6.3 content.module \content_notify()
  2. 6 content.module \content_notify()

Modules notify Content module when uninstalled, disabled, etc.

@TODO figure out exactly what needs to be done by content module when field modules are installed, uninstalled, enabled or disabled.

Parameters

string $op: the module operation: uninstall, install, enable, disable

string $module: the name of the affected module.

24 calls to content_notify()
fieldgroup_disable in modules/fieldgroup/fieldgroup.install
Implementation of hook_disable().
fieldgroup_enable in modules/fieldgroup/fieldgroup.install
Implementation of hook_enable().
fieldgroup_install in modules/fieldgroup/fieldgroup.install
@file Implementation of hook_install().
fieldgroup_uninstall in modules/fieldgroup/fieldgroup.install
Implementation of hook_uninstall().
nodereference_disable in modules/nodereference/nodereference.install
Implementation of hook_disable().

... See full list

File

./content.module, line 556
Allows administrators to associate custom fields to content types.

Code

function content_notify($op, $module) {
  switch ($op) {
    case 'install':
      content_clear_type_cache();
      break;
    case 'uninstall':
      module_load_include('inc', 'content', 'includes/content.crud');
      content_module_delete($module);
      break;
    case 'enable':
      content_associate_fields($module);
      content_clear_type_cache();
      break;
    case 'disable':

      // When CCK modules are disabled before content module's update is run
      // to add the active column, we can't do this.
      if (variable_get('content_schema_version', -1) < 6007) {
        return FALSE;
      }
      db_query("UPDATE {" . content_field_tablename() . "} SET active=0 WHERE module='%s'", $module);
      db_query("UPDATE {" . content_instance_tablename() . "} SET widget_active=0 WHERE widget_module='%s'", $module);
      content_clear_type_cache(TRUE);
      break;
  }
}