Get all prompts for a plugin.

@since 2.7.7

@param  string $plugin The name of a plugin.
@return array
425658
public function getPluginPrompts( $plugin ) {
		$pluginPrompts = array();

		$prompts = $this->getPrompts();

		foreach ( $prompts as $prompt ) {
			if ( $prompt['plugin'] === $plugin ) {
				$pluginPrompts[] = $prompt;
			}
		}

		return $pluginPrompts;
	}
512276
public function resolveRequirements(Plugin $plugin, $moodleVersion)
    {
        $map = [
            'auth'       => new AuthRequirements($plugin, $moodleVersion),
            'block'      => new BlockRequirements($plugin, $moodleVersion),
            'filter'     => new FilterRequirements($plugin, $moodleVersion),
            'format'     => new FormatRequirements($plugin, $moodleVersion),
            'mod'        => new ModuleRequirements($plugin, $moodleVersion),
            'qtype'      => new QuestionRequirements($plugin, $moodleVersion),
            'repository' => new RepositoryRequirements($plugin, $moodleVersion),
            'theme'      => new ThemeRequirements($plugin, $moodleVersion),
        ];

        if (array_key_exists($plugin->type, $map)) {
            return $map[$plugin->type];
        }

        return new GenericRequirements($plugin, $moodleVersion);
    }
1315337
public function get_enabled_plugins($type) {
        $this->load_enabled_plugins();
        if (isset($this->enabledplugins[$type])) {
            return $this->enabledplugins[$type];
        }
        return null;
    }
635493
public function getPluginOptions()
    {
        if ($this->url !== null) {
            $url = Url::to($this->url);
            $this->pluginOptions['load'] = new JsExpression("
                function (query, callback) {
                    if (!query.length) return callback();
                    $.getJSON('$url', { query: encodeURIComponent(query) }, function (data) { callback(data); })
                    .fail(function () { callback(); });
                }
            ");
        }

        return Json::encode($this->pluginOptions);
    }
939196
public function getPluginClassNames() {
		$plugins = array();
		if (TRUE === $this->isEnabled('NamelessCoder\\GizzleGitPlugins\\GizzlePlugins\\ClonePlugin')) {
			$plugins[] = 'NamelessCoder\\GizzleGitPlugins\\GizzlePlugins\\ClonePlugin';
		}
		if (TRUE === $this->isEnabled('NamelessCoder\\GizzleGitPlugins\\GizzlePlugins\\CheckoutPlugin')) {
			$plugins[] = 'NamelessCoder\\GizzleGitPlugins\\GizzlePlugins\\CheckoutPlugin';
		}
		if (TRUE === $this->isEnabled('NamelessCoder\\GizzleGitPlugins\\GizzlePlugins\\PullPlugin')) {
			$plugins[] = 'NamelessCoder\\GizzleGitPlugins\\GizzlePlugins\\PullPlugin';
		}
		if (TRUE === $this->isEnabled('NamelessCoder\\GizzleGitPlugins\\GizzlePlugins\\CommitPlugin')) {
			$plugins[] = 'NamelessCoder\\GizzleGitPlugins\\GizzlePlugins\\CommitPlugin';
		}
		if (TRUE === $this->isEnabled('NamelessCoder\\GizzleGitPlugins\\GizzlePlugins\\PushPlugin')) {
			$plugins[] = 'NamelessCoder\\GizzleGitPlugins\\GizzlePlugins\\PushPlugin';
		}
		return $plugins;
	}
880126
public function get_plugin_info($component) {
        list($type, $name) = core_component::normalize_component($component);
        $plugins = $this->get_plugins_of_type($type);
        if (isset($plugins[$name])) {
            return $plugins[$name];
        } else {
            return null;
        }
    }
1153375
public function getPlugins()
    {
        if (!$this->_plugins) {

            $manifest = $this->getPluginPath() . '/composer.json';

            if (!file_exists($manifest)) {
                return array();
            }

            $contents = file_get_contents($manifest);

            if ($contents === false) {
                return array();
            }

            $data = json_decode($contents);

            if (!isset($data->require)) {
                return array();
            }

            $this->_plugins = array();

            foreach ($data->require as $package => $version)
            {
                $file = $this->getPluginPath() . '/vendor/' . $package . '/composer.json';

                if (file_exists($file))
                {
                    $json     = file_get_contents($file);
                    $manifest = json_decode($json);

                    if (is_null($manifest)) {
                        continue;
                    }

                    if (isset($manifest->type) && $manifest->type == 'joomlatools-console-plugin') {
                        $this->_plugins[$package] = $version;
                    }
                }
            }
        }

        return $this->_plugins;
    }
1130021
public static function get_enabled_plugins() {
        global $DB;

        $plugins = core_plugin_manager::instance()->get_installed_plugins('format');
        if (!$plugins) {
            return array();
        }
        $installed = array();
        foreach ($plugins as $plugin => $version) {
            $installed[] = 'format_'.$plugin;
        }

        list($installed, $params) = $DB->get_in_or_equal($installed, SQL_PARAMS_NAMED);
        $disabled = $DB->get_records_select('config_plugins', "plugin $installed AND name = 'disabled'", $params, 'plugin ASC');
        foreach ($disabled as $conf) {
            if (empty($conf->value)) {
                continue;
            }
            list($type, $name) = explode('_', $conf->plugin, 2);
            unset($plugins[$name]);
        }

        $enabled = array();
        foreach ($plugins as $plugin => $version) {
            $enabled[$plugin] = $plugin;
        }

        return $enabled;
    }
327026
public function getData(string $plugin = null)
    {
        /* Only get data for single plugin */
        if(! is_null($plugin)) {
            return $this->getPlugin($plugin)->getContainer()->getData();
        }

        /* Get data for all plugins */
        $data = [];
        foreach($this->plugins as $plugin) {
            $data[$plugin->getName()] = $plugin->getContainer()->getData();
        }
        return $data;
    }
191949
private function getPluginDefinition(string $handle, array $pluginInfo): array
    {
        $settings = null;
        $plugin = Craft::$app->plugins->getPlugin($handle);
        if ($plugin) {
            $settings = $plugin->getSettings();
        }

        return [
          'isEnabled' => $pluginInfo['isEnabled'],
          'isInstalled' => $pluginInfo['isInstalled'],
          'settings' => $settings ? $settings->attributes : [],
        ];
    }
75090
private function executePluginInstall(Plugin $plugin)
    {
        try {
            $plugin->install();
        } catch (\Exception $e) {
            throw new \Piwik\Plugin\PluginException($plugin->getPluginName(), $e->getMessage());
        }
    }
673201
public static function get_subplugins($component) {
        self::init();

        if (isset(self::$subplugins[$component])) {
            return self::$subplugins[$component];
        }

        return null;
    }
158500
public function isPluginDismissed( $plugin ) {
		$dismissed = false;

		$plugin_prompts = $this->getPluginPrompts( $plugin );

		foreach ( $plugin_prompts as $prompt ) {
			if ( ! empty( $prompt['time_dismissed'] ) ) {
				$dismissed = true;
			}
		}

		return $dismissed;
	}
910960
public function getInternalPlugins()
    {
        // Return only plugins with no custom url
        $plugins = [];
        foreach ($this->getPlugins() as $name => $url) {
            if (empty($url)) {
                $plugins[] = $name;
            }
        }
        return $plugins;
    }
812015
def get_hints(self, plugin):
        '''  '''
        hints = []

        for hint_name in getattr(plugin, 'hints', []):
            hint_plugin = self._plugins.get(hint_name)
            if hint_plugin:
                hint_result = Result(
                    name=hint_plugin.name,
                    homepage=hint_plugin.homepage,
                    from_url=self.requested_url,
                    type=HINT_TYPE,
                    plugin=plugin.name,
                )
                hints.append(hint_result)

                logger.debug(f'{plugin.name} & hint {hint_result.name} detected')
            else:
                logger.error(f'{plugin.name} hints an invalid plugin: {hint_name}')

        return hints
726722
public function getRequiredBy($plugin)
    {
        $requiredBy = [];
        $plugin = $this->getBundle($plugin);

        foreach ($this->getInstalledBundles() as $bundle) {
            $requirements = $bundle['instance']->getRequiredPlugins();
            if (in_array(get_class($plugin), $requirements)) {
                $requiredBy[] = get_class($bundle['instance']);
            }
        }

        return $requiredBy;
    }
908988
public function getPluginActivities() {
		$activities = $this->getActivities();

		if ( ! isset( $activities[ $this->plugin ] ) ) {
			$activities[ $this->plugin ] = array();
		}

		return $activities[ $this->plugin ];
	}