options = $wdwt_options;
}
/**
*
* return value of parameter for post, page or index page
* first looks for parameter in meta, then if not found there, in options
* @param $param_name 'menu_bg_color' or '[colors][menu][bg_color]'
*/
public function get_param($param_name, $meta_array = array(), $default =''){
$value=false;
$options_array = $this->options;
preg_match_all("/\[([^\]]*)\]/", $param_name, $matches);
/*if param name is string*/
if(empty($matches[1])){
if(isset($meta_array[$param_name])){
$value = $meta_array[$param_name];
}
elseif(isset($options_array[$param_name])){
$value = $options_array[$param_name];
}
else{
$value = $default;
}
return $value;
}
else{/*if param name is array*/
$in_options = false;
$in_meta = false;
$value = $meta_array;
foreach($matches[1] as $subparam)
{
if(isset($value[$subparam])){
$value = $value[$subparam];
$in_meta = true;
}
else{
$in_meta = false;
break;
}
}
if($in_meta){
/*param value is found in meta*/
return $value;
}
$value = $options_array;
foreach($matches[1] as $subparam)
{
if(isset($value[$subparam])){
$value = $value[$subparam];
$in_options = true;
}
else{
$in_options = false;
break;
}
}
if($in_options){
/*param value is found in options*/
return $value;
}
else{
return $default;
}
}
return $default;
}
/**
* FRONT END INTEGRATION
*/
public function integration_head(){
$integrate_header_enable = $this->get_param('integrate_header_enable');
$integration_head = stripslashes($this->get_param('integration_head'));
if($integrate_header_enable){
echo $integration_head;
}
}
public function integration_body(){
$integrate_body_enable = $this->get_param('integrate_body_enable');
$integration_body = stripslashes($this->get_param('integration_body'));
if($integrate_body_enable){
echo $integration_body;
}
}
public function integration_top()
{
$integrate_singletop_enable = $this->get_param('integrate_singletop_enable', false);
$integration_single_top = stripslashes($this->get_param('integration_single_top', false));
if($integrate_singletop_enable)
echo $integration_single_top;
}
public function integration_bottom()
{
$integrate_singlebottom_enable = $this->get_param('integrate_singlebottom_enable', false);
$integration_single_bottom = stripslashes($this->get_param('integration_single_bottom', false));
if($integrate_singlebottom_enable)
echo $integration_single_bottom;
}
public function head_advertisment(){
$integration_head_adsense_type = $this->get_param('integration_head_adsense_type');
$integration_head_adsense = stripslashes($this->get_param('integration_head_adsense'));
$integration_head_advertisment_url = esc_url($this->get_param('integration_head_advertisment_url'));
$integration_head_advertisment_picture = esc_url($this->get_param('integration_head_advertisment_picture'));
$integration_head_advertisment_alt = esc_attr(stripslashes($this->get_param('integration_head_advertisment_alt')));
$integration_head_advertisment_title = esc_attr(stripslashes($this->get_param('integration_head_advertisment_title')));
switch($integration_head_adsense_type){
case 'adsens':
?>

get_param('integration_bottom_adsense_type');
$integration_bottom_adsense = stripslashes($this->get_param('integration_bottom_adsense'));
$integration_bottom_advertisment_url = esc_url($this->get_param('integration_bottom_advertisment_url'));
$integration_bottom_advertisment_picture = esc_url($this->get_param('integration_bottom_advertisment_picture'));
$integration_bottom_advertisment_alt = esc_attr(stripslashes($this->get_param('integration_bottom_advertisment_alt')));
$integration_bottom_advertisment_title = esc_attr(stripslashes($this->get_param('integration_bottom_advertisment_title')));
switch($integration_bottom_adsense_type){
case 'adsens': ?>
';
$this->typography_fonts();
$this->typography_headers();
$this->typography_primary();
$this->typography_secondary();
$this->typography_inputs();
echo '';
}
protected function typography_fonts(){
?>
@font-face {
font-family: "OpenSans";
src: url("/inc/fonts/OpenSans-Bold.ttf");
font-weight:bold;
}
@font-face {
font-family: "OpenSans";
src: url("/inc/fonts/OpenSans-BoldItalic.ttf");
font-weight:bold;
font-style:italic;
}
@font-face {
font-family: "OpenSans";
src: url("/inc/fonts/OpenSans-ExtraBold.ttf");
font-weight:bolder;
}
@font-face {
font-family: "OpenSans";
src: url("/inc/fonts/OpenSans-ExtraBoldItalic.ttf");
font-weight:bolder;
font-style:italic;
}
@font-face {
font-family: "OpenSans";
src: url("/inc/fonts/OpenSans-Italic.ttf");
font-style:italic;
}
@font-face {
font-family: "OpenSans";
src: url("/inc/fonts/OpenSans-Light.ttf");
font-weight:lighter;
}
@font-face {
font-family: "OpenSans";
src: url("/inc/fonts/OpenSans-LightItalic.ttf");
font-weight:lighter;
font-style:italic;
}
@font-face {
font-family: "OpenSans";
src: url("/inc/fonts/OpenSans-Regular.ttf");
}
@font-face {
font-family: "OpenSans";
src: url("/inc/fonts/OpenSans-Semibold.ttf");
font-weight:500;
}
@font-face {
font-family: "OpenSans";
src: url("/inc/fonts/OpenSans-SemiboldItalic.ttf");
font-weight:500;
font-style:italic;
}
get_param('text_headers_font');
$text_headers_weight = $this->get_param('text_headers_weight');
$text_headers_kern = $this->get_param('text_headers_kern');
$text_headers_transform = $this->get_param('text_headers_transform');
$text_headers_variant = $this->get_param('text_headers_variant');
$text_headers_style = $this->get_param('text_headers_style');
?>
h1, h2, h3, h4, h5, h6 {
font-family: ;
font-weight: ;
letter-spacing: ;
text-transform: ;
font-variant: ;
font-style: ;
}
get_param('text_secondary_font');
$text_secondary_weight = $this->get_param('text_secondary_weight');
$text_secondary_kern = $this->get_param('text_secondary_kern');
$text_secondary_transform = $this->get_param('text_secondary_transform');
$text_secondary_variant = $this->get_param('text_secondary_variant');
$text_secondary_style = $this->get_param('text_secondary_style');
?>
.nav, .metabar, .subtext, .subhead, .widget-title, .reply a, .editpage, #page .wp-pagenavi, .post-edit-link, #wp-calendar caption, #wp-calendar thead th, .soapbox-links a, .fancybox, .standard-form .admin-links, .ftitle small {
font-family: ;
font-weight: ;
letter-spacing: ;
text-transform: ;
font-variant: ;
font-style: ;
}
get_param('text_primary_font');
$text_primary_weight = $this->get_param('text_primary_weight');
$text_primary_kern = $this->get_param('text_primary_kern');
$text_primary_transform = $this->get_param('text_primary_transform');
$text_primary_variant = $this->get_param('text_primary_variant');
$text_primary_style = $this->get_param('text_primary_style');
?>
body {
font-family: ;
font-weight: ;
letter-spacing: ;
text-transform: ;
font-variant: ;
font-style: ;
}
get_param('text_inputs_font');
$text_inputs_weight = $this->get_param('text_inputs_weight');
$text_inputs_kern = $this->get_param('text_inputs_kern');
$text_inputs_transform = $this->get_param('text_inputs_transform');
$text_inputs_variant = $this->get_param('text_inputs_variant');
$text_inputs_style = $this->get_param('text_inputs_style');
?>
input, textarea {
font-family: ;
font-weight: ;
letter-spacing: ;
text-transform: ;
font-variant: ;
font-style: ;
}
get_param('favicon_img')));
$favicon_enable = $this->get_param('favicon_enable');
if($favicon_enable && $favicon_img) { ?>
get_param('custom_css_enable');
$custom_css_text = esc_html(stripslashes($this->get_param('custom_css_text')));
if($custom_css_enable){
echo "";
}
}
/**
* Prints style for menu background image
*/
public function menu_bg_img(){
$menu_bg_img_enable = $this->get_param('menu_bg_img_enable');
$menu_bg_img = esc_url($this->get_param('menu_bg_img'));
if($menu_bg_img_enable){ ?>
1)
$opacity = 1.0;
$output = 'rgba('.implode(",",$rgb).','.$opacity.')';
} else {
$output = 'rgb('.implode(",",$rgb).')';
}
//Return rgb(a) color string
return $output;
}
/**
* Modify output color,
* make color darker
*/
protected function darker($color,$pracent){
$new_color=$color;
if(!(strlen($new_color==6) || strlen($new_color)==7))
{
return $color;
}
$color_vandakanishov=strpos($new_color,'#');
if($color_vandakanishov == false) {
$new_color= str_replace('#','',$new_color);
}
$color_part_1=substr($new_color, 0, 2);
$color_part_2=substr($new_color, 2, 2);
$color_part_3=substr($new_color, 4, 2);
$color_part_1=dechex( (int) (hexdec( $color_part_1 ) - (hexdec( $color_part_1 )* $pracent / 100 )));
$color_part_2=dechex( (int) (hexdec( $color_part_2) - (( ( hexdec( $color_part_2 ) ) ) * $pracent / 100 )));
$color_part_3=dechex( (int) (hexdec( $color_part_3 ) - (( ( hexdec( $color_part_3 ) ) ) * $pracent / 100 )));
if(strlen($color_part_1)<2) $color_part_1="0".$color_part_1;
if(strlen($color_part_2)<2) $color_part_2="0".$color_part_2;
if(strlen($color_part_3)<2) $color_part_3="0".$color_part_3;
$new_color=$color_part_1.$color_part_2.$color_part_3;
if($color_vandakanishov == false){
return $new_color;
}
else{
return '#'.$new_color;
}
}
/**
* Modify output color,
* make color lighter
*/
protected function ligther($color,$pracent=15){
$new_color=$color;
if(!(strlen($new_color==6) || strlen($new_color)==7))
{
return $color;
}
$color_vandakanishov=strpos($new_color,'#');
if($color_vandakanishov == false) {
$new_color= str_replace('#','',$new_color);
}
$color_part_1=substr($new_color, 0, 2);
$color_part_2=substr($new_color, 2, 2);
$color_part_3=substr($new_color, 4, 2);
$color_part_1=dechex( (int) (hexdec( $color_part_1 ) + (( 255-( hexdec( $color_part_1 ) ) ) * $pracent / 100 )));
$color_part_2=dechex( (int) (hexdec( $color_part_2) + (( 255-( hexdec( $color_part_2 ) ) ) * $pracent / 100 )));
$color_part_3=dechex( (int) (hexdec( $color_part_3 ) + (( 255-( hexdec( $color_part_3 ) ) ) * $pracent / 100 )));
$new_color=$color_part_1.$color_part_2.$color_part_3;
if($color_vandakanishov == false){
return $new_color;
}
else{
return '#'.$new_color;
}
}
/**
* return inverted color
*/
protected function invert($color)
{
//get red, green and blue
$r = substr($color, 0, 2);
$g = substr($color, 2, 2);
$b = substr($color, 4, 2);
//revert them, they are decimal now
$r = 0xff-hexdec($r);
$g = 0xff-hexdec($g);
$b = 0xff-hexdec($b);
//now convert them to hex and return.
return dechex($r).dechex($g).dechex($b);
}
/**
* Prints style for menu background image
*/
public function footer_text(){
$footer_text_enable = $this->get_param('footer_text_enable');
$footer_text = stripslashes($this->get_param('footer_text'));
if($footer_text_enable) {
echo stripslashes($footer_text);
}
}
protected function negativeColor($color)
{
//get red, green and blue
$r = substr($color, 0, 2);
$g = substr($color, 2, 2);
$b = substr($color, 4, 2);
//revert them, they are decimal now
$r = 0xff-hexdec($r);
$g = 0xff-hexdec($g);
$b = 0xff-hexdec($b);
//now convert them to hex and return.
return dechex($r).dechex($g).dechex($b);
}
/***********************************/
/* REQUERD FUNCTION FOR COLORS */
/***********************************/
protected function ligthest_brigths($color,$pracent=15){
$new_color=$color;
if(!(strlen($new_color==6) || strlen($new_color)==7))
{
return $color;
}
$color_vandakanishov=strpos($new_color,'#');
if($color_vandakanishov == false) {
$new_color= str_replace('#','',$new_color);
}
$color_part_1=substr($new_color, 0, 2);
$color_part_2=substr($new_color, 2, 2);
$color_part_3=substr($new_color, 4, 2);
$color_part_1=dechex( (int) (hexdec( $color_part_1 ) + (( 255-( hexdec( $color_part_1 ) ) ) * $pracent / 100 )));
$color_part_2=dechex( (int) (hexdec( $color_part_2) + (( 255-( hexdec( $color_part_2 ) ) ) * $pracent / 100 )));
$color_part_3=dechex( (int) (hexdec( $color_part_3 ) + (( 255-( hexdec( $color_part_3 ) ) ) * $pracent / 100 )));
$new_color=$color_part_1.$color_part_2.$color_part_3;
if($color_vandakanishov == false){
return $new_color;
}
else{
return '#'.$new_color;
}
}
protected function darkest_brigths($color,$pracent){
$new_color=$color;
if(!(strlen($new_color==6) || strlen($new_color)==7))
{
return $color;
}
$color_vandakanishov=strpos($new_color,'#');
if($color_vandakanishov == false) {
$new_color= str_replace('#','',$new_color);
}
$color_part_1=substr($new_color, 0, 2);
$color_part_2=substr($new_color, 2, 2);
$color_part_3=substr($new_color, 4, 2);
$color_part_1=dechex( (int) (hexdec( $color_part_1 ) - (hexdec( $color_part_1 )* $pracent / 100 )));
$color_part_2=dechex( (int) (hexdec( $color_part_2) - (( ( hexdec( $color_part_2 ) ) ) * $pracent / 100 )));
$color_part_3=dechex( (int) (hexdec( $color_part_3 ) - (( ( hexdec( $color_part_3 ) ) ) * $pracent / 100 )));
if(strlen($color_part_1)<2) $color_part_1="0".$color_part_1;
if(strlen($color_part_2)<2) $color_part_2="0".$color_part_2;
if(strlen($color_part_3)<2) $color_part_3="0".$color_part_3;
$new_color=$color_part_1.$color_part_2.$color_part_3;
if($color_vandakanishov == false){
return $new_color;
}
else{
return '#'.$new_color;
}
}
}