Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
page_custom_form_ecommerce_edit_fns.inc
1 <?php
18 require_once SQ_PACKAGES_PATH.'/cms/page_templates/page_custom_form/page_custom_form_edit_fns.inc';
19 
32 {
33 
34 
45  function redirectToFormEcomRules(&$asset, &$o, $prefix)
46  {
47  // get the bodycopy attached to us
48  $form_link = $GLOBALS['SQ_SYSTEM']->am->getLinks($asset->id, SQ_LINK_TYPE_2, 'form_ecommerce', false, 'major', '', '1', '1');
49  $form = $GLOBALS['SQ_SYSTEM']->am->getAsset($form_link[0]['minorid']);
50  if (is_null($form)) {
51  trigger_localised_error('ECOM0002', E_USER_ERROR, $asset->name, $asset->id);
52  return false;
53  }
54 
55  // redirect to the bodycopy's edit contents screen
56  $o->setRedirect($form->getBackendHref('ecommerce_rules'));
57 
58  // fudge the navigation history a little so when they click on the link to ger back to the
59  // page it doesnt take them to the edit contents screen and then redirect them again
60  $_SESSION['sq_nav_history'][(count($_SESSION['sq_nav_history']) - 1)]['screen'] = 'details';
61 
62  return false;
63 
64  }//end redirectToFormEcomRules()
65 
66 
67 }//end class
68 
69 ?>