| 1 |
<?php |
| 2 |
if (!defined('ABSPATH')) { |
| 3 |
die('Access denied.'); |
| 4 |
} |
| 5 |
?> |
| 6 |
<div id="submitbox" class="submitbox e2pdf-submitbox"> |
| 7 |
<div id="minor-publishing"> |
| 8 |
<div id="misc-shortcodes-actions"> |
| 9 |
<div class="misc-pub-section"> |
| 10 |
<div class="e2pdf-rel e2pdf-closed"> |
| 11 |
<a href="javascript:void(0);" class="e2pdf-link e2pdf-hidden-dropdown button e2pdf-w100 e2pdf-center <?php if ($this->get->get('action') !== 'edit') { ?>disabled<?php } ?>" <?php if ($this->get->get('action') !== 'edit') { ?>disabled="disabled"<?php } ?>><?php _e('Shortcodes', 'e2pdf') ?> <span class="toggle-indicator" aria-hidden="true"></span></a> |
| 12 |
<div class="e2pdf-hidden-dropdown-content"> |
| 13 |
<?php if ($this->get->get('action') === 'edit') { ?> |
| 14 |
<div class="misc-pub-section misc-pub-e2pdf-shortcode"> |
| 15 |
<input placeholder="<?php _e('Shortcode', 'e2pdf') ?>" class="e2pdf-center e2pdf-copy-field e2pdf-w100" type="text" readonly="readonly" value='[e2pdf-attachment id="<?php echo (int) $this->view->template->get('ID'); ?>"]'> |
| 16 |
</div> |
| 17 |
<div class="misc-pub-section misc-pub-e2pdf-shortcode"> |
| 18 |
<input placeholder="<?php _e('Shortcode', 'e2pdf') ?>" class="e2pdf-center e2pdf-copy-field e2pdf-w100" type="text" readonly="readonly" value='[e2pdf-download id="<?php echo (int) $this->view->template->get('ID'); ?>"]'> |
| 19 |
</div> |
| 20 |
<div class="misc-pub-section misc-pub-e2pdf-shortcode"> |
| 21 |
<input placeholder="<?php _e('Shortcode', 'e2pdf') ?>" class="e2pdf-center e2pdf-copy-field e2pdf-w100" type="text" readonly="readonly" value='[e2pdf-save id="<?php echo (int) $this->view->template->get('ID'); ?>"]'> |
| 22 |
</div> |
| 23 |
<div class="misc-pub-section misc-pub-e2pdf-shortcode"> |
| 24 |
<input placeholder="<?php _e('Shortcode', 'e2pdf') ?>" class="e2pdf-center e2pdf-copy-field e2pdf-w100" type="text" readonly="readonly" value='[e2pdf-view id="<?php echo (int) $this->view->template->get('ID'); ?>"]'> |
| 25 |
</div> |
| 26 |
<div class="misc-pub-section misc-pub-e2pdf-shortcode"> |
| 27 |
<input placeholder="<?php _e('Shortcode', 'e2pdf') ?>" class="e2pdf-center e2pdf-copy-field e2pdf-w100" type="text" readonly="readonly" value='[e2pdf-zapier id="<?php echo (int) $this->view->template->get('ID'); ?>"]'> |
| 28 |
</div> |
| 29 |
<?php } ?> |
| 30 |
</div> |
| 31 |
</div> |
| 32 |
</div> |
| 33 |
</div> |
| 34 |
<div id="minor-publishing-actions"> |
| 35 |
<div class="e2pdf-grid"> |
| 36 |
<div class="e2pdf-ib e2pdf-w50 e2pdf-pr5 e2pdf-align-left"> |
| 37 |
|
| 38 |
<?php if (!$this->get->get('revision_id')) { ?> |
| 39 |
<a class="e2pdf-link e2pdf-modal" data-modal="tpl-options" href="javascript:void(0);"> |
| 40 |
<?php _e('Options', 'e2pdf'); ?> <i class="dashicons dashicons-admin-generic"></i> |
| 41 |
</a> |
| 42 |
<?php } ?> |
| 43 |
</div><div class="e2pdf-ib e2pdf-w50 e2pdf-pl5"> |
| 44 |
<div id="preview-action"> |
| 45 |
<a form-id="e2pdf-build-form" target="_blank" href="<?php echo esc_url($this->helper->get_url(array('page' => 'e2pdf-templates', 'action' => 'preview'))); ?>" class="button e2pdf-w100 e2pdf-center e2pdf-submit-form e2pdf-link" _wpnonce="<?php echo wp_create_nonce('e2pdf_templates'); ?>"><?php _e('Preview', 'e2pdf'); ?></a> |
| 46 |
</div> |
| 47 |
<div class="clear"></div> |
| 48 |
</div> |
| 49 |
</div> |
| 50 |
</div> |
| 51 |
<div class="misc-pub-section"> |
| 52 |
<div class="e2pdf-grid"> |
| 53 |
<div class="e2pdf-ib e2pdf-w50 e2pdf-pr5 e2pdf-align-left"> |
| 54 |
<?php if ($this->view->template->get('pdf')) { ?> |
| 55 |
<a class="e2pdf-link" title="<?php _e('Download Original PDF', 'e2pdf') ?>" target="_blank" href="<?php echo esc_url($this->helper->get_upload_url('pdf/' . $this->view->template->get('pdf') . '/' . $this->view->template->get('pdf') . '.pdf')); ?>"><i class="dashicons dashicons-download"></i></a> |
| 56 |
<?php if (!$this->get->get('revision_id')) { ?> |
| 57 |
<a class="e2pdf-link e2pdf-modal" data-modal="pdf-reupload" title="<?php _e('Replace PDF', 'e2pdf') ?>" href="javascript:void(0);"><i class="dashicons dashicons-upload"></i></a> |
| 58 |
<a class="e2pdf-link e2pdf-delete-pdf" title="<?php _e('Remove PDF', 'e2pdf') ?>" href="javascript:void(0);"><i class="dashicons dashicons-no"></i></a> |
| 59 |
<?php } ?> |
| 60 |
<?php } else { ?> |
| 61 |
<?php if ($this->get->get('action') === 'edit' && !$this->get->get('revision_id')) { ?> |
| 62 |
<a class="e2pdf-link e2pdf-modal" data-modal="pdf-reupload" title="<?php _e('Upload PDF', 'e2pdf') ?>" href="javascript:void(0);"><i class="dashicons dashicons-upload"></i></a> |
| 63 |
<?php } ?> |
| 64 |
<?php } ?> |
| 65 |
<br/><a <?php if ($this->get->get('action') !== 'edit') { ?>disabled="disabled"<?php } ?> target="_blank" href="<?php echo esc_url($this->helper->get_url(array('page' => 'e2pdf-templates', 'action' => 'download', 'id' => $this->view->template->get('ID')))); ?>" class="e2pdf-ib e2pdf-link e2pdf-mt6"><?php _e('Download', 'e2pdf'); ?></a> |
| 66 |
</div><div class="e2pdf-ib e2pdf-w50 e2pdf-pl5 e2pdf-center"> |
| 67 |
<a <?php if ($this->get->get('action') !== 'edit') { ?>disabled="disabled"<?php } ?> target="_blank" href="<?php echo esc_url($this->helper->get_url(array('page' => 'e2pdf-templates', 'action' => 'view', 'id' => $this->view->template->get('ID')))); ?>" class="e2pdf-ib e2pdf-link"><?php _e('View Saved', 'e2pdf'); ?></a><br/> |
| 68 |
<a <?php if (!$this->view->template->get('activated')) { ?>disabled="disabled"<?php } ?> target="_blank" href="<?php echo esc_url($this->helper->get_url(array('page' => 'e2pdf', 'id' => $this->view->template->get('ID')))); ?>" class="e2pdf-ib e2pdf-link e2pdf-mt6 e2pdf-generate-pdf-button"><?php _e('Create PDF', 'e2pdf'); ?></a> |
| 69 |
</div> |
| 70 |
</div> |
| 71 |
</div> |
| 72 |
<div id="misc-activation-actions"> |
| 73 |
<?php if ($this->get->get('action') === 'edit') { ?> |
| 74 |
<div class="misc-pub-section misc-pub-e2pdf-revision"> |
| 75 |
<span id="e2pdf-post-revision"> |
| 76 |
<div class="e2pdf-grid e2pdf-w100"> |
| 77 |
<div class="e2pdf-ib e2pdf-w40"> |
| 78 |
<label for="e2pdf-revision-item" class="e2pdf-small"><?php _e('Revision', 'e2pdf'); ?>:</label> |
| 79 |
<div class="e2pdf-ib e2pdf-small e2pdf-w100 "><?php echo esc_html(sprintf(__("Revisions Limit: %s", 'e2pdf'), max(1, (int) get_option('e2pdf_revisions_limit', '3')))); ?></div> |
| 80 |
</div><div class="e2pdf-ib e2pdf-w60 e2pdf-onload"> |
| 81 |
<?php |
| 82 |
$this->render('field', 'select', array( |
| 83 |
'field' => array( |
| 84 |
'id' => 'e2pdf-revision', |
| 85 |
'name' => 'revision_id', |
| 86 |
'class' => 'e2pdf-w100 e2pdf-small disabled', |
| 87 |
'disabled' => 'disabled' |
| 88 |
), |
| 89 |
'value' => $this->get->get('revision_id') ? $this->get->get('revision_id') : '0', |
| 90 |
'options' => $this->view->template->get('revisions'), |
| 91 |
)); |
| 92 |
?> |
| 93 |
</div> |
| 94 |
</div> |
| 95 |
</span> |
| 96 |
</div> |
| 97 |
<?php } ?> |
| 98 |
<div class="misc-pub-section misc-pub-e2pdf-tpl-hooks"> |
| 99 |
<span id="e2pdf-post-tpl-hooks"> |
| 100 |
<a class="e2pdf-modal e2pdf-link" data-modal="tpl-hooks" href="javascript:void(0);"><?php _e('Integration Hooks', 'e2pdf'); ?></a> |
| 101 |
</span> |
| 102 |
</div> |
| 103 |
<div class="misc-pub-section misc-pub-e2pdf-tpl-actions"> |
| 104 |
<span id="e2pdf-post-tpl-actions"> |
| 105 |
<a class="e2pdf-modal e2pdf-link" data-modal="tpl-actions" href="javascript:void(0);"><?php _e('Global Actions', 'e2pdf'); ?></a> |
| 106 |
</span> |
| 107 |
</div> |
| 108 |
<div class="misc-pub-section misc-pub-e2pdf-tpl-properties"> |
| 109 |
<span id="e2pdf-post-tpl-properties"> |
| 110 |
<a class="e2pdf-modal e2pdf-link" data-modal="tpl-properties" href="javascript:void(0);"><?php _e('Global Properties', 'e2pdf'); ?></a> |
| 111 |
</span> |
| 112 |
</div> |
| 113 |
<div class="misc-pub-section misc-pub-e2pdf-item"> |
| 114 |
<label for="e2pdf-post-item"><?php _e('Connection', 'e2pdf'); ?>:</label> |
| 115 |
<span id="e2pdf-post-item"> |
| 116 |
<?php if ($this->view->template->get('extension') && $this->view->template->get('item') && $this->view->template->extension()->item()) { ?> |
| 117 |
<?php if ($this->view->template->get('item') == '-2') { ?> |
| 118 |
<?php if ($this->view->template->get('item1') || $this->view->template->get('item2')) { ?> |
| 119 |
<?php if ($this->view->template->get('item1')) { ?> |
| 120 |
<?php if ($this->view->template->extension()->item($this->view->template->get('item1'))->url) { ?> |
| 121 |
<a target="_blank" href="<?php echo esc_url($this->view->template->extension()->item($this->view->template->get('item1'))->url); ?>" class="e2pdf-link"> |
| 122 |
<?php echo esc_html($this->view->template->extension()->item($this->view->template->get('item1'))->name); ?> |
| 123 |
</a> |
| 124 |
<?php } else { ?> |
| 125 |
<?php echo $this->view->template->extension()->item($this->view->template->get('item1'))->name ? esc_html($this->view->template->extension()->item($this->view->template->get('item1'))->name) : __('N/A', 'e2pdf'); ?> |
| 126 |
<?php } ?> |
| 127 |
<?php } ?> |
| 128 |
<?php if ($this->view->template->get('item1') && $this->view->template->get('item2')) { ?> |
| 129 |
| |
| 130 |
<?php } ?> |
| 131 |
<?php if ($this->view->template->get('item2')) { ?> |
| 132 |
<?php if ($this->view->template->extension()->item($this->view->template->get('item2'))->url) { ?> |
| 133 |
<a target="_blank" href="<?php echo esc_url($this->view->template->extension()->item($this->view->template->get('item2'))->url); ?>" class="e2pdf-link"> |
| 134 |
<?php echo esc_html($this->view->template->extension()->item($this->view->template->get('item2'))->name); ?> |
| 135 |
</a> |
| 136 |
<?php } else { ?> |
| 137 |
<?php echo $this->view->template->extension()->item($this->view->template->get('item2'))->name ? esc_html($this->view->template->extension()->item($this->view->template->get('item2'))->name) : __('N/A', 'e2pdf'); ?> |
| 138 |
<?php } ?> |
| 139 |
<?php } ?> |
| 140 |
<?php } else { ?> |
| 141 |
<a href="javascript:void(0);" class="e2pdf-link e2pdf-modal e2pdf-color-red" data-modal="tpl-options" <?php if ($this->get->get('revision_id')) { ?>disabled="disabled"<?php } ?> href="javascript:void(0);"><?php _e('Not linked', 'e2pdf'); ?></a> |
| 142 |
<?php } ?> |
| 143 |
<?php } else { ?> |
| 144 |
<?php if ($this->view->template->extension()->item()->url) { ?> |
| 145 |
<a target="_blank" href="<?php echo esc_url($this->view->template->extension()->item()->url); ?>" class="e2pdf-link"><?php echo esc_html($this->view->template->extension()->item()->name); ?></a> |
| 146 |
<?php } else { ?> |
| 147 |
<?php echo $this->view->template->extension()->item()->name ? esc_html($this->view->template->extension()->item()->name) : __('N/A', 'e2pdf'); ?> |
| 148 |
<?php } ?> |
| 149 |
<?php } ?> |
| 150 |
<?php } else { ?> |
| 151 |
<a href="javascript:void(0);" class="e2pdf-link e2pdf-modal e2pdf-color-red" data-modal="tpl-options" <?php if ($this->get->get('revision_id')) { ?>disabled="disabled"<?php } ?> href="javascript:void(0);"><?php _e('Not linked', 'e2pdf'); ?></a> |
| 152 |
<?php } ?> |
| 153 |
</span> |
| 154 |
</div> |
| 155 |
<div class="misc-pub-section misc-pub-e2pdf-activation"> |
| 156 |
<label for="e2pdf-post-activation"><?php _e('Activation', 'e2pdf'); ?>:</label> |
| 157 |
<span id="e2pdf-post-activation"> |
| 158 |
<?php if ($this->view->template->get('activated')) { ?> |
| 159 |
<a class="e2pdf-color-green e2pdf-deactivate-template e2pdf-link" <?php if ($this->get->get('revision_id')) { ?>disabled="disabled"<?php } ?> data-id="<?php echo (int) $this->view->template->get('ID'); ?>" href="javascript:void(0);" _wpnonce="<?php echo wp_create_nonce('e2pdf_templates'); ?>"><?php _e('Activated', 'e2pdf'); ?></a> |
| 160 |
<?php } else { ?> |
| 161 |
<a class="e2pdf-color-red e2pdf-activate-template e2pdf-link" <?php if ($this->get->get('action') !== 'edit' || $this->get->get('revision_id')) { ?>disabled="disabled"<?php } ?> data-id="<?php echo (int) $this->view->template->get('ID'); ?>" href="javascript:void(0);" _wpnonce="<?php echo wp_create_nonce('e2pdf_templates'); ?>"><?php _e('Not Activated', 'e2pdf'); ?></a> |
| 162 |
<?php } ?></span> |
| 163 |
</div> |
| 164 |
</div> |
| 165 |
<?php if (get_option('e2pdf_debug', '0') === '1' && defined('E2PDF_DEVELOPER')) { ?> |
| 166 |
<hr> |
| 167 |
<div class="misc-pub-section"> |
| 168 |
<div class="e2pdf-grid"> |
| 169 |
<div class="e2pdf-ib e2pdf-w100"> |
| 170 |
<div id="convert-action"> |
| 171 |
<a form-id="e2pdf-build-form" target="_blank" href="<?php echo esc_url($this->helper->get_url(array('page' => 'e2pdf-templates', 'action' => 'convert', 'type' => 'php'))); ?>" class="e2pdf-submit-form e2pdf-link" _wpnonce="<?php echo wp_create_nonce('e2pdf_templates'); ?>">PHP</a> |
| 172 |
</div> |
| 173 |
<div class="clear"></div> |
| 174 |
</div> |
| 175 |
</div> |
| 176 |
</div> |
| 177 |
<?php } ?> |
| 178 |
<div class="clear"></div> |
| 179 |
</div> |
| 180 |
<div id="major-publishing-actions"> |
| 181 |
<?php if ($this->get->get('action') === 'edit' && !$this->get->get('revision_id')) { ?> |
| 182 |
<div id="delete-action"> |
| 183 |
<a href="<?php echo esc_url($this->helper->get_url(array('page' => 'e2pdf-templates', 'action' => 'trash', 'id' => $this->view->template->get('ID'), '_wpnonce' => wp_create_nonce('e2pdf_templates')))); ?>" onclick="return confirm('<?php _e('Trash', 'e2pdf'); ?>?')" class="submitdelete deletion"><?php _e('Trash', 'e2pdf'); ?></a> |
| 184 |
</div> |
| 185 |
<?php } ?> |
| 186 |
<div id="publishing-action" class="e2pdf-onload"> |
| 187 |
<span class="spinner"></span> |
| 188 |
<input form-id="e2pdf-build-form" action="e2pdf_save_form" type="button" value="<?php |
| 189 |
if ($this->get->get('revision_id')) { |
| 190 |
_e('Restore', 'e2pdf'); |
| 191 |
} else if ($this->get->get('action') === 'edit') { |
| 192 |
_e('Update', 'e2pdf'); |
| 193 |
} else { |
| 194 |
_e('Save', 'e2pdf'); |
| 195 |
} |
| 196 |
?>" class="e2pdf-submit-form button-primary button-large disabled <?php if ($this->get->get('revision_id')) { ?>restore<?php } ?>" id="e2pdf-submit-side-top" _wpnonce="<?php echo wp_create_nonce('e2pdf_templates'); ?>"> |
| 197 |
</div> |
| 198 |
<div class="clear"></div> |
| 199 |
</div> |
| 200 |
</div> |
| 201 |
|