WPDK  1.5.0
WordPress Development Kit
 All Data Structures Files Functions Variables Pages
WPDKListTableViewController Class Reference
Inheritance diagram for WPDKListTableViewController:

Public Member Functions

 __construct ($id, $title, $args)
 Constructor. More...
 
 get_columns ()
 Return the list of columns. More...
 
 get_statuses ()
 Statuses. More...
 
 get_status ($status)
 Count status. More...
 
 get_actions_with_status ($item, $status)
 Action with status. More...
 
 get_bulk_actions_with_status ($status)
 Bulk actions. More...
 
 load ()
 To override. More...
 
 admin_head ()
 To override. More...
 
 _admin_head ()
 To override. More...
 
 display ()
 Display the list table view. More...
 
 html ()
 Get the list table view. More...
 
 wpdk_header_view_title_did_appear ($view)
 Filter on title. More...
 
 no_items ()
 Called when no items found. More...
 
 get_views ()
 Get the top head views statuses. More...
 
 statuses ($statuses)
 Statuses. More...
 
 data ()
 Return the items data list. More...
 
 column_default ($item, $column_name)
 Process the content of a column. More...
 
 actions_column ($item, $column_name= 'description', $item_status= '', $custom_content= '')
 Process the content of ID column. More...
 
 column_cb ($item)
 Standard checkbox for group actions. More...
 
 get_bulk_actions ()
 Get the bulk actions. More...
 
 process_bulk_action ()
 Process the bulk actions and standard actions. More...
 
 urlRemveAction ()
 URL. More...
 
 urlRemoveNonce ()
 URL. More...
 
 urlAddNew ()
 URL. More...
 
 redirect ()
 Redirect. More...
 

Static Public Member Functions

static action ()
 
static willLoad ()
 To override. More...
 
static didHeadLoad ()
 To override. More...
 
static actions ($args, $status)
 Return the only used action. More...
 

Data Fields

const GET_STATUS = 'status'
 Default status key. More...
 
 $id
 A string id for this list table. More...
 
 $title
 View head title. More...
 
 $viewController
 View controller. More...
 
 $getStatusID
 GET id for status. More...
 
 $model
 Model. More...
 
 $column_headers = array()
 Column headers. More...
 

Protected Attributes

 $args
 WP_List_Table args. More...
 

Detailed Description

An extension of WordPress WP_List_Table class.

Overview

The WPDKListTableViewController class extends the WordPress WP_List_Table class. It add some useful methods to semplify the common procedure. This class is not a true view controller (WPDKViewController) but it is very similar.

Author
=undo= <info@.nosp@m.wpxt.nosp@m.re.me
Date
2014-02-07
Version
1.0.3

Definition at line 21 of file wpdk-listtable-viewcontroller.php.

Constructor & Destructor Documentation

__construct (   $id,
  $title,
  $args 
)

Constructor.

The child class should call this constructor from it's own constructor. Create an instance of WPDKListTableViewController class

Parameters
string$idList table id
string$titleTitle of view controller
array$argsStandard WP_List_Table args
Returns
WPDKListTableViewController

Definition at line 106 of file wpdk-listtable-viewcontroller.php.

Member Function Documentation

_admin_head ( )

To override.

Since
1.4.21

Definition at line 359 of file wpdk-listtable-viewcontroller.php.

static action ( )
static

Get the current action selected from the bulk actions dropdown.

Since
3.1.0
Returns
string|bool The action name or False if no action was selected

Definition at line 208 of file wpdk-listtable-viewcontroller.php.

static actions (   $args,
  $status 
)
static

Return the only used action.

Utility for build a right actions list when the list table is showing items.

Parameters
array$args
string$status
Deprecated:
Use the new engine subclass - used by SamrtShop
Returns
mixed

Definition at line 789 of file wpdk-listtable-viewcontroller.php.

actions_column (   $item,
  $column_name = 'description',
  $item_status = '',
  $custom_content = '' 
)

Process the content of ID column.

The list view has a special comumn named ID. This is the primary column where are displayed some action when the mouse is over the cel. This actions are usualy: Edit | Delete | Set Trash | etc... This method return the HTML markup with description item and the list of actions.

Parameters
array$itemThe single item
string$column_nameOptional. The column action id. Default 'description'
string$item_statusOptional. Overwrite the view status for item in a specific status
string$custom_contentOptional. Useful tuo override $custom_content
Note
You can override this method for your costum view. This method is called only there is a column named "id"
Returns
string

Definition at line 698 of file wpdk-listtable-viewcontroller.php.

admin_head ( )

To override.

Since
1.4.18

Definition at line 351 of file wpdk-listtable-viewcontroller.php.

column_cb (   $item)

Standard checkbox for group actions.

Return the HTML markup for the checkbox element used for multiple selections.

Note
You can override this method for your custom view. This method is called only there is a column named "cb"
Parameters
$item
Returns
string

Definition at line 734 of file wpdk-listtable-viewcontroller.php.

column_default (   $item,
  $column_name 
)

Process the content of a column.

Display a cel content for a column.

Note
I suggest to you to override this method
Parameters
array$itemThe single item
string$column_nameColumn name
Returns
mixed

Definition at line 674 of file wpdk-listtable-viewcontroller.php.

data ( )

Return the items data list.

Return the items data list. This method will be over-ridden in a sub-class.

Returns
array

Definition at line 654 of file wpdk-listtable-viewcontroller.php.

static didHeadLoad ( )
static

To override.

Definition at line 373 of file wpdk-listtable-viewcontroller.php.

display ( )

Display the list table view.

This method override the default WP_List_Table display.

Definition at line 386 of file wpdk-listtable-viewcontroller.php.

get_actions_with_status (   $item,
  $status 
)

Action with status.

Return tha array with the action for the current status

Note
To override
Parameters
mixed$itemThe item
string$statusCurrent status
Returns
array

Definition at line 181 of file wpdk-listtable-viewcontroller.php.

get_bulk_actions ( )

Get the bulk actions.

Return an array with the list of bulk actions used in combo menu select.

Returns
array

Definition at line 748 of file wpdk-listtable-viewcontroller.php.

get_bulk_actions_with_status (   $status)

Bulk actions.

Return the array with the buk action for the combo menu for a status of view

Note
To override
Parameters
string$statusCurrent status
Returns
array

Definition at line 196 of file wpdk-listtable-viewcontroller.php.

get_columns ( )

Return the list of columns.

Return a key value pairs array with the list of columns

Note
To override
Returns
array

Definition at line 136 of file wpdk-listtable-viewcontroller.php.

get_status (   $status)

Count status.

Return the count of specific status

Note
To override
Parameters
string$status
Returns
int

Definition at line 165 of file wpdk-listtable-viewcontroller.php.

get_statuses ( )

Statuses.

Return a key value pairs array with statuses supported

Note
To override
Returns
array

Definition at line 150 of file wpdk-listtable-viewcontroller.php.

get_views ( )

Get the top head views statuses.

Return an array with the HTML markup list of statuses. This method use the $statuses property format as:

$statuses = array( 'all' => array( 'label' => __( 'All' ), 'count' => 0 ),

'publish' => array( 'label' => __( 'Publish' ), 'count' => 0 ) );

Returns
array

Definition at line 507 of file wpdk-listtable-viewcontroller.php.

html ( )

Get the list table view.

Return the HTML markup for list table view.

Note
This is a low level method that create the HTML markup for list table view. You'll notice that the display method above has an input param for echo/display. For now this method html() is here for backward compatibility.
Returns
string

Definition at line 401 of file wpdk-listtable-viewcontroller.php.

load ( )

To override.

Since
1.4.18

Definition at line 343 of file wpdk-listtable-viewcontroller.php.

no_items ( )

Called when no items found.

The itens can be not found for two main reason: the query search has param tha t doesn't match with items, or the items list (or the database query) return an empty list.

Definition at line 476 of file wpdk-listtable-viewcontroller.php.

process_bulk_action ( )

Process the bulk actions and standard actions.

This method is to override and you can use it to processed the action request sent from list table. You can processed bulk and single action. This method must return a boolean in order to re-processed the items list view.

Returns
bool TRUE to stop display the list view, FALSE to display the list.

Definition at line 768 of file wpdk-listtable-viewcontroller.php.

redirect ( )

Redirect.

Redirect

Definition at line 878 of file wpdk-listtable-viewcontroller.php.

statuses (   $statuses)

Statuses.

To override

Parameters
$statuses

Definition at line 550 of file wpdk-listtable-viewcontroller.php.

urlAddNew ( )

URL.

Return the URL to Add New item

Returns
string

Definition at line 863 of file wpdk-listtable-viewcontroller.php.

urlRemoveNonce ( )

URL.

Return the current URL without: _wp_http_referer, _wpnonce and singular id

Returns
string

Definition at line 845 of file wpdk-listtable-viewcontroller.php.

urlRemveAction ( )

URL.

Return the current URL without: action and singular id

Returns
string

Definition at line 828 of file wpdk-listtable-viewcontroller.php.

static willLoad ( )
static

To override.

Definition at line 366 of file wpdk-listtable-viewcontroller.php.

wpdk_header_view_title_did_appear (   $view)

Filter on title.

Called when the title has been drawed

Parameters
WPDKHeaderView$viewThe header view

Definition at line 454 of file wpdk-listtable-viewcontroller.php.

Field Documentation

array $args
protected

WP_List_Table args.

Internal copy of WP_List_Table args

Definition at line 71 of file wpdk-listtable-viewcontroller.php.

array $column_headers = array()

Column headers.

Column header

Definition at line 90 of file wpdk-listtable-viewcontroller.php.

string $getStatusID

GET id for status.

Name of GET parameter for status. Default status

Definition at line 62 of file wpdk-listtable-viewcontroller.php.

string $id

A string id for this list table.

A string id for this list table view. This id is used in class HTML markup.

Definition at line 35 of file wpdk-listtable-viewcontroller.php.

Model.

An instance of WPDKListTableModel class

Since
1.3.0

Definition at line 81 of file wpdk-listtable-viewcontroller.php.

string $title

View head title.

The top head view controller title

Definition at line 44 of file wpdk-listtable-viewcontroller.php.

WPDKViewController $viewController

View controller.

The internal view controller for this list table

Definition at line 53 of file wpdk-listtable-viewcontroller.php.

const GET_STATUS = 'status'

Default status key.

Definition at line 26 of file wpdk-listtable-viewcontroller.php.


The documentation for this class was generated from the following file: