give_get_forms_label_singular(), // Singular name of the listed records 'plural' => give_get_forms_label_plural(), // Plural name of the listed records 'ajax' => false, // Does this table support ajax? ) ); } /** * Show the search field * * @since 2.0.1 * @access public * * @param string $text Label for the search box * @param string $input_id ID of the search box * * @return void */ public function search_box( $text, $input_id ) { } /** * Retrieve the table columns * * @access public * @since 2.0.1 * * @return array $columns Array of all the list table columns */ public function get_columns() { $columns = array( 'ID' => __( 'Log ID', 'give' ), 'date' => __( 'Date', 'give' ), 'details' => __( 'Process Details', 'give' ), ); return $columns; } /** * This function renders most of the columns in the list table. * * @access public * @since 2.0.1 * * @param array $item Contains all the data of the discount code * @param string $column_name The name of the column * * @return string Column Name */ public function column_default( $item, $column_name ) { switch ( $column_name ) { case 'ID': return sprintf( '%1$s %2$s', esc_attr( $item[ $column_name ] ), esc_attr( $item['title'] ) ); default: return esc_attr( $item[ $column_name ] ); } } /** * Output Error Message column * * @access public * @since 2.0.1 * * @param array $item Contains all the data of the log * * @return void */ public function column_details( $item ) { echo Give()->tooltips->render_link( array( 'label' => __( 'View Update Log', 'give' ), 'tag_content' => '', 'link' => "#TB_inline?width=640&inlineId=log-details-{$item['ID']}", 'attributes' => array( 'class' => 'thickbox give-error-log-details-link button button-small', ), ) ); ?> ', esc_html( $item['log_content'] ) ); } ?> _args['plural'] ); } ?>
bulk_actions( $which ); ?>
extra_tablenav( $which ); $this->pagination( $which ); ?>
get_paged(); $log_query = array( 'log_type' => 'update', 'paged' => $paged, 'posts_per_page' => $this->per_page, ); $logs = Give()->logs->get_connected_logs( $log_query ); if ( $logs ) { foreach ( $logs as $log ) { $logs_data[] = array( 'ID' => $log->ID, 'title' => $log->log_title, 'date' => $log->log_date, 'log_content' => $log->log_content, 'log_date' => $log->log_date, ); } } return $logs_data; } /** * Setup the final data for the table * * @access public * @since 2.0.1 * @uses Give_Update_Log_Table::get_columns() * @uses WP_List_Table::get_sortable_columns() * @uses Give_Update_Log_Table::get_pagenum() * @uses Give_Update_Log_Table::get_logs() * @uses Give_Update_Log_Table::get_log_count() * * @return void */ public function prepare_items() { $columns = $this->get_columns(); $hidden = array(); // No hidden columns $sortable = $this->get_sortable_columns(); $this->_column_headers = array( $columns, $hidden, $sortable ); $this->items = $this->get_logs(); $total_items = Give()->logs->get_log_count( 0, 'update' ); $this->set_pagination_args( array( 'total_items' => $total_items, 'per_page' => $this->per_page, 'total_pages' => ceil( $total_items / $this->per_page ), ) ); } }