Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
Public Member Functions | List of all members
CssAtMediaParserPlugin Class Reference
Inheritance diagram for CssAtMediaParserPlugin:
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 4320 of file cssmin.php.

Member Function Documentation

CssAtMediaParserPlugin::getTriggerChars ( )

Implements aCssParserPlugin::getTriggerChars().

Returns
array

Reimplemented from aCssParserPlugin.

Definition at line 4327 of file cssmin.php.

{
return array("@", "{", "}");
}
CssAtMediaParserPlugin::getTriggerStates ( )

Implements aCssParserPlugin::getTriggerStates().

Returns
array

Reimplemented from aCssParserPlugin.

Definition at line 4336 of file cssmin.php.

{
return array("T_DOCUMENT", "T_AT_MEDIA::PREPARE", "T_AT_MEDIA");
}
CssAtMediaParserPlugin::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 4348 of file cssmin.php.

{
if ($char === "@" && $state === "T_DOCUMENT" && strtolower(substr($this->parser->getSource(), $index, 6)) === "@media")
{
$this->parser->pushState("T_AT_MEDIA::PREPARE");
$this->parser->clearBuffer();
return $index + 6;
}
elseif ($char === "{" && $state === "T_AT_MEDIA::PREPARE")
{
$mediaTypes = array_filter(array_map("trim", explode(",", $this->parser->getAndClearBuffer("{"))));
$this->parser->setMediaTypes($mediaTypes);
$this->parser->setState("T_AT_MEDIA");
$this->parser->appendToken(new CssAtMediaStartToken($mediaTypes));
}
elseif ($char === "}" && $state === "T_AT_MEDIA")
{
$this->parser->appendToken(new CssAtMediaEndToken());
$this->parser->clearBuffer();
$this->parser->unsetMediaTypes();
$this->parser->popState();
}
else
{
return false;
}
return true;
}

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