Get the HTML links to all of the registered JavaScript assets.

@return string
186624
public function scripts()
	{
		$assets = array();
		
		foreach ($this->assets as $asset) {
			if ('js' !== $asset['ext']) {
				continue;
			}
			
			$assets[] = $this->route ? $asset : $this->process($asset);
		}
		
		if (empty($assets)) {
			return '';
		}
		
		if ($this->route) {
			return $this->prepareForController($assets, 'script');
		}
		
		if ($this->combine) {
			$assets = $this->combine($assets, 'script');
		}
		
		$links = array();
		foreach ($assets as $asset) {
			$url = $this->cdn ? $this->cdn . $asset['url'] : $asset['url'];
			$links[] = HTML::script($url, $asset['attributes']);
		}
		
		return implode('', $links);
	}
697292
protected function getScriptText()
    {
        $scriptText = "";
        foreach ($this->imageUrls as $imageUrl) {
            $escapedImageUrl = Builder::escapeText($imageUrl);
            $scriptText      .= "
PreloadImage({$escapedImageUrl});";
        }
        return $scriptText;
    }
917010
protected function getInlineJavaScript()
    {
        $base_href = 'editor_base_' . $this->id;
        ob_start();

        if ($this->base_href === null) {
            echo "var {$base_href} = " .
                "document.getElementsByTagName('base');\n";

            echo "if ({$base_href}.length) {\n";
            echo "\t{$base_href} = {$base_href}[0];\n";
            echo "\t{$base_href} = {$base_href}.href;\n";
            echo "} else {\n";
            echo "\t{$base_href} = location.href.split('#', 2)[0];\n";
            echo "\t{$base_href} = {$base_href}.split('?', 2)[0];\n";
            echo "\t{$base_href} = {$base_href}.substring(\n";
            echo "\t\t0, {$base_href}.lastIndexOf('/') + 1);\n";
            echo "}\n";
        } else {
            echo "var {$base_href} = " .
                SwatString::quoteJavaScriptString($this->base_href) .
                ";\n";
        }

        echo "tinyMCE.init({\n";

        $lines = array();
        foreach ($this->getConfig() as $name => $value) {
            if (is_string($value)) {
                $value = SwatString::quoteJavaScriptString($value);
            } elseif (is_bool($value)) {
                $value = $value ? 'true' : 'false';
            }
            $lines[] = "\t" . $name . ": " . $value;
        }

        $lines[] = "\tdocument_base_url: {$base_href}";

        echo implode(",\n", $lines);

        // Make removeformat button also clear inline alignments, styles,
        // colors and classes.
        echo ",\n" .
            "\tformats: {\n" .
            "\t\tremoveformat : [\n" .
            "\t\t\t{\n" .
            "\t\t\t\tselector     : 'b,strong,em,i,font,u,strike',\n" .
            "\t\t\t\tremove       : 'all',\n" .
            "\t\t\t\tsplit        : true,\n" .
            "\t\t\t\texpand       : false,\n" .
            "\t\t\t\tblock_expand : true,\n" .
            "\t\t\t\tdeep         : true\n" .
            "\t\t\t},\n" .
            "\t\t\t{\n" .
            "\t\t\t\tselector     : 'span',\n" .
            "\t\t\t\tattributes   : [\n" .
            "\t\t\t\t\t'style',\n" .
            "\t\t\t\t\t'class',\n" .
            "\t\t\t\t\t'align',\n" .
            "\t\t\t\t\t'color',\n" .
            "\t\t\t\t\t'background'\n" .
            "\t\t\t\t],\n" .
            "\t\t\t\tremove       : 'empty',\n" .
            "\t\t\t\tsplit        : true,\n" .
            "\t\t\t\texpand       : false,\n" .
            "\t\t\t\tdeep         : true\n" .
            "\t\t\t},\n" .
            "\t\t\t{\n" .
            "\t\t\t\tselector     : '*',\n" .
            "\t\t\t\tattributes   : [\n" .
            "\t\t\t\t\t'style',\n" .
            "\t\t\t\t\t'class',\n" .
            "\t\t\t\t\t'align',\n" .
            "\t\t\t\t\t'color',\n" .
            "\t\t\t\t\t'background'\n" .
            "\t\t\t\t],\n" .
            "\t\t\t\tsplit        : false,\n" .
            "\t\t\t\texpand       : false,\n" .
            "\t\t\t\tdeep         : true\n" .
            "\t\t\t}\n" .
            "\t\t]\n" .
            "\t}";

        echo "\n});";

        return ob_get_clean();
    }
1032736
public function getLinks()
    {
        $links = array();
        foreach($this->links as $rel => $href) {
            $simple_rel = $rel;
            $base_uris = array("fx:", static::LINK_RELATIONSHIPS_BASE_URI);
            foreach($base_uris as $base_uri) {
                $pos = strpos($simple_rel, $base_uri);
                if ($pos !== FALSE && ($simple_rel.'/' != $base_uri)) {
                    $simple_rel = substr($simple_rel, strlen($base_uri));
                }
            }
            $links[$simple_rel] = $href;
        }
        return $links;
    }
580117
private function assets()
    {
        $s = '';
        foreach($this->styles as $id=>$f){
            $s .= '<link id="stylesheet_'.$id.'" rel="stylesheet" href="'._URL.'css/'.$f.'.css">'."\n\t";
        }
        $this->val('style', $s);

        $s = '<script id="javascript_base">var URL=\''._URL.'\'';
        if(isset($_SESSION['msg']) && $_SESSION['msg'] !== '') {
            $s .= ',xmsg="'.str_replace('"', "'", $_SESSION['msg']).'"';
            unset($_SESSION['msg']); 
        }
        foreach ($this->jsvalues as $n=>$v) {
            $s .= ','.$n.'='.(is_string($v) ? '\''.$v.'\'' : $v);
        }
        $s .= ';</script>';
        foreach($this->scripts as $id=>$f){
            $s .= "\n\t".'<script id="javascript_'.$id.'" src="'._URL.'js/'.$f.'.js"></script>';
        }
        $this->val('script', $s); //e($this);
    }
783655
public function getScripts()
    {
        $retVal = '';
        while ( $this->scripts->valid() ) {
            $retVal .= "<script type='text/javascript'>\n{$this->scripts->get()}\n</script>\n";
            $this->scripts->next();
        }
        
        return $retVal;
    }
686584
protected function getLinks()
    {
        $sLinks = '';
        foreach($this->xPaginator->getPages() as $page)
        {
            if($page['call'])
            {
                $sTemplate = ($page['isCurrent'] ? 'pagination::links/current' : 'pagination::links/enabled');
                $sLinks .= $this->xTemplate->render($sTemplate, ['call' => $page['call'], 'text' => $page['num']]);
            }
            else
            {
                $sLinks .= $this->xTemplate->render('pagination::links/disabled', ['text' => $page['num']]);
            }
        }
        return $sLinks;
    }
1128775
protected function renderActionLinks() : string
    {
        $links = "";
        foreach ($this->getActionLinks() as $url => $label) {
            $links .= H::a($label, ["data-url" => $url])." ";
        }
        return $links;
    }
564371
public function getLink() {
		$url = 'javascript:chooseInstancePopup('.json_encode($this->type).', "'.ROOT_URL.$this->getUrl().'?name=", "'.ROOT_URL.'")';
		return $url;
	}
1033259
public function renderJs()
    {
        $jsLines = "\n";
        if ($this->getView()->assetBundles) {
            foreach ($this->getView()->assetBundles as $assetBundle) {
                if (!$assetBundle->sourcePath) {
                    foreach ($assetBundle->js as $jsFile) {
                        $jsLines .= "\n" . Html::jsFile($jsFile, $assetBundle->jsOptions);
                    }
                }
            }
        }
        if ($this->getView()->jsFiles) {
            foreach ($this->getView()->jsFiles as $jsFiles) {
                $jsLines .= implode("\n", $jsFiles);
            }
        }
        if ($this->getView()->js) {
            foreach ($this->getView()->js as $js) {
                $jsLines .= implode("\n", $js);
            }
        }
        return $jsLines;
    }
859045
public function getStyles(): string
    {
        $str = '';

        if(isset($this->styles))
            foreach($this->styles as $style)
                if(isset($style['content']))
                    $str .= '<style type="'.$style['type'].'">'.$style['content'].'</style>';
                elseif(isset($style['href']))
                    $str .= '<link rel="'.$style['rel'].'" type="'.$style['type'].'" href="'.$style['href'].'"'.(($style['defer']) ? ' defer async' : '').' />';
                elseif(isset($style['raw']))
                    $str .= $style['raw'];

        return $str;
    }
887408
public function get_links() {
        global $USER;
        $links = array();

        if (!isloggedin() || isguestuser()) {
            return $links;
        }

        $tagname = $this->get_display_name();
        $systemcontext = context_system::instance();

        // Add a link for users to add/remove this from their interests.
        if (static::is_enabled('core', 'user') && core_tag_area::get_collection('core', 'user') == $this->tagcollid) {
            if (static::is_item_tagged_with('core', 'user', $USER->id, $this->name)) {
                $url = new moodle_url('/tag/user.php', array('action' => 'removeinterest',
                    'sesskey' => sesskey(), 'tag' => $this->rawname));
                $links[] = html_writer::link($url, get_string('removetagfrommyinterests', 'tag', $tagname),
                        array('class' => 'removefrommyinterests'));
            } else {
                $url = new moodle_url('/tag/user.php', array('action' => 'addinterest',
                    'sesskey' => sesskey(), 'tag' => $this->rawname));
                $links[] = html_writer::link($url, get_string('addtagtomyinterests', 'tag', $tagname),
                        array('class' => 'addtomyinterests'));
            }
        }

        // Flag as inappropriate link.  Only people with moodle/tag:flag capability.
        if (has_capability('moodle/tag:flag', $systemcontext)) {
            $url = new moodle_url('/tag/user.php', array('action' => 'flaginappropriate',
                'sesskey' => sesskey(), 'id' => $this->id));
            $links[] = html_writer::link($url, get_string('flagasinappropriate', 'tag', $tagname),
                        array('class' => 'flagasinappropriate'));
        }

        // Edit tag: Only people with moodle/tag:edit capability who either have it as an interest or can manage tags.
        if (has_capability('moodle/tag:edit', $systemcontext) ||
                has_capability('moodle/tag:manage', $systemcontext)) {
            $url = new moodle_url('/tag/edit.php', array('id' => $this->id));
            $links[] = html_writer::link($url, get_string('edittag', 'tag'),
                        array('class' => 'edittag'));
        }

        return $links;
    }
156403
private function getScriptsContainers()
    {
        $container = null;
        $config    = null;
        foreach (['container', 'app', 'foundation'] as $name) {
            if (isset($this->{$name}) && is_null($container)) {
                $container = $this->{$name}->make('antares.asset');
                $config    = $this->{$name}->make('config');
                break;
            }
        }
        if (is_null($container)) {
            $container = app('antares.asset');
        }
        if (is_null($config)) {
            $config = app('config');
        }
        return [
            'container' => $container,
            'config'    => $config
        ];
    }
905838
protected function getJavaScriptFiles()
    {
        $formObject = $this->assetHandlerFactory->getFormObject();

        $javaScriptFiles = $this->getFieldsValidationJavaScriptAssetHandler()
            ->getJavaScriptValidationFiles();

        $conditionProcessor = $this->getConditionProcessor($formObject);

        $javaScriptFiles = array_merge($javaScriptFiles, $conditionProcessor->getJavaScriptFiles());

        return $javaScriptFiles;
    }
280826
public function getAssetVariables()
    {
        $result = [];

        foreach ($this->getFormFields() as $attribute => $field) {
            if (!$varName = array_get($field, 'assetVar')) {
                continue;
            }

            $result[$varName] = $this->{$attribute};
        }

        return $result;
    }
1144396
protected function cacheJsAssetFiles()
    {
        if ($this->getOptions()->isProduction()) {
            // Retrieve asset file filters manager
            $oAssetFileFiltersManager = $this->getAssetFileFiltersManager();

            // Retrieve Js asset file filter if available
            $oJsFileFilter = $oAssetFileFiltersManager->has(\AssetsBundle\AssetFile\AssetFile::ASSET_JS) ? $oAssetFileFiltersManager->get(\AssetsBundle\AssetFile\AssetFile::ASSET_JS) : null;

            // Create tmp asset file
            $oTmpAssetFile = $this->createTmpAssetFile(\AssetsBundle\AssetFile\AssetFile::ASSET_JS);

            foreach ($this->getAssetFilesConfiguration()->getAssetFiles(\AssetsBundle\AssetFile\AssetFile::ASSET_JS) as $oAssetFile) {
                $sAssetFileContent = $oJsFileFilter ? $oJsFileFilter->filterAssetFile($oAssetFile) : $oAssetFile->getAssetFileContents();
                $oTmpAssetFile->setAssetFileContents($sAssetFileContent . PHP_EOL);
            }
            if($oTmpAssetFile->getAssetFileSize()){
                return array($this->getAssetFilesCacheManager()->cacheAssetFile($oTmpAssetFile));
            }
            return array();
        }

        // Retrieve asset files cache manager
        $oAssetFilesCacheManager = $this->getAssetFilesCacheManager();
        $aAssetFiles = array();
        foreach ($this->getAssetFilesConfiguration()->getAssetFiles(\AssetsBundle\AssetFile\AssetFile::ASSET_JS) as $oAssetFile) {
            // Cache asset file if not empty
            if($oAssetFile->getAssetFileSize()){
                $aAssetFiles[] = $oAssetFilesCacheManager->cacheAssetFile($oAssetFile);
            }
        }
        return $aAssetFiles;
    }
950671
public function getJavascripts()
    {
        $self = $this;
        $parse_javascripts = function ($params, $javascripts) use ($self) {
            foreach ($params as $js) {

                if (is_string($js)) {
                    $js = array(
                        'path'  => $js,
                    );
                } elseif (isset($js['route'])) {
                    $js = array(
                        'path'  => $self->getGenerator()
                                        ->getContainer()
                                        ->get('router')
                                        ->generate($js['route'], $js['routeparams'])
                    );
                }

                $javascripts[] = $js;
            }

            return $javascripts;
        };

        // From config.yml
        $javascripts = $parse_javascripts(
            $this->getGenerator()->getContainer()
                 ->getParameter('admingenerator.javascripts', array()), array()
        );

        // From generator.yml
        $javascripts = $parse_javascripts(
            $this->getVariable('javascripts', array()), $javascripts
        );

        return $javascripts;
    }