# e2pdf/1.03.07/classes/view/page-e2pdf-settings.php

E2Pdf – Export Pdf Tool for WordPress, version 1.03.07. 142 lines.

- Page: https://pluginprobe.com/plugins/e2pdf/1.03.07/code/classes/view/page-e2pdf-settings.php
- Raw: https://pluginprobe.com/plugins/e2pdf/1.03.07/raw/classes/view/page-e2pdf-settings.php
- Modified: 2018-12-25T15:41:54+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/e2pdf/1.03.07/code/classes/view/page-e2pdf-settings.php#L10-L20`.

```php
<?php
if (!defined('ABSPATH')) {
    die('Access denied.');
}
?>
<div class="wrap">
    <h1><?php _e('Settings', 'e2pdf'); ?></h1>
    <hr class="wp-header-end">
    <?php $this->render('blocks', 'notifications'); ?>
    <h3 class="nav-tab-wrapper wp-clearfix">
        <?php foreach ($this->view->groups as $group_key => $group) { ?>
            <?php if (isset($group['action']) && isset($group['group'])) { ?>
                <a href="<?php echo $this->helper->get_url(array('page' => 'e2pdf-settings', 'action' => $group['action'], 'group' => $group['group'])); ?>" class="nav-tab <?php if ($this->get->get('action') === $group['action'] && $this->get->get('group') === $group['group']) { ?>nav-tab-active<?php } ?>"><?php echo $group['name']; ?></a>
            <?php } elseif (isset($group['action'])) { ?>
                <a href="<?php echo $this->helper->get_url(array('page' => 'e2pdf-settings', 'action' => $group['action'])); ?>" class="nav-tab <?php if ($this->get->get('action') === $group['action']) { ?>nav-tab-active<?php } ?>"><?php echo $group['name']; ?></a>
            <?php } else { ?>
                <a href="<?php echo $this->helper->get_url(array('page' => 'e2pdf-settings')); ?>" class="nav-tab <?php if (!$this->get->get('action')) { ?>nav-tab-active<?php } ?>"><?php echo $group['name']; ?></a>
            <?php } ?>
        <?php } ?>
    </h3>
    <div class="wrap">
        <?php if ($this->get->get('action') == 'fonts') { ?>
            <div class="e2pdf-view-area">
                <form enctype="multipart/form-data" method="post">
                    <input type="hidden" name="_nonce" value="<?php echo wp_create_nonce('e2pdf_post') ?>">
                    <ul class="e2pdf-fonts-list">
                        <li><h4><?php _e('Upload Font', 'e2pdf'); ?>:</h4></li>
                        <li>
                            <div class="e2pdf-name"><?php _e('Font', 'e2pdf'); ?>:
                            </div><div class="e2pdf-value">
                                <input name="font" type="file">
                                <div class="e2pdf-note"><?php _e('Allowed filetypes', 'e2pdf'); ?>: <strong>.ttf</strong></div>
                            </div>
                        </li>
                        <li>
                            <div class="e2pdf-name"></div><div class="e2pdf-value">
                                <input class="button-primary button-large" type="submit" value="<?php _e('Upload', 'e2pdf'); ?>"> 
                            </div>
                        </li>
                    </ul>
                </form>
                <div class="e2pdf-rel">
                    <form>
                        <div class="e2pdf-form-loader"><span class="spinner"></span></div>
                        <ul class="e2pdf-fonts-list">
                            <li><h4><?php _e('Available Fonts', 'e2pdf'); ?>:</h4></li>
                            <?php foreach ($this->view->fonts as $key => $value) { ?>
                                <li>
                                    <div class="e2pdf-name">
                                        <strong><?php echo $value; ?></strong> (<?php echo $key; ?>)
                                    </div><div class="e2pdf-value">
                                        <a class="e2pdf-link" href="<?php echo $this->helper->get_upload_url('fonts/' . $key); ?>" target="_blank"><i class="dashicons dashicons-download"></i></a>
                                        <?php if ($key === 'NotoSans-Regular.ttf') { ?>
                                            <a class="e2pdf-link" disabled="disabled" data-font="<?php echo $key; ?>" href="javascript:void(0);"><i class="dashicons dashicons-no"></i></a>
                                        <?php } else { ?>
                                            <a class="e2pdf-link e2pdf-delete-font" data-font="<?php echo $key; ?>" href="javascript:void(0);"><i class="dashicons dashicons-no"></i></a>
                                        <?php } ?>
                                    </div>

                                </li>
                            <?php } ?>
                        </ul>
                    </form>
                </div>
            </div>
        <?php } else { ?>
            <div class="e2pdf-view-area">
                <?php if (isset($group['action']) && isset($group['group'])) { ?>
                    <form method="post" action="<?php echo $this->helper->get_url(array('page' => 'e2pdf-settings', 'action' => $this->get->get('action'), 'group' => $this->get->get('group'))); ?>">
                    <?php } elseif (isset($group['action'])) { ?>
                        <form method="post" action="<?php echo $this->helper->get_url(array('page' => 'e2pdf-settings', 'action' => $this->get->get('action'))); ?>">
                        <?php } else { ?>
                            <form method="post" action="<?php echo $this->helper->get_url(array('page' => 'e2pdf-settings')); ?>">
                            <?php } ?>

                            <input type="hidden" name="_nonce" value="<?php echo wp_create_nonce('e2pdf_post') ?>">
                            <ul class="e2pdf-options-list">
                                <?php foreach ($this->view->options as $group_key => $group) { ?>
                                    <?php foreach ($group['options'] as $option_key => $option_value) { ?>
                                        <?php if (isset($option_value['header'])) { ?>
                                            <li><h4><?php echo $option_value['header']; ?></h4></li>
                                        <?php } ?>
                                        <?php if ($option_value['type'] != 'hidden') { ?>
                                            <li>
                                                <div class="e2pdf-name">
                                                    <?php echo $option_value['name']; ?>:
                                                </div><div class="e2pdf-value">
                                                    <?php
                                                    if ($option_value['type'] == 'checkbox') {
                                                        $this->render('field', 'checkbox', array(
                                                            'field' => array(
                                                                'name' => $option_value['key'],
                                                                'placeholder' => isset($option_value['placeholder']) ? $option_value['placeholder'] : ''
                                                            ),
                                                            'value' => isset($option_value['value']) ? $option_value['value'] : '',
                                                            'checkbox_value' => 1,
                                                            'default_value' => isset($option_value['default_value']) ? $option_value['default_value'] : '',
                                                        ));
                                                    } elseif ($option_value['type'] == 'text') {
                                                        $this->render('field', 'text', array(
                                                            'field' => array(
                                                                'name' => isset($option_value['key']) ? $option_value['key'] : '',
                                                                'placeholder' => isset($option_value['placeholder']) ? $option_value['placeholder'] : '',
                                                                'class' => isset($option_value['class']) ? 'e2pdf-w100 ' . $option_value['class'] : 'e2pdf-w100'
                                                            ),
                                                            'value' => $option_value['value'],
                                                        ));
                                                    } elseif ($option_value['type'] == 'textarea') {
                                                        $this->render('field', 'textarea', array(
                                                            'field' => array(
                                                                'name' => isset($option_value['key']) ? $option_value['key'] : '',
                                                                'style' => 'height: 100px;',
                                                                'class' => 'e2pdf-w100',
                                                                'placeholder' => isset($option_value['placeholder']) ? $option_value['placeholder'] : '',
                                                            ),
                                                            'value' => isset($option_value['value']) ? $option_value['value'] : '',
                                                        ));
                                                    } elseif ($option_value['type'] == 'select') {
                                                        $this->render('field', 'select', array(
                                                            'field' => array(
                                                                'name' => isset($option_value['key']) ? $option_value['key'] : '',
                                                                'class' => 'e2pdf-w100'
                                                            ),
                                                            'value' => isset($option_value['value']) ? $option_value['value'] : '',
                                                            'options' => isset($option_value['options']) ? $option_value['options'] : ''
                                                        ));
                                                    }
                                                    ?>
                                                </div>
                                            </li>
                                        <?php } ?>
                                    <?php } ?>
                                <?php } ?>
                            </ul>
                            <?php submit_button(); ?>
                        </form>
                        </div>
                    <?php } ?>

                    </div>
                    </div>
                    <?php $this->render('blocks', 'debug-panel'); ?>
```
