/**
  * Constructor
  */
 public function __construct($post_type)
 {
     // Set the page
     $this->set_page('general_' . $post_type);
     // Set the title
     $this->set_title(sprintf(__('General settings for %s', 'related-posts-for-wp'), $post_type));
     // The fields
     $this->sections = array(self::PREFIX . 'automatic_linking' => array('id' => 'automatic_linking', 'label' => sprintf(__('Automatic %ss linking', 'related-posts-for-wp'), $post_type), 'description' => sprintf(__('The following options affect how related posts are automatically linked for %ss.', 'related-posts-for-wp'), $post_type), 'fields' => array(array('id' => 'automatic_linking', 'label' => __('Enable', 'related-posts-for-wp'), 'description' => sprintf(__('Checking this will enable automatically linking posts to new %ss', 'related-posts-for-wp'), $post_type), 'type' => 'checkbox', 'default' => 1), array('id' => 'automatic_linking_post_amount', 'label' => __('Amount of Posts', 'related-posts-for-wp'), 'description' => sprintf(__('The amount of automatically linked %ss', 'related-posts-for-wp'), $post_type), 'type' => 'text', 'default' => '3'), array('id' => 'max_post_age', 'label' => __('Maximum Post Age', 'related-posts-for-wp'), 'description' => sprintf(__('The maximum age in days of %ss that will be linked. (0 = unlimited)', 'related-posts-for-wp'), $post_type), 'type' => 'text', 'default' => '0'))), self::PREFIX . 'css' => array('id' => 'css', 'label' => __('Frontend Settings', 'related-posts-for-wp'), 'description' => sprintf(__('The following options affect how related %ss are displayed on the frontend.', 'related-posts-for-wp'), $post_type), 'fields' => array(array('id' => 'heading_text', 'label' => __('Heading text', 'related-posts-for-wp'), 'description' => sprintf(__('The text that is displayed above the related %ss. To disable, leave field empty.', 'related-posts-for-wp'), $post_type), 'type' => 'text', 'default' => __('Related Posts', 'related-posts-for-wp')), array('id' => 'excerpt_length', 'label' => __('Excerpt length', 'related-posts-for-wp'), 'description' => __('The amount of words to be displayed below the title on website. To disable, set value to 0.', 'related-posts-for-wp'), 'type' => 'text', 'default' => '15'))), self::PREFIX . 'thumbnail_size' => array('id' => 'thumbnail_size', 'label' => __('Thumbnail size', 'related-posts-for-wp'), 'description' => sprintf(__('These settings affect the display and dimensions of your related post thumbnails – the display on the front-end will still be affected by CSS styles. After changing these settings you may need to %sregenerate your thumbnails.%s', 'related-posts-for-wp'), '<a href="https://wordpress.org/plugins/regenerate-thumbnails/" target="_blank">', '</a>'), 'fields' => array(array('id' => 'thumbnail_width', 'label' => __('Width', 'related-posts-for-wp'), 'description' => __("Thumbnail's width in pixels.", 'related-posts-for-wp'), 'type' => 'text', 'default' => get_option('thumbnail_size_w')), array('id' => 'thumbnail_height', 'label' => __('Height', 'related-posts-for-wp'), 'description' => __("Thumbnail's height in pixels.", 'related-posts-for-wp'), 'type' => 'text', 'default' => get_option('thumbnail_size_h')), array('id' => 'thumbnail_crop', 'label' => __('Crop', 'related-posts-for-wp'), 'description' => __('Crop the image from the center.', 'related-posts-for-wp'), 'type' => 'checkbox', 'default' => 1))), self::PREFIX . 'thumbnail_placeholder' => array('id' => 'thumbnail_placeholder', 'label' => __('Thumbnail Placeholder', 'related-posts-for-wp'), 'description' => __('The placeholder will be used if no featured image is set and no images could be found in the content.', 'related-posts-for-wp'), 'fields' => array(array('id' => 'thumbnail_placeholder', 'label' => __('Placeholder', 'related-posts-for-wp'), 'description' => __("Thumbnail placeholder, the image that will be used if no other image is found.", 'related-posts-for-wp'), 'type' => 'image', 'default' => ''))));
     // Parent constructor
     parent::__construct();
 }
 /**
  * Constructor
  */
 public function __construct()
 {
     // Set the page
     $this->set_page('words');
     // Set the title
     $this->set_title(__('Words', 'related-posts-for-wp'));
     // The fields
     $this->sections = array(self::PREFIX . 'words' => array('id' => 'words', 'label' => __('Word related options', 'related-posts-for-wp'), 'description' => __("Control what extra words should be excluded and what word combinations should be parsed as a single word.", 'related-posts-for-wp'), 'fields' => array(array('id' => 'ignored_words', 'label' => __('Extra Ignored Words', 'related-posts-for-wp'), 'description' => sprintf(__('By default we already ignore a lot of words based on your language that are not related to your content. In English this would be words like %s and %s.', 'related-posts-for-wp'), '<code>and</code>', '<code>or</code>') . '<br/>' . __('Add the extra words you would to ignore here, one word per row.', 'related-posts-for-wp'), 'type' => 'textarea', 'default' => ''), array('id' => 'joined_words', 'label' => __('Joined Words', 'related-posts-for-wp'), 'description' => sprintf(__('By default we split content per word but some word combinations should be considered as one word. An example of this would be %s.', 'related-posts-for-wp'), '<code>iPhone 6</code>') . '<br/>' . __('Add your joined words here, one joined word per row.', 'related-posts-for-wp'), 'type' => 'textarea', 'default' => ''))));
     // Parent constructor
     parent::__construct();
 }
 /**
  * Constructor
  */
 public function __construct()
 {
     // Set the page
     $this->set_page('configurator');
     // Set the title
     $this->set_title(__('Styling', 'related-posts-for-wp'));
     // The fields
     $this->sections = array(self::PREFIX . 'configuration' => array('id' => 'configuration', 'description' => __('Full control on how your related posts are displayed.', 'related-posts-for-wp'), 'fields' => array(array('id' => 'configuration', 'type' => 'configurator', 'default' => '[{"type":"title","x":0,"y":0,"width":2,"height":1},{"type":"image","x":0,"y":1,"width":2,"height":2},{"type":"excerpt","x":0,"y":3,"width":2,"height":2}]'), array('id' => 'posts_per_row', 'label' => __('Posts per row', 'related-posts-for-wp'), 'description' => __('The amount of related posts per row.', 'related-posts-for-wp'), 'type' => 'select', 'options' => array(1 => '1', 2 => '2', 3 => '3', 4 => '4'), 'default' => '2'), array('id' => 'fixed_height', 'label' => __('Row fixed height', 'related-posts-for-wp'), 'description' => __('The fixed height per row in pixels, set to 0 to allow dynamic heights..', 'related-posts-for-wp'), 'type' => 'text', 'default' => '325'), array('id' => 'css', 'label' => __('Custom CSS', 'related-posts-for-wp'), 'description' => __('Add custom CSS to selected theme. Warning! This is an advanced feature! An error here will break frontend display. To disable, leave field empty.', 'related-posts-for-wp'), 'type' => 'textarea', 'default' => ''))));
     // Parent constructor
     parent::__construct();
 }
 /**
  * Constructor
  */
 public function __construct()
 {
     // Set the page
     $this->set_page('misc');
     // Set the title
     $this->set_title(__('Misc', 'related-posts-for-wp'));
     // The fields
     $this->sections = array(self::PREFIX . 'misc' => array('id' => 'misc', 'label' => __('Miscellaneous Settings', 'related-posts-for-wp'), 'description' => __("A shelter for options that just don't fit in.", 'related-posts-for-wp'), 'fields' => array(array('id' => 'clean_on_uninstall', 'label' => __('Remove Data on Uninstall?', 'related-posts-for-wp'), 'description' => __('Check this box if you would like to completely remove all of its data when the plugin is deleted.', 'related-posts-for-wp'), 'type' => 'checkbox', 'default' => 0), array('id' => 'show_love', 'label' => __('Show love?', 'related-posts-for-wp'), 'description' => __("Display a 'Powered by' line under your related posts. <strong>BEWARE! Only for the real fans.</strong>", 'related-posts-for-wp'), 'type' => 'checkbox', 'default' => 0), array('id' => 'disable_sslverify', 'label' => __('Disable SSL Verification', 'related-posts-for-wp'), 'description' => __("Disable SSL verification in license requests. Check this if you've got problems connecting to licensing server.", 'related-posts-for-wp'), 'type' => 'checkbox', 'default' => 0))));
     // Parent constructor
     parent::__construct();
 }
 /**
  * Constructor
  */
 public function __construct()
 {
     // Set the page
     $this->set_page('license');
     // Set the title
     $this->set_title(__('License', 'related-posts-for-wp'));
     $is_activated = RP4WP_Updater_Key_API::is_activated();
     // The fields
     $this->sections = array(self::PREFIX . 'misc' => array('id' => 'misc', 'fields' => array(array('id' => 'license_status', 'label' => __('License Status', 'related-posts-for-wp'), 'type' => 'license_status', 'default' => $is_activated), array('id' => 'licence_key', 'label' => __('License Key', 'related-posts-for-wp'), 'description' => sprintf(__('Your license key. You can find your license key in your %sMy Account%s page.', 'related-posts-for-wp'), '<a href="https://www.relatedpostsforwp.com/my-account/" target="_blank">', '</a>'), 'type' => 'text', 'default' => '', 'disabled' => $is_activated), array('id' => 'email', 'label' => __('Activation Email', 'related-posts-for-wp'), 'description' => sprintf(__('Your activation email address. You can find your activation email address in your %sMy Account%s page.', 'related-posts-for-wp'), '<a href="https://www.relatedpostsforwp.com/my-account/" target="_blank">', '</a>'), 'type' => 'text', 'default' => get_option('admin_email'), 'disabled' => $is_activated))));
     if (false == $is_activated) {
         $this->set_button_title('Save and Activate License');
     } else {
         $this->set_button_title('Deactivate License');
     }
     // Parent constructor
     parent::__construct();
 }