5 if ( ! defined(
'GRAVITYVIEW_DIR' ) ) {
18 public static $slug =
'list';
30 $form = $this->view->form;
32 if ( isset( $this->view->unions[ $entry[
'form_id'] ] ) ) {
33 if ( isset( $this->view->unions[ $entry[
'form_id'] ][ $field->ID ] ) ) {
34 $field = $this->view->unions[ $entry[
'form_id'] ][ $field->ID ];
36 $field = Internal_Field::from_configuration( array(
'id' =>
'custom' ) );
40 if ( $entry->is_multi() ) {
41 if ( ! $single_entry = $entry->from_field( $field ) ) {
44 $form = GF_Form::by_id( $field->form_id );
55 $context = Template_Context::from_template( $this, compact(
'field',
'entry' ) );
60 $value = $renderer->render( $field, $this->view, $source, $entry, $this->request );
65 $label = apply_filters(
'gravityview_render_after_label', $field->get_label( $this->view,
$form, $entry ), $field->as_configuration() );
66 $label = apply_filters(
'gravityview/template/field_label', $label, $field->as_configuration(),
$form->form ?
$form->form : null, null );
74 $label = apply_filters(
'gravityview/template/field/label', $label, $context );
81 $hide_empty = apply_filters(
'gravityview/render/hide-empty-zone', Utils::get( $extras,
'hide_empty', $this->view->settings->get(
'hide_empty',
false ) ), $context );
83 if ( is_numeric( $field->ID ) ) {
84 $extras[
'field'] = $field->as_configuration();
87 $extras[
'entry'] = $entry->as_entry();
88 $extras[
'hide_empty'] = $hide_empty;
105 if ( ! is_array( $zones ) ) {
106 $zones = array( $zones );
110 foreach ( $zones as $zone ) {
111 $zone_var = str_replace(
'-',
'_', $zone );
112 $vars[ $zone_var ] = $this->view->fields->by_position(
'directory_list-' . $zone )->by_visible( $this->view );
113 $vars[
"has_$zone_var" ] = $vars[ $zone_var ]->count();
147 return apply_filters(
'gravityview/template/list/entry/class',
$class, Template_Context::from_template( $context->template, compact(
'entry' ) ) );
165 do_action(
'gravityview/template/list/body/before', $context );
191 do_action(
'gravityview/template/list/body/after', $context );
217 $zone = str_replace(
'//',
'/',
"/$zone/" );
224 do_action( sprintf(
'gravityview/template/list/entry%sbefore', $zone ), Template_Context::from_template( $context->template, compact(
'entry' ) ) );
226 $zone = str_replace(
'/',
'_', $zone );
252 $zone = str_replace(
'//',
'/',
"/$zone/" );
259 do_action( sprintf(
'gravityview/template/list/entry%safter', $zone ), Template_Context::from_template( $context->template, compact(
'entry' ) ) );
261 $zone = str_replace(
'/',
'_', $zone );
the_field(\GV\Field $field, \GV\Entry $entry, $extras=null)
Output the field in the list view.
If this file is called directly, abort.
static body_before( $context)
gravityview_list_body_before and gravityview/template/list/body/before actions.
static getInstance( $passed_post=NULL)
static entry_after( $entry, $context, $zone='')
gravityview_list_entry_after and gravityview/template/list/entry/after actions.
if(gravityview() ->plugin->is_GF_25()) $form
static load( $configuration)
Hydrates the legacy context globals as needed.
static body_after( $context)
gravityview_list_body_after and gravityview/template/list/body/after actions.
If this file is called directly, abort.
If this file is called directly, abort.
If this file is called directly, abort.
If this file is called directly, abort.
static entry_before( $entry, $context, $zone='')
gravityview_list_entry_before and gravityview/template/list/entry/before actions. ...
extract_zone_vars( $zones)
Return an array of variables ready to be extracted.
If this file is called directly, abort.
static entry_class( $class, $entry, $context)
gravityview_entry_class and gravityview/template/list/entry/class filters.
If this file is called directly, abort.
gravityview_field_output( $passed_args, $context=null)
Output field based on a certain html markup.