<?php


define('AIT_REVSLIDER_ENABLED', true);
define('AIT_REVSLIDER_PACKAGE', 'developer');



add_action('plugins_loaded', 'aitRevsliderOverrides');
add_action('before_ajax_editor', 'aitAddRevsliderShortcodeToAjaxLoadedEditor');

function aitRevsliderOverrides()
{
	//global $productAdmin;

	//if(isset($productAdmin)){
		//remove_action('admin_menu', array($productAdmin, 'addAdminMenu'));
		//add_action('admin_menu', 'aitChangeRevsliderAdminMenu');
	//}

	if(get_option('revslider-valid') === false){
		update_option('revslider-valid', 'true');
	}
}


function aitAddRevsliderShortcodeToAjaxLoadedEditor()
{
	global $pagenow;

	if ($pagenow == 'admin-ajax.php') {
		// added rev slider shortcode dropdown to ajax-loaded editor
		RevSlider_TinyBox::my_add_tinymce();
	}
}



function aitChangeRevsliderAdminMenu()
{
	global $productAdmin;

	if(isset($productAdmin)){
		add_menu_page(
			__('Revolution Slider', 'revslider'),
			__('Revolution Slider', 'revslider'),
			'manage_options',
			'revslider',
			array($productAdmin, 'adminPages'),
			RevSliderAdmin::$url_plugin . "revolution-slider-icon.png",
			"54.9"
		);
	}
}

