<?php
//delete_blog_option('wccp_pro_settings');
$wccp_pro_settings = wccp_pro_read_options();
//delete_option('wccp_pro_settings');
session_unset();
if ( isset( $_POST['Restore_defaults'] ) ) 
{
	if(is_multisite())
	{
		delete_blog_option('wccp_pro_settings');
	}
	else
	{
		delete_option('wccp_pro_settings');
	}
}
?>

<style>
#aio_admin_main {
	text-align:left;
	direction:ltr;
	padding:10px;
	margin: 10px;
	background-color: #ffffff;
	border:1px solid #EBDDE2;
	display: relative;
	overflow: auto;
}
.inner_block{
	height: 370px;
	display: inline;
	min-width:770px;
}
#donate{
    background-color: #EEFFEE;
    border: 1px solid #66DD66;
    border-radius: 10px 10px 10px 10px;
    height: 58px;
    padding: 10px;
    margin: 15px;
    }
.text-font {
    color: #1ABC9C;
    font-size: 14px;
    line-height: 1.5;
    padding-left: 3px;
    transition: color 0.25s linear 0s;
}
.text-font:hover {
    opacity: 1;
    transition: color 0.25s linear 0s;
}
.simpleTabsContent{
	border: 1px solid #E9E9E9;
	padding: 4px;
}
div.simpleTabsContent{
	margin-top:0;
	border: 1px solid #E0E0E0;
    display: none;
    height: 100%;
    min-height: 400px;
    padding: 5px 15px 15px;
}
html {
	background: #FFFFFF;
}

.inner-label {
    -moz-border-bottom-colors: none;
    -moz-border-left-colors: none;
    -moz-border-right-colors: none;
    -moz-border-top-colors: none;
    border-color: #f6f6f6;
    border-image: none;
    border-radius: 3px;
    border-style: solid;
    border-width: 1px 1px 1px 7px;
    font-family: tahoma;
    font-size: 11px;
    padding: 13px;
    text-align: center;
}
.controls_container {
    border-radius: 4px;
    min-height: 54px;
    padding-top: 7px;
    font-family: tahoma;
    font-size: 11px;
}
.framework_small_font {
    font-family: tahoma;
    font-size: 11px;
}
.welling {
    background-color: rgba(255, 253, 255, 1);
    border-radius: 3px;
    min-height: 54px;
    padding: 5px;
    font-family: tahoma;
    font-size: 11px;
}
.welling p {
    font-family: tahoma;
    font-size: 11px;
}
.welling > span {
    display: table-cell;
    height: 44px;
    vertical-align: middle;
}
tab_heading_text{
	
}
</style>
<!-- This for range slider only -->
<style>
.sliderr {
    -webkit-appearance: none;
    width: 100%;
    height: 15px;
    border-radius: 5px;
    background: #d3d3d3;
    outline: none;
    opacity: 0.7;
    -webkit-transition: .2s;
    transition: opacity .2s;
	}
.sliderr:hover {
    opacity: 1;
}

.sliderr::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #4CAF50;
    cursor: pointer;
}

.sliderr::-moz-range-thumb {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #4CAF50;
    cursor: pointer;
}
</style>
<style>
.styled-select-div {
  background: transparent;
  border: none;
  font-size: 14px;
  height: 37px;
  padding: 5px; /* If you add too much padding here, the options won't show in IE */
  width: 268px;
  background-color: #3b8ec2;
  -webkit-border-radius: 5px;
  -moz-border-radius: 5px;
  border-radius: 5px;
}
/* -------------------- Colors: Text */
.styled-select-div  select{
  color: #fff;
  background-color: rgb(59, 142, 194);
  border: none;
  font-size: 14px;
  height: 29px !important;
  padding: 5px; /* If you add too much padding here, the options won't show in IE */
  width: 258px;
}
.styled-select-div  option{
  color: #fff;
  background-color: rgb(126, 133, 138);
}
</style>
<?php
$c = new wccp_pro_controls_class();

if($c -> wccp_pro_get_setting('show_rating_message') == 'Yes')
{
	echo wpccp_rate_us('https://wordpress.org/support/plugin/wp-content-copy-protector/reviews/?filter=5', '#191E23');
	
	echo "<p></p>";
}
else{
	echo '<p style="margin: 20px 0 20px;font-size: 16px;font-weight: bold;color: rgba(30,140,190,.8);">WP Content Copy Protection &amp; No Right Click (Premium)</p>';
}
?>
<form method="POST">

<input type="hidden" value="update" name="action">
		<div class="tab_container">
			<input class="tab_container_radio_tabs" id="tab1" type="radio" name="tabs" checked>
			<label class="tab_container_label_tabs" for="tab1"><i class="fa fa-code"></i><span>Selection</span></label>

			<input class="tab_container_radio_tabs" id="tab2" type="radio" name="tabs">
			<label class="tab_container_label_tabs" for="tab2"><i class="fa fa-pencil-square-o"></i><span>RightClick</span></label>

			<input class="tab_container_radio_tabs" id="tab3" type="radio" name="tabs">
			<label class="tab_container_label_tabs" for="tab3"><i class="fa fa-bar-chart-o"></i><span>CSS protection</span></label>

			<input class="tab_container_radio_tabs" id="tab4" type="radio" name="tabs">
			<label class="tab_container_label_tabs" for="tab4"><i class="fa fa-ticket"></i><span>Smart protection</span></label>

			<input class="tab_container_radio_tabs" id="tab5" type="radio" name="tabs">
			<label class="tab_container_label_tabs" for="tab5"><i class="fa fa-picture-o"></i><span>Watermark</span></label>
			
			<input class="tab_container_radio_tabs" id="tab6" type="radio" name="tabs">
			<label class="tab_container_label_tabs" for="tab6"><i class="fa fa-filter"></i><span>Exclusion</span></label>
			
			<input class="tab_container_radio_tabs" id="tab7" type="radio" name="tabs">
			<label class="tab_container_label_tabs" for="tab7"><i class="fa fa-cog"></i><span>Custom Settings</span></label>
			
			<input class="tab_container_radio_tabs" id="tab8" type="radio" name="tabs">
			<label class="tab_container_label_tabs" for="tab8"><i class="fa fa-envelope-o"></i><span>Contact</span></label>
<script>
//Remeber last tab checked after refreshing the page
var currunt_tab = localStorage.getItem("wccp_pro_lastTab") || "tab1";
currunt_tab = "#" + currunt_tab;
$(currunt_tab).prop('checked', 'checked');
$(".tab_container :radio").on("change", function(){
  localStorage.setItem("wccp_pro_lastTab",this.id );
});

</script>
<?php
//---------------------------------------------------------------------
//Basic Protection 
//---------------------------------------------------------------------

$c->open_tab('content1');
	$c->add_tab_heading('<strong>Basic Protection (<font color="#008000">Basic Layer</font>):</strong>');
		$c->open_row();
	    $c->add_label("Disable Selection on");
	    $c->open_controls_container('disable_selection_on');
			$c->add_checkbox('single_posts_protection' , 'Posts' , 'checked', '');
			$c->add_checkbox('home_page_protection' , 'HomePage' , 'checked', '');
			$c->add_checkbox('page_protection' , 'Static pages' , 'checked', '');
		$c->close_controls_container();
	    $c->add_help_container('To choose where to apply the protection');
	$c->close_row();
    $c->add_line();
    
    $c->open_row();
        $c->add_label("Selection disabled message");
        $c->open_controls_container('selection_disabled_message');
			$default_text = '<b>Alert:</b> Content is protected !!';
	        $c->add_textbox('smessage' , 'Selection disabled message here', 'col-md-7 col-xs-12', $default_text);
		$c->close_controls_container();
        $c->add_help_container('');
    $c->close_row();
    $c->add_line();
	
	$c->open_row();
        $c->add_label("CTRL + key disabled message");
        $c->open_controls_container('ctrl_message_container');
			$default_text = '<b>Alert:</b> You are not allowed to copy content or view source';
	        $c->add_textbox('ctrl_message' , 'Write a message for CTRL + keys', 'col-md-7 col-xs-12', $default_text);
		$c->close_controls_container();
        $c->add_help_container('Message for disable the keys  CTRL+A , CTRL+C , CTRL+X , CTRL+S or CTRL+V , CTRL+U');
    $c->close_row();
    $c->add_line();
    
	$c->open_row();
	    $c->add_label("Disable special keys");
	    $c->open_controls_container('special_keys_protection');
			$c->add_checkbox('prntscr_protection' , 'Print Screen Key' , 'checked', '');
			$c->add_checkbox('ctrl_p_protection' , 'Ctrl+P Key' , 'checked', '');
			$c->add_checkbox('ctrl_s_protection' , 'Ctrl+S Key' , 'checked', '');
		$c->close_controls_container();
	    $c->add_help_container('Disable PrintScreen key & Printing key & Save page key<p>Note: this may not work on all browsers</p>');
	$c->close_row();
    $c->add_line();
	
	$c->open_row();
	    $c->add_label("Special keys disabled message");
	    $c->open_controls_container('special_keys_disabled_message');
			$default_text = 'You are not allowed to print or save this page!!';
	        $c->add_textbox('custom_keys_message' , 'Write a message for PrintScreen key', 'col-md-7 col-xs-12', $default_text);
		$c->close_controls_container();
	    $c->add_help_container('');
	$c->close_row();
    $c->add_line();
	
	$c->open_row();
	    $c->add_label("Print page disabled message");
	    $c->open_controls_container('p_p_d_m');
			$default_text = "WARNING:  UNAUTHORIZED USE AND/OR DUPLICATION OF THIS MATERIAL WITHOUT EXPRESS AND WRITTEN PERMISSION FROM THIS SITE'S AUTHOR AND/OR OWNER IS STRICTLY PROHIBITED! CONTACT US FOR FURTHER CLARIFICATION.!!";
			$bottom_hint = '';
			$c->add_textarea('prnt_scr_msg', 'Write the message here', 'col-md-10 col-xs-12',$bottom_hint, $default_text);
		$c->close_controls_container();
	    $c->add_help_container('Leave this field blank if you want to allow users to print your pages');
	$c->close_row();
    $c->add_line();
	
    $c->open_row();
        $c->add_label("Message inner style");
        $c->open_controls_container('m_i_s');
	        $c->add_colorpicker('msg_color', 'Message background', '#ffecec');
	        $c->add_colorpicker('font_color', 'Font color', '#555555');
		$c->close_controls_container();
        $c->add_help_container('You may use CTRL+F5 after saving to preview the message');
    $c->close_row();
    $c->add_line();
    
    $c->open_row();
        $c->add_label("Message outer style");
        $c->open_controls_container('m_o_s');
	        $c->add_colorpicker('border_color', 'Border color', '#f5aca6');
	        $c->add_colorpicker('shadow_color', 'Shadow color', '#f2bfbf');
		$c->close_controls_container();
        $c->add_help_container('You may use CTRL+F5 after saving to preview the message');
    $c->close_row();
    $c->add_line();
    
    $c->open_row();
        $c->add_label("Message Show Time");
        $c->open_controls_container('m_s_t');
			$c->open_form_group();
				$show_array[] = array();
				$show_array["class"] = 'col-md-4 col-xs-12';$show_array["counter"] = 1;
				$show_array["tansparency_meter"] = 0;$show_array["behind_text"] = '';
				$c->add_slider('message_show_time', 3, 0, 15, 1, 'horizontal', $show_array);
			$c->close_form_group();
		$c->close_controls_container();
        $c->add_help_container('By seconds, the alert message show time<p>0 value will hide the message');
    $c->close_row();

$c->close_tab();

//---------------------------------------------------------------------
// Copy Protection on RightClick 
//---------------------------------------------------------------------
$c->open_tab('content2');
	$c->add_tab_heading('<strong>Copy Protection on RightClick (<font color="#008000">Premium Layer 1</font>):</strong>');
	$c->open_row();
	    $c->add_label("Disable RightClick on");
	    $c->open_controls_container('');
			$c->add_checkbox('right_click_protection_posts' , 'Posts' , 'checked', '');
			$c->add_checkbox('right_click_protection_homepage' , 'HomePage' , 'checked', '');
			$c->add_checkbox('right_click_protection_pages' , 'Static pages' , 'checked', '');
		$c->close_controls_container();
	    $c->add_help_container('To choose where to apply the protection');
	$c->close_row();
	$c->add_line();
	
	$c->open_row();
	    $c->add_label("Disables RightClick for HTML tags");
	    $c->open_controls_container('');
			$c->open_controls_row();
				$c->add_checkbox('img' , 'Images ' , 'checked', '');
				$c->add_checkbox('a' , 'links' , 'checked', '');
				$c->add_checkbox('pb' , 'Text content' , 'checked', '');
			$c->close_controls_row();
			$c->open_controls_row();
				$c->add_checkbox('h' , 'Headlines' , 'checked', '');
				$c->add_checkbox('textarea' , 'Text area' , 'checked', '');
				$c->add_checkbox('input' , 'Text fields' , 'checked', '');
			$c->close_controls_row();
			$c->open_controls_row();
				$c->add_checkbox('emptyspaces' , 'Empty spaces' , 'checked', '');
				$c->add_checkbox('videos' , 'Videos (Not Recommended)' , '', '');
				$c->add_empty_col();
			$c->close_controls_row();
		$c->close_controls_container();
	    $c->add_help_container('Video protection is not recommended because video players are too different');
	$c->close_row();
	$c->add_line();
	
	$c->open_row();
	    $c->add_label("Right click disabled messages");
	    $c->open_controls_container('');
			$c->add_textbox('alert_msg_img' , 'For Images', 'col-md-4 col-xs-12', '<b>Alert:</b> Protected image');
			$c->add_textbox('alert_msg_a' , 'For Links', 'col-md-4 col-xs-12', '<b>Alert:</b> This link is protected');
			$c->add_textbox('alert_msg_pb' , 'For Text', 'col-md-4 col-xs-12', '<b>Alert:</b> Right click on text is disabled');
			$c->add_textbox('alert_msg_h' , 'For Headlines', 'col-md-4 col-xs-12', '<b>Alert:</b> Right click on headlines is disabled');
			$c->add_textbox('alert_msg_textarea' , 'For Text Area', 'col-md-4 col-xs-12', '<b>Alert:</b> Right click is disabled');
			$c->add_textbox('alert_msg_input' , 'For Text fields', 'col-md-4 col-xs-12', '<b>Alert:</b> Right click is disabled');
			$c->add_textbox('alert_msg_emptyspaces' , 'For Empty Spaces', 'col-md-4 col-xs-12', '<b>Alert:</b> Right click on empty spaces is disabled');
			$c->add_textbox('alert_msg_videos' , 'For videos', 'col-md-4 col-xs-12', '<b>Alert:</b> Right click on videos is disabled');
		$c->close_controls_container();
	    $c->add_help_container('&lt;b&gt;some text&lt;/b&gt; shows the text in <b>bold</b> format');
	$c->close_row();
	$c->add_line();
$c->close_tab();

//---------------------------------------------------------------------
//Protection by CSS Techniques 
//---------------------------------------------------------------------
$c->open_tab('content3');
	$c->add_tab_heading('<strong>Protection by CSS Techniques (<font color="#008000">Premium Layer 2</font>):</strong>');
	$c->open_row();
        $c->add_label('Home Page Protection by CSS');
        $c->open_controls_container('');
	        $options_array = array('Yes','No');
	        $default_value = 'Yes';
	        $c->add_dropdown('home_css_protection', $options_array, $default_value);
		$c->close_controls_container();
		$c->add_help_container('Protect your Homepage by CSS tricks');
	$c->close_row();
    $c->add_line();
	
	$c->open_row();
        $c->add_label('Posts Protection by CSS');
        $c->open_controls_container('');
	        $options_array = array('Yes','No');
	        $default_value = 'Yes';
	        $c->add_dropdown('posts_css_protection', $options_array, $default_value);
		$c->close_controls_container();
		$c->add_help_container('Protect your single posts by CSS tricks');
	$c->close_row();
	$c->add_line();
    
    $c->open_row();
        $c->add_label('Pages Protection by CSS');
        $c->open_controls_container('');
	        $options_array = array('Yes','No');
	        $default_value = 'Yes';
	        $c->add_dropdown('pages_css_protection', $options_array, $default_value);
		$c->close_controls_container();
		$c->add_help_container('Protect your static pages by CSS tricks');
	$c->close_row();
		
	$c->open_row();
	    $c->add_label("Add custom CSS code");
	    $c->open_controls_container('custom_css_code_container');
			$bottom_hint = '';
			$default_value = "<style>/* Start your code after this line */\n \n/* End your code before this line */</style>";
			$c->add_textarea('custom_css_code', 'Insert your custom code here', 'col-md-10 col-xs-12',$bottom_hint , $default_value);
		$c->close_controls_container();
	    $c->add_help_container('');
	$c->close_row();
$c->close_tab();

//---------------------------------------------------------------------
// Smart protection
//---------------------------------------------------------------------
$c->open_tab('content4');
$c->add_tab_heading('<strong>Smart protection (<font color="#008000">Premium Layer 3</font>):</strong>');
	$c->open_row();
	    $c->add_label("Auto overlay a transparent image over the real images on:");
	    $c->open_controls_container('');
			$c->add_checkbox('protection_overlay_posts' , 'Posts' , '', '');
			$c->add_checkbox('protection_overlay_homepage' , 'HomePage' , '', '');
			$c->add_checkbox('protection_overlay_pages' , 'Static pages' , '', '');
		$c->close_controls_container();
	    $c->add_photo_help_container('images/tansparent.png', '');
	$c->close_row();
	$c->add_line();

	$c->open_row();
	    $c->add_label("Auto remove image attachment links");
	    $c->open_controls_container('Auto-remove-image-attachment-links');
			$options_array = array('Yes', 'No');
				$default_value = 'No';
				$c->add_dropdown('remove_img_urls', $options_array, $default_value);
				$c->add_bottom_hint("<p>Not recommended when you are using any lightbox plugin</p>");
		$c->close_controls_container();
	    $c->add_help_container('All images will be without hover links');
	$c->close_row();
	$c->add_line();
	
	$c->open_row();
	    $c->add_label("Action when JavaScript is disabled");
	    $c->open_controls_container('hotlinking_rule4');
			$options_array = array('Nothing', 'Watermark all');
			$default_value = 'Nothing';
			$c->add_dropdown('no_js_action', $options_array, $default_value);
		$c->close_controls_container();
	    $c->add_help_container('The browser will do it if the user disable JavaScript');
	$c->close_row();

$c->close_tab();
//---------------------------------------------------------------------
//Protection by watermarking
//---------------------------------------------------------------------
$c->open_tab('content5');
	$c->add_tab_heading('<strong>Watermark your images with full control (<font color="#008000">Premium Layer 4</font>):</strong>');
	if (!extension_loaded('gd') && !function_exists('gd_info')) {
		//echo "PHP GD library is NOT installed on your web server";
		$c->add_section('Warning: PHP GD library is NOT installed on your web server','red');
	}
	//$c->add_section('Default watremark','#1ABC9C');
	$c->open_row();
	    $c->add_label("Hotlinking Rule");
	    $c->open_controls_container('hotlinking_rule');
			$options_array = array('Watermark', 'No Action');
				$default_value = 'Watermark';
				$c->add_dropdown('hotlinking_rule', $options_array, $default_value);
				$htaccess_file = ABSPATH.'.htaccess';
				$filename = $htaccess_file;
				if (is_writable($filename)) {
					$hint = '<p style="color:green">Good! The htaccess file is writable</p>';
				} else {
					$hint = '<p style="color:red">Opps! The htaccess file is not writable</p>';
				}
				$c->add_bottom_hint($hint);
		$c->close_controls_container();
	    $c->add_help_container('Action when a thief copy your images to his site or try to download them');
	$c->close_row();
	$c->add_line();
	
	$c->open_row();
	    $c->add_label("My Site Rule");
	    $c->open_controls_container('my_site_rule');
			$options_array = array('Watermark', 'No Action');
				$default_value = 'No Action';
				$c->add_dropdown('mysite_rule', $options_array, $default_value);
		$c->close_controls_container();
	    $c->add_help_container('What will happen to images on my site');
	$c->close_row();
	$c->add_line();
	
	$c->open_row();
	    $c->add_label("Watermark logo");
	    $c->open_controls_container('Watermark-logo');
			$pluginsurl = plugins_url( '', __FILE__ );
			$default_image = $pluginsurl . '/images/testing-logo.png';
			$c->add_media_uploader('dw_logo',$default_image);
		$c->close_controls_container();
	    $c->add_help_container('You can use a transparent logo in a png format<br>Best size: 128x128 px <p>Clear it to watermark without logo</p>');
	$c->close_row();
	$c->add_line();
	
	$c->open_row();
	    $c->add_label("Logo Margins");
	    $c->open_controls_container('margin_factors');
			$c->open_form_group();
			$show_array[] = array();
				$c->add_inner_label("From Top");
				$show_array["class"] = 'col-md-4 col-xs-12';$show_array["counter"] = 1;
				$show_array["tansparency_meter"] = 0;$show_array["behind_text"] = '%';
				$c->add_slider('dw_margin_top_factor', 98, 1, 100, 1, 'horizontal', $show_array);//Text size
			$c->close_form_group();
			
			$c->open_form_group();
				$c->add_inner_label("From Left");
				$show_array[] = array();
				$show_array["class"] = 'col-md-4 col-xs-12';$show_array["counter"] = 1;
				$show_array["tansparency_meter"] = 0;$show_array["behind_text"] = '%';
				$c->add_slider('dw_margin_left_factor', 98, 1, 100, 2, 'horizontal', $show_array);//Text size
			$c->close_form_group();
		$c->close_controls_container();
	    $c->add_photo_help_container('images/logo-positioning.png', '');
	$c->close_row();
	$c->add_line();
	
	$c->open_row();
	    $c->add_label("Watermark Central text");
	    $c->open_controls_container('Watermark-text');
			$default_text = 'WATERMARKED';
			$c->add_textbox('dw_text' , 'Watermark text', 'col-8', $default_text);
			$c->add_colorpicker('dw_font_color', '', '#000000');
		$c->close_controls_container();
	    $c->add_help_container('Write a short text');
	$c->close_row();
	$c->add_line();
	
	$c->open_row();
	    $c->add_label("Watermark text position");
	    $c->open_controls_container('watermark-position');
			$options_array = 
			array(
				array('top-left','top-center','top-right','center-left','center-center','center-right','bottom-left','bottom-center','bottom-right'),
				array('Top Left','Top Center','Top Rright','Center Left','Center','Center Right','Bottom Left','Bottom Center','Bottom Right')
			);
			$c->add_image_picker('dw_position', '', $options_array, 'images/img-picker-1', 'center-center');
	    $c->close_controls_container();
		$c->add_help_container('Choose a watermark text position');
	$c->close_row();
	$c->add_line();
	
	$c->open_row();
	    $c->add_label("Central text font size");
	    $c->open_controls_container('Watermark-font-size');
		$c->open_form_group();
			$show_array[] = array();
			$show_array["class"] = 'col-md-4 col-xs-12';$show_array["counter"] = 1;
			$show_array["tansparency_meter"] = 0;$show_array["behind_text"] = '%';
			//add_slider($name, $default_value, $min, $max, $factor, $orientation, $show_array)
			$c->add_slider('dw_font_size_factor', 90, 1, 100, 1, 'horizontal', $show_array);//Text size
		$c->close_form_group();
		$c->close_controls_container();
	    $c->add_help_container('Depend on image size');
	$c->close_row();
	$c->add_line();
	
	$c->open_row();
	    $c->add_label("Watermark Repeated text");
	    $c->open_controls_container('Watermark-r-text');
			$default_text = 'your-site.com';
			$default_text = $_SERVER["SERVER_NAME"];
			$c->add_textbox('dw_r_text' , 'Watermark text', 'col-8', $default_text);
			$c->add_colorpicker('dw_r_font_color', '', '#efefef');
		$c->close_controls_container();
	    $c->add_help_container('Repeated as a grid on the image');
	$c->close_row();
	$c->add_line();
	
	$c->open_row();
	    $c->add_label("Repeated text font size");
	    $c->open_controls_container('repeated-text-font-size');
		$c->open_form_group();
			$show_array[] = array();
			$show_array["class"] = 'col-md-4 col-xs-12';$show_array["counter"] = 1;
			$show_array["tansparency_meter"] = 0;$show_array["behind_text"] = '%';
			//add_slider($name, $default_value, $min, $max, $factor, $orientation, $show_array)
			$c->add_slider('dw_r_font_size_factor', 55, 1, 100, 1, 'horizontal', $show_array);//Text size
		$c->close_form_group();
		$c->close_controls_container();
	    $c->add_help_container('Depend on image size');
	$c->close_row();
	$c->add_line();
	
	$c->open_row();
	    $c->add_label("Text transparency");
	    $c->open_controls_container('Watermark-transparency');
		$c->open_form_group();
			$show_array[] = array();
			$show_array["class"] = 'col-md-4 col-xs-12';$show_array["counter"] = 1;
			$show_array["tansparency_meter"] = 1;$show_array["behind_text"] = '';
			$c->add_slider('dw_text_transparency', 65, 1, 100, 1, 'horizontal', $show_array);//Text transparency
		$c->close_form_group();
			$c->add_inner_label("Rotation");
			$c->add_textbox('dw_rotation', 'Rotation value', 'col-md-4 col-xs-12', '40');//Text Rotation
			// $c->add_filedropdown();
		$c->close_controls_container();
	    $c->add_help_container('Rotation value + or - (0 to 360)');
	$c->close_row();
	$c->add_line();
	
	$c->open_row();
	    $c->add_label("Watermark image filter");
	    $c->open_controls_container('Watermark image filter');
			$options_array = array('Blur','Grayscale','Negate','Britness','None');
			$default_value = 'None';
			$c->add_dropdown('dw_imagefilter', $options_array, $default_value);
		$c->close_controls_container();
	    $c->add_help_container('Chosse any filter you want');
	$c->close_row();
	$c->add_line();
	
	$c->open_row();
	    $c->add_label("Signature");
	    $c->open_controls_container('watermark_effect_3');
			$default_text = 'This image is protected';
			$c->add_textbox('dw_signature' , 'Signature', 'col-8', $default_text);
		$c->close_controls_container();
	    $c->add_help_container('Will added at the bottom area of any image');
	$c->close_row();
	$c->add_line();
$c->close_tab();
//---------------------------------------------------------------------
// Exclude URLs (pages or posts) form protection
//---------------------------------------------------------------------
global $_wp_additional_image_sizes; 
$c->open_tab('content6');
$c->add_tab_heading('<strong>Exclude URLs (pages or posts) form protection:</strong>');
	$c->open_row();
	    $c->add_label("URL Exclude List");
	    $c->open_controls_container('url_exclude_list');
			$bottom_hint = "Example: http://www.mysite.com/mypage.html";
			$c->add_textarea('url_exclude_list', 'Exclude list', 'col-md-10 col-xs-12',$bottom_hint, '');
		$c->close_controls_container();
	    $c->add_help_container("Please enter URL's line by line<p><b>Note:</b> Watermarking is out of exclusion</p>");
	$c->close_row();
	
	$c->open_row();
	    $c->add_label("Selection Exclude by class name");
	    $c->open_controls_container('selection_exclude_classes');
			$bottom_hint = "Example: class1";
			$c->add_textarea('selection_exclude_classes', 'Exclude list', 'col-md-10 col-xs-12',$bottom_hint, '');
		$c->close_controls_container();
	    $c->add_help_container("Write excluded calsses from selection line by line<p><b>Note:</b> This type of exclusion has some special rules</p>");
	$c->close_row();
	
	$c->open_row();
	    $c->add_label("Exclude online bots");
	    $c->open_controls_container('bots_exclude');
			$bottom_hint = "Example: googlebot";
			$c->add_textarea('exclude_online_bots', 'Exclude list', 'col-md-10 col-xs-12',$bottom_hint, '');
		$c->close_controls_container();
	    $c->add_help_container("Write excluded bots line by line");
	$c->close_row();
	
	$c->open_row();
	    $c->add_label("Exclude by user type:");
	    $c->open_controls_container('');
			$c->open_controls_row();
				$c->add_checkbox('administrator' , 'Administrators ' , '', '');
				$c->add_checkbox('editor' , 'Editors' , '', '');
				$c->add_checkbox('author' , 'Authors' , '', '');
			$c->close_controls_row();
			$c->open_controls_row();
				$c->add_checkbox('contributor' , 'Contributors' , '', '');
				$c->add_checkbox('subscriber' , 'Subscribers' , '', '');
				$c->add_empty_col();
			$c->close_controls_row();
		$c->close_controls_container();
	    $c->add_help_container('');
	$c->close_row();
	
	function wpsites_list_cats() {

$args = array(
'orderby' => 'name',
'exclude' => '',
'include' => '',
);
$categories = get_categories( $args );
echo'<nav id="primary-navigation" class="primary-navigation" role="navigation">';
foreach ( $categories as $category ) {
echo '<li><a href="' . get_category_link( $category->term_id ) . '">' .  $category->name . '</a></li>';
}
echo'</nav>';

}
//wpsites_list_cats();
	
	$c->open_row();
	    //$c->add_label("Watermark exclude image sizes");
	    $registered_image_sizes = wccp_pro_get_image_sizes();
		
		$options_array = array(); //Empty the $options_array to use it
		
		foreach($registered_image_sizes as $key => $value)
		{
			if (!is_array($value))
			{
				echo $key ." => ". $value ."\r\n" ;
			}
			else
			{
			   //echo $key ." =>>>> array( \r\n";
			   
			   //$options_array[].= $key;
			   
			   $value3 = '';
			   
			   foreach ($value as $key2 => $value2)
			   {
				   //echo "\t". $key2 ." => ". $value2 ."\r\n";
				   
				   $value3 .= " ". $key2 ." => ". $value2 ." ";
			   }
			   
			   $options_array[].= $key;
			   
			   $value3 = '';

			   //echo ")";
			}
		}
		$default_value = 'None';
		//$c->add_multiselection_dropdown('image_sizes' , $options_array , $default_value);
		//echo $c->wccp_pro_get_setting('image_sizes');
	$c->close_row();

$c->close_tab();
//---------------------------------------------------------------------
//Custom Settings
//---------------------------------------------------------------------
$c->open_tab('content7');
$c->add_tab_heading('<strong>Custom Settings:</strong>');

	$c->open_row();
        $c->add_label('Show the plugin icon in the top admin bar');
        $c->open_controls_container('plugin-icon-top-admin-bar');
	        $options_array = array('Yes','No');
	        $default_value = 'Yes';
	        $c->add_dropdown('show_admin_bar_icon', $options_array, $default_value);
		$c->close_controls_container();
	$c->add_help_container('Used for going to plugin settings page fast');
    $c->close_row();
	$c->add_line();
	
	$c->open_row();
        $c->add_label('Show the plugin rating bar');
        $c->open_controls_container('plugin-rating-bar');
	        $options_array = array('Yes','No');
	        $default_value = 'Yes';
	        $c->add_dropdown('show_rating_message', $options_array, $default_value);
		$c->close_controls_container();
	$c->add_help_container('Used for show/hide plugin rating page');
    $c->close_row();
$c->close_tab();

//---------------------------------------------------------------------
//About tab
//---------------------------------------------------------------------
$c->open_tab('content8');
//echo '<img style="float:left" src="http://www.wp-buy.com/wp-content/uploads/2015/05/wp-buy-new-logo.png">';
$c->add_tab_heading('<strong>Contact US</strong>');
	$c->open_row();
	    $c->add_label("Getting Support:");
	    $c->open_controls_container('Getting-Support');
			echo '<img style="" src="'.$pluginsurl.'/images/wp-buy-new-logo.png"><p></p>';
			echo "<font size=4pt>";
			echo "We would love to hear from you! Please write any question you want and we will get in touch with you shortly.";
			echo "<p></p>Have your own issue? Support Center will help you:";
			echo '<p></p><a class=" current " href="http://www.wp-buy.com/category/plugins-support/copy-protection-plugin-support/">Support Topics *</a>';
			echo "</font>";
		$c->close_controls_container();
	$c->close_row();

$c->close_tab();
?>
<div style="width:98%;" class="">
<div class="row justify-content-end form-btns">
	<div class=""><input type="submit" class="btn btn-secondary" value="Restore defaults" style="width: 193; height: 29;" name="Restore_defaults"></div>
	<div class=""><input type="button" class="btn btn-primary" alt="Use CTRL+F5 after saving" onclick="show_wccp_pro_message('This is a preview message (do not forget to save changes)');" value="Preview alert message" style="width: 193; height: 29;" name="B5"></div>
	<div class=""><input class="btn btn-success" type="submit" value="   Save Settings   " name="Save_settings" style="width: 193; height: 29;"></div>
</div></div>
</div><!-- tabs div end -->

<style>
.form-btns .btn{
	width:180px !important;
	margin-right: 5px;
	float: right;
}
@media (max-width: 415px)
{
	.form-btns .btn
	{
	width:250px !important;
	}
}
@media (min-width: 416px) and (max-width: 575.98px)
{
	.form-btns .btn
	{
	width:390px !important;
	}
}
@media (min-width: 576px) and (min-width: 768px)
{
	.form-btns .btn
	{
	width:180px !important;
	margin-right: 5px;
	}
}
@media (max-width: 768px)
{
	.help-container
	{
		display: none;
	}
	.welling {
		background-color: #dddddd3b;
		max-height: 30px;
		margin-top: 15px;
		background-image: -webkit-linear-gradient(left, #5d5d5d, #757474 1%, transparent 1%, transparent 100%);
		padding-left: 15px;
	}
	hr{display:none;}
	.controls_container{
		margin-top: 6px;
	}
}
@media screen and (max-width: 782px){.wp-picker-container input[type=text].wp-color-picker{width:80px;padding:6px 5px 5px;font-size:16px;line-height:18px}.wp-customizer .wp-picker-container input[type=text].wp-color-picker{padding:5px 5px 4px}.wp-picker-container .wp-color-result.button{height:auto;padding:0 0 0 40px;font-size:14px;line-height:29px}.wp-customizer .wp-picker-container .wp-color-result.button{font-size:13px;line-height:26px}.wp-picker-container .wp-color-result-text{padding:0 14px;font-size:inherit;line-height:inherit}.wp-customizer .wp-picker-container .wp-color-result-text{padding:0 10px}}
</style>
<script>
$(document).ready(function(){
  var changeWidth = function(){
    if ( $(window).width() < 575.98 ){
    $('.form-btns').removeClass('justify-content-end').addClass('justify-content-center');
    } else {
      $('.form-btns').removeClass('justify-content-center').addClass('justify-content-end');
    }
  };
  $(window).resize(changeWidth);
});
</script>
</form>
<div class="msgmsg-box-wpcp warning-wpcp hideme" id="wpcp-error-message"><b>Alert: </b>Content is protected !!</div>


<style type="text/css">
	#wpcp-error-message {
	    direction: ltr;
	    text-align: center;
	    transition: opacity 900ms ease 0s;
	    z-index: 99999999;
	}
	.hideme {
    	opacity:0;
    	visibility: hidden;
	}
	.showme {
    	opacity:1;
    	visibility: visible;
	}
	.enable-me{
		
	}
	.disable-me{
	
	}
	.msgmsg-box-wpcp {
		border-radius: 10px;
		color: <?php echo $wccp_pro_settings['font_color'];?>;
		font-family: Tahoma;
		font-size: 11px;
		margin: 10px;
		padding: 10px 36px;
		position: fixed;
		width: 255px;
		top: 50%;
  		left: 50%;
  		margin-top: -10px;
  		margin-left: -130px;
  		-webkit-box-shadow: 0px 0px 34px 2px <?php echo $wccp_pro_settings['shadow_color'];?>;
		-moz-box-shadow: 0px 0px 34px 2px <?php echo $wccp_pro_settings['shadow_color'];?>;
		box-shadow: 0px 0px 34px 2px <?php echo $wccp_pro_settings['shadow_color'];?>;
	}
	.msgmsg-box-wpcp span {
		font-weight:bold;
		text-transform:uppercase;
	}
	.error-wpcp {<?php global $pluginsurl; ?>
		background:#ffecec url('<?php echo $pluginsurl ?>/images/error.png') no-repeat 10px 50%;
		border:1px solid #f5aca6;
	}
	.success {
		background:#e9ffd9 url('<?php echo $pluginsurl ?>/images/success.png') no-repeat 10px 50%;
		border:1px solid #a6ca8a;
	}
	.warning-wpcp {
		background:<?php echo $wccp_pro_settings['msg_color'];?> url('<?php echo $pluginsurl ?>/images/warning.png') no-repeat 10px 50%;
		border:1px solid <?php echo $wccp_pro_settings['shadow_color'];?>;
	}
	.notice {
		background:#e3f7fc url('<?php echo $pluginsurl ?>/images/notice.png') no-repeat 10px 50%;
		border:1px solid #8ed9f6;
	}
</style>
<?php
########## function creation ##################

function wpccp_rate_us($plugin_url, $box_color='#1D1F21'){
	
	$ret = '
	<style type="text/css">
	
	.rate_box{
		max-width:700px;
		background-color:'.$box_color.';
		color:#ffffff;
		margin:10px;
		-webkit-border-radius: 7px;
		-moz-border-radius: 7px;
		border-radius: 7px;
		padding:5px;
		direction: ltr;

	}
	.rating {
	  unicode-bidi: bidi-override;
	  direction: rtl;
	  
	  
	}
	.link_wp{
		
		color:#EDAE42 !important
	}
	.rating > span {
	  display: inline-block;
	  position: relative;
	  width: 1.1em;
	  font-size:22px;
	}
	.rating > span:hover:before,
	.rating > span:hover ~ span:before {
	   content: "\2605";
	   position: absolute;
	   color:yellow;
	}
	</style>';
	
	$ret .= '<div id="rate_box" class="row rate_box">
<div class="col-md-8">
<p>
<strong>Do you like this plugin?</strong><br /> Please take a few seconds to <a class="link_wp" href="'.$plugin_url.'" target="_blank">rate it on WordPress.org!</a></p>
</div>
<div class="col-md-4">
<div class="rating">';

	for($r=1; $r<=5; $r++)
	{
		
		$ret .= '<span onclick="window.open(\''.$plugin_url.'\',\'_blank\')">☆</span>';
	}

$ret .= '</div>
</div>
</div>';
return $ret;
}
//---------------------------------------------------------------------------------------------
/* Get size information for all currently-registered image sizes.
 * @global $_wp_additional_image_sizes
 * @uses   get_intermediate_image_sizes()
 * @return array $sizes Data for all currently-registered image sizes.*/
//---------------------------------------------------------------------------------------------
function wccp_pro_get_image_sizes() {
	global $_wp_additional_image_sizes;

	$sizes = array();

	foreach ( get_intermediate_image_sizes() as $_size ) {
		if ( in_array( $_size, array('thumbnail', 'medium', 'medium_large', 'large') ) ) {
			$sizes[ $_size ]['width']  = get_option( "{$_size}_size_w" );
			$sizes[ $_size ]['height'] = get_option( "{$_size}_size_h" );
			$sizes[ $_size ]['crop']   = (bool) get_option( "{$_size}_crop" );
		} elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {
			$sizes[ $_size ] = array(
				'width'  => $_wp_additional_image_sizes[ $_size ]['width'],
				'height' => $_wp_additional_image_sizes[ $_size ]['height'],
				'crop'   => $_wp_additional_image_sizes[ $_size ]['crop'],
			);
		}
	}

	return $sizes;
}

//---------------------------------------------------------------------------------------------
/* Get size information for a specific registered image size.
 * @uses   wccp_pro_get_image_sizes()
 * @param  string $size The image size for which to retrieve data.
 * @return bool|array $size Size data about an image size or false if the size doesn't exist.*/
 //---------------------------------------------------------------------------------------------
function get_image_size( $size ) {
	$sizes = wccp_pro_get_image_sizes();

	if ( isset( $sizes[ $size ] ) ) {
		return $sizes[ $size ];
	}

	return false;
}
//---------------------------------------------------------------------------------------------
//Hotlinking
//---------------------------------------------------------------------------------------------
if(isset( $_POST['Save_settings'] ))
{
	if($_POST['hotlinking_rule'] == "Watermark" || $_POST['mysite_rule'] == "Watermark")
	{
		wccp_pro_modify_htaccess();
	}
	if($_POST['hotlinking_rule'] == "No Action" && $_POST['mysite_rule'] == "No Action")
	{
		wccp_pro_clear_htaccess();
	}
}
if ( isset( $_POST['Restore_defaults'] ) ) 
{
	wccp_pro_modify_htaccess();
	
	$wccpadminurl = get_admin_url();
	
	$settings_url = $wccpadminurl.'options-general.php?page=wccp-options-pro';
	
	header("Location: ".$settings_url);
}
?>

