コード例 #1
0
ファイル: admin.php プロジェクト: HugoLS/Variation
 /**
  * Load gmedia pages in wpless interface
  */
 function gmedia_blank_page()
 {
     set_current_screen('GrandMedia_Settings');
     global $gmCore;
     $gmediablank = $gmCore->_get('gmediablank', '');
     /*
     add_filter('admin_body_class', function(){
     	$gmediablank = isset($_GET['gmediablank'])? $_GET['gmediablank'] : '';
     	return "gmedia-blank $gmediablank"; });
     */
     add_filter('admin_body_class', create_function('', '$gmediablank = isset($_GET["gmediablank"])? $_GET["gmediablank"] : ""; return "gmedia-blank $gmediablank";'));
     define('IFRAME_REQUEST', true);
     iframe_header('GmediaGallery');
     switch ($gmediablank) {
         case 'update_plugin':
             require_once dirname(dirname(__FILE__)) . '/update.php';
             gmedia_do_update();
             break;
         case 'image_editor':
             require_once dirname(dirname(__FILE__)) . '/inc/image-editor.php';
             gmedia_image_editor();
             break;
     }
     iframe_footer();
     exit;
 }
コード例 #2
0
ファイル: update.php プロジェクト: pasyuk/grand-media
function gmedia_upgrade_progress_panel()
{
    gmedia_do_update();
    ?>
    <div id="gmediaUpdate" class="panel panel-default">
        <div class="panel-body">
            <div id="gmUpdateProgress">

            </div>
            <div class="gm_upgrade_busy"><img src="<?php 
    echo plugin_dir_url(dirname(__FILE__)) . 'admin/assets/img/loading.gif';
    ?>
" alt="updating..."/></div>
        </div>
        <script type="text/javascript">
            jQuery(function() {
                gmUpdateProgress();
            });
            function gmUpdateProgress() {
                jQuery.ajax({
                    type: "get",
                    dataType: "json",
                    url: ajaxurl,
                    data: {action: 'gmedia_upgrade_process'}
                }).done(function(data) {
                    if(data.content) {
                        jQuery('#gmUpdateProgress').html(data.content);
                    }
                    if(data.status == 'done') {
                        jQuery('.gm_upgrade_busy').remove();
                        if('' == data.content) {
                            jQuery('#gmUpdateProgress').append('<p><a class="btn btn-success" href="<?php 
    echo admin_url('admin.php?page=GrandMedia');
    ?>
"><?php 
    _e('Go to Gmedia Library', 'grand-media');
    ?>
</a></p>');
                        }
                        return;
                    } else {
                        setTimeout(function() { gmUpdateProgress(); }, 2000);
                    }
                });
            }
        </script>
    </div>
    <?php 
}
コード例 #3
0
ファイル: admin.php プロジェクト: pasyuk/grand-media
 /**
  * Load gmedia pages in wpless interface
  */
 function gmedia_blank_page()
 {
     set_current_screen('GrandMedia_Settings');
     global $gmCore, $gmProcessor;
     $gmediablank = $gmCore->_get('gmediablank', '');
     define('IFRAME_REQUEST', true);
     iframe_header('GmediaGallery');
     echo '<div id="gmedia-container">';
     switch ($gmediablank) {
         case 'update_plugin':
             require_once dirname(dirname(__FILE__)) . '/config/update.php';
             gmedia_do_update();
             break;
         case 'image_editor':
             require_once dirname(dirname(__FILE__)) . '/inc/image-editor.php';
             gmedia_image_editor();
             break;
         case 'map_editor':
             require_once dirname(dirname(__FILE__)) . '/inc/map-editor.php';
             gmedia_map_editor();
             break;
         case 'library':
             echo '<div id="gmedia_iframe_content">';
             echo '<div id="gm-message">' . $gmCore->alert('success', $gmProcessor->msg) . $gmCore->alert('danger', $gmProcessor->error) . '</div>';
             include GMEDIA_ABSPATH . 'admin/pages/library/library.php';
             echo '</div>';
             break;
         case 'comments':
             require_once dirname(__FILE__) . '/tpl/comments.php';
             break;
         case 'module_preview':
             require_once dirname(__FILE__) . '/tpl/module-preview.php';
             break;
     }
     echo '</div>';
     iframe_footer();
     exit;
 }