You are here

function content_notify in Content Construction Kit (CCK) 6.3

Same name and namespace in other branches
  1. 6 content.module \content_notify()
  2. 6.2 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.

28 calls to content_notify()
content_multigroup_disable in modules/content_multigroup/content_multigroup.install
Implementation of hook_disable().
content_multigroup_enable in modules/content_multigroup/content_multigroup.install
Implementation of hook_enable().
content_multigroup_install in modules/content_multigroup/content_multigroup.install
Implementation of hook_install().
content_multigroup_uninstall in modules/content_multigroup/content_multigroup.install
Implementation of hook_uninstall().
fieldgroup_disable in modules/fieldgroup/fieldgroup.install
Implementation of hook_disable().

... See full list

File

./content.module, line 576
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;
  }
}