is_row_empty($item); } $section = $this->get_current_section(); foreach (array_values($section['rows']) as $row) { foreach ($row['columns'] as $single_column) { if (in_array($item, $single_column)) { return true; } } } return false; } public function render() { $content = ''; $footer = $this->get_current_section(); $atts = $footer['settings']; foreach ($this->get_current_section()['rows'] as $row) { $content .= $this->render_row($row); } return blocksy_html_tag( 'footer', array_merge( [ 'id' => 'footer', 'class' => 'ct-footer' . (blocksy_akg('footer_container_structure', $atts, 'fixed') === 'boxed' ? ' ct-container': ''), 'data-id' => $this->get_short_section_id() ], blocksy_schema_org_definitions('footer', [ 'array' => true ]) ), $content ); } public function render_row($row) { if ($this->is_row_empty($row)) { return ''; } $row_config = $this->get_item_config_for($row['id']); $simplified_id = str_replace( '-row', '', $row['id'] ); $atts = $this->get_item_data_for($row['id']); $count = count($row['columns']); $data_stack = []; if ($count === 2) { $columns = blocksy_default_akg( '2_columns_layout', $atts, [ 'desktop' => 'repeat(2, 1fr)', 'tablet' => 'initial', 'mobile' => 'initial' ] ); if ($columns['tablet'] === 'initial') { $data_stack[] = 'tablet'; } if ($columns['mobile'] === 'initial') { $data_stack[] = 'mobile'; } } if ($count === 3) { $columns = blocksy_default_akg( '3_columns_layout', $atts, [ 'desktop' => 'repeat(3, 1fr)', 'tablet' => 'initial', 'mobile' => 'initial' ] ); if ($columns['tablet'] === 'initial') { $data_stack[] = 'tablet'; } if ($columns['mobile'] === 'initial') { $data_stack[] = 'mobile'; } } if ($count === 4) { $columns = blocksy_default_akg( '4_columns_layout', $atts, [ 'desktop' => 'repeat(4, 1fr)', 'tablet' => 'initial', 'mobile' => 'initial' ] ); if ($columns['tablet'] === 'initial') { $data_stack[] = 'tablet'; } if ($columns['mobile'] === 'initial') { $data_stack[] = 'mobile'; } } if ($count === 5) { $columns = blocksy_default_akg( '5_columns_layout', $atts, [ 'desktop' => 'repeat(5, 1fr)', 'tablet' => 'initial', 'mobile' => 'initial' ] ); if ($columns['tablet'] === 'initial') { $data_stack[] = 'tablet'; } if ($columns['mobile'] === 'initial') { $data_stack[] = 'mobile'; } } if ($count === 6) { $columns = blocksy_default_akg( '6_columns_layout', $atts, [ 'desktop' => 'repeat(6, 1fr)', 'tablet' => 'initial', 'mobile' => 'initial' ] ); if ($columns['tablet'] === 'initial') { $data_stack[] = 'tablet'; } if ($columns['mobile'] === 'initial') { $data_stack[] = 'mobile'; } } $data_grid = []; if (! in_array('tablet', $data_stack)) { $data_grid[] = 'md'; } if (! in_array('mobile', $data_stack)) { $data_grid[] = 'sm'; } if (! empty($data_grid)) { $data_grid = ['data-columns-divider' => implode(':', $data_grid)]; } $container_class = 'ct-container'; $footer = $this->get_current_section(); $footer_atts = $footer['settings']; if ( blocksy_default_akg('footerRowWidth', $atts, 'fixed') !== 'fixed' || blocksy_akg('footer_container_structure', $footer_atts, 'fixed') === 'fluid' ) { $container_class = 'ct-container-fluid'; } if (blocksy_akg('footer_container_structure', $footer_atts, 'fixed') === 'boxed') { $container_class = 'ct-container-auto'; } $row_divider_output = []; $visibility_classes = blocksy_visibility_classes( blocksy_default_akg( 'footerRowVisibility', $atts, [ 'desktop' => true, 'tablet' => true, 'mobile' => true, ] ) ); if (! empty($visibility_classes)) { $row_divider_output['class'] = $visibility_classes; } $row_container_attr = array_merge([ 'data-row' => $simplified_id, ], $row_divider_output, ( is_customize_preview() ? [ 'data-item-label' => $row_config['config']['name'], 'data-shortcut' => 'border', 'data-shortcut-location' => $this->get_customizer_location_for( $row['id'] ), ] : [] ), ( [] )); $columns_wrapper_attr = array_merge([ 'class' => $container_class ], $data_grid); $result = '