function qc($what, $force = false) { global $wp_invoice_debug; if (is_array($what)) { $what = WPI_Functions::pretty_print_r($what, false); } if (is_array($what) || is_string($what)) { // this way we don't try and show classess if ($wp_invoice_debug || $force) { ?> <div class="ui-state-error ui-corner-all" style="padding: 0 .7em;"> <p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span> <span class="message_content"><?php echo $what; ?></span></p> </div> <?php } } else { ?> <div class="ui-state-error ui-corner-all" style="padding: 0 .7em;"> <p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span> <span class="message_content"><pre><?php print_r($what); ?></pre></span></p> </div> <?php } // Add QC Message to Log //WPI_Functions::log($what) }
/** * This function prints out our invoice data for debugging purposes * @since 3.0 */ function debug_get_invoice(){ global $wpi_settings; if(!isset($_REQUEST['invoice_id'])) die(__("Please enter an invoice id.", WPI)); $this_invoice = new WPI_Invoice(); $this_invoice->load_invoice("id=".$_REQUEST['invoice_id']); echo WPI_Functions::pretty_print_r($this_invoice->data); die(); }
function help($wpi_settings) { ?> <script type='text/javascript'> jQuery(document).ready(function() { /** Do the JS for our view link */ jQuery('#wpi_settings_view').click(function(e){ e.preventDefault(); jQuery('.wpi_settings_row').toggle(); }); // Check plugin updates jQuery("#wpi_ajax_check_plugin_updates").click(function() { jQuery('.plugin_status').remove(); jQuery.post(ajaxurl, { action: 'wpi_ajax_check_plugin_updates' }, function(data) { message = "<div class='plugin_status updated fade'><p>" + data + "</p></div>"; jQuery(message).insertAfter("h2"); }); }); }); </script> <div class="wpi_settings_block"> <?php _e('Check for any premium feature updates from the Usability Dynamics Update server:', WPI); ?> <input type="button" id="wpi_ajax_check_plugin_updates" value="<?php esc_attr(_e('Check Updates', WPI)); ?>"> </div> <div class="wpi_settings_block"> <?php _e('Look up the $wpi_settings global settings array:', WPI); ?> <input type="button" id="wpi_settings_view" value="<?php esc_attr(_e('Toggle $wpi_settings', WPI)); ?>"> <div class="wpi_settings_row hidden"> <?php echo WPI_Functions::pretty_print_r($wpi_settings); ?> </div> </div> <?php }
/** * Help tab * * @param type $wpi_settings */ static function help($wpi_settings) { ?> <script type='text/javascript'> jQuery(document).ready(function() { //** Do the JS for our view link */ jQuery('.wpi_settings_view').click(function(e){ e.preventDefault(); jQuery(this).parent().find('.wpi_settings_row').toggle(); }); }); </script> <?php do_action('wpi_settings_before_help'); ?> <div class="wpi_settings_block"> <?php _e('Look up the $wpi_settings global settings array:', WPI); ?> <input type="button" class="wpi_settings_view" value="<?php esc_attr(_e('Toggle $wpi_settings', WPI)); ?> "> <div class="wpi_settings_row hidden"> <?php echo WPI_Functions::pretty_print_r($wpi_settings); ?> </div> </div> <div class="wpi_settings_block"> <?php _e("Restore Backup of WP-Invoice Configuration", WPI); ?> : <input name="wpi_settings[settings_from_backup]" type="file" /> <a href="<?php echo wp_nonce_url("admin.php?page=wpi_page_settings&wpi_action=download-wpi-backup", 'download-wpi-backup'); ?> "><?php _e('Download Backup of Current WP-Invoice Configuration.', WPI); ?> </a> </div> <?php do_action('wpi_settings_after_help'); ?> <?php }