<?php
if (! function_exists("theme_rewrite_flush_rules")) {
	function theme_rewrite_flush_rules($option,$value) {
		if(theme_get_option('portfolio','permalink_slug') != $value){
			theme_ajax_flush_rewrite_rules();
		}
		
		return $value;
	}
	
	function theme_ajax_flush_rewrite_rules() {
?>
<script type="text/javascript" >
jQuery(document).ready(function($) {
	var data = {
		action: 'theme-flush-rewrite-rules'
	};
	jQuery.post(ajaxurl, data, function(response) {
		
	});
});
</script>
<?php
	}
}

$options = array(
	array(
		"name" => __("Portfolio",THEME_ADMIN_DOMAIN),
		"type" => "title"
	),
	array(
		"name" => __("Portfolio General",THEME_ADMIN_DOMAIN),
		"type" => "start"
	),
		array(
			"name" => __("Breadcrumbs Parent Page",THEME_ADMIN_DOMAIN),
			"desc" => __("If set will enable portfolio item breadcrumbs. The page you choose here will be the parent page of portfolio items on the breadcrumbs. This will override the global configuration.",THEME_ADMIN_DOMAIN),
			"id" => "breadcrumbs_page",
			"page" => 0,
			"default" => 0,
			"chosen" => "true",
			"prompt" => __("None",THEME_ADMIN_DOMAIN),
			"type" => "select",
		),
		array(
			"name" => __("Display Title",THEME_ADMIN_DOMAIN),
			"desc" => "",
			"id" => "display_title",
			"default" => true,
			"type" => "toggle"
		),
		array(
			"name" => __("Display Description",THEME_ADMIN_DOMAIN),
			"desc" => "",
			"id" => "display_excerpt",
			"default" => true,
			"type" => "toggle"
		),
		array(
			"name" => __("Display Description Words Number",THEME_ADMIN_DOMAIN),
			"desc" => "",
			"id" => "excerpt_count",
			"default" => 10,
			"type" => "text"
		),
		array(
			"name" => __("Display More Link",THEME_ADMIN_DOMAIN),
			"desc" => "",
			"id" => "display_more_button",
			"default" => true,
			"type" => "toggle"
		),
		array(
			"name" => __("More Button Text",THEME_ADMIN_DOMAIN),
			"desc" => "",
			"size" => 30,
			"id" => "more_button_text",
			"default" => 'Read More »',
			"type" => "text",
		),
	array(
		"type" => "end"
	),
	array(
		"name" => __("Portfolio Rewrite URL",THEME_ADMIN_DOMAIN),
		"type" => "start"
	),
		array(
			"name" => __("Permalink Slug",THEME_ADMIN_DOMAIN),
			"desc" => "Permalink Slug is used for build URLs of portfolio. If this value is empty, it will use 'portfolio' for build URL.",
			"size" => 30,
			"id" => "permalink_slug",
			"default" => '',
			"process" => 'theme_rewrite_flush_rules',
			"type" => "text",
		),
	array(
		"type" => "end"
	),
	array(
		"name" => __("Height of Thumbnail",THEME_ADMIN_DOMAIN),
		"type" => "start"
	),
		/*array(
			"name" => __("One Column",THEME_ADMIN_DOMAIN),
			"desc" => sprintf(__("%s in width",THEME_ADMIN_DOMAIN),'600px'),
			"id" => "1_column_height",
			"min" => "1",
			"max" => "600",
			"step" => "1",
			"unit" => 'px',
			"default" => "350",
			"type" => "range"
		),*/
		array(
			"name" => __("Two Columns",THEME_ADMIN_DOMAIN),
			"desc" => sprintf(__("%s in width",THEME_ADMIN_DOMAIN),'450px'),
			"id" => "2_columns_height",
			"min" => "1",
			"max" => "600",
			"step" => "1",
			"unit" => 'px',
			"default" => "250",
			"type" => "range"
		),
		array(
			"name" => __("Three Columns",THEME_ADMIN_DOMAIN),
			"desc" => sprintf(__("%s in width",THEME_ADMIN_DOMAIN),'292px'),
			"id" => "3_columns_height",
			"min" => "1",
			"max" => "600",
			"step" => "1",
			"unit" => 'px',
			"default" => "180",
			"type" => "range"
		),
		array(
			"name" => __("Four Columns",THEME_ADMIN_DOMAIN),
			"desc" => sprintf(__("%s in width",THEME_ADMIN_DOMAIN),'217px'),
			"id" => "4_columns_height",
			"min" => "1",
			"max" => "600",
			"step" => "1",
			"unit" => 'px',
			"default" => "150",
			"type" => "range"
		),
	array(
		"type" => "end"
	),
	array(
		"name" => __("Video Type's Lightbox Dimension",THEME_ADMIN_DOMAIN),
		"type" => "start"
	),
		array(
			"name" => __("Width",THEME_ADMIN_DOMAIN),
			"desc" => "",
			"id" => "video_width",
			"default" => 640,
			"min" => 0,
			"max" => 960,
			"unit" => 'px',
			"type" => "range"
		),
		array(
			"name" => __("Height",THEME_ADMIN_DOMAIN),
			"desc" => "",
			"id" => "video_height",
			"default" => 390,
			"min" => 0,
			"max" => 960,
			"unit" => 'px',
			"type" => "range"
		),
	array(
		"type" => "end"
	),
	array(
		"name" => __("Lightbox Type's Lightbox Dimension,Only For Doc&Iframe Type",THEME_ADMIN_DOMAIN),
		"type" => "start"
	),
		array(
			"name" => __("Width",THEME_ADMIN_DOMAIN),
			"desc" => "",
			"id" => "lightbox_width",
			"default" => 640,
			"min" => 0,
			"max" => 960,
			"unit" => 'px',
			"type" => "range"
		),
		array(
			"name" => __("Height",THEME_ADMIN_DOMAIN),
			"desc" => "",
			"id" => "lightbox_height",
			"default" => 390,
			"min" => 0,
			"max" => 960,
			"unit" => 'px',
			"type" => "range"
		),
	array(
		"type" => "end"
	),
	array(
		"name" => __("Featured Image",THEME_ADMIN_DOMAIN),
		"type" => "start"
	),
		array(
			"name" => __("Featured Image",THEME_ADMIN_DOMAIN),
			"desc" => __("If this option is on, Featured Image will appear in Portfolio Item page.",THEME_ADMIN_DOMAIN),
			"id" => "featured_image",
			"default" => false,
			"type" => "toggle"
		),
		array(
			"name" => __("Default Image",THEME_ADMIN_DOMAIN),
			"id" => "default_portfolio_image",
			"default" => '',
			"type" => "upload"
		),
		array(
			"name" => __("Featured Image for Lightbox",THEME_ADMIN_DOMAIN),
			"desc" => __("If this option is on, the full image will open in the lightbox when click on Featured Image of Portfolio Item page.",THEME_ADMIN_DOMAIN),
			"id" => "featured_image_lightbox",
			"default" => false,
			"type" => "toggle"
		),
		array(
			"name" => __("Adaptive Height",THEME_ADMIN_DOMAIN),
			"desc" => __("If this option is on, the height of the featured image depand on the scale of the image.",THEME_ADMIN_DOMAIN),
			"id" => "adaptive_height",
			"default" => false,
			"type" => "toggle"
		),
		array(
			"name" => __("Fixed Height",THEME_ADMIN_DOMAIN),
			"desc" => __("If the option above is off, it will take effect.",THEME_ADMIN_DOMAIN),
			"id" => "fixed_height",
			"min" => "1",
			"max" => "600",
			"step" => "1",
			"unit" => 'px',
			"default" => "250",
			"type" => "range"
		),
	array(
		"type" => "end"
	),
	array(
		"name" => __("Single Portfolio Header General",THEME_ADMIN_DOMAIN),
		"type" => "start"
	),
		array(
			"name" => __("Feature Header Type",THEME_ADMIN_DOMAIN),
			"desc" => "",
			"id" => "introduce_type",
			"default" => 'default',
			"options" => array(
				"default" => "Default",
				"description" => "Description",
				"slideshow" => "SlideShow",
				"disable" => "Disable",
			),
			"type" => "select",
		),
		array(
			"name" => __("Feature Header Custom Title",THEME_ADMIN_DOMAIN),
			"desc" => __('If any text you enter here will override your default feature header title.',THEME_ADMIN_DOMAIN),
			"id" => "custom_title",
			"default" => "",
			"class" => 'full',
			"type" => "text"		
		),
		array(
			"name" => __("Feature Header Custom Text",THEME_ADMIN_DOMAIN),
			"desc" => __('If the "custom text" option is selected above any text you enter here will override your general feautre header text .',THEME_ADMIN_DOMAIN),
			"id" => "custom_introduce_text",
			"rows" => "2",
			"default" => "",
			"type" => "textarea"		
		),
		array(
			"name" => __("SlideShow Type",THEME_ADMIN_DOMAIN),
			"desc" => __("Select which slidershow type to use.",THEME_ADMIN_DOMAIN),
			"id" => "slideshow_type",
			"default" => 'nivo',
			"options" => array(
				"any" => __('Anything SlideShow',THEME_ADMIN_DOMAIN),
				"nivo" => __('Nivo SlideShow',THEME_ADMIN_DOMAIN),
				"flow" => __('Cover FlowSlideShow',THEME_ADMIN_DOMAIN),
			),
			"type" => "select",
		),
		array(
			"name" => __("SlideShow Source",THEME_ADMIN_DOMAIN),
			"desc" => __("Select which slidershow Source to use. It only available when the type of feature header is slideshow",THEME_ADMIN_DOMAIN),
			"id" => "slideshow_category",
			"default" => "{s}",
			"options" => array(
				"g" => __('Self Gallery',THEME_ADMIN_DOMAIN),
			),
			"chosen" => true,
			"chosen_order" => true,
			"prompt" => __("Select Source..",THEME_ADMIN_DOMAIN),
			"function" => "theme_slideshow_category",
			'target' => 'slideshow_source',
			'process' => 'theme_slidershow_source_process',
			'prepare' => 'theme_slidershow_source_prepare',
			"type" => "multiselect"
		),
		array(
			"name" => __("SlideShow Height",THEME_ADMIN_DOMAIN),
			"desc" => __("Height of slider.",THEME_ADMIN_DOMAIN),
			"id" => "slideshow_height",
			"min" => "100",
			"max" => "500",
			"step" => "1",
			"unit" => 'px',
			"default" => "396",
			"type" => "range"
		),
		array(
			"name" => __("SlideShow Number",THEME_ADMIN_DOMAIN),
			"desc" => __("Number of Slide items to display.",THEME_ADMIN_DOMAIN),
			"id" => "slideshow_number",
			"min" => "0",
			"max" => "10",
			"step" => "1",
			"default" => "0",
			"type" => "range"
		),
		array(
			"name" => __("Disable slideshow control bar",THEME_ADMIN_DOMAIN),
			"desc" => __("If true, you'll  disable your slideshow's control bar in blog list page.",THEME_ADMIN_DOMAIN),
			"id" => "slideshow_nav",
			"default" => "0",
			"type" => "toggle"
		),
		array(
			"name" => __("SlideShow Nav Items Number",THEME_ADMIN_DOMAIN),
			"desc" => __("Number of Slide nav items to display.",THEME_ADMIN_DOMAIN),
			"id" => "slideshow_nav_number",
			"min" => "1",
			"max" => "6",
			"step" => "1",
			"default" => "4",
			"type" => "range"
		),
	array(
		"type" => "end"
	),
	array(
		"name" => __("Single Portfolio Item",THEME_ADMIN_DOMAIN),
		"type" => "start"
	),
		array(
			"name" => __("Layout",THEME_ADMIN_DOMAIN),
			"desc" => "",
			"id" => "layout",
			"default" => 'right',
			"options" => array(
				"full" => __('Full Width',THEME_ADMIN_DOMAIN),
				"right" => __('Right Sidebar',THEME_ADMIN_DOMAIN),
				"left" => __('Left Sidebar',THEME_ADMIN_DOMAIN),
				"default"=>__('Default',THEME_ADMIN_DOMAIN),
			),
			"type" => "select",
		),
		array(
			"name" => __("Show Meta in Header Area",THEME_ADMIN_DOMAIN),
			"desc" => __("if this option is on, blog title and blog meta info will show in header introduce text area.",THEME_ADMIN_DOMAIN),
			"id" => "show_in_header",
			"default" => true,
			"type" => "toggle"
		),
		array(
			"name" => __("For Header Area of Single Portfolio Page",THEME_ADMIN_DOMAIN),
			"desc" => "",
			"id" => "single_meta_items",
			"default" => array('date','category'),
			"options" => array(
				'category'=>__('Category',THEME_ADMIN_DOMAIN),
				'tags'=>__('Tags',THEME_ADMIN_DOMAIN),
				'author'=>__('Author',THEME_ADMIN_DOMAIN),
				'date'=>__('Date',THEME_ADMIN_DOMAIN),
			),
			'enable_text' => __('Enabled',THEME_ADMIN_DOMAIN),
			'disable_text' => __('Disabled',THEME_ADMIN_DOMAIN),
			"type" => "ddmultiselect"
		),
		array(
			"name" => __("About Author Box",'striking_admin'),
			"desc" => "",
			"id" => "author",
			"default" => false,
			"type" => "toggle"
		),
		array(
			"name" => __("Related & Recent Module",'striking_admin'),
			"desc" => "",
			"id" => "related_recent",
			"default" => false,
			"type" => "toggle"
		),
		array(
			"name" => __("Previous & Next Navigation",THEME_ADMIN_DOMAIN),
			"desc" => "",
			"id" => "single_navigation",
			"default" => false,
			"type" => "toggle"
		),
		array(
			"name" => __("Previous & Next Navigation Order",THEME_ADMIN_DOMAIN),
			"desc" => "",
			"id" => "single_navigation_order",
			"default" => 'post_data',
			"options" => array(
				"post_data" => __('Post Data',THEME_ADMIN_DOMAIN),
				"menu_order" => __('Menu Order',THEME_ADMIN_DOMAIN),
			),
			"type" => "select",
		),
		array(
			"name" => __(" Previous & Next Navigation for Category",THEME_ADMIN_DOMAIN),
			"desc" => "If this option is on, the Previous & Next Navigation will only show the portfolio items with the same Category",
			"id" => "single_navigation_category",
			"default" => false,
			"type" => "toggle"
		),
		array(
			"name" => __("Document Type Navigation",THEME_ADMIN_DOMAIN),
			"desc" => "If this option is on, the Previous & Next Navigation will only apply to Document type of Portfolio",
			"id" => "single_doc_navigation",
			"default" => true,
			"type" => "toggle"
		),
		array(
			"name" => __("Enable Comment",THEME_ADMIN_DOMAIN),
			"desc" => "",
			"id" => "enable_comment",
			"default" => false,
			"type" => "toggle"
		),
	array(
		"type" => "end"
	),
	array(
		"name" => __("Featured Image Thumbnail for Widget",THEME_ADMIN_DOMAIN),
		"type" => "start"
	),
		array(
			"name" => __("Display default thumbnail image",THEME_ADMIN_DOMAIN),
			"desc" => __("If this option is on, it will display default thumbnail image when there is no feature image.",THEME_ADMIN_DOMAIN),
			"id" => "display_default_thumbnail",
			"default" => true,
			"type" => "toggle"
		),
		array(
			"name" => __("Custom default thumbnail image",THEME_ADMIN_DOMAIN),
			"id" => "default_thumbnail_custom",
			"default" => "",
			"type" => "upload"
		),
	array(
		"type" => "end"
	),
);
return array(
	'auto' => true,
	'name' => 'portfolio',
	'options' => $options
);
