Commit f787d278d5d23bea974e599137dd71e766dd19d4

Authored by Neil Blakey-Milner
1 parent 573ca0b7

Introduce the concept of a document action slot, in preparation for

future plans.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4977 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/actions/documentaction.inc.php
@@ -131,13 +131,14 @@ class KTDocumentAction extends KTStandardDispatcher { @@ -131,13 +131,14 @@ class KTDocumentAction extends KTStandardDispatcher {
131 } 131 }
132 132
133 class KTDocumentActionUtil { 133 class KTDocumentActionUtil {
134 - function getDocumentActionInfo() { 134 + function getDocumentActionInfo($slot = "documentaction") {
135 $oRegistry =& KTActionRegistry::getSingleton(); 135 $oRegistry =& KTActionRegistry::getSingleton();
136 - return $oRegistry->getActions('documentaction'); 136 + return $oRegistry->getActions($slot);
137 } 137 }
138 - function &getDocumentActionsForDocument($oDocument, $oUser) { 138 +
  139 + function &getDocumentActionsForDocument($oDocument, $oUser, $slot = "documentaction") {
139 $aObjects = array(); 140 $aObjects = array();
140 - foreach (KTDocumentActionUtil::getDocumentActionInfo() as $aAction) { 141 + foreach (KTDocumentActionUtil::getDocumentActionInfo($slot) as $aAction) {
141 list($sClassName, $sPath, $sPlugin) = $aAction; 142 list($sClassName, $sPath, $sPlugin) = $aAction;
142 $oRegistry =& KTPluginRegistry::getSingleton(); 143 $oRegistry =& KTPluginRegistry::getSingleton();
143 $oPlugin =& $oRegistry->getPlugin($sPlugin); 144 $oPlugin =& $oRegistry->getPlugin($sPlugin);
@@ -149,11 +150,11 @@ class KTDocumentActionUtil { @@ -149,11 +150,11 @@ class KTDocumentActionUtil {
149 return $aObjects; 150 return $aObjects;
150 } 151 }
151 152
152 - function getAllDocumentActions() { 153 + function getAllDocumentActions($slot = "documentaction") {
153 $aObjects = array(); 154 $aObjects = array();
154 $oDocument = null; 155 $oDocument = null;
155 $oUser = null; 156 $oUser = null;
156 - foreach (KTDocumentActionUtil::getDocumentActionInfo() as $aAction) { 157 + foreach (KTDocumentActionUtil::getDocumentActionInfo($slot) as $aAction) {
157 list($sClassName, $sPath, $sName, $sPlugin) = $aAction; 158 list($sClassName, $sPath, $sName, $sPlugin) = $aAction;
158 $oRegistry =& KTPluginRegistry::getSingleton(); 159 $oRegistry =& KTPluginRegistry::getSingleton();
159 $oPlugin =& $oRegistry->getPlugin($sPlugin); 160 $oPlugin =& $oRegistry->getPlugin($sPlugin);
@@ -165,11 +166,11 @@ class KTDocumentActionUtil { @@ -165,11 +166,11 @@ class KTDocumentActionUtil {
165 return $aObjects; 166 return $aObjects;
166 } 167 }
167 168
168 - function getDocumentActionsByNames($aNames) { 169 + function getDocumentActionsByNames($aNames, $slot = "documentaction") {
169 $aObjects = array(); 170 $aObjects = array();
170 $oDocument = null; 171 $oDocument = null;
171 $oUser = null; 172 $oUser = null;
172 - foreach (KTDocumentActionUtil::getDocumentActionInfo() as $aAction) { 173 + foreach (KTDocumentActionUtil::getDocumentActionInfo($slot) as $aAction) {
173 list($sClassName, $sPath, $sName, $sPlugin) = $aAction; 174 list($sClassName, $sPath, $sName, $sPlugin) = $aAction;
174 $oRegistry =& KTPluginRegistry::getSingleton(); 175 $oRegistry =& KTPluginRegistry::getSingleton();
175 $oPlugin =& $oRegistry->getPlugin($sPlugin); 176 $oPlugin =& $oRegistry->getPlugin($sPlugin);