<?php
/////////////////////////////////////////

// ************* Theme Options Page *********** //

add_action('admin_menu', 'mkt_add_product'); //Add new menu block to admin side

function mkt_add_product(){	
	if(function_exists(add_object_page))
    {
        add_object_page (CUSTOM_MENU_TITLE, CUSTOM_MENU_TITLE, 8,'product_menu.php', 'admin_settings',  get_bloginfo('template_url').'/images/favicon.ico');
    }
    else
    {
        add_menu_page (CUSTOM_MENU_TITLE, CUSTOM_MENU_TITLE, 8,'product_menu.php', 'admin_settings',  get_bloginfo('template_url').'/images/favicon.ico'); 
    }
   	
	add_submenu_page('product_menu.php', CUSTOM_MENU_GENERAL_SETTINGS, CUSTOM_MENU_GENERAL_SETTINGS, 8, 'product_menu.php', 'admin_settings');
	add_submenu_page('product_menu.php', CUSTOM_MENU_DESIGN_SETTINGS, CUSTOM_MENU_DESIGN_SETTINGS, 8, 'theme_settings', 'theme_settings');
	add_submenu_page('product_menu.php', CUSTOM_MENU_PAYMENT_OPTIONS, CUSTOM_MENU_PAYMENT_OPTIONS, 8, 'paymentoptions', 'payment_options');
	add_submenu_page('product_menu.php', CUSTOM_MENU_MANAGE_COUPON, CUSTOM_MENU_MANAGE_COUPON, 8, 'managecoupon', 'manage_coupon');
	add_submenu_page('product_menu.php', CUSTOM_MENU_MANAGE_PRICE, CUSTOM_MENU_MANAGE_PRICE, 8, 'price', 'manage_price');
	add_submenu_page('product_menu.php', CUSTOM_MENU_BULK_UPLOAD, CUSTOM_MENU_BULK_UPLOAD, 8, 'bulk', 'bulk_upload');
}

function bulk_upload()
{
	include_once(TEMPLATEPATH . '/library/includes/admin_bulk_upload.php');
}
function admin_settings()
{
	include_once(TEMPLATEPATH . '/library/includes/admin_settings.php');
}
function theme_settings()
{
	mytheme_add_admin();
}
function payment_options()
{
	include_once(TEMPLATEPATH . '/library/includes/admin_paymethods.php');
}
function manage_coupon()
{
	if($_REQUEST['pagetype']=='addedit')
	{
		include_once(TEMPLATEPATH . '/library/includes/admin_coupon.php');
	}else
	{
		include_once(TEMPLATEPATH . '/library/includes/admin_manage_coupon.php');
	}
}
function manage_price()
{
	if($_REQUEST['pagetype']=='addedit')
	{
		include_once(TEMPLATEPATH . '/library/includes/admin_price.php');
	}else
	{
		include_once(TEMPLATEPATH . '/library/includes/admin_manage_price.php');
	}
}
?>