���� JFIF �� � ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /var/www/html/form/content/plugins/halfdata-green-forms/ |
<?php if (!defined('UAP_CORE') && !defined('ABSPATH')) exit; class leform_widget extends WP_Widget { function __construct() { parent::__construct(false, esc_html__('Green Forms', 'leform')); } function widget($args, $instance) { global $leform, $wpdb; $content = ''; $form_id = $leform->wpml_parse_form_id($instance['form-id']); include_once(dirname(__FILE__).'/modules/core-front.php'); $html = leform_front_class::shortcode_handler(array('id' => $form_id)); if (!empty($html)) { $content = $args['before_widget'].'<div style="clear:both; max-width:'.$instance['width-max'].'px; margin:'.$instance['margin-top'].'px '.$instance['margin-right'].'px '.$instance['margin-bottom'].'px '.$instance['margin-left'].'px;">'.$html.'</div>'.$args['after_widget']; } echo $content; } function update($new_instance, $old_instance) { global $leform, $wpdb; $instance = $old_instance; $instance['form-id'] = $leform->wpml_compile_form_id(strip_tags($new_instance['form-id']), $instance['form-id']); $instance['width-max'] = intval($new_instance['width-max']); $instance['margin-top'] = intval($new_instance['margin-top']); $instance['margin-bottom'] = intval($new_instance['margin-bottom']); $instance['margin-left'] = intval($new_instance['margin-left']); $instance['margin-right'] = intval($new_instance['margin-right']); return $instance; } function form($instance) { global $leform, $wpdb; $instance = wp_parse_args((array)$instance, array('form-id' => '', 'margin-top' => 0, 'margin-bottom' => 0, 'margin-left' => 0, 'margin-right' => 0, 'width-max' => 320)); $popup_selected = $leform->wpml_parse_form_id(strip_tags($instance['form-id'])); $margin_top = intval($instance['margin-top']); $margin_bottom = intval($instance['margin-bottom']); $margin_right = intval($instance['margin-right']); $margin_left = intval($instance['margin-left']); $width_max = intval($instance['width-max']); $forms = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."leform_forms WHERE deleted = '0' AND active = '1' ORDER BY active DESC, id DESC", ARRAY_A); echo ' <p> <label for="'.$this->get_field_id('form-id').'">'.esc_html__('Forms', 'leform').':</label>'; if (sizeof($forms) > 0) { $status = -1; echo ' <select class="widefat" id="'.$this->get_field_id('form-id').'" name="'.$this->get_field_name('form-id').'">'; foreach($forms as $form) { if ($form['active'] != $status) { if ($form['active'] == 1) echo '<option disabled="disabled">--------- '.esc_html__('Active forms', 'leform').' ---------</option>'; else echo '<option disabled="disabled">--------- '.esc_html__('Inactive forms', 'leform').' ---------</option>'; $status = $form['active']; } if ($popup_selected == $form['id']) { echo ' <option value="'.$form['id'].'" selected="selected"'.($form['active'] == 1 ? '' : ' disabled="disabled"').'>'.esc_html($form['name']).'</option>'; } else { echo ' <option value="'.$form['id'].'"'.($form['active'] == 1 ? '' : ' disabled="disabled"').'>'.esc_html($form['name']).'</option>'; } } echo ' </select>'; } else { echo esc_html__('Create at least one form.', 'leform'); } echo ' </p> <p> <label class="leform-widget-label" for="'.$this->get_field_id("margin-top").'">'.esc_html__('Top margin', 'leform').':</label> <input class="leform-widget-tiny-text" id="'.$this->get_field_id('margin-top').'" name="'.$this->get_field_name('margin-top').'" type="number" step="1" min="-20" value="'.$margin_top.'" size="3"> '.esc_html__('px', 'leform').' <label class="leform-widget-label" for="'.$this->get_field_id("margin-bottom").'">'.esc_html__('Bottom margin', 'leform').':</label> <input class="leform-widget-tiny-text" id="'.$this->get_field_id('margin-bottom').'" name="'.$this->get_field_name('margin-bottom').'" type="number" step="1" min="-20" value="'.$margin_bottom.'" size="3"> '.esc_html__('px', 'leform').' <label class="leform-widget-label" for="'.$this->get_field_id("margin-left").'">'.esc_html__('Left margin', 'leform').':</label> <input class="leform-widget-tiny-text" id="'.$this->get_field_id('margin-left').'" name="'.$this->get_field_name('margin-left').'" type="number" step="1" min="-20" value="'.$margin_left.'" size="3"> '.esc_html__('px', 'leform').' <label class="leform-widget-label" for="'.$this->get_field_id("margin-right").'">'.esc_html__('Right margin', 'leform').':</label> <input class="leform-widget-tiny-text" id="'.$this->get_field_id('margin-right').'" name="'.$this->get_field_name('margin-right').'" type="number" step="1" min="-20" value="'.$margin_right.'" size="3"> '.esc_html__('px', 'leform').' </p> <p> <label class="leform-widget-label" for="'.$this->get_field_id("width-max").'">'.esc_html__('Max width', 'leform').':</label> <input class="leform-widget-tiny-text" id="'.$this->get_field_id('width-max').'" name="'.$this->get_field_name('width-max').'" type="number" step="1" min="120" value="'.$width_max.'" size="3"> '.esc_html__('px', 'leform').' </p>'; } } ?>