Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
Public Member Functions | List of all members
CssUrlParserPlugin Class Reference
Inheritance diagram for CssUrlParserPlugin:
aCssParserPlugin

Public Member Functions

 getTriggerChars ()
 getTriggerStates ()
 parse ($index, $char, $previousChar, $state)
- Public Member Functions inherited from aCssParserPlugin
 __construct (CssParser $parser, array $configuration=null)

Additional Inherited Members

- Protected Attributes inherited from aCssParserPlugin
 $configuration = array()
 $parser = null
 $buffer = ""

Detailed Description

Definition at line 744 of file cssmin.php.

Member Function Documentation

CssUrlParserPlugin::getTriggerChars ( )

Implements aCssParserPlugin::getTriggerChars().

Returns
array

Reimplemented from aCssParserPlugin.

Definition at line 751 of file cssmin.php.

{
return array("(", ")");
}
CssUrlParserPlugin::getTriggerStates ( )

Implements aCssParserPlugin::getTriggerStates().

Returns
array

Reimplemented from aCssParserPlugin.

Definition at line 760 of file cssmin.php.

{
return false;
}
CssUrlParserPlugin::parse (   $index,
  $char,
  $previousChar,
  $state 
)

Implements aCssParserPlugin::parse().

Parameters
integer$indexCurrent index
string$charCurrent char
string$previousCharPrevious char
Returns
mixed TRUE will break the processing; FALSE continue with the next plugin; integer set a new index and break the processing

Reimplemented from aCssParserPlugin.

Definition at line 772 of file cssmin.php.

References CssMin\triggerError().

{
// Start of string
if ($char === "(" && strtolower(substr($this->parser->getSource(), $index - 3, 4)) === "url(" && $state !== "T_URL")
{
$this->parser->pushState("T_URL");
$this->parser->setExclusive(__CLASS__);
}
// Escaped LF in url => remove escape backslash and LF
elseif ($char === "\n" && $previousChar === "\\" && $state === "T_URL")
{
$this->parser->setBuffer(substr($this->parser->getBuffer(), 0, -2));
}
// Parse error: Unescaped LF in string literal
elseif ($char === "\n" && $previousChar !== "\\" && $state === "T_URL")
{
$line = $this->parser->getBuffer();
$this->parser->setBuffer(substr($this->parser->getBuffer(), 0, -1) . ")"); // Replace the LF with the url string delimiter
$this->parser->popState();
$this->parser->unsetExclusive();
CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": Unterminated string literal", $line . "_"));
}
// End of string
elseif ($char === ")" && $state === "T_URL")
{
$this->parser->popState();
$this->parser->unsetExclusive();
}
else
{
return false;
}
return true;
}

The documentation for this class was generated from the following file: