| 1 |
<?php |
| 2 |
/** |
| 3 |
* @package Admin |
| 4 |
* @sub-package Admin Opengraph Display |
| 5 |
*/ |
| 6 |
?> |
| 7 |
<div id="catchwebtools" class="wrap"> |
| 8 |
<?php include ( 'header.php' ); ?> |
| 9 |
<?php include ( 'navigation.php' ); ?> |
| 10 |
<div id="opengraph"> |
| 11 |
<form method="post" action="options.php"> |
| 12 |
<?php settings_fields( 'opengraph-settings-group' ); ?> |
| 13 |
<?php $settings = get_catchwebtools_options( 'catchwebtools_opengraph' ); ?> |
| 14 |
<div class="option-container"> |
| 15 |
<h3 class="option-toggle option-active"><a href="#"><?php _e( 'Enable Open Graph Module', 'catchwebtools' ); ?></a></h3> |
| 16 |
<div class="option-content inside open"> |
| 17 |
<table class="form-table"> |
| 18 |
<tbody> |
| 19 |
<tr> |
| 20 |
<th scope="row"><?php _e( 'Enable Open Graph Module', 'catchwebtools' ); ?></th> |
| 21 |
<td> |
| 22 |
<?php |
| 23 |
$text = ( ! empty ( $settings['status'] ) && $settings['status'] ) ? 'checked' : ''; |
| 24 |
echo '<input type="checkbox" ' .$text. ' name="catchwebtools_opengraph[status]" value="1"/> '. __( 'Check to Enable', 'catchwebtools' ); |
| 25 |
echo '<p class="description">'. __( 'Add Open Graph meta data to your site\'s <code><head></code> section. You can specify some of the IDs that are sometimes needed below:', 'catchwebtools' ) . '<p class="description">'; |
| 26 |
echo '<p class="description">'. __( 'Open Graph tags for specific Pages or Posts, can be added via Catch Web Tools Custom Meta Box which shows up in Pages\' and Posts\' add/edit sections once this function is enabled.', 'catchwebtools' ) . '</p>'; |
| 27 |
?> |
| 28 |
</td> |
| 29 |
</tr> |
| 30 |
</tbody> |
| 31 |
</table> |
| 32 |
<?php submit_button('Save Changes'); ?> |
| 33 |
</div> |
| 34 |
|
| 35 |
<h3 class="option-toggle"><a href="#"><?php _e( 'Facebook Settings', 'catchwebtools' ); ?></a></h3> |
| 36 |
<div class="option-content inside"> |
| 37 |
<table class="form-table"> |
| 38 |
<tbody> |
| 39 |
<tr> |
| 40 |
<th scope="row"><?php _e( 'Facebook App ID', 'catchwebtools' ); ?></th> |
| 41 |
<td> |
| 42 |
<?php |
| 43 |
$text = ( ! empty ( $settings['fb:app_id'] ) ) ? esc_attr( $settings['fb:app_id'] ) : ''; |
| 44 |
echo '<input type="text" size="80" name="catchwebtools_opengraph[fb:app_id]" value="' .$text. '" />'; |
| 45 |
?> |
| 46 |
</td> |
| 47 |
</tr> |
| 48 |
</tbody> |
| 49 |
</table> |
| 50 |
<?php submit_button('Save Changes'); ?> |
| 51 |
</div> |
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
<h3 class="option-toggle"><a href="#"><?php _e( 'Homepage Settings', 'catchwebtools' ); ?></a></h3> |
| 57 |
<div class="option-content inside"> |
| 58 |
<table class="form-table"> |
| 59 |
<tbody> |
| 60 |
<tr> |
| 61 |
<th scope="row"> |
| 62 |
<?php _e( 'Title', 'catchwebtools' );?> |
| 63 |
</th> |
| 64 |
<td> |
| 65 |
<?php |
| 66 |
$text = ( ! empty ( $settings['og:title'] ) ) ? esc_attr( $settings['og:title'] ) : get_bloginfo( 'name' ) ; |
| 67 |
echo '<input type="text" size="80" name="catchwebtools_opengraph[og:title]" value="' .$text. '" /><p id="description">og:title tag</p>'; |
| 68 |
?> |
| 69 |
</td> |
| 70 |
</tr> |
| 71 |
|
| 72 |
<tr> |
| 73 |
<th scope="row"> |
| 74 |
<?php _e( 'Type', 'catchwebtools' );?> |
| 75 |
</th> |
| 76 |
<td> |
| 77 |
<?php |
| 78 |
$text = ( ! empty ( $settings['og:type'] ) ) ? esc_attr( $settings['og:type'] ) : ''; |
| 79 |
$options = array('website', 'music.song', 'music.radio_station', 'music.playlist', 'music.album', 'video.movie', 'video.tv_show', 'video.episode', 'video.other', 'article', 'book', 'profile'); |
| 80 |
echo '<select name="catchwebtools_opengraph[og:type]" class="catchwebtools_opengraph_type">'; |
| 81 |
echo '<option value="">-</option>'; |
| 82 |
foreach($options as $option){ |
| 83 |
echo '<option value="'. $option .'" '; |
| 84 |
if ( $text == $option ) |
| 85 |
echo 'selected="true"'; |
| 86 |
echo '>'. $option .'</option>'; |
| 87 |
} |
| 88 |
echo '</select><p id="description">og:type tag</p>'; |
| 89 |
?> |
| 90 |
</td> |
| 91 |
</tr> |
| 92 |
|
| 93 |
<tr> |
| 94 |
<th scope="row"> |
| 95 |
<?php _e( 'URL', 'catchwebtools' );?> |
| 96 |
</th> |
| 97 |
<td> |
| 98 |
<?php |
| 99 |
$text = ( ! empty ( $settings['og:url'] ) ) ? esc_attr( $settings['og:url'] ) : home_url(); |
| 100 |
echo '<input type="text" size="80" name="catchwebtools_opengraph[og:url]" value="' .$text. '" /><p id="description">og:url tag</p>'; |
| 101 |
?> |
| 102 |
</td> |
| 103 |
</tr> |
| 104 |
|
| 105 |
<tr> |
| 106 |
<th scope="row"> |
| 107 |
<?php _e( 'Description', 'catchwebtools' );?> |
| 108 |
</th> |
| 109 |
<td> |
| 110 |
<?php |
| 111 |
$text = ( ! empty ( $settings['og:description'] ) ) ? esc_attr( $settings['og:description'] ) : esc_attr( get_bloginfo( 'description' ) ); |
| 112 |
echo '<textarea cols="80" rows="7" name="catchwebtools_opengraph[og:description]" >' .$text. '</textarea><p id="description">og:description tag</p>'; |
| 113 |
?> |
| 114 |
</td> |
| 115 |
</tr> |
| 116 |
|
| 117 |
<tr> |
| 118 |
<th scope="row"> |
| 119 |
<?php _e( 'Sitename', 'catchwebtools' );?> |
| 120 |
</th> |
| 121 |
<td> |
| 122 |
<?php |
| 123 |
$text = ( ! empty ( $settings['og:site_name'] ) ) ? esc_attr( $settings['og:site_name'] ) : get_bloginfo( 'name' ); |
| 124 |
echo '<input type="text" size="80" name="catchwebtools_opengraph[og:site_name]" value="' .$text. '" /><p id="description">og:site_name tag</p>'; |
| 125 |
?> |
| 126 |
</td> |
| 127 |
</tr> |
| 128 |
|
| 129 |
<tr> |
| 130 |
<th scope="row"> |
| 131 |
<?php _e( 'Locale', 'catchwebtools' );?> |
| 132 |
</th> |
| 133 |
<td> |
| 134 |
<?php |
| 135 |
$text = ( ! empty ( $settings['og:locale'] ) ) ? esc_attr( $settings['og:locale'] ) : ''; |
| 136 |
echo '<input type="text" size="80" name="catchwebtools_opengraph[og:locale]" value="' .$text. '" /><p id="description">og:locale tag</p>'; |
| 137 |
?> |
| 138 |
</td> |
| 139 |
</tr> |
| 140 |
|
| 141 |
</tbody> |
| 142 |
</table> |
| 143 |
<?php submit_button('Save Changes'); ?> |
| 144 |
</div> |
| 145 |
|
| 146 |
<h3 class="option-toggle"><a href="#"><?php _e( 'Default Settings', 'catchwebtools' ); ?></a></h3> |
| 147 |
<div class="option-content inside"> |
| 148 |
<table class="form-table"> |
| 149 |
<tbody> |
| 150 |
<tr> |
| 151 |
<th scope="row"> |
| 152 |
<?php _e( 'Default Image', 'catchwebtools' );?> |
| 153 |
</th> |
| 154 |
<td> |
| 155 |
<?php |
| 156 |
$text = ( ! empty ( $settings['og:default_image'] ) ) ? esc_attr( $settings['og:default_image'] ) : ''; |
| 157 |
echo ' |
| 158 |
<input type="text" class="upload-url" size="80" name="catchwebtools_opengraph[og:default_image]" value="'. esc_attr( $text ) .'" /> |
| 159 |
<input id="st_upload_button" class="st_upload_button button" name="catchwebtools_opengraph[og:default_image]" type="button" value="'. esc_attr( 'Upload', 'catchwebtools' ) .'" />'; |
| 160 |
echo '<p class="description">'. __( 'This image is used if the post/page being shared does not contain any images.', 'catchwebtools' ) .'</p>'; |
| 161 |
?> |
| 162 |
</td> |
| 163 |
</tr> |
| 164 |
</tbody> |
| 165 |
</table> |
| 166 |
<?php submit_button('Save Changes'); ?> |
| 167 |
</div> |
| 168 |
|
| 169 |
<h3 class="option-toggle"><a href="#"><?php _e( 'Custom Settings (Only for Advanced Users)', 'catchwebtools' ); ?></a></h3> |
| 170 |
<div class="option-content inside"> |
| 171 |
<table class="form-table"> |
| 172 |
<tbody> |
| 173 |
<tr> |
| 174 |
<th scope="row"> |
| 175 |
<?php _e( 'Custom Tags', 'catchwebtools' ); ?> |
| 176 |
</th> |
| 177 |
<td> |
| 178 |
<?php |
| 179 |
$text = ( ! empty ( $settings['custom'] ) ) ? esc_attr( $settings['custom'] ) : ''; |
| 180 |
echo '<textarea cols="80" rows="7" name="catchwebtools_opengraph[custom]" >' .$text. '</textarea>'; |
| 181 |
echo '<p class="description">'. __( 'For any other type of Open Graph tags.', 'catchwebtools' ) . '</p>'; |
| 182 |
echo '<p class="description">'. __( 'E.g:', 'catchwebtools' ) . '<code><meta property="og:audio" content="http://example.com/sound.mp3" /></code>'; |
| 183 |
echo '<p class="description">'. __( 'If you do not know what this is, you should probably leave it empty.', 'catchwebtools' ); |
| 184 |
?> |
| 185 |
</td> |
| 186 |
</tr> |
| 187 |
</tbody> |
| 188 |
</table> |
| 189 |
<?php submit_button('Save Changes'); ?> |
| 190 |
</div> |
| 191 |
|
| 192 |
|
| 193 |
</div> |
| 194 |
</form> |
| 195 |
</div> <!-- #opengraph --> |
| 196 |
</div><!-- .wrap --> |