<?php
/**
 * The page Settings.
 *
 * @since 1.0.0
 */

// Exit if accessed directly
if( !defined('ABSPATH') ) {
	exit;
}

class WWLABLE_SettingsPage extends WCL_Page {

	/**
	 * The id of the page in the admin menu.
	 *
	 * Mainly used to navigate between pages.
	 * @see FactoryPages000_AdminPage
	 *
	 * @since 1.0.0
	 * @var string
	 */
	public $id = "whitelabel";

	public $page_parent_page = 'none';

	/**
	 * @var string
	 */
	public $page_menu_dashicon = 'dashicons-performance';

	/**
	 * @var int
	 */
	public $page_menu_position = 20;

	public $available_for_multisite = true;


	/**
	 * @param WCL_Plugin $plugin
	 */
	public function __construct(WCL_Plugin $plugin)
	{
		$this->menu_title = __('Whitelabel', 'clearfy');
		$this->page_menu_short_description = __('Whitelabel control panel', 'clearfy');

		parent::__construct($plugin);

		$this->plugin = $plugin;
	}

	/**
	 * Permalinks options.
	 *
	 * @return mixed[]
	 * @since 1.0.0
	 */
	public function getPageOptions()
	{
		$options = array();

		$options[] = array(
			'type' => 'html',
			'html' => '<div class="wbcr-factory-page-group-header">' . __('<strong>Agents settings</strong>.', 'clearfy') . '<p>' . __('Basic branding settings.', 'clearfy') . '</p></div>'
		);

		$options[] = array(
			'type' => 'checkbox',
			'way' => 'buttons',
			'name' => 'whitelabel_hide_license_page',
			'title' => __('Hide licese page', 'clearfy'),
			'layout' => array('hint-type' => 'icon', 'hint-icon-color' => 'grey'),
			'hint' => __('Sometimes you may want your client not to have access to your license and plugin licensing in general, to restrict client access to the licensing page enable this checkbox.', 'clearfy'),
			'default' => false
		);

		$options[] = array(
			'type' => 'checkbox',
			'way' => 'buttons',
			'name' => 'enable_whitelabel',
			'title' => __('Enable Whitelabel', 'clearfy'),
			'layout' => array('hint-type' => 'icon', 'hint-icon-color' => 'grey'),
			'hint' => __('Turns on branding mode, replaces all occurrences of the word Clearfy with your plugin name, replaces the company name, links to your own, removes ads and our widgets.', 'clearfy'),
			'default' => false
		);

		$options[] = array(
			'type' => 'html',
			'html' => '<div class="wbcr-factory-page-group-header">' . __('<strong>Whitelabel colors</strong>.', 'clearfy') . '<p>' . __('You can change the color of the top bar of the plugin interface. For example, make it in the style of your site..', 'clearfy') . '</p></div>'
		);

		$options[] = array(
			'type' => 'color',
			'name' => 'whitelabel_header_bgcolor',
			'title' => __('Header background color', 'clearfy'),
			'layout' => array('hint-type' => 'icon', 'hint-icon-color' => 'grey'),
			'hint' => __('Select the header background color of the Clearfy plugin interface.', 'clearfy'),
			'default' => '#32373c'
		);
		$options[] = array(
			'type' => 'color',
			'name' => 'whitelabel_header_text_color',
			'title' => __('Header text color', 'clearfy'),
			'layout' => array('hint-type' => 'icon', 'hint-icon-color' => 'grey'),
			'hint' => __('Select the color of the header text of the Clearfy plugin interface.', 'clearfy'),
			'default' => '#ccc'
		);

		$options[] = array(
			'type' => 'color',
			'name' => 'whitelabel_button1_bgcolor',
			'title' => __('Save button background color', 'clearfy'),
			'layout' => array('hint-type' => 'icon', 'hint-icon-color' => 'grey'),
			'hint' => __('Select the background color of the save button.', 'clearfy'),
			'default' => '#8bc34a'
		);

		$options[] = array(
			'type' => 'color',
			'name' => 'whitelabel_button1_text_color',
			'title' => __('', 'clearfy'),
			'layout' => array('hint-type' => 'icon', 'hint-icon-color' => 'grey'),
			'hint' => __('Select the text color for the save button.', 'clearfy'),
			'default' => '#fff'
		);

		$options[] = array(
			'type' => 'color',
			'name' => 'whitelabel_button2_bgcolor',
			'title' => __('Select the background color for the general settings button.', 'clearfy'),
			'layout' => array('hint-type' => 'icon', 'hint-icon-color' => 'grey'),
			'hint' => __('Settings button background color', 'clearfy'),
			'default' => '#9e9e9e'
		);

		$options[] = array(
			'type' => 'color',
			'name' => 'whitelabel_button2_text_color',
			'title' => __('Select the text color for the general settings button.', 'clearfy'),
			'layout' => array('hint-type' => 'icon', 'hint-icon-color' => 'grey'),
			'hint' => __('Settings button text color', 'clearfy'),
			'default' => '#fff'
		);

		$options[] = array(
			'type' => 'html',
			'html' => '<div class="wbcr-factory-page-group-header">' . __('<strong>Whitelabel settings</strong>.', 'clearfy') . '<p>' . __('With this group of settings, you can edit the plugin name, brand, company name, etc.', 'clearfy') . '</p></div>'
		);

		$options[] = array(
			'type' => 'textbox',
			'way' => 'buttons',
			'name' => 'whitelabel_company_plugin_name',
			'title' => __('Plugin name', 'clearfy'),
			'layout' => array('hint-type' => 'icon', 'hint-icon-color' => 'grey'),
			'hint' => __('Enter a name for the plugin. The Clearfy name will be replaced with the name entered in this field.', 'clearfy'),
			'default' => 'Clearfy'
		);

		$options[] = array(
			'type' => 'textbox',
			'way' => 'buttons',
			'name' => 'whitelabel_company_name',
			'title' => __('Company name', 'clearfy'),
			'layout' => array('hint-type' => 'icon', 'hint-icon-color' => 'grey'),
			'hint' => __('Enter your company name. The CreativeMotion or Webcraftic name will be replaced with the name entered in this field.', 'clearfy'),
			'default' => 'Creative Motion'
		);

		/*$options[] = array(
			'type' => 'textbox',
			'way' => 'buttons',
			'name' => 'whitelabel_company_plugin_description',
			'title' => __('Plugin description', 'clearfy'),
			'layout' => array('hint-type' => 'icon', 'hint-icon-color' => 'grey'),
			'hint' => __('Enter your plugin name.', 'clearfy'),
			'default' => 'Disables unused Wordpress features, improves performance and increases SEO rankings, using Plugin name, which makes WordPress very easy.'
		);*/

		$options[] = array(
			'type' => 'textbox',
			'way' => 'buttons',
			'name' => 'whitelabel_company_site_url',
			'title' => __('Link to the company\'s website', 'clearfy'),
			'layout' => array('hint-type' => 'icon', 'hint-icon-color' => 'grey'),
			'hint' => __('Enter a link to your company\'s website.', 'clearfy'),
			'default' => 'https://cm-wp.com'
		);

		$options[] = array(
			'type' => 'html',
			'html' => '<div class="wbcr-factory-page-group-header">' . __('<strong>Right sidebar widget 1 settings</strong>', 'clearfy') . '<p>' . __('', 'clearfy') . '</p></div>'
		);

		$options[] = array(
			'type' => 'checkbox',
			'way' => 'buttons',
			'name' => 'whitelabel_enable_right_sidebar_widget_1',
			'title' => __('Enable widget', 'clearfy'),
			'layout' => array('hint-type' => 'icon', 'hint-icon-color' => 'grey'),
			'hint' => __('Enable widget.', 'clearfy'),
			'default' => true
		);

		$options[] = array(
			'type' => 'textbox',
			'way' => 'buttons',
			'name' => 'whitelabel_right_sidebar_widget_1_title',
			'title' => __('Title', 'clearfy'),
			'layout' => array('hint-type' => 'icon', 'hint-icon-color' => 'grey'),
			'hint' => __('Enter your plugin name.', 'clearfy'),
			'default' => 'Widget 1'
		);

		$options[] = array(
			'type' => 'wp-editor',
			'way' => 'buttons',
			'name' => 'whitelabel_right_sidebar_widget_1_description',
			'title' => __('Description', 'clearfy'),
			'layout' => array('hint-type' => 'icon', 'hint-icon-color' => 'grey'),
			'hint' => __('Enter your plugin name.', 'clearfy'),
			'default' => 'You can create an arbitrary company widget, for technical support and any other data, so that users can see it on the pages of the plugin.'
		);

		$options[] = array(
			'type' => 'html',
			'html' => '<div class="wbcr-factory-page-group-header">' . __('<strong>Right sidebar widget 2 settings</strong>', 'clearfy') . '<p>' . __('', 'clearfy') . '</p></div>'
		);

		$options[] = array(
			'type' => 'checkbox',
			'way' => 'buttons',
			'name' => 'whitelabel_enable_right_sidebar_widget_2',
			'title' => __('Enable widget', 'clearfy'),
			'layout' => array('hint-type' => 'icon', 'hint-icon-color' => 'grey'),
			'hint' => __('Enable widget.', 'clearfy'),
			'default' => false
		);

		$options[] = array(
			'type' => 'textbox',
			'way' => 'buttons',
			'name' => 'whitelabel_right_sidebar_widget_2_title',
			'title' => __('Title', 'clearfy'),
			'layout' => array('hint-type' => 'icon', 'hint-icon-color' => 'grey'),
			'hint' => __('Enter your plugin name.', 'clearfy'),
			'default' => ''
		);

		$options[] = array(
			'type' => 'wp-editor',
			'way' => 'buttons',
			'name' => 'whitelabel_right_sidebar_widget_2_description',
			'title' => __('Description', 'clearfy'),
			'layout' => array('hint-type' => 'icon', 'hint-icon-color' => 'grey'),
			'hint' => __('Enter your plugin name.', 'clearfy'),
			'default' => ''
		);

		$options[] = array(
			'type' => 'html',
			'html' => '<div class="wbcr-factory-page-group-header">' . __('<strong>Right sidebar widget 3 settings</strong>', 'clearfy') . '<p>' . __('', 'clearfy') . '</p></div>'
		);

		$options[] = array(
			'type' => 'checkbox',
			'way' => 'buttons',
			'name' => 'whitelabel_enable_right_sidebar_widget_3',
			'title' => __('Enable widget', 'clearfy'),
			'layout' => array('hint-type' => 'icon', 'hint-icon-color' => 'grey'),
			'hint' => __('Enable widget.', 'clearfy'),
			'default' => false
		);

		$options[] = array(
			'type' => 'textbox',
			'way' => 'buttons',
			'name' => 'whitelabel_right_sidebar_widget_3_title',
			'title' => __('Title', 'clearfy'),
			'layout' => array('hint-type' => 'icon', 'hint-icon-color' => 'grey'),
			'hint' => __('Enter your plugin name.', 'clearfy'),
			'default' => ''
		);

		$options[] = array(
			'type' => 'wp-editor',
			'way' => 'buttons',
			'name' => 'whitelabel_right_sidebar_widget_3_description',
			'title' => __('Description', 'clearfy'),
			'layout' => array('hint-type' => 'icon', 'hint-icon-color' => 'grey'),
			'hint' => __('Enter your plugin name.', 'clearfy'),
			'default' => ''
		);

		$options[] = array(
			'type' => 'html',
			'html' => '<div class="wbcr-factory-page-group-header">' . __('<strong>Bottom sidebar widget 1 settings</strong>', 'clearfy') . '<p>' . __('', 'clearfy') . '</p></div>'
		);

		$options[] = array(
			'type' => 'checkbox',
			'way' => 'buttons',
			'name' => 'whitelabel_enable_bottom_sidebar_widget_1',
			'title' => __('Enable widget', 'clearfy'),
			'layout' => array('hint-type' => 'icon', 'hint-icon-color' => 'grey'),
			'hint' => __('Enable widget.', 'clearfy'),
			'default' => true
		);

		$options[] = array(
			'type' => 'textbox',
			'way' => 'buttons',
			'name' => 'whitelabel_bottom_sidebar_widget_1_title',
			'title' => __('Title', 'clearfy'),
			'layout' => array('hint-type' => 'icon', 'hint-icon-color' => 'grey'),
			'hint' => __('Enter your plugin name.', 'clearfy'),
			'default' => 'Bottom sidebar widget 1'
		);

		$options[] = array(
			'type' => 'wp-editor',
			'way' => 'buttons',
			'name' => 'whitelabel_bottom_sidebar_widget_1_description',
			'title' => __('Description', 'clearfy'),
			'layout' => array('hint-type' => 'icon', 'hint-icon-color' => 'grey'),
			'hint' => __('Enter your plugin name.', 'clearfy'),
			'default' => 'You can create an arbitrary company widget, for technical support and any other data, so that users can see it on the pages of the plugin.'
		);

		$options[] = array(
			'type' => 'html',
			'html' => '<div class="wbcr-factory-page-group-header">' . __('<strong>Bottom sidebar widget 2 settings</strong>', 'clearfy') . '<p>' . __('', 'clearfy') . '</p></div>'
		);

		$options[] = array(
			'type' => 'checkbox',
			'way' => 'buttons',
			'name' => 'whitelabel_enable_bottom_sidebar_widget_2',
			'title' => __('Enable widget', 'clearfy'),
			'layout' => array('hint-type' => 'icon', 'hint-icon-color' => 'grey'),
			'hint' => __('Enable widget.', 'clearfy'),
			'default' => false
		);

		$options[] = array(
			'type' => 'textbox',
			'way' => 'buttons',
			'name' => 'whitelabel_bottom_sidebar_widget_2_title',
			'title' => __('Title', 'clearfy'),
			'layout' => array('hint-type' => 'icon', 'hint-icon-color' => 'grey'),
			'hint' => __('Enter your plugin name.', 'clearfy'),
			'default' => ''
		);

		$options[] = array(
			'type' => 'wp-editor',
			'way' => 'buttons',
			'name' => 'whitelabel_bottom_sidebar_widget_2_description',
			'title' => __('Description', 'clearfy'),
			'layout' => array('hint-type' => 'icon', 'hint-icon-color' => 'grey'),
			'hint' => __('Enter your plugin name.', 'clearfy'),
			'default' => ''
		);

		$options[] = array(
			'type' => 'html',
			'html' => '<div class="wbcr-factory-page-group-header">' . __('<strong>Bottom sidebar widget 3 settings</strong>', 'clearfy') . '<p>' . __('', 'clearfy') . '</p></div>'
		);

		$options[] = array(
			'type' => 'checkbox',
			'way' => 'buttons',
			'name' => 'whitelabel_enable_bottom_sidebar_widget_3',
			'title' => __('Enable widget', 'clearfy'),
			'layout' => array('hint-type' => 'icon', 'hint-icon-color' => 'grey'),
			'hint' => __('Enable widget.', 'clearfy'),
			'default' => false
		);

		$options[] = array(
			'type' => 'textbox',
			'way' => 'buttons',
			'name' => 'whitelabel_bottom_sidebar_widget_3_title',
			'title' => __('Title', 'clearfy'),
			'layout' => array('hint-type' => 'icon', 'hint-icon-color' => 'grey'),
			'hint' => __('Enter your plugin name.', 'clearfy'),
			'default' => ''
		);

		$options[] = array(
			'type' => 'wp-editor',
			'way' => 'buttons',
			'name' => 'whitelabel_bottom_sidebar_widget_3_description',
			'title' => __('Description', 'clearfy'),
			'layout' => array('hint-type' => 'icon', 'hint-icon-color' => 'grey'),
			'hint' => __('Enter your plugin name.', 'clearfy'),
			'default' => ''
		);

		$form_options = array();

		$form_options[] = array(
			'type' => 'form-group',
			'items' => $options,
			//'cssClass' => 'postbox'
		);

		return apply_filters('wclearfy/performance/intant_pages_form', $form_options, $this);
	}
}
