Ejemplo n.º 1
0
}
function compileAll($compressedFiles, $app, $nameInclude, $compile, $delete)
{
    if ($nameInclude == "ALL") {
        foreach ($compressedFiles->files as $key => $fileNameInclude) {
            compile($compressedFiles, $app, $key, $compile, $delete);
        }
    } else {
        compile($compressedFiles, $app, $nameInclude, $compile, $delete);
    }
}
if (isset($_GET['detail'])) {
    $detail = $_GET['who'];
}
if (isset($_GET['delete'])) {
    //die("dom");
    compileAll($compressedFiles, $app, $_GET['who'], false, true);
}
if (isset($_GET['compile'])) {
    compileAll($compressedFiles, $app, $_GET['who'], true, true);
}
echo "Applications available : <a href='?app=love' title='click to get details'>love</a>\n        - <a href='?app=review' title='click to get details'>review</a>\n        <br/>\n";
echo "Current Application : " . $app . "\n         - <a href='?app=" . $app . "&compile=y&who=ALL' >compile</a>\n         - <a href='?app=" . $app . "&delete=y&who=ALL' >delete</a>\n        <br/>\n";
foreach ($compressedFiles->files as $key => $fileNameInclude) {
    echo "<a href='?app=" . $app . "&detail=y&who=" . $key . "' title='click to get details'>" . $key . "</a>\n             - <a href='?app=" . $app . "&compile=y&who=" . $key . "' >compile</a>\n             - <a href='?app=" . $app . "&delete=y&who=" . $key . "' >delete</a>\n            <br/>\n";
    if (isset($detail) && $detail == $key) {
        foreach ($fileNameInclude as $fileName) {
            echo "...." . $fileName . " <br/>\n";
        }
    }
}
Ejemplo n.º 2
0
    $options['debug'] = 1;
    $options['fatalError'] = HTML_TEMPLATE_FLEXY_ERROR_DIE;
}
//compileAll($options,$a);
echo "PASS ONE: Bail out when globals / privates etc. found\n";
// test allowPHP
$options['allowPHP'] = true;
compileAll($options, $a);
echo "PASS TWO: Compile when globals / privates etc. found\n";
$options['compileDir'] = dirname(__FILE__) . '/results2';
// test GLOBALS, privates etc.
$options['globals'] = true;
$options['privates'] = true;
$options['globalfunctions'] = true;
$options['fatalError'] = HTML_TEMPLATE_FLEXY_ERROR_DIE;
compileAll($options, $a);
if ($a) {
    exit;
}
/* ----- forms examples ---------*/
$x = new HTML_Template_Flexy($options);
$x->compile('forms.html');
$tmp = new StdClass();
$tmp->xyz = "testing 123";
$elements['List'] = new HTML_Template_Flexy_Element('select');
$elements['List']->setValue(2001);
$elements['picture'] = new HTML_Template_Flexy_Element('img', "width='400' height='400' src='any.gif'");
$elements['xhtmllisttest'] = new HTML_Template_Flexy_Element();
$elements['xhtmllisttest']->setOptions(array('0' => '--select something--', 'bbb' => 'somevalue'));
$elements['xhtmllisttest']->setValue('bbb');
// write the data to a file.