Include JS and CSS used by all methods.

Always called by dispatcher before controller's requested method.

@since 2.0.0
@access public
181448
public function Initialize() {
      $this->Head = new HeadModule($this);
      $this->Head->AddTag('meta', array('name' => 'robots', 'content' => 'noindex'));
      
      $this->AddJsFile('jquery.js');
      $this->AddJsFile('jquery.livequery.js');
      $this->AddJsFile('jquery.form.js');
      $this->AddJsFile('jquery.popup.js');
      $this->AddJsFile('jquery.gardenhandleajaxform.js');
      $this->AddJsFile('global.js');
      
      $this->AddCssFile('style.css');
      parent::Initialize();
      Gdn_Theme::Section('Entry');
   }
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.'));
        }
    }
66590
public function init()
    {
        $this->assets = array(
            'js' => YII_DEBUG ? 'foundation/foundation.section.js' : 'foundation.min.js'
        );

        Html::addCssClass($this->htmlOptions, Enum::SECTION_CONTAINER);
        Html::addCssClass($this->htmlOptions, $this->style);
        ArrayHelper::addValue('data-section', $this->style, $this->htmlOptions);
        $this->registerClientScript();
        parent::init();
    }
712021
public function Initialize() {
      parent::Initialize();
      $this->ShowOptions = TRUE;
      $this->Menu->HighlightRoute('/discussions');
      $this->AddCssFile('vanilla.css');
		$this->AddJsFile('discussions.js');
			
		// Inform moderator of checked comments in this discussion
		$CheckedDiscussions = Gdn::Session()->GetAttribute('CheckedDiscussions', array());
		if (count($CheckedDiscussions) > 0)
			ModerationController::InformCheckedDiscussions($this);
         
      $this->CountCommentsPerPage = C('Vanilla.Comments.PerPage', 30);
         
		$this->FireEvent('AfterInitialize');
   }
50483
public function init()
    {
        parent::init();

        Html::addCssClass($this->options, ['widget' => 'preloader-wrapper active']);
        Html::addCssClass($this->spinnerOptions, ['spinner' => 'spinner-layer']);

        switch ($this->size) {
            case self::SIZE_SMALL:
                Html::addCssClass($this->options, ['spinner-size' => 'small']);
                break;

            case self::SIZE_BIG:
                Html::addCssClass($this->options, ['spinner-size' => 'big']);
                break;
        }

        if ($this->flashColors === false && $this->color) {
            $color = ArrayHelper::getValue($this->colors, $this->color);
            Html::addCssClass($this->spinnerOptions, ['spinner-color' => "spinner-$color-only"]);
        }
    }
704378
final public function init()
    {
        $this->sourcePath = $this->getSourcePath();
        $this->depends    = [CpAsset::class];

        $this->js  = $this->getScripts();
        $this->css = $this->getStylesheets();

        parent::init();
    }
1020323
protected function injectCSS() {
            if (!$this->isCLI && !self::$cssInjected) {
                self::$cssInjected = true;
                if (file_exists($this->config->cssPath)) {
                    echo '<style type="text/css">';
                    /** @noinspection PhpIncludeInspection */
                    include $this->config->cssPath;
                    echo '</style>';
                } else {
                    echo 'The AloFramework handlers\' CSS file could not be found: ' . $this->config->cssPath . PHP_EOL;
                }
            }
        }
863260
public function init()
    {
        $this->assets = array(
            'js' => YII_DEBUG ? 'foundation/foundation.reveal.js' : 'foundation.min.js'
        );

        Html::addCssClass($this->htmlOptions, Enum::DIALOG);
        $this->setId(ArrayHelper::removeValue($this->htmlOptions, 'id', $this->getId()));
        $this->registerClientScript();
        parent::init();

        $this->htmlOptions['id'] = $this->getId();

        echo $this->renderToggleButton() . "\n";
        echo \CHtml::openTag('div', $this->htmlOptions) . "\n";
        echo $this->renderHeader() . "\n";
    }
1027457
public function init()
    {
        $this->assets = array(
            'js' => YII_DEBUG ? 'foundation/foundation.topbar.js' : 'foundation.min.js'
        );

        Html::addCssClass($this->htmlOptions, Enum::NAV_TOPBAR);
        if ($this->fixed) {
            Html::addCssClass($this->htmlOptions, Enum::NAV_FIXED);
        }
        if ($this->sticky) {
            Html::addCssClass($this->htmlOptions, Enum::NAV_STICKY);
        }
        if ($this->containToGrid) {
            Html::addCssClass($this->htmlOptions, Enum::NAV_CONTAINED);
        }

        parent::init();
    }
1147628
protected function renderJs() {
        $id = $this->options['id'];
        $options = $this->getOptionsObject();

        $this->getView()->registerJs("$('#$id').remainingCharacters($options);");
    }
188322
protected function includeStylesheets()
    {
        $config = $this->getStylesheetsConfig();

        if (empty($config)) {
            return;
        }

        $view = $this->getView();
        $headLink = $view->headLink();

        foreach ($config as $href => $options) {
            $media = $this->getConfigValue($options, 'media', 'screen');
            $conditionalStylesheet = $this->getConfigValue(
                $options,
                'conditionalStylesheet',
                ''
            );
            $extras = $this->getConfigValue($options, 'extras', []);
            $headLink->prependStylesheet(
                $href,
                $media,
                $conditionalStylesheet,
                $extras
            );
        }
    }
1251657
public function Initialize() {
      $this->ModuleSortContainer = 'Profile';
      $this->Head = new HeadModule($this);
      $this->AddJsFile('jquery.js');
      $this->AddJsFile('jquery.livequery.js');
      $this->AddJsFile('jquery.form.js');
      $this->AddJsFile('jquery.popup.js');
      $this->AddJsFile('jquery.gardenhandleajaxform.js');
      $this->AddJsFile('global.js');
      
      $this->AddCssFile('style.css');
      $this->AddModule('GuestModule');
      parent::Initialize();
      
      Gdn_Theme::Section('Profile');
      
      if ($this->EditMode)
         $this->CssClass .= 'EditMode';

      $this->SetData('Breadcrumbs', array());
      $this->CanEditPhotos = C('Garden.Profile.EditPhotos') || Gdn::Session()->CheckPermission('Garden.Users.Edit');
   }
245302
final protected function beforeRenderView()
    {
        $this->initView();
        
        $view = $this->getView();
        
        $client = $this->clientType ? : static::input('clienttype');
        if ($client) {
            $configs = Config::get('views', $this->getModule()->getName(), true);
            if (isset($configs[$client]['theme'])) {
                $view->setTheme($configs[$client]['theme']);
            }
        }
        
        if (!$view->getBeginContent()) {
            $beginContent  = "<?php use Wslim\Ioc; ?>" . PHP_EOL;
            $view->setBeginContent($beginContent);
        }
        
        // ioc
        Ioc::$htmlHelper || Ioc::$htmlHelper = new HtmlHelper();
        Ioc::$formHelper || Ioc::$formHelper = new FormHelper();
        
        // view data
        $viewData = $view->getData();
        $viewData['rootUrl']  = Config::getRootUrl();
        $viewData['baseUrl']  = $this->getModule()->getBaseUrl(true);
        $viewData['lang']     = Ioc::language()->getData();
        $viewData['requestParams'] = $this->input();
        $viewData['page']     = $this->inputInt('page');
        
        return $this;
    }
386203
protected function _includeComponents(): void
    {
        // for now, we just include all components
        $appComponentFolder = WWW_ROOT . 'js/app/components/';
        $folder = new Folder($appComponentFolder);
        $files = $folder->find('.*\.js');
        if (!empty($files)) {
            foreach ($files as $file) {
                $this->_dependencies[] = 'app/components/' . $file;
            }
        }

        // Add Plugin Components
        foreach (Plugin::loaded() as $pluginName) {
            $pluginJsComponentsFolder = Plugin::path($pluginName) . '/webroot/js/app/components/';
            if (is_dir($pluginJsComponentsFolder)) {
                $folder = new Folder($pluginJsComponentsFolder);
                $files = $folder->find('.*\.js');
                foreach ($files as $file) {
                    $this->_dependencies[] = '/' . Inflector::underscore($pluginName) . '/js/app/components/' . $file;
                }
            }
        }
    }
1187438
public function init()
    {
        add_action('admin_head', array($this, 'addJsVariables'));
        add_action('admin_enqueue_scripts', array($this, 'enqueue'));
        add_action('current_screen', function ($current_screen) {
            add_action('views_edit-' . $current_screen->post_type, array($this, 'addFilterUrlParams'));
        });
    }
822455
protected function beforeAjax()
    {
        if ($this->initialized) {
            return;
        }

        $this->controller->pageAction();
        $this->validateField();
        $this->prepareVars();
        $this->initialized = true;
    }
1318773
public function initialize()
    {
        /**
         * Attaches event fired before view render
         * It allows to use $this->view->partial inside of action method before action view is being rendered
         */
        $this->eventsManager->attach('view:beforeRenderView', function($event, $view, $engineViewPath) {
            if ($view instanceof View) {
                $view->setControllerViewPath($this->router->getControllerName());
            }
        });
    }