<?php
/**
 * A unique identifier is defined to store the options in the database and reference them from the theme.
 * By default it uses the theme name, in lowercase and without spaces, but this can be changed if needed.
 * If the identifier changes, it'll appear as if the options have been reset.
 */

function optionsframework_option_name() {

	// This gets the theme name from the stylesheet
	$themename = wp_get_theme();
	$themename = preg_replace("/\W/", "_", strtolower($themename) );

	$optionsframework_settings = get_option( 'optionsframework' );
	$optionsframework_settings['id'] = $themename;
	update_option( 'optionsframework', $optionsframework_settings );
}

/**
 * Defines an array of options that will be used to generate the settings page and be saved in the database.
 * When creating the 'id' fields, make sure to use all lowercase and no spaces.
 *
 * If you are making your theme translatable, you should replace 'outset'
 * with the actual text domain for your theme.  Read more:
 * http://codex.wordpress.org/Function_Reference/load_theme_textdomain
 */

function optionsframework_options() {

	$options[] = array(
		'name' => __('Getting Started', 'outset'),
		'type' => 'heading');

	$options[] = array(
		'desc' => sprintf(
				'<p style="color: #FF0000">%s</p><p>Step 1. %s</p><p>Step 2. %s</p><p>Step 3. %s</p><p>Step 4. %s</p>',
				sprintf(
					__( 'Front Page and Blog Page', 'outset' )
				),
				__( 'Create two blank pages from your dashboard. Name them "Home" and "Blog" respectively. Make sure, the pages are blank. Publish them.', 'outset' ),
				__( 'Now, under WordPress dashboard, click on Settings. Then, click on Reading. Under Front Page Displays, click on A Static Page. From the dropdown, set the newly created "Home" page as Front Page and "Blog" page as Posts Page.', 'outset' ),
				__( 'Your page "Home" will now show default front page content with a carousel and call-to-action sections.', 'outset' ),
				__( 'Your page "Blog" will now show your recent posts. You can change the number of posts from the Reading Settings page.', 'outset' )
			),
		'type' => 'info');




	$options[] = array(
		'name' => __('Basic Settings', 'outset'),
		'type' => 'heading');

	//Logo
	$options[] = array(
        'name' => __('Upload a Logo', 'outset'),
        'desc' => __('Upload a logo to your theme, size must be 150px by 50px.', 'outset'),
        'id' => 'logo_uploader',
        'type' => 'upload');

	//Favicon        
    $options[] = array(
	    'name' => __('Upload a Favicon', 'outset'),
	    'desc' => __('Upload a favicon to your theme, size must be 16px by 16px.', 'outset'),
	    'id' => 'favicon_uploader',
	    'type' => 'upload');

    //Footer text
    $options[] = array(
		'name' => __('Custom Footer', 'outset'),
	    'desc' => __('Leave blank to restore to default.', 'outset'),
		'id' => 'footer_text',
		'type' => 'textarea');




	$options[] = array(
		'name' => __('Navigation', 'outset'),
		'type' => 'heading');

	//Main Navbar Color
    $options[] = array(
		'name' => __('Main Navbar Color', 'outset'),
		'desc' => __('Change the color of the main Navigation bar.', 'outset'),
		'id' => 'navbar_color',
		'std' => '#1e73be',
		'type' => 'color');

	//Navbar Dropdown Color
    $options[] = array(
		'name' => __('Navbar Dropdown Color', 'outset'),
	    'desc' => __('Change the Navigation Dropdown color.', 'outset'),
		'id' => 'dropdown_color',
		'std' => '#1e73be',
		'type' => 'color');

	//Navbar Dropdown Hover Color
    $options[] = array(
		'name' => __('Navbar Dropdown Hover Color', 'outset'),
	    'desc' => __('Change the color of elements in the Navigation Dropdown on hover.', 'outset'),
		'id' => 'dropdownhover_color',
		'std' => '#000000',
		'type' => 'color');




	$options[] = array(
		'name' => __('Typography', 'outset'),
		'type' => 'heading');

    //OS and Google Fonts Variable
	$font_faces = array(
		'Arial, sans-serif' => 'Arial',
        'Droid Serif, serif' => 'Droid Serif',
		'Garamond, "Hoefler Text", Times New Roman, Times, serif' => 'Garamond',
		'Lato, sans-serif' => 'Lato',
        'Lobster, cursive' => 'Lobster',
        'Open Sans, sans-serif' => 'Open Sans',
        'Oswald, sans-serif' => 'Oswald',
        'PT Sans, sans-serif' => 'PT Sans',
        'Roboto, sans-serif' => 'Roboto',
		'Source Sans Pro, sans-serif' => 'Source Sans Pro',
		'Tahoma, Geneva, sans-serif' => 'Tahoma',
		'Titillium Web, sans-serif' => 'Titillium Web',
		'Trebuchet MS, sans-serif' => 'Trebuchet MS',
        'Ubuntu, sans-serif' => 'Ubuntu',
		'Verdana, sans-serif' => 'Verdana');

	//Sitewide Font Style
	$options[] = array(
		'name' => __('Default Font Style', 'outset'),
	    'desc' => __('Choose a Default Font Style for your website.', 'outset'),
		'id' => 'global_font_style',
		'type' => 'select',
		'std' => 'Open Sans, sans-serif',
		'options' => $font_faces );

	//Paragraph Font Sizes Variable
	$paragraph_size = array('10px' => '10px', '12px' => '12px','14px' => '14px','16px' => '16px','18px' => '18px','20px' => '20px','22px' => '22px','24px' => '24px','26px' => '26px','28px' => '28px', '30px' => '30px');
	
	//Paragraphs Font Size
	$options[] = array(
		'name' => __('Paragraph Font Size', 'outset'),
	    'desc' => __('Choose the Paragraph font size. All &#60;p&#62; tags will be changed.', 'outset'),
		'id' => 'paragraph_font_size',
		'type' => 'select',
		'std' => '18px',
		'options' => $paragraph_size );

	//H2 Font Sizes Variable
	$title_size = array('30px' => '30px', '32px' => '32px','34px' => '34px','36px' => '36px','38px' => '38px','40px' => '40px','42px' => '42px','44px' => '44px','46px' => '46px','48px' => '48px', '50px' => '50px', '52px' => '52px','54px' => '54px','56px' => '56px','58px' => '58px', '60px' => '60px');

	//Page & Post Title Font Size
	$options[] = array(
		'name' => __('Page and Post Titles Font Size', 'outset'),
	    'desc' => __('Choose the Title font size. All &#60;h2&#62; tags will be changed.', 'outset'),
		'id' => 'title_font_size',
		'type' => 'select',
		'std' => '36px',
		'options' => $title_size );




	$options[] = array(
		'name' => __('Business Page', 'outset'),
		'type' => 'heading');

	$options[] = array(
		'desc' => sprintf(
				'<p style="color: #FF0000">%s</p><ul><li>-- %s</li><li>-- %s</li></ul>',
				sprintf(
					__( 'IMPORTANT', 'outset' )
				),
				__( 'To remove the Front Page and show your latest posts, delete the front-page.php file from the theme directory.', 'outset' ),
				__( 'To add Slider Images and Captions, click on the Slider Options tab.', 'outset' )
			),
		'type' => 'info');

	$options[] = array(
		'name' => __('Featurette Small 1', 'outset'),
	    'desc' => __('Recommended image size is 250px by 250px.', 'outset'),
	    'id' => 'featurette1_uploader',
	    'type' => 'upload');

    $options[] = array(
		'desc' => __('A small title for the featurette. Keep it small and simple.', 'outset'),
		'id' => 'featurette1_heading',
		'type' => 'text');

    $options[] = array(
		'desc' => __('Enter a small description for the page or post you are linking to.', 'outset'),
		'id' => 'featurette1_text',
		'type' => 'textarea');

    $options[] = array(
		'desc' => __('Add the URL you would like to link to. Must be in full like http://www.example.com', 'outset'),
		'id' => 'featurette1_url',
		'type' => 'text');

	$options[] = array(
		'name' => __('Featurette Small 2', 'outset'),
	    'desc' => __('Recommended image size is 250px by 250px.', 'outset'),
	    'id' => 'featurette2_uploader',
	    'type' => 'upload');

    $options[] = array(
		'desc' => __('A small title for the featurette. Keep it small and simple.', 'outset'),
		'id' => 'featurette2_heading',
		'type' => 'text');

    $options[] = array(
		'desc' => __('Enter a small description for the page or post you are linking to.', 'outset'),
		'id' => 'featurette2_text',
		'type' => 'textarea');

    $options[] = array(
		'desc' => __('Add the URL you would like to link to. Must be in full like http://www.example.com', 'outset'),
		'id' => 'featurette2_url',
		'type' => 'text');

	$options[] = array(
		'name' => __('Featurette Small 3', 'outset'),
	    'desc' => __('Recommended image size is 250px by 250px.', 'outset'),
	    'id' => 'featurette3_uploader',
	    'type' => 'upload');

    $options[] = array(
		'desc' => __('A small title for the featurette. Keep it small and simple.', 'outset'),
		'id' => 'featurette3_heading',
		'type' => 'text');

    $options[] = array(
		'desc' => __('Enter a small description for the page or post you are linking to.', 'outset'),
		'id' => 'featurette3_text',
		'type' => 'textarea');

    $options[] = array(
		'desc' => __('Add the URL you would like to link to. Must be in full like http://www.example.com', 'outset'),
		'id' => 'featurette3_url',
		'type' => 'text');

	$options[] = array(
		'name' => __('Featurette Big 1', 'outset'),
	    'desc' => __('Recommended image size is 350px by 350px.', 'outset'),
	    'id' => 'featurette4_uploader',
	    'type' => 'upload');

    $options[] = array(
		'desc' => __('A small title for the featurette. Keep it small and simple.', 'outset'),
		'id' => 'featurette4_heading',
		'type' => 'text');

    $options[] = array(
		'desc' => __('Enter a small description for the page or post you are linking to.', 'outset'),
		'id' => 'featurette4_text',
		'type' => 'textarea');

    $options[] = array(
		'desc' => __('Add the URL you would like to link to. Must be in full like http://www.example.com', 'outset'),
		'id' => 'featurette4_url',
		'type' => 'text');

    $options[] = array(
		'name' => __('Featurette Big 2', 'outset'),
	    'desc' => __('Recommended image size is 350px by 350px.', 'outset'),
	    'id' => 'featurette5_uploader',
	    'type' => 'upload');

    $options[] = array(
		'desc' => __('A small title for the featurette. Keep it small and simple.', 'outset'),
		'id' => 'featurette5_heading',
		'type' => 'text');

    $options[] = array(
		'desc' => __('Enter a small description for the page or post you are linking to.', 'outset'),
		'id' => 'featurette5_text',
		'type' => 'textarea');

    $options[] = array(
		'desc' => __('Add the URL you would like to link to. Must be in full like http://www.example.com', 'outset'),
		'id' => 'featurette5_url',
		'type' => 'text');




	$options[] = array(
		'name' => __('Slider Options', 'outset'),
		'type' => 'heading');

	//Logo
	$options[] = array(
		'name' => __('First Slide', 'outset'),
		'desc' => __('Caption for your slide. Recommended limit is 30 characters', 'outset'),
		'id' => 'slide1_text',
		'type' => 'text');

    $options[] = array(
		'desc' => __('Add the URL you would like to link to. Must be in full like http://www.example.com', 'outset'),
		'id' => 'slide1_url',
		'type' => 'text');

	$options[] = array(
        'desc' => __('Size must be 1170px by 500px.', 'outset'),
        'id' => 'slide1_uploader',
        'type' => 'upload');

	$options[] = array(
		'name' => __('Second Slide', 'outset'),
		'desc' => __('Caption for your slide. Recommended limit is 30 characters', 'outset'),
		'id' => 'slide2_text',
		'type' => 'text');

    $options[] = array(
		'desc' => __('Add the URL you would like to link to. Must be in full like http://www.example.com', 'outset'),
		'id' => 'slide2_url',
		'type' => 'text');

	$options[] = array(
        'desc' => __('Size must be 1170px by 500px.', 'outset'),
        'id' => 'slide2_uploader',
        'type' => 'upload');

	$options[] = array(
		'name' => __('Third Slide', 'outset'),
		'desc' => __('Caption for your slide. Recommended limit is 30 characters', 'outset'),
		'id' => 'slide3_text',
		'type' => 'text');

    $options[] = array(
		'desc' => __('Add the URL you would like to link to. Must be in full like http://www.example.com', 'outset'),
		'id' => 'slide3_url',
		'type' => 'text');

	$options[] = array(
        'desc' => __('Size must be 1170px by 500px.', 'outset'),
        'id' => 'slide3_uploader',
        'type' => 'upload');

	$options[] = array(
		'name' => __('Fourth Slide', 'outset'),
		'desc' => __('Caption for your slide. Recommended limit is 30 characters', 'outset'),
		'id' => 'slide4_text',
		'type' => 'text');

    $options[] = array(
		'desc' => __('Add the URL you would like to link to. Must be in full like http://www.example.com', 'outset'),
		'id' => 'slide4_url',
		'type' => 'text');

	$options[] = array(
        'desc' => __('Size must be 1170px by 500px.', 'outset'),
        'id' => 'slide4_uploader',
        'type' => 'upload');

	$options[] = array(
		'name' => __('Fifth Slide', 'outset'),
		'desc' => __('Caption for your slide. Recommended limit is 30 characters', 'outset'),
		'id' => 'slide5_text',
		'type' => 'text');

    $options[] = array(
		'desc' => __('Add the URL you would like to link to. Must be in full like http://www.example.com', 'outset'),
		'id' => 'slide5_url',
		'type' => 'text');
    
	$options[] = array(
        'desc' => __('Size must be 1170px by 500px.', 'outset'),
        'id' => 'slide5_uploader',
        'type' => 'upload');



	$options[] = array(
		'name' => __('More', 'outset'),
		'type' => 'heading');

	$options[] = array(
		'name' => __('Theme Support', 'outset'),
		'desc' => sprintf(
				'<p>%s</p>',
				sprintf(
					__( 'For Support, you can check our <a href="%s">theme FAQs</a>. If the FAQs do not resolve your problem, post your question in the Wordpress forums.', 'outset'),
					esc_url( 'http://novicepost.com/support-outset-theme' ))),
		'type' => 'info');

	$options[] = array(
		'name' => __('How you can help', 'outset'),
		'desc' => sprintf(
				'<p>%s</p>',
				sprintf(
					__( 'It has taken hours of work to make this theme simple and customizable. You can expect lots of features in the coming updates. This theme and all themes I build in the future will always be FREE! You can encourage theme development by making a <a href="%s">small donation</a>.', 'outset'),
					esc_url( 'http://novicepost.com/help-us' )
				)
			),
		'type' => 'info'
	);





/* Custom Options. Add them above and define them in options-functions.php
========================================================================== */

/*
	$options[] = array(
		'name' => __('Input Text Mini', 'outset'),
		'desc' => __('A mini text input field.', 'outset'),
		'id' => 'example_text_mini',
		'std' => 'Default',
		'class' => 'mini',
		'type' => 'text');

	$options[] = array(
		'name' => __('Input Text', 'outset'),
		'desc' => __('A text input field.', 'outset'),
		'id' => 'example_text',
		'std' => 'Default Value',
		'type' => 'text');

	$options[] = array(
		'name' => __('Textarea', 'outset'),
		'desc' => __('Textarea description.', 'outset'),
		'id' => 'example_textarea',
		'std' => 'Default Text',
		'type' => 'textarea');

	$options[] = array(
		'name' => __('Input Select Small', 'outset'),
		'desc' => __('Small Select Box.', 'outset'),
		'id' => 'example_select',
		'std' => 'three',
		'type' => 'select',
		'class' => 'mini', //mini, tiny, small
		'options' => $test_array);

	$options[] = array(
		'name' => __('Input Select Wide', 'outset'),
		'desc' => __('A wider select box.', 'outset'),
		'id' => 'example_select_wide',
		'std' => 'two',
		'type' => 'select',
		'options' => $test_array);

	if ( $options_categories ) {
	$options[] = array(
		'name' => __('Select a Category', 'outset'),
		'desc' => __('Passed an array of categories with cat_ID and cat_name', 'outset'),
		'id' => 'example_select_categories',
		'type' => 'select',
		'options' => $options_categories);
	}

	if ( $options_tags ) {
	$options[] = array(
		'name' => __('Select a Tag', 'options_check'),
		'desc' => __('Passed an array of tags with term_id and term_name', 'options_check'),
		'id' => 'example_select_tags',
		'type' => 'select',
		'options' => $options_tags);
	}

	$options[] = array(
		'name' => __('Select a Page', 'outset'),
		'desc' => __('Passed an pages with ID and post_title', 'outset'),
		'id' => 'example_select_pages',
		'type' => 'select',
		'options' => $options_pages);

	$options[] = array(
		'name' => __('Input Radio (one)', 'outset'),
		'desc' => __('Radio select with default options "one".', 'outset'),
		'id' => 'example_radio',
		'std' => 'one',
		'type' => 'radio',
		'options' => $test_array);

	$options[] = array(
		'name' => __('Example Info', 'outset'),
		'desc' => __('This is just some example information you can put in the panel.', 'outset'),
		'type' => 'info');

	$options[] = array(
		'name' => __('Input Checkbox', 'outset'),
		'desc' => __('Example checkbox, defaults to true.', 'outset'),
		'id' => 'example_checkbox',
		'std' => '1',
		'type' => 'checkbox');

	$options[] = array(
		'name' => __('Advanced Settings', 'outset'),
		'type' => 'heading');

	$options[] = array(
		'name' => __('Check to Show a Hidden Text Input', 'outset'),
		'desc' => __('Click here and see what happens.', 'outset'),
		'id' => 'example_showhidden',
		'type' => 'checkbox');

	$options[] = array(
		'name' => __('Hidden Text Input', 'outset'),
		'desc' => __('This option is hidden unless activated by a checkbox click.', 'outset'),
		'id' => 'example_text_hidden',
		'std' => 'Hello',
		'class' => 'hidden',
		'type' => 'text');

	$options[] = array(
		'name' => __('Uploader Test', 'outset'),
		'desc' => __('This creates a full size uploader that previews the image.', 'outset'),
		'id' => 'example_uploader',
		'type' => 'upload');

	$options[] = array(
		'name' => "Example Image Selector",
		'desc' => "Images for layout.",
		'id' => "example_images",
		'std' => "2c-l-fixed",
		'type' => "images",
		'options' => array(
			'1col-fixed' => $imagepath . '1col.png',
			'2c-l-fixed' => $imagepath . '2cl.png',
			'2c-r-fixed' => $imagepath . '2cr.png')
	);

	$options[] = array(
		'name' =>  __('Example Background', 'outset'),
		'desc' => __('Change the background CSS.', 'outset'),
		'id' => 'example_background',
		'std' => $background_defaults,
		'type' => 'background' );

	$options[] = array(
		'name' => __('Multicheck', 'outset'),
		'desc' => __('Multicheck description.', 'outset'),
		'id' => 'example_multicheck',
		'std' => $multicheck_defaults, // These items get checked by default
		'type' => 'multicheck',
		'options' => $multicheck_array);

	$options[] = array(
		'name' => __('Colorpicker', 'outset'),
		'desc' => __('No color selected by default.', 'outset'),
		'id' => 'example_colorpicker',
		'std' => '',
		'type' => 'color' );

	$options[] = array( 'name' => __('Typography', 'outset'),
		'desc' => __('Example typography.', 'outset'),
		'id' => "example_typography",
		'std' => $typography_defaults,
		'type' => 'typography' );

	$options[] = array(
		'name' => __('Custom Typography', 'outset'),
		'desc' => __('Custom typography options.', 'outset'),
		'id' => "custom_typography",
		'std' => $typography_defaults,
		'type' => 'typography',
		'options' => $typography_options );
	
	$options[] = array(
		'name' => __('Text Editor', 'outset'),
		'type' => 'heading' );
*/

	/**
	 * For $settings options see:
	 * http://codex.wordpress.org/Function_Reference/wp_editor
	 *
	 * 'media_buttons' are not supported as there is no post to attach items to
	 * 'textarea_name' is set by the 'id' you choose
	 */

	$wp_editor_settings = array(
		'wpautop' => true, // Default
		'textarea_rows' => 5,
		'tinymce' => array( 'plugins' => 'wordpress' )
	);

	return $options;
}