/**
  * Returns field definition arrays.
  * 
  * Pass an empty string to the parameter for meta box options. 
  * 
  * @return      array
  */
 public function get($sFieldIDPrefix = '')
 {
     $_oOption = $this->oOption;
     $_aFields = array(array('field_id' => 'unit_type', 'type' => 'hidden', 'value' => 'category', 'hidden' => true), array('field_id' => 'country', 'title' => __('Country', 'amazon-auto-links'), 'type' => 'select', 'label' => array('CA' => 'CA - ' . __('Canada', 'amazon-auto-links'), 'CN' => 'CN - ' . __('China', 'amazon-auto-links'), 'FR' => 'FR - ' . __('France', 'amazon-auto-links'), 'DE' => 'DE - ' . __('Germany', 'amazon-auto-links'), 'IT' => 'IT - ' . __('Italy', 'amazon-auto-links'), 'JP' => 'JP - ' . __('Japan', 'amazon-auto-links'), 'UK' => 'UK - ' . __('United Kingdom', 'amazon-auto-links'), 'ES' => 'ES - ' . __('Spain', 'amazon-auto-links'), 'US' => 'US - ' . __('United States', 'amazon-auto-links'), 'IN' => 'IN - ' . __('India', 'amazon-auto-links'), 'BR' => 'BR - ' . __('Brazil', 'amazon-auto-links'), 'MX' => 'MX - ' . __('Mexico', 'amazon-auto-links')), 'default' => 'US'), array('field_id' => 'associate_id', 'title' => __('Associate ID', 'amazon-auto-links'), 'type' => 'text', 'description' => 'e.g. <code>miunosoft-20</code>', 'default' => ''), array('field_id' => 'count', 'title' => __('Number of Items', 'amazon-auto-links'), 'type' => 'number', 'tip' => __('The number of product links to display.', 'amazon-auto-links'), 'default' => 10, 'attributes' => array('min' => 1, 'max' => $_oOption->getMaximumProductLinkCount() ? $_oOption->getMaximumProductLinkCount() : null)), array('field_id' => 'image_size', 'title' => __('Image Size', 'amazon-auto-links'), 'type' => 'number', 'after_input' => ' ' . __('pixel', 'amazon-auto-links'), 'elimiter' => '', 'tip' => __('The maximum width of the product image in pixel. Set <code>0</code> for no image.', 'amazon-auto-links'), 'description' => __('Max', 'amazon-auto-links') . ': <code>500</code> ' . ' ' . __('Default', 'amazon-auto-links') . ': <code>160</code>', 'attributes' => array('max' => 500, 'min' => 0), 'default' => 160), array('field_id' => 'sort', 'title' => __('Sort Order', 'amazon-auto-links'), 'type' => 'select', 'label' => array('date' => __('Date', 'amazon-auto-links'), 'title' => __('Title', 'amazon-auto-links'), 'title_descending' => __('Title Descending', 'amazon-auto-links'), 'random' => __('Random', 'amazon-auto-links')), 'default' => 'random'), array('field_id' => 'keep_raw_title', 'title' => __('Sort Option', 'amazon-auto-links'), 'type' => 'checkbox', 'label' => __('Keep raw titles.', 'amazon-auto-links'), 'description' => __('If checked, unsanitized titles will be used. This is useful to sort by rank.', 'amazon-auto-links'), 'default' => false), array('field_id' => 'feed_type', 'title' => __('Types', 'amazon-auto-links'), 'type' => 'checkbox', 'label' => array('bestsellers' => __('Best Sellers', 'amazon-auto-links'), 'new-releases' => __('Hot New Releases', 'amazon-auto-links'), 'movers-and-shakers' => __('Mover and Shakers', 'amazon-auto-links'), 'top-rated' => __('Top Rated', 'amazon-auto-links'), 'most-wished-for' => __('Most Wished For', 'amazon-auto-links'), 'most-gifted' => __('Gift Ideas', 'amazon-auto-links')), 'description' => __('It is recommended to check only a few for faster page loading.', 'amazon-auto-links') . '&nbsp;' . __('Some of the types other than Best Sellers are not supported in some locales.', 'amazon-auto-links'), 'default' => array('bestsellers' => true)), array('field_id' => 'ref_nosim', 'title' => __('Direct Link Bonus', 'amazon-auto-links'), 'type' => 'radio', 'label' => array(1 => __('On', 'amazon-auto-links'), 0 => __('Off', 'amazon-auto-links')), 'description' => sprintf(__('Inserts <code>ref=nosim</code> in the link url. For more information, visit <a href="%1$s">this page</a>.', 'amazon-auto-links'), 'https://affiliate-program.amazon.co.uk/gp/associates/help/t5/a21'), 'default' => 0), array('field_id' => 'title_length', 'title' => __('Title Length', 'amazon-auto-links'), 'type' => 'number', 'tip' => __('The allowed character length for the title.', 'amazon-auto-links') . '&nbsp;' . __('Use it to prevent a broken layout caused by a very long product title. Set -1 for no limit.', 'amazon-auto-links'), 'description' => __('Default', 'amazon-auto-links') . ": <code>-1</code>", 'default' => -1), array('field_id' => 'link_style', 'title' => __('Link Style', 'amazon-auto-links'), 'type' => 'radio', 'label' => array(1 => 'http://www.amazon.<code>[domain-suffix]</code>/<code>[product-name]</code>/dp/<code>[asin]</code>/ref=<code>[...]</code>?tag=<code>[associate-id]</code>' . "&nbsp;<span class='description'>(" . __('Default', 'amazon-auto-links') . ")</span>", 2 => 'http://www.amazon.<code>[domain-suffix]</code>/exec/obidos/ASIN/<code>[asin]</code>/<code>[associate-id]</code>/ref=<code>[...]</code>', 3 => 'http://www.amazon.<code>[domain-suffix]</code>/gp/product/<code>[asin]</code>/?tag=<code>[associate-id]</code>&ref=<code>[...]</code>', 4 => 'http://www.amazon.<code>[domain-suffix]</code>/dp/ASIN/<code>[asin]</code>/ref=<code>[...]</code>?tag=<code>[associate-id]</code>', 5 => site_url() . '?' . $_oOption->get('query', 'cloak') . '=<code>[asin]</code>&locale=<code>[...]</code>&tag=<code>[associate-id]</code>'), 'before_label' => "<span class='links-style-label'>", 'after_label' => "</span>", 'default' => 1));
     $_oCreditFields = new AmazonAutoLinks_FormFields_Unit_Credit();
     $_aCreditFields = $_oCreditFields->get($sFieldIDPrefix);
     return array_merge($_aFields, $_aCreditFields);
 }
 /**
  * Returns field definition arrays.
  * 
  * Pass an empty string to the parameter for meta box options. 
  * 
  * @return      array
  */
 public function get($sFieldIDPrefix = '', $aUnitOptions = array())
 {
     $_oOption = $this->oOption;
     $_aFields = array(array('field_id' => $sFieldIDPrefix . 'unit_type', 'type' => 'hidden', 'hidden' => true, 'value' => 'search'), array('field_id' => $sFieldIDPrefix . 'unit_title', 'type' => 'text', 'title' => __('Unit Name', 'amazon-auto-links')), array('field_id' => $sFieldIDPrefix . 'Keywords', 'type' => 'text', 'title' => __('Search Keyword', 'amazon-auto-links'), 'attributes' => array('size' => version_compare($GLOBALS['wp_version'], '3.8', '>=') ? 40 : 60), 'tip' => __('Enter the keyword to search.', 'amazon-auto-links'), 'description' => __('For multiple items, separate them by commas.', 'amazon-auto-links') . ' e.g. <code>WordPress, PHP</code>'), array('field_id' => $sFieldIDPrefix . 'search_per_keyword', 'type' => 'checkbox', 'title' => __('Query per Term', 'amazon-auto-links'), 'tip' => __('Although Amazon API allows multiple search terms to be set per request, when one of them returns an error, the entire result becomes an error. To prevent it, check this option so that the rest will be returned.', 'amazon-auto-links'), 'label' => __('Perform search per item.', 'amazon-auto-links'), 'default' => false), array('field_id' => $sFieldIDPrefix . 'Operation', 'type' => 'hidden', 'title' => __('Operation', 'amazon-auto-links'), 'hidden' => true), array('field_id' => $sFieldIDPrefix . 'country', 'type' => 'text', 'title' => __('Locale', 'amazon-auto-links'), 'attributes' => array('readonly' => 'readonly')), array('field_id' => $sFieldIDPrefix . 'associate_id', 'type' => 'text', 'title' => __('Associate ID', 'amazon-auto-links'), 'description' => 'e.g. <code>miunosoft-20</code>'), array('field_id' => $sFieldIDPrefix . 'SearchIndex', 'type' => 'select', 'title' => __('Category', 'amazon-auto-links'), 'label' => AmazonAutoLinks_Property::getSearchIndexByLocale(isset($aUnitOptions['country']) ? strtoupper($aUnitOptions['country']) : null), 'default' => 'All', 'tip' => __('Select the category to limit the searching area.', 'amazon-auto-links'), 'description' => __('If the above ID Type is ISBN, this will be automatically set to Books.', 'amazon-auto-links') . ' ' . __('If the ID Type is ASIN this option will not take effect.', 'amazon-auto-links')), array('field_id' => $sFieldIDPrefix . 'count', 'type' => 'number', 'title' => __('Number of Items', 'amazon-auto-links'), 'attributes' => array('min' => 1, 'max' => $_oOption->getMaximumProductLinkCount() ? $_oOption->getMaximumProductLinkCount() : null), 'tip' => __('The number of product links to display.', 'amazon-auto-links'), 'default' => 10), array('field_id' => $sFieldIDPrefix . 'image_size', 'type' => 'number', 'title' => __('Image Size', 'amazon-auto-links'), 'after_input' => ' ' . __('pixel', 'amazon-auto-links'), 'delimiter' => '', 'tip' => __('The maximum width of the product image in pixel. Set <code>0</code> for no image.', 'amazon-auto-links'), 'description' => __('Max', 'amazon-auto-links') . ': <code>500</code> ' . ' ' . __('Default', 'amazon-auto-links') . ': <code>160</code>', 'attributes' => array('max' => 500, 'min' => 0), 'default' => 160), array('field_id' => $sFieldIDPrefix . 'Sort', 'title' => __('Sort Order', 'amazon-auto-links'), 'type' => 'radio', 'label' => array('pricerank' => "<strong>" . __('Price Ascending', 'amazon-auto-links') . "</strong> - " . __('Sorts items from the cheapest to the most expensive.', 'amazon-auto-links') . '<br />', 'inversepricerank' => "<strong>" . __('Price Descending', 'amazon-auto-links') . "</strong> - " . __('Sorts items from the most expensive to the cheapest.', 'amazon-auto-links') . '<br />', 'salesrank' => "<strong>" . __('Sales Rank', 'amazon-auto-links') . "</strong> - " . __('Sorts items based on how well they have been sold, from best to worst sellers.', 'amazon-auto-links') . '<br />', 'relevancerank' => "<strong>" . __('Relevance Rank', 'amazon-auto-links') . "</strong> - " . __('Sorts items based on how often the keyword appear in the product description.', 'amazon-auto-links') . '<br />', 'reviewrank' => "<strong>" . __('Review Rank', 'amazon-auto-links') . "</strong> - " . __('Sorts items based on how highly rated the item was reviewed by customers where the highest ranked items are listed first and the lowest ranked items are listed last.', 'amazon-auto-links') . '<br />'), 'default' => 'salesrank', 'description' => __('When the search index is selected to <code>All</code>, this option does not take effect.', 'amazon-auto-links')), array('field_id' => $sFieldIDPrefix . 'ref_nosim', 'type' => 'radio', 'title' => __('Direct Link Bonus', 'amazon-auto-links'), 'label' => array(1 => __('On', 'amazon-auto-links'), 0 => __('Off', 'amazon-auto-links')), 'description' => sprintf(__('Inserts <code>ref=nosim</code> in the link url. For more information, visit <a href="%1$s">this page</a>.', 'amazon-auto-links'), 'https://affiliate-program.amazon.co.uk/gp/associates/help/t5/a21'), 'default' => 0), array('field_id' => $sFieldIDPrefix . 'title_length', 'type' => 'number', 'title' => __('Title Length', 'amazon-auto-links'), 'tip' => __('The allowed character length for the title.', 'amazon-auto-links') . '&nbsp;' . __('Use it to prevent a broken layout caused by a very long product title. Set -1 for no limit.', 'amazon-auto-links'), 'description' => __('Default', 'amazon-auto-links') . ": <code>-1</code>", 'default' => -1), array('field_id' => $sFieldIDPrefix . 'description_length', 'type' => 'number', 'title' => __('Description Length', 'amazon-auto-links'), 'tip' => __('The allowed character length for the description.', 'amazon-auto-links') . '&nbsp;' . __('Set -1 for no limit.', 'amazon-auto-links'), 'description' => __('Default', 'amazon-auto-links') . ": <code>250</code>", 'default' => 250), array('field_id' => $sFieldIDPrefix . 'link_style', 'title' => __('Link Style', 'amazon-auto-links'), 'type' => 'radio', 'label' => array(1 => 'http://www.amazon.<code>[domain-suffix]</code>/<code>[product-name]</code>/dp/<code>[asin]</code>/ref=<code>[...]</code>?tag=<code>[associate-id]</code>' . "&nbsp;<span class='description'>(" . __('Default', 'amazon-auto-links') . ")</span>", 2 => 'http://www.amazon.<code>[domain-suffix]</code>/exec/obidos/ASIN/<code>[asin]</code>/<code>[associate-id]</code>/ref=<code>[...]</code>', 3 => 'http://www.amazon.<code>[domain-suffix]</code>/gp/product/<code>[asin]</code>/?tag=<code>[associate-id]</code>&ref=<code>[...]</code>', 4 => 'http://www.amazon.<code>[domain-suffix]</code>/dp/ASIN/<code>[asin]</code>/ref=<code>[...]</code>?tag=<code>[associate-id]</code>', 5 => site_url() . '?' . $_oOption->get('query', 'cloak') . '=<code>[asin]</code>&locale=<code>[...]</code>&tag=<code>[associate-id]</code>'), 'before_label' => "<span class='links-style-label'>", 'after_label' => "</span>", 'default' => 1));
     $_oCreditFields = new AmazonAutoLinks_FormFields_Unit_Credit();
     $_aCreditFields = $_oCreditFields->get($sFieldIDPrefix);
     return array_merge($_aFields, $_aCreditFields);
 }
 /**
  * Returns field definition arrays.
  * 
  * Pass an empty string to the parameter for meta box options. 
  * 
  * @return      array
  */
 public function get($sFieldIDPrefix = '', $sUnitType = 'category')
 {
     $_oOption = $this->oOption;
     $_aFields = array(array('field_id' => $sFieldIDPrefix . 'title', 'type' => 'text', 'title' => __('Title', 'amazon-auto-links')), array('field_id' => $sFieldIDPrefix . 'show_title_on_no_result', 'type' => 'checkbox', 'label' => __('Show widget title on no result.', 'amazon-auto-links'), 'default' => true), array('field_id' => $sFieldIDPrefix . 'criteria', 'title' => __('Additional Criteria', 'amazon-auto-links'), 'type' => 'checkbox', 'label' => array('post_title' => __('Post Title', 'amazon-auto-links'), 'taxonomy_terms' => __('Taxonomy Terms', 'amazon-auto-links'), 'breadcrumb' => __('Breadcrumb', 'amazon-auto-links')), 'default' => array('post_title' => true, 'taxonomy_terms' => true, 'breadcrumb' => false)), array('field_id' => $sFieldIDPrefix . 'additional_keywords', 'title' => __('Additional Keywords', 'amazon-auto-links'), 'type' => 'text', 'attributes' => array('style' => 'width: 80%'), 'tip' => __('Add additional search keywords, separated by commas.', 'amazon-auto-links')), array('field_id' => $sFieldIDPrefix . 'country', 'type' => 'select', 'title' => __('Country', 'amazon-auto-links'), 'label' => array('CA' => 'CA - ' . __('Canada', 'amazon-auto-links'), 'CN' => 'CN - ' . __('China', 'amazon-auto-links'), 'FR' => 'FR - ' . __('France', 'amazon-auto-links'), 'DE' => 'DE - ' . __('Germany', 'amazon-auto-links'), 'IT' => 'IT - ' . __('Italy', 'amazon-auto-links'), 'JP' => 'JP - ' . __('Japan', 'amazon-auto-links'), 'UK' => 'UK - ' . __('United Kingdom', 'amazon-auto-links'), 'ES' => 'ES - ' . __('Spain', 'amazon-auto-links'), 'US' => 'US - ' . __('United States', 'amazon-auto-links'), 'IN' => 'IN - ' . __('India', 'amazon-auto-links'), 'BR' => 'BR - ' . __('Brazil', 'amazon-auto-links'), 'MX' => 'MX - ' . __('Mexico', 'amazon-auto-links')), 'default' => 'US'), array('field_id' => $sFieldIDPrefix . 'associate_id', 'type' => 'text', 'title' => __('Associate ID', 'amazon-auto-links'), 'tip' => __('The Amazon Associate affiliate id (tag).', 'amazon-auto-links') . ' e.g. ' . '<code>miunosorft-20</code>'), array('field_id' => $sFieldIDPrefix . 'count', 'type' => 'number', 'title' => __('Number of Items', 'amazon-auto-links'), 'attributes' => array('min' => 1, 'max' => $_oOption->getMaximumProductLinkCount() ? $_oOption->getMaximumProductLinkCount() : null), 'default' => 10), array('field_id' => $sFieldIDPrefix . 'image_size', 'type' => 'number', 'title' => __('Image Size', 'amazon-auto-links'), 'attributes' => array('min' => 0, 'max' => 500), 'after_input' => ' ' . __('pixel', 'amazon-auto-links'), 'tip' => __('The maximum width of the product image in pixel. Set <code>0</code> for no image.', 'amazon-auto-links'), 'description' => __('Max', 'amazon-auto-links') . ': <code>500</code> ' . ' ' . __('Default', 'amazon-auto-links') . ': <code>160</code>', 'default' => 160), array('field_id' => $sFieldIDPrefix . 'ref_nosim', 'title' => __('Direct Link Bonus', 'amazon-auto-links'), 'type' => 'radio', 'label' => array(1 => __('On', 'amazon-auto-links'), 0 => __('Off', 'amazon-auto-links')), 'description' => sprintf(__('Inserts <code>ref=nosim</code> in the link url. For more information, visit <a href="%1$s">this page</a>.', 'amazon-auto-links'), 'https://affiliate-program.amazon.co.uk/gp/associates/help/t5/a21'), 'default' => 0), array('field_id' => $sFieldIDPrefix . 'title_length', 'title' => __('Title Length', 'amazon-auto-links'), 'type' => 'number', 'tip' => __('The allowed character length for the title.', 'amazon-auto-links') . '&nbsp;' . __('Use it to prevent a broken layout caused by a very long product title. Set -1 for no limit.', 'amazon-auto-links') . '<br />' . __('Default', 'amazon-auto-links') . ": <code>-1</code>", 'default' => -1), array('field_id' => $sFieldIDPrefix . 'link_style', 'title' => __('Link Style', 'amazon-auto-links'), 'type' => 'radio', 'label' => array(1 => 'http://www.amazon.<code>[domain-suffix]</code>/<code>[product-name]</code>/dp/<code>[asin]</code>/ref=<code>[...]</code>?tag=<code>[associate-id]</code>' . "&nbsp;<span class='description'>(" . __('Default', 'amazon-auto-links') . ")</span>", 2 => 'http://www.amazon.<code>[domain-suffix]</code>/exec/obidos/ASIN/<code>[asin]</code>/<code>[associate-id]</code>/ref=<code>[...]</code>', 3 => 'http://www.amazon.<code>[domain-suffix]</code>/gp/product/<code>[asin]</code>/?tag=<code>[associate-id]</code>&ref=<code>[...]</code>', 4 => 'http://www.amazon.<code>[domain-suffix]</code>/dp/ASIN/<code>[asin]</code>/ref=<code>[...]</code>?tag=<code>[associate-id]</code>', 5 => site_url() . '?' . $_oOption->get('query', 'cloak') . '=<code>[asin]</code>&locale=<code>[...]</code>&tag=<code>[associate-id]</code>'), 'before_label' => array(1 => "<span class='links-style-label'>", 2 => "<span class='links-style-label'>", 3 => "<span class='links-style-label'>", 4 => "<span class='links-style-label'>", 5 => "<span class='links-style-label'>"), 'after_label' => array(1 => "</span>", 2 => "</span>", 3 => "</span>", 4 => "</span>", 5 => "</span>"), 'default' => 1));
     $_oCreditFields = new AmazonAutoLinks_FormFields_Unit_Credit();
     $_aCreditFields = $_oCreditFields->get($sFieldIDPrefix);
     return array_merge($_aFields, $_aCreditFields);
 }
 /**
  * Returns field definition arrays.
  * 
  * Pass an empty string to the parameter for meta box options. 
  * 
  * @return      array
  */
 public function get($sFieldIDPrefix = '')
 {
     $_oOption = $this->oOption;
     $_aFields = array(array('field_id' => $sFieldIDPrefix . 'unit_type', 'type' => 'hidden', 'hidden' => true, 'value' => 'url'), array('field_id' => $sFieldIDPrefix . 'unit_title', 'title' => __('Unit Name', 'amazon-auto-links'), 'type' => 'text', 'description' => 'e.g. <code>My URL Unit</code>', 'value' => ''), array('field_id' => $sFieldIDPrefix . 'country', 'type' => 'select', 'title' => __('Country', 'amazon-auto-links'), 'label' => array('CA' => 'CA - ' . __('Canada', 'amazon-auto-links'), 'CN' => 'CN - ' . __('China', 'amazon-auto-links'), 'FR' => 'FR - ' . __('France', 'amazon-auto-links'), 'DE' => 'DE - ' . __('Germany', 'amazon-auto-links'), 'IT' => 'IT - ' . __('Italy', 'amazon-auto-links'), 'JP' => 'JP - ' . __('Japan', 'amazon-auto-links'), 'UK' => 'UK - ' . __('United Kingdom', 'amazon-auto-links'), 'ES' => 'ES - ' . __('Spain', 'amazon-auto-links'), 'US' => 'US - ' . __('United States', 'amazon-auto-links'), 'IN' => 'IN - ' . __('India', 'amazon-auto-links'), 'BR' => 'BR - ' . __('Brazil', 'amazon-auto-links'), 'MX' => 'MX - ' . __('Mexico', 'amazon-auto-links')), 'default' => 'US'), array('field_id' => $sFieldIDPrefix . 'associate_id', 'type' => 'text', 'title' => __('Associate ID', 'amazon-auto-links'), 'description' => 'e.g. <code>miunosoft-20</code>', 'default' => ''), array('field_id' => $sFieldIDPrefix . 'urls', 'type' => 'text', 'title' => __('URLs', 'amazon-auto-links'), 'attributes' => array('style' => 'width: 720px; max-width: 86%; ', 'size' => version_compare($GLOBALS['wp_version'], '3.8', '>=') ? 40 : 60), 'repeatable' => array('max' => $_oOption->isAdvancedAllowed() ? 0 : 1), 'description' => __('Enter URLs of the page to be parsed.', 'amazon-auto-links') . ' e.g. <code>http://www.amazon.com/gp/feature.html?docId=1000677541</code>'), array('field_id' => $sFieldIDPrefix . 'search_per_keyword', 'type' => 'checkbox', 'title' => __('Query per Term', 'amazon-auto-links'), 'tip' => __('Although Amazon API allows multiple search terms to be set per request, when one of them returns an error, the entire result becomes an error. To prevent it, check this option so that the rest will be returned.', 'amazon-auto-links'), 'label' => __('Perform search per item.', 'amazon-auto-links'), 'default' => false), array('field_id' => $sFieldIDPrefix . 'count', 'title' => __('Number of Items', 'amazon-auto-links'), 'type' => 'number', 'tip' => __('The number of product links to display.', 'amazon-auto-links'), 'attributes' => array('min' => 1, 'max' => $_oOption->getMaximumProductLinkCount() ? $_oOption->getMaximumProductLinkCount() : null), 'default' => 10), array('field_id' => $sFieldIDPrefix . 'image_size', 'type' => 'number', 'title' => __('Image Size', 'amazon-auto-links'), 'after_input' => ' ' . __('pixel', 'amazon-auto-links'), 'delimiter' => '', 'tip' => __('The maximum width of the product image in pixel. Set <code>0</code> for no image.', 'amazon-auto-links'), 'description' => __('Max', 'amazon-auto-links') . ': <code>500</code> ' . ' ' . __('Default', 'amazon-auto-links') . ': <code>160</code>', 'attributes' => array('max' => 500, 'min' => 0), 'default' => 160), array('field_id' => $sFieldIDPrefix . '_sort', 'type' => 'select', 'title' => __('Sort Order', 'amazon-auto-links'), 'label' => array('raw' => __('Raw', 'amazon-auto-links'), 'title' => __('Title', 'amazon-auto-links'), 'title_descending' => __('Title Descending', 'amazon-auto-links'), 'random' => __('Random', 'amazon-auto-links')), 'tip' => __('In order to not to sort and leave it as the found order, choose <code>Raw</code>.', 'amazon-auto-links'), 'default' => 'raw'), array('field_id' => $sFieldIDPrefix . 'ref_nosim', 'type' => 'radio', 'title' => __('Direct Link Bonus', 'amazon-auto-links'), 'label' => array(1 => __('On', 'amazon-auto-links'), 0 => __('Off', 'amazon-auto-links')), 'description' => sprintf(__('Inserts <code>ref=nosim</code> in the product link url. For more information, visit <a href="%1$s">this page</a>.', 'amazon-auto-links'), 'https://affiliate-program.amazon.co.uk/gp/associates/help/t5/a21'), 'default' => 0), array('field_id' => $sFieldIDPrefix . 'title_length', 'type' => 'number', 'title' => __('Title Length', 'amazon-auto-links'), 'tip' => __('The allowed character length for the title.', 'amazon-auto-links') . '&nbsp;' . __('Use it to prevent a broken layout caused by a very long product title. Set -1 for no limit.', 'amazon-auto-links'), 'description' => __('Default', 'amazon-auto-links') . ": <code>-1</code>", 'default' => -1), array('field_id' => $sFieldIDPrefix . 'link_style', 'type' => 'radio', 'title' => __('Link Style', 'amazon-auto-links'), 'label' => array(1 => 'http://www.amazon.<code>[domain-suffix]</code>/<code>[product-name]</code>/dp/<code>[asin]</code>/ref=<code>[...]</code>?tag=<code>[associate-id]</code>' . "&nbsp;<span class='description'>(" . __('Default', 'amazon-auto-links') . ")</span>", 2 => 'http://www.amazon.<code>[domain-suffix]</code>/exec/obidos/ASIN/<code>[asin]</code>/<code>[associate-id]</code>/ref=<code>[...]</code>', 3 => 'http://www.amazon.<code>[domain-suffix]</code>/gp/product/<code>[asin]</code>/?tag=<code>[associate-id]</code>&ref=<code>[...]</code>', 4 => 'http://www.amazon.<code>[domain-suffix]</code>/dp/ASIN/<code>[asin]</code>/ref=<code>[...]</code>?tag=<code>[associate-id]</code>', 5 => site_url() . '?' . $_oOption->get('query', 'cloak') . '=<code>[asin]</code>&locale=<code>[...]</code>&tag=<code>[associate-id]</code>'), 'before_label' => "<span class='links-style-label'>", 'after_label' => "</span>", 'default' => 1), array('field_id' => $sFieldIDPrefix . 'Operation', 'type' => 'hidden', 'hidden' => true, 'value' => 'ItemLookup'));
     $_oCreditFields = new AmazonAutoLinks_FormFields_Unit_Credit();
     $_aCreditFields = $_oCreditFields->get($sFieldIDPrefix);
     return array_merge($_aFields, $_aCreditFields);
 }
 /**
  * Returns field definition arrays.
  * 
  * Pass an empty string to the parameter for meta box options. 
  * 
  * @return      array
  */
 public function get($sFieldIDPrefix = '')
 {
     $_oOption = $this->oOption;
     $_aFields = array(array('field_id' => $sFieldIDPrefix . 'unit_title', 'title' => __('Unit Name', 'amazon-auto-links'), 'type' => 'text', 'description' => 'e.g. <code>My Tag Unit</code>', 'value' => ''), array('field_id' => $sFieldIDPrefix . 'country', 'type' => 'select', 'title' => __('Country', 'amazon-auto-links'), 'label' => array('US' => 'US - ' . __('United States', 'amazon-auto-links')), 'default' => 'US', 'description' => __('Currently only the U.S. locale is supported for this unit type.', 'amazon-auto-links')), array('field_id' => $sFieldIDPrefix . 'associate_id', 'type' => 'text', 'title' => __('Associate ID', 'amazon-auto-links'), 'description' => 'e.g. <code>miunosoft-20</code>', 'default' => ''), array('field_id' => $sFieldIDPrefix . 'tags', 'type' => 'text', 'title' => __('Tags', 'amazon-auto-links'), 'attributes' => array('size' => version_compare($GLOBALS['wp_version'], '3.8', '>=') ? 40 : 60), 'description' => __('Enter keywords that represent tags separated by commas.', 'amazon-auto-links') . ' ' . __('If the customer ID is provided, this option is optional and if it is left empty, all products tagged by the customer will be fetched.', 'amazon-auto-links') . ' ' . __('Any upper-case characters will be converted to lower-cases.', 'amazon-auto-links') . '<br />e.g. <code>wordpress, php</code>'), array('field_id' => $sFieldIDPrefix . 'customer_id', 'type' => 'text', 'title' => __('Customer ID', 'amazon-auto-links') . ' <span class="description">(' . __('optional', 'amazon-auto-links') . ')</span>', 'description' => __('Enter a 13-character ID of the customer who tagged the products.', 'amazon-auto-links') . ' ' . sprintf(__('You can find it by looking at the url of the customer profile page. The format is <code>%1$s</code>.', 'amazon-auto-links'), 'http://www.amazon.com/gp/pdp/profile/[customer_id]/') . ' ' . __('This is recommended to filter spam tagged products.', 'amazon-auto-links') . ' ' . __('If not specified, product links tagged by all customers will be fetched.', 'amazon-auto-links') . '<br />e.g. <code>AJM38DLD0P3H8</code>' . ' ' . sprintf(__('An example of the <a href="%1$s" target="_blank">customer profile page</a>.', 'amazon-auto-links'), 'http://www.amazon.com/gp/pdp/profile/AJM38DLD0P3H8/')), array('field_id' => $sFieldIDPrefix . 'feed_type', 'type' => 'checkbox', 'title' => __('Types', 'amazon-auto-links'), 'label' => array('new' => __('New', 'amazon-auto-links'), 'popular' => __('Popular', 'amazon-auto-links'), 'recent' => __('Recent', 'amazon-auto-links')), 'description' => __('It is recommended to check only a few for faster page loading.', 'amazon-auto-links') . '&nbsp;' . __('If the customer ID is provided, this option will not take effect.', 'amazon-auto-links'), 'default' => array('new' => true, 'popular' => false, 'recent' => false)), array('field_id' => $sFieldIDPrefix . 'threshold', 'type' => 'number', 'title' => __('Threshhold', 'amazon-auto-links'), 'attributes' => array('min' => 1), 'delimiter' => '', 'description' => __('This option indicates a threshold for how many times an item must have been tagged in order to appear in the "recent" feed. ', 'amazon-auto-links') . ' ' . __('If the threshold is set to 5, items will not appear in the recency feed until they have been tagged 5 times, and will be bumped up every time they are tagged after that.', 'amazon-auto-links') . ' ' . __('Default', 'amazon-auto-links') . ': <code>2</code>', 'default' => 2), array('field_id' => $sFieldIDPrefix . 'count', 'title' => __('Number of Items', 'amazon-auto-links'), 'type' => 'number', 'tip' => __('The number of product links to display.', 'amazon-auto-links'), 'attributes' => array('min' => 1, 'max' => $_oOption->getMaximumProductLinkCount() ? $_oOption->getMaximumProductLinkCount() : null), 'default' => 10), array('field_id' => $sFieldIDPrefix . 'image_size', 'type' => 'number', 'title' => __('Image Size', 'amazon-auto-links'), 'after_input' => ' ' . __('pixel', 'amazon-auto-links'), 'delimiter' => '', 'tip' => __('The maximum width of the product image in pixel. Set <code>0</code> for no image.', 'amazon-auto-links'), 'description' => __('Max', 'amazon-auto-links') . ': <code>500</code> ' . ' ' . __('Default', 'amazon-auto-links') . ': <code>160</code>', 'attributes' => array('max' => 500, 'min' => 0), 'default' => 160), array('field_id' => $sFieldIDPrefix . 'sort', 'type' => 'select', 'title' => __('Sort Order', 'amazon-auto-links'), 'label' => array('date' => __('Date', 'amazon-auto-links'), 'title' => __('Title', 'amazon-auto-links'), 'title_descending' => __('Title Descending', 'amazon-auto-links'), 'random' => __('Random', 'amazon-auto-links')), 'default' => 'random'), array('field_id' => $sFieldIDPrefix . 'ref_nosim', 'type' => 'radio', 'title' => __('Direct Link Bonus', 'amazon-auto-links'), 'label' => array(1 => __('On', 'amazon-auto-links'), 0 => __('Off', 'amazon-auto-links')), 'description' => sprintf(__('Inserts <code>ref=nosim</code> in the product link url. For more information, visit <a href="%1$s">this page</a>.', 'amazon-auto-links'), 'https://affiliate-program.amazon.co.uk/gp/associates/help/t5/a21'), 'default' => 0), array('field_id' => $sFieldIDPrefix . 'title_length', 'type' => 'number', 'title' => __('Title Length', 'amazon-auto-links'), 'tip' => __('The allowed character length for the title.', 'amazon-auto-links') . '&nbsp;' . __('Use it to prevent a broken layout caused by a very long product title. Set -1 for no limit.', 'amazon-auto-links'), 'description' => __('Default', 'amazon-auto-links') . ": <code>-1</code>", 'default' => -1), array('field_id' => $sFieldIDPrefix . 'link_style', 'type' => 'radio', 'title' => __('Link Style', 'amazon-auto-links'), 'label' => array(1 => 'http://www.amazon.<code>[domain-suffix]</code>/<code>[product-name]</code>/dp/<code>[asin]</code>/ref=<code>[...]</code>?tag=<code>[associate-id]</code>' . "&nbsp;<span class='description'>(" . __('Default', 'amazon-auto-links') . ")</span>", 2 => 'http://www.amazon.<code>[domain-suffix]</code>/exec/obidos/ASIN/<code>[asin]</code>/<code>[associate-id]</code>/ref=<code>[...]</code>', 3 => 'http://www.amazon.<code>[domain-suffix]</code>/gp/product/<code>[asin]</code>/?tag=<code>[associate-id]</code>&ref=<code>[...]</code>', 4 => 'http://www.amazon.<code>[domain-suffix]</code>/dp/ASIN/<code>[asin]</code>/ref=<code>[...]</code>?tag=<code>[associate-id]</code>', 5 => site_url() . '?' . $_oOption->get('query', 'cloak') . '=<code>[asin]</code>&locale=<code>[...]</code>&tag=<code>[associate-id]</code>'), 'before_label' => "<span class='links-style-label'>", 'after_label' => "</span>", 'default' => 1));
     $_oCreditFields = new AmazonAutoLinks_FormFields_Unit_Credit();
     $_aCreditFields = $_oCreditFields->get($sFieldIDPrefix);
     return array_merge($_aFields, $_aCreditFields);
 }
 /**
  * Returns field definition arrays.
  * 
  * Pass an empty string to the parameter for meta box options. 
  * 
  * @return      array
  */
 public function get($sFieldIDPrefix = '', $aUnitOptions = array())
 {
     $_oOption = $this->oOption;
     $aUnitOptions = $aUnitOptions + array('country' => null);
     $_aFields = array(array('field_id' => $sFieldIDPrefix . 'unit_title', 'type' => 'text', 'title' => __('Unit Name', 'amazon-auto-links')), array('field_id' => $sFieldIDPrefix . 'unit_type', 'type' => 'hidden', 'hidden' => true, 'value' => 'similarity_lookup'), array('field_id' => $sFieldIDPrefix . 'ItemId', 'title' => __('Item ASIN', 'amazon-auto-links'), 'type' => 'textarea', 'attributes' => array('size' => version_compare($GLOBALS['wp_version'], '3.8', '>=') ? 40 : 60), 'description' => __('Enter the ASIN(s) of the product per line or use the <code>,</code> (comma) characters to delimit the items.', 'amazon-auto-links') . ' e.g. <code>B009ZVO3H6</code>'), array('field_id' => $sFieldIDPrefix . 'search_per_keyword', 'type' => 'checkbox', 'title' => __('Query per Term', 'amazon-auto-links'), 'tip' => __('Although Amazon API allows multiple search terms to be set per request, when one of them returns an error, the entire result becomes an error. To prevent it, check this option so that the rest will be returned.', 'amazon-auto-links'), 'label' => __('Perform search per item.', 'amazon-auto-links'), 'default' => false), array('field_id' => $sFieldIDPrefix . 'SimilarityType', 'type' => 'radio', 'title' => __('Similarity Type', 'amazon-auto-links'), 'label' => array('Intersection' => __('Intersection', 'amazon-auto-links') . ' - ' . __('returns the intersection of items that are similar to all of the ASINs specified', 'amazon-auto-links'), 'Random' => __('Random', 'amazon-auto-links') . ' - ' . __('returns the union of randomly picked items that are similar to all of the ASINs specified.', 'amazon-auto-links')), 'description' => __('The maximum of only ten items can be retrieved.', 'amazon-auto-links'), 'default' => 'Intersection'), array('field_id' => $sFieldIDPrefix . 'count', 'type' => 'number', 'title' => __('Number of Items', 'amazon-auto-links'), 'attributes' => array('min' => 1, 'max' => $_oOption->getMaximumProductLinkCount() ? $_oOption->getMaximumProductLinkCount() : null), 'tip' => __('The number of product links to display.', 'amazon-auto-links'), 'description' => __('This unit type cannot display more than 10 items.', 'amazon-auto-links'), 'default' => 10), array('field_id' => $sFieldIDPrefix . 'Operation', 'type' => 'hidden', 'hidden' => true, 'value' => 'SimilarityLookup'), array('field_id' => $sFieldIDPrefix . 'country', 'title' => __('Locale', 'amazon-auto-links'), 'type' => 'text', 'attributes' => array('readonly' => true)), array('field_id' => $sFieldIDPrefix . 'associate_id', 'type' => 'text', 'title' => __('Associate ID', 'amazon-auto-links'), 'description' => 'e.g. <code>miunosoft-20</code>'), array('field_id' => $sFieldIDPrefix . 'image_size', 'title' => __('Image Size', 'amazon-auto-links'), 'type' => 'number', 'after_input' => ' ' . __('pixel', 'amazon-auto-links'), 'delimiter' => '', 'tip' => __('The maximum width of the product image in pixel. Set <code>0</code> for no image.', 'amazon-auto-links'), 'description' => __('Max', 'amazon-auto-links') . ': <code>500</code> ' . ' ' . __('Default', 'amazon-auto-links') . ': <code>160</code>', 'attributes' => array('max' => 500, 'min' => 0), 'default' => 160), array('field_id' => $sFieldIDPrefix . 'ref_nosim', 'type' => 'radio', 'title' => __('Direct Link Bonus', 'amazon-auto-links'), 'label' => array(1 => __('On', 'amazon-auto-links'), 0 => __('Off', 'amazon-auto-links')), 'description' => sprintf(__('Inserts <code>ref=nosim</code> in the link url. For more information, visit <a href="%1$s">this page</a>.', 'amazon-auto-links'), 'https://affiliate-program.amazon.co.uk/gp/associates/help/t5/a21'), 'default' => 0), array('field_id' => $sFieldIDPrefix . 'title_length', 'type' => 'number', 'title' => __('Title Length', 'amazon-auto-links'), 'tip' => __('The allowed character length for the title.', 'amazon-auto-links') . '&nbsp;' . __('Use it to prevent a broken layout caused by a very long product title. Set -1 for no limit.', 'amazon-auto-links'), 'description' => __('Default', 'amazon-auto-links') . ": <code>-1</code>", 'default' => -1), array('field_id' => $sFieldIDPrefix . 'description_length', 'type' => 'number', 'title' => __('Description Length', 'amazon-auto-links'), 'tip' => __('The allowed character length for the description.', 'amazon-auto-links') . '&nbsp;' . __('Set -1 for no limit.', 'amazon-auto-links'), 'description' => __('Default', 'amazon-auto-links') . ": <code>250</code>", 'default' => 250), array('field_id' => $sFieldIDPrefix . 'link_style', 'type' => 'radio', 'title' => __('Link Style', 'amazon-auto-links'), 'label' => array(1 => 'http://www.amazon.<code>[domain-suffix]</code>/<code>[product-name]</code>/dp/<code>[asin]</code>/ref=<code>[...]</code>?tag=<code>[associate-id]</code>' . "&nbsp;<span class='description'>(" . __('Default', 'amazon-auto-links') . ")</span>", 2 => 'http://www.amazon.<code>[domain-suffix]</code>/exec/obidos/ASIN/<code>[asin]</code>/<code>[associate-id]</code>/ref=<code>[...]</code>', 3 => 'http://www.amazon.<code>[domain-suffix]</code>/gp/product/<code>[asin]</code>/?tag=<code>[associate-id]</code>&ref=<code>[...]</code>', 4 => 'http://www.amazon.<code>[domain-suffix]</code>/dp/ASIN/<code>[asin]</code>/ref=<code>[...]</code>?tag=<code>[associate-id]</code>', 5 => site_url() . '?' . $_oOption->get('query', 'cloak') . '=<code>[asin]</code>&locale=<code>[...]</code>&tag=<code>[associate-id]</code>'), 'before_label' => "<span class='links-style-label'>", 'after_label' => "</span>", 'default' => 1));
     $_oCreditFields = new AmazonAutoLinks_FormFields_Unit_Credit();
     $_aCreditFields = $_oCreditFields->get($sFieldIDPrefix);
     return array_merge($_aFields, $_aCreditFields);
 }
 /**
  * Returns field definition arrays.
  * 
  * Pass an empty string to the parameter for meta box options. 
  * 
  * @return      array
  */
 public function get($sFieldIDPrefix = '', $aUnitOptions = array())
 {
     $_oOption = $this->oOption;
     $aUnitOptions = $aUnitOptions + array('country' => null);
     $_bUPCAllowed = 'CA' !== $aUnitOptions['country'];
     $_bISBNAllowed = 'US' === $aUnitOptions['country'];
     $_aFields = array(array('field_id' => $sFieldIDPrefix . 'unit_type', 'type' => 'hidden', 'hidden' => true, 'value' => 'item_lookup'), array('field_id' => $sFieldIDPrefix . 'unit_title', 'type' => 'text', 'title' => __('Unit Name', 'amazon-auto-links')), array('field_id' => $sFieldIDPrefix . 'ItemId', 'type' => 'textarea', 'title' => __('Item ID', 'amazon-auto-links'), 'attributes' => array('size' => version_compare($GLOBALS['wp_version'], '3.8', '>=') ? 40 : 60), 'description' => __('Enter the ID(s) of the product per line or use the <code>,</code> (comma) characters to delimit the items.', 'amazon-auto-links') . ' e.g. <code>B009ZVO3H6, B0043D2DZA</code>'), array('field_id' => $sFieldIDPrefix . 'search_per_keyword', 'type' => 'checkbox', 'title' => __('Query per Term', 'amazon-auto-links'), 'tip' => __('Although Amazon API allows multiple search terms to be set per request, when one of them returns an error, the entire result becomes an error. To prevent it, check this option so that the rest will be returned.', 'amazon-auto-links'), 'label' => __('Perform search per item.', 'amazon-auto-links'), 'default' => false), array('field_id' => $sFieldIDPrefix . 'IdType', 'type' => 'radio', 'title' => __('ID Type', 'amazon-auto-links'), 'label' => array('ASIN' => 'ASIN', 'SKU' => 'SKU', 'UPC' => '<span class="' . ($_bUPCAllowed ? "" : "disabled") . '">UPC <span class="description">(' . __('Not available in the CA locale.', 'amazon-auto-links') . ')</span></span>', 'EAN' => 'EAN', 'ISBN' => '<span class="' . ($_bISBNAllowed ? "" : "disabled") . '">ISBN <span class="description">(' . __('The US locale only, when the search index is Books.', 'amaozn-auto-links') . ')</span></span>'), 'attributes' => array('UPC' => array('disabled' => $_bUPCAllowed ? null : 'disabled'), 'ISBN' => array('disabled' => $_bISBNAllowed ? null : 'disabled')), 'default' => 'ASIN'), array('field_id' => $sFieldIDPrefix . 'Operation', 'type' => 'hidden', 'hidden' => true, 'value' => 'ItemLookup'), array('field_id' => $sFieldIDPrefix . 'country', 'type' => 'text', 'title' => __('Locale', 'amazon-auto-links'), 'attributes' => array('readonly' => true)), array('field_id' => $sFieldIDPrefix . 'associate_id', 'type' => 'text', 'title' => __('Associate ID', 'amazon-auto-links'), 'description' => 'e.g. <code>miunosoft-20</code>'), array('field_id' => $sFieldIDPrefix . 'SearchIndex', 'type' => 'select', 'title' => __('Categories', 'amazon-auto-links'), 'label' => AmazonAutoLinks_Property::getSearchIndexByLocale(isset($aUnitOptions['country']) ? $aUnitOptions['country'] : null), 'default' => 'All', 'tip' => __('Select the category to limit the searching area.', 'amazon-auto-links'), 'description' => __('If the above ID Type is ISBN, this will be automatically set to Books.', 'amazon-auto-links') . ' ' . __('If the ID Type is ASIN this option will not take effect.', 'amazon-auto-links')), array('field_id' => $sFieldIDPrefix . 'image_size', 'type' => 'number', 'title' => __('Image Size', 'amazon-auto-links'), 'after_input' => ' ' . __('pixel', 'amazon-auto-links'), 'delimiter' => '', 'tip' => __('The maximum width of the product image in pixel. Set <code>0</code> for no image.', 'amazon-auto-links'), 'description' => __('Max', 'amazon-auto-links') . ': <code>500</code> ' . ' ' . __('Default', 'amazon-auto-links') . ': <code>160</code>', 'attributes' => array('max' => 500, 'min' => 0), 'default' => 160), array('field_id' => $sFieldIDPrefix . 'ref_nosim', 'type' => 'radio', 'title' => __('Direct Link Bonus', 'amazon-auto-links'), 'label' => array(1 => __('On', 'amazon-auto-links'), 0 => __('Off', 'amazon-auto-links')), 'description' => sprintf(__('Inserts <code>ref=nosim</code> in the link url. For more information, visit <a href="%1$s">this page</a>.', 'amazon-auto-links'), 'https://affiliate-program.amazon.co.uk/gp/associates/help/t5/a21'), 'default' => 0), array('field_id' => $sFieldIDPrefix . 'title_length', 'type' => 'number', 'title' => __('Title Length', 'amazon-auto-links'), 'tip' => __('The allowed character length for the title.', 'amazon-auto-links') . '&nbsp;' . __('Use it to prevent a broken layout caused by a very long product title. Set -1 for no limit.', 'amazon-auto-links'), 'description' => __('Default', 'amazon-auto-links') . ": <code>-1</code>", 'default' => -1), array('field_id' => $sFieldIDPrefix . 'description_length', 'type' => 'number', 'title' => __('Description Length', 'amazon-auto-links'), 'tip' => __('The allowed character length for the description.', 'amazon-auto-links') . '&nbsp;' . __('Set -1 for no limit.', 'amazon-auto-links'), 'description' => __('Default', 'amazon-auto-links') . ": <code>250</code>", 'default' => 250), array('field_id' => $sFieldIDPrefix . 'link_style', 'type' => 'radio', 'title' => __('Link Style', 'amazon-auto-links'), 'label' => array(1 => 'http://www.amazon.<code>[domain-suffix]</code>/<code>[product-name]</code>/dp/<code>[asin]</code>/ref=<code>[...]</code>?tag=<code>[associate-id]</code>' . "&nbsp;<span class='description'>(" . __('Default', 'amazon-auto-links') . ")</span>", 2 => 'http://www.amazon.<code>[domain-suffix]</code>/exec/obidos/ASIN/<code>[asin]</code>/<code>[associate-id]</code>/ref=<code>[...]</code>', 3 => 'http://www.amazon.<code>[domain-suffix]</code>/gp/product/<code>[asin]</code>/?tag=<code>[associate-id]</code>&ref=<code>[...]</code>', 4 => 'http://www.amazon.<code>[domain-suffix]</code>/dp/ASIN/<code>[asin]</code>/ref=<code>[...]</code>?tag=<code>[associate-id]</code>', 5 => site_url() . '?' . $_oOption->get('query', 'cloak') . '=<code>[asin]</code>&locale=<code>[...]</code>&tag=<code>[associate-id]</code>'), 'before_label' => "<span class='links-style-label'>", 'after_label' => "</span>", 'default' => 1));
     $_oCreditFields = new AmazonAutoLinks_FormFields_Unit_Credit();
     $_aCreditFields = $_oCreditFields->get($sFieldIDPrefix);
     return array_merge($_aFields, $_aCreditFields);
 }