';
_e('Your WP YouTube Lyte cache has been succesfully cleared.', 'wp-youtube-lyte' );
echo '
';
}
function lyte_cacheclear_part_notice() {
echo '';
_e('WP YouTube Lyte cache was partially cleared, refresh this page to continue purging.', 'wp-youtube-lyte' );
echo '
';
}
function lyte_cacheclear_fail_notice() {
echo '';
_e('There was a problem, the WP YouTube Lyte cache could not be cleared.', 'wp-youtube-lyte' );
echo '
';
}
function lyte_create_menu() {
$hook=add_options_page( 'WP YouTube Lyte settings', 'WP YouTube Lyte', 'manage_options', 'lyte_settings_page', 'lyte_settings_page');
add_action( 'admin_init', 'register_lyte_settings' );
add_action( 'admin_print_scripts-'.$hook, 'lyte_admin_scripts' );
add_action( 'admin_print_styles-'.$hook, 'lyte_admin_styles' );
}
function register_lyte_settings() {
register_setting( 'lyte-settings-group', 'lyte_show_links' );
register_setting( 'lyte-settings-group', 'lyte_size' );
register_setting( 'lyte-settings-group', 'lyte_hidef' );
register_setting( 'lyte-settings-group', 'lyte_position' );
register_setting( 'lyte-settings-group', 'lyte_notification' );
register_setting( 'lyte-settings-group', 'lyte_microdata' );
register_setting( 'lyte-settings-group', 'lyte_emptycache' );
register_setting( 'lyte-settings-group', 'lyte_greedy' );
register_setting( 'lyte-settings-group', 'lyte_yt_api_key' );
register_setting( 'lyte-settings-group', 'lyte_local_thumb' );
register_setting( 'lyte-settings-group', 'lyte_disclaimer' );
}
function lyte_admin_scripts() {
wp_enqueue_script('jqcookie', plugins_url('/external/jquery.cookie.min.js', __FILE__), array('jquery'),null,true);
wp_enqueue_script('unslider', plugins_url('/external/unslider-min.js', __FILE__), array('jquery'),null,true);
}
function lyte_admin_styles() {
wp_enqueue_style('unslider', plugins_url('/external/unslider.css', __FILE__));
wp_enqueue_style('unslider-dots', plugins_url('/external/unslider-dots.css', __FILE__));
}
function lyte_admin_nag_apikey() {
echo "";
}
$lyte_yt_api_key=get_option('lyte_yt_api_key','');
$lyte_yt_api_key=apply_filters('lyte_filter_yt_api_key', $lyte_yt_api_key);
if (empty($lyte_yt_api_key)) {
add_action('admin_notices', 'lyte_admin_nag_apikey');
}
function lyte_admin_api_error(){
$yt_error=json_decode(get_option('lyte_api_error'),1);
echo '';
_e('WP YouTube Lyte got the following error back from the YouTube API: ','wp-youtube-lyte');
echo "".$yt_error["reason"]."";
echo " (".date("r",$yt_error["timestamp"]).").";
echo '.
';
update_option('lyte_api_error','');
}
if (get_option('lyte_api_error','')!=='') {
add_action('admin_notices', 'lyte_admin_api_error');
}
function lyte_settings_page() {
global $pSize, $pSizeOrder;
?>
- Check out the FAQ here.","wp-youtube-lyte"); ?>
get_item_quantity( 7 );
$rss_items = $rss->get_items( 0, $maxitems );
}
?>
__('Main','wp-youtube-lyte')));
$tabContent="";
if (count($tabs) >= 1) {
if(isset($_GET['page'])){
$currentId = $_GET['page'];
} else {
$currentId = "wp-youtube-lyte";
}
$tabContent .= "";
foreach($tabs as $tabId => $tabName){
if($currentId == $tabId){
$class = " nav-tab-active";
} else{
$class = "";
}
$tabContent .= ''.$tabName.'';
}
$tabContent .= "
";
} else {
$tabContent = "
";
}
return $tabContent;
}
?>