Initializes the HeadLink element
@return $this
500612
public function initHeadLink()
    {
        $cssPath = $this->options->getCss()->getPath();
        $stylesheets = $this->orderByPriority($this->options->getCss()->getStylesheets());
        foreach ($stylesheets as $css) {
            if (isset($css["media"])) {
                $this->headLink->appendStylesheet($cssPath . "/" . $css["name"], $css["media"], false, array());
            } else {
                $this->headLink->appendStylesheet($cssPath . "/" . $css["name"], 'screen', false, array());
            }
        }

        return $this;
    }
1237746
public function init()
    {
        $serviceFactory = new \OAuth\ServiceFactory();
        $serviceFactory->setHttpClient(new CurlClient());
        $this->service = $serviceFactory->createService(
            $this->getServiceName(), $this->credentials, $this->sessionStorage, $this->scopes
        );

        return $this;
    }
1080748
protected function getHead()
    {
        $head = $this->getDocument()->createElement('head');
        $metahttp = $this->getDocument()->createElement('meta');
        $metahttp->setAttribute('http-equiv', 'Content-Type');
        $metahttp->setAttribute('content', 'text/html; charset=utf-8');
        $head->appendChild($metahttp);
        $head->appendChild($this->getDocument()->createElement('title', 'Generated List'));

        foreach ($this->getStylesheets() as $href) {
            $stylesheet = $this->getDocument()->createElement('link');
            $stylesheet->setAttribute('href', $href);
            $stylesheet->setAttribute('rel', 'stylesheet');
            $stylesheet->setAttribute('type', 'text/css');
            $head->appendChild($stylesheet);
        }

        return $head;
    }
521241
public static function init()
	{
		self::$operations['page'] = array('custom'=>true);
		self::$operations['headTotal'] = array('onlyOne'=>true);
		self::$operations['footTotal'] = array('onlyOne'=>true);
		self::$isInit = true;
	}
579063
public function initialize()
    {
        if ($this->isInformationCached()) {

            $this->information = $this->retrieveInformationFromCache();

        } else {

            $this->information = $this->collector->collect();
        }

        $this->fillModelClassIndex();

        $this->initialized = true;

        return $this;
    }
1255311
private function init()
    {
        $this->curl = curl_init();
        $this->setUserAgent(self::USER_AGENT);
        $this->setOpt(CURLINFO_HEADER_OUT, true);
        $this->setOpt(CURLOPT_HEADER, false);
        $this->setOpt(CURLOPT_RETURNTRANSFER, true);
        $this->setOpt(CURLOPT_HEADERFUNCTION, array($this, 'addResponseHeaderLine'));
        return $this;
    }
1134103
protected function Init()
    {
        $this->repeater = ContentRepeater::Schema()->ByContent($this->content);
        $this->current = $this->tree->FirstChildOf($this->item);
        $this->isEmpty = !$this->current;
        return parent::Init();
    }
1331806
public function getHead()
    {
        $head = new Core\Tag(
            'head',
            array((isset($this->args[0]) ? $this->args[0] : null)),
            array('generate', 'start')
        );
        $head->setAttrs($this->headattrs);

        return $head;
    }
901189
public function setUpElement()
    {
        parent::setUpElement();
        $path = "/";
        if(isset($_SERVER["HTTP_REFERER"]) && ($url = parse_url($_SERVER["HTTP_REFERER"])) &&
            $url["host"] == $_SERVER["HTTP_HOST"]){
            $path = $url["path"];
        }
        $currentUser = $this->container->getUserLibraryInstance()->getUserLoggedIn();

        if ($currentUser == null) {
            HTTPHeaderHelper::redirectToLocation("/");
            return;
        }

        $site = $this->container->getSiteInstance();
        $vars = $currentUser->getUserVariables();
        $lastRun = $vars->getValue("last-file-lib-cleanup");
        $lastRun = $lastRun == null ? 0 : $lastRun;

        $fileLib = $this->container->getFileLibraryInstance();
        $contentLibraries = array();
        /** @var Page $page */
        foreach ($this->container->getPageOrderInstance()->listPages() as $page) {
            if ($page->lastModified() < $lastRun) {
                continue;
            }
            $contentLibraries[] = $page->getContentLibrary();

        }
        if($site->lastModified() >= $lastRun){
            $contentLibraries[] = $site->getContentLibrary();
        }
        $fileList = array();
        /** @var File $file */
        foreach ($fileLib->getFileList($currentUser) as $file) {
            if ($fileLib->whitelistContainsFile($file)) {
                continue;
            }
            /** @var $contentLib ContentLibrary */
            foreach ($contentLibraries as $contentLib) {
                if (!count($contentLib->searchLibrary($file->getBasename(), $lastRun))) {
                    continue;
                }
                $fileLib->addToWhitelist($file);
                break;
            }
            $fileList[] = $file;
        }
        $fileLib->cleanLibrary($currentUser);
        $vars->setValue("last-file-lib-cleanup", time());
        $currentUser->logout();

        HTTPHeaderHelper::redirectToLocation($path);
    }
1301408
protected function Init()
    {
        $fieldset = ContentFieldset::Schema()->ByContent($this->Content());
        $this->id = $this->CssID();
        $this->classes = $this->CssClass();
        $this->legend = $fieldset->GetLegend();
        return parent::Init();
    }
892044
protected function _initItems()
    {
        $data = $this->_getItemsData();
        $items = [];
        foreach ($data as $itemData) {
            $item = $this->_createItem($itemData['label'], $itemData['value'], $itemData['count']);
            $items[] = $item;

            if ($this->useUrlRewrites() === true) {
                $item->setUrlRewrite($itemData['url']);
            }
        }
        $this->_items = $items;

        return $this;
    }
156204
public function initialize()
    {
        setlocale(LC_ALL, $this->locale->getIso() . '.' . $this->encoding);
        $this->localeInfo = localeconv();

        return $this;
    }
1146744
public function Initialize() {
      $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();
   }
484906
public function initialize() {
        if (!$this->isEnabled()) {
            return;
        }

        $current = null;

        // Determine via cookie
        if (!empty($_COOKIE['locale']) && isset($this->_locales[$_COOKIE['locale']])) {
            $current = $_COOKIE['locale'];

        // Determine locale based on HTTP headers
        } else if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
            $header = mb_strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']);

            if (mb_strpos($header, ';') !== false) {
                $header = mb_strstr($header, ';', true);
            }

            $header = explode(',', $header);

            if (count($header) > 0) {
                foreach ($header as $key) {
                    if (isset($this->_locales[$key])) {
                        $current = $key;
                        break;
                    }
                }
            }
        }

        // Set current to the fallback if none found
        if ($current === null) {
            $current = $this->_fallback->getCode();
        }

        // Check for a translator
        if (!$this->_translator) {
            throw new MissingTranslatorException('A translator is required for G11n message parsing');
        }

        $this->emit('g11n.onInit', [$this, &$current]);

        // Apply the locale
        $this->useLocale($current);
    }
340441
protected function Init()
    {
        $this->login = ContentLogin::Schema()->ByContent($this->Content());
        $this->HandleLoggedIn();
        $passwordUrl = $this->login->GetPasswordUrl();
        $this->passwordUrl = $passwordUrl ? FrontendRouter::Url($passwordUrl) : '';
        $this->AddNameField();
        $this->AddPasswordField();
        $this->AddUniqueSubmit('LoginSubmit');
        $validator = new Access(self::Guard(), false, $this->ErrorPrefix('Access'));
        $this->Elements()->AddValidator($validator);
        return parent::Init();
    }
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');
   }
233324
public function initialize()
    {
        parent::initialize();
        $this->cms = Cms::getInstance();
        $this->_setTheme();

        $pluginEvent = Plugin::getData('Core', 'Controller.initialize');
        if (is_callable($pluginEvent->find(0)) && Plugin::hasManifestEvent('Controller.initialize')) {
            call_user_func_array($pluginEvent->find(0), [$this]);
        }
    }