Render css file by path as php file and store result in tmp directory and return new href value
@param \stdClass $item
@param boolean  $minify
@return string
169804
private function _renderFileToTmpAndGetNewHref ($item, $minify = FALSE) {
		$path = $item->path;
		$tmpFileName = '/rendered_css_' . self::$systemConfigHash . '_' . trim(str_replace('/', '_', $path), "_");
		$srcFileFullPath = $this->getAppRoot() . $path;
		$tmpFileFullPath = $this->getTmpDir() . $tmpFileName;
		if (self::$fileRendering) {
			if (file_exists($srcFileFullPath)) {
				$srcFileModDate = filemtime($srcFileFullPath);
			} else {
				$srcFileModDate = 1;
			}
			if (file_exists($tmpFileFullPath)) {
				$tmpFileModDate = filemtime($tmpFileFullPath);
			} else {
				$tmpFileModDate = 0;
			}
			if ($srcFileModDate !== FALSE && $tmpFileModDate !== FALSE) {
				if ($srcFileModDate > $tmpFileModDate) {
					if ($item->render) {
						$fileContent = $this->_renderFile($srcFileFullPath);
					} else if ($minify) {
						$fileContent = file_get_contents($srcFileFullPath);
					}
					$fileContent = $this->_convertStylesheetPathsFromRelatives2TmpAbsolutes($fileContent, $path);
					if ($minify) $fileContent = $this->_minify($fileContent, $item->path);
					$this->saveFileContent($tmpFileFullPath, $fileContent);
					$this->log("Css file rendered ('$tmpFileFullPath').", 'debug');
				}
			}
		}
		$tmpPath = substr($tmpFileFullPath, strlen($this->getAppRoot()));
		return $tmpPath;
	}
1255918
function minifyCss() {
  var stream = gulp.src([compiled.css + '/**/*', '!' + compiled.css + '/styleguide*'])
    .pipe(plugins.minifyCss())
    .pipe(plugins.rename({ suffix: '.min' }))
    .pipe(gulp.dest(dist.css));
  return stream;
}
898264
function render_select($item)
    {
        if ($item['name'] === '')
        {
            Eresus_Kernel::app()->getPage()->addErrorMessage(
                sprintf(errFormFieldHasNoName, $item['type'], $this->form['name']));
        }
        $result = "\t\t".'<tr><td class="formLabel">'.$item['label'].'</td><td><select name="'.$item['name'].'"'.$this->attrs($item).'>'."\n";
        if (!isset($item['items']) && isset($item['values'])) $item['items'] = $item['values'];
        for($i = 0; $i< count($item['items']); $i++) {
            if (isset($item['values'])) $value = $item['values'][$i]; else $value = $i;
            $result .= '<option value="'.$value.'" '.($value == (isset($this->values[$item['name']]) ? $this->values[$item['name']] : (isset($item['value'])?$item['value']:'')) ? 'selected = "selected"' : '').">".$item['items'][$i]."</option>\n";
        }
        $result .= '</select>'.$item['comment']."</td></tr>\n";
        return $result;
    }
135735
public function minifyCSS() {
      $css_dir = './css';
      if (is_dir($css_dir)) {
         foreach (glob("$css_dir/*.css") as $css_file) {
            if (!$this->endsWith($css_file, 'min.css')) {
               $this->taskMinify($css_file)
                  ->to(str_replace('.css', '.min.css', $css_file))
                  ->type('css')
                  ->run();
            }
         }
      }
      return $this;
   }
164345
public function renderItem($item)
    {
        $content = ArrayHelper::getValue($item, 'content', '');
        $caption = ArrayHelper::getValue($item, 'caption');

        if ($caption !== null) {
            $caption = \CHtml::tag('div', array('class' => Enum::ORBIT_CAPTION), $caption);
        }
        return \CHtml::tag('li', array(), $content . $caption);
    }
303982
private function _renderItemsTogether ($actualGroupName = '', $items = [], $indent = 0, $minify = FALSE) {
		// some configurations is not possible to render together and minimized
		list($itemsToRenderMinimized, $itemsToRenderSeparately) = $this->filterItemsForNotPossibleMinifiedAndPossibleMinifiedItems($items);

		$indentStr = $this->getIndentString($indent);
		$resultItems = [];
		if (self::$fileRendering) $resultItems[] = '<!-- css group begin: ' . $actualGroupName . ' -->';

		// process array with groups, which are not possible to minimize
		foreach ($itemsToRenderSeparately as & $itemsToRender) {
			$resultItems[] = $this->_renderItemsTogetherAsGroup($itemsToRender, $minify);
		}

		// process array with groups to minimize
		foreach ($itemsToRenderMinimized as & $itemsToRender) {
			$resultItems[] = $this->_renderItemsTogetherAsGroup($itemsToRender, $minify);
		}

		if (self::$fileRendering) $resultItems[] = '<!-- css group end: ' . $actualGroupName . ' -->';

		return $indentStr . implode(PHP_EOL . $indentStr, $resultItems);
	}
752912
function minifycss($file)
    {
        $minifiedFileName = $this->checkIfFileWasUpdated($file);
        if ($minifiedFileName) {
            $fileContent = file_get_contents(ROOTPATH . $file);
            $cssmin = new CSSmin();
            file_put_contents(ROOTPATH . $minifiedFileName, $cssmin->run($fileContent));
            return $minifiedFileName;
        }
        return $file;
    }
1282144
public function renderItem($item, $index)
    {
        if (is_string($item)) {
            $content = $item;
            $caption = null;
            $options = [];
        } elseif (isset($item['content'])) {
            $content = $item['content'];
            $caption = ArrayHelper::getValue($item, 'caption');
            if ($caption !== null) {
                $captionOptions = ArrayHelper::remove($item, 'captionOptions', []);
                Html::addCssClass($captionOptions, ['widget' => 'carousel-caption']);

                $caption = Html::tag('div', $caption, $captionOptions);
            }
            $options = ArrayHelper::getValue($item, 'options', []);
        } else {
            throw new InvalidConfigException('The "content" option is required.');
        }

        Html::addCssClass($options, ['widget' => 'carousel-item']);
        if ($index === 0) {
            Html::addCssClass($options, 'active');
        }

        return Html::tag('div', $content . "\n" . $caption, $options);
    }
432234
public function getThumbnail($item)
    {
        if ($item['image_display'] == 'custom' || $item['link_type'] == 'external') {
            return wp_get_attachment_image_src(
                $item['custom_image']['ID'],
                apply_filters(
                    'Modularity/index/image',
                    municipio_to_aspect_ratio('16:9', $this->thumbnailSize),
                    $this->args
                )
            );
        } elseif ($item['image_display'] == 'false') {
            return false;
        }

        return wp_get_attachment_image_src(
            get_post_thumbnail_id($item['page']->ID),
            apply_filters(
                'Modularity/index/image',
                municipio_to_aspect_ratio('16:9', $this->thumbnailSize),
                $this->args
            )
        );
    }
1052141
public function render(Item $item)
    {
        if ($item->isAuthorized()) {
            $items = [];
            foreach ($item->getItems() as $child) {
                $items[] = (new IlluminateItemRenderer($this->factory))->render($child);
            }

            $badges = [];
            foreach ($item->getBadges() as $badge) {
                $badges[] = (new IlluminateBadgeRenderer($this->factory))->render($badge);
            }

            $appends = [];
            foreach ($item->getAppends() as $append) {
                $appends[] = (new IlluminateAppendRenderer($this->factory))->render($append);
            }

            return $this->factory->make($this->view, [
                'item'    => $item,
                'items'   => $items,
                'badges'  => $badges,
                'appends' => $appends,
                'active'  => (new ActiveStateChecker())->isActive($item),
            ])->render();
        }
    }
1043016
public function renderItem($item)
    {
        if (is_string($item)) {
            return $item;
        }
        if (!isset($item['label'])) {
            throw new InvalidConfigException("The 'label' option is required.");
        }
        $encodeLabel = isset($item['encode']) ? $item['encode'] : $this->encodeLabels;
        $label = $encodeLabel ? Html::encode($item['label']) : $item['label'];
        $options = array_merge($this->itemOptions, ArrayHelper::getValue($item, 'options', []));
        $url = ArrayHelper::getValue($item, 'url', '#');
        $linkOptions = ArrayHelper::getValue($item, 'linkOptions', []);
        $iconOptions = ArrayHelper::getValue($item, 'icon', []);

        if (isset($item['active'])) {
            $active = ArrayHelper::remove($item, 'active', false);
        } else {
            $active = $this->isItemActive($item);
        }

        if ($this->activateItems && $active) {
            Html::addCssClass($options, 'active');
        }
        $icon = '';
        if ($iconOptions) {
            $icon = Html::tag('span', '', ['class' => $iconOptions]) . ' ';
        }

        return Html::a($icon . $label, $url, array_merge($linkOptions, $options));
    }
855358
public function getCssContent(string $fileName, bool $minify): string
    {
        $content = file_get_contents($fileName);

        if ($content === false) {
            throw new RuntimeException(sprintf('File could be read: %s', $fileName));
        }

        if ($minify === true) {
            $compressor = new CssMinifier();
            $content = $compressor->run($content);
        }

        return $content;
    }
599856
function minify($files,$mime=NULL,$header=TRUE,$path=NULL) {
		$fw=Base::instance();
		if (is_string($files))
			$files=$fw->split($files);
		if (!$mime)
			$mime=$this->mime($files[0]);
		preg_match('/\w+$/',$files[0],$ext);
		$cache=Cache::instance();
		$dst='';
		if (!isset($path))
			$path=$fw->UI.';./';
		foreach ($fw->split($path,FALSE) as $dir)
			foreach ($files as $file)
				if (is_file($save=$fw->fixslashes($dir.$file)) &&
					is_bool(strpos($save,'../')) &&
					preg_match('/\.(css|js)$/i',$file)) {
					if ($fw->CACHE &&
						($cached=$cache->exists(
							$hash=$fw->hash($save).'.'.$ext[0],$data)) &&
						$cached[0]>filemtime($save))
						$dst.=$data;
					else {
						$data='';
						$src=$fw->read($save);
						for ($ptr=0,$len=strlen($src);$ptr<$len;) {
							if (preg_match('/^@import\h+url'.
								'\(\h*([\'"])((?!(?:https?:)?\/\/).+?)\1\h*\)[^;]*;/',
								substr($src,$ptr),$parts)) {
								$path=dirname($file);
								$data.=$this->minify(
									($path?($path.'/'):'').$parts[2],
									$mime,$header
								);
								$ptr+=strlen($parts[0]);
								continue;
							}
							if ($ext[0]=='css'&&preg_match('/^url\(([^\'"].*?[^\'"])\)/i',
									substr($src,$ptr),$parts)) {
								$data.=$parts[0];
								$ptr+=strlen($parts[0]);
								continue;
							}
							if ($src[$ptr]=='/') {
								if ($src[$ptr+1]=='*') {
									// Multiline comment
									$str=strstr(
										substr($src,$ptr+2),'*/',TRUE);
									$ptr+=strlen($str)+4;
								}
								elseif ($src[$ptr+1]=='/') {
									// Single-line comment
									$str=strstr(
										substr($src,$ptr+2),"\n",TRUE);
									$ptr+=(empty($str))?
										strlen(substr($src,$ptr)):strlen($str)+2;
								}
								else {
									// Presume it's a regex pattern
									$regex=TRUE;
									// Backtrack and validate
									for ($ofs=$ptr;$ofs;$ofs--) {
										// Pattern should be preceded by
										// open parenthesis, colon,
										// object property or operator
										if (preg_match(
											'/(return|[(:=!+\-*&|])$/',
											substr($src,0,$ofs))) {
											$data.='/';
											$ptr++;
											while ($ptr<$len) {
												$data.=$src[$ptr];
												$ptr++;
												if ($src[$ptr-1]=='\\') {
													$data.=$src[$ptr];
													$ptr++;
												}
												elseif ($src[$ptr-1]=='/')
													break;
											}
											break;
										}
										elseif (!ctype_space($src[$ofs-1])) {
											// Not a regex pattern
											$regex=FALSE;
											break;
										}
									}
									if (!$regex) {
										// Division operator
										$data.=$src[$ptr];
										$ptr++;
									}
								}
								continue;
							}
							if (in_array($src[$ptr],['\'','"'])) {
								$match=$src[$ptr];
								$data.=$match;
								$ptr++;
								// String literal
								while ($ptr<$len) {
									$data.=$src[$ptr];
									$ptr++;
									if ($src[$ptr-1]=='\\') {
										$data.=$src[$ptr];
										$ptr++;
									}
									elseif ($src[$ptr-1]==$match)
										break;
								}
								continue;
							}
							if (ctype_space($src[$ptr])) {
								if ($ptr+1<strlen($src) &&
									preg_match('/[\w'.($ext[0]=='css'?
										'#\.%+\-*()\[\]':'\$').']{2}|'.
										'[+\-]{2}/',
										substr($data,-1).$src[$ptr+1]) ||
									($ext[0]=='css' && $ptr+2<strlen($src) &&
									preg_match('/:\w/',substr($src,$ptr+1,2))))
									$data.=' ';
								$ptr++;
								continue;
							}
							$data.=$src[$ptr];
							$ptr++;
						}
						if ($ext[0]=='css')
							$data=str_replace(';}','}',$data);
						if ($fw->CACHE)
							$cache->set($hash,$data);
						$dst.=$data;
					}
				}
		if (PHP_SAPI!='cli' && $header)
			header('Content-Type: '.$mime.'; charset='.$fw->ENCODING);
		return $dst;
	}
221946
public function getAction($item)
    {
        $options = [
            'query' => [
                'item'      => $this->getItemId($item),
                'processor' => $this->getId(),
            ],
        ];
        if ($this->isLinkDialog()) {
            $options['attributes']['class'][] = 'use-ajax';
            $options['attributes']['class'][] = 'minidialog';
            $options['query']['minidialog'] = 1;
            $options['query'] += drupal_get_destination();
        }

        return new Action(
            $this->getLinkTitle(),
            'admin/calista/action-process',
            $options,
            $this->getLinkIcon(),
            $this->getLinkPriority(),
            $this->isLinkPrimary(),
            true,
            false,
            $this->getLinkGroup()
        );
    }
641995
private function _renderItemSeparated (\stdClass $item) {
		$result = '<link rel="stylesheet"';
		if ($item->media !== 'all') $result .= ' media="' . $item->media . '"';
		if (!$item->render && self::$fileChecking) {
			$fullPath = $this->getAppRoot() . $item->path;
			if (!file_exists($fullPath)) {
				$this->log("File not found in CSS view rendering process ('$fullPath').", 'error');
			}
		}
		$result .= ' href="' . $item->href . '" />';
		return $result;
	}
1260855
private function pushStream($item) : string
    {
        $id = uniqid(__FUNCTION__ . mt_rand(), true) . '_';
        $this->streams[$id] = $item; // push

        return $id;
    }
503860
public function item($item = [], $options = [])
    {
        $html = '<li ' . ($item['active'] ? 'class="active"' : '') . '>' .
            $this->Html->link(__($item['title']), $item['url']) . '</li>';
        return $html;
    }