Commit 249fb0556f2ba7b3f8a280a3df41c6e6e3fcaaed

Authored by bshuttle
1 parent ae382bd4

make doctype always work ideally.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5824 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/documentmanagement/DocumentType.inc
@@ -185,10 +185,19 @@ class KTDocumentTypeManager { @@ -185,10 +185,19 @@ class KTDocumentTypeManager {
185 $this->checkActiveHandler(); 185 $this->checkActiveHandler();
186 if (is_null($this->_active_handler)) { 186 if (is_null($this->_active_handler)) {
187 // as totally normal if nothing is registered. 187 // as totally normal if nothing is registered.
188 - return DocumentType::getList(); 188 + $l = (array) DocumentType::getList();
189 } else { 189 } else {
190 - return $this->_active_handler->getListForUserAndFolder($oUser, $oFolder); 190 + $l = (array) $this->_active_handler->getListForUserAndFolder($oUser, $oFolder);
191 } 191 }
  192 +
  193 + $final = array();
  194 + foreach ($l as $oType) {
  195 + if (PEAR::isError($oType) || ($oType->getDisabled())) {
  196 + continue;
  197 + }
  198 + $final[] = $oType;
  199 + }
  200 + return $final;
192 } 201 }
193 202
194 function checkActiveHandler() { 203 function checkActiveHandler() {