Commit 15adcbe2 authored by webchick's avatar webchick

Issue #1824244 by webflo, fubhy: Turn _field_ui_bundle_admin_path() into a...

Issue #1824244 by webflo, fubhy: Turn _field_ui_bundle_admin_path() into a public function (field_ui_bundle_admin_path()).
parent 0bbca7fd
......@@ -41,7 +41,7 @@ function field_ui_fields_list() {
}
// Add the current instance.
$admin_path = _field_ui_bundle_admin_path($entity_type, $bundle);
$admin_path = field_ui_bundle_admin_path($entity_type, $bundle);
$rows[$field_name]['data'][2][] = $admin_path ? l($bundles[$entity_type][$bundle]['label'], $admin_path . '/fields') : $bundles[$entity_type][$bundle]['label'];
}
}
......@@ -719,7 +719,7 @@ function field_ui_field_delete_form($form, &$form_state, $instance) {
$entity_type = $instance['entity_type'];
$field = field_info_field($instance['field_name']);
$admin_path = _field_ui_bundle_admin_path($entity_type, $bundle);
$admin_path = field_ui_bundle_admin_path($entity_type, $bundle);
$form['entity_type'] = array('#type' => 'value', '#value' => $entity_type);
$form['bundle'] = array('#type' => 'value', '#value' => $bundle);
......@@ -766,7 +766,7 @@ function field_ui_field_delete_form_submit($form, &$form_state) {
drupal_set_message(t('There was a problem removing the %field from the %type content type.', array('%field' => $instance['label'], '%type' => $bundle_label)), 'error');
}
$admin_path = _field_ui_bundle_admin_path($entity_type, $bundle);
$admin_path = field_ui_bundle_admin_path($entity_type, $bundle);
$form_state['redirect'] = field_ui_get_destinations(array($admin_path . '/fields'));
// Fields are purged on cron. However field module prevents disabling modules
......@@ -1132,6 +1132,6 @@ function field_ui_next_destination($entity_type, $bundle) {
unset($_REQUEST['destinations']);
return field_ui_get_destinations($destinations);
}
$admin_path = _field_ui_bundle_admin_path($entity_type, $bundle);
$admin_path = field_ui_bundle_admin_path($entity_type, $bundle);
return $admin_path . '/fields';
}
......@@ -316,7 +316,7 @@ function field_ui_field_attach_create_bundle($entity_type, $bundle) {
/**
* Determines the adminstration path for a bundle.
*/
function _field_ui_bundle_admin_path($entity_type, $bundle_name) {
function field_ui_bundle_admin_path($entity_type, $bundle_name) {
$bundles = field_info_bundles($entity_type);
$bundle_info = $bundles[$bundle_name];
if (isset($bundle_info['admin'])) {
......@@ -385,7 +385,7 @@ function field_ui_form_node_type_form_alter(&$form, $form_state) {
*/
function field_ui_form_node_type_form_submit($form, &$form_state) {
if ($form_state['triggering_element']['#parents'][0] === 'save_continue') {
$form_state['redirect'] = _field_ui_bundle_admin_path('node', $form_state['values']['type']) .'/fields';
$form_state['redirect'] = field_ui_bundle_admin_path('node', $form_state['values']['type']) .'/fields';
}
}
......
......@@ -462,7 +462,7 @@ public function submit(array $form, array &$form_state) {
$view_mode_settings = field_view_mode_settings($this->entity_type, $this->bundle);
if (!empty($value) && empty($view_mode_settings[$view_mode_name]['custom_settings'])) {
$view_mode_label = $entity_info['view_modes'][$view_mode_name]['label'];
$path = _field_ui_bundle_admin_path($this->entity_type, $this->bundle) . "/display/$view_mode_name";
$path = field_ui_bundle_admin_path($this->entity_type, $this->bundle) . "/display/$view_mode_name";
drupal_set_message(t('The %view_mode mode now uses custom display settings. You might want to <a href="@url">configure them</a>.', array('%view_mode' => $view_mode_label, '@url' => url($path))));
// Initialize the newly customized view mode with the display settings
// from the default view mode.
......
......@@ -21,7 +21,7 @@ public function __construct($entity_type, $bundle, $view_mode = NULL) {
$this->entity_type = $entity_type;
$this->bundle = $bundle;
$this->view_mode = 'form';
$this->adminPath = _field_ui_bundle_admin_path($this->entity_type, $this->bundle);
$this->adminPath = field_ui_bundle_admin_path($this->entity_type, $this->bundle);
}
/**
......
......@@ -55,7 +55,7 @@ public function __construct($entity_type, $bundle, $view_mode = NULL) {
$this->entity_type = $entity_type;
$this->bundle = $bundle;
$this->view_mode = (isset($view_mode) ? $view_mode : 'default');
$this->adminPath = _field_ui_bundle_admin_path($this->entity_type, $this->bundle);
$this->adminPath = field_ui_bundle_admin_path($this->entity_type, $this->bundle);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment