<?php
/**
* 
*/

// Disallow direct access.
defined('ABSPATH') or die("Access denied");

// Global Comonents eent
$content = '';
echo CJTBlocksMetaBoxView::trigger( 'CJTBlocksMetaBoxView.loadglobalcomponents', $content );

// Block Templates.
require CJTOOLBOX_VIEWS_PATH . '/blocks/block/tmpl/codefile/codefile.html.tmpl';
		
$block = $this->getBlock();

// Display as metabox without using Wordpress Metabox APIs.
if ($this->getOption('customizeMetabox')) : ?>
<div id="cjtoolbox-<?php echo $block->id; ?>" class="postbox">


    <div class="postbox-header">
    
        <h2 class="hndle"><?php echo $this->getMetaboxName(); ?></h2>
        
        <div class="handle-actions hide-if-no-js">
        
            <button type="button" class="handle-order-higher hidden" aria-disabled="false" aria-describedby="cjtoolbox-<?php echo $block->id ?>-handle-order-higher-description">
                <span class="screen-reader-text"> <?php _e('Move up') ?></span>
                <span class="order-higher-indicator" aria-hidden="true"></span>
            </button>
            
            <span class="hidden" id="cjtoolbox-<?php echo $block->id ?>-handle-order-higher-description"><?php _e('Move box up') ?></span>
            
            <button type="button" class="handle-order-lower hidden" aria-disabled="false" aria-describedby="cjtoolbox-<?php echo $block->id ?>-handle-order-lower-description">
                <span class="screen-reader-text"><?php _e('Move down') ?></span>
                <span class="order-lower-indicator" aria-hidden="true"></span>
            </button>
            
            <span class="hidden" id="cjtoolbox-<?php echo $block->id ?>-handle-order-lower-description"><?php _e('Move box down') ?></span>
                
            <button type="button" class="handlediv" aria-expanded="true">
                <span class="screen-reader-text"><?php _e('Toggle panel') ?>: </span>
                <span class="toggle-indicator" aria-hidden="true"></span>
            </button>
            
        </div>
    
    </div>
    
	<div class="inside">
<?php endif; ?>
		<input type="hidden" id="cjt-securityToken" value="<?php echo $this->getSecurityToken() ?>" />
<?php $this->blockView->display();
			if ($this->getOption('customizeMetabox')) : ?>
	</div>
</div>
<?php endif; ?>
<div id="cjt-inline-popup"></div>
<script type="text/javascript">
	// Initialize metabox.
	jQuery(jQuery.proxy(CJTBlocksPage.init, CJTBlocksPage));
</script>