Commit a21769a9ae3385fe45071304bb459e7e3e6b576e

Authored by Jonathan Byrne
1 parent 2968ae7b

KTS-2709

"After re-activating the Tag Cloud plugin this does not work"

Fixed. Hid Tag fieldset and linked it to tag cloud plugin.

Committed By: Jonathan Byrne
Reviewed By: Jalaoedien Abrahams

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@7798 c91229c3-7414-0410-bfa2-8a42b809f60b
plugins/ktcore/admin/documentFieldsv2.php
... ... @@ -66,7 +66,7 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
66 66  
67 67 $oTemplate->setData(array(
68 68 'context' => $this,
69   - 'fieldsets' => KTFieldset::getList('disabled != true'),
  69 + 'fieldsets' => KTFieldset::getList("disabled != true AND namespace != 'tagcloud'"),
70 70 ));
71 71 return $oTemplate;
72 72 }
... ...
plugins/ktcore/admin/plugins.php
... ... @@ -75,6 +75,33 @@ class KTPluginDispatcher extends KTAdminDispatcher {
75 75 $sTable = KTUtil::getTableName('plugins');
76 76 $aIds = (array) KTUtil::arrayGet($_REQUEST, 'pluginids');
77 77 KTPluginEntity::setEnabled($aIds);
  78 + //enabling or disabling Tag fieldset depending on whether tag cloud plugin is enabled or disabled.
  79 + //Get tag cloud object
  80 + $oTagClouPlugin = KTPluginEntity::getByNamespace('ktcore.tagcloud.plugin');
  81 + if($oTagClouPlugin->getDisabled() == '1')
  82 + {
  83 + //disable tag fieldset
  84 + $aFV = array(
  85 + 'disabled' => true,
  86 + );
  87 + $aWFV = array(
  88 + 'namespace' => 'tagcloud'
  89 + );
  90 + $res = DBUtil::whereUpdate('fieldsets', $aFV, $aWFV);
  91 + }
  92 + //if Tag Cloud plugin disabled
  93 + if($oTagClouPlugin->getDisabled() == '0')
  94 + {
  95 + //enable tag fieldset
  96 + $aFV = array(
  97 + 'disabled' => false,
  98 + );
  99 + $aWFV = array(
  100 + 'namespace' => 'tagcloud'
  101 + );
  102 + $res = DBUtil::whereUpdate('fieldsets', $aFV, $aWFV);
  103 + }
  104 +
78 105 $this->successRedirectToMain(_kt('Plugins updated'));
79 106 }
80 107  
... ...