| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) exit; | |
| 2 | + | |
| 3 | 3 | function tcmp_ui_manager() { |
| 4 | 4 | global $tcmp; |
| 5 | 5 | |
| 6 | 6 | $id = tcmp_isqs( 'id', 0 ); |
| @@ -36,10 +36,10 @@ | ||
| 36 | 36 | $snippets = $tcmp->manager->values(); |
| 37 | 37 | if ( count( $snippets ) > 0 ) { ?> |
| 38 | 38 | <div style="float:left;"> |
| 39 | 39 | <form method="get" action="" style="margin:5px; float:left;"> |
| 40 | - <input type="hidden" name="page" value="<?php echo esc_attr( TCMP_PLUGIN_SLUG ); ?>" /> | |
| 41 | - <input type="hidden" name="tab" value="<?php echo esc_attr( TCMP_TAB_EDITOR ); ?>" /> | |
| 40 | + <input type="hidden" name="page" value="<?php echo TCMP_PLUGIN_SLUG; ?>" /> | |
| 41 | + <input type="hidden" name="tab" value="<?php echo TCMP_TAB_EDITOR; ?>" /> | |
| 42 | 42 | <input type="submit" class="button-primary" value="<?php $tcmp->lang->P( 'Button.Add' ); ?>" /> |
| 43 | 43 | </form> |
| 44 | 44 | </div> |
| 45 | 45 | <div style="clear:both;"></div> |
| @@ -73,12 +73,11 @@ | ||
| 73 | 73 | $color = 'green'; |
| 74 | 74 | $text = 'Yes'; |
| 75 | 75 | $question = 'QuestionActiveOff'; |
| 76 | 76 | } |
| 77 | - $text = '<span style="font-weight:bold; color:' . $color . '">' . $tcmp->lang->L( $text ) . '</span>'; | |
| 78 | - $toggle_url = TCMP_TAB_MANAGER_URI . '&tcmp_nonce=' . wp_create_nonce( 'tcmp_toggle' ) . '&action=toggle&id=' . $snippet['id']; | |
| 77 | + $text = '<span style="font-weight:bold; color:' . $color . '">' . $tcmp->lang->L( $text ) . '</span>'; | |
| 79 | 78 | ?> |
| 80 | - <a onclick="return confirm('<?php echo esc_js( $tcmp->lang->L( $question ) ); ?>');" href="<?php echo esc_url( $toggle_url ); ?>"> | |
| 79 | + <a onclick="return confirm('<?php echo esc_attr( $tcmp->lang->L( $question ) ); ?>');" href="<?php echo TCMP_TAB_MANAGER_URI; ?>&tcmp_nonce=<?php echo esc_attr( wp_create_nonce( 'tcmp_toggle' ) ); ?>&action=toggle&id=<?php echo esc_attr( $snippet['id'] ); ?>"> | |
| 81 | 80 | <?php echo wp_kses( $text, $tcmp_allowed_html_tags ); ?> |
| 82 | 81 | </a> |
| 83 | 82 | </td> |
| 84 | 83 | <td><?php echo esc_html( $snippet['name'] ); ?></td> |
| @@ -92,9 +91,9 @@ | ||
| 92 | 91 | } |
| 93 | 92 | } else { |
| 94 | 93 | $text = 'Conversion'; |
| 95 | 94 | } |
| 96 | - $tcmp->lang->P( $text ); | |
| 95 | + esc_html( $tcmp->lang->P( $text ) ); | |
| 97 | 96 | ?> |
| 98 | 97 | </td> |
| 99 | 98 | <td style="text-align:center;"> |
| 100 | 99 | <input type="text" style="width:110px; text-align:center;" value='[tcm id="<?php echo esc_html( $snippet['id'] ); ?>"]' readonly="readonly" class="tcmp-select-onfocus" /> |
| @@ -99,9 +98,9 @@ | ||
| 99 | 98 | <td style="text-align:center;"> |
| 100 | 99 | <input type="text" style="width:110px; text-align:center;" value='[tcm id="<?php echo esc_html( $snippet['id'] ); ?>"]' readonly="readonly" class="tcmp-select-onfocus" /> |
| 101 | 100 | </td> |
| 102 | 101 | <td style="text-align:center;"> |
| 103 | - <input type="button" class="button button-secondary" value="<?php $tcmp->lang->P( 'Edit' ); ?>" onclick="location.href='<?php echo esc_url( TCMP_TAB_EDITOR_URI . '&id=' . $snippet['id'] ); ?>';"/> | |
| 102 | + <input type="button" class="button button-secondary" value="<?php $tcmp->lang->P( 'Edit' ); ?>" onclick="location.href='<?php echo TCMP_TAB_EDITOR_URI; ?>&id=<?php echo esc_attr( $snippet['id'] ); ?>';"/> | |
| 104 | 103 | <input type="button" class="button button-secondary" value="<?php $tcmp->lang->P( 'Delete?' ); ?>" onclick="TCMP_btnDeleteClick(<?php echo esc_attr( $snippet['id'] ); ?>)"/> |
| 105 | 104 | </td> |
| 106 | 105 | </tr> |
| 107 | 106 | <?php } ?> |