Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Open new window


Mikepo

Recommended Posts

Hi

​I have the following code in admin/includes/boxes/updateqty.php file

 

 

  foreach ( $cl_box_groups as &$group ) {
    if ( $group['heading'] == BOX_HEADING_STOCK ) {
      $group['apps'][] = array('code' => 'centurion_update_qty.php',
                               'title' => MODULES_ADMIN_MENU_STOCK_UPDATE_QTY_CENTURION,
                               'link' => tep_href_link('centurion_update_qty.php'));
      break;
    }
  }

 

how can I force the link to 'centurion_update_qty.php' to open in a new window?

 

I know target="_blank" can be used in a html href tag, but how do I use that here?

 

Thanks

Mike

osC CE live - developing osC Phoenix adding modules with no core changes(awesome and easy!)

Link to comment
Share on other sites

I believe that this is not possible as those arrays are used to create links;

 

foreach ($groups['apps'] as $app) {

echo '<li><a href="' . $app['link'] . '">' . $app['title'] . '</a></li>';

}

 

and there is nothing there to tell it target=_blank

It would be a waste of time and effort to code it, so here is a javascript shortcut;

 

<script>
$(document).ready(function(){
  $('a[href*="centurion_update_qty.php"]').click(function(){
    window.open(this.href);
    return false;
  });
});
</script>
Core code change that into the bottom of admin/includes/template_bottom.php
Link to comment
Share on other sites

@@burt, thanks, does exactly what it said on the tin.  simple if you know how!

 

Cheers

Mike

osC CE live - developing osC Phoenix adding modules with no core changes(awesome and easy!)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...