summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--relation.info2
-rw-r--r--relation.install7
-rw-r--r--relation_endpoint.info (renamed from relation_endpoints.info)0
-rw-r--r--relation_endpoint.install (renamed from relation_endpoints.install)4
-rw-r--r--relation_endpoint.module (renamed from relation_endpoints.module)26
5 files changed, 20 insertions, 19 deletions
diff --git a/relation.info b/relation.info
index fab0e55..e9ebece 100644
--- a/relation.info
+++ b/relation.info
@@ -8,5 +8,5 @@ files[] = tests/relation.rules.test
files[] = tests/relation.views.test
files[] = views/relation_handler_relationship.inc
configure = admin/structure/relation
-dependencies[] = relation_endpoints
+dependencies[] = relation_endpoint
dependencies[] = ctools
diff --git a/relation.install b/relation.install
index ef4ff23..fc67df8 100644
--- a/relation.install
+++ b/relation.install
@@ -250,8 +250,9 @@ function relation_uninstall() {
}
/**
- * Implements hook_update_N().
+ * Enable the new endpoint module and ctools.
*/
-function hook_update_7001() {
- module_enable(array('relation_endpoints'));
+function relation_update_7001() {
+ module_enable(array('relation_endpoint', 'ctools'));
+ db_update('field_config')->fields(array('module' => 'relation_endpoint'))->execute();
}
diff --git a/relation_endpoints.info b/relation_endpoint.info
index 568e42b..568e42b 100644
--- a/relation_endpoints.info
+++ b/relation_endpoint.info
diff --git a/relation_endpoints.install b/relation_endpoint.install
index a449abc..db5121a 100644
--- a/relation_endpoints.install
+++ b/relation_endpoint.install
@@ -2,13 +2,13 @@
/**
* @file
- * Installation functions for Relation Endpoints helper module.
+ * Installation functions for Relation Endpoint field type module.
*/
/**
* Implements hook_field_schema().
*/
-function relation_endpoints_field_schema() {
+function relation_endpoint_field_schema() {
$columns = array(
'entity_type' => array(
'type' => 'varchar',
diff --git a/relation_endpoints.module b/relation_endpoint.module
index 3901160..289841e 100644
--- a/relation_endpoints.module
+++ b/relation_endpoint.module
@@ -5,7 +5,7 @@
* Relation endpoints field.
*/
-function relation_endpoints_field_info() {
+function relation_endpoint_field_info() {
return array(
'relation_endpoint' => array(
'label' => t('Relation endpoint'),
@@ -18,7 +18,7 @@ function relation_endpoints_field_info() {
);
}
-function relation_endpoints_field_validate($entity_type, $entity, $field, $instance, $langcode, $items, &$errors) {
+function relation_endpoint_field_validate($entity_type, $entity, $field, $instance, $langcode, $items, &$errors) {
$relation_type = relation_type_load($entity->relation_type);
// Check that relation_type exists.
if (!$relation_type) {
@@ -97,7 +97,7 @@ function relation_endpoints_field_validate($entity_type, $entity, $field, $insta
/**
* Implements hook_field_presave().
*/
-function relation_endpoints_field_presave($entity_type, $entity, $field, $instance, $langcode, &$items) {
+function relation_endpoint_field_presave($entity_type, $entity, $field, $instance, $langcode, &$items) {
// We need r_index here because EntityFieldQuery can't query on deltas.
foreach ($items as $delta => &$item) {
$item['r_index'] = $delta;
@@ -107,14 +107,14 @@ function relation_endpoints_field_presave($entity_type, $entity, $field, $instan
/**
* Implements hook_field_update().
*/
-function relation_endpoints_field_update($entity_type, $entity, $field, $instance, $langcode, &$items) {
+function relation_endpoint_field_update($entity_type, $entity, $field, $instance, $langcode, &$items) {
// We do not update.
}
/**
* Implements hook_field_is_empty().
*/
-function relation_endpoints_field_is_empty($item, $field) {
+function relation_endpoint_field_is_empty($item, $field) {
// We are never empty.
return FALSE;
}
@@ -122,7 +122,7 @@ function relation_endpoints_field_is_empty($item, $field) {
/**
* Helper to create an HTML table representing a relation.
*/
-function _relation_endpoints_field_create_html_table($endpoints) {
+function _relation_endpoint_field_create_html_table($endpoints) {
$list_items = array();
foreach ($endpoints as $delta => $endpoint) {
$entities = entity_load($endpoint['entity_type'], array($endpoint['entity_id']));
@@ -142,7 +142,7 @@ function _relation_endpoints_field_create_html_table($endpoints) {
);
}
-function relation_endpoints_field_formatter_info() {
+function relation_endpoint_field_formatter_info() {
return array(
'relation_endpoint' => array(
'label' => t('Endpoints table'),
@@ -151,7 +151,7 @@ function relation_endpoints_field_formatter_info() {
);
}
-function relation_endpoints_field_widget_info() {
+function relation_endpoint_field_widget_info() {
return array(
'relation_endpoint' => array(
'label' => t('Endpoints table'),
@@ -163,11 +163,11 @@ function relation_endpoints_field_widget_info() {
);
}
-function relation_endpoints_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
- return array(_relation_endpoints_field_create_html_table($items));
+function relation_endpoint_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
+ return array(_relation_endpoint_field_create_html_table($items));
}
-function relation_endpoints_field_widget_form(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) {
+function relation_endpoint_field_widget_form(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) {
foreach ($items as $delta => $item) {
foreach (array('entity_type', 'entity_id') as $column) {
$element[$delta][$column] = array(
@@ -176,14 +176,14 @@ function relation_endpoints_field_widget_form(&$form, &$form_state, $field, $ins
);
}
}
- $element['link_list'] = _relation_endpoints_field_create_html_table($items);
+ $element['link_list'] = _relation_endpoint_field_create_html_table($items);
return $element;
}
/**
* Implements hook_form_field_ui_field_overview_form_alter().
*/
-function relation_endpoints_form_field_ui_field_overview_form_alter(&$form, $form_state) {
+function relation_endpoint_form_field_ui_field_overview_form_alter(&$form, $form_state) {
// Deleting endpoints would make the module useless.
if ($form['#entity_type'] == 'relation') {
$form['fields']['endpoints']['delete'] = array(