?> </p> <label for="tag-display-status"><?php _e('Select default group', 'email-subscribers'); ?> </label> <select name="es_registered_group" id="es_email_group"> <option value=''><?php _e('Select', 'email-subscribers'); ?> </option> <?php $thisselected = ""; $groups = array(); $groups = es_cls_dbquery::es_view_subscriber_group(); if (count($groups) > 0) { $i = 1; foreach ($groups as $group) { if ($group["es_email_group"] == $es_registered_group) { $thisselected = "selected='selected'"; } ?> <option value='<?php echo $group["es_email_group"]; ?> ' <?php echo $thisselected; ?> ><?php echo $group["es_email_group"];
function form($instance) { $defaults = array('es_af_title' => '', 'es_af_desc' => '', 'es_af_name' => '', 'es_af_name_mand' => '', 'es_af_email' => '', 'es_af_email_mand' => '', 'es_af_group' => '', 'es_af_group_mand' => '', 'es_af_group_list' => ''); $instance = wp_parse_args((array) $instance, $defaults); $es_af_title = $instance['es_af_title']; $es_af_desc = $instance['es_af_desc']; $es_af_name = $instance['es_af_name']; $es_af_name_mand = $instance['es_af_name_mand']; $es_af_email = $instance['es_af_email']; $es_af_email_mand = $instance['es_af_email_mand']; $es_af_group = $instance['es_af_group']; $es_af_group_mand = $instance['es_af_group_mand']; $es_af_group_list = $instance['es_af_group_list']; ?> <p> <label for="<?php echo $this->get_field_id('es_af_title'); ?> "><?php _e('Widget title', ES_AF_TDOMAIN); ?> </label> <input class="widefat" id="<?php echo $this->get_field_id('es_af_title'); ?> " name="<?php echo $this->get_field_name('es_af_title'); ?> " type="text" value="<?php echo $es_af_title; ?> " /> </p> <p> <label for="<?php echo $this->get_field_id('es_af_desc'); ?> "><?php _e('Short description', ES_AF_TDOMAIN); ?> </label> <input class="widefat" id="<?php echo $this->get_field_id('es_af_desc'); ?> " name="<?php echo $this->get_field_name('es_af_desc'); ?> " type="text" value="<?php echo $es_af_desc; ?> " /> <?php _e('Short description about your subscription form.', ES_AF_TDOMAIN); ?> </p> <p> <label for="<?php echo $this->get_field_id('es_af_name'); ?> "><?php _e('Display NAME box', ES_AF_TDOMAIN); ?> </label> <select class="widefat" id="<?php echo $this->get_field_id('es_af_name'); ?> " name="<?php echo $this->get_field_name('es_af_name'); ?> "> <option value="YES" <?php $this->es_af_selected($es_af_name == 'YES'); ?> >YES</option> <option value="NO" <?php $this->es_af_selected($es_af_name == 'NO'); ?> >NO</option> </select> </p> <p> <label for="<?php echo $this->get_field_id('es_af_name_mand'); ?> "><?php _e('Do you want to set NAME box is mandatory box?', ES_AF_TDOMAIN); ?> </label> <select class="widefat" id="<?php echo $this->get_field_id('es_af_name_mand'); ?> " name="<?php echo $this->get_field_name('es_af_name_mand'); ?> "> <option value="YES" <?php $this->es_af_selected($es_af_name_mand == 'YES'); ?> >YES</option> <option value="NO" <?php $this->es_af_selected($es_af_name_mand == 'NO'); ?> >NO</option> </select> </p> <p> <label for="<?php echo $this->get_field_id('es_af_email'); ?> "><?php _e('Display EMAIL box', ES_AF_TDOMAIN); ?> </label> <select class="widefat" id="<?php echo $this->get_field_id('es_af_email'); ?> " name="<?php echo $this->get_field_name('es_af_email'); ?> "> <option value="YES" <?php $this->es_af_selected($es_af_email == 'YES'); ?> >YES</option> </select> </p> <p> <label for="<?php echo $this->get_field_id('es_af_email_mand'); ?> "><?php _e('Do you want to set EMAIL box is mandatory box?', ES_AF_TDOMAIN); ?> </label> <select class="widefat" id="<?php echo $this->get_field_id('es_af_email_mand'); ?> " name="<?php echo $this->get_field_name('es_af_email_mand'); ?> "> <option value="YES" <?php $this->es_af_selected($es_af_email_mand == 'YES'); ?> >YES</option> </select> </p> <p> <label for="<?php echo $this->get_field_id('es_af_group'); ?> "><?php _e('Display GROUPS options', ES_AF_TDOMAIN); ?> </label> <select class="widefat" id="<?php echo $this->get_field_id('es_af_group'); ?> " name="<?php echo $this->get_field_name('es_af_group'); ?> "> <option value="YES" <?php $this->es_af_selected($es_af_group == 'YES'); ?> >YES</option> <option value="NO" <?php $this->es_af_selected($es_af_group == 'NO'); ?> >NO</option> </select> </p> <p> <label for="<?php echo $this->get_field_id('es_af_group_mand'); ?> "><?php _e('Do you want to set mandatory option for GROUP box?', ES_AF_TDOMAIN); ?> </label> <select class="widefat" id="<?php echo $this->get_field_id('es_af_group_mand'); ?> " name="<?php echo $this->get_field_name('es_af_group_mand'); ?> "> <option value="YES" <?php $this->es_af_selected($es_af_group_mand == 'YES'); ?> >YES</option> <option value="NO" <?php $this->es_af_selected($es_af_group_mand == 'NO'); ?> >NO</option> </select> </p> <p> <label for="<?php echo $this->get_field_id('es_af_group_list'); ?> "><?php _e('Enter GROUP name to display (coma separated value)', ES_AF_TDOMAIN); ?> </label> <input class="widefat" id="<?php echo $this->get_field_id('es_af_group_list'); ?> " name="<?php echo $this->get_field_name('es_af_group_list'); ?> " type="text" value="<?php echo $es_af_group_list; ?> " /> <?php if (is_plugin_active('email-subscribers/email-subscribers.php')) { $groups = array(); $groups = es_cls_dbquery::es_view_subscriber_group(); if (count($groups) > 0) { $i = 1; foreach ($groups as $group) { if ($i != 1) { echo ", "; } else { echo "<br>Existing Groups : "; } echo $group["es_email_group"]; $i = $i + 1; } } } ?> </p> <?php }