<?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 = get_option( 'stylesheet' );
	$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 'options_framework_theme'
 * with the actual text domain for your theme.  Read more:
 * http://codex.wordpress.org/Function_Reference/load_theme_textdomain
 */

function optionsframework_options() {

	// Test data
	$test_array = array(
		'one' => __('One', 'options_framework_theme'),
		'two' => __('Two', 'options_framework_theme'),
		'three' => __('Three', 'options_framework_theme'),
		'four' => __('Four', 'options_framework_theme'),
		'five' => __('Five', 'options_framework_theme')
	);

	// Multicheck Array
	$multicheck_array = array(
		'one' => __('French Toast', 'options_framework_theme'),
		'two' => __('Pancake', 'options_framework_theme'),
		'three' => __('Omelette', 'options_framework_theme'),
		'four' => __('Crepe', 'options_framework_theme'),
		'five' => __('Waffle', 'options_framework_theme')
	);

	// Multicheck Defaults
	$multicheck_defaults = array(
		'one' => '1',
		'five' => '1'
	);

	// Background Defaults
	$background_defaults = array(
		'color' => '',
		'image' => '',
		'repeat' => 'repeat',
		'position' => 'top center',
		'attachment'=>'scroll' );

	// Typography Defaults
	$typography_defaults = array(
		'size' => '15px',
		'face' => 'georgia',
		'style' => 'bold',
		'color' => '#bada55' );
		
	// Typography Options
	$typography_options = array(
		'sizes' => array( '6','12','14','16','20' ),
		'faces' => array( 'Helvetica Neue' => 'Helvetica Neue','Arial' => 'Arial' ),
		'styles' => array( 'normal' => 'Normal','bold' => 'Bold' ),
		'color' => false
	);

	// Pull all the categories into an array
	$options_categories = array();
	$options_categories_obj = get_categories();
	foreach ($options_categories_obj as $category) {
		$options_categories[$category->cat_ID] = $category->cat_name;
	}
	
	// Pull all tags into an array
	$options_tags = array();
	$options_tags_obj = get_tags();
	foreach ( $options_tags_obj as $tag ) {
		$options_tags[$tag->term_id] = $tag->name;
	}


	// Pull all the pages into an array
	$options_pages = array();
	$options_pages_obj = get_pages('sort_column=post_parent,menu_order');
	$options_pages[''] = 'Select a page:';
	foreach ($options_pages_obj as $page) {
		$options_pages[$page->ID] = $page->post_title;
	}

	// If using image radio buttons, define a directory path
	$imagepath =  get_template_directory_uri() . '/images/';
	

	
// Homepage Layouts
$theme_layout = array (
'Default' => __('Default Layout'),
'Blog' => __('Blog Layout'),
'Portfolio' => __('Portfolio Layout'),
);
	
//Stylesheets Reader




	$options = array();

	$options[] = array(
		'name' => __('General Settings', 'options_framework_theme'),
		'type' => 'heading');
        
		$options[] = array(
		'name' => __('Upload Logo Image'),
		'desc' => __('Upload a logo using the uploader, logo must be 43px height and can be upto 500px width.'),
		'std' => $imagepath . 'logo.jpg',
		'id' => 'logo_uploader',
		'type' => 'upload');
		
		$options[] = array(
		'name' => __('Upload a Favicon'),
		'desc' => __('Upload a favicon, size must be 16px by 16px.'),
		'id' => 'favicon_uploader',
		'type' => 'upload');
		
		$options[] = array(
		'name' => __('Footer Text'),
		'desc' => __('Footer copyrights info.'),
		'id' => 'footer_text',
		'std' => 'Copyrights 2013. <a href="#">Mi theme</a> allrights reserved.',
		'type' => 'textarea');
	

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

	
    
	
	$options[] = array(
		'name' => __('Slider Category'),
		'desc' => __('Select a Category for slider.'),
		'id' => 'mt_slide_categories',
		'type' => 'select',
		'options' => $options_categories);
		
	$options[] = array(
		'name' => __('Number of slider items'),
		'desc' => __('Set the number of item for slider'),
		'id' => 'mt_slide_number',
		'std' => '3',
		'class' => 'mini', 
		'type' => 'text');
	
    $options[] = array(
		'name' => __('Catchy Heading Text'),
		'desc' => __('This is for homepage catchy heading text'),
		'id' => 'catchy_heading',
		'std' => 'Moonthemes Offering Best Free and Premium Wordpress Themes',
		'type' => 'textarea');	
		
	 $options[] = array(
		'name' => __('Catchy Description Text'),
		'desc' => __('This is for homepage catchy description text'),
		'id' => 'catchy_desc',
		'std' => 'Moonthemes Offering Best Free and Premium Wordpress Themes, New amazing theme will be releasing soon, Moonthemes Offering Best Free and Premium Wordpress Themes, New amazing theme will be releasing soon <a href="#">internet web &rarr; </a>',
		'type' => 'textarea');	

    $options[] = array(
		'name' => __('Services Heading Text'),
		'desc' => __('This is for homepage service heading text'),
		'id' => 'service_heading',
		'std' => 'About Services',
		'type' => 'textarea');	

	 $options[] = array(
		'name' => __('Services First Column Title Text'),
		'desc' => __('This is for homepage service First column title text'),
		'id' => 'service_firstt',
		'std' => 'Top web service',
		'type' => 'textarea');	
     
     $options[] = array(
		'name' => __('Services First Column Description Text'),
		'desc' => __('This is for homepage service first column description text'),
		'id' => 'service_first',
		'std' => 'New amazing theme will be releasing soon and homepage service first <a href="#">column text</a>',
		'type' => 'textarea');
		
	$options[] = array(
		'name' => __('Services Second Column Title Text'),
		'desc' => __('This is for homepage service second column title text'),
		'id' => 'service_secondd',
		'std' => 'best design site',
		'type' => 'textarea');		
		
    $options[] = array(
		'name' => __('Services Second Column Description Text'),
		'desc' => __('This is for homepage service second column description text'),
		'id' => 'service_second',
		'std' => 'New amazing theme will be releasing soon and homepage service second column text',
		'type' => 'textarea');		

    $options[] = array(
		'name' => __('Services Third Column Title Text'),
		'desc' => __('This is for homepage service third column title text'),
		'id' => 'service_third',
		'std' => 'premium themes',
		'type' => 'textarea');		
		
    $options[] = array(
		'name' => __('Services Third Column Description Text'),
		'desc' => __('This is for homepage service third column description text'),
		'id' => 'service_thirdd',
		'std' => 'New amazing theme will be releasing soon and homepage service third column text',
		'type' => 'textarea');		

	 $options[] = array(
		'name' => __('Services Fourth Column Title Text'),
		'desc' => __('This is for homepage service fourth column title text'),
		'id' => 'service_fourth',
		'std' => 'unique site idea',
		'type' => 'textarea');		
		
    $options[] = array(
		'name' => __('Services Fourth Column Description Text'),
		'desc' => __('This is for homepage service fourth column description text'),
		'id' => 'service_fourtht',
		'std' => 'New amazing theme will be releasing soon and homepage service fourth column text',
		'type' => 'textarea');		

							
	

	$options[] = array(
		'name' => __('Layout Styles'),
		'type' => 'heading' );
		
		$options[] = array(
		'name' => __('Theme Layout'),
		'desc' => __('Set a layout for homepage.'),
		'id' => 'theme_layout',
		'std' => 'Default',
		'type' => 'select', 
		'options' => $theme_layout);
		
		$options[] = array(
		'name' => __('Change theme Color Scheme'),
		'desc' => __('Unlimited Color Style.'),
		'id' => 'theme_colors',
		'std' => '#ea4848',
		'type' => 'color'); 
		
		$options[] = array(
		'name' => __('Custom CSS'),
		'desc' => __('Quickly add CSS code for the theme by adding it to this block.'),
		'id' => 'custom_css',
		'std' => '',
		'type' => 'textarea'); 
		
	$options[] = array(
		'name' => __('Blog'),
		'type' => 'heading' );	
		
	$options[] = array(
		'name' => __('Blog Page Top Heading Text'),
		'desc' => __('This is for blog page top heading text'),
		'id' => 'blogt_hdn',
		'std' => 'Blog',
		'type' => 'textarea');	

    $options[] = array(
		'name' => __('Blog Page Top Description Text'),
		'desc' => __('This is for blog page top description text'),
		'id' => 'blogt_desc',
		'std' => 'The text goes here',
		'type' => 'textarea');	

    $options[] = array(
		'name' => __('Portfolio'),
		'type' => 'heading' );	
		
	$options[] = array(
		'name' => __('Portfolio Page Top Heading Text'),
		'desc' => __('This is for portfolio page top heading text'),
		'id' => 'ptr_hdn',
		'std' => 'Portfolio',
		'type' => 'textarea');	

    $options[] = array(
		'name' => __('Portfolio Page Top Description Text'),
		'desc' => __('This is for portfolio page top description text'),
		'id' => 'ptr_desc',
		'std' => 'The text goes here',
		'type' => 'textarea');	

    $options[] = array(
		'name' => __('Portfolio Page Intro Heading Text'),
		'desc' => __('This is for portfolio page intro heading text'),
		'id' => 'ptr_tro',
		'std' => 'The Text Goes Here',
		'type' => 'textarea');	

    $options[] = array(
		'name' => __('Portfolio Page Intro Description Text'),
		'desc' => __('This is for portfolio page intro description text'),
		'id' => 'tro_desc',
		'std' => 'This is for portfolio page intro description text',
		'type' => 'textarea');	

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

    $options[] = array(
		'name' => __('Background Image or Color Settings'),
		'desc' => __(''),
		'id' => 'bg_imgr',
		'std' => $background_defaults,
		'type' => 'background');

    			
	return $options;
}

