<!-- Send Template -->

<?php
	
global $post;
$newsletters_theme_id = get_post_meta($post -> ID, '_newsletters_theme_id', true);	
	
?>

<div class="submitbox">
	<div class="misc-pub-section misc-pub-section-last">        
        <div class="scroll-list">	        
            <?php if (apply_filters($this -> pre . '_admin_nonetheme', true)) : ?><div><label><input <?php echo ($newsletters_theme_id == 0 || (empty($newsletters_theme_id) && $this -> default_theme_id('sending') == "")) ? 'checked="checked"' : ''; ?> type="radio" name="newsletters_theme_id" value="0" id="theme0" /> <?php _e('NONE', 'wp-mailinglist'); ?></label></div><?php endif; ?>
            <?php if ($themes = $Theme -> select()) : ?>
                <?php $default_theme_id = $this -> default_theme_id('sending'); ?>
                <?php foreach ($themes as $theme_id => $theme_title) : ?>
                    <div><label><input <?php echo ((!empty($newsletters_theme_id) && $newsletters_theme_id == $theme_id) || (empty($newsletters_theme_id) && $newsletters_theme_id != "0" && $theme_id == $default_theme_id)) ? 'checked="checked"' : ''; ?> type="radio" name="newsletters_theme_id" value="<?php echo $theme_id; ?>" id="newsletters_theme<?php echo $theme_id; ?>" /> <?php echo __($theme_title); ?></label> 
                    <?php if (apply_filters($this -> pre . '_admin_themepreview', true)) : ?><a href="" onclick="jQuery.colorbox({iframe:true, width:'80%', height:'80%', title:'<?php echo __($theme_title); ?>', href:'<?php echo home_url(); ?>/?wpmlmethod=themepreview&amp;id=<?php echo $theme_id; ?>'}); return false;" class=""><i class="fa-solid fa-eye fa-fw"></i></a><?php endif; ?>
                    <?php if (apply_filters('newsletters_admin_createnewsletter_themeedit', true)) : ?><a href="" onclick="jQuery.colorbox({title:'<?php echo sprintf(__('Edit Template: %s', 'wp-mailinglist'), $theme_title); ?>', href:newsletters_ajaxurl + 'action=newsletters_themeedit&security=<?php echo wp_create_nonce('themeedit'); ?>&id=<?php echo $theme_id; ?>'}); return false;" class=""><i class="fa-solid fa-pencil fa-fw"></i></a><?php endif; ?>
                    </div>
                <?php endforeach; ?>
            <?php endif; ?>
        </div>
    </div>
</div>