Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
page_standard_edit_fns.inc
1 <?php
18 require_once SQ_CORE_PACKAGE_PATH.'/page/page_edit_fns.inc';
19 
32 {
33 
34 
39  function __construct()
40  {
41  parent::__construct();
42 
43  }//end constructor
44 
45 
56  public function redirectToBodycopy(Page_Standard $asset, Backend_Outputter $o, $prefix)
57  {
58  // get the bodycopy attached to us
59  $bodycopy_link = $GLOBALS['SQ_SYSTEM']->am->getLinks($asset->id, SQ_LINK_TYPE_2, 'bodycopy', TRUE, 'major', NULL, '1', '1');
60  $bodycopy = NULL;
61  if (!empty($bodycopy_link)) {
62  $bodycopy = $GLOBALS['SQ_SYSTEM']->am->getAsset($bodycopy_link[0]['minorid'], 'bodycopy');
63  }
64  if (is_null($bodycopy)) {
65  trigger_localised_error('CORE0016', E_USER_ERROR, $asset->name);
66  return FALSE;
67  }
68 
69  // redirect to the bodycopy's edit contents screen
70  $o->setRedirect($bodycopy->getBackendHref('contents'));
71 
72  // fudge the navigation history a little so when they click on the link to ger back to the
73  // page it doesnt take them to the edit contents screen and then redirect them again
74  $_SESSION['sq_nav_history'][(count($_SESSION['sq_nav_history']) - 1)]['screen'] = 'details';
75 
76  return FALSE;
77 
78  }//end redirectToBodycopy()
79 
80 
81 }//end class
82 
83 ?>