@param Helper $component

@return array

@throws InvalidCallException
343045
protected function getConfig(Helper $component)
    {
        if ($component->config === null) {
            if ($this->getDetector()->detect() === false) {
                throw new InvalidCallException('Unable to determine application type');
            }
            $configList = $this->getDetector()->getConfig();
        } else {
            if ($this->config === null) {
                if (isset($component->config[0])) {
                    $configList = $component->config;
                } else {
                    throw new InvalidCallException('Default config list not found in component config data');
                }
            } else {
                if (isset($component->config[$this->config])) {
                    $configList = $component->config[$this->config];
                } else {
                    throw new InvalidCallException("Scope '{$this->config}' not found in component config data");
                }
            }
        }

        return $configList;
    }
1059684
public static function normalize_component($component) {
        if ($component === 'moodle' or $component === 'core' or $component === '') {
            return array('core', null);
        }

        if (strpos($component, '_') === false) {
            self::init();
            if (array_key_exists($component, self::$subsystems)) {
                $type   = 'core';
                $plugin = $component;
            } else {
                // Everything else without underscore is a module.
                $type   = 'mod';
                $plugin = $component;
            }

        } else {
            list($type, $plugin) = explode('_', $component, 2);
            if ($type === 'moodle') {
                $type = 'core';
            }
            // Any unknown type must be a subplugin.
        }

        return array($type, $plugin);
    }
586166
protected function validateComponent($component): ?string
    {
        $component = $this->filterComponent($component);
        if (null === $component) {
            return $component;
        }

        return $this->decodeComponent($component);
    }
1215297
public function helper($helper)
    {
        if (isset($this->aliases[$helper])) {
            $helper = $this->aliases[$helper];
        }

        $helper = $this->normalizeName($helper);

        $args = func_get_args();
        $args[0] = $helper;

        return call_user_func_array([$this->factory, 'helper'], $args);
    }
277415
public function load(string $helper)
    {
        if (isset($this->filters[$helper])) {
            return call_user_func_array($this->filters[$helper], array_slice(func_get_args(), 1));
        }
    }
794673
public static function getComponentNs(string $component): string
    {
        if ($component === 'framework') {
            return '';
        }

        $namespace = '';
        $nsAry = explode('-', $component);
        foreach ($nsAry as $ns) {
            $namespace .= "\\" . ucfirst($ns);
        }

        return $namespace;
    }
479330
public static function getComponentName($component)
    {
        $details = $component->componentDetails();
        $name = $details['name'] ?? 'cms::lang.component.unnamed';

        return Lang::get($name);
    }
600813
public static function getSharedComponents($component)
    {
        static $sharedClasses = array();
        if (!isset($sharedClasses[Kwf_Component_Data_Root::getComponentClass()])) { //pro root klasse cachen weil die sich ja bei den tests ändern kann
            $componentClasses = Kwc_Abstract::getComponentClasses();
            $sharedClasses[Kwf_Component_Data_Root::getComponentClass()] = array();
            foreach ($componentClasses as $componentClass) {
                $class = Kwc_Abstract::getFlag($componentClass, 'sharedDataClass');
                if ($class) $sharedClasses[Kwf_Component_Data_Root::getComponentClass()][$componentClass] = $class;
            }
        }
        $ret = array();
        foreach ($sharedClasses[Kwf_Component_Data_Root::getComponentClass()] as $componentClass => $sharedClass) {
            $targetComponent = null;
            if (is_instance_of($component->componentClass, $sharedClass)) {
                $targetComponent = $component;
            }
            if (!$targetComponent) {
                $components = $component->getRecursiveChildComponents(
                    array('componentClass' => $sharedClass, 'pseudoPage' => false)
                );
                if (count($components) > 0) $targetComponent = array_shift($components);
            }
            if ($targetComponent) $ret[$componentClass] = $targetComponent;
        }
        return $ret;
    }
271638
public static function build($component, array $options = [])
    {
        if (empty($component->options)) {
            return '';
        }

        $options = [];
        foreach ($component->options as $option) {
            if (! is_array($option)) {
                $options[] = $option;
            } else {
                $options[] = $option['name']
                    . ((! empty($option['equals']) && $option['equals']) ? '=' : ' ')
                    . (! empty($option['expr']) ? $option['expr'] : $option['value']);
            }
        }

        return implode(' ', $options);
    }
1271247
public static function getEditComponents($component)
    {
        $editComponents = array();

        //egal ob component eine page ist oder nicht, selbst darf sie immer bearbeitet werden
        //es ist dann *keine* page wenn der benutzer unter eine unterkomponente bearbeiten darf - nicht aber die page selbst
        $editComponents[] = $component;

        $editComponents = array_merge($editComponents,
            $component->getRecursiveChildComponents(
                array(
                    'hasEditComponents' => true,
                    'ignoreVisible' => true,
                    'generatorFlags' => array('showInPageTreeAdmin' => false),
                ), array(
                    'generatorFlags' => array('showInPageTreeAdmin' => false),
                    'hasEditComponents' => true,
                )
            )
        );
        return $editComponents;
    }
43461
protected function marshall(QtiComponent $component)
    {
        $element = self::getDOMCradle()->createElement('col');

        if ($component->getSpan() !== 1) {
            $this->setDOMElementAttribute($element, 'span', $component->getSpan());
        }

        $this->fillElement($element, $component);

        return $element;
    }
484182
public function activate_component( $component ) {

		$activated = false;

		if ( ! $this->is_component_active( $component ) ) {
			if ( empty( $this->components ) ) {
				// Setup components
				PodsInit::$components->get_components();
			}

			if ( isset( $this->components[ $component ] ) ) {
				$this->settings['components'][ $component ] = array();

				$this->update_settings( $this->settings );

				$activated = true;
			}
		} else {
			$activated = true;
		}//end if

		return $activated;

	}
673201
public static function get_subplugins($component) {
        self::init();

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

        return null;
    }
28148
protected function callChildComponent($component, IContext $context)
    {
        /**
         * @var IRouter $router
         */
        $router = $component->getRouter();
        $router->setBaseUrl($context->getRouteResult()->getMatchedUrl());

        $componentRequest = $this->createComponentRequest($context->getRouteResult()->getUnmatchedUrl());

        try {
            return $component->execute($componentRequest);
        } catch (\Exception $e) {
            return $this->callErrorController($e, $context);
        }
    }
478499
public static function build($component, array $options = [])
    {
        $tmp = [];
        foreach ($component as $componentPart) {
            $tmp[] = $componentPart[0] . ' ' . $componentPart[1];
        }

        return implode(' ', $tmp);
    }
503289
public function getChildrenRenderings(QtiComponent $component)
    {
        $returnValue = array();

        foreach (array_reverse($component->getComponents()->getArrayCopy()) as $c) {

            if (count($this->getRenderingStack()) > 0) {
                list($renderedComponent, $rendering) = $this->getRenderingStack()->pop();

                if ($c === $renderedComponent) {
                    array_unshift($returnValue, $rendering);
                } else {
                    // repush...
                    $this->storeRendering($renderedComponent, $rendering);
                }
            }
        }

        return $returnValue;
    }
494779
public function other_plugins_that_require($component) {
        $others = array();
        foreach ($this->get_plugins() as $type => $plugins) {
            foreach ($plugins as $plugin) {
                $required = $plugin->get_other_required_plugins();
                if (isset($required[$component])) {
                    $others[] = $plugin->component;
                }
            }
        }
        return $others;
    }