Concrete5 Dispatcher.php questions

Permalink
Fairly simply question here I think, hope someone can help.

I am coding an addition to the order search page in the eCommerce add-on. What I am doing is adding checkboxes beside each order, for the user to select a number of orders, upon hitting a new button it simply runs 'order_print.php', modified to run on a loop.

I've got all the code in place but I have run into a problem, when I click the button I get an access denied error because C5 did not execute.

How can I incorporate my new button with the dispatcher, so that it sets C5_EXECUTE = TRUE, but maintains the security.

I realize I could just take out the line
defined('C5_EXECUTE') or die(_("Access Denied."));
but I don't want to do that as it will create a vulnerability.

Included are the relevant files. ccm.dashboard.js has my javascript function in it which populates a PHP $_GET list with values from a javascript function and appends it to the url of print_shipping_labels.php

The code for my button appears on line 185 of search.php

I have only changed them to .txt to upload here, be sure to change ccm.dashboard back to .js, and the other two back to .php

Thanks a bunch if anyone can help out, I'd rather not troubleshoot for 15 hours.