Plugins
class Plugins
Constants
| DATABASE_VERSION |
|
| ADMIN_SESSION_AFTER_START |
Constanta's List of Hooks |
| CONTENT_BEFORE_LOAD |
|
| CONTENT_AFTER_LOAD |
|
| BIBLIOGRAPHY_INIT |
|
| BIBLIOGRAPHY_BEFORE_UPDATE |
|
| BIBLIOGRAPHY_AFTER_UPDATE |
|
| BIBLIOGRAPHY_BEFORE_SAVE |
|
| BIBLIOGRAPHY_AFTER_SAVE |
|
| BIBLIOGRAPHY_BEFORE_DELETE |
|
| BIBLIOGRAPHY_AFTER_DELETE |
|
| BIBLIOGRAPHY_CUSTOM_FIELD_DATA |
|
| BIBLIOGRAPHY_CUSTOM_FIELD_FORM |
|
| BIBLIOGRAPHY_BEFORE_DATAGRID_OUTPUT |
|
| CIRCULATION_AFTER_SUCCESSFUL_TRANSACTION |
|
| MEMBERSHIP_INIT |
|
| MEMBERSHIP_BEFORE_UPDATE |
|
| MEMBERSHIP_AFTER_UPDATE |
|
| MEMBERSHIP_BEFORE_SAVE |
|
| MEMBERSHIP_AFTER_SAVE |
|
| OVERDUE_NOTICE_INIT |
|
| DUEDATE_NOTICE_INIT |
|
| MODULE_MAIN_MENU_INIT |
|
| OAI2_INIT |
|
Properties
| protected array | $locations | Store plugins location, so plugins can stored in multiple location |
|
| protected array | $plugins | Plugin scanned will store here |
|
| protected | $active_plugins | ||
| protected | $hooks | ||
| protected | $menus |
Methods
Plugins constructor.
No description
Add .plugin.php | plugin file into list
Check if path location have sub-directory
No description
Get active plugins from database
No description
load .plugin.php file from plugin
A method to listing hook into list
A shortcut to register method
shortcut to 'registerHook'
A method to listing menu into SLiMS module submenut.
Shortcut for 'registerMenu'
Register SLiMS Module as Plugin
A shortcut for registerModule
This method is relate to SLiMS\SearchEngine\Engine
This method is relate to SLiMS\Session\Factory
This method is relate to SLiMS\Cli\Console
Seperate root composer ('slims-plugin') detector and plugin base composer (vendor inside each plugin).
No description
Grouping some plugin into submenu.
No description
Running hook process.
No description
This method is part of hooking process.
This method call closure to use hook handler
No description
Load php files inside (pages/) of a plugin and register as module menu with hierarchical directory.
Magic 🪄 method to manage registing menu per module via static method call.
Details
at line 76
__construct(null $location = null)
Plugins constructor.
at line 81
static Plugins
getInstance()
No description
at line 92
Plugins
addLocation(array|string $location)
Add .plugin.php | plugin file into list
at line 257
bool
isDeep(string $location)
Check if path location have sub-directory
at line 267
array
getPlugins()
No description
at line 279
array
getActive()
Get active plugins from database
at line 286
bool
isActive($id)
No description
at line 298
void
loadPlugins()
load .plugin.php file from plugin
at line 312
void
register(string $hook, closure $callback, $sequence = 9999)
A method to listing hook into list
at line 329
void
registerHook(string $hook, closure $callback, $sequence = 9999)
A shortcut to register method
at line 337
static
hook($hook, $callback, $sequence = 9999)
shortcut to 'registerHook'
at line 352
void
registerMenu(string $module_name, string $label, string $path, string $description = null)
A method to listing menu into SLiMS module submenut.
at line 371
static
menu($module_name, $label, $path, $description = null)
Shortcut for 'registerMenu'
at line 385
void
registerModule(string $module_name, string $path, string $description = '', string $callback_priv = '')
Register SLiMS Module as Plugin
at line 435
static void
module(string $module_name, string $path, string $description = '', string $callback_priv = '')
A shortcut for registerModule
at line 446
void
registerSearchEngine(string $class_name)
This method is relate to SLiMS\SearchEngine\Engine
at line 457
void
registerSessionDriver(string $class_name)
This method is relate to SLiMS\Session\Factory
at line 468
void
registerCommand(string $class_name)
This method is relate to SLiMS\Cli\Console
at line 478
registerAutoload()
Seperate root composer ('slims-plugin') detector and plugin base composer (vendor inside each plugin).
The autoload.php will be call at plugin_container.php
at line 485
getAutoload($pluginPath)
No description
at line 497
static GroupMenuOrder
group(string $group_name, closure $callback)
Grouping some plugin into submenu.
at line 505
setGroupName($group_name)
No description
at line 517
static void
run(string $hook, array $params = [])
Running hook process.
at line 522
execute($hook, $params = [])
No description
at line 545
static
use(string $handler_class)
This method is part of hooking process.
If you have class to handle some hook, this method to set up your class.
at line 557
for(closure $hooks)
This method call closure to use hook handler
at line 567
array
getMenus(null $module = null)
No description
at line 597
static void
registerPages(string $pathToPages = 'pages')
Load php files inside (pages/) of a plugin and register as module menu with hierarchical directory.
Description :
pages/ # first directory --- bibliography # as module ---- index.php # as file
or --- membership # as module ---- GROUP # as group name of plugin ----- index.php # as file
or if you want to grouping and ordering menu
--- membership # as module
---- GROUP<after|before>
at line 671
static void|object
__callStatic(string $method, array $arguments)
Magic 🪄 method to manage registing menu per module via static method call.
e.g :
Plugins::opac($webPath, $filePaath) = Plugins::menu('opac', ...etc)