function output_file(&$menu_array, $rel_path = '/')
 {
     $page = new Page($this->name . ' \\ Examples', $this->sub, "", "../");
     $page->subtemplate('template.example.html');
     $page->content($this->display());
     $page->set('examples_nav', $this->back_to_list());
     //writeFile("learning/".strtolower($this->sub)."/".strtolower($this->name).".html", $page->out());
     // Move 2 May 2013
     writeFile("examples/" . strtolower($this->name) . ".html", $page->out());
     $this->copy_media();
     echo $this->name . '<br />';
     #echo "learning/examples/".strtolower($this->sub)."/".strtolower($this->name).".html\n";
 }
Example #2
0
        while ($fp = readdir($dp)) {
            if (substr($fp, 0, 1) != '.') {
                $ex = new Example($fp, "Topics/" . $cat, $subdir);
                if (!$local) {
                    $ex->output_file($catTopics);
                } else {
                    $ex->output_file($catTopics, "../../");
                }
                $count++;
            }
        }
    }
}
//Create Examples page
$page = new Page('Examples', 'Examples', "", "../../");
$page->subtemplate('template.examples-main.html');
//Create Basics html
$html = "<b>Basic Examples</b>. <i>Programs about form, data, images, color, typography, and more...</i><br /><br /><br />";
$html .= "<ul class=\"examples\">\n";
foreach ($catBasics as $cat => $array) {
    $html .= "<li><ul><li><b>{$cat}</b></li><br />";
    foreach ($array as $file => $name) {
        $thisfile = strtolower($file);
        $html .= "\t<li><a href=\"{$thisfile}\">{$name}</a></li>\n";
    }
    $html .= '</ul></li>';
}
$html .= "</ul>";
//Create Topics html
$html .= "<b>Topic Examples</b>. <i>Programs about to animation, interaction, motion, simulation, and more...</i><br /><br /><br />";
$html .= "<ul class=\"examples\">\n";
Example #3
0
<?php

require_once '../config.php';
DEFINE('COVER', true);
//require_once('updates.php');
//if (!defined('SUBMIT')) {
//    require_once('happenings.php');
//    require_once('courses.php');
//}
require_once 'exhibition.php';
$benchmark_start = microtime_float();
$page = new Page('', 'Cover');
$page->subtemplate('template.cover.html');
//$page->set('updates', get_updates(24));
//$page->set('happenings', get_happenings(5));
//$page->set('courses', get_courses_short(5));
$page->set('exhibition', get_curated_short());
writeFile("index.php", $page->out());
$benchmark_end = microtime_float();
$execution_time = round($benchmark_end - $benchmark_start, 4);
if (!defined('SUBMIT')) {
    echo <<<EOC
<h2>Index.php Generation Successful</h2> <p>Generator took {$execution_time} seconds to execute</p>
EOC;
}
Example #4
0
        $i++;
    }
    return $curated;
}
if (!defined('COVER')) {
    $benchmark_start = microtime_float();
    // get xml
    $curated = curated_xml('all');
    // count number of items
    $ctotal = count($curated);
    // count number of pages needed
    $cnum_pages = ceil($ctotal / CURATED_PER_PAGE);
    // create and write the other pages
    for ($i = 0; $i <= $cnum_pages; $i++) {
        $page = new Page('Exhibition Archives', 'Exhibition');
        $page->subtemplate('template.curated.archive.html');
        $page->set('curated_nav', curated_nav($cnum_pages, $i + 1));
        $page->set('exhibition', get_curated_three($curated, CURATED_PER_PAGE * $i, CURATED_PER_PAGE));
        //$pagename = sprintf("curated_page_%d.html", $i+1);
        if ($i == 0) {
            $pagename = sprintf("index.html");
        } else {
            $pagename = sprintf("curated_page_%d.html", $cnum_pages - $i);
        }
        writeFile("exhibition/" . $pagename, $page->out());
    }
    $benchmark_end = microtime_float();
    $execution_time = round($benchmark_end - $benchmark_start, 4);
    if (!defined('SUBMIT')) {
    }
}
        while ($fp = readdir($dp)) {
            if (substr($fp, 0, 1) != '.') {
                $ex = new Example($fp, "Topics/" . $cat, $subdir);
                if (!$local) {
                    $ex->output_file($catTopics);
                } else {
                    $ex->output_file($catTopics, "../../");
                }
                $count++;
            }
        }
    }
}
//Create Examples page
$page = new Page('Examples', 'Examples', "", "../../");
$page->subtemplate('template.examples.html');
//Create Basics html
$html = "<b>Basic Examples</b>. <i>Programs about form, data, images, color, typography, and more...</i><br /><br /><br />";
$html .= "<ul class=\"examples\">\n";
foreach ($catBasics as $cat => $array) {
    $html .= "<li><ul><li><b>{$cat}</b></li><br />";
    foreach ($array as $file => $name) {
        $thisfile = strtolower($file);
        $html .= "\t<li><a href=\"{$thisfile}\">{$name}</a></li>\n";
    }
    $html .= '</ul></li>';
}
$html .= "</ul>";
//Create Topics html
$html .= "<b>Topic Examples</b>. <i>Programs about to animation, interaction, motion, simulation, and more...</i><br /><br /><br />";
$html .= "<ul class=\"examples\">\n";