Commit 8dfb96d633f373500a129e96a9b47abad4ae97c4

Authored by Neil Blakey-Milner
1 parent 06b856cc

Automatically create breadcrumbs for document actions.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4065 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/actions/documentaction.inc.php
@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 require_once(KT_LIB_DIR . '/actions/actionregistry.inc.php'); 3 require_once(KT_LIB_DIR . '/actions/actionregistry.inc.php');
4 require_once(KT_LIB_DIR . '/workflow/workflowutil.inc.php'); 4 require_once(KT_LIB_DIR . '/workflow/workflowutil.inc.php');
5 require_once(KT_LIB_DIR . '/dispatcher.inc.php'); 5 require_once(KT_LIB_DIR . '/dispatcher.inc.php');
  6 +require_once(KT_LIB_DIR . '/browse/browseutil.inc.php');
6 7
7 class KTDocumentAction extends KTStandardDispatcher { 8 class KTDocumentAction extends KTStandardDispatcher {
8 var $sName; 9 var $sName;
@@ -15,6 +16,11 @@ class KTDocumentAction extends KTStandardDispatcher { @@ -15,6 +16,11 @@ class KTDocumentAction extends KTStandardDispatcher {
15 var $_bDisabled; 16 var $_bDisabled;
16 var $_sDisabledText = null; 17 var $_sDisabledText = null;
17 18
  19 + var $sSection = "view_details";
  20 + var $aBreadcrumbs = array(
  21 + array('action' => 'browse', 'name' => 'Browse'),
  22 + );
  23 +
18 function KTDocumentAction($oDocument = null, $oUser = null) { 24 function KTDocumentAction($oDocument = null, $oUser = null) {
19 $this->oDocument =& $oDocument; 25 $this->oDocument =& $oDocument;
20 $this->oUser =& $oUser; 26 $this->oUser =& $oUser;
@@ -99,9 +105,9 @@ class KTDocumentAction extends KTStandardDispatcher { @@ -99,9 +105,9 @@ class KTDocumentAction extends KTStandardDispatcher {
99 105
100 function check() { 106 function check() {
101 $this->oDocument =& $this->oValidator->validateDocument($_REQUEST['fDocumentId']); 107 $this->oDocument =& $this->oValidator->validateDocument($_REQUEST['fDocumentId']);
102 - if ($this->_show() === false) {  
103 - return false;  
104 - } 108 + $aOptions = array("final" => false);
  109 + $this->aBreadcrumbs = array_merge($this->aBreadcrumbs,
  110 + KTBrowseUtil::breadcrumbsForDocument($this->oDocument, $aOptions));
105 return true; 111 return true;
106 } 112 }
107 113