| @@ -1,134 +1,309 @@ | ||
| 1 | -<?php | |
| 1 | +<?php | |
| 2 | +if ( ! defined( 'ABSPATH' ) ) | |
| 3 | + exit; | |
| 2 | 4 | |
| 3 | 5 | global $wpdb; |
| 4 | -global $current_user; | |
| 5 | -get_currentuserinfo(); | |
| 6 | - | |
| 7 | -$xyz_ips_snippetId = $_GET['snippetId']; | |
| 8 | - | |
| 6 | +$goback=1; | |
| 7 | +$xyz_ips_snippetId = intval($_GET['snippetId']); | |
| 9 | 8 | $xyz_ips_message=''; |
| 10 | 9 | if(isset($_GET['xyz_ips_msg'])){ |
| 11 | - $xyz_ips_message = $_GET['xyz_ips_msg']; | |
| 10 | + $xyz_ips_message = intval($_GET['xyz_ips_msg']); | |
| 12 | 11 | } |
| 13 | 12 | if($xyz_ips_message == 1){ |
| 13 | +?> | |
| 14 | +<div class="xyz_ips_system_notice_area_style1" id="xyz_ips_system_notice_area"> | |
| 15 | + PHP Snippet updated successfully. | |
| 16 | + <span id="xyz_ips_system_notice_area_dismiss">Dismiss</span> | |
| 17 | +</div> | |
| 18 | +<?php | |
| 19 | +} | |
| 20 | +if(isset($_GET['goback'])) | |
| 21 | + $goback= intval($_GET['goback']); | |
| 22 | +if(isset($_POST) && isset($_POST['updateSubmit'])){ | |
| 14 | 23 | |
| 15 | - ?> | |
| 16 | -<div class="system_notice_area_style1" id="system_notice_area"> | |
| 17 | -PHP Snippet updated successfully. <span id="system_notice_area_dismiss">Dismiss</span> | |
| 18 | -</div> | |
| 19 | - | |
| 20 | -<?php | |
| 24 | + if (! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'ips-pedit_'.$xyz_ips_snippetId )) { | |
| 25 | + wp_nonce_ays( 'ips-pedit_'.$xyz_ips_snippetId ); | |
| 26 | + exit; | |
| 27 | + } | |
| 28 | + $goback=intval($_POST['goback']); | |
| 29 | + $goback++; | |
| 30 | + $_POST = stripslashes_deep($_POST); | |
| 31 | + $_POST = xyz_trim_deep($_POST); | |
| 32 | + $xyz_ips_snippetId = intval($_GET['snippetId']); | |
| 33 | + $temp_xyz_ips_title = str_replace(' ', '', $_POST['snippetTitle']); | |
| 34 | + $temp_xyz_ips_title = str_replace('-', '', $temp_xyz_ips_title); | |
| 35 | + $xyz_ips_title = str_replace(' ', '-', $_POST['snippetTitle']); | |
| 36 | + $xyz_ips_content = $_POST['snippetContent']; | |
| 37 | + $xyz_ips_snippetDescription=sanitize_text_field($_POST['xyz_ips_snippetDescription']); | |
| 21 | 38 | |
| 39 | + | |
| 22 | 40 | |
| 23 | -} | |
| 24 | -if(isset($_POST) && isset($_POST['updateSubmit'])){ | |
| 41 | + $xyz_ips_insertionMethod = intval($_POST['xyz_ips_insertionMethod']); | |
| 25 | 42 | |
| 26 | -// echo '<pre>'; | |
| 27 | -// print_r($_POST); | |
| 28 | -// die("JJJ"); | |
| 29 | - $_POST = stripslashes_deep($_POST); | |
| 30 | - $_POST = xyz_trim_deep($_POST); | |
| 31 | - | |
| 32 | - $xyz_ips_snippetId = $_GET['snippetId']; | |
| 33 | - $temp_xyz_ips_title = str_replace(' ', '', $_POST['snippetTitle']); | |
| 34 | - $temp_xyz_ips_title = str_replace('-', '', $temp_xyz_ips_title); | |
| 35 | - $xyz_ips_title = str_replace(' ', '-', $_POST['snippetTitle']); | |
| 36 | - $xyz_ips_content = $_POST['snippetContent']; | |
| 37 | - | |
| 38 | - if($xyz_ips_title != "" && $xyz_ips_content != ""){ | |
| 39 | - | |
| 40 | - if(ctype_alnum($temp_xyz_ips_title)) | |
| 41 | - { | |
| 42 | - $snippet_count = $wpdb->query($wpdb->prepare( 'SELECT * FROM '.$wpdb->prefix.'xyz_ips_short_code WHERE id!=%d AND title=%s LIMIT 0,1',$xyz_ips_snippetId,$xyz_ips_title)) ; | |
| 43 | - | |
| 44 | - if($snippet_count == 0){ | |
| 45 | - $xyz_shortCode = '[xyz-ips snippet="'.$xyz_ips_title.'"]'; | |
| 46 | - | |
| 47 | - $wpdb->update($wpdb->prefix.'xyz_ips_short_code', array('title'=>$xyz_ips_title,'content'=>$xyz_ips_content,'short_code'=>$xyz_shortCode,), array('id'=>$xyz_ips_snippetId)); | |
| 48 | - | |
| 49 | - header("Location:".admin_url('admin.php?page=insert-php-code-snippet-manage&action=snippet-edit&snippetId='.$xyz_ips_snippetId.'&xyz_ips_msg=1')); | |
| 50 | - | |
| 51 | - | |
| 52 | - | |
| 53 | - }else{ | |
| 54 | - ?> | |
| 55 | - <div class="system_notice_area_style0" id="system_notice_area"> | |
| 56 | - PHP Snippet already exists. <span id="system_notice_area_dismiss">Dismiss</span> | |
| 57 | - </div> | |
| 58 | - <?php | |
| 59 | - | |
| 60 | - } | |
| 61 | - } | |
| 62 | - else | |
| 63 | - { | |
| 64 | - ?> | |
| 65 | - <div class="system_notice_area_style0" id="system_notice_area"> | |
| 66 | - PHP Snippet title can have only alphabets,numbers or hyphen. <span id="system_notice_area_dismiss">Dismiss</span> | |
| 67 | - </div> | |
| 68 | - <?php | |
| 69 | - | |
| 70 | - } | |
| 71 | - | |
| 72 | - | |
| 73 | - }else{ | |
| 74 | -?> | |
| 75 | - <div class="system_notice_area_style0" id="system_notice_area"> | |
| 76 | - Fill all mandatory fields. <span id="system_notice_area_dismiss">Dismiss</span> | |
| 77 | - </div> | |
| 78 | -<?php | |
| 79 | - } | |
| 43 | + $xyz_ips_insertionMethod = ($xyz_ips_insertionMethod >= XYZ_IPS_INSERTION_METHOD['AUTOMATIC'] && $xyz_ips_insertionMethod <= XYZ_IPS_INSERTION_METHOD['EXECUTE_ON_DEMAND']) ? $xyz_ips_insertionMethod : XYZ_IPS_INSERTION_METHOD['AUTOMATIC']; | |
| 44 | + $xyz_ips_insertionLocation = intval($_POST['xyz_ips_insertionLocation']); | |
| 80 | 45 | |
| 46 | + | |
| 47 | +if ($xyz_ips_insertionLocation == XYZ_IPS_INSERTION_LOCATION['ADMIN_RUN_ON_HEADER'] || $xyz_ips_insertionLocation == XYZ_IPS_INSERTION_LOCATION['ADMIN_RUN_ON_FOOTER']) { | |
| 48 | + $xyz_ips_insertionLocationType = XYZ_IPS_INSERTION_LOCATION_TYPE['ADMIN']; | |
| 81 | 49 | } |
| 50 | +else if($xyz_ips_insertionLocation == XYZ_IPS_INSERTION_LOCATION['FRONTEND_RUN_ON_HEADER'] || $xyz_ips_insertionLocation == XYZ_IPS_INSERTION_LOCATION['FRONTEND_RUN_ON_FOOTER']){ | |
| 51 | + $xyz_ips_insertionLocationType = XYZ_IPS_INSERTION_LOCATION_TYPE['FRONT_END']; | |
| 52 | +} | |
| 53 | +else{ | |
| 54 | + $xyz_ips_insertionLocationType = 0; | |
| 55 | + } | |
| 56 | +if(get_option('xyz_ips_auto_insert')==1){ | |
| 57 | + $xyz_ips_content_start='<?php'; | |
| 58 | + $new_line="\r\n"; | |
| 59 | + $xyz_ips_content_end='?>'; | |
| 82 | 60 | |
| 61 | + if (stripos($xyz_ips_content, '<?php') !== false) | |
| 62 | + $tag_start_position=stripos($xyz_ips_content,'<?php'); | |
| 63 | + else | |
| 64 | + $tag_start_position="-1"; | |
| 83 | 65 | |
| 84 | -global $wpdb; | |
| 66 | + if (stripos($xyz_ips_content, '?>') !== false) | |
| 67 | + $tag_end_position=stripos($xyz_ips_content,'?>'); | |
| 68 | + else | |
| 69 | + $tag_end_position="-1"; | |
| 85 | 70 | |
| 71 | + | |
| 72 | + if(stripos($xyz_ips_content, '<?php') === false && stripos($xyz_ips_content, '?>') === false) | |
| 73 | + { | |
| 74 | + $xyz_ips_content=$xyz_ips_content_start.$new_line.$xyz_ips_content; | |
| 75 | + } | |
| 76 | + else if(stripos($xyz_ips_content, '<?php') !== false) | |
| 77 | + { | |
| 78 | + if($tag_start_position>=0 && $tag_end_position>=0 && $tag_start_position>$tag_end_position) | |
| 79 | + { | |
| 80 | + $xyz_ips_content=$xyz_ips_content_start.$new_line.$xyz_ips_content; | |
| 81 | + } | |
| 82 | + } | |
| 83 | + else if(stripos($xyz_ips_content, '<?php') === false) | |
| 84 | + { | |
| 85 | + if (stripos($xyz_ips_content, '?>') !== false) | |
| 86 | + { | |
| 87 | + $xyz_ips_content=$xyz_ips_content_start.$new_line.$xyz_ips_content; | |
| 88 | + } | |
| 89 | + } | |
| 90 | +} | |
| 86 | 91 | |
| 92 | + if($xyz_ips_title != "" && $xyz_ips_content != ""){ | |
| 93 | + if(ctype_alnum($temp_xyz_ips_title)){ | |
| 94 | + $snippet_count = $wpdb->query($wpdb->prepare( 'SELECT * FROM '.$wpdb->prefix.'xyz_ips_short_code WHERE id!=%d AND title=%s LIMIT 0,1',$xyz_ips_snippetId,$xyz_ips_title)) ; | |
| 95 | + if($snippet_count == 0){ | |
| 96 | + $xyz_shortCode = '[xyz-ips snippet="'.$xyz_ips_title.'"]'; | |
| 97 | + $wpdb->update($wpdb->prefix.'xyz_ips_short_code', array('title'=>$xyz_ips_title,'description'=>$xyz_ips_snippetDescription,'insertionMethod' => $xyz_ips_insertionMethod, 'insertionLocation' => $xyz_ips_insertionLocation, 'insertionLocationType' => $xyz_ips_insertionLocationType,'content'=>$xyz_ips_content,'short_code'=>$xyz_shortCode,), array('id'=>$xyz_ips_snippetId)); | |
| 98 | + wp_safe_redirect(admin_url('admin.php?page=insert-php-code-snippet-manage&action=snippet-edit&snippetId='.$xyz_ips_snippetId.'&xyz_ips_msg=1'.'&goback='.$goback)); | |
| 99 | + } | |
| 100 | + else{ | |
| 101 | +?> | |
| 102 | +<div class="xyz_ips_system_notice_area_style0" id="xyz_ips_system_notice_area"> | |
| 103 | + PHP Snippet already exists. | |
| 104 | + <span id="xyz_ips_system_notice_area_dismiss">Dismiss</span> | |
| 105 | +</div> | |
| 106 | +<?php | |
| 107 | + } | |
| 108 | + } | |
| 109 | + else{ | |
| 110 | +?> | |
| 111 | +<div class="xyz_ips_system_notice_area_style0" id="xyz_ips_system_notice_area"> | |
| 112 | + PHP Snippet title can have only alphabets,numbers or hyphen. | |
| 113 | + <span id="xyz_ips_system_notice_area_dismiss">Dismiss</span> | |
| 114 | +</div> | |
| 115 | +<?php | |
| 116 | + } | |
| 117 | + } | |
| 118 | + else{ | |
| 119 | +?> | |
| 120 | +<div class="xyz_ips_system_notice_area_style0" id="xyz_ips_system_notice_area"> | |
| 121 | + Fill all mandatory fields. | |
| 122 | + <span id="xyz_ips_system_notice_area_dismiss">Dismiss</span> | |
| 123 | +</div> | |
| 124 | +<?php | |
| 125 | + } | |
| 126 | +} | |
| 127 | +global $wpdb; | |
| 87 | 128 | $snippetDetails = $wpdb->get_results($wpdb->prepare( 'SELECT * FROM '.$wpdb->prefix.'xyz_ips_short_code WHERE id=%d LIMIT 0,1',$xyz_ips_snippetId )) ; |
| 88 | 129 | $snippetDetails = $snippetDetails[0]; |
| 130 | +$xyz_ips_insertionMethod = $snippetDetails->insertionMethod; | |
| 131 | +$xyz_ips_insertionLocation = $snippetDetails->insertionLocation; | |
| 132 | +?> | |
| 133 | +<div > | |
| 134 | + <fieldset | |
| 135 | + style="width: 99%; border: 1px solid #F7F7F7; padding: 10px 0px;"> | |
| 136 | + <legend> | |
| 137 | + <b> | |
| 138 | + Edit PHP Snippet | |
| 139 | + </b> | |
| 140 | + </legend> | |
| 141 | + <form name="frmmainForm" id="frmmainForm" method="post"> | |
| 142 | + <?php wp_nonce_field( 'ips-pedit_'.$xyz_ips_snippetId ); ?> | |
| 143 | + <input type="hidden" id="snippetId" name="snippetId" | |
| 144 | + value=" | |
| 145 | +<?php if(isset($_POST['snippetId'])){ echo esc_attr($_POST['snippetId']);}else{ echo esc_attr($snippetDetails->id); }?>"> | |
| 146 | + <div> | |
| 147 | + <input type="hidden" name="goback" value= <?php echo $goback;?>> | |
| 148 | + | |
| 149 | + <table | |
| 150 | + style="width: 99%; background-color: #F9F9F9; border: 1px solid #E4E4E4; border-width: 1px;margin: 0 auto"> | |
| 151 | + <tr> | |
| 152 | + <td> | |
| 153 | + <br/> | |
| 154 | + <div id="shortCode"> | |
| 155 | + </div> | |
| 156 | + <br/> | |
| 157 | + </td> | |
| 158 | + </tr> | |
| 159 | + <tr valign="top"> | |
| 160 | + <td style="border-bottom: none;width:20%;"> | |
| 161 | + Placement Methods | |
| 162 | + <font color="red"> | |
| 163 | + * | |
| 164 | + </font> | |
| 165 | + </td> | |
| 166 | + <td style="border-bottom: none;width:1px;"> | |
| 167 | + : | |
| 168 | + </td> | |
| 169 | + <td> | |
| 170 | + <select class="xyz_ips_uniq_select" name="xyz_ips_insertionMethod" | |
| 171 | + id="xyz_ips_insertionMethod"> | |
| 172 | + <option value="<?php echo XYZ_IPS_INSERTION_METHOD['AUTOMATIC']; ?>" <?php if ($xyz_ips_insertionMethod == XYZ_IPS_INSERTION_METHOD['AUTOMATIC']) { | |
| 173 | + echo "selected"; | |
| 174 | + } ?>>Automatic</option> | |
| 175 | + <option value="<?php echo XYZ_IPS_INSERTION_METHOD['SHORT_CODE']; ?>" <?php if ($xyz_ips_insertionMethod == XYZ_IPS_INSERTION_METHOD['SHORT_CODE']) { | |
| 176 | + echo "selected"; | |
| 177 | + } ?>>Short code (Manual)</option> | |
| 178 | + <option value="<?php echo XYZ_IPS_INSERTION_METHOD['EXECUTE_ON_DEMAND']; ?>" <?php if ($xyz_ips_insertionMethod == XYZ_IPS_INSERTION_METHOD['EXECUTE_ON_DEMAND']) { | |
| 179 | + echo "selected"; | |
| 180 | + } ?>>Execute on demand</option> | |
| 181 | + </select> | |
| 182 | + </td> | |
| 183 | + </tr> | |
| 89 | 184 | |
| 90 | -?> | |
| 91 | 185 | |
| 92 | -<div > | |
| 93 | - <fieldset | |
| 94 | - style="width: 99%; border: 1px solid #F7F7F7; padding: 10px 0px;"> | |
| 95 | - <legend> | |
| 96 | - <b>Edit PHP Snippet</b> | |
| 97 | - </legend> | |
| 98 | - <form name="frmmainForm" id="frmmainForm" method="post"> | |
| 99 | - <input type="hidden" id="snippetId" name="snippetId" | |
| 100 | - value="<?php if(isset($_POST['snippetId'])){ echo esc_attr($_POST['snippetId']);}else{ echo esc_attr($snippetDetails->id); }?>"> | |
| 101 | - <div> | |
| 102 | - <table | |
| 103 | - style="width: 99%; background-color: #F9F9F9; border: 1px solid #E4E4E4; border-width: 1px;margin: 0 auto"> | |
| 104 | - <tr><td><br/> | |
| 105 | - <div id="shortCode"></div> | |
| 106 | - <br/></td></tr> | |
| 107 | - <tr valign="top"> | |
| 108 | - <td style="border-bottom: none;width:20%;"> Tracking Name <font color="red">*</font></td> | |
| 109 | - <td style="border-bottom: none;width:1px;"> : </td> | |
| 110 | - <td><input style="width:80%;" | |
| 111 | - type="text" name="snippetTitle" id="snippetTitle" | |
| 112 | - value="<?php if(isset($_POST['snippetTitle'])){ echo esc_attr($_POST['snippetTitle']);}else{ echo esc_attr($snippetDetails->title); }?>"></td> | |
| 113 | - </tr> | |
| 114 | - <tr> | |
| 115 | - <td style="border-bottom: none;width:20%; "> PHP code (without <?php ?>) <font color="red">*</font></td> | |
| 116 | - <td style="border-bottom: none;width:1px;"> : </td> | |
| 117 | - <td > | |
| 118 | - <textarea name="snippetContent" style="width:80%;height:150px;"><?php if(isset($_POST['snippetContent'])){ echo esc_textarea($_POST['snippetContent']);}else{ echo esc_textarea($snippetDetails->content); }?></textarea> | |
| 119 | - </td> | |
| 120 | - </tr> | |
| 186 | + <tr valign="top" id="xyz_ips_insertionLocationTR"> | |
| 187 | + <td style="border-bottom: none;width:20%;"> | |
| 188 | + Insertion Location | |
| 189 | + <font color="red"> | |
| 190 | + * | |
| 191 | + </font> | |
| 192 | + </td> | |
| 193 | + <td style="border-bottom: none;width:1px;"> | |
| 194 | + : | |
| 195 | + </td> | |
| 196 | + <td> | |
| 197 | + <div> | |
| 198 | + <div class="xyz_ips_insertionLocationDiv"> | |
| 199 | + <span id="xyz_ips_insertion-location-txt">Select Insertion Location </span><span><i class="fa fa-angle-down" aria-hidden="true"></i> <i class="fa fa-angle-up" aria-hidden="true"></i></span> | |
| 121 | 200 | |
| 122 | - <tr> | |
| 123 | - <td></td><td></td> | |
| 124 | - <td><input class="button-primary" style="cursor: pointer;" | |
| 125 | - type="submit" name="updateSubmit" value="Update"></td> | |
| 126 | - </tr> | |
| 127 | - <tr><td><br/></td></tr> | |
| 128 | - </table> | |
| 129 | - </div> | |
| 201 | + </div> | |
| 202 | + <input type="hidden" id="xyz_ips_insertionLocation" name="xyz_ips_insertionLocation" value="<?php echo $xyz_ips_insertionLocation;?>"> | |
| 203 | + <ul id="xyz_ips_uniq_list" class="xyz_ips_uniq_list"> | |
| 204 | + <div class="xyz_ips_left_column"> | |
| 205 | + | |
| 206 | + <li class="xyz_ips_li_h2"><label>Admin</label></li> | |
| 207 | + <li class="xyz_ips_li_option <?php echo ($xyz_ips_insertionLocation == XYZ_IPS_INSERTION_LOCATION['ADMIN_RUN_ON_HEADER']) ? 'selected' : ''; ?>" | |
| 208 | + data-value="<?php echo XYZ_IPS_INSERTION_LOCATION['ADMIN_RUN_ON_HEADER']; ?>"> | |
| 209 | + Run on header | |
| 210 | + </li> | |
| 211 | + <li class="xyz_ips_li_option <?php echo ($xyz_ips_insertionLocation == XYZ_IPS_INSERTION_LOCATION['ADMIN_RUN_ON_FOOTER']) ? 'selected' : ''; ?>" | |
| 212 | + data-value="<?php echo XYZ_IPS_INSERTION_LOCATION['ADMIN_RUN_ON_FOOTER']; ?>"> | |
| 213 | + Run on footer | |
| 214 | + </li> | |
| 215 | + | |
| 216 | + <li class="xyz_ips_li_h2"><label>Front end</label></li> | |
| 130 | 217 | |
| 131 | - </form> | |
| 132 | - </fieldset> | |
| 218 | + <li class="xyz_ips_li_option <?php echo ($xyz_ips_insertionLocation == XYZ_IPS_INSERTION_LOCATION['FRONTEND_RUN_ON_HEADER']) ? 'selected' : ''; ?>" | |
| 219 | + data-value="<?php echo XYZ_IPS_INSERTION_LOCATION['FRONTEND_RUN_ON_HEADER']; ?>"> | |
| 220 | + Run on header | |
| 221 | + </li> | |
| 222 | + <li class="xyz_ips_li_option <?php echo ($xyz_ips_insertionLocation == XYZ_IPS_INSERTION_LOCATION['FRONTEND_RUN_ON_FOOTER']) ? 'selected' : ''; ?>" | |
| 223 | + data-value="<?php echo XYZ_IPS_INSERTION_LOCATION['FRONTEND_RUN_ON_FOOTER']; ?>"> | |
| 224 | + Run on footer | |
| 225 | + </li> | |
| 226 | + | |
| 227 | + </div> | |
| 228 | + <div class="xyz_ips_right_column"> | |
| 133 | 229 | |
| 230 | + </div> | |
| 231 | +</ul> | |
| 134 | 232 | </div> |
| 233 | + | |
| 234 | + </td> | |
| 235 | + </tr> | |
| 236 | + <tr valign="top"> | |
| 237 | + <td style="border-bottom: none;width:20%;"> | |
| 238 | + Tracking Name | |
| 239 | + <font color="red"> | |
| 240 | + * | |
| 241 | + </font> | |
| 242 | + </td> | |
| 243 | + <td style="border-bottom: none;width:1px;"> | |
| 244 | + : | |
| 245 | + </td> | |
| 246 | + <td> | |
| 247 | + <input style="width:80%;" | |
| 248 | + type="text" name="snippetTitle" id="snippetTitle" | |
| 249 | + value="<?php if(isset($_POST['snippetTitle'])){ echo esc_attr($_POST['snippetTitle']);}else{ echo esc_attr($snippetDetails->title); }?>"> | |
| 250 | + </td> | |
| 251 | + </tr> | |
| 252 | + <tr valign="top"> | |
| 253 | + <td style="border-bottom: none;width:20%;"> Description </td> | |
| 254 | + <td style="border-bottom: none;width:1px;"> : </td> | |
| 255 | + <td> | |
| 256 | + <textarea id="xyz_ips_snippetDescription" name="xyz_ips_snippetDescription" style="resize: both;width:80%;"><?php | |
| 257 | + if(isset($_POST['xyz_ips_snippetDescription'])){ echo esc_attr($_POST['xyz_ips_snippetDescription']);}else{ echo esc_attr($snippetDetails->description); }?> | |
| 258 | + </textarea> | |
| 259 | + </td> | |
| 260 | + </tr> | |
| 261 | + <tr> | |
| 262 | + <td style="border-bottom: none;width:20%; "> | |
| 263 | + <?php | |
| 264 | + if(get_option('xyz_ips_auto_insert')==1){ | |
| 265 | + ?> | |
| 266 | + PHP code | |
| 267 | + <?php | |
| 268 | + } | |
| 269 | + else{ | |
| 270 | + ?> | |
| 271 | + PHP code (without <?php ?>) | |
| 272 | + <?php | |
| 273 | + } | |
| 274 | + ?> | |
| 275 | + <font color="red"> | |
| 276 | + * | |
| 277 | + </font> | |
| 278 | + </td> | |
| 279 | + <td style="border-bottom: none;width:1px;"> | |
| 280 | + : | |
| 281 | + </td> | |
| 282 | + <td > | |
| 283 | + <textarea name="snippetContent" style="width:80%;height:150px;"><?php if(isset($_POST['snippetContent'])){ echo esc_textarea($_POST['snippetContent']);}else{ echo esc_textarea($snippetDetails->content); }?></textarea> | |
| 284 | + </td> | |
| 285 | + </tr> | |
| 286 | + <tr> | |
| 287 | + <td> | |
| 288 | + </td> | |
| 289 | + <td> | |
| 290 | + <input class="button-primary" style="cursor: pointer;" type="button" name="back" onclick=" window.history.go(-<?php echo $goback;?>);" value="Back" > | |
| 291 | + </td> | |
| 292 | + <td> | |
| 293 | + <input class="button-primary" style="cursor: pointer;" | |
| 294 | + type="submit" name="updateSubmit" value="Update"> | |
| 295 | + </td> | |
| 296 | + </tr> | |
| 297 | + <tr> | |
| 298 | + <td> | |
| 299 | + <br/> | |
| 300 | + </td> | |
| 301 | + </tr> | |
| 302 | + </table> | |
| 303 | + </div> | |
| 304 | + </form> | |
| 305 | + </fieldset> | |
| 306 | +</div> | |
| 307 | +<?php | |
| 308 | +require( dirname( __FILE__ ) . '/snippet-js.php' ); | |
| 309 | +?> | |