Miva - Concatenate CSS Files through Navigation Set
<mvt:if expr="ISNULL l.settings:readytheme:navigationitems">
<mvt:exit/>
</mvt:if>
<mvt:comment><!-- Minified Output File Variables --></mvt:comment>
<mvt:if expr="g.minify_css">
<mvt:assign name="l.settings:minify:css:enabled" value="1" />
</mvt:if>
<mvt:assign name="l.settings:minify:css:output_file:directory" value="'/mm5/' $ g.theme_path $ '/css/'"/>
<mvt:assign name="l.settings:minify:css:output_file:name" value="'miva-styles.min.css'"/>
<mvt:assign name="l.settings:minify:css:output_file:path" value="l.settings:minify:css:output_file:directory $ l.settings:minify:css:output_file:name"/>
<mvt:assign name="l.settings:minify:css:output_file:contents" value="''" />
<mvt:comment><!-- Ouput Individual Style Files --></mvt:comment>
<mvt:if expr="NOT l.settings:minify:css:enabled">
<mvt:foreach iterator="css_file" array="readytheme:navigationitems">
<mvt:assign name="l.settings:css_file:link_dest" value="l.settings:css_file:link_dest $ '?v=' $ stime(l.settings:css_file:link_dest)" />
<link rel="stylesheet" href="//&mvte:global:domain:name;&mvt:css_file:link_dest;">
</mvt:foreach>
<mvt:exit/>
</mvt:if>
<mvt:comment><!-- Concatinate Styles --></mvt:comment>
<mvt:foreach iterator="css_file" array="readytheme:navigationitems">
<mvt:assign name="l.settings:css_file:length" value="file_read(l.settings:css_file:link_dest, 'script', l.settings:css_file:contents)"/>
<mvt:assign name="l.settings:minify:css:output_file:contents" value="l.settings:minify:css:output_file:contents $ g.newline $ l.settings:css_file:contents" />
</mvt:foreach>
<mvt:comment><!-- Determine time of last modified file --></mvt:comment>
<mvt:assign name="l.settings:minify:css:most_recent_stime" value="0" />
<mvt:foreach iterator="css_file" array="readytheme:navigationitems">
<mvt:comment>
<!--
Miva creates new files and sets their File Modified time in GMT.
Therefore, if your FTP program sets the File Modified time in your local time,
then you need to update this accordingly
-->
</mvt:comment>
<mvt:assign name="l.settings:minify:timezone_offset" value="60 * 60 * 8" />
<mvt:assign name="l.settings:minify:css:current_stime" value="stime(l.settings:css_file:link_dest) + l.settings:minify:timezone_offset" />
<mvt:assign name="l.settings:css_file:link_dest" value="l.settings:css_file:link_dest $ '?v=' $ l.settings:minify:css:current_stime" />
<mvt:if expr="l.settings:minify:css:current_stime GT l.settings:minify:css:most_recent_stime">
<mvt:assign name="l.settings:minify:css:most_recent_stime" value="l.settings:minify:css:current_stime" />
</mvt:if>
</mvt:foreach>
<mvt:assign name="l.settings:minify:css:output_file:stime" value="stime(l.settings:minify:css:output_file:path)" />
<mvt:comment><!-- Minified Output File CRUD --></mvt:comment>
<mvt:if expr="l.settings:minify:css:most_recent_stime GT l.settings:minify:css:output_file:stime">
<mvt:assign name="l.settings:minify:css:output_file:stime" value="l.settings:minify:css:most_recent_stime" />
<mvt:assign name="l.settings:minify:css:output_file:exists" value="sexists(l.settings:minify:css:output_file:path)"/>
<mvt:if expr="l.settings:minify:css:output_file:exists EQ 1">
<mvt:assign name="l.settings:minify:css:output_file:deleted" value="sdelete(l.settings:minify:css:output_file:path)"/>
<mvt:if expr="l.settings:minify:css:output_file:deleted EQ 1">
<mvt:assign name="l.settings:minify:css:file_created" value="file_create(l.settings:minify:css:output_file:path, 'script', l.settings:minify:css:output_file:contents)"/>
</mvt:if>
<mvt:else>
<mvt:assign name="l.settings:minify:css:file_created" value="file_create(l.settings:minify:css:output_file:path, 'script', l.settings:minify:css:output_file:contents)"/>
</mvt:if>
</mvt:if>
<link rel="stylesheet" href="//&mvte:global:domain:name;&mvt:minify:css:output_file:path;?v=&mvt:minify:css:output_file:stime;">