Skip to content

Commit

Permalink
Issue #60 - convert bw_trace_options_do_page
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbingwide committed Dec 20, 2017
1 parent ed88909 commit daeeafe
Show file tree
Hide file tree
Showing 11 changed files with 418 additions and 82 deletions.
74 changes: 37 additions & 37 deletions admin/oik-bwtrace.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,24 +107,21 @@ function oik_action_options() {
BW_::bw_textarea_arr( "bw_action_options", __( "Trace attached hook functions", "oik-bwtrace" ), $options, "hook_funcs", 80 );
BW_::bw_textarea_arr( "bw_action_options", __( "Hooks to debug backtrace", "oik-bwtrace" ), $options, "backtrace", 80 );
BW_::bw_textarea_arr( "bw_action_options", __( "'String watch' for this string", "oik-bwtrace" ), $options, "stringwatch", 80 );

//bw_tablerow( array( "", "<input type=\"submit\" name=\"ok\" value=\"Save changes\" class=\"button-primary\"/>") );
etag( "table" );
BW_::p( isubmit( "ok", __( "Save changes", "oik-bwtrace" ), null, "button-primary" ) );
etag( "form" );
}


/**
* Display the oik trace options page
*
*/
function bw_trace_options_do_page() {
oik_menu_header( "trace options" );
oik_box( null, null, "Options", "oik_trace_options" );
oik_box( null, null, "Information", "oik_trace_info" );
oik_box( null, null, "Notes about oik trace", "oik_trace_notes" );
oik_box( null, null, "Trace options and reset button", "oik_trace_reset_notes" );
BW_::oik_menu_header( __( "trace options", "oik-bwtrace" ) );
BW_::oik_box( null, null, __( "Options", "oik-bwtrace" ), "oik_trace_options" );
BW_::oik_box( null, null, __( "Information", "oik-bwtrace" ), "oik_trace_info" );
BW_::oik_box( null, null, __( "Notes about oik trace", "oik-bwtrace" ), "oik_trace_notes" );
BW_::oik_box( null, null, __( "Trace options and reset button", "oik-bwtrace" ), "oik_trace_reset_notes" );
oik_menu_footer();
bw_flush();
}
Expand All @@ -145,39 +142,42 @@ function oik_trace_options() {
bw_flush();
settings_fields('bw_trace_options_options');

bw_textfield_arr( "bw_trace_options", "Trace file", $options, 'file', 60 );
bw_checkbox_arr( "bw_trace_options", "Reset trace file every transaction", $options, 'reset' );
bw_checkbox_arr( "bw_trace_options", "Trace enabled", $options, 'trace' );
BW_::bw_textfield_arr( "bw_trace_options", __( "Trace file", "oik-bwtrace" ), $options, 'file', 60 );
bw_checkbox_arr( "bw_trace_options", __( "Reset trace file every transaction", "oik-bwtrace" ), $options, 'reset' );
bw_checkbox_arr( "bw_trace_options", __( "Trace enabled", "oik-bwtrace" ), $options, 'trace' );

bw_textfield_arr( "bw_trace_options", "AJAX Trace file", $options, 'file_ajax', 60 );
bw_checkbox_arr( "bw_trace_options", "Reset AJAX trace file every AJAX transaction", $options, 'reset_ajax' );
bw_checkbox_arr( "bw_trace_options", "AJAX Trace enabled", $options, 'trace_ajax' );
BW_::bw_textfield_arr( "bw_trace_options", __( "AJAX Trace file", "oik-bwtrace" ), $options, 'file_ajax', 60 );
bw_checkbox_arr( "bw_trace_options", __( "Reset AJAX trace file every AJAX transaction", "oik-bwtrace" ), $options, 'reset_ajax' );
bw_checkbox_arr( "bw_trace_options", __( "AJAX Trace enabled", "oik-bwtrace" ), $options, 'trace_ajax' );

// Does this need includes/bwtrace.php?
$trace_levels = bw_list_trace_levels();
// Do we need to default this after upgrade?
//$options['level'] = bw_trace_level();
bw_select_arr( "bw_trace_options", "Trace level", $options, 'level', array( "#options" => $trace_levels ) );
bw_checkbox_arr( "bw_trace_options", "Fully qualified file names", $options, 'qualified' );
bw_checkbox_arr( "bw_trace_options", "Include trace record count", $options, 'count' );
bw_checkbox_arr( "bw_trace_options", "Include timestamp", $options, 'date' );
bw_checkbox_arr( "bw_trace_options", "Include current filter", $options, 'filters' );
bw_checkbox_arr( "bw_trace_options", "Include number of queries", $options, "num_queries" );
bw_checkbox_arr( "bw_trace_options", "Include post ID", $options, "post_id" );
BW_::bw_select_arr( "bw_trace_options", __( "Trace level", "oik-bwtrace" ), $options, 'level', array( "#options" => $trace_levels ) );
bw_checkbox_arr( "bw_trace_options", __( "Fully qualified file names", "oik-bwtrace" ), $options, 'qualified' );
bw_checkbox_arr( "bw_trace_options", __( "Include trace record count", "oik-bwtrace" ), $options, 'count' );
bw_checkbox_arr( "bw_trace_options", __( "Include timestamp", "oik-bwtrace" ), $options, 'date' );
bw_checkbox_arr( "bw_trace_options", __( "Include current filter", "oik-bwtrace" ), $options, 'filters' );
bw_checkbox_arr( "bw_trace_options", __( "Include number of queries", "oik-bwtrace" ), $options, "num_queries" );
bw_checkbox_arr( "bw_trace_options", __( "Include post ID", "oik-bwtrace" ), $options, "post_id" );
$memory_limit = ini_get( "memory_limit" );
bw_trace( $memory_limit, "memory_limit", false, BW_TRACE_DEBUG );
bw_checkbox_arr( "bw_trace_options", "Include memory/peak usage ( limit $memory_limit )", $options, 'memory' );
bw_checkbox_arr( "bw_trace_options", "Include files loaded count", $options, 'files' );
$current_ip = "<br />Current IP: ";
$current_ip .= bw_array_get( $_SERVER, "REMOTE_ADDR", null );
bw_textfield_arr( "bw_trace_options", "Trace specific IP $current_ip", $options, 'ip', 20 );
bw_checkbox_arr( "bw_trace_options", sprintf( __( 'Include memory/peak usage ( limit %1$s )', "oik-bwtrace" ), $memory_limit ), $options, 'memory' );
bw_checkbox_arr( "bw_trace_options", __( "Include files loaded count", "oik-bwtrace" ), $options, 'files' );

$current_ip = bw_array_get( $_SERVER, "REMOTE_ADDR", null );
$current_ip_text = "<br />";
$current_ip_text .= sprintf( __( 'Current IP: %1$s', "oik-bwtrace" ), $current_ip );

BW_::bw_textfield_arr( "bw_trace_options", __( "Trace specific IP", "oik-bwtrace" ) . $current_ip_text, $options, 'ip', 20 );

// Trace error processing is not yet enabled.
// textfield( "bw_trace_options[errors]", 1 ,"Trace errors (0=no,-1=all,1=E_ERROR,2=E_WARNING,4=E_PARSE, etc)", $options['errors'] );
// bw_tablerow( array( "", "<input type=\"submit\" name=\"ok\" value=\"Save changes\" class=\"button-primary\"/>") );

etag( "table" );
p( isubmit( "ok", __( "Save changes", 'oik-bwtrace' ), null, "button-primary" ) );
BW_::p( isubmit( "ok", __( "Save changes", 'oik-bwtrace' ), null, "button-primary" ) );
etag( "form" );

bw_flush();
Expand All @@ -187,22 +187,22 @@ function oik_trace_options() {
* Display trace notes
*/
function oik_trace_notes() {
p( "The tracing output produced by oik-bwtrace can be used for problem determination.");
p( "It's not for the faint hearted.");
p( "The oik-bwtrace plugin should <b>not</b> need to be activated on a live site.");
p( "If you do need to activate it, only do so for a short period of time." );
BW_::p( __( "The tracing output produced by oik-bwtrace can be used for problem determination.", "oik-bwtrace" ) );
BW_::p( __( "It's not for the faint hearted.", "oik-bwtrace" ) );
BW_::p( __( "The oik-bwtrace plugin should <b>not</b> need to be activated on a live site.", "oik-bwtrace" ) );
BW_::p( __( "If you do need to activate it, only do so for a short period of time.", "oik-bwtrace" ) );

p( "You will need to specify the trace file name (e.g. bwtrace.loh )" );
p( "When you want to trace processing check 'Trace enabled'" );
p( "Check 'Reset trace file every transaction' to cause the trace file to be cleared for every request, including AJAX requests." );
BW_::p( __( "You will need to specify the trace file name (e.g. bwtrace.loh )", "oik-bwtrace" ) );
BW_::p( __( "When you want to trace processing check 'Trace enabled'", "oik-bwtrace" ) );
BW_::p( __( "Check 'Reset trace file every transaction' to cause the trace file to be cleared for every request, including AJAX requests.", "oik-bwtrace" ) );


p("You may find the most recent trace output at..." );
BW_::p( __( "You may find the most recent trace output at...", "oik-bwtrace" ) );
$bw_trace_url = bw_trace_url();

alink( NULL, $bw_trace_url, $bw_trace_url, "View trace output in your browser.");
BW_::alink( NULL, $bw_trace_url, $bw_trace_url, __( "View trace output in your browser.", "oik-bwtrace" ) );

p("If you want to trace processing within some content you can use two shortcodes: [bwtron] to turn trace on and [bwtroff] to turn it off" );
BW_::p( __( "If you want to trace processing within some content you can use two shortcodes: [bwtron] to turn trace on and [bwtroff] to turn it off", "oik-bwtrace" ) );

bw_flush();

Expand Down
12 changes: 6 additions & 6 deletions includes/bwtrace.php
Original file line number Diff line number Diff line change
Expand Up @@ -1065,12 +1065,12 @@ function bw_lazy_trace2( $value=null, $text=null, $show_args=true, $level=null )
* @return array Trace levels
*/
function bw_list_trace_levels() {
$levels = array( BW_TRACE_DEBUG => "Debug level"
, BW_TRACE_INFO => "Information level - standard"
, BW_TRACE_NOTICE => "Notice level"
, BW_TRACE_WARNING => "Warning level"
, BW_TRACE_ERROR => "Error level"
, BW_TRACE_VERBOSE => "Verbose level - noisier than Debug"
$levels = array( BW_TRACE_DEBUG => __( "Debug level", "oik-bwtrace" )
, BW_TRACE_INFO => __( "Information level - standard", "oik-bwtrace" )
, BW_TRACE_NOTICE => __( "Notice level", "oik-bwtrace" )
, BW_TRACE_WARNING => __( "Warning level" , "oik-bwtrace" )
, BW_TRACE_ERROR => __( "Error level", "oik-bwtrace" )
, BW_TRACE_VERBOSE => __( "Verbose level - noisier than Debug", "oik-bwtrace" )
);
return( $levels );
}
Expand Down
Binary file modified languages/oik-bwtrace-bb_BB.mo
Binary file not shown.
140 changes: 130 additions & 10 deletions languages/oik-bwtrace-bb_BB.po
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: oik bwtrace 2.1.1-beta-20171023\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tag/oik-bwtrace\n"
"POT-Creation-Date: 2017-12-19 17:57:35+00:00\n"
"POT-Creation-Date: 2017-12-20 15:56:11+00:00\n"
"MIME-Version: 1.0\n"
"Plural-Forms: nplurals=2; plural=n == 1 ? 0 : 1;\n"
"Language: bb_BB\n"
Expand All @@ -13,6 +13,21 @@ msgstr ""
"PO-Revision-Date: 2017-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
#: admin/class-oik-trace-info.php:25
msgid "Field"
msgstr "Feild"


#: admin/class-oik-trace-info.php:25
msgid "Value"
msgstr "Vlaue"


#: admin/class-oik-trace-info.php:25
msgid "Notes"
msgstr "Ntoes"


#: admin/oik-bwtrace.php:51
msgid "oik trace options"
msgstr "OIk tarce otpoins"
Expand All @@ -28,12 +43,12 @@ msgid "action options"
msgstr "atcoin otpoins"


#: admin/oik-bwtrace.php:73 admin/oik-bwtrace.php:124
#: admin/oik-bwtrace.php:73 admin/oik-bwtrace.php:121
msgid "Options"
msgstr "Otpoins"


#: admin/oik-bwtrace.php:74
#: admin/oik-bwtrace.php:74 admin/oik-bwtrace.php:122
msgid "Information"
msgstr "Ifnroamiton"

Expand Down Expand Up @@ -118,41 +133,111 @@ msgid "'String watch' for this string"
msgstr "'Srtnig wtach' fOr tihs srtnig"


#: admin/oik-bwtrace.php:113 admin/oik-bwtrace.php:180
#: admin/oik-bwtrace.php:111 admin/oik-bwtrace.php:180
msgid "Save changes"
msgstr "Svae cahgnes"


#: admin/oik-bwtrace.php:123
#: admin/oik-bwtrace.php:120
msgid "trace options"
msgstr "tarce otpoins"


#: admin/oik-bwtrace.php:126
#: admin/oik-bwtrace.php:123
msgid "Notes about oik trace"
msgstr "Ntoes aobut OIk tarce"


#: admin/oik-bwtrace.php:127
#: admin/oik-bwtrace.php:124
msgid "Trace options and reset button"
msgstr "Tarce otpoins And rseet btuotn"


#: admin/oik-bwtrace.php:148
#: admin/oik-bwtrace.php:145
msgid "Trace file"
msgstr "Tarce flie"


#: admin/oik-bwtrace.php:152
#: admin/oik-bwtrace.php:146
msgid "Reset trace file every transaction"
msgstr "Rseet tarce flie eevry tarsncaiton"


#: admin/oik-bwtrace.php:147
msgid "Trace enabled"
msgstr "Tarce eanlbed"


#: admin/oik-bwtrace.php:149
msgid "AJAX Trace file"
msgstr "AAJX Tarce flie"


#: admin/oik-bwtrace.php:160
#: admin/oik-bwtrace.php:150
msgid "Reset AJAX trace file every AJAX transaction"
msgstr "Rseet AAJX tarce flie eevry AAJX tarsncaiton"


#: admin/oik-bwtrace.php:151
msgid "AJAX Trace enabled"
msgstr "AAJX Tarce eanlbed"


#: admin/oik-bwtrace.php:157
msgid "Trace level"
msgstr "Tarce lveel"


#: admin/oik-bwtrace.php:158
msgid "Fully qualified file names"
msgstr "Fluly qauilifed flie nmaes"


#: admin/oik-bwtrace.php:159
msgid "Include trace record count"
msgstr "Icnulde tarce rcerod cuont"


#: admin/oik-bwtrace.php:160
msgid "Include timestamp"
msgstr "Icnulde tmiseatmp"


#: admin/oik-bwtrace.php:161
msgid "Include current filter"
msgstr "Icnulde cruernt flietr"


#: admin/oik-bwtrace.php:162
msgid "Include number of queries"
msgstr "Icnulde nmuebr Of qeuires"


#: admin/oik-bwtrace.php:163
msgid "Include post ID"
msgstr "Icnulde psot ID"


#: admin/oik-bwtrace.php:166
msgid "Include memory/peak usage ( limit %1$s )"
msgstr "Icnulde mmeroy/paek uasge ( lmiit %1$s )"


#: admin/oik-bwtrace.php:167
msgid "Include files loaded count"
msgstr "Icnulde flies laoedd cuont"


#: admin/oik-bwtrace.php:171
msgid "Current IP: %1$s"
msgstr "Cruernt IP: %1$s"


#: admin/oik-bwtrace.php:173
msgid "Trace specific IP"
msgstr "Tarce sepicifc IP"


#: admin/oik-bwtrace.php:190
msgid ""
"The tracing output produced by oik-bwtrace can be used for problem "
Expand Down Expand Up @@ -203,6 +288,11 @@ msgid "You may find the most recent trace output at..."
msgstr "YOU mAy fnid thE msot rcenet tarce otuupt At..."


#: admin/oik-bwtrace.php:203
msgid "View trace output in your browser."
msgstr "Veiw tarce otuupt In yuor borswer."


#: admin/oik-bwtrace.php:205
msgid ""
"If you want to trace processing within some content you can use two "
Expand All @@ -217,6 +307,36 @@ msgid "Activate the oik base plugin to enable the [bwtrace] shortcode"
msgstr "Atcvitae thE OIk bsae pulign tO eanlbe thE [bwtrace] sohtrocde"


#: includes/bwtrace.php:1068
msgid "Debug level"
msgstr "Dbeug lveel"


#: includes/bwtrace.php:1069
msgid "Information level - standard"
msgstr "Ifnroamiton lveel - satdnrad"


#: includes/bwtrace.php:1070
msgid "Notice level"
msgstr "Ntocie lveel"


#: includes/bwtrace.php:1071
msgid "Warning level"
msgstr "Wrainng lveel"


#: includes/bwtrace.php:1072
msgid "Error level"
msgstr "Error lveel"


#: includes/bwtrace.php:1073
msgid "Verbose level - noisier than Debug"
msgstr "Vreobse lveel - nioiser tahn Dbeug"


#: libs/bobbforms.php:510
msgid "None"
msgstr "Nnoe"
Expand Down
Binary file modified languages/oik-bwtrace-en_GB.mo
Binary file not shown.
Loading

0 comments on commit daeeafe

Please sign in to comment.