forked from GNUsocial/gnu-social
plugins onAutoload now only overloads if necessary (extlibs etc.)
lib/plugin.php now has a parent onAutoload function that finds most common files that are used in plugins (actions, dataobjects, forms, libs etc.) if they are put in the standardised directories ('actions', 'classes', 'forms', 'lib' and perhaps some others in the future).
This commit is contained in:
@@ -74,29 +74,6 @@ class MapstractionPlugin extends Plugin
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hook for autoloading classes
|
||||
*
|
||||
* This makes sure our classes get autoloaded from our directory
|
||||
*
|
||||
* @param string $cls name of class being used
|
||||
*
|
||||
* @return boolean event handler return
|
||||
*/
|
||||
function onAutoload($cls)
|
||||
{
|
||||
switch ($cls)
|
||||
{
|
||||
case 'AllmapAction':
|
||||
case 'UsermapAction':
|
||||
case 'MapAction':
|
||||
include_once INSTALLDIR.'/plugins/Mapstraction/' . strtolower(mb_substr($cls, 0, -6)) . '.php';
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Hook for adding extra JavaScript
|
||||
*
|
||||
|
Reference in New Issue
Block a user