register_plugin( 'audit-trail', __FILE__ ); add_action( 'init', array( &$this, 'init' ) ); } function init() { if ( current_user_can( 'manage_options' ) ) { $this->register_ajax( 'at_view' ); $this->register_ajax( 'at_close' ); } } function at_view() { if ( check_ajax_referer( 'audittrail_view' ) ) { $id = intval( $_POST['id'] ); $item = AT_Audit::get( $id ); $this->render_admin( 'trail_details', array( 'item' => $item ) ); die(); } } function at_close( $item ) { if ( check_ajax_referer( 'audittrail_view' ) ) { $id = intval( $_POST['id'] ); $item = AT_Audit::get ($id); $this->render_admin ('trail_item', array ('item' => $item)); die(); } } }