placements_key = $placements_key; $b = new Blocksy_Customizer_Builder(); $this->registered_items = $b->get_registered_items_by('footer'); } public function get_section_value() { $footer = new Blocksy_Customizer_Builder_Footer(); return get_theme_mod( $this->placements_key, $footer->get_default_value() ); } public function get_current_section() { if (! $this->section_value) { $this->section_value = $this->get_section_value(); } foreach ($this->section_value['sections'] as $single_section) { if ($single_section['id'] === $this->section_value['current_section']) { return $single_section; } } return $this->section_value['sections'][0]; } 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'], 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']; } } $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 = []; if (blocksy_default_akg('footerRowTopDivider', $atts, [ 'width' => 1, 'style' => 'none', 'color' => [ 'color' => '#dddddd', ], ])['style'] !== 'none') { $row_divider_output[] = 'top'; } if (blocksy_default_akg('footerRowBottomDivider', $atts, [ 'width' => 1, 'style' => 'none', 'color' => [ 'color' => '#dddddd', ], ])['style'] !== 'none') { $row_divider_output[] = 'bottom'; } if (! empty($row_divider_output)) { $row_divider_output = [ 'data-divider' => implode(':', $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 = '