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:
Mikael Nordfeldth
2013-08-28 15:54:26 +02:00
parent b6cfcfbcaa
commit de55d8f83b
282 changed files with 227 additions and 1423 deletions

View File

@@ -67,35 +67,6 @@ class BlogPlugin extends MicroAppPlugin
return true;
}
/**
* Load related modules when needed
*
* @param string $cls Name of the class to be loaded
*
* @return boolean hook value; true means continue processing, false means stop.
*/
function onAutoload($cls)
{
$dir = dirname(__FILE__);
switch ($cls)
{
case 'NewblogentryAction':
case 'ShowblogentryAction':
include_once $dir . '/' . strtolower(mb_substr($cls, 0, -6)) . '.php';
return false;
case 'BlogEntryForm':
case 'BlogEntryListItem':
include_once $dir . '/'.strtolower($cls).'.php';
return false;
case 'Blog_entry':
include_once $dir . '/'.$cls.'.php';
return false;
default:
return true;
}
}
/**
* Map URLs to actions
*