Exemplo n.º 1
0
 /**
  * Execute certain hook handler
  *
  * @return void
  */
 public function executeHookHandler()
 {
     $adminLESS = static::getLESS(\XLite::ADMIN_INTERFACE);
     $lessParser = \XLite\Core\LessParser::getInstance();
     // Admin LESS files parsing
     $lessParser->setInterface('admin');
     $lessParser->setHttp('http');
     $lessParser->makeCSS($adminLESS);
     $lessParser = \XLite\Core\LessParser::resetInstance();
     $lessParser->setHttp('https');
     $lessParser->makeCSS($adminLESS);
 }
Exemplo n.º 2
0
 /**
  * Prepare CSS resources
  *
  * @param array $resources Resources
  *
  * @return array
  */
 protected function prepareCSSResources(array $resources)
 {
     $lessResources = array();
     // Detect the merged resources grouping
     foreach ($resources as $index => $resource) {
         if (isset($resource['less'])) {
             if (!isset($resource['merge']) && 'common' !== $resource['interface']) {
                 $resource['merge'] = 'bootstrap/css/initialize.less';
             }
             if (isset($resource['merge'])) {
                 $lessResources[$resource['merge']][] = $resource;
                 unset($resources[$index]);
             }
         }
     }
     foreach ($resources as $index => $resource) {
         if (isset($resource['less'])) {
             if (!isset($lessResources[$resource['original']])) {
                 // one resource group is registered
                 $lessGroup = array($resource);
             } else {
                 // The resource is placed into the head of the less resources list
                 $lessGroup = array_merge(array($resource), $lessResources[$resource['original']]);
             }
             $resources[$index] = \XLite\Core\LessParser::getInstance()->makeCSS($lessGroup);
             // Media type is derived from the parent resource
             $resources[$index]['media'] = $resource['media'];
         }
     }
     return $resources;
 }