| | 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-information"><?php esc_html_e( 'Privacy Policy Information' ); ?></a> |
| | 116 | </div> |
| | 117 | <!-- TABS --> |
| | 118 | <div class="tabs"> |
| | 119 | <!-- TAB Tools --> |
| | 120 | <div class="tab privacy-tools"> |
| | 121 | <div id="poststuff"> |
| | 122 | <div id="post-body" class="metabox-holder columns-2"> |
| | 123 | <!-- main content --> |
| | 124 | <div id="post-body-content"> |
| | 125 | <div class="meta-box-sortables ui-sortable"> |
| | 126 | <?php |
| | 127 | // Requests come from wp_options as an array of users. |
| | 128 | // If user is registered, use an array similar to WP_User, otherwise just the user email. |
| | 129 | $requests = array( |
| | 130 | array( |
| | 131 | 'ID' => 1, |
| | 132 | 'full_name' => 'John Doe', |
| | 133 | 'email' => 'john@doe.com', |
| | 134 | 'date' => '2018/03/07', |
| | 135 | 'type' => 'delete', |
| | 136 | ), |
| | 137 | array( |
| | 138 | 'ID' => 2, |
| | 139 | 'full_name' => 'John Doe', |
| | 140 | 'email' => 'john@doe.com', |
| | 141 | 'date' => '2018/03/07', |
| | 142 | 'type' => 'delete', |
| | 143 | ), |
| | 144 | array( |
| | 145 | 'ID' => 3, |
| | 146 | 'full_name' => 'John Doe', |
| | 147 | 'email' => 'john@doe.com', |
| | 148 | 'date' => '2018/03/07', |
| | 149 | 'type' => 'delete', |
| | 150 | ), |
| | 151 | ); |
| 113 | | <?php |
| 114 | | if ( $privacy_policy_page_exists ) { |
| 115 | | $edit_href = add_query_arg( |
| 116 | | array( |
| 117 | | 'post' => $privacy_policy_page_id, |
| 118 | | 'action' => 'edit', |
| 119 | | ), |
| 120 | | admin_url( 'post.php' ) |
| 121 | | ); |
| 122 | | $view_href = get_permalink( $privacy_policy_page_id ); |
| | 157 | $export_requests = array_filter( $requests, function( $item ) { |
| | 158 | return $item['type'] == 'export'; |
| | 159 | }); |
| | 160 | ?> |
| | 161 | <div class="postbox"> |
| | 162 | <h2><?php esc_html_e( 'Erasure / Anonymization Requests' ); ?></h2> |
| | 163 | <div class="inside"> |
| | 164 | <?php if ( ! empty( $delete_requests ) ) { ?> |
| | 165 | <table class="widefat striped"> |
| | 166 | <thead> |
| | 167 | <tr> |
| | 168 | <th><?php esc_html_e( 'ID' ); ?></th> |
| | 169 | <th><?php esc_html_e( 'Full Name' ); ?></th> |
| | 170 | <th><?php esc_html_e( 'Email' ); ?></th> |
| | 171 | <th><?php esc_html_e( 'Date of Request' ); ?></th> |
| | 172 | <th><?php esc_html_e( 'Review' ); ?></th> |
| | 173 | <th><?php esc_html_e( 'Action' ); ?></th> |
| | 174 | </tr> |
| | 175 | </thead> |
| | 176 | <tbody> |
| | 177 | <?php foreach ( $delete_requests as $request ) : ?> |
| | 178 | <tr> |
| | 179 | <td><?php echo esc_html( $request['ID'] ); ?></td> |
| | 180 | <td><?php echo esc_html( $request['full_name'] ); ?></td> |
| | 181 | <td><?php echo esc_html( $request['email'] ); ?></td> |
| | 182 | <td><?php echo esc_html( $request['date'] ); ?></td> |
| | 183 | <td> |
| | 184 | <button class="button"><?php esc_html_e( 'Review Request' ); ?></button> |
| | 185 | </td> |
| | 186 | <td> |
| | 187 | <button class="button button-primary"><?php esc_html_e( 'Erase / Anonymize' ); ?></button> |
| | 188 | </td> |
| | 189 | </tr> |
| | 190 | <?php endforeach; ?> |
| | 191 | </tbody> |
| | 192 | </table> |
| | 193 | <?php } else { ?> |
| | 194 | <strong><?php esc_html_e( 'There are currently no Erasure / Anonymization Requests.' ); ?></strong> |
| | 195 | <?php } ?> |
| | 196 | </div> |
| | 197 | </div> |
| | 198 | <div class="postbox"> |
| | 199 | <h2><?php esc_html_e( 'Export Requests' ); ?></h2> |
| | 200 | <div class="inside"> |
| | 201 | <?php if ( ! empty( $export_requests ) ) { ?> |
| | 202 | <table class="widefat striped"> |
| | 203 | <thead> |
| | 204 | <tr> |
| | 205 | <th><?php esc_html_e( 'ID' ); ?></th> |
| | 206 | <th><?php esc_html_e( 'Full Name' ); ?></th> |
| | 207 | <th><?php esc_html_e( 'Email' ); ?></th> |
| | 208 | <th><?php esc_html_e( 'Date of Request' ); ?></th> |
| | 209 | <th><?php esc_html_e( 'Review' ); ?></th> |
| | 210 | <th><?php esc_html_e( 'Action' ); ?></th> |
| | 211 | </tr> |
| | 212 | </thead> |
| | 213 | <tbody> |
| | 214 | <?php foreach ( $export_requests as $request ) : ?> |
| | 215 | <tr> |
| | 216 | <td><?php echo esc_html( $request['ID'] ); ?></td> |
| | 217 | <td><?php echo esc_html( $request['full_name'] ); ?></td> |
| | 218 | <td><?php echo esc_html( $request['email'] ); ?></td> |
| | 219 | <td><?php echo esc_html( $request['date'] ); ?></td> |
| | 220 | <td> |
| | 221 | <button class="button"><?php esc_html_e( 'Review Request' ); ?></button> |
| | 222 | </td> |
| | 223 | <td> |
| | 224 | <button class="button button-primary"><?php esc_html_e( 'Export' ); ?></button> |
| | 225 | </td> |
| | 226 | </tr> |
| | 227 | <?php endforeach; ?> |
| | 228 | </tbody> |
| | 229 | </table> |
| | 230 | <?php } else { ?> |
| | 231 | <strong><?php esc_html_e( 'There are currently no Export Requests.' ); ?></strong> |
| | 232 | <?php } ?> |
| | 233 | </div> |
| | 234 | </div> |
| | 235 | </div> |
| | 236 | </div> |
| | 237 | <!-- sidebar --> |
| | 238 | <div id="postbox-container-1" class="postbox-container"> |
| | 239 | <!-- privacy policy page box --> |
| | 240 | <div class="meta-box-sortables"> |
| | 241 | <div class="postbox create-privacy-policy-box"> |
| | 242 | <h2><?php esc_html_e( 'Privacy Policy Page' ); ?></h2> |
| | 243 | <div class="inside"> |
| | 244 | <?php |
| | 245 | if ( $privacy_policy_page_exists ) { |
| | 246 | $edit_href = add_query_arg( |
| | 247 | array( |
| | 248 | 'post' => $privacy_policy_page_id, |
| | 249 | 'action' => 'edit', |
| | 250 | ), |
| | 251 | admin_url( 'post.php' ) |
| | 252 | ); |
| | 253 | $view_href = get_permalink( $privacy_policy_page_id ); |
| | 254 | ?> |
| | 255 | <p> |
| | 256 | <strong> |
| | 257 | <?php |
| | 258 | printf( |
| | 259 | // translators: %1$s Edit url. %2$s View url. |
| | 260 | __( '<a href="%1$s">Edit</a> or <a href="%2$s">view</a> your privacy policy.' ), |
| | 261 | esc_url( $edit_href ), |
| | 262 | esc_url( $view_href ) |
| | 263 | ); |
| | 264 | ?> |
| | 265 | </strong> |
| | 266 | </p> |
| | 267 | <?php |
| | 268 | } |
| | 269 | ?> |
| | 270 | <form method="post" action=""> |
| | 271 | <input type="hidden" name="action" value="set-privacy-page" /> |
| | 272 | <p class="post-attributes-label-wrapper"> |
| | 273 | <label class="post-attributes-label" for="page_for_privacy_policy"> |
| | 274 | <?php |
| | 275 | if ( $privacy_policy_page_exists ) { |
| | 276 | esc_html_e( 'Select another page for your privacy policy' ); |
| | 277 | } else { |
| | 278 | esc_html_e( 'Select an existing privacy policy page' ); |
| | 279 | } |
| | 280 | ?> |
| | 281 | </label> |
| | 282 | </p> |
| | 283 | <?php |
| | 284 | wp_dropdown_pages( |
| | 285 | array( |
| | 286 | 'name' => 'page_for_privacy_policy', |
| | 287 | 'show_option_none' => __( '— Select —' ), |
| | 288 | 'option_none_value' => '0', |
| | 289 | 'selected' => $privacy_policy_page_id, |
| | 290 | 'post_status' => array( 'draft', 'publish' ), |
| | 291 | ) |
| | 292 | ); |
| 144 | | if ( $privacy_policy_page_exists ) { |
| 145 | | _e( 'Select another page for your privacy policy' ); |
| 146 | | } else { |
| 147 | | _e( 'Select an existing privacy policy page' ); |
| 148 | | } |
| 149 | | |
| 150 | | ?> |
| 151 | | </label> |
| 152 | | </th> |
| 153 | | <td id="front-static-pages"> |
| 154 | | <form method="post" action=""> |
| 155 | | <input type="hidden" name="action" value="set-privacy-page" /> |
| 156 | | <?php |
| 157 | | |
| 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 | | ); |
| 167 | | |
| 168 | | wp_nonce_field( 'set-privacy-page' ); |
| 169 | | submit_button( __( 'Set Page' ), 'primary', 'submit', true, array( 'id' => 'set-page' ) ); |
| 170 | | |
| 171 | | ?> |
| 172 | | </form> |
| 173 | | </td> |
| 174 | | </tr> |
| 175 | | <?php |
| 176 | | |
| 177 | | if ( ! $privacy_policy_page_exists ) { |
| 178 | | ?> |
| 179 | | <tr> |
| 180 | | <th scope="row"><?php _e( 'Create new page for your privacy policy' ); ?></th> |
| 181 | | <td> |
| 182 | | <form method="post" action=""> |
| 183 | | <input type="hidden" name="action" value="create-privacy-page" /> |
| 184 | | <?php |
| 185 | | |
| 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> |
| | 311 | ?> |
| | 312 | </form> |
| | 313 | <?php |
| | 314 | } |
| | 315 | ?> |
| | 316 | </div> |
| | 317 | </div> |
| | 318 | </div> |
| | 319 | <!-- manual erase / anonymize box --> |
| | 320 | <div class="meta-box-sortables"> |
| | 321 | <div class="postbox"> |
| | 322 | <h2> |
| | 323 | <?php esc_html_e( 'Erase / Anonymize Data' ); ?> |
| | 324 | </h2> |
| | 325 | <div class="inside"> |
| | 326 | <form method="post" action=""> |
| | 327 | <p class="post-attributes-label-wrapper"> |
| | 328 | <label class="post-attributes-label" for="manual_erase_email"> |
| | 329 | E-mail |
| | 330 | </label> |
| | 331 | </p> |
| | 332 | <input type="text" name="action" name="manual_erase_email" id="manual_erase_email" value="" /> |
| | 333 | <?php |
| | 334 | submit_button( __( 'Erase / Anonymize' ), 'primary', 'submit', true, array( 'id' => 'delete' ) ); |
| | 335 | ?> |
| | 336 | </form> |
| | 337 | </div> |
| | 338 | </div> |
| | 339 | </div> |
| | 340 | <!-- manual export box --> |
| | 341 | <div class="meta-box-sortables"> |
| | 342 | <div class="postbox"> |
| | 343 | <h2> |
| | 344 | <?php esc_html_e( 'Export Data' ); ?> |
| | 345 | </h2> |
| | 346 | <div class="inside"> |
| | 347 | <form method="post" action=""> |
| | 348 | <p class="post-attributes-label-wrapper"> |
| | 349 | <label class="post-attributes-label" for="manual_export_email"> |
| | 350 | E-mail |
| | 351 | </label> |
| | 352 | </p> |
| | 353 | <input type="text" name="action" name="manual_export_email" id="manual_export_email" value="" /> |
| | 354 | <?php |
| | 355 | submit_button( __( 'Export' ), 'primary', 'submit', true, array( 'id' => 'export' ) ); |
| | 356 | ?> |
| | 357 | </form> |
| | 358 | </div> |
| | 359 | </div> |
| | 360 | </div> |
| | 361 | <!-- information box --> |
| | 362 | <div class="meta-box-sortables"> |
| | 363 | <div class="postbox tools-information"> |
| | 364 | <h2> |
| | 365 | <?php esc_html_e( 'General Information' ); ?> |
| | 366 | </h2> |
| | 367 | <div class="inside"> |
| | 368 | <p> |
| | 369 | Content Here |
| | 370 | </p> |
| | 371 | </div> |
| | 372 | </div> |
| | 373 | </div> |
| | 374 | </div> |
| | 375 | </div> |
| | 376 | </div> |
| | 377 | </div> |
| | 378 | <!-- TAB Privacy Policy Information --> |
| | 379 | <div class="tab privacy-information"> |
| | 380 | <div class="privacy-information-toc-wrapper"> |
| | 381 | <a href="#" class="privacy-information-toc active" data-tab="privacy-information-core"><?php esc_html_e( 'WordPress' ); ?></a> | |
| | 382 | <a href="#" class="privacy-information-toc" data-tab="privacy-information-plugin1"><?php esc_html_e( 'Plugin 1' ); ?></a> |
| | 383 | </div> |
| | 384 | <div class="tabs"> |
| | 385 | <div class="tab privacy-information-core"> |
| | 386 | <div class="tab-content"> |
| | 387 | <h2><?php esc_html_e( 'WordPress' ); ?></h2> |
| | 388 | <p>Content Here</p> |
| | 389 | </div> |
| | 390 | </div> |
| | 391 | <div class="tab privacy-information-plugin1"> |
| | 392 | <div class="tab-content"> |
| | 393 | <h2><?php esc_html_e( 'Plugin 1' ); ?></h2> |
| | 394 | <p>Content Here</p> |
| | 395 | </div> |
| | 396 | </div> |
| | 397 | </div> |
| | 398 | </div> |
| | 399 | </div> |