Exemple #1
0
function removeYamlLineNumbers(&$yaml)
{
    foreach ($yaml as $key => $value) {
        if ($key == '__yaml_line') {
            unset($yaml[$key]);
        } elseif (is_array($value)) {
            removeYamlLineNumbers($yaml[$key]);
        }
    }
}
Exemple #2
0
 function mainProcess()
 {
     $errors = array();
     # Make x6main scrollable
     jqDocReady("\$('.x6body').css('overflow-y','scroll')");
     # Define the directories
     $dirx6 = fsDirTop() . 'templates/x6/';
     $dirx6src = $dirx6 . 'skinsources/';
     $dirapp = fsDirTop() . 'application/';
     # Now scan for other skins and process those
     $dirs = array($dirx6src, $dirapp);
     foreach ($dirs as $dir) {
         $files = scandir($dir);
         foreach ($files as $file) {
             echo "<br/>{$dir}{$file};";
             # These lines filter out entries that are not skins
             $apieces = explode('.', $file);
             if (count($apieces) != 3) {
                 continue;
             }
             if ($apieces[0] != 'x6skin') {
                 continue;
             }
             if ($apieces[2] != 'yaml') {
                 continue;
             }
             # Load the file and process it.  We assume the
             # middle piece of the file is the name of the
             # template.
             list($yaml, $errors) = loadYaml($dir . $file);
             if (count($errors) > 0) {
                 echo "<h2>Errors encountered in skin file</h2>";
                 echo "<p>File: {$dir}{$file}</p>";
                 hprint_r($errors);
                 return;
             }
             removeYamlLineNumbers($yaml);
             $this->writeCSS($apieces[1], $yaml['defines'], $yaml['css']);
         }
     }
     # Finally, write the list of skins out to apppub
     file_put_contents(fsDirTop() . 'templates/x6/skinsphp/x6skins.ser.txt', serialize($this->skinFiles));
 }