function widget($args, $instance) { extract($args); extract($instance); $title = apply_filters('widget_title', $title); echo $before_widget; if ($show_header == '1') { echo $before_title . $title . $after_title; } rc_slider($slider_id); echo $after_widget; }
/** * renders slider preview * * @return void */ function rcs_render_preview_slider() { $id = isset($_GET['id']) ? $_GET['id'] : 0; ?> <!DOCTYPE html> <html> <head> <link rel="stylesheet" type="text/css" href="<?php echo plugins_url('lib/jquery-ui.css', RCS_PLUGIN_MAIN_FILE); ?> " /> <link rel="stylesheet" type="text/css" href="<?php echo plugins_url('lib/camera/css/camera.css', RCS_PLUGIN_MAIN_FILE); ?> " /> <link rel="stylesheet" type="text/css" href="<?php echo plugins_url('css/admin.css', RCS_PLUGIN_MAIN_FILE); ?> " /> <script type="text/javascript" src="<?php echo plugins_url('lib/jquery-1.8.0.min.js', RCS_PLUGIN_MAIN_FILE); ?> "></script> <script type="text/javascript" src="<?php echo plugins_url('lib/jquery-ui.js', RCS_PLUGIN_MAIN_FILE); ?> "></script> <script type="text/javascript" src="<?php echo plugins_url('lib/camera/scripts/jquery.mobile.customized.min.js', RCS_PLUGIN_MAIN_FILE); ?> "></script> <script type="text/javascript" src="<?php echo plugins_url('lib/camera/scripts/camera.js', RCS_PLUGIN_MAIN_FILE); ?> "></script> <script type="text/javascript"> function rcs_getVimeoThumbnails(vimeoId, slide_id, slider_id){ jQuery.get('https://vimeo.com/api/v2/video/' + vimeoId + '.json', {}, function(response){ var result = new Object(response[0]); if(typeof result == 'object' && result != null && result.thumbnail_small && result.thumbnail_large){ var slide = jQuery('#' + slide_id); if(slide){ slide.data('src', result.thumbnail_large); slide.data('thumb', result.thumbnail_small); } setVimeoThumbnails(slider_id, slide_id, result.thumbnail_large, result.thumbnail_small); } }); } //--------------------------------------------------------- function setVimeoThumbnails(slider_id, slide_id, thumbnail_large, thumbnail_small){ jQuery.post(RCS_ADMIN_URL + 'admin-ajax.php', { action: 'RCS_SET_VIMEO_THUMBNAILS', slider_id: slider_id, slide_id: slide_id, thumbnail_small: thumbnail_small, thumbnail_large: thumbnail_large }, function(response){ }); } </script> </head> <body> <?php rc_slider($id); ?> <div style="clear: both;"></div> </body> </html> <?php exit; }