| @@ -9,9 +9,9 @@ | ||
| 9 | 9 | |
| 10 | 10 | <div class="wrap"> |
| 11 | 11 | <h2>VdoCipher Options</h2> |
| 12 | 12 | |
| 13 | -<form name="vdoOptionForm" method="post" action="options.php"> | |
| 13 | +<form method="post" action="options.php"> | |
| 14 | 14 | <?php |
| 15 | 15 | settings_fields('vdo_option-group'); |
| 16 | 16 | do_settings_sections('vdo_option-group'); |
| 17 | 17 | ?> |
| @@ -19,26 +19,17 @@ | ||
| 19 | 19 | <p><strong>Status : </strong> Ready to use. You can now embed your videos inside posts and pages.</p> |
| 20 | 20 | </div> |
| 21 | 21 | <table class="form-table"> |
| 22 | 22 | <tr valign="top"> |
| 23 | - <th scope="row">API Secret Key</th> | |
| 24 | - <td> | |
| 25 | - <div style="display: inline-flex;"> | |
| 26 | - <input type="password" name="vdo_client_key" | |
| 23 | + <th scope="row">Client Secret Key</th> | |
| 24 | + <td><input type="text" name="vdo_client_key" | |
| 27 | 25 | value="<?php echo esc_attr(get_option('vdo_client_key')); ?>" |
| 28 | - max-length="64" style="width: 640px" id="vdo_client_key" /> | |
| 29 | - <p style="margin-left:20px; position: relative"> | |
| 30 | - <span id="toggle_span"> | |
| 31 | - <button id="toggle_API_visibility" href="#" data-protected="On">Show API Secret Key</button> | |
| 32 | - </span> | |
| 33 | - </p> | |
| 34 | - </div> | |
| 35 | - </td> | |
| 26 | + max-length="64" style="width: 640px" id="vdo_client_key" /></td> | |
| 36 | 27 | </tr> |
| 37 | 28 | |
| 38 | 29 | <tr valign="top"> |
| 39 | 30 | <th scope="row">Default Width</th> |
| 40 | - <td><input type="text" id="vdo_default_width" name="vdo_default_width" | |
| 31 | + <td><input type="text" name="vdo_default_width" | |
| 41 | 32 | value="<?php echo esc_attr(get_option('vdo_default_width')); ?>" |
| 42 | 33 | /></td> |
| 43 | 34 | </tr> |
| 44 | 35 | |
| @@ -43,166 +34,73 @@ | ||
| 43 | 34 | </tr> |
| 44 | 35 | |
| 45 | 36 | <tr valign="top"> |
| 46 | 37 | <th scope="row">Default Height</th> |
| 47 | - <td><input type="text" id="vdo_default_height" name="vdo_default_height" | |
| 38 | + <td><input type="text" name="vdo_default_height" | |
| 48 | 39 | value="<?php echo esc_attr(get_option('vdo_default_height')); ?>" |
| 49 | 40 | /></td> |
| 50 | 41 | </tr> |
| 51 | 42 | |
| 52 | 43 | <!-- Version Number --> |
| 53 | - <?php | |
| 54 | - if ((get_option('vdo_embed_version')) == false) { | |
| 55 | - update_option('vdo_embed_version', VDOCIPHER_PLAYER_VERSION); | |
| 56 | - } | |
| 44 | + <?php | |
| 45 | + if ((get_option('vdo_embed_version')) == false) { | |
| 46 | + update_option('vdo_embed_version', '0.5'); | |
| 47 | + } | |
| 57 | 48 | ?> |
| 58 | 49 | <tr valign="top"> |
| 59 | 50 | <th scope="row">Player Version</th> |
| 60 | 51 | <td> |
| 61 | - <div style="display: inline-flex"> | |
| 62 | - <select id="vdo_embed_version"> | |
| 52 | + <?php $vdo_embed_version_vars = array('0.5', '1.0.0', '1.1.0', '1.1.3', '1.2.7', '1.3.3', '1.4.4'); ?> | |
| 53 | + <select name="vdo_embed_version" id="vdo_embed_version"> | |
| 63 | 54 | <?php |
| 64 | - $vdo_embed_version_vars = array( | |
| 65 | - '0.5', '1.0.0', '1.1.0', '1.1.3', '1.2.7', '1.3.3', '1.4.5','1.5.0','1.6.4','1.6.10' | |
| 66 | - ); | |
| 67 | - $vdo_embed_version_string = get_option('vdo_embed_version'); | |
| 68 | - foreach ($vdo_embed_version_vars as $vdo_embed_version_var) { | |
| 69 | - if ($vdo_embed_version_string == $vdo_embed_version_var) { | |
| 70 | - $selected = 'selected'; | |
| 71 | - } else { | |
| 72 | - $selected = ''; | |
| 73 | - } | |
| 74 | - switch ($vdo_embed_version_var) { | |
| 75 | - case '0.5': | |
| 76 | - $version_old_new = ' (old player)'; | |
| 77 | - break; | |
| 78 | - case VDOCIPHER_PLAYER_VERSION: | |
| 79 | - $version_old_new = ' (newest player)' ; | |
| 80 | - break; | |
| 81 | - default: | |
| 82 | - $version_old_new = ' (new player)'; | |
| 83 | - break; | |
| 84 | - } | |
| 55 | + $vdo_embed_version_str = get_option('vdo_embed_version'); | |
| 85 | 56 | ?> |
| 57 | + <?php | |
| 58 | + foreach($vdo_embed_version_vars as $vdo_embed_version_var) { | |
| 59 | + if ($vdo_embed_version_str == $vdo_embed_version_var) { | |
| 60 | + $selected = 'selected="selected"'; } | |
| 61 | + else { $selected = ''; } | |
| 62 | + | |
| 63 | + if($vdo_embed_version_var === '0.5') { | |
| 64 | + $version_old_new = ' (old player)' ; } | |
| 65 | + else { | |
| 66 | + $version_old_new = ' (new player)' ; } | |
| 67 | + ?> | |
| 86 | 68 | <option value="<?php echo $vdo_embed_version_var; ?>" <?php echo $selected; ?> > |
| 87 | 69 | <?php echo $vdo_embed_version_var . $version_old_new ; ?> |
| 88 | 70 | </option> |
| 89 | 71 | <?php } ?> |
| 90 | - <option value="Custom Version"> | |
| 91 | - <?php echo 'Custom Version' ?> | |
| 92 | - </option> | |
| 93 | - </select> | |
| 94 | - <input type="text" name="vdo_embed_version" | |
| 95 | - id="vdo_custom_version" | |
| 96 | - style="margin-left:20px; position: relative; width:120px;" /> | |
| 97 | - </div> | |
| 98 | - <p class="description">It is recommended that you use the latest player version for best video playback.</p> | |
| 72 | + </select> | |
| 99 | 73 | </td> |
| 100 | 74 | </tr> |
| 101 | 75 | |
| 102 | 76 | <!-- Player Theme Options --> |
| 103 | 77 | <?php |
| 104 | - if (!(get_option('vdo_player_theme'))) { | |
| 105 | - update_option('vdo_player_theme', '9ae8bbe8dd964ddc9bdb932cca1cb59a'); | |
| 106 | - } | |
| 78 | + if ((get_option('vdo_player_theme')) == false) { | |
| 79 | + update_option('vdo_player_theme','9ae8bbe8dd964ddc9bdb932cca1cb59a'); | |
| 80 | + } | |
| 107 | 81 | ?> |
| 108 | 82 | <tr valign="top"> |
| 109 | 83 | <th scope="row">Player Theme</th> |
| 110 | 84 | <td> |
| 111 | - <div style="display:inline-flex; margin-bottom:10px;"> | |
| 112 | - <input | |
| 113 | - type="text" | |
| 114 | - name="vdo_player_theme" | |
| 115 | - value="<?php echo esc_attr(get_option('vdo_player_theme')); ?>" | |
| 116 | - max-length = "32" | |
| 117 | - style="width: 320px" | |
| 118 | - readonly | |
| 85 | + <input type="text" name="vdo_player_theme" | |
| 86 | + value="<?php echo esc_attr(get_option('vdo_player_theme')); ?>" max-length = "32" style="width: 320px" | |
| 119 | 87 | /> |
| 120 | - <p style="margin-left:20px; position: relative"> | |
| 121 | - <span><a href="<?php menu_page_url('themesvdo', 1); ?> " >Select Custom Player Theme</a><br/> | |
| 122 | - </p> | |
| 123 | - </div> | |
| 124 | - <p class="description"> | |
| 125 | - Player theme is not available for old player version(0.5). The default theme will be applied for old player. | |
| 126 | - </p> | |
| 127 | - | |
| 88 | + <p class="description">Player theme is not available for old player version(0.5). The default theme will be applied for old player.</p> | |
| 128 | 89 | </td> |
| 129 | 90 | </tr> |
| 130 | - <!-- Player Theme Options end--> | |
| 131 | 91 | |
| 132 | - <!-- Player Watermark option - Flash/ HTML5 starts --> | |
| 133 | - <tr id="vdo_watermark_html_flash" valign="top"> | |
| 134 | - <th scope="row"> Choice of Watermark </th> | |
| 135 | - <td> | |
| 136 | - <?php | |
| 137 | - if ((get_option('vdo_watermark_flash_html') == 'html5')) { | |
| 138 | - $vdocheckedhtml5 = 'checked'; | |
| 139 | - $vdocheckedflash = ''; | |
| 140 | - } elseif ((get_option('vdo_watermark_flash_html') == 'flash')) { | |
| 141 | - $vdocheckedhtml5 = ''; | |
| 142 | - $vdocheckedflash = 'checked'; | |
| 143 | - } | |
| 144 | - ?> | |
| 145 | - <input type="radio" class="vdo-htmlflash" | |
| 146 | - value="html5" name="vdo_watermark_flash_html" | |
| 147 | - id="vdo_html5" <?php echo $vdocheckedhtml5; ?> > | |
| 148 | - <label for="vdo_html5">HTML5 (Overlay)</label> | |
| 149 | - | |
| 150 | - <input type="radio" class="vdo-htmlflash" | |
| 151 | - value="flash" name="vdo_watermark_flash_html" | |
| 152 | - id="vdo_flash" <?php echo $vdocheckedflash; ?> > | |
| 153 | - <label for="vdo_flash">Flash (Hard-Coded)</label> | |
| 154 | - </td> | |
| 155 | - </tr> | |
| 156 | - <!-- Player Watermark option - Flash/ HTML5 ends --> | |
| 157 | 92 | <tr valign="top"> |
| 158 | 93 | <th scope="row">Annotation Statement</th> |
| 159 | 94 | <td> |
| 160 | - <div style="display: inline-flex;"> | |
| 161 | - <textarea name="vdo_annotate_code" id="vdo_watermarkjson" | |
| 162 | - type="textarea" rows="6" cols="55" style="display: float-left" | |
| 163 | - ><?php | |
| 95 | + <textarea name="vdo_annotate_code" type="textarea" rows="5" cols="60"><?php | |
| 164 | 96 | if (get_option('vdo_annotate_code') != "") { |
| 165 | 97 | echo get_option('vdo_annotate_code'); |
| 166 | - $vdo_annotation_code = get_option('vdo_annotate_code'); | |
| 167 | 98 | } |
| 168 | 99 | ?></textarea> |
| 169 | - <p class="description" style="margin-left:20px; position: relative"> | |
| 170 | - <span style="color:purple"><b>Sample Code for Dynamic Watermark</b></span><br/> | |
| 171 | - [{'type':'rtext', 'text':' {name}', 'alpha':'0.60', 'color':'0xFF0000','size':'15','interval':'5000'}] <br/> | |
| 172 | - <span style="color:purple"><b>Sample Code for Static Watermark</b></span><br/> | |
| 173 | - [{'type':'text', 'text':'{ip}', 'alpha':'0.5' , 'x':'10', 'y':'100', 'color':'0xFF0000', 'size':'12'}] <br/> | |
| 174 | - </p> | |
| 175 | - </div> | |
| 176 | - <p class="description" id="vdojsonvalidator"></p> | |
| 177 | - <p class="description"> | |
| 178 | - Leave this text blank in case you do not need watermark over all | |
| 179 | - videos. For details on writing the annotation code | |
| 180 | - <a href="https://www.vdocipher.com/blog/2014/12/add-text-to-videos-with-watermark/" target="_blank"> | |
| 181 | - check this out | |
| 182 | - </a> | |
| 183 | - </p> | |
| 100 | + <p class="description">Leave this text blank in case you do not need watermark over all Videos. For details on writing the annotation code <a href="https://www.vdocipher.com/blog/2014/12/add-text-to-videos-with-watermark/" target="_blank">check this out</a></p> | |
| 184 | 101 | </td> |
| 185 | 102 | </tr> |
| 186 | - <tr style="display:none;"> | |
| 187 | - <td>Plugin version no.: </td> | |
| 188 | - <td><input | |
| 189 | - id="vdo_plugin_version" name="vdo_plugin_version" | |
| 190 | - value="<?php echo esc_attr(get_option('vdo_plugin_version')); ?>" readonly> | |
| 191 | - </td> | |
| 192 | - </tr> | |
| 193 | 103 | </table> |
| 194 | - <?php | |
| 195 | - wp_enqueue_script('vdo_validate_watermark', plugin_dir_url(__FILE__).'js/validatewatermark.js'); | |
| 196 | - wp_localize_script('vdo_validate_watermark', 'vdoValidateWatermark', array( | |
| 197 | - 'vdoWatermark' => $vdo_annotation_code | |
| 198 | - )); | |
| 199 | - wp_enqueue_script('vdo_html_flash_choice', plugin_dir_url(__FILE__).'js/flashhtml5choice.js'); | |
| 200 | - wp_enqueue_script('vdo_hide_key', plugin_dir_url(__FILE__).'js/showkey.js'); | |
| 201 | - wp_localize_script('vdo_html_flash_choice', 'vdoVD', array( | |
| 202 | - 'vdoAV' => $vdo_embed_version_vars, | |
| 203 | - 'vdoSV' => $vdo_embed_version_string | |
| 204 | - )); | |
| 205 | - ?> | |
| 206 | 104 | <?php submit_button(); ?> |
| 207 | 105 | </form> |
| 208 | 106 | </div> |