Simple HTML DOM オブジェクトを生成する
@param  string $src HTMLソースコード
@return object Simple HTML DOM オブジェクト
357043
public function create_simple_html_dom( $src ){
		// Simple HTML DOM
		$simple_html_dom = str_get_html(
			$src ,
			true, // $lowercase
			true, // $forceTagsClosed
			DEFAULT_TARGET_CHARSET, // $target_charset
			false, // $stripRN
			DEFAULT_BR_TEXT, // $defaultBRText
			DEFAULT_SPAN_TEXT // $defaultSpanText
		);
		return $simple_html_dom;
	}
136981
public static function image($src, $alt = null, $attribs = array())
    {
        $attribs = array_merge(array('src'=>$src), $attribs);
        if ($alt) {
            $attribs['alt'] = htmlentities($alt);
        }
        
        return self::tag('img', null, $attribs);
    }
44165
public function image(String $src, Int $width = NULL, Int $height = NULL, Array $attributes = []) : String
    {
        if( ! IS::url($src) )
        {
            $src = Request::getBaseURL($src);
        }

        $attributes['src'] = $src;

        if( ! empty($width) )
        {
            $attributes['width'] = $width;
        }

        if( ! empty($height) )
        {
            $attributes['height'] = $height;
        }

        if( ! isset($attributes['title']) )
        {
            $attributes['title'] = '';
        }

        if( ! isset($attributes['alt']) )
        {
            $attributes['alt'] = '';
        }

        return $this->_singleElement('img', $attributes);
    }
51463
public function hFactSourcePrepend($srec) {
        $wt_tree = Globals::getTree();
        $html='';
        $sid=null;
        
        if($this->getSetting('MAJ_SHOW_CERT', Auth::PRIV_HIDE) >= Auth::accessLevel($wt_tree)){
            if (!$srec || strlen($srec) == 0) return $html;
            	
            $certificate = null;
            $subrecords = explode("\n", $srec);
            $levelSOUR = substr($subrecords[0], 0, 1);
            $match = null;
            if (preg_match('~^'.$levelSOUR.' SOUR @('.WT_REGEX_XREF.')@$~', $subrecords[0], $match)) {
                $sid=$match[1];
            };
            $nb_subrecords = count($subrecords);
            for ($i=0; $i < $nb_subrecords; $i++) {
                $subrecords[$i] = trim($subrecords[$i]);
                $tag = substr($subrecords[$i], 2, 4);
                $text = substr($subrecords[$i], 7);
                if($tag == '_ACT') $certificate= new Certificate($text, $wt_tree, $this->getProvider());
            }
            	
            if($certificate && $certificate->canShow())
                $html = $this->getDisplay_ACT($certificate, $sid);
                	
        }
        return $html;
    }
889088
protected function generateFileVersion( $src ) {
		// Normalize both URLs in order to avoid problems with http, https
		// and protocol-less cases
		$src = $this->removeProtocol( $src );
		$home_url = $this->removeProtocol( site_url( '/' ) );
		$version = false;

		if ( ! $this->isExternalUrl( $src, $home_url ) ) {
			// Generate the absolute path to the file
			$file_path = str_replace(
				[$home_url, '/'],
				[ABSPATH, DIRECTORY_SEPARATOR],
				$src
			);

			if ( file_exists( $file_path ) ) {
				// Use the last modified time of the file as a version
				$version = filemtime( $file_path );
			}
		}

		return $version;
	}
47304
protected function generateRequestBody($src)
	{
		$params = [
			'compilation_level' => $this->compilationLevel,
			'js_code'           => $src,
			'output_format'     => 'json',
			'output_info'       => 'compiled_code'
		];

		// Add our custom externs if default externs are disabled
		if ($this->excludeDefaultExterns && $this->compilationLevel === 'ADVANCED_OPTIMIZATIONS')
		{
			$params['exclude_default_externs'] = 'true';
			$params['js_externs'] = $this->externs;
		}

		// Add dupe variables by hand
		$body = http_build_query($params) . '&output_info=errors';

		return $body;
	}
1112124
private function close_php( &$src ){
		if( $this->inphp ){
			$this->inphp = false;
			
			// this may result in back to back tags, which we can avoid with a bit of string manipulation.
			$makenice = $this->opt(COMPILER_OPTION_NICE_TAGS);
			
			if( $makenice && substr( $src, -5 ) === '<?php' ){
				// trim trailing open tag, so no need to close
				$src = substr_replace( $src, '', -5 );
			}
			else {
				$src .= ' ?>';
			}
		}
		return $src;	
	}
983558
protected function _renderSrc($url, array $attrs = array()) {
        if ('http://' !== substr($url, 0, 7)
            && 'https://' !== substr($url, 0, 8)
            && '//' !== substr($url, 0, 2)
        ) {
            $url = $this->view->assetUrl($url);
        }
        $attrs['src'] = $url;
        $attrs = $this->_htmlAttribs($attrs);
        return "<script{$attrs}></script>";
    }
1286589
public function IsDerivedFrom( $src )
	{
		switch ( $src->TypeCode )
		{
			case XmlTypeCode::Node:
				if ( ! $this->IsNode )
					return false;
				break;

			case XmlTypeCode::AnyAtomicType:
			case XmlTypeCode::UntypedAtomic:
				if ( $this->IsNode )
					return false;
				break;

			case XmlTypeCode::Document:
				if ( $this->TypeCode != XmlTypeCode::Document || $this->SchemaElement != $src->SchemaElement)
					return false;
				break;

			case XmlTypeCode::Element:
				if ( $this->TypeCode != XmlTypeCode::Element || $this->SchemaElement != $src->SchemaElement)
					return false;
				break;

			case XmlTypeCode::Attribute:
				if ($this->TypeCode != XmlTypeCode::Attribute || $this->SchemaAttribute != $src->SchemaAttribute)
					return false;
				break;

			case XmlTypeCode::ProcessingInstruction:
				if ($this->TypeCode != XmlTypeCode::ProcessingInstruction)
					return false;
				break;

			case XmlTypeCode::Comment:
				if ( $this->TypeCode != XmlTypeCode::Comment )
					return false;
				break;

			case XmlTypeCode::Text:
				if ( $this->TypeCode != XmlTypeCode::Text )
					return false;
				break;
		}
		if ( ! is_null( $this->SchemaType ) || ! is_null( $src->SchemaType ) )
		{
			if ( ! is_null( $this->SchemaType ) && ! is_null( $src->SchemaType ) )
			{
				if ( ! DOMSchemaType::IsDerivedFrom( $this->SchemaType, $src->SchemaType, XmlSchemaDerivationMethod::Empty_ ) )
					return false;
			}
			else
				return false;
		}

		if ( $this->Cardinality != $src->Cardinality)
		{
			if ( ( $this->Cardinality == XmlTypeCardinality::ZeroOrOne || $this->Cardinality == XmlTypeCardinality::ZeroOrMore ) &&
				 ($src->Cardinality == XmlTypeCardinality::One || $src->Cardinality == XmlTypeCardinality::OneOrMore))
				return false;

			if ( $this->Cardinality == XmlTypeCardinality::One && $src->Cardinality == XmlTypeCardinality::OneOrMore)
				return false;
		}
		return true;
	}
362398
protected function _getPublicSrc($src)
    {
        return $this->view->cdn ? $this->view->cdn . $src : $this->view->baseUrl . $src;
    }
337974
public function img($src = null, $alt = null)
    {
        return Img::create()
            ->attributeIf($src, 'src', $src)
            ->attributeIf($alt, 'alt', $alt);
    }
1276372
protected function AssignFrom( $src )
	{
		$context = $this->context;
		$node = $this->node;
		$dataPool = $this->dataPool;
		$baseIter = $this->baseIter;
		$iter = $this->iter->CloneInstance();
		$sequentialPosition = $this->sequentialPosition;

	}
923067
public static function inputImage(string $name = '', string $src = '', array $attributes = []): string
    {
        $defaultAttributes = ['method-get' => false, 'class' => 'formImage'];
        $userAttributes = \array_merge($defaultAttributes, $attributes);
        $attributes = [];
        $attributes['type'] = 'image';
        $attributes['name'] = $userAttributes['method-get'] === false ? \sprintf('MFVARS[%s]', $name) : $name;
        $attributes['src'] = $src;
        $attributes['id'] = isset($userAttributes['id']) ? $userAttributes['id'] : $name;
        $userAttributes = static::clearAttributes($userAttributes, ['method-get', 'id']);

        return Tags::input(\array_merge($attributes, $userAttributes));
    }
1340844
private function renderImageAsHtml($src, $alt, $attributes = '')
    {
        /** @var GenerateHtmlEvent $imageEvent */
        $imageEvent = $this->eventDispatcher->dispatch(
            ContaoEvents::IMAGE_GET_HTML,
            new GenerateHtmlEvent($src, $alt, $attributes)
        );

        return $imageEvent->getHtml();
    }
785932
public static function imageThumbnail($src, $alt = '', $htmlOptions = array())
    {
        $htmlOptions['type'] = self::IMAGE_TYPE_THUMBNAIL;
        return self::image($src, $alt, $htmlOptions);
    }
378985
public function getTemplateSource($src)
    {
        if (0 === mb_strpos($src, 'Compo')) {
            $parser = $this->getContainer()->get('templating.name_parser');
            $locator = $this->getContainer()->get('templating.loader');
            $path = $locator->load($parser->parse($src));

            if ($path) {
                return $path->getContent();
            }
        }

        return $src;
    }
210442
public function embed(string $src){
        if(strtolower(substr($src, 0, 14)) !== "<!doctype html"){
            return $src;
        }

        $src        = $this->getDomDocument($src);
        $debug      = $this->getDomDocument($this->generateDebugHtml());
        $srcPath    = new \DOMXPath($src);
        $debugPath  = new \DOMXPath($debug);

        $headNode   = $srcPath->query("//head")->item(0);
        $bodyNode   = $srcPath->query("//body")->item(0);

        if($headNode !== null && $bodyNode !== null){
            $headNode->appendChild($src->importNode($debugPath->query("//head/style")->item(0), true));
            $bodyNode->appendChild($src->importNode($debugPath->query("//body/div")->item(0), true));
            $bodyNode->appendChild($src->importNode($debugPath->query("//body/script")->item(0), true));
        }

        return $src->saveHTML();
    }