Plugin Directory

Changeset 1481448


Ignore:
Timestamp:
08/23/2016 10:39:34 AM (10 years ago)
Author:
sendmachine
Message:

made plugin compatible with wordpress v4.6, added some html classes

Location:
sendmachine
Files:
6 edited
3 copied

Legend:

Unmodified
Added
Removed
  • sendmachine/tags/1.0.10/includes/sendmachine_subscribe_manager.php

    r1332124 r1481448  
    3131        $out .= $instance['description'] ? "<p>".$instance['description']."</p>" : "";
    3232
    33         $out .= $this->build_form();
     33        $out .= $this->build_form($args['id']);
    3434
    3535        $out .= $args['after_widget'];
     
    7272    }
    7373
    74     private function build_form() {
     74    private function build_form($instance_id = "") {
    7575       
    7676        $this->form_count++;
     
    100100
    101101                $required = ($list_field['required']) ? "*" : "";
    102 
    103                 $list_fields .= $list_field['form_name'] . " $required<br>";
     102                $element_id = strtolower("form_input_{$list_field['form_name']}_$instance_id");
     103
     104                $list_fields .= "<div class='sm_wp_input_group'><label for='$element_id' class='sm_wp_form_label'>" . $list_field['form_name'] . " $required</label>";
    104105
    105106                if (in_array($list_field['cf_type'], array("text", "number", "email","date","birthday"))) {
     
    109110                    elseif($list_field['cf_type'] == "birthday") $placeholder = "mm/dd";
    110111                   
    111                     $list_fields .= "<input placeholder='$placeholder' type='text' name='" . $list_field['name'] . "'/><br><br>";
     112                    $list_fields .= "<input id='$element_id' class='sm_wp_form_input_text' placeholder='$placeholder' type='text' name='" . $list_field['name'] . "'/>";
    112113                }
    113114                elseif ($list_field['cf_type'] == "radiobutton") {
     
    115116                    foreach ($list_field['options'] as $option) {
    116117
    117                         $list_fields .= "<label><input type='radio' value='" . $option . "' name='" . $list_field['name'] . "' /> " . $option . "</label><br>";
     118                        $list_fields .= "<label class='sm_wp_form_radio_label'><input class='sm_wp_form_input_radio' type='radio' value='" . $option . "' name='" . $list_field['name'] . "' /> " . $option . "</label><br>";
    118119                    }
    119                     $list_fields .="<br>";
    120120                }
    121121                elseif ($list_field['cf_type'] == "dropdown") {
    122122
    123                     $list_fields .= "<select class='sm_list_dropdown' name='" . $list_field['name'] . "'>";
     123                    $list_fields .= "<select class='sm_list_dropdown sm_wp_form_select' name='" . $list_field['name'] . "'>";
    124124                    $list_fields .= "<option></option>";
    125125
     
    129129                    }
    130130
    131                     $list_fields .= "</select><br><br>";
     131                    $list_fields .= "</select>";
    132132                }
     133                $list_fields .= "</div>";
    133134            }
    134135        }
     
    145146                . '<input type="hidden" name="sm_form_nr" value="'.$this->form_count.'"/> '
    146147                . $list_fields
    147                 . '<input type="submit" value="'.__('Subscribe', SM_LANGUAGE_DOMAIN).'" />'
     148                . '<div class="sm_wp_form_submit_button_wrapper"><input class="sm_wp_form_submit_button" type="submit" value="'.__('Subscribe', SM_LANGUAGE_DOMAIN).'" /></div>'
    148149                . '<div class="sm_wp_sub_req_resp" >' . $notices . '</div>'
    149150                . '</form>'
  • sendmachine/tags/1.0.10/readme.txt

    r1400969 r1481448  
    33Tags: sendmachine,newsletter,campaigns,subscribers,sign-up,email marketing
    44Requires at least: 3.2.1
    5 Tested up to: 4.5
     5Tested up to: 4.6
    66Stable tag: 1.0.9
    77License: GPLv2 or later
     
    9696== Changelog ==
    9797
     98= 1.0.10 =
     99* Tested plugin up to WP v4.6
     100* Added widget html classes
     101
    98102= 1.0.9 =
    99103* Tested up to 4.5
  • sendmachine/tags/1.0.10/sendmachine_wp.php

    r1400969 r1481448  
    55  Plugin URI: https://www.sendmachine.com
    66  Description: The official Sendmachine plugin featuring subscribe forms, users sync, news feed, email sending and transactional campaigns.
    7   Version: 1.0.9
     7  Version: 1.0.10
    88  Author: Sendmachine team
    99  Author URI: http://developers.sendmachine.com/
  • sendmachine/tags/1.0.10/static/css/sm-widget.css

    r1226818 r1481448  
    1313    background-color: pink;
    1414}
    15 .sm_list_dropdown{
     15.sendmachine_wp_subscribe .sm_list_dropdown{
    1616    width:100%;
    1717}
     18.sendmachine_wp_subscribe .sm_wp_form_label{
     19    display: block;
     20}
     21.sendmachine_wp_subscribe .sm_wp_input_group{
     22    margin-bottom: 20px;
     23}
  • sendmachine/trunk/includes/sendmachine_subscribe_manager.php

    r1332124 r1481448  
    3131        $out .= $instance['description'] ? "<p>".$instance['description']."</p>" : "";
    3232
    33         $out .= $this->build_form();
     33        $out .= $this->build_form($args['id']);
    3434
    3535        $out .= $args['after_widget'];
     
    7272    }
    7373
    74     private function build_form() {
     74    private function build_form($instance_id = "") {
    7575       
    7676        $this->form_count++;
     
    100100
    101101                $required = ($list_field['required']) ? "*" : "";
    102 
    103                 $list_fields .= $list_field['form_name'] . " $required<br>";
     102                $element_id = strtolower("form_input_{$list_field['form_name']}_$instance_id");
     103
     104                $list_fields .= "<div class='sm_wp_input_group'><label for='$element_id' class='sm_wp_form_label'>" . $list_field['form_name'] . " $required</label>";
    104105
    105106                if (in_array($list_field['cf_type'], array("text", "number", "email","date","birthday"))) {
     
    109110                    elseif($list_field['cf_type'] == "birthday") $placeholder = "mm/dd";
    110111                   
    111                     $list_fields .= "<input placeholder='$placeholder' type='text' name='" . $list_field['name'] . "'/><br><br>";
     112                    $list_fields .= "<input id='$element_id' class='sm_wp_form_input_text' placeholder='$placeholder' type='text' name='" . $list_field['name'] . "'/>";
    112113                }
    113114                elseif ($list_field['cf_type'] == "radiobutton") {
     
    115116                    foreach ($list_field['options'] as $option) {
    116117
    117                         $list_fields .= "<label><input type='radio' value='" . $option . "' name='" . $list_field['name'] . "' /> " . $option . "</label><br>";
     118                        $list_fields .= "<label class='sm_wp_form_radio_label'><input class='sm_wp_form_input_radio' type='radio' value='" . $option . "' name='" . $list_field['name'] . "' /> " . $option . "</label><br>";
    118119                    }
    119                     $list_fields .="<br>";
    120120                }
    121121                elseif ($list_field['cf_type'] == "dropdown") {
    122122
    123                     $list_fields .= "<select class='sm_list_dropdown' name='" . $list_field['name'] . "'>";
     123                    $list_fields .= "<select class='sm_list_dropdown sm_wp_form_select' name='" . $list_field['name'] . "'>";
    124124                    $list_fields .= "<option></option>";
    125125
     
    129129                    }
    130130
    131                     $list_fields .= "</select><br><br>";
     131                    $list_fields .= "</select>";
    132132                }
     133                $list_fields .= "</div>";
    133134            }
    134135        }
     
    145146                . '<input type="hidden" name="sm_form_nr" value="'.$this->form_count.'"/> '
    146147                . $list_fields
    147                 . '<input type="submit" value="'.__('Subscribe', SM_LANGUAGE_DOMAIN).'" />'
     148                . '<div class="sm_wp_form_submit_button_wrapper"><input class="sm_wp_form_submit_button" type="submit" value="'.__('Subscribe', SM_LANGUAGE_DOMAIN).'" /></div>'
    148149                . '<div class="sm_wp_sub_req_resp" >' . $notices . '</div>'
    149150                . '</form>'
  • sendmachine/trunk/readme.txt

    r1400969 r1481448  
    33Tags: sendmachine,newsletter,campaigns,subscribers,sign-up,email marketing
    44Requires at least: 3.2.1
    5 Tested up to: 4.5
     5Tested up to: 4.6
    66Stable tag: 1.0.9
    77License: GPLv2 or later
     
    9696== Changelog ==
    9797
     98= 1.0.10 =
     99* Tested plugin up to WP v4.6
     100* Added widget html classes
     101
    98102= 1.0.9 =
    99103* Tested up to 4.5
  • sendmachine/trunk/sendmachine_wp.php

    r1400969 r1481448  
    55  Plugin URI: https://www.sendmachine.com
    66  Description: The official Sendmachine plugin featuring subscribe forms, users sync, news feed, email sending and transactional campaigns.
    7   Version: 1.0.9
     7  Version: 1.0.10
    88  Author: Sendmachine team
    99  Author URI: http://developers.sendmachine.com/
  • sendmachine/trunk/static/css/sm-widget.css

    r1226818 r1481448  
    1313    background-color: pink;
    1414}
    15 .sm_list_dropdown{
     15.sendmachine_wp_subscribe .sm_list_dropdown{
    1616    width:100%;
    1717}
     18.sendmachine_wp_subscribe .sm_wp_form_label{
     19    display: block;
     20}
     21.sendmachine_wp_subscribe .sm_wp_input_group{
     22    margin-bottom: 20px;
     23}
Note: See TracChangeset for help on using the changeset viewer.