'100%', '80' => '80%', '75' => '75%', '66' => '66%', '60' => '60%', '50' => '50%', '40' => '40%', '33' => '33%', '25' => '25%', '20' => '20%', ]; protected $context; protected $translator; protected $locale; protected $locale_fo; protected $upload; protected $gdpr; protected $gdpr_msg; protected $gdpr_cfg; /** * Get widget name. * * @since 1.0.0 * * @return string Widget name */ public function getName() { return 'contact-form'; } /** * Get widget title. * * @since 1.0.0 * * @return string Widget title */ public function getTitle() { return __('Contact Form'); } /** * Get widget icon. * * @since 1.0.0 * * @return string Widget icon */ public function getIcon() { return 'eicon-form-horizontal'; } /** * Get widget categories. * * Used to determine where to display the widget in the editor. * * @since 1.0.0 * * @return array Widget categories */ public function getCategories() { return ['premium']; } /** * Get widget keywords. * * Retrieve the list of keywords the widget belongs to. * * @since 2.1.0 * * @return array Widget keywords */ public function getKeywords() { return ['submit', 'send', 'message']; } protected function getContactOptions() { $contacts = \Contact::getContacts($this->context->language->id); $opts = [ '0' => __('Select'), ]; foreach ($contacts as $contact) { $opts[$contact['id_contact']] = $contact['name']; } return $opts; } protected function getModuleLink($module) { if (empty($this->context->employee->id)) { return '#'; } return $this->context->link->getAdminLink('AdminModules') . '&configure=' . $module; } protected function getToken() { if (empty($this->context->cookie->contactFormTokenTTL) || $this->context->cookie->contactFormTokenTTL < time() ) { $this->context->cookie->contactFormToken = md5(uniqid()); $this->context->cookie->contactFormTokenTTL = time() + 600; } return $this->context->cookie->contactFormToken; } protected function trans($id, array $params = [], $domain = 'Modules.Contactform.Shop', $locale = null) { try { return $this->translator->trans($id, $params, $domain, $locale ?: $this->locale); } catch (\Exception $ex) { return $id; } } /** * Register contact form widget controls. * * Adds different input fields to allow the user to change and customize the widget settings. * * @since 1.0.0 */ protected function _registerControls() { $this->startControlsSection( 'section_form_content', [ 'label' => __('Form Fields'), ] ); $this->addControl( 'subject_id', [ 'label' => $this->trans('Subject Heading'), 'type' => ControlsManager::SELECT, 'options' => $this->getContactOptions(), 'default' => '0', ] ); $this->addControl( 'show_upload', [ 'label' => $this->trans('Attach File'), 'type' => $this->upload ? ControlsManager::SWITCHER : ControlsManager::HIDDEN, 'label_off' => __('Hide'), 'label_on' => __('Show'), 'default' => 'yes', ] ); $this->addControl( 'show_reference', [ 'label' => $this->trans('Order Reference'), 'type' => ControlsManager::SWITCHER, 'label_off' => __('Hide'), 'label_on' => __('Show'), 'default' => 'yes', ] ); $this->addControl( 'input_size', [ 'label' => __('Size'), 'type' => ControlsManager::SELECT, 'options' => [ 'xs' => __('Extra Small'), 'sm' => __('Small'), 'md' => __('Medium'), 'lg' => __('Large'), 'xl' => __('Extra Large'), ], 'default' => 'sm', 'separator' => 'before', ] ); $this->addControl( 'show_labels', [ 'label' => __('Label'), 'type' => ControlsManager::SWITCHER, 'default' => 'yes', 'label_off' => __('Hide'), 'label_on' => __('Show'), ] ); $this->endControlsSection(); $this->startControlsSection( 'section_subject_content', [ 'label' => $this->trans('Subject Heading'), 'condition' => [ 'subject_id' => '0', ], ] ); $this->addControl( 'subject_label', [ 'label' => __('Label'), 'type' => ControlsManager::TEXT, 'placeholder' => $this->trans('Subject Heading', [], 'Modules.Contactform.Shop', $this->locale_fo), 'condition' => [ 'show_labels' => 'yes', ], ] ); $this->addResponsiveControl( 'subject_width', [ 'label' => __('Column Width'), 'type' => ControlsManager::SELECT, 'options' => self::$col_width, 'default' => '100', ] ); $this->endControlsSection(); $this->startControlsSection( 'section_email_content', [ 'label' => $this->trans('Email address'), ] ); $this->addControl( 'email_label', [ 'label' => __('Label'), 'type' => ControlsManager::TEXT, 'placeholder' => $this->trans('Email address', [], 'Modules.Contactform.Shop', $this->locale_fo), 'condition' => [ 'show_labels!' => '', ], ] ); $this->addControl( 'email_placeholder', [ 'label' => __('Placeholder'), 'type' => ControlsManager::TEXT, 'placeholder' => $this->trans('your@email.com', [], 'Shop.Forms.Help', $this->locale_fo), ] ); $this->addResponsiveControl( 'email_width', [ 'label' => __('Column Width'), 'type' => ControlsManager::SELECT, 'options' => self::$col_width, 'default' => '100', ] ); $this->endControlsSection(); $this->startControlsSection( 'section_reference_content', [ 'label' => $this->trans('Order Reference'), 'condition' => [ 'show_reference!' => '', ], ] ); $this->addControl( 'reference_label', [ 'label' => __('Label'), 'type' => ControlsManager::TEXT, 'placeholder' => $this->trans('Order Reference', [], 'Modules.Contactform.Shop', $this->locale_fo), 'condition' => [ 'show_labels' => 'yes', ], ] ); $this->addResponsiveControl( 'reference_width', [ 'label' => __('Column Width'), 'type' => ControlsManager::SELECT, 'options' => self::$col_width, 'default' => '100', ] ); $this->endControlsSection(); $this->startControlsSection( 'section_upload_content', [ 'label' => $this->trans('Attach File'), 'condition' => [ 'show_upload' => $this->upload ? 'yes' : 'hide', ], ] ); $this->addControl( 'upload_label', [ 'label' => __('Label'), 'type' => ControlsManager::TEXT, 'placeholder' => $this->trans('Attach File', [], 'Modules.Contactform.Shop', $this->locale_fo), 'condition' => [ 'show_labels' => 'yes', ], ] ); $this->addResponsiveControl( 'upload_width', [ 'label' => __('Column Width'), 'type' => ControlsManager::SELECT, 'options' => self::$col_width, 'default' => '100', ] ); $this->endControlsSection(); $this->startControlsSection( 'section_message_content', [ 'label' => $this->trans('Message'), ] ); $this->addControl( 'message_label', [ 'label' => __('Label'), 'type' => ControlsManager::TEXT, 'placeholder' => $this->trans('Message', [], 'Modules.Contactform.Shop', $this->locale_fo), 'condition' => [ 'show_labels!' => '', ], ] ); $this->addControl( 'message_placeholder', [ 'label' => __('Placeholder'), 'type' => ControlsManager::TEXT, 'placeholder' => $this->trans('How can we help?', [], 'Shop.Forms.Help', $this->locale_fo), ] ); $this->addResponsiveControl( 'message_width', [ 'label' => __('Column Width'), 'type' => ControlsManager::SELECT, 'options' => self::$col_width, 'default' => '100', ] ); $this->addControl( 'message_rows', [ 'label' => __('Rows'), 'type' => ControlsManager::NUMBER, 'default' => '4', ] ); $this->endControlsSection(); $this->startControlsSection( 'section_button_content', [ 'label' => __('Button'), ] ); $this->addControl( 'button_type', [ 'label' => __('Type'), 'type' => ControlsManager::SELECT, 'options' => [ '' => __('Default'), 'primary' => __('Primary'), 'secondary' => __('Secondary'), ], 'prefix_class' => 'elementor-button-', 'style_transfer' => true, ] ); $this->addControl( 'button_text', [ 'label' => __('Text'), 'type' => ControlsManager::TEXT, 'placeholder' => $this->trans('Send', [], 'Modules.Contactform.Shop', $this->locale_fo), ] ); $this->addControl( 'button_size', [ 'label' => __('Size'), 'type' => ControlsManager::CHOOSE, 'toggle' => false, 'options' => WidgetButton::getButtonSizes(), 'default' => 'sm', 'style_transfer' => true, ] ); $this->addResponsiveControl( 'button_width', [ 'label' => __('Column Width'), 'type' => ControlsManager::SELECT, 'options' => self::$col_width, 'default' => '100', ] ); $this->addResponsiveControl( 'button_align', [ 'label' => __('Alignment'), 'type' => ControlsManager::CHOOSE, 'options' => [ 'start' => [ 'title' => __('Left'), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => __('Center'), 'icon' => 'eicon-text-align-center', ], 'end' => [ 'title' => __('Right'), 'icon' => 'eicon-text-align-right', ], 'stretch' => [ 'title' => __('Justified'), 'icon' => 'eicon-text-align-justify', ], ], 'default' => 'stretch', 'prefix_class' => 'elementor%s-button-align-', ] ); $this->addControl( 'selected_icon', [ 'label' => __('Icon'), 'label_block' => false, 'type' => ControlsManager::ICONS, 'skin' => 'inline', 'fa4compatibility' => 'icon', 'recommended' => [ 'ce-icons' => [ 'caret-right', 'angle-right', 'chevron-right', 'arrow-right', 'long-arrow-right', ], 'fa-solid' => [ 'right-to-bracket', 'arrow-right-to-bracket', 'right-long', 'arrow-right-long', 'arrow-right', 'chevron-right', 'caret-right', 'angle-right', 'angles-right', 'square-caret-right', 'circle-chevron-right', 'circle-arrow-right', 'circle-right', 'paper-plane', ], 'fa-regular' => [ 'square-caret-right', 'circle-right', 'paper-plane', ], ], ] ); $this->addControl( 'icon_align', [ 'label' => __('Icon Position'), 'type' => ControlsManager::SELECT, 'default' => 'left', 'options' => [ 'left' => __('Before'), 'right' => __('After'), ], 'condition' => [ 'selected_icon[value]!' => '', ], ] ); $this->addControl( 'icon_indent', [ 'label' => __('Icon Spacing'), 'type' => ControlsManager::SLIDER, 'range' => [ 'px' => [ 'max' => 50, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-button-content-wrapper' => 'gap: {{SIZE}}{{UNIT}}', '{{WRAPPER}} .elementor-button-text' => 'flex-grow: min(0, {{SIZE}})', ], 'condition' => [ 'selected_icon[value]!' => '', ], ] ); $this->endControlsSection(); $this->startControlsSection( 'section_additional_options', [ 'label' => __('Additional Options'), 'type' => ControlsManager::SECTION, ] ); $this->addControl( 'custom_messages', [ 'label' => __('Messages'), 'type' => ControlsManager::SELECT, 'options' => [ '' => __('Default'), 'yes' => __('Custom'), ], ] ); $this->addControl( 'success_message', [ 'label' => __('Success'), 'label_block' => true, 'type' => ControlsManager::TEXT, 'placeholder' => $this->trans('Your message has been successfully sent to our team.', [], 'Modules.Contactform.Shop', $this->locale_fo), 'condition' => [ 'custom_messages!' => '', ], ] ); $this->addControl( 'error_message', [ 'label' => __('Error'), 'label_block' => true, 'type' => ControlsManager::TEXT, 'placeholder' => $this->trans('An error occurred while sending the message.', [], 'Modules.Contactform.Shop', $this->locale_fo), 'condition' => [ 'custom_messages!' => '', ], ] ); $this->addControl( 'configure_module', [ 'label' => __('Contact Form'), 'type' => ControlsManager::BUTTON, 'text' => '' . __('Configure'), 'link' => [ 'url' => $this->getModuleLink('contactform'), 'is_external' => true, ], 'separator' => 'before', ] ); empty($this->gdpr) or $this->addControl( 'configure_gdpr', [ 'label' => __('GDPR'), 'type' => ControlsManager::BUTTON, 'text' => '' . __('Configure'), 'link' => [ 'url' => $this->gdpr_cfg, 'is_external' => true, ], ] ); $this->endControlsSection(); $this->startControlsSection( 'section_style_form', [ 'label' => __('Form'), 'tab' => ControlsManager::TAB_STYLE, ] ); $this->addControl( 'column_gap', [ 'label' => __('Columns Gap'), 'type' => ControlsManager::SLIDER, 'default' => [ 'size' => 10, ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 60, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-field-group' => 'padding-right: calc({{SIZE}}{{UNIT}} / 2); padding-left: calc({{SIZE}}{{UNIT}} / 2);', '{{WRAPPER}} .elementor-form-fields-wrapper' => 'margin-left: calc(-{{SIZE}}{{UNIT}} / 2); margin-right: calc(-{{SIZE}}{{UNIT}} / 2);', ], ] ); $this->addControl( 'row_gap', [ 'label' => __('Rows Gap'), 'type' => ControlsManager::SLIDER, 'default' => [ 'size' => 10, ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 60, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-field-group' => 'margin-bottom: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .elementor-form-fields-wrapper' => 'margin-bottom: -{{SIZE}}{{UNIT}};', ], ] ); $this->addControl( 'heading_style_label', [ 'type' => ControlsManager::HEADING, 'label' => __('Label'), 'separator' => 'before', 'condition' => [ 'show_labels!' => '', ], ] ); $this->addControl( 'label_spacing', [ 'label' => __('Spacing'), 'type' => ControlsManager::SLIDER, 'default' => [ 'size' => 0, ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 60, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-field-group > label' => 'padding-bottom: {{SIZE}}{{UNIT}};', ], 'condition' => [ 'show_labels!' => '', ], ] ); $this->addControl( 'label_color', [ 'label' => __('Text Color'), 'type' => ControlsManager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-field-group label' => 'color: {{VALUE}};', ], 'scheme' => [ 'type' => SchemeColor::getType(), 'value' => SchemeColor::COLOR_3, ], 'condition' => [ 'show_labels!' => '', ], ] ); $this->addGroupControl( GroupControlTypography::getType(), [ 'name' => 'label_typography', 'scheme' => SchemeTypography::TYPOGRAPHY_3, 'selector' => '{{WRAPPER}} .elementor-field-group label', 'condition' => [ 'show_labels!' => '', ], ] ); empty($this->gdpr) or $this->addControl( 'heading_style_checkbox', [ 'type' => ControlsManager::HEADING, 'label' => __('Checkbox'), 'separator' => 'before', ] ); $this->addControl( 'checkbox_spacing', [ 'label' => __('Spacing'), 'type' => $this->gdpr ? ControlsManager::SLIDER : ControlsManager::HIDDEN, 'default' => [ 'size' => 5, 'unit' => 'px', ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 60, ], ], 'selectors' => !$this->gdpr ? [] : [ '{{WRAPPER}} input[type=checkbox]' => 'margin: 0 {{SIZE}}{{UNIT}};', ], ] ); $this->endControlsSection(); $this->startControlsSection( 'section_field_style', [ 'label' => __('Field'), 'tab' => ControlsManager::TAB_STYLE, ] ); $this->addGroupControl( GroupControlTypography::getType(), [ 'name' => 'field_typography', 'selector' => '{{WRAPPER}} .elementor-field-group .elementor-field', 'scheme' => SchemeTypography::TYPOGRAPHY_3, ] ); $this->addControl( 'field_text_color', [ 'label' => __('Text Color'), 'type' => ControlsManager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-field-group .elementor-field' => 'color: {{VALUE}};', ], 'scheme' => [ 'type' => SchemeColor::getType(), 'value' => SchemeColor::COLOR_3, ], ] ); $this->addControl( 'field_background_color', [ 'label' => __('Background Color'), 'type' => ControlsManager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-field-group .elementor-field-textual' => 'background-color: {{VALUE}};', ], ] ); $this->addControl( 'field_border_color', [ 'label' => __('Border Color'), 'type' => ControlsManager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-field-group .elementor-field-textual' => 'border-color: {{VALUE}};', ], ] ); $this->addControl( 'field_border_width', [ 'label' => __('Border Width'), 'type' => ControlsManager::DIMENSIONS, 'size_units' => ['px'], 'selectors' => [ '{{WRAPPER}} .elementor-field-group .elementor-field-textual' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->addControl( 'field_border_radius', [ 'label' => __('Border Radius'), 'type' => ControlsManager::DIMENSIONS, 'size_units' => ['px', '%'], 'selectors' => [ '{{WRAPPER}} .elementor-field-group .elementor-field-textual' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->endControlsSection(); $this->startControlsSection( 'section_button_style', [ 'label' => __('Button'), 'tab' => ControlsManager::TAB_STYLE, ] ); $this->addGroupControl( GroupControlTypography::getType(), [ 'name' => 'button_typography', 'scheme' => SchemeTypography::TYPOGRAPHY_4, 'selector' => '{{WRAPPER}} .elementor-button', ] ); $this->startControlsTabs('tabs_button_style'); $this->startControlsTab( 'tab_button_normal', [ 'label' => __('Normal'), ] ); $this->addControl( 'button_text_color', [ 'label' => __('Text Color'), 'type' => ControlsManager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-button' => 'color: {{VALUE}};', ], ] ); $this->addControl( 'button_background_color', [ 'label' => __('Background Color'), 'type' => ControlsManager::COLOR, 'scheme' => [ 'type' => SchemeColor::getType(), 'value' => SchemeColor::COLOR_4, ], 'selectors' => [ '{{WRAPPER}} .elementor-button' => 'background-color: {{VALUE}};', ], ] ); $this->addControl( 'button_border_color', [ 'label' => __('Border Color'), 'type' => ControlsManager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-button' => 'border-color: {{VALUE}};', ], ] ); $this->endControlsTab(); $this->startControlsTab( 'tab_button_hover', [ 'label' => __('Hover'), ] ); $this->addControl( 'button_hover_color', [ 'label' => __('Text Color'), 'type' => ControlsManager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-button:hover' => 'color: {{VALUE}};', ], ] ); $this->addControl( 'button_background_hover_color', [ 'label' => __('Background Color'), 'type' => ControlsManager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-button:hover' => 'background-color: {{VALUE}};', ], ] ); $this->addControl( 'button_hover_border_color', [ 'label' => __('Border Color'), 'type' => ControlsManager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-button:hover' => 'border-color: {{VALUE}};', ], ] ); $this->endControlsTab(); $this->endControlsTabs(); $this->addControl( 'button_border_width', [ 'label' => __('Border Width'), 'type' => ControlsManager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 20, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-button' => 'border-width: {{SIZE}}{{UNIT}};', ], 'separator' => 'before', ] ); $this->addControl( 'button_border_radius', [ 'label' => __('Border Radius'), 'type' => ControlsManager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-button' => 'border-radius: {{SIZE}}{{UNIT}};', ], ] ); $this->addControl( 'button_hover_animation', [ 'label' => __('Animation'), 'type' => ControlsManager::HOVER_ANIMATION, ] ); $this->endControlsSection(); $this->startControlsSection( 'section_messages_style', [ 'label' => __('Messages'), 'tab' => ControlsManager::TAB_STYLE, ] ); $this->addGroupControl( GroupControlTypography::getType(), [ 'name' => 'messages_typography', 'scheme' => SchemeTypography::TYPOGRAPHY_2, 'selector' => '{{WRAPPER}} .elementor-message', ] ); $this->addControl( 'heading_style_success', [ 'type' => ControlsManager::HEADING, 'label' => __('Success'), ] ); $this->addControl( 'success_message_color', [ 'label' => __('Text Color'), 'type' => ControlsManager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-message.elementor-message-success' => 'color: {{COLOR}};', ], ] ); $this->addControl( 'heading_style_error', [ 'type' => ControlsManager::HEADING, 'label' => __('Error'), ] ); $this->addControl( 'error_message_color', [ 'label' => __('Text Color'), 'type' => ControlsManager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-message.elementor-message-danger' => 'color: {{COLOR}};', ], ] ); $this->endControlsSection(); } /** * Render contact form widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 */ protected function render() { $settings = $this->getSettingsForDisplay(); $id = $this->getId(); $id_contact = 0; $id_order = 0; $orders = $settings['show_reference'] && !empty($this->context->customer->id) ? \Order::getCustomerOrders($this->context->customer->id) : []; $show_labels = (bool) $settings['show_labels']; $input_classes = 'elementor-field elementor-size-' . esc_attr($settings['input_size']); $this->addRenderAttribute('form', [ 'action' => $this->context->link->getModuleLink('creativeelements', 'ajax', [], null, null, null, true), 'method' => 'post', 'enctype' => 'multipart/form-data', 'data-success' => $settings['custom_messages'] ? $settings['success_message'] : '', 'data-error' => $settings['custom_messages'] ? $settings['error_message'] : '', ]); $this->addRenderAttribute('email', [ 'id' => 'from-' . $id, 'value' => isset($this->context->customer->email) ? $this->context->customer->email : '', 'placeholder' => $settings['email_placeholder'] ?: $this->trans('your@email.com', [], 'Shop.Forms.Help'), 'inputmode' => 'email', ]); $this->addRenderAttribute('message', [ 'id' => 'message-' . $id, 'placeholder' => $settings['message_placeholder'] ?: $this->trans('How can we help?', [], 'Shop.Forms.Help'), 'rows' => (int) $settings['message_rows'], ]); $this->addRenderAttribute('button', 'class', 'elementor-button elementor-size-' . $settings['button_size']); if ($settings['button_hover_animation']) { $this->addRenderAttribute('button', 'class', 'elementor-animation-' . $settings['button_hover_animation']); } if (\Tools::getIsset('token') && $id_customer_thread = (int) \Tools::getValue('id_customer_thread')) { $ct = new \CustomerThread($id_customer_thread); if (\Tools::getValue('token') === $ct->token) { $id_contact = $ct->id_contact; if ($settings['show_reference'] && $id_order = $ct->id_order) { $order = new \Order($id_order); $orders = [ [ 'id_order' => $order->id, 'reference' => $order->reference, ], ]; } $this->setRenderAttribute('email', 'value', $ct->email); } } ?>
locale = $this->locale_fo; ?> <# var contacts = context->language->id)); ?>, email_placeholder = settings.email_placeholder || trans('your@email.com', [], 'Shop.Forms.Help')); ?>, message_placeholder = settings.message_placeholder || trans('How can we help?', [], 'Shop.Forms.Help')); ?>, upload = upload; ?>; #> locale = null; } public function __construct($data = [], $args = []) { $this->context = \Context::getContext(); $this->translator = $this->context->getTranslator(); $id_lang = (int) \Tools::getValue('id_lang'); $lang = $id_lang ? new \Language($id_lang) : null; $this->locale_fo = isset($lang->locale) ? $lang->locale : null; $this->upload = \Configuration::get('PS_CUSTOMER_SERVICE_FILE_UPLOAD'); $this->initGDPR($id_lang); parent::__construct($data, $args); } protected function initGDPR($id_lang) { empty($id_lang) && $id_lang = $this->context->language->id; if (\Module::isEnabled('psgdpr') && \Module::getInstanceByName('psgdpr') && call_user_func('GDPRConsent::getConsentActive', $id_module = \Module::getModuleIdByName('contactform')) ) { $this->gdpr = 'psgdpr_consent_checkbox'; $this->gdpr_msg = call_user_func('GDPRConsent::getConsentMessage', $id_module, $id_lang); $this->gdpr_cfg = $this->getModuleLink('psgdpr&page=dataConsent'); } elseif (\Module::isEnabled('gdprpro') && \Configuration::get('gdpr-pro_consent_contact_enable')) { $this->gdpr = 'gdpr_consent_chkbox'; $this->gdpr_msg = \Configuration::get('gdpr-pro_consent_contact_text', $id_lang); $this->gdpr_cfg = empty($this->context->employee) ? '#' : $this->context->link->getAdminLink('AdminGdprConfig'); } // Striptags from GDPR message empty($this->gdpr_msg) or $this->gdpr_msg = preg_replace('~?p\b.*?>~i', '', $this->gdpr_msg); } }