protected function view()
 {
     $status = isset($_GET['status']) ? $_GET['status'] : NULL;
     add_filter('ctct_cachekey', function () {
         return isset($_GET['status']) ? false : 'ctct_all_campaigns';
     });
     $Campaigns = $this->cc->getAllEmailCampaigns($status);
     kws_print_subsub('status', array(array('val' => '', 'text' => 'All'), array('val' => 'DRAFT', 'text' => 'Draft'), array('val' => 'RUNNING', 'text' => 'Running'), array('val' => 'SCHEDULED', 'text' => 'Scheduled'), array('val' => 'SENT', 'text' => 'Sent')));
     include CTCT_DIR_PATH . 'views/admin/view.campaigns-view.php';
 }
    /**
     * View all events
     */
    function view()
    {
        $events = constant_contact_old_api_get_all('Events', $this->old_api);
        if (empty($events) || !is_array($events)) {
            include EVENTSPOT_FILE_PATH . '/views/promo.php';
            ?>
			<p class="submit"><a href="<?php 
            echo esc_url(add_query_arg('refresh', 'events'));
            ?>
" class="button-secondary alignright" title="<?php 
            echo sprintf(esc_attr__('Event registrants data is stored for %s hours. Refresh data now.', 'ctct'), round(KWS_V1API::$event_cache_age / 3600));
            ?>
"><?php 
            esc_html_e('Refresh Events', 'ctct');
            ?>
</a></p>
			<?php 
        } else {
            kws_print_subsub('status', array(array('val' => '', 'text' => 'All'), array('val' => 'ACTIVE', 'text' => 'Active'), array('val' => 'DRAFT', 'text' => 'Draft'), array('val' => 'COMPLETE', 'text' => 'Complete'), array('val' => 'CANCELLED', 'text' => 'Cancelled')));
            /** Populate the $events var with only events matching the filtered status */
            if (isset($_GET['status']) && in_array($_GET['status'], array('ACTIVE', 'COMPLETE', 'DRAFT', 'CANCELLED'))) {
                $ACTIVE = $COMPLETE = $DRAFT = $CANCELLED = array();
                foreach ($events as $id => $v) {
                    ${$v->status}[] = $v;
                }
                $events = ${$_GET['status']};
            }
            $this->make_table($events, __('Events', 'ctct'));
            ?>
			<p class="submit"><a href="<?php 
            echo esc_url(add_query_arg('refresh', 'events'));
            ?>
" class="button-secondary alignright" title="<?php 
            echo sprintf(esc_attr__('Event registrants data is stored for %s hours. Refresh data now.', 'ctct'), round(KWS_V1API::$event_cache_age / 3600));
            ?>
"><?php 
            esc_html_e('Refresh Events', 'ctct');
            ?>
</a></p>
			<?php 
        }
    }
 function print_navigation()
 {
     $methods_text = array('activity' => __('Constant Contact Activity', 'ctct'), 'debug' => __('Debugging Logs', 'ctct'), 'error' => __('Errors or Exceptions', 'ctct'), 'log' => __('Notices', 'ctct'));
     $navigation = array();
     foreach (self::$methods as $method) {
         $navigation[] = array('val' => 'ctct_' . $method, 'text' => $methods_text[$method]);
     }
     // Grab the first active method if the link hasn't been clicked yet
     if (empty($_GET['log'])) {
         $navigation[0]['val'] = '';
     }
     kws_print_subsub('log', $navigation);
 }
 protected function view()
 {
     add_filter('ctct_cachekey', function () {
         return isset($_GET['status']) ? false : 'ctct_all_contacts';
     });
     if (!empty($_GET['refresh']) && $_GET['refresh'] === 'contacts') {
         do_action('ctct_flush_contacts');
     }
     $Contacts = $this->cc->getAllContacts();
     kws_print_subsub('status', array(array('val' => '', 'text' => 'All'), array('val' => 'ACTIVE', 'text' => 'Active'), array('val' => 'UNCONFIRMED', 'text' => 'Unconfirmed'), array('val' => 'OPTOUT', 'text' => 'Opt-Out'), array('val' => 'REMOVED', 'text' => 'Removed'), array('val' => 'NON_SUBSCRIBER', 'text' => 'Non-Subscriber')));
     if (empty($Contacts)) {
         esc_html_e('Your account has no contacts.', 'ctct');
     } else {
         include CTCT_DIR_PATH . 'views/admin/view.contacts-view.php';
     }
 }