| 68 | | $privacy_policy_page = get_post( $privacy_policy_page_id ); |
| 69 | | if ( ! $privacy_policy_page instanceof WP_Post ) { |
| | 68 | $privacy_policy_page = get_post( $privacy_policy_page_id ); |
| | 69 | if ( ! $privacy_policy_page instanceof WP_Post ) { |
| | 70 | add_settings_error( |
| | 71 | 'page_for_privacy_policy', |
| | 72 | 'page_for_privacy_policy', |
| | 73 | __( 'The currently selected privacy policy page does not exist. Please create or select new page.' ), |
| | 74 | 'error' |
| | 75 | ); |
| | 76 | } else { |
| | 77 | if ( 'trash' === $privacy_policy_page->post_status ) { |
| | 112 | <!-- TAB PANEL MENU --> |
| | 113 | <div class="nav-tab-wrapper wp-clearfix"> |
| | 114 | <a href="#" class="nav-tab nav-tab-active" data-tab="privacy-tools"><?php esc_html_e( 'Tools' ); ?></a> |
| | 115 | <a href="#" class="nav-tab" data-tab="privacy-requests"><?php esc_html_e( 'Requests' ); ?></a> |
| | 116 | <a href="#" class="nav-tab" data-tab="privacy-information"><?php esc_html_e( 'Privacy Policy Information' ); ?></a> |
| | 117 | </div> |
| | 118 | <!-- TABS --> |
| | 119 | <div class="tabs"> |
| | 120 | <!-- TAB Tools --> |
| | 121 | <div class="tab privacy-tools"> |
| | 122 | <div id="poststuff"> |
| | 123 | <div id="post-body" class="metabox-holder columns-2"> |
| | 124 | <!-- main content --> |
| | 125 | <div id="post-body-content"> |
| | 126 | <div class="meta-box-sortables ui-sortable"> |
| | 127 | <div class="postbox"> |
| | 128 | <h2><?php esc_html_e( 'Privacy Policy Page' ); ?></h2> |
| | 129 | <div class="inside"> |
| | 130 | <?php |
| | 131 | if ( $privacy_policy_page_exists ) { |
| | 132 | $edit_href = add_query_arg( |
| | 133 | array( |
| | 134 | 'post' => $privacy_policy_page_id, |
| | 135 | 'action' => 'edit', |
| | 136 | ), |
| | 137 | admin_url( 'post.php' ) |
| | 138 | ); |
| | 139 | $view_href = get_permalink( $privacy_policy_page_id ); |
| | 140 | ?> |
| | 141 | <p> |
| | 142 | <strong> |
| | 143 | <?php |
| | 144 | printf( |
| | 145 | // translators: %1$s Edit url. %2$s View url. |
| | 146 | __( '<a href="%1$s">Edit</a> or <a href="%2$s">view</a> your privacy policy.' ), |
| | 147 | $edit_href, |
| | 148 | $view_href |
| | 149 | ); |
| | 150 | ?> |
| | 151 | </strong> |
| | 152 | </p> |
| | 153 | <?php |
| | 154 | } |
| | 155 | ?> |
| | 156 | <table class="form-table"> |
| | 157 | <tr> |
| | 158 | <th scope="row"> |
| | 159 | <label for="page_for_privacy_policy"> |
| | 160 | <?php |
| 158 | | wp_dropdown_pages( |
| 159 | | array( |
| 160 | | 'name' => 'page_for_privacy_policy', |
| 161 | | 'show_option_none' => __( '— Select —' ), |
| 162 | | 'option_none_value' => '0', |
| 163 | | 'selected' => $privacy_policy_page_id, |
| 164 | | 'post_status' => array( 'draft', 'publish' ), |
| 165 | | ) |
| 166 | | ); |
| | 206 | ?> |
| | 207 | </form> |
| | 208 | </td> |
| | 209 | </tr> |
| | 210 | <?php |
| | 211 | } |
| | 212 | ?> |
| | 213 | </table> |
| | 214 | </div> |
| | 215 | </div> |
| | 216 | </div> |
| | 217 | <div class="meta-box-sortables ui-sortable"> |
| | 218 | <div class="postbox"> |
| | 219 | <h2><?php esc_html_e( 'Title' ); ?></h2> |
| | 220 | <div class="inside"> |
| | 221 | Content Here |
| | 222 | </div> |
| | 223 | </div> |
| | 224 | </div> |
| | 225 | </div> |
| | 226 | <!-- sidebar --> |
| | 227 | <div id="postbox-container-1" class="postbox-container"> |
| | 228 | <div class="meta-box-sortables"> |
| | 229 | <div class="postbox tools-information"> |
| | 230 | <h2> |
| | 231 | <?php esc_html_e( 'General Information' ); ?> |
| | 232 | </h2> |
| | 233 | <div class="inside"> |
| | 234 | <p> |
| | 235 | Content Here |
| | 236 | </p> |
| | 237 | </div> |
| | 238 | </div> |
| | 239 | </div> |
| | 240 | </div> |
| | 241 | </div> |
| | 242 | </div> |
| | 243 | </div> |
| | 244 | <!-- TAB Requests --> |
| | 245 | <div class="tab privacy-requests"> |
| 168 | | wp_nonce_field( 'set-privacy-page' ); |
| 169 | | submit_button( __( 'Set Page' ), 'primary', 'submit', true, array( 'id' => 'set-page' ) ); |
| | 247 | <?php |
| | 248 | // Requests come from wp_options as an array of users. |
| | 249 | // If user is registered, use an array similar to WP_User, otherwise just the user email. |
| | 250 | $requests = array( |
| | 251 | array( |
| | 252 | 'ID' => 1, |
| | 253 | 'full_name' => 'John Doe', |
| | 254 | 'email' => 'john@doe.com', |
| | 255 | 'date' => '2018/03/07', |
| | 256 | 'type' => 'Delete', |
| | 257 | ), |
| | 258 | array( |
| | 259 | 'ID' => 2, |
| | 260 | 'full_name' => 'Jane Doe', |
| | 261 | 'email' => 'jane@doe.com', |
| | 262 | 'date' => '2018/03/03', |
| | 263 | 'type' => 'Anonymize', |
| | 264 | ), |
| | 265 | ); |
| 186 | | wp_nonce_field( 'create-privacy-page' ); |
| 187 | | submit_button( __( 'Create Page' ), 'primary', 'submit', true, array( 'id' => 'create-page' ) ); |
| 188 | | |
| 189 | | ?> |
| 190 | | </form> |
| 191 | | </td> |
| 192 | | </tr> |
| 193 | | <?php |
| 194 | | } |
| 195 | | |
| 196 | | ?> |
| 197 | | </table> |
| | 276 | <?php if ( ! empty( $delete_requests ) ) : ?> |
| | 277 | <h2><?php esc_html_e( 'Erasure Requests' ); ?></h2> |
| | 278 | <table class="widefat"> |
| | 279 | <thead> |
| | 280 | <tr> |
| | 281 | <th><?php esc_attr_e( 'ID' ); ?></th> |
| | 282 | <th><?php esc_attr_e( 'Full Name' ); ?></th> |
| | 283 | <th><?php esc_attr_e( 'Email' ); ?></th> |
| | 284 | <th><?php esc_attr_e( 'Date of Request' ); ?></th> |
| | 285 | <th><?php esc_attr_e( 'Review' ); ?></th> |
| | 286 | <th><?php esc_attr_e( 'Action' ); ?></th> |
| | 287 | </tr> |
| | 288 | </thead> |
| | 289 | <tbody> |
| | 290 | <?php foreach ( $delete_requests as $request ) : ?> |
| | 291 | <tr> |
| | 292 | <td><?php echo esc_html( $request['ID'] ); ?></td> |
| | 293 | <td><?php echo esc_html( $request['full_name'] ); ?></td> |
| | 294 | <td><?php echo esc_html( $request['email'] ); ?></td> |
| | 295 | <td><?php echo esc_html( $request['date'] ); ?></td> |
| | 296 | <td> |
| | 297 | <button class="button"><?php esc_html_e( 'Review Request' ); ?></button> |
| | 298 | </td> |
| | 299 | <td> |
| | 300 | <button class="button button-primary"><?php esc_html_e( 'Erase' ); ?></button> |
| | 301 | </td> |
| | 302 | </tr> |
| | 303 | <?php endforeach; ?> |
| | 304 | </tbody> |
| | 305 | </table> |
| | 306 | <?php endif ?> |
| | 307 | <?php if ( ! empty( $anonymize_requests ) ) : ?> |
| | 308 | <h2><?php esc_html_e( 'Anonymization Requests' ); ?></h2> |
| | 309 | <table class="widefat"> |
| | 310 | <thead> |
| | 311 | <tr> |
| | 312 | <th><?php esc_attr_e( 'ID' ); ?></th> |
| | 313 | <th><?php esc_attr_e( 'Full Name' ); ?></th> |
| | 314 | <th><?php esc_attr_e( 'Email' ); ?></th> |
| | 315 | <th><?php esc_attr_e( 'Date of Request' ); ?></th> |
| | 316 | <th><?php esc_attr_e( 'Review' ); ?></th> |
| | 317 | <th><?php esc_attr_e( 'Action' ); ?></th> |
| | 318 | </tr> |
| | 319 | </thead> |
| | 320 | <tbody> |
| | 321 | <?php foreach ( $anonymize_requests as $request ) : ?> |
| | 322 | <tr> |
| | 323 | <td><?php echo esc_html( $request['ID'] ); ?></td> |
| | 324 | <td><?php echo esc_html( $request['full_name'] ); ?></td> |
| | 325 | <td><?php echo esc_html( $request['email'] ); ?></td> |
| | 326 | <td><?php echo esc_html( $request['date'] ); ?></td> |
| | 327 | <td> |
| | 328 | <button class="button"><?php esc_html_e( 'Review Request' ); ?></button> |
| | 329 | </td> |
| | 330 | <td> |
| | 331 | <button class="button button-primary"><?php esc_html_e( 'Anonymize' ); ?></button> |
| | 332 | </td> |
| | 333 | </tr> |
| | 334 | <?php endforeach; ?> |
| | 335 | </tbody> |
| | 336 | </table> |
| | 337 | <?php endif ?> |
| | 338 | </div> |
| | 339 | <!-- TAB Privacy Policy Information --> |
| | 340 | <div class="tab privacy-information"> |
| | 341 | <div class="nav-tab-wrapper wp-clearfix"> |
| | 342 | <a href="#" class="nav-tab nav-tab-active" data-tab="privacy-information-core"><?php esc_html_e( 'WordPress Core' ); ?></a> |
| | 343 | <a href="#" class="nav-tab" data-tab="privacy-information-plugin1"><?php esc_html_e( 'Plugin 1' ); ?></a> |
| | 344 | </div> |
| | 345 | <div class="tabs"> |
| | 346 | <div class="tab privacy-information-core"> |
| | 347 | <div class="tab-content"> |
| | 348 | <h2><?php esc_html_e( 'WordPress Core' ); ?></h2> |
| | 349 | <p>Content Here</p> |
| | 350 | </div> |
| | 351 | </div> |
| | 352 | <div class="tab privacy-information-plugin1"> |
| | 353 | <div class="tab-content"> |
| | 354 | <h2><?php esc_html_e( 'Plugin 1' ); ?></h2> |
| | 355 | <p>Content Here</p> |
| | 356 | </div> |
| | 357 | </div> |
| | 358 | </div> |
| | 359 | </div> |
| | 360 | </div> |