Commit 72fbe9084b1c53a198c7e5623f965af60240a8bc

Authored by megan_w
1 parent 955477ae

KTS-2708

"Refactor plugins registration and loading"
Updated. Added in the code to call the setup function on registering the plugin.

Committed by: Megan Watson
Reviewed by: Conrad Vermeulen



git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/branches/3.4.5-Release-Branch@7704 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 7 additions and 2 deletions
lib/plugins/plugin.inc.php
... ... @@ -672,7 +672,7 @@ class KTPlugin {
672 672 'friendlyname' => $friendly_name,
673 673 ));
674 674 // FIXME we -really- need to raise an error here, somehow.
675   - return $oEntity;
  675 + //return $oEntity;
676 676 } else {
677 677 $oEntity->updateFromArray(array(
678 678 'path' => $this->stripKtDir($this->sFilename),
... ... @@ -680,8 +680,11 @@ class KTPlugin {
680 680 'unavailable' => false,
681 681 'friendlyname' => $friendly_name,
682 682 ));
683   - return $oEntity;
  683 + //return $oEntity;
684 684 }
  685 + /* ** Quick fix for optimisation. Reread must run plugin setup. ** */
  686 + $this->setup();
  687 + return $oEntity;
685 688 }
686 689 $disabled = 1;
687 690 if ($this->bAlwaysInclude || $this->autoRegister) { $disabled = 0; }
... ... @@ -697,6 +700,8 @@ class KTPlugin {
697 700 if (PEAR::isError($oEntity)) {
698 701 return $oEntity;
699 702 }
  703 + /* ** Quick fix for optimisation. Reread must run plugin setup. ** */
  704 + $this->setup();
700 705 return true;
701 706 }
702 707 }
... ...