PluginProbe
Slider Ultimate / 2.2.10
Slider Ultimate v2.2.10
2.2.10 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 All 54 releases
ultimate-slider / lib / simple-admin-pages / classes / AdminPageSetting.FileUpload.class.php
AdminPageSetting.FileUpload.class.php
76 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Register, display and save an option for uploading an image/file.
5 *
6 * This setting accepts the following arguments in its constructor function.
7 *
8 * $args = array(
9 * 'id' => 'setting_id', // Unique id
10 * 'title' => 'My Setting', // Title or label for the setting
11 * 'description' => 'Description', // Help text description
12 * );
13 *
14 * @since 2.5
15 * @package Simple Admin Pages
16 */
17
18 class sapAdminPageSettingFileUpload_2_6_19 extends sapAdminPageSetting_2_6_19 {
19
20 public $sanitize_callback = 'esc_url_raw';
21
22 /**
23 * Add in the JS requried to allow file uploading
24 * @since 2.5
25 */
26 public $scripts = array(
27 'sap-file-upload' => array(
28 'path' => 'js/file_upload.js',
29 'dependencies' => array( 'jquery' ),
30 'version' => SAP_VERSION,
31 'footer' => true,
32 ),
33 );
34
35 /**
36 * Display this setting
37 * @since 2.5
38 */
39 public function display_setting() {
40
41 ?>
42
43 <fieldset <?php $this->print_conditional_data(); ?>>
44
45 <span class="sap-file-upload-preview">
46
47 <span class="sap-file-upload-preview-label">
48 <?php _e( 'Current image:', 'simple-admin-pages' ); ?>
49 </span>
50
51 <span class="sap-file-upload-preview-value">
52 <?php echo esc_html( $this->value ); ?>
53 </span>
54
55 </span>
56
57 <?php echo ( $this->value != '' ? '<br /><br />' : '' ); ?>
58
59 <input name="<?php echo esc_attr( $this->get_input_name() ); ?>" type="hidden" id="<?php echo esc_attr( $this->get_input_name() ); ?>" class="file-upload" value="<?php echo esc_attr( $this->value ); ?>" />
60
61 <input class="button sap-file-upload-button" type="button" value="<?php _e( 'Upload Image', 'simple-admin-pages' ); ?>" />
62
63 </fieldset>
64
65 <br /><br />
66
67 <?php $this->display_disabled(); ?>
68
69 <?php
70
71 $this->display_description();
72
73 }
74
75 }
76