summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Boyer2008-08-30 10:26:58 (GMT)
committer Sam Boyer2008-08-30 10:26:58 (GMT)
commit3f4d9904cf52bf70d23abaede34f734f5b49d5c0 (patch)
tree1c865a1832574877227f65992c73c1d8694f66c5
parent9c3d32f0db7ee4cc328beafe1caea98fc41fe4ac (diff)
Backported include directory hook implementation example
-rw-r--r--includes/plugins.inc13
1 files changed, 13 insertions, 0 deletions
diff --git a/includes/plugins.inc b/includes/plugins.inc
index b548f3d..c357186 100644
--- a/includes/plugins.inc
+++ b/includes/plugins.inc
@@ -1403,6 +1403,19 @@ function panels_get_include_directories($plugin_type) {
* an error, it will undermine the Panels engine's lazy-loading logic and
* negatively impact memory usage.
*
+ * Note also that including a conditional on the plugin type so that you only
+ * define plugins for directories that you have actually populated with plugin
+ * include files is another small contribution to performance that you can make.
+ * For example, if you define only content_type and context plugins and don't
+ * want them at the root level of your module directory, this code would work:
+ * @code
+ * function MYMODULE_panels_include_directory($plugin_type) {
+ * if ($plugin_type == 'content_type' || $plugin_type == 'context') {
+ * return 'panels_inc/' . $plugin_type;
+ * }
+ * }
+ * @endcode
+ *
* @param string $plugin_type
* The plugin type for which the Panels engine is currently requesting the
* location of an include directory.