PluginProbe
Copy Anything to Clipboard for WordPress – Copy Button, Copy Text & Copy Code / 5.2.0
Copy Anything to Clipboard for WordPress – Copy Button, Copy Text & Copy Code v5.2.0
5.5.3 3.1.0 3.2.0 3.2.1 3.3.0 3.4.0 3.4.1 3.4.2 3.4.3 3.5.0 3.5.1 3.5.2 3.6.0 3.7.0 3.8.0 3.8.1 3.8.2 3.8.3 4.0.0 4.0.2 4.0.3 4.0.4 4.0.5 4.1.0 4.1.1 All 78 releases
copy-the-code / includes / add-new-form.php

add-new-form.php in Copy Anything to Clipboard for WordPress – Copy Button, Copy Text & Copy Code 5.2.0, at includes/add-new-form.php

378 lines 16.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Add new Page
4 *
5 * @package Copy the Code
6 * @since 2.0.0
7 */
8
9 ?>
10 <div class="wrap copy-the-code">
11 <div class="wrap">
12 <h1><?php echo esc_html( COPY_THE_CODE_TITLE ); ?> <small>v<?php echo esc_html( COPY_THE_CODE_VER ); ?></small></h1>
13
14 <p>
15 <a href="<?php echo admin_url( 'edit.php?post_type=copy-to-clipboard' ); ?>" class="button">Back to List</a>
16 </p>
17
18 <p class="description"><?php _e( 'Add the new button as per your requirement. See more with <a target="_blank" href="https://clipboard.agency/doc/" target="_blank">getting started guide</a>', 'copy-the-code' ); ?></p>
19
20 <div id="poststuff">
21 <div id="post-body" class="columns-2">
22 <div id="post-body-content">
23
24 <form enctype="multipart/form-data" method="post">
25 <div class="tabs">
26 <div id="tab-general">
27 <table class="form-table">
28 <tr>
29 <th scope="row"><?php _e( 'Selector', 'copy-the-code' ); ?></th>
30 <td>
31 <fieldset>
32 <input type="text" name="selector" class="regular-text" value="<?php echo esc_attr( $data['selector'] ); ?>" />
33 <p class="description"><?php _e( 'It is the selector which contain the content which you want to copy.<br/>Default its &lt;pre&gt; html tag.', 'copy-the-code' ); ?></p>
34 </fieldset>
35 </td>
36 </tr>
37
38 <tr>
39 <th scope="row"><?php _e( 'Style', 'copy-the-code' ); ?></th>
40 <td>
41 <fieldset>
42 <select name="style" class="style">
43 <option value="button">Button</option>
44 <option value="svg-icon">SVG Icon</option>
45 <option value="cover">Cover</option>
46 </select>
47
48 </fieldset>
49 <p class="description"><?php _e( 'Select the button style.', 'copy-the-code' ); ?></p>
50 </td>
51 </tr>
52 <tr>
53 <th scope="row"><?php _e( 'Button Position', 'copy-the-code' ); ?></th>
54 <td>
55 <fieldset>
56 <select name="button-position" class="button-position">
57 <option value="inside" <?php selected( $data['button-position'], 'inside' ); ?>><?php echo 'Inside'; ?></option>
58 <option value="outside" <?php selected( $data['button-position'], 'outside' ); ?>><?php echo 'Outside'; ?></option>
59 </select>
60 <p class="description"><?php _e( 'Button Position Inside/Outside. Default Inside.', 'copy-the-code' ); ?></p>
61 </fieldset>
62 </td>
63 </tr>
64 <tr>
65 <th scope="row"><?php _e( 'Copy Format', 'copy-the-code' ); ?></th>
66 <td>
67 <fieldset>
68 <select name="copy-format" class="copy-format">
69 <option value="default" <?php selected( $data['copy-format'], 'default' ); ?>><?php echo 'Default'; ?></option>
70 <option value="google-docs" <?php selected( $data['copy-format'], 'google-docs' ); ?>><?php echo 'Google Docs'; ?></option>
71 <option value="email" <?php selected( $data['copy-format'], 'email' ); ?>><?php echo 'Email'; ?></option>
72 </select>
73 <p class="description"><?php _e( 'Copy the content for specific format.', 'copy-the-code' ); ?></p>
74 </fieldset>
75 </td>
76 </tr>
77 </table>
78 </div>
79 <div id="tab-style">
80 <table class="form-table">
81 <tr>
82 <th scope="row"><?php _e( 'Button Text', 'copy-the-code' ); ?></th>
83 <td>
84 <fieldset>
85 <input type="text" name="button-text" class="regular-text" value="<?php echo esc_attr( $data['button-text'] ); ?>" />
86 <p class="description"><?php _e( 'Copy button text. Default \'Copy\'.', 'copy-the-code' ); ?></p>
87 </fieldset>
88 </td>
89 </tr>
90 <tr>
91 <th scope="row"><?php _e( 'Button Copy Text', 'copy-the-code' ); ?></th>
92 <td>
93 <fieldset>
94 <input type="text" name="button-copy-text" class="regular-text" value="<?php echo esc_attr( $data['button-copy-text'] ); ?>" />
95 <p class="description"><?php _e( 'Copy button text which appear after click on it. Default \'Copied!\'.', 'copy-the-code' ); ?></p>
96 </fieldset>
97 </td>
98 </tr>
99 <tr>
100 <th scope="row"><?php _e( 'Button Title', 'copy-the-code' ); ?></th>
101 <td>
102 <fieldset>
103 <input type="text" name="button-title" class="regular-text" value="<?php echo esc_attr( $data['button-title'] ); ?>" />
104 <p class="description"><?php _e( 'It is showing on hover on the button. Default \'Copy to Clipboard\'.', 'copy-the-code' ); ?></p>
105 </fieldset>
106 </td>
107 </tr>
108 </table>
109 </div>
110 </div>
111
112 <input type="hidden" name="message" value="saved" />
113 <?php wp_nonce_field( 'copy-the-code-nonce', 'copy-the-code' ); ?>
114
115 <?php submit_button( 'Create' ); ?>
116 </form>
117 </div>
118 <div class="postbox-container" id="postbox-container-1">
119 <h3>Preview:</h3>
120 <div id="preview"></div>
121
122 <?php
123 /**
124 * Customization Options
125 */
126 $stored = get_option( 'ctc_default_style' );
127 if ( empty( $stored ) ) {
128 $stored = [];
129 }
130
131 $data = [
132 'btn_color' => isset( $stored['btn_color'] ) ? $stored['btn_color'] : '#424242',
133 'btn_bg_color' => isset( $stored['btn_bg_color'] ) ? $stored['btn_bg_color'] : '#e1e3e8',
134 'btn_font_size' => isset( $stored['btn_font_size'] ) ? $stored['btn_font_size'] : '14',
135 'btn_line_height' => isset( $stored['btn_line_height'] ) ? $stored['btn_line_height'] : '18',
136 'btn_t_padding' => isset( $stored['btn_t_padding'] ) ? $stored['btn_t_padding'] : '10',
137 'btn_r_padding' => isset( $stored['btn_r_padding'] ) ? $stored['btn_r_padding'] : '20',
138 'btn_b_padding' => isset( $stored['btn_b_padding'] ) ? $stored['btn_b_padding'] : '10',
139 'btn_l_padding' => isset( $stored['btn_l_padding'] ) ? $stored['btn_l_padding'] : '20',
140 'btn_l_margin' => isset( $stored['btn_l_margin'] ) ? $stored['btn_l_margin'] : '0',
141 'btn_t_margin' => isset( $stored['btn_t_margin'] ) ? $stored['btn_t_margin'] : '0',
142 'btn_r_margin' => isset( $stored['btn_r_margin'] ) ? $stored['btn_r_margin'] : '0',
143 'btn_b_margin' => isset( $stored['btn_b_margin'] ) ? $stored['btn_b_margin'] : '0',
144 'btn_tl_radius' => isset( $stored['btn_tl_radius'] ) ? $stored['btn_tl_radius'] : '0',
145 'btn_tr_radius' => isset( $stored['btn_tr_radius'] ) ? $stored['btn_tr_radius'] : '0',
146 'btn_br_radius' => isset( $stored['btn_br_radius'] ) ? $stored['btn_br_radius'] : '0',
147 'btn_bl_radius' => isset( $stored['btn_bl_radius'] ) ? $stored['btn_bl_radius'] : '0',
148 'btn_h_color' => isset( $stored['btn_h_color'] ) ? $stored['btn_h_color'] : '#424242',
149 'btn_h_bg_color' => isset( $stored['btn_h_bg_color'] ) ? $stored['btn_h_bg_color'] : '#d0d1d6',
150
151 // SVG Icon
152 'svg_icon_color' => isset( $stored['svg_icon_color'] ) ? $stored['svg_icon_color'] : '#23282d',
153 'svg_icon_h_color' => isset( $stored['svg_icon_h_color'] ) ? $stored['svg_icon_h_color'] : '#23282d',
154 'svg_icon_width' => isset( $stored['svg_icon_width'] ) ? $stored['svg_icon_width'] : '20',
155 'svg_icon_t_padding' => isset( $stored['svg_icon_t_padding'] ) ? $stored['svg_icon_t_padding'] : '10',
156 'svg_icon_r_padding' => isset( $stored['svg_icon_r_padding'] ) ? $stored['svg_icon_r_padding'] : '10',
157 'svg_icon_b_padding' => isset( $stored['svg_icon_b_padding'] ) ? $stored['svg_icon_b_padding'] : '10',
158 'svg_icon_l_padding' => isset( $stored['svg_icon_l_padding'] ) ? $stored['svg_icon_l_padding'] : '10',
159
160 // Cover
161 'cover_color' => isset( $stored['cover_color'] ) ? $stored['cover_color'] : '#ffffff',
162 'cover_font_size' => isset( $stored['cover_font_size'] ) ? $stored['cover_font_size'] : '14',
163 ];
164 $is_free = ctc_fs()->is_not_paying() ? 'is-free' : 'is-pro';
165 ?>
166 <form id="ctc-style-form" class="<?php echo $is_free; ?>">
167
168 <?php if ( ctc_fs()->is_not_paying() ) { ?>
169 <div class="upgrade">
170 <a href="<?php echo ctc_fs()->get_upgrade_url(); ?>">
171 <?php esc_html_e( 'Upgrade to Premium to Access', 'copy-the-code' ); ?>
172 </a>
173 </div>
174 <?php } ?>
175
176 <table class="style-svg-icon widefat striped">
177 <tr>
178 <th colspan="2">
179 <b>Normal Style</b>
180 </th>
181 </tr>
182 <tr>
183 <td>Icon Color</td>
184 <td>
185 <input type="color" class="ctc-svg-icon-color" name="ctc-svg-icon-color" value="<?php echo $data['svg_icon_color']; ?>" />
186 </td>
187 </tr>
188 <tr>
189 <td>Icon Size</td>
190 <td>
191 <input type="number" class="ctc-svg-icon-width" name="ctc-svg-icon-width" value="<?php echo $data['svg_icon_width']; ?>" />
192 </td>
193 </tr>
194 <tr>
195 <td>Icon Padding</td>
196 <td>
197 <input type="number" class="ctc-svg-icon-t-padding" name="ctc-svg-icon-t-padding" value="<?php echo $data['svg_icon_t_padding']; ?>" />
198 <input type="number" class="ctc-svg-icon-r-padding" name="ctc-svg-icon-r-padding" value="<?php echo $data['svg_icon_r_padding']; ?>" />
199 <input type="number" class="ctc-svg-icon-b-padding" name="ctc-svg-icon-b-padding" value="<?php echo $data['svg_icon_b_padding']; ?>" />
200 <input type="number" class="ctc-svg-icon-l-padding" name="ctc-svg-icon-l-padding" value="<?php echo $data['svg_icon_l_padding']; ?>" />
201 </td>
202 </tr>
203 <tr>
204 <th colspan="2">
205 <b>Hover Style</b>
206 </th>
207 </tr>
208 <tr>
209 <td>Icon Color</td>
210 <td>
211 <input type="color" class="ctc-svg-icon-h-color" name="ctc-svg-icon-h-color" value="<?php echo $data['svg_icon_h_color']; ?>" />
212 </td>
213 </tr>
214 <tr>
215 <td colspan="2" align="right">
216 <input type="hidden" name="nonce" value="<?php echo wp_create_nonce( 'ctc-save-style' ); ?>" />
217 <input type="submit" class="button button-primary" value="Save Changes" />
218 </td>
219 </tr>
220 </table>
221 <table class="style-cover widefat striped">
222 <tr>
223 <td>Text Color</td>
224 <td>
225 <input type="color" class="ctc-cover-color" name="ctc-cover-color" value="<?php echo $data['cover_color']; ?>" />
226 </td>
227 </tr>
228 <tr>
229 <td>Font Size</td>
230 <td>
231 <input type="number" class="ctc-cover-font-size" name="ctc-cover-font-size" value="<?php echo $data['cover_font_size']; ?>" />
232 </tr>
233 <tr>
234 <tr>
235 <td colspan="2" align="right">
236 <input type="hidden" name="nonce" value="<?php echo wp_create_nonce( 'ctc-save-style' ); ?>" />
237 <input type="submit" class="button button-primary" value="Save Changes" />
238 </td>
239 </tr>
240 </table>
241 <table class="style-button widefat striped">
242 <tr>
243 <th colspan="2">
244 <b>Normal Style</b>
245 </th>
246 </tr>
247 <tr>
248 <td>Button Color</td>
249 <td>
250 <input type="color" class="ctc-btn-color" name="ctc-btn-color" value="<?php echo $data['btn_color']; ?>" />
251 </td>
252 </tr>
253 <tr>
254 <td>Button Background Color</td>
255 <td>
256 <input type="color" class="ctc-btn-bg-color" name="ctc-btn-bg-color" value="<?php echo $data['btn_bg_color']; ?>" />
257 </td>
258 </tr>
259 <tr>
260 <td>Font Size</td>
261 <td>
262 <input type="number" class="ctc-btn-font-size" name="ctc-btn-font-size" value="<?php echo $data['btn_font_size']; ?>" />
263 </tr>
264 <tr>
265 <td>Line Height</td>
266 <td>
267 <input type="number" class="ctc-btn-line-height" name="ctc-btn-line-height" value="<?php echo $data['btn_line_height']; ?>" />
268 </td>
269 </tr>
270 <tr>
271 <td>Button Padding</td>
272 <td>
273 <input type="number" class="ctc-btn-t-padding" name="ctc-btn-t-padding" value="<?php echo $data['btn_t_padding']; ?>" />
274 <input type="number" class="ctc-btn-r-padding" name="ctc-btn-r-padding" value="<?php echo $data['btn_r_padding']; ?>" />
275 <input type="number" class="ctc-btn-b-padding" name="ctc-btn-b-padding" value="<?php echo $data['btn_b_padding']; ?>" />
276 <input type="number" class="ctc-btn-l-padding" name="ctc-btn-l-padding" value="<?php echo $data['btn_l_padding']; ?>" />
277 </td>
278 </tr>
279 <tr>
280 <td>Button Margin</td>
281 <td>
282 <input type="number" class="ctc-btn-t-margin" name="ctc-btn-t-margin" value="<?php echo $data['btn_t_margin']; ?>" />
283 <input type="number" class="ctc-btn-r-margin" name="ctc-btn-r-margin" value="<?php echo $data['btn_r_margin']; ?>" />
284 <input type="number" class="ctc-btn-b-margin" name="ctc-btn-b-margin" value="<?php echo $data['btn_b_margin']; ?>" />
285 <input type="number" class="ctc-btn-l-margin" name="ctc-btn-l-margin" value="<?php echo $data['btn_l_margin']; ?>" />
286 </td>
287 </tr>
288 <tr>
289 <td>Border Radius</td>
290 <td>
291 <input type="number" class="ctc-btn-tl-radius" name="ctc-btn-tl-radius" value="<?php echo $data['btn_tl_radius']; ?>" />
292 <input type="number" class="ctc-btn-tr-radius" name="ctc-btn-tr-radius" value="<?php echo $data['btn_tr_radius']; ?>" />
293 <input type="number" class="ctc-btn-br-radius" name="ctc-btn-br-radius" value="<?php echo $data['btn_br_radius']; ?>" />
294 <input type="number" class="ctc-btn-bl-radius" name="ctc-btn-bl-radius" value="<?php echo $data['btn_bl_radius']; ?>" />
295 </td>
296 </tr>
297 <tr>
298 <th colspan="2">
299 <b>Hover Style</b>
300 </th>
301 </tr>
302 <tr>
303 <td>Button Color</td>
304 <td>
305 <input type="color" class="ctc-btn-h-color" name="ctc-btn-h-color" value="<?php echo $data['btn_h_color']; ?>" />
306 </td>
307 </tr>
308 <tr>
309 <td>Button Background Color</td>
310 <td>
311 <input type="color" class="ctc-btn-h-bg-color" name="ctc-btn-h-bg-color" value="<?php echo $data['btn_h_bg_color']; ?>" />
312 </td>
313 </tr>
314 <tr>
315 <td colspan="2" align="right">
316 <input type="hidden" name="nonce" value="<?php echo wp_create_nonce( 'ctc-save-style' ); ?>" />
317 <input type="submit" class="button button-primary" value="Save Changes" />
318 </td>
319 </tr>
320 </table>
321 </form>
322
323 <div class="postbox">
324 <h2 class="hndle"><span><?php _e( 'Getting Started', 'copy-the-code' ); ?></span></h2>
325 <div class="inside">
326 <div class="table-of-contents">
327 <ol class="items">
328 <li><a target="_blank" href="https://clipboard.agency/doc/">Way 1 - Copy with Shortcode</a>
329 <ol>
330 <li><a target="_blank" href="https://clipboard.agency/doc/">Example 1: Copy Same Display Text in
331 Clipboard</a></li>
332 <li><a target="_blank" href="https://clipboard.agency/doc/">Example 2: Copy Different
333 Text than Display Text in Clipboard</a></li>
334 <li><a target="_blank" href="https://clipboard.agency/doc/">Shortcode Parameters</a>
335 </li>
336 </ol>
337 </li>
338 <li><a target="_blank" href="https://clipboard.agency/doc/">Way 2 - Copy with Target</a>
339 <ol>
340 <li><a target="_blank" href="https://clipboard.agency/doc/">Use Case 1: How to add the copy
341 button to Blockquote</a></li>
342 <li><a target="_blank" href="https://clipboard.agency/doc/">Use Case 2: How to add the copy
343 button to Code Snippet</a></li>
344 <li><a target="_blank" href="https://clipboard.agency/doc/">Use Case 3: How to add the copy button
345 to HTML list</a>
346 </li>
347 </ol>
348 </li>
349 <li><a target="_blank" href="https://clipboard.agency/doc/">Other Customizations</a></li>
350 </ol>
351 </div>
352 </div>
353 </div>
354
355 <div class="postbox">
356 <h2 class="hndle"><span><?php _e( 'Support', 'copy-the-code' ); ?></span></h2>
357 <div class="inside">
358 <p><?php _e( 'Do you have any issue with this plugin? Or Do you have any suggessions?', 'copy-the-code' ); ?></p>
359 <p><?php _e( 'Please don\'t hesitate to <a href="https://clipboard.agency/doc/" target="_blank">send request »</a>.', 'copy-the-code' ); ?></p>
360 </div>
361 </div>
362
363 <?php if ( ctc_fs()->is_not_paying() ) { ?>
364 <div class="postbox">
365 <h2 class="hndle"><span><?php _e( 'Donate', 'copy-the-code' ); ?></span></h2>
366 <div class="inside">
367 <p><?php _e( 'Would you like to support the advancement of this plugin?', 'copy-the-code' ); ?></p>
368 <a href="https://www.paypal.me/mwaghmare7/" target="_blank" class="button button-primary"><?php _e( 'Donate Now!', 'copy-the-code' ); ?></a>
369 </div>
370 </div>
371 <?php } ?>
372
373 </div>
374 </div>
375 </div>
376 </div>
377 </div>
378