@todo Description

@param Controller_Addon $addon
968150
private function initAddon($addon)
    {
        $base_path = $this->pathfinder->base_location->getPath();
        $init_class_path = $base_path.'/../'.$addon->get('addon_full_path').'/lib/Initiator.php';
        if (file_exists($init_class_path)) {
            include $init_class_path;
            $class_name = str_replace('/', '\\', $addon->get('name').'\\Initiator');

            /** @type Controller_Addon $init */
            $init = $this->add($class_name, array(
                    'addon_obj' => $addon,
                    'base_path' => $base_path,
                ));
            if (!is_a($init, 'Controller_Addon')) {
                throw $this->exception(
                    'Initiator of '.$addon->get('name').' is inherited not from \Controller_Addon'
                );
            }

            /*
             * initiators of all addons are accessible
             * from all around the project
             * through $this->app->getInitiatedAddons()
             */
            $this->addons[$init->api_var] = $init;
            if ($init->with_pages) {
                $init->routePages($init->api_var);
            }
        }
    }
1032805
public static function contextInit($extension, $module, $action)
    {
        
		
		$basePath = '/'.$extension.'/views/';
		
		//load module scripts
		$jsModuleFile = $basePath.self::JS.'/controllers/'.strtolower($module).'/'.$action.'.'.self::JS;
		
		$cssModuleFile = $basePath.self::CSS.'/'.$module.'.'.self::CSS;
		$cssModuleDir = $basePath.self::CSS.'/'.$module.'/';
		
		if(file_exists($jsModuleFile)){
			self::addJsFile($jsModuleFile);
		}
		if(file_exists($cssModuleFile)){
			self::addCssFile($cssModuleFile);
		}
		foreach(glob($cssModuleDir.'*.'.self::CSS) as $file){
			self::addCssFile($file);
		}
		
		//
		//@todo load action scripts
		//
		
        
    }
152839
public function onKernelView(GetResponseForControllerResultEvent $event): void
    {
        $request = $event->getRequest();
        if ($request->isMethodSafe(false) || !($attributes = RequestAttributesExtractor::extractAttributes($request)) || !$attributes['persist']) {
            return;
        }

        $controllerResult = $event->getControllerResult();
        if (!$this->dataPersister->supports($controllerResult, $attributes)) {
            return;
        }

        switch ($request->getMethod()) {
            case 'PUT':
            case 'PATCH':
            case 'POST':
                $persistResult = $this->dataPersister->persist($controllerResult, $attributes);

                if (null === $persistResult) {
                    @trigger_error(sprintf('Returning void from %s::persist() is deprecated since API Platform 2.3 and will not be supported in API Platform 3, an object should always be returned.', DataPersisterInterface::class), E_USER_DEPRECATED);
                } else {
                    $controllerResult = $persistResult;
                    $event->setControllerResult($controllerResult);
                }

                if (null === $this->iriConverter) {
                    return;
                }

                $hasOutput = true;
                if (null !== $this->resourceMetadataFactory) {
                    $resourceMetadata = $this->resourceMetadataFactory->create($attributes['resource_class']);
                    $outputMetadata = $resourceMetadata->getOperationAttribute($attributes, 'output', ['class' => $attributes['resource_class']], true);
                    $hasOutput = \array_key_exists('class', $outputMetadata) && null !== $outputMetadata['class'] && $controllerResult instanceof $outputMetadata['class'];
                }

                if ($hasOutput) {
                    $request->attributes->set('_api_write_item_iri', $this->iriConverter->getIriFromItem($controllerResult));
                }
            break;
            case 'DELETE':
                $this->dataPersister->remove($controllerResult);
                $event->setControllerResult(null);
                break;
        }
    }
1199461
protected function _addon($addon, $data)
    {
        if (is_string($addon)) {
            $class = 'input-group-' . ($this->_isButton($addon) ? 'btn' : 'addon');
            $addon = $this->_templates->format('inputGroupAddon', [
                'class' => $class,
                'content' => $addon,
                'templateVars' => $data['templateVars'],
            ]);
        } else {
            $class = 'input-group-btn';
            $addon = $this->_templates->format('inputGroupAddon', [
                'class' => $class,
                'content' => implode('', $addon),
                'templateVars' => $data['templateVars'],
            ]);
        }

        return $addon;
    }
1274264
protected function loadFiles(Addon $addon, array $files)
    {
        foreach ($files as $filename) {
            $path = $addon->path($filename);

            if (!file_exists($path)) {
                $message = "Warning: PHP Script '$path' is nothing.";
                info($message);
                echo $message;
                continue;
            }

            require_once $path;
        }
    }
1313157
protected function checkModule() : void
    {
        $namespaced_class = $this->getFullyQualifiedClass($this->response->getModule(), $this->response->getController());
        if (!class_exists($namespaced_class)) {
            $this->response->setStatusCode(404);
            Core::i()->log->warning('Unable to load controller ' . $namespaced_class);
            return;
        }
        if (!call_user_func($namespaced_class . '::can_view')) {
            $this->response->setStatusCode(403);
            Core::i()->log->error('User is not authorized to view ' . $namespaced_class);
            return;
        }
        if (method_exists($namespaced_class, $this->getActionMethodName($this->response->getAction()))) {
            $this->response->setStatusCode(200);
        } elseif (method_exists($namespaced_class, 'indexAction')) {
            Core::i()->log->notice('Requested action ' . $this->response->getAction() . ' not found in ' . $namespaced_class);
            $this->response->setAction('index');
            $this->response->setStatusCode(200);
        } else {
            Core::i()->log->error('Controller ' . $namespaced_class . ' does not have a public indexAction method defined.');
            $this->response->setStatusCode(500);
        }
    }
898083
public function setController(Controller $controller)
    {
        $this->_Controller = $controller;
        $this->setEventManager($controller->getEventManager());
    }
1059145
protected function _addResponseHeaders($controllerAction)
    {
        if ($this->_getHelper()->isDebug()) {
            $controllerAction->getResponse()->setHeader('X-Debug', '1');
        }

        if ($this->_getHelper()->getIsEsiUsed()) {
            $controllerAction->getResponse()->setHeader(
                'Surrogate-Control', 'key=ESI/1.0'
            );
        }

        if (!$this->_getHelper()->isAllowedCurrentPage()) {
            $this->performBan();
        } else {
            if ($ttl = $this->_getHelper()->getCurrentPageTtl()) {
                $this->_getHelper()->addTtl($ttl);
            }

            foreach ($this->_collectedObjects as $object) {
                $this->_getHelper()->addObjectTags(
                    $this->_getProcessor()->getTags($object)
                );
            }

            $this->_collectedObjects = array();
        }


        if ($controllerAction->getResponse()->canSendHeaders()) {
            foreach (Mage::helper('ecomdev_varnish')->getVarnishHeaders(
                !$this->_getHelper()->isAllowedCurrentPage()
            ) as $name => $value) {
                if (is_array($value)) {
                    foreach ($value as $val) {
                        $controllerAction->getResponse()->setHeader($name, $val);
                    }
                } else {
                    $controllerAction->getResponse()->setHeader($name, $value, true);
                }
            }
        }



        return $this;
    }
377299
public function addAction($controller, $action = null)
    {
        if ($action === null) {
            list($controller, $action) = explode('.', $controller);
        }
        $this->actions[] = array(
            'controller' => null,
            'controller_name' => $controller,
            'action' => $action,
            'result' => null,
        );
        $this->action_names[] = "{$controller}.{$action}";
    }
1230582
public function onKernelController(FilterControllerEvent $event) {
        $css = rtrim($this->cssBase, '/') . '/' . trim($this->lteAdmin, '/');
        $mng = $this->manager;

        $mng->registerStyle('jquery-ui', $css . '/jQueryUI/jquery-ui-1.10.3.custom.css');
        $mng->registerStyle('bootstrap', $css . '/bootstrap.css', ['jquery-ui']);
        $mng->registerStyle('bootstrap-slider', $css . '/bootstrap-slider/slider.css', ['bootstrap']);
        $mng->registerStyle('datatables', $css . '/datatables/dataTables.bootstrap.css', ['bootstrap']);
        $mng->registerStyle('fontawesome', $css . '/font-awesome.css');
        $mng->registerStyle('ionicons', $css . '/ionicons.css');
        $mng->registerStyle('admin-lte', $css . '/AdminLTE.css', ['bootstrap-slider', 'fontawesome', 'ionicons', 'datatables']);
        $mng->registerStyle('bs-colorpicker', $css . '/colorpicker/bootstrap-colorpicker.css', ['admin-lte']);
        $mng->registerStyle('daterangepicker', $css . '/daterangepicker/daterangepicker.css', ['admin-lte']);
        $mng->registerStyle('timepicker', $css . '/timepicker/bootstrap-timepicker.css', ['admin-lte']);
        $mng->registerStyle('wysiwyg', $css . '/bootstrap-wysihtml5/bootstrap3-wysihtml5.css', ['admin-lte']);
    }
513762
public static function getConfigurationValue(string $name, $addon = null)
    {
        return self::getConfigurationValueOrDefault($name, null, $addon);
    }
311975
public function addOnRejected(callable $callback): void
    {
        if ($this->getState() === Promise::PENDING) {
            $this->onRejected[] = $callback;
        } elseif ($this->getState() === Promise::REJECTED) {
            $this->exception = call_user_func($callback, $this->exception);
        }
    }
870203
public function setControllerContext(\TYPO3\Flow\Aop\JoinPointInterface $joinPoint) {
		$this->controllerContext = $joinPoint->getMethodArgument('controllerContext');
	}
741006
public function onKernelController(FilterControllerEvent $event): void
    {
        $controller = $event->getController();
        if (\is_array($controller)) {
            [$controller] = $controller; // Ignoring action
        }
        if (!$controller instanceof AdminInjectableInterface && !$controller instanceof ActionInjectableInterface) {
            return;
        }

        $request = $event->getRequest();
        if (!$request->attributes->has('_admin')) {
            $routeName = $request->attributes->get('_route');

            $m = "Missing request attribute '_admin' for route {$routeName}, this means you declared";
            $m .= ' this route outside the admin configuration, please use the admin configuration';
            throw new \LogicException($m);
        }
        $admin = $request->attributes->get('_admin');
        if (!$admin instanceof Admin) {
            throw new \UnexpectedValueException('_admin request attribute is not an Admin object');
        }
        if ($controller instanceof AdminInjectableInterface) {
            $controller->setAdmin($admin);
        }

        if (!$request->attributes->has('_action')) {
            $routeName = $request->attributes->get('_route');

            $m = "Missing request attribute '_action' for route {$routeName},";
            $m .= 'this means you declared this route outside the admin configuration, please include the _action';
            $m .= 'attribute in your route definition or use the admin configuration';
            throw new \LogicException($m);
        }
        $admin->setCurrentAction($request->attributes->get('_action'));
        if ($controller instanceof ActionInjectableInterface) {
            $controller->setAction($admin->getCurrentAction());
        }
    }
23188
public function launchModuleAction($event, Module\ModuleInterface $module, $method, Bucket $bucket, $additionnalData = null)
    {
        $module->setBucket($bucket);

        return call_user_func(
            array(
                $module,
                $method
            ),
            $additionnalData
        );
    }
1336140
function addonsManager_disableAddon(aSpec) {
    var spec = aSpec || { };
    spec.button = "disable";

    var button = this.getAddonButton(spec);
    this._controller.click(button);
  }
760406
public void addOnInstalled(AddOn addOn) {
        for (ExtensionHook hook : extensionHooks.values()) {
            for (AddOnInstallationStatusListener listener : hook.getAddOnInstallationStatusListeners()) {
                try {
                    listener.addOnInstalled(addOn);
                } catch (Exception e) {
                    logger.error("An error occurred while notifying: " + listener.getClass().getCanonicalName(), e);
                }
            }
        }
    }