コード例 #1
0
ファイル: sendinblue.php プロジェクト: niceit/rockets
 /**
  * Uninstall method is called once uninstall this plugin
  * delete tables, options that used in plugin
  */
 static function uninstall()
 {
     $setting = array();
     update_option(SIB_Manager::main_option_name, $setting);
     $home_settings = array('activate_email' => 'no');
     update_option(SIB_Manager::home_option_name, $home_settings);
     // delete access_token
     $token_settings = array();
     update_option(SIB_Manager::access_token_option_name, $token_settings);
     // remove account info
     SIB_Page_Home::remove_account_info();
 }
コード例 #2
0
ファイル: page-form.php プロジェクト: niceit/rockets
        /** generate welcome page */
        function generate_welcome_page()
        {
            ?>
            <div id="main-content" class="row">
                <img class="small-content" src="<?php 
            echo SIB_Manager::$plugin_url . '/img/background/setting.png';
            ?>
" style="width: 100%;">
            </div>
        <?php 
            SIB_Page_Home::print_disable_popup();
        }
コード例 #3
0
ファイル: widget_form.php プロジェクト: niceit/rockets
    /**
     * Function Name : form
     * @param array $instance
     * @return string|void
     */
    function form($instance)
    {
        // Retrieve previous values from instance
        // or set default values if not present
        if (isset($instance['widget_title']) && $instance['widget_title'] != '') {
            $widget_title = esc_attr($instance['widget_title']);
        } else {
            $widget_title = __('SendinBlue Newsletter', 'sib_lang');
        }
        if (isset($instance['button_text']) && $instance['button_text'] != '') {
            $button_text = esc_attr($instance['button_text']);
        } else {
            $button_text = __('Subscribe', 'sib_lang');
        }
        if (isset($instance['sib_list'])) {
            $sib_list = esc_attr($instance['sib_list']);
        } else {
            $sib_list = SIB_Manager::$list_id;
        }
        $lists = SIB_Page_Home::get_lists();
        $sub_atts = get_option(SIB_Manager::form_subscription_option_name);
        $available_atts = $sub_atts['available_attributes'];
        $displays = array();
        foreach ($available_atts as $att) {
            if (isset($instance['disp_att_' . $att])) {
                $displays['disp_att_' . $att] = esc_attr($instance['disp_att_' . $att]);
            } else {
                $displays['disp_att_' . $att] = 'yes';
            }
        }
        ?>
        <p>
            <label for="<?php 
        echo $this->get_field_id('widget_title');
        ?>
">
                <?php 
        echo __('Widget Title', 'sib_lang') . ':';
        ?>
            </label>
             <input type="text" class="widefat" id="<?php 
        echo $this->get_field_id('widget_title');
        ?>
" name="<?php 
        echo $this->get_field_name('widget_title');
        ?>
" value="<?php 
        echo $widget_title;
        ?>
" />
        </p>
        <p>
        <?php 
        foreach ($available_atts as $att) {
            ?>
            <p>
                <input type="checkbox" id="<?php 
            echo $this->get_field_id('disp_att_' . $att);
            ?>
" name="<?php 
            echo $this->get_field_name('disp_att_' . $att);
            ?>
" value="yes" <?php 
            checked($displays['disp_att_' . $att], 'yes');
            ?>
>
                <label for="<?php 
            echo $this->get_field_id('disp_att_' . $att);
            ?>
"><?php 
            echo __('Display', 'sib_lang') . ' ' . $att . ' ' . __('Input', 'sib_lang');
            ?>
</label>
            </p>
        <?php 
        }
        ?>
        </p>
        <p>
            <label for="<?php 
        echo $this->get_field_id('button_text');
        ?>
">
                <?php 
        echo __('Button Text', 'sib_lang') . ':';
        ?>
            </label>
            <input type="text" class="widefat" id="<?php 
        echo $this->get_field_id('button_text');
        ?>
" name="<?php 
        echo $this->get_field_name('button_text');
        ?>
" value="<?php 
        echo $button_text;
        ?>
" />
        </p>
        <p>
            <label for="<?php 
        echo $this->get_field_id('sib_list');
        ?>
">
                <?php 
        echo __('List', 'sib_lang') . ':';
        ?>
            </label>
            <select class="widefat" id="<?php 
        echo $this->get_field_id('sib_list');
        ?>
" name="<?php 
        echo $this->get_field_name('sib_list');
        ?>
">
            <?php 
        foreach ($lists as $list) {
            ?>
                <option value="<?php 
            echo $list['id'];
            ?>
" <?php 
            selected($sib_list, $list['id']);
            ?>
><?php 
            echo $list['name'];
            ?>
</option>
                <?php 
        }
        ?>
            </select>
        </p>
        <?php 
    }
コード例 #4
0
        /** generate welcome page */
        function generate_welcome_page()
        {
            ?>
            <img src="<?php 
            echo SIB_Manager::$plugin_url . '/img/background/campaigns.png';
            ?>
"  style="width: 100%;">
        <?php 
            SIB_Page_Home::print_disable_popup();
        }
コード例 #5
0
 /**
  * Ajax module to get all lists.
  */
 public static function ajax_get_lists()
 {
     $lists = SIB_Page_Home::get_lists();
     if (!is_array($lists)) {
         $lists = array();
     }
     // set default list_id at first up...
     if (SIB_Manager::$list_id == '') {
         $home_settings = get_option(SIB_Manager::home_option_name);
         $home_settings['list_id'] = $lists[0]['id'];
         update_option(SIB_Manager::home_option_name, $home_settings);
     }
     $result = array('lists' => $lists);
     wp_send_json($result);
 }