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";
 }
$where = CONTENTDIR . 'static';
putenv('HOME=' . CONTENTDIR);
`cd {$where} && /usr/bin/svn update`;
// make troubleshooting page
$source = CONTENTDIR . "static/";
#$path = BASEDIR;
$page = new Page("Overview", "Overview");
$page->content(file_get_contents($source . "overview.html"));
writeFile('overview/index.html', $page->out());
#copydirr($source.'/images', $path.'/images');
$page = new Page("Foundation", "Foundation");
$page->content(file_get_contents($source . "foundation.html"));
writeFile('foundation/index.html', $page->out());
$page = new Page("People", "People");
$page->content(file_get_contents($source . "people.html"));
writeFile('people/index.html', $page->out());
$benchmark_end = microtime_float();
$execution_time = round($benchmark_end - $benchmark_start, 4);
?>

<h2>About page generation Successful</h2>
<p>Generated files in <?php 
echo $execution_time;
?>
 seconds.</p>
<!--<p>Page put here: <?php 
echo $source . "faq.html";
?>
</p>-->
<!--<p>Page put here: <?php 
echo $path . 'faq.html';
Example #3
0
<?php

require_once '../config.php';
require_once 'lib/Translation.class.php';
require_once './contributions.php';
$benchmark_start = microtime_float();
$tools_dir = 'reference/tools';
$index = CONTENTDIR . "api_en/tools/index.html";
$page = new Page('Tools', 'Tools', 'Tools');
$page->content(file_get_contents($index));
//make_necessary_directories(BASEDIR.$tools_dir.'/images/include.php');
writeFile($tools_dir . '/index.html', $page->out());
if (!is_dir(BASEDIR . $tools_dir . '/images')) {
    mkdir(BASEDIR . $tools_dir . '/images', 0757);
}
copydirr(CONTENTDIR . "api_en/tools/images", BASEDIR . $tools_dir . '/images');
// copy over the files for the contributed libraries
copy(CONTENTDIR . "static/tools.html", BASEDIR . $tools_dir . '/tools.html');
$benchmark_end = microtime_float();
$execution_time = round($benchmark_end - $benchmark_start, 4);
?>

<h2>Tool Generation Successful</h2>
<p>Generated files in <?php 
echo $execution_time;
?>
 seconds.</p>
Example #4
0
//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";
foreach ($catTopics 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>";
$page->content($html);
// Change 2 May 2013
//writeFile('learning/'.strtolower($subdir).'/index.html', $page->out());
writeFile('examples/index.html', $page->out());
$benchmark_end = microtime_float();
$execution_time = round($benchmark_end - $benchmark_start, 4);
?>

<h2>Examples pages generation Successful</h2>
<p>Generated <?php 
echo $count + 1;
?>
 files in <?php 
echo $execution_time;
?>
 seconds.</p>
<h2>Updated <?php 
echo $where;
?>
<?php

require_once '../config.php';
require 'lib/Translation.class.php';
$benchmark_start = microtime_float();
// make overview page
$source = CONTENTDIR . "api_en/environment/";
$path = REFERENCEDIR . "/environment/";
make_necessary_directories($path . "images/file");
$page = new Page("Environment (IDE)", "Environment", "Environment", '../../');
$page->content(file_get_contents($source . "index.html"));
$page->language("en");
writeFile('reference/environment/index.html', $page->out());
copydirr($source . '/images', $path . '/images');
$benchmark_end = microtime_float();
$execution_time = round($benchmark_end - $benchmark_start, 4);
?>

<h2>Environment page generation Successful</h2>
<p>Generated files in <?php 
echo $execution_time;
?>
 seconds.</p>
Example #6
0
    $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')) {
    }
}
function curated_nav($num, $current)
{
    $html = '<p class="exhibition-nav">';
    for ($i = $num; $i > 0; $i--) {
        if ($i == $num) {
            if ($num - $i + 1 == $current) {
                $links[] = sprintf("Page: %d", $i);
            } else {
                $links[] = sprintf("Page: <a href=\"./\">%d</a>", $i);
Example #7
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;
}
require_once './contributions.php';
copy(CONTENTDIR . "static/libraries.html", $lib_dir . 'libraries.html');
// For each Library
foreach ($libraries as $lib) {
    $source = "api_en/LIB_{$lib}";
    $destination = "libraries/{$lib}";
    make_necessary_directories(REFERENCEDIR . $destination . '/images/include');
    // template and copy index
    $index = CONTENTDIR . $source . '/index.html';
    if ($lib == 'pdf' || $lib == 'dxf') {
        //$page = new Page(strtoupper($lib) . ' \\ Libraries', 'Libraries', 'Library-index');
        $page = new Page(strtoupper($lib) . ' \\ Libraries', 'Libraries');
    } else {
        //$page = new Page(ucfirst($lib) . ' \\ Libraries', 'Library-index');
        $page = new Page(ucfirst($lib) . ' \\ Libraries', 'Libraries');
    }
    //$page->language("en");
    $page->content(file_get_contents($index));
    writeFile('reference/' . $destination . '/index.html', $page->out());
    // copy images directory
    //copydirr(CONTENTDIR.$source.'/images', REFERENCEDIR.$destination.'/images');
}
$benchmark_end = microtime_float();
$execution_time = round($benchmark_end - $benchmark_start, 4);
?>

<h2>Library Generation Successful</h2>
<p>Generated files in <?php 
echo $execution_time;
?>
 seconds.</p>
$page->content(file_get_contents($source . "index.html"));
writeFile('tutorials/index.html', $page->out());
// Start making the individual tutorial pages
if (!($xml = simplexml_load_file($source . 'tutorials.xml'))) {
    echo 'XML file missing';
} else {
    foreach ($xml as $tutorial) {
        $title = $tutorial->title;
        $directory = $tutorial->directory;
        $imgs = $tutorial->imgs;
        $code = $tutorial->code;
        echo 'About to generate tutorial ' . $title . ' in directory ' . $directory . ', imgs dir = ' . $imgs . ', code dir = ' . $code . '<br \\>';
        echo 'Copying ' . $source . $directory . '/index.html to ' . 'tutorials/' . $directory . '/index.html<br \\>';
        $page = new Page($title, "Tutorials", "Tutorials", "../../");
        $page->content(file_get_contents($source . $directory . '/index.html'));
        writeFile('tutorials/' . $directory . '/index.html', $page->out());
        if ($imgs == 'true') {
            $newpath = $path . 'tutorials/' . $directory . '/imgs';
            if (!is_dir($newpath)) {
                mkdir($newpath, 0757);
            }
            if (is_dir($newpath)) {
                copydirr($source . $directory . '/imgs', $newpath, null, 0757, true);
            }
        }
        if ($code == 'true') {
            $newpath = $path . 'tutorials/' . $directory . '/code';
            if (!is_dir($newpath)) {
                mkdir($newpath, 0757);
            }
            if (is_dir($newpath)) {
writeFile($dest . "mission/index.html", $page->out());
$page = new Page("Projects", "Projects");
$page->content(file_get_contents($source . "projects.html"));
writeFile($dest . "projects/index.html", $page->out());
$page = new Page("People", "People2");
$page->content(file_get_contents($source . "people.html"));
writeFile($dest . "people/index.html", $page->out());
$page = new Page("Fellowships", "Fellowships");
$page->content(file_get_contents($source . "fellowships.html"));
writeFile($dest . "fellowships/index.html", $page->out());
$page = new Page("Reports", "Reports");
$page->content(file_get_contents($source . "reports.html"));
writeFile($dest . "reports/index.html", $page->out());
$page = new Page("Patrons", "Patrons");
$page->content(file_get_contents($source . "patrons.html"));
writeFile($dest . "patrons/index.html", $page->out());
//$page = new Page("Donate", "Donate");
//$page->content(file_get_contents($source."donate.html"));
//writeFile($dest."donate/index.html", $page->out());
// After the pages are created, copy them to the Foundation subdomain
//cp ../../img/processing-web.png ../../distribution/img/
echo "Starting to copy the site...";
`cd {$path} && cp -r foundation-site/* /var/www/foundation/`;
echo "done!";
echo "Starting to copy the CSS...";
`cd {$path} && rm -rf /var/www/foundation/css/ && mkdir /var/www/foundation/css/ && cp -r css/* /var/www/foundation/css/`;
echo "done!";
echo "Starting to copy the JavaScript...";
`cd {$path} && rm -rf /var/www/foundation/javascript/ && mkdir /var/www/foundation/javascript/ && cp -r javascript/* /var/www/foundation/javascript/`;
echo "done!";
echo "Starting to copy the images...";
writeFile('learning/curves/index.html', $page->out());
if (!is_dir($path . 'learning/curves/imgs')) {
    mkdir($path . 'learning/curves/imgs', '0757');
}
if (is_dir($path . 'learning/curves/imgs')) {
    copydirr($source . 'curves/imgs', $path . 'learning/curves/imgs', null, 0757, true);
}
if (!is_dir($path . 'learning/curves/code')) {
    mkdir($path . 'learning/curves/code', '0757');
}
if (is_dir($path . 'learning/curves/code')) {
    copydirr($source . 'curves/code', $path . 'learning/curves/code', true, 0757, true);
}
$page = new Page("Anatomy", "Tutorials");
$page->content(file_get_contents($source . "anatomy/index.html"));
writeFile('learning/anatomy/index.html', $page->out());
if (!is_dir($path . 'learning/anatomy/imgs')) {
    mkdir($path . 'learning/anatomy/imgs', '0757');
}
if (is_dir($path . 'learning/anatomy/imgs')) {
    copydirr($source . 'anatomy/imgs', $path . 'learning/anatomy/imgs', null, 0757, true);
}
if (!is_dir($path . 'learning/anatomy/code')) {
    mkdir($path . 'learning/anatomy/code', '0757');
}
if (is_dir($path . 'learning/anatomy/code')) {
    copydirr($source . 'anatomy/code', $path . 'learning/anatomy/code', true, 0757, true);
}
$benchmark_end = microtime_float();
$execution_time = round($benchmark_end - $benchmark_start, 4);
?>
$page->content(file_get_contents($source . "books.html"));
writeFile('books/index.html', $page->out());
// Copy over the errata file for Processing: A Programming Handbook...
copy($source . 'processing-errata.txt', $path . 'books/processing-errata.txt');
// Copy over the media.zip file for Getting Started with Processing...
copy($source . 'media.zip', $path . 'books/media.zip');
$page = new Page("Copyright", "Copyright");
$page->content(file_get_contents($source . "copyright.html"));
writeFile('copyright.html', $page->out());
// Copy over the images for the shop index
if (!is_dir($path . 'shop')) {
    mkdir($path . 'shop', 0757);
}
if (!is_dir($path . 'shop/imgs')) {
    mkdir($path . 'shop/imgs', 0757);
}
if (is_dir($path . 'shop/imgs')) {
    copydirr($source . 'shop/imgs', $path . 'shop/imgs', null, 0757, false);
}
$page = new Page("Shop", "Shop");
$page->content(file_get_contents($source . 'shop/' . "index.html"));
writeFile('shop/index.html', $page->out());
$benchmark_end = microtime_float();
$execution_time = round($benchmark_end - $benchmark_start, 4);
?>

<h2>Static page generation Successful</h2>
<p>Generated files in <?php 
echo $execution_time;
?>
 seconds.</p>
Example #13
0
<?php

require_once '../config.php';
// arguments
$title = isset($_POST['title']) ? $_POST['title'] : false;
$section = isset($_POST['section']) ? $_POST['section'] : false;
$page = new Page($title, $section);
echo '<pre>';
echo htmlspecialchars($page->out());