Add HUBzero core js resources

@return  void
187983
public static function core()
	{
		if (isset(self::$loaded[__METHOD__]))
		{
			return;
		}

		Asset::script('assets/hubzero.js', true, true);

		self::$loaded[__METHOD__] = true;
	}
1198970
protected function _includeAppController(): void
    {
        $controller = null;
        if (file_exists(WWW_ROOT . 'js/app/app_controller.js')) {
            $controller = 'app/app_controller.js';
        } else {
            $controller = '/frontend_bridge/js/lib/app_controller.js';
        }
        $this->_dependencies[] = $controller;
    }
1156044
public function bootstrap()
    {

        // Start the rudimental system
        try {

            // Load settingsfile
            $this->loadSettings();

            // From here starts output buffering
            ob_start();

            // Registe PSR classloader
            $this->registerClassloader();

            // Create core DI container instance and map the instance to comntainer
            $this->di = \Core\DI\DI::getInstance();
            $this->di->mapValue('core.di', $this->di);

            $this->initLogger();

            // Run inits
            $this->initDatabase();
            $this->initMessageHandler();
            $this->initDependencies();
            $this->initHttp();
            $this->initSession();
            $this->initConfig();
            $this->initMailer();
            $this->initRouter();

            // Get an instance of Core app
            $this->getAppInstance('Core');

            $this->initSecurity();
            $this->initPage();
            $this->initAssetManager();

            // Run highlevel system
            $this->autodiscoverApps();

            // Match request against the generic routes to get the ajax request flag and to match a fallback result.
            $this->router->match();

            // Initiate apps
            $this->initApps();

            // Match routes again as now possible app routes are available
            $this->router->match();

            // Run dispatcher
            $result = $this->dispatch();

            // Send mails
            $this->mailer->send();

            // Process all assets
            $this->processAssets();

            // Send cookies
            $this->http->cookies->send();

            // Redirect requested?
            if (!empty($_SESSION['Core']['redirect'])) {

                $this->http->header->location($_SESSION['Core']['redirect']['location'], $_SESSION['Core']['redirect']['permanent']);
                $this->http->header->send();

                // Important: Clear redirect from session!
                unset($_SESSION['Core']['redirect']);

                return;
            }

            switch ($this->router->getFormat()) {

                case 'file':
                    $sendfile = new Sendfile($result);
                    $sendfile->send();

                    break;

                case 'html':

                    $this->http->header->contentType('text/html', 'utf-8');

                    $language = $this->getAppInstance('Core')->language;

                    // Add logoff button for logged in users
                    if ($this->user->isGuest()) {
                        $this->page->menu->createItem('register', $language->get('menu.register'), $this->router->generate('core.register'));
                        $this->page->menu->createItem('login', $language->get('menu.login'), $this->router->generate('core.login', [
                            'action' => 'login'
                        ]));
                    }

                    // or add login and register buttons. But not when current user is currently on banlist
                    else {

                        $usermenu = $this->page->menu->createItem('login', $this->user->getDisplayname());

                        // Show admin menu?
                        if ($this->user->getAdmin()) {
                            $usermenu->createItem('admin', $language->get('menu.admin'), $this->router->generate('core.admin'));
                        }

                        $usermenu->createItem('logout', $language->get('menu.logout'), $this->router->generate('core.login', [
                            'action' => 'logout'
                        ]));
                    }

                    $this->page->setHome($this->config->get('Core', 'url.home'));
                    $this->page->setContent($result);

                    $result = $this->page->render();
            }

            // Send headers so far
            $this->http->header->send();
        }
        catch (\Throwable $t) {

            $error = new ErrorHandler($t);
            $error->setAjax(isset($_REQUEST['ajax']));
            $error->setPublic(isset($this->user) && $this->user->getAdmin());
            $error->setPublic(true);

            if (isset($this->logger)) {
                $error->setLogger($this->logger);
            }

            http_response_code(500);

            $result = $error->handle();
        }

        echo $result;

        ob_end_flush();
    }
966123
protected function configure() : void
    {
        $this->setName('configure')
             ->setDescription('Configure your hooks')
             ->setHelp('This command creates or updates your captainhook configuration')
             ->addOption('extend', 'e', InputOption::VALUE_NONE, 'Extend existing configuration file')
             ->addOption('force', 'f', InputOption::VALUE_NONE, 'Overwrite existing configuration file')
             ->addOption('advanced', 'a', InputOption::VALUE_NONE, 'More options, but more to type')
             ->addOption(
                 'configuration',
                 'c',
                 InputOption::VALUE_OPTIONAL,
                 'Path to your json configuration',
                 './' . CH::CONFIG
             );
    }
1108737
public function add()
    {
        $this->dirs = array_merge($this->dirs, func_get_args());
        $this->dirs = array_filter($this->dirs);
        $this->dirs = array_values($this->dirs);
    }
133236
public function enqueue_core() {

		// Register uix core asset.
		$this->core_assets();
		$this->enqueue_actions();
		// push assets to ui manager.
		uix()->set_assets( $this->assets );
		// done enqueuing - dpo inline or manual enqueue.
		$this->set_active_styles();
	}
944419
public static function autoload(): void
    {
        //  CI base helpers
        require_once BASEPATH . 'core/Common.php';

        $aComponents = [];
        foreach (Components::available() as $oModule) {
            $aComponents[] = (object) [
                'slug'     => $oModule->slug,
                'autoload' => $oModule->autoload,
            ];
        }

        //  Module items
        foreach ($aComponents as $oModule) {
            //  Helpers
            if (!empty($oModule->autoload->helpers)) {
                foreach ($oModule->autoload->helpers as $sHelper) {
                    if (is_array($sHelper)) {
                        list($sName, $sProvider) = $sHelper;
                        self::helper($sName, $sProvider);
                    } else {
                        self::helper($sHelper, $oModule->slug);
                    }
                }
            }
            //  Services
            if (!empty($oModule->autoload->services)) {
                foreach ($oModule->autoload->services as $sService) {
                    if (is_array($sHelper)) {
                        list($sName, $sProvider) = $sService;
                        self::service($sName, $sProvider);
                    } else {
                        self::service($sService, $oModule->slug);
                    }
                }
            }
        }
    }
757599
public function add() {
        global $CFG, $USER, $DB;

        unset($this->id);
        $this->module       = 'blog';
        $this->userid       = (empty($this->userid)) ? $USER->id : $this->userid;
        $this->lastmodified = time();
        $this->created      = time();

        // Insert the new blog entry.
        $this->id = $DB->insert_record('post', $this);

        if (!empty($CFG->useblogassociations)) {
            $this->add_associations();
        }

        core_tag_tag::set_item_tags('core', 'post', $this->id, context_user::instance($this->userid), $this->tags);

        // Trigger an event for the new entry.
        $event = \core\event\blog_entry_created::create(array(
            'objectid'      => $this->id,
            'relateduserid' => $this->userid
        ));
        $event->set_blog_entry($this);
        $event->trigger();
    }
279896
protected function updateBootstrapping()
    {
        $this->filesystem->put(resource_path('assets/sass/app.scss'), '' . PHP_EOL);
        $this->filesystem->copy($this->stubPath('/app.js'), resource_path('assets/js/app.js'));
    }
786808
function add_static($js, $condition = null, $no_build = false) {
        $js = Helper::static_url($js);
        return $this->add($js, $condition, $no_build);
    }
1216181
public function addNewUserAction()
    {
        $container = new Container('meliscore');
        $response = [];
        $this->getEventManager()->trigger('meliscore_tooluser_savenew_start', $this, $response);

        $melisMelisCoreConfig = $this->serviceLocator->get('MelisCoreConfig');
        $appConfigForm = $melisMelisCoreConfig->getItem('meliscore/tools/meliscore_tool_user/forms/meliscore_tool_user_form_new');
        $appConfigForm = $appConfigForm['elements'];

        $success = 0;
        $errors = [];
        $datas = [];
        $textTitle = 'tr_meliscore_tool_user';

        if (!empty($container['action-tool-user-tmp'])) {
            if (!empty($container['action-tool-user-tmp']['success'])) {
                $success = $container['action-tool-user-tmp']['success'];
            }

            if (!empty($container['action-tool-user-tmp']['errors'])) {
                $errors = $container['action-tool-user-tmp']['errors'];
            }

            if (!empty($container['action-tool-user-tmp']['datas'])) {
                $datas = $container['action-tool-user-tmp']['datas'];
            }
        }

        unset($container['action-tool-user-tmp']);
        unset($container['action-tool-user-setrights-tmp']);

        foreach ($errors as $keyError => $valueError) {
            foreach ($appConfigForm as $keyForm => $valueForm) {
                if ($valueForm['spec']['name'] == $keyError &&
                    !empty($valueForm['spec']['options']['label'])) {
                    $errors[$keyError]['label'] = $valueForm['spec']['options']['label'];
                }
            }
        }

        if ($success == 0) {
            $textMessage = 'tr_meliscore_tool_user_new_fail_info';
        } else {
            $textMessage = 'tr_meliscore_tool_user_new_success_info';
        }

        $userId = null;
        if (!empty($datas['usr_id'])) {
            $userId = $datas['usr_id'];
            unset($datas['usr_id']);
        }

        $response = [
            'success' => $success,
            'textTitle' => $textTitle,
            'textMessage' => $textMessage,
            'errors' => $errors,
            'datas' => $datas
        ];

        $this->getEventManager()->trigger('meliscore_tooluser_savenew_end', $this, array_merge($response, ['typeCode' => 'CORE_USER_ADD', 'itemId' => $userId]));

        unset($response['datas']);

        return new JsonModel($response);
    }
1138120
protected function bootComponentDrivers()
    {
        $this->addRedisSentinelBroadcaster();
        $this->addRedisSentinelCacheStore();

        // This package's Horizon service provider will set up the queue
        // connector a bit differently, so we don't need to do it twice:
        if (! $this->config->shouldIntegrateHorizon) {
            $this->addRedisSentinelQueueConnector();
        }

        // Since version 5.2, Lumen does not include support for sessions by
        // default, so we'll only register the session handler if enabled:
        if ($this->config->supportsSessions) {
            $this->addRedisSentinelSessionHandler();
        }
    }
843651
public function setHeaders()
    {
        $this->response->getHeaders()->addHeaders([
            'User-Agent' => 'BoltPay/Magento-'.$this->configHelper->getStoreVersion() . '/' . $this->configHelper->getModuleVersion(),
            'X-Bolt-Plugin-Version' => $this->configHelper->getModuleVersion(),
        ]);
    }
660650
protected function registerCoreContainerAliases(): void
    {
        $this->app->alias('orchestra.imagine', ImagineManager::class);

        $this->app->bind(ImagineInterface::class, function (Application $app) {
            return $app->make('orchestra.imagine')->driver();
        });
    }
1220561
private boolean addBusHub(BusHub hub) {
		if (hub == null) {
			return false;
		}
		if (this.validBusHubs.contains(hub)) {
			return false;
		}
		if (ListUtil.contains(this.invalidBusHubs, INVALID_HUB_COMPARATOR, hub)) {
			return false;
		}

		final boolean isValidPrimitive = hub.isValidPrimitive();

		if (isValidPrimitive) {
			if (!this.validBusHubs.add(hub)) {
				return false;
			}
		} else if (ListUtil.addIfAbsent(this.invalidBusHubs, INVALID_HUB_COMPARATOR, hub) < 0) {
			return false;
		}

		hub.setEventFirable(isEventFirable());
		hub.setContainer(this);
		if (isEventFirable()) {
			firePrimitiveChanged(new BusChangeEvent(this,
					BusChangeEventType.HUB_ADDED,
					hub,
					-1,
					null,
					null,
					null));
			hub.checkPrimitiveValidity();
			checkPrimitiveValidity();
		}
		return true;
	}
818744
protected function setup() {
		$this->rs = new \HaveAPI\Client\Resource($this->client, 'token', $this->description->resources->token, array());
		$this->via = isSet($this->opts['via']) ? $this->opts['via'] : self::HTTP_HEADER;
		
		if(isSet($this->opts['token'])) {
			$this->configured = true;
			$this->token = $this->opts['token'];
			return;
		}
		
		$this->requestToken();
	}
533627
public function on_start()
    {
        $this->addHeaderItem('<link href="' . ASSETS_URL_CSS . '/views/install.css" rel="stylesheet" type="text/css" media="all" />');
        $this->requireAsset('core/app');
        $this->requireAsset('javascript', 'backstretch');
        $this->requireAsset('javascript', 'bootstrap/collapse');
        $this->set('urlResolver', $this->app->make(ResolverManagerInterface::class));

        $config = $this->app->make('config');
        $this->set('backgroundFade', 0);
        $this->set('pageTitle', t('Install concrete5'));
        $image = date('Ymd') . '.jpg';
        $this->set('image', date('Ymd') . '.jpg');
        $this->set('imagePath', $config->get('concrete.urls.background_feed') . '/' . $image);
        $this->set('concreteVersion', $config->get('concrete.version'));

        $locale = $this->request->request->get('locale');
        if ($locale) {
            $loc = Localization::changeLocale($locale);
            $this->set('locale', $locale);
        }
        Cache::disableAll();

        if ($this->app->isInstalled()) {
            throw new UserMessageException(t('concrete5 is already installed.'));
        }
    }