You are here

private function CSSCompression_Setup::details in Advanced CSS/JS Aggregation 6

Same name and namespace in other branches
  1. 7 advagg_css_compress/css-compressor-3.x/src/lib/Setup.inc \CSSCompression_Setup::details()

Run individual compression techniques on each property of a selector

Parameters

(string) row: Selector properties:

1 call to CSSCompression_Setup::details()
CSSCompression_Setup::setup in advagg_css_compress/css-compressor-3.x/src/lib/Setup.inc
Setup selector and details arrays for compression methods

File

advagg_css_compress/css-compressor-3.x/src/lib/Setup.inc, line 236

Class

CSSCompression_Setup
CSS Compressor [VERSION] [DATE] Corey Hart @ http://www.codenothing.com

Code

private function details($row) {
  $row = preg_split($this->rsemicolon, $row);
  $parts = array();
  $details = '';
  foreach ($row as $line) {

    // Set loopers
    $parts = preg_split($this->rcolon, $line, 2);
    $prop = '';
    $value = '';

    // Property
    if (isset($parts[0]) && ($parts[0] = trim($parts[0])) != '') {
      $prop = $parts[0];
    }

    // Value
    if (isset($parts[1]) && ($parts[1] = trim($parts[1])) != '') {
      $value = preg_replace($this->rbang, ' !', $parts[1]);
    }

    // Fail safe, remove unspecified property/values
    if ($prop == '' || $value == '') {
      continue;
    }

    // Run the tag/element through each compression
    list($prop, $value) = $this->Individuals
      ->individuals($prop, $value);

    // Add counter to before stats
    $this->stats['before']['props']++;

    // Store the compressed element
    $details .= "{$prop}:" . preg_replace($this->rspacebang, '!', $value) . ";";
  }
  return $details;
}