Plugin Directory

Changeset 1629543


Ignore:
Timestamp:
04/04/2017 09:04:03 PM (9 years ago)
Author:
racanu
Message:

Added list of subscribers to settings page

Location:
keep-in-touch/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • keep-in-touch/trunk/class-keep-in-touch-msg.php

    r1629200 r1629543  
    330330    {
    331331        self::send_mail_to_recipients(
    332             empty($recipients) ? Keep_In_Touch_Db::get_emails_of_all_newsletter_subscribers() : $recipients,
     332            empty($recipients) ? Keep_In_Touch_Db::get_emails_of_all_confirmed_newsletter_subscribers() : $recipients,
    333333            Keep_In_Touch_Utils::get_blog_marker() . sprintf(__('Newsletter: %s', 'keep-in-touch'), $title),
    334334            $text
  • keep-in-touch/trunk/class-keep-in-touch-settings.php

    r1629423 r1629543  
    206206    }
    207207
     208    static private function generate_subscribers_list()
     209    {
     210        $use_full_name = (get_option('keep_in_touch_use_full_name', 'no') == 'yes');
     211        $subscribers = Keep_In_Touch_Db::get_all_confirmed_subscribers();
     212        echo '<div class="postbox">';
     213        echo '<h3 class="hndle">' . __('Subscribers list', 'keep-in-touch') . ' (' . count($subscribers) . ')</h3>';
     214        echo '<div class="inside">';
     215        foreach ($subscribers as $subscriber)
     216        {
     217            $full_name = (!Keep_In_Touch_Utils::is_null_or_empty_string($subscriber->full_name)) ? $subscriber->full_name : __('[not available]', 'keep-in-touch');
     218            echo '<p style="padding-left:1.5em;text-indent:-1.5em;">' .
     219                ($use_full_name ? $full_name . '<br/>' : '') .
     220                $subscriber->email .
     221                '</p>';
     222        }
     223        echo '</div>';
     224        echo '</div>';
     225    }
     226
    208227    static private function generate_plugin_settings_page()
    209228    {
     
    220239
    221240        echo '<div id="postbox-container-1" class="postbox-container">';
    222         echo '<div class="postbox">';
    223         echo '<h3 class="hndle">' . __('Subscribers list', 'keep-in-touch') . '</h3>';
    224         echo '<div class="inside">';
    225         echo '<p>One</p>';
    226         echo '<p>Two</p>';
    227         echo '<p>Three</p>';
     241        self::generate_subscribers_list();
    228242        echo '</div>';
    229243
  • keep-in-touch/trunk/class-keep-in-touch-utils.php

    r1622571 r1629543  
    124124    }
    125125   
     126    static function is_null_or_empty_string($string)
     127    {
     128        return (!isset($string) || trim($string)==='');
     129    }
     130
    126131    static function startsWith($needle, $haystack)
    127132    {
  • keep-in-touch/trunk/keep-in-touch.php

    r1629200 r1629543  
    6464    }
    6565
    66     static private function is_null_or_empty_string($string)
    67     {
    68         return (!isset($string) || trim($string)==='');
    69     }
    70 
    7166    static private function return_same_page()
    7267    {
     
    8984    static private function handle_submit()
    9085    {
    91         if (self::is_null_or_empty_string($_POST['keep_in_touch_email']))
     86        if (Keep_In_Touch_Utils::is_null_or_empty_string($_POST['keep_in_touch_email']))
    9287            self::return_same_page();
    9388
    9489        $email = sanitize_email($_POST['keep_in_touch_email']);
    95         if (!self::is_null_or_empty_string($_POST['keep_in_touch_email_reference']))
     90        if (!Keep_In_Touch_Utils::is_null_or_empty_string($_POST['keep_in_touch_email_reference']))
    9691            $email_reference = sanitize_email($_POST['keep_in_touch_email_reference']);
    97         if (!self::is_null_or_empty_string($_POST['keep_in_touch_full_name']))
     92        if (!Keep_In_Touch_Utils::is_null_or_empty_string($_POST['keep_in_touch_full_name']))
    9893            $full_name = sanitize_text_field($_POST['keep_in_touch_full_name']);
    9994
  • keep-in-touch/trunk/languages/keep-in-touch-it_IT.po

    r1629423 r1629543  
    44"Report-Msgid-Bugs-To: \n"
    55"POT-Creation-Date: \n"
    6 "PO-Revision-Date: 2017-04-04 16:53:19+0000\n"
     6"PO-Revision-Date: 2017-04-04 21:01:49+0000\n"
    77"Last-Translator: admin <racanu@gmail.com>\n"
    88"Language-Team: \n"
     
    498498msgstr "Inserire nome e cognome"
    499499
    500 #: class-keep-in-touch-settings.php:223
     500#: class-keep-in-touch-settings.php:213
    501501#@ keep-in-touch
    502502msgid "Subscribers list"
     
    523523msgstr "Richiedere nome completo"
    524524
     525#: class-keep-in-touch-settings.php:217
     526#@ keep-in-touch
     527msgid "[not available]"
     528msgstr "[non disponibile]"
     529
Note: See TracChangeset for help on using the changeset viewer.