<?php
/**
 * @package Outset
 */


/* Helper function to get options set by the Options Framework plugin
======================================================================== */

if ( !function_exists( 'of_get_option' ) ) :
function of_get_option( $name, $default = false ) {

	$optionsframework_settings = get_option( 'optionsframework' );

	// Gets the unique option id
	$option_name = $optionsframework_settings['id'];

	if ( get_option($option_name) ) {
		$options = get_option($option_name);
	}

	if ( isset($options[$name]) ) {
		return $options[$name];
	} else {
		return $default;
	}
}
endif;




/* Navbar Menu Background Color
================================================== */

function navbar_head_css() {

		$output = '';

		if ( of_get_option( 'navbar_color' ) != "#1e73be") {
			$output .= ".navbar-inner {background-color:" . of_get_option('navbar_color') . "}\n";
		}

		// Output styles
		if ($output <> '') {
			$output = "<!-- Custom Styling -->\n<style type=\"text/css\">\n" . $output . "</style>\n";
			echo $output;
		}
}

add_action( 'wp_head', 'navbar_head_css' );




/* Dropdown Menu Background
================================================== */

function dropdown_head_css() {

		$output = '';

		if ( of_get_option( 'dropdown_color' ) != "#1e73be") {
			$output .= ".dropdown-menu {background-color:" . of_get_option('dropdown_color') . "}\n";
		}

		// Output styles
		if ($output <> '') {
			$output = "<!-- Custom Styling -->\n<style type=\"text/css\">\n" . $output . "</style>\n";
			echo $output;
		}
}

add_action( 'wp_head', 'dropdown_head_css' );




/* Dropdown Menu Hover Color
================================================== */

function dropdownhover_head_css() {

		$output = '';

		if ( of_get_option( 'dropdownhover_color' ) != "#000000") {
			$output .= ".dropdown-menu li:hover {background-color:" . of_get_option('dropdownhover_color') . "}\n";
		}

		// Output styles
		if ($output <> '') {
			$output = "<!-- Custom Styling -->\n<style type=\"text/css\">\n" . $output . "</style>\n";
			echo $output;
		}
}

add_action( 'wp_head', 'dropdownhover_head_css' );




/* Sitewide Font Style
================================================== */

function global_font_style() {

		$output = '';

		if ( of_get_option( 'global_font_style' )) {
			$output .= ".container {font-family:" . of_get_option('global_font_style') . "}\n";
		}

		// Output styles
		if ($output <> '') {
			$output = "<!-- Custom Styling -->\n<style type=\"text/css\">\n" . $output . "</style>\n";
			echo $output;
		}
}

add_action( 'wp_head', 'global_font_style' );




/* Paragraph Font Size
================================================== */

function paragraph_font_size() {

		$output = '';

		if ( of_get_option( 'paragraph_font_size' )) {
			$output .= "p {font-size:" . of_get_option('paragraph_font_size') . "}\n";
		}

		// Output styles
		if ($output <> '') {
			$output = "<!-- Custom Styling -->\n<style type=\"text/css\">\n" . $output . "</style>\n";
			echo $output;
		}
}

add_action( 'wp_head', 'paragraph_font_size' );




/* Post/Page Title Font Size
================================================== */

function h2_font_size() {

		$output = '';

		if ( of_get_option( 'title_font_size' )) {
			$output .= "h2 {font-size:" . of_get_option('title_font_size') . "}\n";
		}

		// Output styles
		if ($output <> '') {
			$output = "<!-- Custom Styling -->\n<style type=\"text/css\">\n" . $output . "</style>\n";
			echo $output;
		}
}

add_action( 'wp_head', 'h2_font_size' );




/* Slide Settings for Home Carousel
================================================== */


$slide1_text = of_get_option('slide1_text');
$slide2_text = of_get_option('slide2_text');
$slide3_text = of_get_option('slide3_text');
$slide4_text = of_get_option('slide4_text');
$slide5_text = of_get_option('slide5_text');

$slide1_url = of_get_option('slide1_url');
$slide2_url = of_get_option('slide2_url');
$slide3_url = of_get_option('slide3_url');
$slide4_url = of_get_option('slide4_url');
$slide5_url = of_get_option('slide5_url');

$slide1_uploader = of_get_option('slide1_uploader');
$slide2_uploader = of_get_option('slide2_uploader');
$slide3_uploader = of_get_option('slide3_uploader');
$slide4_uploader = of_get_option('slide4_uploader');
$slide5_uploader = of_get_option('slide5_uploader');




/* Front Page Featurette Sections
================================================== */

$featurette1_uploader = of_get_option('featurette1_uploader');
$featurette2_uploader = of_get_option('featurette2_uploader');
$featurette3_uploader = of_get_option('featurette3_uploader');
$featurette4_uploader = of_get_option('featurette4_uploader');
$featurette5_uploader = of_get_option('featurette5_uploader');

$featurette1_heading = of_get_option('featurette1_heading'); 
$featurette2_heading = of_get_option('featurette2_heading');
$featurette3_heading = of_get_option('featurette3_heading');
$featurette4_heading = of_get_option('featurette4_heading');
$featurette5_heading = of_get_option('featurette5_heading');

$featurette1_text = of_get_option('featurette1_text');
$featurette2_text = of_get_option('featurette2_text');
$featurette3_text = of_get_option('featurette3_text');
$featurette4_text = of_get_option('featurette4_text');
$featurette5_text = of_get_option('featurette5_text');

$featurette1_url = of_get_option('featurette1_url');
$featurette2_url = of_get_option('featurette2_url');
$featurette3_url = of_get_option('featurette3_url');
$featurette4_url = of_get_option('featurette4_url');
$featurette5_url = of_get_option('featurette5_url');