admin_form_before(); $output .= $this->admin_form_start(); $output .= $this->default_fields(); $widget_saved_values = $this->get_settings(); $output .= $this->admin_language_tab(); //have to start language tab from here on $output .= $this->admin_language_tab_start(); $all_languages = LanguageHelper::all_languages(); foreach ($all_languages as $key => $lang) { $output .= $this->admin_language_tab_content_start([ 'class' => $key == 0 ? 'tab-pane fade show active' : 'tab-pane fade', 'id' => "nav-home-" . $lang->slug ]); $output .= Text::get([ 'name' => 'section_title_'.$lang->slug, 'label' => __('Section Title'), 'value' => $widget_saved_values['section_title_' . $lang->slug] ?? null, ]); $output .= $this->admin_language_tab_content_end(); } $output .= $this->admin_language_tab_end(); //have to end language tab $output .= Repeater::get([ 'multi_lang' => true, 'settings' => $widget_saved_values, 'id' => 'header_eleven', 'fields' => [ [ 'type' => RepeaterField::TEXT, 'name' => 'title', 'label' => __('Title') ], [ 'type' => RepeaterField::TEXTAREA, 'name' => 'description', 'label' => __('Description') ], [ 'type' => RepeaterField::TEXT, 'name' => 'url', 'label' => __('Url') ], [ 'type' => RepeaterField::ICON_PICKER, 'name' => 'button_icon', 'label' => __('Icon') ] ] ]); $output .= Select::get([ 'name' => 'section_title_alignment', 'label' => __('Section Title Alignment'), 'options' => [ 'left-align' => __('left Align'), 'center-align' => __('Center Align'), 'right-align' => __('Right Align'), ], 'value' => $widget_saved_values['section_title_alignment'] ?? null, ]); $output .= Slider::get([ 'name' => 'padding_top', 'label' => __('Padding Top'), 'value' => $widget_saved_values['padding_top'] ?? 90, 'max' => 500, ]); $output .= Slider::get([ 'name' => 'padding_bottom', 'label' => __('Padding Bottom'), 'value' => $widget_saved_values['padding_bottom'] ?? 200, 'max' => 500, ]); $output .= $this->admin_form_submit_button(); $output .= $this->admin_form_end(); $output .= $this->admin_form_after(); return $output; } /** * frontend_render * this method must have to implement by all widget to render frontend widget content * @since 1.0.0 * */ public function frontend_render(): string { $settings = $this->get_settings(); $padding_top = SanitizeInput::esc_html($settings['padding_top']); $padding_bottom = SanitizeInput::esc_html($settings['padding_bottom']); $section_title = SanitizeInput::esc_html($settings['section_title_'. LanguageHelper::user_lang_slug()]); $section_title_alignment = SanitizeInput::esc_html($settings['section_title_alignment']); $section_title_markup = ''; if (!empty($section_title)){ $section_title_markup = <<