<?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 (lowercase and without spaces)
	$themename = get_theme_data(STYLESHEETPATH . '/style.css');
	$themename = $themename['Name'];
	$themename = preg_replace("/\W/", "", strtolower($themename) );
	
	$optionsframework_settings = get_option('optionsframework');
	$optionsframework_settings['id'] = $themename;
	update_option('optionsframework', $optionsframework_settings);
	
	// echo $themename;
}

/**
 * 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.
 *  
 */

function optionsframework_options() {
	
	$yesno = array('no' => 'No', 'yes' =>'Yes' );
	$float = array('left' => 'left', 'right' =>'right');
	// Test data
	$test_array = array("one" => "One","two" => "Two","three" => "Three","four" => "Four","five" => "Five");
	// Multicheck Array
	$multicheck_array = array("one" => "French Toast", "two" => "Pancake", "three" => "Omelette", "four" => "Crepe", "five" => "Waffle");
	// Multicheck Defaults
	$multicheck_defaults = array("one" => "true","five" => "true");
	// Background Defaults
	$border = array('color' => '', 'style' => 'solid', 'position' => 'border', 'size'=>'' );
	$shadow = array('color' => '', 'size'=>'' );
	$position = array('top' => '', 'right' =>'', 'bottom' =>'', 'left' =>'' );
	$bodybg = array('repeat' => 'repeat-x');
	$bodytypo = array('size' => '12px', 'face' =>'tahoma', 'style' => 'normal' );
	$slideTypo = array('size' => '12px', 'face' =>'tahoma', 'style' => 'normal' );
	$navTypo = array('size' => '16px', 'face' =>'Hacen Saudi Arabia');
	$postTitleTypo = array('size' => '18px', 'face' =>'mohammad_bold' );
	$postContentTypo = array('size' => '13px', 'face' =>'tahoma', 'style' => 'normal' );
	$sideTitleTypo = array('size' => '14px', 'face' =>'Hacen Saudi Arabia');
	$iread_title = array('size' => '24px', 'face' =>'tnaskh');

//H typo
$h1 = array('size' => '36px', 'face' =>'arial' );
$h2 = array('size' => '30px', 'face' =>'arial' );
$h3 = array('size' => '24px', 'face' =>'arial' );
$h4 = array('size' => '18px', 'face' =>'arial' );
$h5 = array('size' => '14px', 'face' =>'arial' );
$h6 = array('size' => '12px', 'face' =>'arial' );

//position
$headlogopos = array('top' => '40', 'left' => '10');
//nivo slider
	$nivo_effects = array('random' => 'random', 'sliceDown' => 'sliceDown', 'sliceDownLeft' => 'sliceDownLeft', 'sliceUp' => 'sliceUp', 'sliceUpLeft' => 'sliceUpLeft','sliceUpDown' => 'sliceUpDown', 'sliceUpDownLeft' => 'sliceUpDownLeft', 'fold' => 'fold', 'fade' => 'fade', 'random' => 'random', 
	 'slideInRight' => 'slideInRight', 'slideInLeft' => 'slideInLeft', 'boxRandom' => 'boxRandom', 'boxRain' => 'boxRain', 
	 'boxRainReverse' => 'boxRainReverse', 'boxRainGrow' => 'boxRainGrow', 'boxRainGrowReverse' => 'boxRainGrowReverse', );

//cycle Slider
	$cycle_effects = array('blindX' => 'blindX', 'blindY' => 'blindY', 'blindZ' => 'blindZ', 'cover' => 'cover', 'curtainX' => 'curtainX','curtainY' => 'curtainY', 'fade' => 'fade', 'fadeZoom' => 'fadeZoom', 'growX' => 'growX', 'growY' => 'growY', 
	 'none' => 'none', 'scrollUp' => 'scrollUp', 'scrollDown' => 'scrollDown', 'scrollLeft' => 'scrollLeft', 
	 'scrollRight' => 'scrollRight', 'scrollHorz' => 'scrollHorz', 'scrollVert' => 'scrollVert',
	'shuffle' => 'shuffle', 'slideX' => 'slideX', 'slideY' => 'slideY', 'toss' => 'toss', 
	 'turnUp' => 'turnUp', 'turnDown' => 'turnDown', 'turnLeft' => 'turnLeft', 'turnRight' => 'turnRight', 'uncover' => 'uncover', 'wipe' => 'wipe', 'zoom' => 	'zoom');

	// Pull all the categories into an array
	$options_categories = array();  
	$options_categories_obj = get_categories('hide_empty=0');
	foreach ($options_categories_obj as $category) {
    	$options_categories[$category->cat_ID] = $category->cat_name;
	}
	
	// Pull all the pages into an array
	$options_pages = array();  
	$options_pages_obj = get_pages('sort_column=post_parent,menu_order');
	$options_pages['false'] = 'إختر صفحة : ';
	foreach ($options_pages_obj as $page) {
    	$options_pages[$page->ID] = $page->post_title;
	}
	//porduct category
	$serie_categories = array();  
	$serie_categories_obj = get_categories('taxonomy=serie_cat');
	foreach ($serie_categories_obj as $scategory) {
    	$serie_categories[$scategory->cat_ID] = $scategory->cat_name;
	}
		
	// If using image radio buttons, define a directory path
	$imagepath =  get_bloginfo('stylesheet_directory') . '/Lioit/admin/images/';
		
	$options = array();


// General Setting 
		$options[] = array( "name" => __('إعدادات عامة', 'theme'),
						"type" => "heading",
						"slug" => "general"
						);
		$options[] = array( "name" => __('إعدادات وخصائص عامة', 'theme'),
						"type" => "info"
						);
		$options[] = array( "name" => __('اللوجو', 'theme'),
						"id" => "logo_img",
						"desc" => 'تغيير صورة الهيدر الأساسية',
						"type" => "upload",
						);


		$options[] = array( "name" => __('أيكونة المتصفح', 'theme'),
						"desc" => __('ارفع ايقونة المتصـفح Favicon الخاصة بك'),
						"id" => "custom_favicon",
						"type" => "upload",
						);


		$options[] = array( "name" => __('نص الحقوق', 'theme'),
						"desc" => __('نص الحقوق الموجود أسفل الموقع'),
						"id" => "copyrights",
						"std" => 'كافة الحقوق محفوظة 2014 ©pramji.com مدونة برامجي',
						"type" => "textarea"
						);

		$options[] = array( "name" => __('صفحة المراسلة', 'theme'),
						"id" => "faq_url",
						"type" => "select",
						"options" => $options_pages
						);
						
						
						$options[] = array( "name" => __('رسالة للزوار', 'theme'),
						"type" => "info"
						);
						
						$options[] = array( "name" => __('تفعيل الرسالة', 'theme'),
						"id" => "info_show",
						"type" => "checkbox",
						); 
						$options[] = array( "name" => __('نص الرسالة للزوار', 'theme'),
						"desc" => __('نص الرسالة '),
						"id" => "info_text",
						"std" => 'تم اضافة قسم خاص لمجلس الامة الكويتي يرجى اختيار القسم من القائمه لمشاهدة جميع اللقطات المضافه',
						"type" => "textarea"
						);
						$options[] = array( "name" => __('نص الرابط ', 'theme'),
						"desc" => __('الصق نص رابط للرسالة '),
						"id" => "info_urltext",
						"std" => 'زيارة القسم',
						"type" => "text",
						);
						$options[] = array( "name" => __('رابط الرسالة', 'theme'),
						"desc" => __('الصق رابط للرسالة هنا'),
						"std" => 'http://pramji.com/category/%D9%85%D8%AC%D9%84%D8%B3-%D8%A7%D9%84%D8%A7%D9%85%D8%A9',
						"id" => "info_url",
						"type" => "text",
						);
			


		
						
						
		
						
// End General
// Social
		$options[] = array( "name" => __('الشبكات الاجتماعية', 'theme'),
						"type" => "heading",
						"slug" => "social"
						);
		$options[] = array( "name" => __('روابط حسابات الشبكات الإجتماعية', 'theme'),
						"type" => "info"
						);


		$options[] = array( "name" => __('رابط Facebook', 'theme'),
						"desc" => __('الصق رابط facebook هنا'),
						"id" => "facebook_url",
						"type" => "text",
						);
						$options[] = array( "name" => __('عنوان الصفحة للإعجاب Facebook', 'theme'),
						"desc" => __('مثال Lioit'),
						"id" => "facebook_pageid",
						"type" => "text",
						);

		$options[] = array( "name" => __('رابط Twitter', 'theme'),
						"desc" => __('الصق رابط twitter هنا'),
						"id" => "twitter_url",
						"type" => "text",
						);
						$options[] = array( "name" => __('بدون رابط Twitter', 'theme'),
						"desc" => __('الصق حساب twitter هنا'),
						"id" => "twitter_name",
						"type" => "text",
						);

		$options[] = array( "name" => __('رابط googl plus', 'theme'),
						"desc" => __('الصق رابط Google Plus هنا'),
						"id" => "gplus_url",
						"type" => "text",
						);
						
						
		$options[] = array( "name" => __('رابط Flickr', 'theme'),
						"desc" => __('الصق رابط Flickr هنا'),
						"id" => "flickr_url",
						"type" => "text",
						);
						



						

// End Social

// Sliders Config 
		$options[] = array( "name" => __('عارض الشرائح', 'theme'),
						"type" => "heading",
						"slug" => "sliders"
						);
		

						$options[] = array( "name" => __('عارض الشرائح بالهيدر', 'theme'),
						"type" => "info"
						);
						$options[] = array( "name" => __('تفعيل الشرائح', 'theme'),
						"id" => "slider_show",
						"type" => "checkbox",
						);
		$options[] = array( "name" => __('القسم لعرض الشرائح منه', 'theme'),
						"id" => "slider_cat",
						"type" => "select",
						"options" => $options_categories
						);
		$options[] = array( "name" => __('عدد الشرائح المراد عرضها', 'theme'),
						"id" => "slider_count",
						"std" => "9",
						"step" => "1",
						"min" => "1",
						"max" => "36",
						"suffix" => "عدد الشرائح",
						"type" => "range",
						);
						


// Sliders Config

// ads 
		$options[] = array( "name" => __('إعلانات', 'theme'),
						"type" => "heading",
						"slug" => "ads"
						);


						
						
						
				$options[] = array( "name" => __('إعلان بالهيدر', 'theme'),
						"type" => "info",
						);		
						
						
						$options[] = array( "name" => __('صورة الإعلان', 'theme'),
						"id" => "ad2_img",
						"desc" => 'إرفع صورة البنر بمقاس 728 * 90',
						"type" => "upload",
						);
						$options[] = array( "name" => __('الوصف', 'theme'),
						"id" => "ad2_alt",
						"type" => "text",
						);
						$options[] = array( "name" => __('رابط الإعلان', 'theme'),
						"id" => "ad2_url",
						"type" => "text",
						);
						
						$options[] = array( "name" => __('إعلان أدسنس', 'theme'),
						"type" => "info",
						);	
						$options[] = array( "name" => __('كود الإعلان', 'theme'),
						"id" => "ad_adsense",
						"type" => "textarea",
						);



						



//ads




	

	

	return $options;
}