Beispiel #1
0
<?php

/* @var FUE_Email $email */
$templates = fue_get_installed_templates();
?>
<select id="template" name="template" class="select2" data-placeholder="<?php 
_e('Please select a template', 'follow_up_emails');
?>
" style="width: 100%;">
    <option value=""></option>
    <?php 
foreach ($templates as $template) {
    $template = basename($template);
    $tpl = new FUE_Email_Template($template);
    $name = $tpl->name;
    if (!$name) {
        $name = $template;
    }
    ?>
    <option value="<?php 
    echo $template;
    ?>
" <?php 
    selected(basename($email->template), $template);
    ?>
><?php 
    echo wp_kses($name, array());
    ?>
</option>
    <?php 
}
 /**
  * Get a list of the installed templates
  * @return array
  */
 public function get_templates()
 {
     $templates = fue_get_installed_templates();
     $output = array();
     foreach ($templates as $template) {
         $tpl = new FUE_Email_Template($template);
         $output[] = array('template' => array('id' => basename($template), 'name' => $tpl->name, 'sections' => $tpl->get_sections()));
     }
     return $output;
 }
Beispiel #3
0
        ?>
</li>
            <?php 
    }
    ?>
        </ul>

        <h3><?php 
    _e('Templates', 'follow_up_emails');
    ?>
</h3>

        <ul class="fue-templates">
            <?php 
    $templates = $fue_addons->get_templates();
    $installed_templates = array_map('basename', fue_get_installed_templates());
    if (empty($templates)) {
        echo '<li>' . __('No templates available', 'follow_up_emails') . '</li>';
    } else {
        foreach ($templates as $id => $template) {
            ?>
                    <li><?php 
            include FUE_TEMPLATES_DIR . '/add-ons/template-item.php';
            ?>
</li>
                <?php 
        }
    }
    ?>
        </ul>
    <?php