<?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 'awesome'
 * 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', 'awesome'),
		'two' => __('Two', 'awesome'),
		'three' => __('Three', 'awesome'),
		'four' => __('Four', 'awesome'),
		'five' => __('Five', 'awesome')
	);

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

	// 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/';
	
	$options = array();
			

	$options[] = array(
		'name' => __('General', 'awesome'),
		'type' => 'heading');
		
	$options[] = array(
		'name' => __('Select Skin', 'options_framework_theme'),
		'id' => 'select_skin',
		'std' => 'two',
		'type' => 'select',
		'class' => 'mini',
		'options' => array(
			'green' => 'Green',
			'orange' => 'Orange')
		);		
		
	$options[] = array(
		'name' => __('Favicon', 'awesome'),
		'desc' => __('Upload your website favicon image.', 'awesome'),
		'id' => 'aw_favicon',
		'type' => 'upload');	
		
	$options[] = array(
		'name' => __('Logo', 'awesome'),
		'desc' => __('Upload your website logo image.', 'awesome'),
		'id' => 'aw_logo',
		'type' => 'upload');		
		
	$options[] = array(
		'name' => __('Archive Style', 'awesome'),
		'desc' => __('Select style.', 'awesome'),
		'id' => 'aw_archive_style',
		'type' => 'select',
		'class' => 'mini',
		'options' => array(
			'one-column' => 'One Column',
			'two-column' => 'Two Column')
		);		
	
		
	$options[] = array(
		'name' => __('Footer Credit', 'awesome'),
		'desc' => __('Custom footer credit.', 'awesome'),
		'id' => 'aw_fcredit',
		'std' => '',
		'type' => 'textarea');		
		
	$options[] = array(
		'name' => __('About Your Company', 'awesome'),
		'type' => 'info');			
		
	$options[] = array(
		'name' => __('Company Name', 'awesome'),
		'id' => 'aw_cname',
		'std' => '',
		'type' => 'text');	
		
	$options[] = array(
		'name' => __('Address', 'awesome'),
		'id' => 'aw_caddress',
		'std' => '',
		'type' => 'text');	
		
	$options[] = array(
		'name' => __('Secondary Address', 'awesome'),
		'id' => 'aw_secondary_caddress',
		'std' => '',
		'type' => 'text');	
		
	$options[] = array(
		'name' => __('State Name, Country Name', 'awesome'),
		'id' => 'aw_ccountry',
		'std' => '',
		'type' => 'text');	
		
	$options[] = array(
		'name' => __('Map', 'awesome'),
		'desc' => __('Input your Google map code here.', 'awesome'),		
		'id' => 'aw_map',
		'std' => '',
		'type' => 'textarea');	
		
	$options[] = array(
		'name' => __('Tagline', 'awesome'),
		'id' => 'aw_ctagline',
		'std' => '',
		'type' => 'textarea');	
		
	$options[] = array(
		'name' => __('Description', 'awesome'),
		'id' => 'aw_cdesc',
		'std' => '',
		'type' => 'textarea');	
		
	$options[] = array(
		'name' => __('Image', 'awesome'),
		'id' => 'aw_cimg',
		'type' => 'upload');			
		
	$options[] = array(
		'name' => __('Social Media', 'awesome'),
		'type' => 'info');				
		
	$options[] = array(
		'name' => __('Twitter', 'awesome'),
		'desc' => __('Input your Twitter profile URL.', 'awesome'),
		'id' => 'aw_twitter',
		'class' => 'mini',
		'type' => 'text');

	$options[] = array(
		'name' => __('Facebook', 'awesome'),
		'desc' => __('Input your Facebook profile URL.', 'awesome'),
		'id' => 'aw_fb',
		'std' => '',
		'class' => 'mini',
		'type' => 'text');

	$options[] = array(
		'name' => __('Flickr', 'awesome'),
		'desc' => __('Input your Flickr profile URL', 'awesome'),
		'id' => 'aw_flickr',
		'std' => '',
		'class' => 'mini',
		'type' => 'text');

	$options[] = array(
		'name' => __('RSS', 'awesome'),
		'desc' => __('Input your RSS feed link.', 'awesome'),
		'id' => 'aw_rss',
		'std' => '',
		'class' => 'mini',
		'type' => 'text');
		
	$options[] = array(
		'name' => __('Home Settings', 'awesome'),
		'type' => 'heading');	
		
	$options[] = array(
		'name' => __('Frontpage Layout', 'options_framework_theme'),
		'id' => 'aw_layout',
		'std' => 'portfolio',
		'type' => 'select',
		'class' => 'mini',
		'options' => array(
			'regular' => 'Regular Layout',
			'portfolio' => 'Portfolio Layout')
		);		
		
	$options[] = array(
		'name' => __('Page Slug Settings', 'awesome'),
		'desc' => __('It must equal to slug name in edit page.', 'awesome'),
		'type' => 'info');			
		
	$options[] = array(
		'name' => __('About Us', 'awesome'),
		'desc' => '',
		'id' => 'aw_sg_about',
		'std' => '',
		'class' => 'mini',
		'type' => 'text');	
		
	$options[] = array(
		'name' => __('Portfolio', 'awesome'),
		'desc' => '',
		'id' => 'aw_sg_portfolio',
		'std' => '',
		'class' => 'mini',
		'type' => 'text');	
		
	$options[] = array(
		'name' => __('Services', 'awesome'),
		'desc' => '',
		'id' => 'aw_sg_services',
		'std' => '',
		'class' => 'mini',
		'type' => 'text');		
		
	$options[] = array(
		'name' => __('Blog', 'awesome'),
		'desc' => '',
		'id' => 'aw_sg_blog',
		'std' => '',
		'class' => 'mini',
		'type' => 'text');		
		
	$options[] = array(
		'name' => __('Features', 'awesome'),
		'desc' => '',
		'id' => 'aw_sg_features',
		'std' => '',
		'class' => 'mini',
		'type' => 'text');		
		
	$options[] = array(
		'name' => __('Contact', 'awesome'),
		'desc' => '',
		'id' => 'aw_sg_contact',
		'std' => '',
		'class' => 'mini',
		'type' => 'text');		
		
	$options[] = array(
		'name' => __('Show/Hide Pages', 'awesome'),
		'desc' => 'When you select "show", it only works after you have defined slug settings correctly.',
		'type' => 'info');		

	$options[] = array(
		'name' => __('About Us', 'options_framework_theme'),
		'id' => 'sh_about',
		'std' => 'two',
		'type' => 'select',
		'class' => 'mini',
		'options' => array(
			'show' => 'Show',
			'hide' => 'Hide')
		);			

	$options[] = array(
		'name' => __('Portfolio', 'options_framework_theme'),
		'id' => 'sh_portfolio',
		'std' => 'two',
		'type' => 'select',
		'class' => 'mini',
		'options' => array(
			'show' => 'Show',
			'hide' => 'Hide')
		);		

	$options[] = array(
		'name' => __('Services', 'options_framework_theme'),
		'id' => 'sh_servies',
		'std' => 'two',
		'type' => 'select',
		'class' => 'mini',
		'options' => array(
			'show' => 'Show',
			'hide' => 'Hide')
		);		

	$options[] = array(
		'name' => __('Blog', 'options_framework_theme'),
		'id' => 'sh_blog',
		'std' => 'two',
		'type' => 'select',
		'class' => 'mini',
		'options' => array(
			'show' => 'Show',
			'hide' => 'Hide')
		);		

	$options[] = array(
		'name' => __('Features', 'options_framework_theme'),
		'id' => 'sh_features',
		'std' => 'two',
		'type' => 'select',
		'class' => 'mini',
		'options' => array(
			'show' => 'Show',
			'hide' => 'Hide')
		);			

	$options[] = array(
		'name' => __('Contact', 'options_framework_theme'),
		'id' => 'sh_contact',
		'std' => 'two',
		'type' => 'select',
		'class' => 'mini',
		'options' => array(
			'show' => 'Show',
			'hide' => 'Hide')
		);					
		
		
	$options[] = array(
		'name' => __('Slider', 'awesome'),
		'type' => 'heading');	

	$options[] = array(
		'name' => __('Enable Drag', 'awesome'),
		'id' => 'slide_drag',
		'type' => 'select',
		'class' => 'mini',
		'std' => 'true',		
		'options' => array(
			'true' => 'True',
			'false' => 'False')
		);		

	$options[] = array(
		'name' => __('Show Arrow', 'awesome'),
		'id' => 'slide_arrow',
		'type' => 'select',
		'class' => 'mini',
		'std' => 'true',
		'options' => array(
			'true' => 'True',
			'false' => 'False')
		);	

	$options[] = array(
		'name' => __('Show Button', 'awesome'),
		'id' => 'slide_btn',
		'type' => 'select',
		'class' => 'mini',
		'std' => 'true',
		'options' => array(
			'true' => 'True',
			'false' => 'False')
		);		

	$options[] = array(
		'name' => __('Auto Play', 'awesome'),
		'id' => 'slide_slideshow',
		'type' => 'select',
		'class' => 'mini',
		'std' => 'true',
		'options' => array(
			'true' => 'True',
			'false' => 'False')
		);		

	$options[] = array(
		'name' => __('Slide Delay', 'awesome'),
		'desc' => __('Per milisecond', 'awesome'),
		'id' => 'slide_delay',
		'std' => '3000',
		'class' => 'mini',
		'type' => 'text'
	);	

	$options[] = array(
		'name' => __('Animation', 'awesome'),
		'id' => 'slide_animation',
		'type' => 'select',
		'class' => 'mini',
		'std' => 'Random',
		'options' => array(
			'fadeIn' => 'Fade In',
			'fadeInUp' => 'Fade In Up',
			'fadeInLeft' => 'Fade In Left',
			'fadeInRight' => 'Fade In Right',
			'bounceIn' => 'Bounce In',
			'bounceInDown' => 'Bounce In Down',
			'bounceInUp' => 'Bounce In Up',
			'bounceInLeft' => 'Bounce In Left',
			'bounceInRight' => 'Bounce In Right',
			'rotateIn' => 'RotateIn',
			'rotateDownLeft' => 'Rotate Down Left',
			'rotateInUpLeft' => 'Rotate In Up Left',
			'rotateInUpRight' => 'Rotate In Up Right',
			'random' => 'Random')	
	);	
	
	

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

	$options[] = array(
		'name' => __('Quick Contact', 'awesome'),
		'desc' => __('Displayed in header, in right side of main menu.', 'awesome'),
		'type' => 'info');		

	$options[] = array(
		'name' => __('Email', 'awesome'),
		'id' => 'aw_mailtop',
		'std' => '',
		'class' => 'mini',
		'type' => 'text');		
		
	$options[] = array(
		'name' => __('Phone', 'awesome'),
		'id' => 'aw_phonetop',
		'std' => '',
		'class' => 'mini',
		'type' => 'text');			
		
	$options[] = array(
		'name' => __('More Contact Details', 'awesome'),
		'type' => 'info');				
		
	$options[] = array(
		'name' => __('Phone number 1', 'awesome'),
		'desc' => __('Input your phone number.', 'awesome'),
		'id' => 'aw_pnumber',
		'std' => '',
		'class' => 'mini',
		'type' => 'text');

	$options[] = array(
		'name' => __('Phone number 2', 'awesome'),
		'desc' => __('Input your phone number.', 'awesome'),
		'id' => 'aw_pnumber2',
		'std' => '',
		'class' => 'mini',
		'type' => 'text');

	$options[] = array(
		'name' => __('Email address 1', 'awesome'),
		'desc' => __('Input your email address.', 'awesome'),
		'id' => 'aw_mail',
		'std' => '',
		'class' => 'mini',
		'type' => 'text');

	$options[] = array(
		'name' => __('Email address 2', 'awesome'),
		'desc' => __('Input your email address', 'awesome'),
		'id' => 'aw_mail2',
		'std' => '',
		'class' => 'mini',
		'type' => 'text');
		
	$options[] = array(
		'name' => __('Contact Form', 'awesome'),
		'type' => 'info');				
		
	$options[] = array(
		'name' => __('Email Admin', 'awesome'),
		'desc' => __('Input your email address admin for contact form', 'awesome'),
		'id' => 'aw_mailadmin',
		'std' => '',
		'class' => 'mini',
		'type' => 'text');		
		
	$options[] = array(
		'name' => __('Team Members', 'awesome'),
		'type' => 'heading');		
		
	$options[] = array(
		'name' => __('Team 1', 'awesome'),
		'desc' => __('Team 1 information details.', 'awesome'),
		'type' => 'info');	

	$options[] = array(
		'name' => __('Name', 'awesome'),
		'id' => 'aw_t_name1',
		'std' => '',
		'class' => 'mini',
		'type' => 'text');	

	$options[] = array(
		'name' => __('Position', 'awesome'),
		'id' => 'aw_t_position1',
		'std' => '',
		'class' => 'mini',
		'type' => 'text');		

	$options[] = array(
		'name' => __('Phone', 'awesome'),
		'id' => 'aw_t_phone1',
		'std' => '',
		'class' => 'mini',
		'type' => 'text');				

	$options[] = array(
		'name' => __('Short Biography', 'awesome'),
		'id' => 'aw_t_bio1',
		'std' => '',
		'type' => 'textarea');				

	$options[] = array(
		'name' => __('Profile picture', 'awesome'),
		'id' => 'aw_t_pp1',
		'std' => '',
		'type' => 'upload');	

	$options[] = array(
		'name' => __('Twitter profile URL', 'awesome'),
		'id' => 'aw_t_twitter1',
		'std' => 'http://',
		'class' => 'mini',
		'type' => 'text');		

	$options[] = array(
		'name' => __('Facebook profile URL', 'awesome'),
		'id' => 'aw_t_fb1',
		'std' => 'http://',
		'class' => 'mini',
		'type' => 'text');		

	$options[] = array(
		'name' => __('Flickr profile URL', 'awesome'),
		'id' => 'aw_t_fr1',
		'std' => 'http://',
		'class' => 'mini',
		'type' => 'text');		

	$options[] = array(
		'name' => __('Team 2', 'awesome'),
		'desc' => __('Team 2 information details.', 'awesome'),
		'type' => 'info');		

	$options[] = array(
		'name' => __('Name', 'awesome'),
		'id' => 'aw_t_name2',
		'std' => '',
		'class' => 'mini',
		'type' => 'text');	

	$options[] = array(
		'name' => __('Position', 'awesome'),
		'id' => 'aw_t_position2',
		'std' => '',
		'class' => 'mini',
		'type' => 'text');		

	$options[] = array(
		'name' => __('Phone', 'awesome'),
		'id' => 'aw_t_phone2',
		'std' => '',
		'class' => 'mini',
		'type' => 'text');				

	$options[] = array(
		'name' => __('Biography', 'awesome'),
		'id' => 'aw_t_bio2',
		'std' => '',
		'type' => 'textarea');				

	$options[] = array(
		'name' => __('Profile picture', 'awesome'),
		'id' => 'aw_t_pp2',
		'std' => '',
		'type' => 'upload');	

	$options[] = array(
		'name' => __('Twitter profile URL', 'awesome'),
		'id' => 'aw_t_twitter2',
		'std' => 'http://',
		'class' => 'mini',
		'type' => 'text');		

	$options[] = array(
		'name' => __('Facebook profile URL', 'awesome'),
		'id' => 'aw_t_fb2',
		'std' => 'http://',
		'class' => 'mini',
		'type' => 'text');		

	$options[] = array(
		'name' => __('Flickr profile URL', 'awesome'),
		'id' => 'aw_t_fr2',
		'std' => 'http://',
		'class' => 'mini',
		'type' => 'text');

	$options[] = array(
		'name' => __('Team 3', 'awesome'),
		'desc' => __('Team 3 information details.', 'awesome'),
		'type' => 'info');	

	$options[] = array(
		'name' => __('Name', 'awesome'),
		'id' => 'aw_t_name3',
		'std' => '',
		'class' => 'mini',
		'type' => 'text');	

	$options[] = array(
		'name' => __('Position', 'awesome'),
		'id' => 'aw_t_position3',
		'std' => '',
		'class' => 'mini',
		'type' => 'text');		

	$options[] = array(
		'name' => __('Phone', 'awesome'),
		'id' => 'aw_t_phone3',
		'std' => '',
		'class' => 'mini',
		'type' => 'text');				

	$options[] = array(
		'name' => __('Biography', 'awesome'),
		'id' => 'aw_t_bio3',
		'std' => '',
		'type' => 'textarea');				

	$options[] = array(
		'name' => __('Profile picture', 'awesome'),
		'id' => 'aw_t_pp3',
		'std' => '',
		'type' => 'upload');	

	$options[] = array(
		'name' => __('Twitter profile URL', 'awesome'),
		'id' => 'aw_t_twitter3',
		'std' => 'http://',
		'class' => 'mini',
		'type' => 'text');		

	$options[] = array(
		'name' => __('Facebook profile URL', 'awesome'),
		'id' => 'aw_t_fb3',
		'std' => 'http://',
		'class' => 'mini',
		'type' => 'text');		

	$options[] = array(
		'name' => __('Flickr profile URL', 'awesome'),
		'id' => 'aw_t_fr3',
		'std' => 'http://',
		'class' => 'mini',
		'type' => 'text');		

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

	$options[] = array(
		'name' => __('Motto', 'awesome'),
		'id' => 'aw_motto',
		'std' => '',
		'type' => 'text');			

	$options[] = array(
		'name' => __('Purchase Teaser Head', 'awesome'),
		'id' => 'aw_purchase_hteaser',
		'std' => '',
		'type' => 'textarea');			

	$options[] = array(
		'name' => __('Purchase Teaser Content', 'awesome'),
		'id' => 'aw_purchase_cteaser',
		'std' => '',
		'type' => 'textarea');	

	$options[] = array(
		'name' => __('Purchase Button Name', 'awesome'),
		'id' => 'aw_purchase_btn',
		'std' => '',
		'class' => 'mini',
		'type' => 'text');			

	$options[] = array(
		'name' => __('Purchase Button URL', 'awesome'),
		'id' => 'aw_purchase_url',
		'std' => 'http://',
		'class' => 'mini',
		'type' => 'text');		
		
	$options[] = array(
		'name' => __('Tabbed Widget', 'awesome'),
		'type' => 'info');	

	$options[] = array(
		'name' => __('Popular Posts', 'awesome'),
		'id' => 'aw_tabbed_pop',
		'std' => '0',
		'type' => 'checkbox');		
		
	$options[] = array(
		'name' => __('', 'awesome'),
		'id' => 'aw_tabbed_pop_limit',
		'desc' => __('Set number item limit.', 'awesome'),		
		'std' => '',
		'class' => 'mini',
		'type' => 'text');			

	$options[] = array(
		'name' => __('Recent Posts', 'awesome'),
		'id' => 'aw_tabbed_recent',
		'std' => '0',
		'type' => 'checkbox');	
		
	$options[] = array(
		'name' => __('', 'awesome'),
		'id' => 'aw_tabbed_recent_limit',
		'desc' => __('Set number item limit.', 'awesome'),		
		'std' => '',
		'class' => 'mini',
		'type' => 'text');			

	$options[] = array(
		'name' => __('Recent Comments', 'awesome'),
		'id' => 'aw_tabbed_comment',
		'std' => '0',
		'type' => 'checkbox');	

	$options[] = array(
		'name' => __('', 'awesome'),
		'id' => 'aw_tabbed_comment_limit',
		'desc' => __('Set number item limit.', 'awesome'),		
		'std' => '',
		'class' => 'mini',
		'type' => 'text');			

	$options[] = array(
		'name' => __('Tags', 'awesome'),
		'desc' => __('', 'options_framework_theme'),		
		'id' => 'aw_tabbed_tags',
		'std' => '0',
		'type' => 'checkbox');		
		
	$options[] = array(
		'name' => __('', 'awesome'),
		'id' => 'aw_tabbed_tags_limit',
		'desc' => __('Set number item limit.', 'awesome'),		
		'std' => '',
		'class' => 'mini',
		'type' => 'text');			

	return $options;
}

/*
 * This is an example of how to add custom scripts to the options panel.
 * This example shows/hides an option when a checkbox is clicked.
 */

add_action('optionsframework_custom_scripts', 'optionsframework_custom_scripts');

function optionsframework_custom_scripts() { ?>

<script type="text/javascript">
jQuery(document).ready(function($) {

	$('#example_showhidden').click(function() {
  		$('#section-example_text_hidden').fadeToggle(400);
	});

	if ($('#example_showhidden:checked').val() !== undefined) {
		$('#section-example_text_hidden').show();
	}

});
</script>

<?php
}