RCI:RCI How to pass data back in run time

From CREpedia

Jump to: navigation, search

We want to make an RCI to display another button in the right sidebar of the Customer Listing in Admin. For this example, we will use the View Downloads button from File Distribution Management System (FDMS).

STEP 1: Repeat from Example 1 above. In this case, the file is admin/customers.php and the RCI call from customers.php that we will use is:

 //RCI start
$returned_rci = $cre_RCI->get('customers', 'listing');

$contents[] = array('align' => 'center', 'text' => '' . tep_image_button('button_edit.gif', IMAGE_EDIT) . ' ' . tep_image_butto
('button_delete.gif', IMAGE_DELETE) . ' ' . tep_image_button('button_orders.gif', IMAGE_ORDERS) . ' ' . tep_image_button('button_email.gif', IMAGE_EMAIL) . ' ' . tep_image_button('button_create_order.gif', IMAGE_BUTTON_CREATE_ORDER) . '' . $returned_rci);
//RCI eof


STEP 2: Create the RCI directory. In this case catalog/admin/includes/runtime/customers/

STEP 3: Create the RCI file. In this case the RCI filename is FDMS_customers_listing.php. FTP the file to the catalog/admin/includes/runtime/customers/ directory. The file contents are:

 
global $cInfo;
$rci .= '' . tep_image_button('button_view_downloads.gif', IMAGE_VIEW_DOWNLOADS) . '';
?>

Note the use of "global" to make available the cInfo object data.

Now if you browse to the Admin->Customers/Orders->Customers listing, you should see the Attach Files button in the right sidebar. If you do not see the RCI button, go through debug procedure listed in Example 1 above.