diff --git a/eva.module b/eva.module index 489005e..e6468d6 100755 --- a/eva.module +++ b/eva.module @@ -31,7 +31,7 @@ function eva_field_extra_fields() { $bundles = array_keys($entity_info['bundles']); } foreach ($bundles as $bundle) { - foreach ($view['show_on'] as $context) { + $context = $view['show_on']; $extras[$entity][$bundle][$context][$view['name'] . '_' . $view['display']] = array( 'label' => (empty($view['title'])) ? $view['name'] : $view['title'], 'description' => $view['title'], @@ -48,7 +48,6 @@ function eva_field_extra_fields() { } } } - } return $extras; } @@ -127,8 +126,6 @@ function _eva_build_extra_fields(&$build, $entity, $fields, $name, $display_id, $view->set_display($display_id); if ($view->access($display_id)) { $view->current_entity = $entity; - // Inform the view of the context it was built under. - $view->_eva_build_context = $context; $longname = $name . '_' . $display_id; if ($context == 'display' && isset($fields[$longname . '_form'])) { @@ -197,7 +194,7 @@ function eva_get_views($type = NULL, $reset = FALSE) { 'name' => $view->name, 'title' => 'EVA: ' . $view->get_human_name() . ' - ' . $view->display[$display_id]->display_title, 'display' => $display_id, - 'show_on' => array_filter($view->display_handler->get_option('show_on')), + 'show_on' => $view->display_handler->get_option('show_on'), 'bundles' => $view->display_handler->get_option('bundles'), 'exposed form' => $view->display_handler->uses_exposed(), 'exposed form split' => $view->display_handler->get_option('exposed_form_as_field'), diff --git a/eva.theme.inc b/eva.theme.inc index 26a9663..7b8181d 100755 --- a/eva.theme.inc +++ b/eva.theme.inc @@ -10,8 +10,7 @@ function template_preprocess_eva_display_entity_view(&$vars) { $view = $vars['view']; $display = $view->display_handler; $vars['title'] = $display->get_option('show_title') ? filter_xss_admin($view->get_title()) : ''; - dpm($view); - if ($view->_eva_build_context == 'form') { + if ($display->get_option('show_on') == 'form') { $vars['exposed'] = NULL; } $vars['exposed_form_as_field'] = $display->get_option('exposed_form_as_field'); diff --git a/eva_plugin_display_entity.inc b/eva_plugin_display_entity.inc index 40d9a01..59bc965 100755 --- a/eva_plugin_display_entity.inc +++ b/eva_plugin_display_entity.inc @@ -17,7 +17,7 @@ function option_definition() { $options['default_argument'] = array('default' => ''); $options['show_title'] = 0; $options['exposed_form_as_field'] = 0; - $options['show_on'] = array('default' => array('display' => 'display')); + $options['show_on'] = array('default' => 'display'); return $options; } @@ -63,7 +63,7 @@ function options_summary(&$categories, &$options) { $options['show_on'] = array( 'category' => 'entity_view', 'title' => t('Show on'), - 'value' => implode(', ', array_filter($this->get_option('show_on'))), + 'value' => $this->get_option('show_on'), ); $argument_mode = $this->get_option('argument_mode'); @@ -147,7 +147,6 @@ function options_form(&$form, &$form_state) { 'form' => t('Form'), ), '#required' => TRUE, - '#multiple' => TRUE, '#default_value' => $this->get_option('show_on'), ); break; @@ -246,11 +245,7 @@ function options_submit(&$form, &$form_state) { break; case 'show_on': - $show_on = $form_state['values']['show_on'] + array( - 'display' => FALSE, - 'form' => FALSE, - ); - $this->set_option('show_on', $show_on); + $this->set_option('show_on', $form_state['values']['show_on']); break; case 'arguments':