예제 #1
0
 public function renderDupeTable($listings, $column = 'post_id')
 {
     if (empty($listings)) {
         return '';
     }
     // get current page with paging as url param
     $page = $_REQUEST['page'];
     if (isset($_REQUEST['paged'])) {
         $page .= '&paged=' . $_REQUEST['paged'];
     }
     $msg = '';
     foreach ($listings as $dupe) {
         $account_title = WPLE_eBayAccount::getAccountTitle($dupe->account_id);
         $msg .= '<b>' . __('Listings for product', 'wplister') . ' #' . $dupe->post_id . ' (' . $account_title . '):</b>';
         $msg .= '<br>';
         $duplicateListings = WPLE_ListingQueryHelper::getAllListingsForProductAndAccount($dupe->post_id, $dupe->account_id);
         foreach ($duplicateListings as $listing) {
             $color = $listing->status == 'archived' ? 'silver' : '';
             $msg .= '<span style="color:' . $color . '">';
             $msg .= '&nbsp;&bull;&nbsp;';
             $msg .= '' . $listing->auction_title . '';
             if ($listing->ebay_id) {
                 $msg .= ' (#' . $listing->ebay_id . ')';
             }
             $msg .= ' &ndash; <i>' . $listing->status . '</i>';
             $msg .= '<br>';
             if (in_array($listing->status, array('prepared', 'verified', 'ended', 'sold'))) {
                 $archive_link = sprintf('<a class="archive button button-small" href="?page=%s&action=%s&auction=%s">%s</a>', $page, 'archive', $listing->id, __('Click to move to archive', 'wplister'));
                 $msg .= '&nbsp;&nbsp;&nbsp;&nbsp;' . $archive_link;
                 $msg .= '<br>';
             }
             if (in_array($listing->status, array('selected'))) {
                 $delete_link = sprintf('<a class="delete button button-small button-primary" href="?page=%s&action=%s&auction=%s">%s</a>', $page, 'delete_listing', $listing->id, __('Click to remove this listing', 'wplister'));
                 $msg .= '&nbsp;&nbsp;&nbsp;&nbsp;' . $delete_link;
                 $msg .= '<br>';
             }
             $msg .= '</span>';
         }
         $msg .= '<br>';
     }
     return $msg;
 }
예제 #2
0
    echo __('WP-Lister is not linked to your eBay account yet.', 'wplister');
    ?>
</p>
										<?php 
} elseif (!$wpl_default_account) {
    ?>
											<p><?php 
    echo __('You need to select a default account.', 'wplister');
    ?>
</p>
										<?php 
} else {
    ?>
											<p>
												<?php 
    echo sprintf(__('Your default account is <b>%s</b>.', 'wplister'), WPLE_eBayAccount::getAccountTitle($wpl_default_account));
    ?>
											</p>
											<p>
												<?php 
    echo __('The default account will always be used by WP-Lister unless specified otherwise.', 'wplister');
    ?>
											</p>
										<?php 
}
?>


									</div>
								</div>