Usage: {asset_js refs='' attrs=[] group='' raw=false}
Required: refs

@return mixed string or nothing if group is filled
423195
public function asset_js($params) {
        if (!isset($params['refs'])) {
            throw new \UnexpectedValueException("The refs parameter is required.");
        }
        $group = isset($params['group']) ? $params['group'] : null;
        $attrs = isset($params['attrs']) ? $params['attrs'] : array();
        $raw = isset($params['raw']) ? $params['raw'] : false;
        return Asset::js($params['refs'], $attrs, $group, $raw);
    }
337909
public function requireJs()
    {
        $scripts = $this->dispatcher->scripts('script', $this->assets, $this->path);

        $required = [];
        $string   = '';
        if (isset($this->assets['script'])) {
            foreach ($this->assets['script'] as $js) {
                if (!is_null($require = array_get($js, 'attributes.require'))) {
                    $required["'" . implode("','", $require) . "'"][] = $js['source'];
                }
            }


            $idx = 0;
            foreach ($required as $names => $scripts) {
                $require = "require([$names],function(){ " . "require(['" . implode("','", $scripts) . "'],function(){ :replace })" . "  });";
                if ($idx > 0) {
                    $string = str_replace(':replace', $require, $string);
                } else {
                    $string = $require;
                }
                ++$idx;
            }
        }

        $inlines = implode('', $this->dispatcher->scripts('inline', $this->assets, $this->path));

        $string = !strlen($string) ? $inlines : str_replace(':replace', $inlines . $this->afterLoad(), $string);


        $require = "['" . implode("','", $scripts) . "']";
        return $this->requireInline($require, $string);
    }
161349
public function getJs()
    {
        if(!$this->includeAssets())
        {
            return '';
        }
        $libraries = $this->getLibrariesInUse();
        $code = '';
        foreach($libraries as $library)
        {
            $code .= "\n" . $library->getJs() . "\n";
        }
        return $code;
    }
388215
public function import($asset, $group = null)
    {
        $assets = $this->isNumericArray($asset) ? $asset : [$asset];

        $assetNames = [];

        foreach ($assets as $asset) {
            list($name, $attributes) = $this->toNameAndAttributes($asset);

            // First iteration only
            if (!$assetNames) {
                $group = $this->detectGroup($name, $group);
            }

            $assetNames[] = $name;

            $assertObject = $this->addImportOrInline($name, $group);

            if ($attributes) {
                $assertObject->setAttributes($attributes);
            }
        }

        $this->lastTouchedGroup = $group;
        $this->lastTouchedAssets = $assetNames;

        return $this;
    }
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;
    }
473447
public function get_js_data() {
        global $CFG;

        $ret = new stdClass;

        // Sort the types by priority.
        uasort($this->types, array($this, 'type_compare'));

        $ret->types = array();
        if (!empty($CFG->dndallowtextandlinks)) {
            foreach ($this->types as $type) {
                if (empty($type->handlers)) {
                    continue; // Skip any types without registered handlers.
                }
                $ret->types[] = $type;
            }
        }

        $ret->filehandlers = $this->filehandlers;
        $uploadrepo = repository::get_instances(array('type' => 'upload', 'currentcontext' => $this->context));
        if (empty($uploadrepo)) {
            $ret->filehandlers = array(); // No upload repo => no file handlers.
        }

        return $ret;
    }
256932
public static function getGroup() {
		
		$attr = [];

		foreach(static :: $group as $group) {
			$attr = static :: arrayRecursiveMerge($attr, $group);
		}

		return $attr;
	}
675157
public function asset(string $path, string $assetSite = null): string
    {
        if (strlen($path) == 0) {
            throw new \InvalidArgumentException('Expected non-empty string');
        }

        // if you pass the full URL that contains "//" part, it'll be immediately
        // returned without any kind of building or parsing

        $pos = strpos($path, '//');
        if (($pos !== false && $pos < 10) || substr($path, 0, 2) == '//') {
            return $path;
        }

        $assets = Application::getConfig('application')->get('assets') ?? [];

        if ($path[0] != '/') {
            $path = '/' . $path;
        }

        $url = null;

        if ($assetSite != null) {
            if (isset($assets[$assetSite])) {
                $url = $assets[$assetSite];
            } else {
                $backtrace = debug_backtrace();
                $caller = $backtrace[1]['function'] ?? '[unknown caller]'; // TODO: Possible fix needed
                Log::warning("Asset site {$assetSite} is used in {$caller}, but not set in application config; using first asset site if any");

                if (count($assets) > 0) {
                    $url = array_values($assets)[0];
                }
            }
        } else {
            if (count($assets) > 0) {
                $url = array_values($assets)[0];
            }
        }

        if ($url == null) {
            return static::makeUrl($path);
        } else {
            if (substr($url, -1) != '/') {
                $url .= '/';
            }

            if (substr($path, 0, 1) == '/') {
                $path = substr($path, 1);
            }

            return $url . $path;
        }
    }
858764
public function webpackAsset($asset)
    {
        $asset_id        = $this->public_path . '/' . Compiler::getAliasId($asset);
        $full_asset_path = $this->web_dir . '/' . $asset_id;

        return [
            'js'  => file_exists($full_asset_path . '.js')
                ? $asset_id . '.js?' . filemtime($full_asset_path . '.js')
                : false,
            'css' => file_exists($full_asset_path . '.css')
                ? $asset_id . '.css?' . filemtime($full_asset_path . '.css')
                : false,
        ];
    }
446285
protected function resolveAssets(): ?string
    {
        $module = $this->getModuleInfo();
        if (!isset($module['assets'])) {
            return null;
        }
        $directory = $this->directory() . DIRECTORY_SEPARATOR . trim($module['assets'], DIRECTORY_SEPARATOR);
        return is_dir($directory) ? realpath($directory) : null;
    }
775924
public function renderScriptAssets()
    {
        return implode(
            "\n",
            array_map(
                function ($asset) {
                    return '<script src="' . $asset . '"></script>';
                },
                array_keys(
                    array_filter($this->scriptAssets, function ($head) { return ! $head; })
                )
            )
        );
    }
720507
public function getRenderedDataAttribute() : ?string
    {
        if ($this->renderedData !== null) {
            return $this->renderedData;
        }

        if ($this->config->get('tracker.save_rendered', true) &&
            ($rendered = $this->getAttributeFromArray('data_rendered')) !== null) {
            return $this->renderedData = $rendered;
        }

        if (($raw = $this->getAttributeFromArray('data')) !== null) {
            return $this->renderedData = markdown($raw);
        }

        return null;
    }
1232785
function attribute( $attr )
    {
        switch ( $attr )
        {
            case "original_filename":
                return $this->OriginalFilename;
            case "mime_type":
                return $this->Type;
            case "mime_type_category":
                return $this->MimeCategory;
            case "mime_type_part":
                return $this->MimePart;
            case "filename":
                return $this->Filename;
            case "filesize":
                return $this->Size;
            case "is_temporary":
                return $this->IsTemporary;
            default:
            {
                eZDebug::writeError( "Attribute '$attr' does not exist", __METHOD__ );
                return null;
            } break;
        }
    }
1040378
public function getRef()
    {
        if (is_null($this->ref)) {
            $tags = $this->tags;
            sort($tags);
            $this->ref = md5(implode('-', $tags));
        }
        return $this->ref;
    }
774148
public function css($attributes = null)
	{
		if( ! $this->css)
			return '';

		$assets = ($this->pipeline) ? array($this->cssPipeline()) : $this->css;

		if($attributes instanceof Closure)
			return $attributes->__invoke($assets);

		// Build attributes
		$attributes = (array) $attributes;
		unset($attributes['href']);

		if( ! array_key_exists('type', $attributes))
			$attributes['type'] = 'text/css';

		if( ! array_key_exists('rel', $attributes))
			$attributes['rel'] = 'stylesheet';

		$attributes = $this->buildTagAttributes($attributes);

		// Build tags
		$output = '';
		foreach($assets as $asset)
			$output .= '<link href="' . $asset . '"' . $attributes . " />\n";

		return $output;
	}
39727
public static function getAssets(){

    // first call? include styles and javascript
    if(static::$didAssets)
      return '';

    ob_start();

    if(ref::config('stylePath') !== false){
      ?>
      <style scoped>
        <?php readfile(str_replace('{:dir}', __DIR__, ref::config('stylePath'))); ?>
      </style>
      <?php
    }

    if(ref::config('scriptPath') !== false){
      ?>
      <script>
        <?php readfile(str_replace('{:dir}', __DIR__, ref::config('scriptPath'))); ?>
      </script>
      <?php
    }

    // normalize space and remove comments
    $output = preg_replace('/\s+/', ' ', trim(ob_get_clean()));
    $output = preg_replace('!/\*.*?\*/!s', '', $output);
    $output = preg_replace('/\n\s*\n/', "\n", $output);

    static::$didAssets = true;
    return $output;
  }
1201990
public static function getAssetFileName()
    {
        $url_frags = parse_url($_SERVER['REQUEST_URI']);
        if (!array_key_exists('query', $url_frags)) return false;
        parse_str($url_frags['query'], $query_vars);
        if (!array_key_exists('asset', $query_vars)) return false;
        return $query_vars['asset'];
    }