/** * Displays the UD UI log page * * @todo Add button or link to delete log * @todo Add nonce to clear_log functions * @since 1.0 * @uses CRM_UD_F::delete_log() * @uses CRM_UD_F::get_log() * @uses CRM_UD_F::nice_time() * @uses add_action() Calls 'admin_menu' hook with an anonymous (lambda-style) function which uses add_menu_page to create a UI Log page * @uses add_action() Calls 'admin_menu' hook with an anonymous (lambda-style) function which uses add_menu_page to create a UI Log page */ function show_log_page() { if ($_REQUEST['ud_action'] == 'clear_log') { CRM_UD_F::delete_log(); } ?> <style type="text/css"> .ud_event_row b { background:none repeat scroll 0 0 #F6F7DC; padding:2px 6px;} </style> <div class="wrap"> <h2><?php _e('UD Log Page for', 'wpp'); ?> get_option('<?php echo 'WP_CRM' . 'log'; ?> '); <a href="<?php echo admin_url("admin.php?page=ud_log&ud_action=clear_log"); ?> " class="button"><?php _e('Clear Log', 'wpp'); ?> </a> </h2> <table class="widefat"> <thead> <tr> <th style="width: 150px"><?php _e('Timestamp', 'wpp'); ?> </th> <th><?php _e('Event', 'wpp'); ?> </th> <th><?php _e('User', 'wpp'); ?> </th> </tr> </thead> <tbody> <?php foreach (CRM_UD_F::get_log() as $event) { ?> <tr class="ud_event_row"> <td><?php echo CRM_UD_F::nice_time($event[0]); ?> </td> <td><?php echo $event[1]; ?> </td> <td><?php $user_data = get_userdata($event[2]); echo $user_data->display_name; ?> </td> </tr> <?php } ?> </tbody> </table> </div> <?php }