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 get_current_section_id() { return blocksy_manager()->footer_builder->get_current_section_id(); } public function get_current_section() { return blocksy_manager()->footer_builder->get_current_section(); } 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( [ 'class' => 'site-footer', '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 = ['data-stack' => 'tablet']; } } 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 = ['data-stack' => 'tablet']; } } 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 = ['data-stack' => 'tablet']; } } 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 = ['data-stack' => 'tablet']; } } 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 = ['data-stack' => 'tablet']; } } $container_class = 'ct-container'; if (blocksy_default_akg('footerRowWidth', $atts, 'fixed') !== 'fixed') { $container_class = 'ct-container-fluid'; } $divider_output = []; if ( blocksy_default_akg('footerColumnsDivider', $atts, [ 'width' => 1, 'style' => 'none', 'color' => [ 'color' => '#dddddd', ], ])['style'] !== 'none' ) { $divider_output = ['data-divider' => 'columns']; } $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-location' => $this->get_customizer_location_for( $row['id'] ), ] : [] ), ( [] )); $columns_wrapper_attr = array_merge([ 'class' => $container_class ], $divider_output, $data_stack); $result = '