Description
Taxonomies to Types mapping pageProcessing depends on the button that was pressed. There should only be one! Selection Validate? Perform action Display preview Display add Display edit Display select list ——————————- ——– ——————- ————— ———— ———— ——————- preview_x2t No n/a Yes – – – delete_x2t No delete selected x2t – – – Yes edit_x2t No n/a – – Yes Yes _oik_x2t_edit_x2t Yes update selected x2t – – Yes Yes _oik_x2t_add_x2t _oik_x2t_add_oik_x2t
Usage
oikx2t_lazy_do_page();Parameters
Returns
voidSource
File name: oik-types/admin/oik-x2t.phpLines:
function oikx2t_lazy_do_page() { oik_menu_header( "Taxonomies to Types", "w100pc" ); $validated = false; $preview_x2t = bw_array_get( $_REQUEST, "preview_x2t", null ); $delete_x2t = bw_array_get( $_REQUEST, "delete_x2t", null ); $edit_x2t = bw_array_get( $_REQUEST, "edit_x2t", null ); /** These codes override the ones from the list... but why do we need to do it? * Do we have to receive the others in the $_REQUEST **?** * */ $oik_x2t_edit_x2t = bw_array_get( $_REQUEST, "_oik_x2t_edit_x2t", null ); $oik_x2t_add_oik_x2t = bw_array_get( $_REQUEST, "_oik_x2t_add_oik_x2t", null ); $oik_x2t_add_x2t = bw_array_get( $_REQUEST, "_oik_x2t_add_x2t", null ); if ( $oik_x2t_add_x2t || $oik_x2t_add_oik_x2t ) { $preview_x2t = null; $delete_x2t = null; $edit_x2t = null; } if ( $preview_x2t ) { oik_box( NULL, NULL, "Preview", "oik_x2t_preview" ); } if ( $delete_x2t ) { _oik_x2t_delete_x2t( $delete_x2t ); } if ( $edit_x2t ) { global $bw_x2t; $bw_x2ts = get_option( "bw_x2ts" ); $bw_x2t = bw_array_get( $bw_x2ts, $edit_x2t, null ); $bw_x2t['args']['x2t'] = $edit_x2t; bw_trace2( $bw_x2t ); } if ( $oik_x2t_edit_x2t ) { $validated = _oik_x2t_x2t_validate( false ); } if ( $oik_x2t_add_oik_x2t ) { $validated = _oik_x2t_x2t_validate( true ); } if ( $oik_x2t_add_x2t || ( $oik_x2t_add_oik_x2t && !$validated ) ) { oik_box( NULL, NULL, "Add new", "oik_x2t_add_oik_x2t" ); } if ( $edit_x2t || $oik_x2t_edit_x2t || $validated ) { // oik_box( null, null, "Edit relationship", "oik_x2t_edit_x2t" ); } oik_box( NULL, NULL, "Taxonomies to types relationships", "oik_x2t_x2ts" ); oik_menu_footer(); bw_flush(); }View on GitHub
Called by
Invoked by
Calls
- bw_array_get() – Return the array[index] or array->index (for an object) or a default value if not set
- bw_flush() – Use bw_flush() to echo the contents of $bwecho then empty it
- bw_trace2() – Trace $value to the trace log file if tracing is active
- _oik_x2t_delete_x2t() – Delete the taxonomy to type relationship
- _oik_x2t_x2t_validate() – Validate the taxonomy to type relationship
