Closed (fixed)
Project:
Add Plugins
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
2 Feb 2013 at 08:33 UTC
Updated:
27 Jan 2014 at 01:38 UTC
Jump to comment: Most recent
I'm not crazy about $path = "../../plugins/$plugin_type";. It shouldn't reference the plugins relative to the module, since the module could be in any number of places in the site. I quickly tried $path = base_path() . "/plugins/$plugin_type";, but it did not work and I had to stop. I'll check this out again later.
Comments
Comment #1
davidneedhamI also tried
$path = "/sites/all/plugins/$plugin_type";and$path = "sites/all/plugins/$plugin_type";with no luck.Comment #2
twistor commentedI believe you're looking for conf_path().
Awesome idea by the way.
Comment #3
twistor commentedremove dupe.
Comment #4
davidneedham@twistor: Hmm, when I
dsm(conf_path()), I only getsites/default. Thanks for the tip though!Comment #5
davidneedhamI also tried using DRUPAL_ROOT with no luck. So far, only
../../plugins/$plugin_typeworks.Comment #6
twistor commentedYeah, I'm thinking that ctools automatically adds the module path in front.
Comment #7
twistor commentedThe problem with
../../plugins/$plugin_typeis that it won't work if your modules are in another directory. eg.modules/contrib/add_plugins. I think the only way you can do this effectively is to figure out the directory you're in and walk up to the directory you want to put the plugins folder in.Comment #8
davidneedhamThe module has been rewritten from the ground up (not that there was much to start with). It now borrows a function from the Libraries module to locate the most specific plugins directory in any of the standard locations (/plugins, sites/all/plugins and sites/example.com/plugins). It then compares the path to the module (wherever the module is) to the path of the plugins folder, creates a path and passes that on to ctools.