fields(array( 'weight' => 20, )) ->condition('name', 'cdm_dataportal') ->execute(); } /** * Implements hook_uninstall(). */ function cdm_dataportal_uninstall() { // Delete all nodes with a cdm content type from the node table. // Comment @WA: you also may want to delete these content types from the // node_type table. db_delete('node') ->condition('type', 'cdm_%') ->execute(); } /** * @todo Please document this function. * @see http://drupal.org/node/1354 */ function _rename_variable($old_name, $new_name) { $success = FALSE; $value = variable_get($old_name, FALSE); variable_del($old_name); if ($value !== FALSE) { variable_set($new_name, $value); $success = variable_get($new_name, FALSE) === $value; } else { $success = TRUE; } return array('success' => $success, 'query' => "Renaming variable $old_name to $new_name"); } /** * @todo Please document this function. * @see http://drupal.org/node/1354 */ function _remove_variable($name) { variable_del($name); return array('success' => TRUE, 'query' => "Removing variable $name"); } /** * @todo Please document this function. * @see http://drupal.org/node/1354 */ function _create_variable($name, $value) { variable_set($name, $value); return array('success' => TRUE, 'query' => "Creating variable $name new value: $value"); } /** * @todo Please document this function. * @see http://drupal.org/node/1354 */ function _modify_variable($name, $value_override) { /* * FIXME take care for correct handling of tree variables * for example description_gallery contains the array: * Array ( [cdm_dataportal_show_thumbnail_captions] => 1 [cdm_dataportal_media_maxextend] => 120 [cdm_dataportal_media_cols] => 4 ) * -----> solutions merge arrays !!! */ return _create_variable($name, $value_override); }