PluginProbe ʕ •ᴥ•ʔ
Brevo – Email, SMS, Web Push, Chat, and more. / 1.5
Brevo – Email, SMS, Web Push, Chat, and more. v1.5
2.9.13 2.9.14 2.9.15 2.9.16 2.9.17 2.9.18 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8 2.9.9 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.9 3.1.0 3.1.1 3.1.10 3.1.11 3.1.12 3.1.13 3.1.14 3.1.15 3.1.16 3.1.2 3.1.20 3.1.21 3.1.22 3.1.23 3.1.24 3.1.25 3.1.26 3.1.27 3.1.28 3.1.29 3.1.3 3.1.30 3.1.31 3.1.32 3.1.33 3.1.34 3.1.35 3.1.36 3.1.37 3.1.38 3.1.39 3.1.4 3.1.40 3.1.41 3.1.42 3.1.43 3.1.44 3.1.45 3.1.46 3.1.47 3.1.48 3.1.49 3.1.5 3.1.50 3.1.51 3.1.52 3.1.53 3.1.54 3.1.55 3.1.56 3.1.57 3.1.58 3.1.59 3.1.6 3.1.60 3.1.61 3.1.62 3.1.63 3.1.64 3.1.65 3.1.66 3.1.67 3.1.68 3.1.69 3.1.7 3.1.70 3.1.71 3.1.72 3.1.73 3.1.74 3.1.75 3.1.76 3.1.77 3.1.78 3.1.79 3.1.8 3.1.80 3.1.81 3.1.82 3.1.83 3.1.84 3.1.85 3.1.86 3.1.87 3.1.88 3.1.89 3.1.9 3.1.90 3.1.91 3.1.92 3.1.93 3.1.94 3.1.95 3.1.96 3.1.97 3.1.98 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 trunk 1.0 1.5 2.0.8 2.9.10 2.9.11 2.9.12
mailin / mailin_widget.php
mailin Last commit date
css 12 years ago emails 12 years ago img 12 years ago js 12 years ago lang 12 years ago ajaxcall.php 12 years ago ajaxcontent.php 12 years ago ajaxmanagesubscribe.php 12 years ago ajaxsmtp.php 12 years ago api_form.php 12 years ago compatibility.php 12 years ago cron.php 12 years ago listings.php 12 years ago mailin.php 12 years ago mailin_widget.php 12 years ago mailinapi.class.php 12 years ago readme.html 12 years ago
mailin_widget.php
196 lines
1 <?php
2
3 /*
4 Description: This is mailin widget which is working with mailin wordpress plugin . from this widget you can manage title of the block displayed in front office . you can also manage to display Prenom and Nom.
5 Author: deshbandhu
6 Version: 1
7 Author URI: http://mailin.fr/
8 */
9
10
11 /**
12 * Adds Foo_Widget widget.
13 */
14
15 function getMailinSubscriptionForm($arg)
16 {
17
18 $api_key = get_option('mailin_apikey');
19
20 $mailin_apikey_status = get_option('mailin_apikey_status');
21
22 $mailin_manage_subscribe = get_option('mailin_manage_subscribe');
23
24 $mailin_unsubscribe = get_option('mailin_unsubscribe');
25
26 if ($api_key == false || $mailin_apikey_status == 0 || $mailin_manage_subscribe == 0)
27 return false;
28 if (get_option('mailin_list_selected') != '')
29 {
30 ?>
31 <div id="mailin_signup_box">
32 <form id="mailin_signup_form" action="#mailin_signup_box" method="post">
33 <input type="hidden" value="subscribe_form_submit" name="mailin_form_action">
34 <div class="mailin_signup_box_inside">
35 <div class="mailin_signup_box_row">
36 <span class="mailin_widget_head"> <?php esc_html_e($arg['title'], 'mailin_i18n');?></span></div>
37 <?php
38 if (mailinMessages() != '')
39 {
40 ?>
41 <div id="mailin_message">
42 <?php
43 echo mailinMessages();
44 ?>
45 </div>
46 <?php
47 }
48 ?>
49
50 <?php
51 if ($arg['firstname'] == 1)
52 {
53 ?>
54 <div class="mailin_signup_box_row">
55 <label><?php echo esc_html_e('First name', 'mailin_i18n'); ?><span class="required">*</span></label>
56 <input type="text" id="fname" name="fname" value="<?php echo isset($_POST['fname']) ? $_POST['fname'] : ''; ?>" size="21" maxlength="55">
57 </div>
58 <?php
59 }
60 ?>
61
62 <?php
63 if ($arg['lastname'] == 2)
64 {
65 ?>
66 <div class="mailin_signup_box_row">
67 <label><?php echo esc_html_e('Last name', 'mailin_i18n');?><span class="required">*</span>
68 </label><input type="text" id="lname" name="lname" value="<?php echo isset($_POST['lname']) ? $_POST['lname'] : ''; ?>" size="21" maxlength="55">
69 </div>
70 <?php }?>
71
72 <div class="mailin_signup_box_row">
73 <label><?php echo esc_html_e('Email', 'mailin_i18n'); ?><span class="required">*</span> </label>
74 <input type="text" id="mailin_email" name="mailin_email" value="<?php echo isset($_POST['mailin_email']) ? $_POST['mailin_email'] : ''; ?>" size="21">
75 </div>
76 <?php
77 if ($mailin_unsubscribe == 1)
78 {
79 ?>
80 <div class="mailin_signup_box_row">
81 <select name="action">
82 <option value="1" <?php if(isset($_POST['action']) && $_POST['action'] == 1 ) echo 'selected'; ?> >
83 <?php
84 echo esc_html_e('Subscribe', 'mailin_i18n');
85 ?>
86 </option>
87 <option value="2"
88 <?php if(isset($_POST['action']) && $_POST['action'] == 2) echo 'selected'; ?>>
89 <?php
90 echo esc_html_e('Unsubscribe', 'mailin_i18n');
91 ?>
92 </option>
93 </select>
94 </div>
95 <?php
96 }
97 ?>
98
99
100 <div class="mailin_signup_box_row right">
101 <input type="submit" class="button" value="<?php echo esc_html_e('Validate', 'mailin_i18n'); ?>" id="mailin_signup_submit" name="mailin_signup_submit"></div>
102 </div>
103 </form>
104 </div>
105
106
107 <?php
108 }
109 }
110
111
112 class Mailin_Widget extends WP_Widget
113 {
114
115 /**
116 * Register widget with WordPress.
117 */
118 public function __construct()
119 {
120 parent::__construct('mailin_widget', // Base ID
121 'Mailin_Widget', // Name
122 array(
123 'description' => __('Mailin Widget', 'mailin_i18n')
124 ) // Args
125 );
126 }
127
128 /**
129 * Front-end display of widget.
130 *
131 * @see WP_Widget::widget()
132 *
133 * @param array $args Widget arguments.
134 * @param array $instance Saved values from database.
135 */
136 public function widget($args, $instance)
137 {
138 extract($args);
139 if (!is_array($instance))
140 $instance = array();
141 getMailinSubscriptionForm(array_merge($args, $instance));
142 }
143 public function form($instance)
144 {
145 if (isset($instance['title']) && !empty($instance['title']))
146 $title = $instance['title'];
147 else
148 $title = 'Subscribe to newsletter';
149 if (isset($instance['firstname']) && $instance['firstname'] == 1)
150 $fchecked = 'checked';
151 else if (!isset($instance['firstname']))
152 $fchecked = 'checked';
153 if (isset($instance['lastname']) && $instance['lastname'] == 2)
154 $lchecked = 'checked';
155 else if (!isset($instance['lastname']))
156 $lchecked = 'checked';
157
158
159 ?>
160 <p><label for="<?php echo $this->get_field_id('title'); ?>" >
161 <?php _e('Title:'); ?></label>
162 <input id="<?php echo $this->get_field_id('title'); ?>"
163 name="<?php echo $this->get_field_name('title');?>" type="text" value="<?php echo $title; ?>" /></p>
164
165 <p><input <?php echo $fchecked; ?>
166 id="<?php echo $this->get_field_id('firstname'); ?>"
167 name="<?php echo $this->get_field_name('firstname'); ?>" type="checkbox" value="1" />
168 <label for="<?php echo $this->get_field_id('firstname'); ?>">
169 <?php _e('Display first name input', 'mailin_i18n'); ?></label></p>
170
171 <p> <input <?php echo $lchecked; ?>
172 id="<?php echo $this->get_field_id('lastname'); ?>"
173 name="<?php echo $this->get_field_name('lastname'); ?>" type="checkbox" value="2" />
174 <label for="<?php echo $this->get_field_id('lastname'); ?>">
175 <?php _e('Display last name input', 'mailin_i18n'); ?></label></p>
176
177 <?php
178 }
179 public function update($new_instance, $old_instance)
180 {
181 $instance['title'] = strip_tags($new_instance['title']);
182 $instance['firstname'] = strip_tags($new_instance['firstname']);
183 $instance['lastname'] = strip_tags($new_instance['lastname']);
184
185 return $instance;
186 }
187 }
188 function mailinRegisterWidgets()
189 {
190 register_widget('Mailin_Widget');
191 }
192
193 add_action('widgets_init', 'mailinRegisterWidgets');
194
195 ?>
196