From: Franck Villaume Date: Tue, 23 Nov 2021 16:50:17 +0000 (+0100) Subject: remove duplicated Plugin->getPluginPath function. Use Plugin->getInstallDir function X-Git-Url: https://scm.fusionforge.org/anonscm/gitweb?p=fusionforge%2Ffusionforge.git;a=commitdiff_plain;h=2db51342ca5fee32a3e1abc28a0f222b176881cb remove duplicated Plugin->getPluginPath function. Use Plugin->getInstallDir function --- diff --git a/src/common/include/Plugin.class.php b/src/common/include/Plugin.class.php index 5bff500b3b..2feb0a6d17 100644 --- a/src/common/include/Plugin.class.php +++ b/src/common/include/Plugin.class.php @@ -95,20 +95,6 @@ class Plugin extends FFError { return (isset($this->provides[$feature]) && $this->provides[$feature]); } - /** - * Added for Codendi compatibility - * getPluginPath() - get installation dir for the plugin. - * - * @return string the directory where the plugin should be linked. - */ - function getPluginPath() { - if (isset($this->installdir) && $this->installdir) { - return $this->installdir; - } else { - return 'plugins/'.$this->name; - } - } - /** * CallHook() - call a particular hook. * diff --git a/src/plugins/forumml/include/forummlPlugin.class.php b/src/plugins/forumml/include/forummlPlugin.class.php index 1d4ea332b8..bc3c8aafeb 100644 --- a/src/plugins/forumml/include/forummlPlugin.class.php +++ b/src/plugins/forumml/include/forummlPlugin.class.php @@ -173,17 +173,14 @@ class ForumMLPlugin extends Plugin { } function cssFile($params) { - $request =& HTTPRequest::instance(); - if (strpos($_SERVER['REQUEST_URI'], $this->getPluginPath()) === 0) { + if (strpos($_SERVER['REQUEST_URI'], $this->getInstallDir()) === 0) { echo ''."\n"; } } function jsFile($params) { - //$request =& HTTPRequest::instance(); - if (strpos($_SERVER['REQUEST_URI'], $this->getPluginPath()) === 0) { - //echo ''."\n"; - echo ''."\n"; + if (strpos($_SERVER['REQUEST_URI'], $this->getInstallDir()) === 0) { + echo ''."\n"; } } diff --git a/src/plugins/hudson/include/hudsonPlugin.class.php b/src/plugins/hudson/include/hudsonPlugin.class.php index 7ae8e22d95..21f15649d6 100644 --- a/src/plugins/hudson/include/hudsonPlugin.class.php +++ b/src/plugins/hudson/include/hudsonPlugin.class.php @@ -127,7 +127,7 @@ control over it to the project administrator."); function cssFile($params) { // Only show the stylesheet if we're actually in the hudson pages. // This stops styles inadvertently clashing with the main site. - if (strpos($_SERVER['REQUEST_URI'], $this->getPluginPath()) === 0 || + if (strpos($_SERVER['REQUEST_URI'], $this->getInstallDir()) === 0 || strpos($_SERVER['REQUEST_URI'], '/my/') === 0 || strpos($_SERVER['REQUEST_URI'], '/projects/') === 0 || strpos($_SERVER['REQUEST_URI'], '/widgets/') === 0 diff --git a/src/plugins/mailman/include/mailmanPlugin.class.php b/src/plugins/mailman/include/mailmanPlugin.class.php index d98f150a50..9cfbe4fb7b 100644 --- a/src/plugins/mailman/include/mailmanPlugin.class.php +++ b/src/plugins/mailman/include/mailmanPlugin.class.php @@ -216,7 +216,7 @@ class mailmanPlugin extends Plugin { } // TODO : WTF ? : I think this should probably be gotten rid of -- OlivierBerger elseif ($hookname=='site_admin_option_hook') { - echo '
  • Template [' . _('Mailman plugin') . ']
  • '; + echo '
  • Template [' . _('Mailman plugin') . ']
  • '; } }