/** * Install Neatline WMS. * * @param PluginBroker $plugin_broker Omeka plugin broker * @param string $plugin_name Plugin name * * @return void. */ public function _addHooksAndFilters($plugin_broker, $plugin_name) { $plugin_broker->setCurrentPluginDirName($plugin_name); new NeatlineMapsPlugin(); }
/** * Load and return a plugin instance * * If the plugin was previously loaded, returns that instance. * * If no options were passed, and we have no specification, load normally. * * If no options were passed, and we have a specification, use the * specification to load an instance. * * Otherwise, simply try and load the plugin. * * @param string $plugin * @param array|null $options * @return object * @throws Exception if plugin not found */ public function load($plugin, array $options = null) { $pluginName = strtolower($plugin); if (isset($this->plugins[$pluginName])) { // If we've loaded it already, just return it return $this->plugins[$pluginName]; } if (null !== $options || !isset($this->specs[$pluginName])) { // If we got options, or if there are no specs for this plugin, // simply proxy to the parent method return parent::load($plugin, $options); } if (isset($this->specs[$pluginName])) { // If we have a spec, pass the spec to the parent method return parent::load($plugin, $this->specs[$pluginName]); } // Return control to the parent method with original arguments return parent::load($plugin, $options); }
/** * This creates the plugin and sets the current plugin directory. * * @param PluginBroker $plugin_broker The current plugin broker. * @param string $plugin_name The name of the plugin to load. * * @return Instance of the plugin class. * @author Eric Rochester <*****@*****.**> **/ public function _addHooksAndFilters($plugin_broker, $plugin_name) { $class_name = $plugin_name . 'Plugin'; $plugin_broker->setCurrentPluginDirName($plugin_name); return new $class_name(); }