function makeCSS($file)
{
    if (substr($file, -8) == '.pre.css') {
        return '';
    }
    echo "FILE: " . $file . "\n";
    $csscontent = file_get_contents($file);
    if ($csscontent === FALSE) {
        echo "      not found.\n";
        return '';
    }
    $comp = '';
    for ($i = 0; $i < strlen($csscontent);) {
        $x = strpos($csscontent, '@import url(', $i);
        if ($x === FALSE) {
            $comp .= substr($csscontent, $i);
            break;
        }
        $comp .= substr($csscontent, $i, $x - $i);
        $x += 12;
        $y = strpos($csscontent, ')', $x);
        $import = substr($csscontent, $x, $y - $x);
        $comp .= makeCSS($import);
        $i = $y + 2;
        // skip );
    }
    return $comp;
}
示例#2
0
 private function displayJavaScript()
 {
     print "{$this->CRLF}{$this->CRLF}<!-- Form Functions -->{$this->CRLF}";
     print makeCSS();
     print "<script type='text/javascript'>{$this->CRLF}";
     print "/* <![CDATA[ */{$this->CRLF}";
     for ($i = 0; $i < count($this->jsFunctions); $i++) {
         print $this->jsFunctions[$i];
         print "{$this->CRLF}{$this->CRLF}";
     }
     print "/* ]]> */ {$this->CRLF}";
     print "</script>{$this->CRLF}<!-- End Of Form Functions -->{$this->CRLF}{$this->CRLF}";
 }
** wiki and forums. For details on contributing a patch for nuBuilder, please
** visit the `Project Contributions' forum.
**
**   Website:  http://www.nubuilder.com
**   Wiki:     http://wiki.nubuilder.com
**   Forums:   http://forums.nubuilder.com
*/
session_start();
ignore_user_abort(true);
set_time_limit(0);
$dir = $_GET['dir'];
$iid = $_GET['iid'];
//-- recordID (zzsys_image_id)
include "../{$dir}/database.php";
include 'common.php';
print makeCSS();
print "<html><head><title>Upload</title></head>\n";
if ($_POST['filename'] == '') {
    $filename = uniqid('1');
    print "<body>";
    print "<form name='upload' enctype='multipart/form-data' method='POST' action = 'imageuploader.php?dir={$dir}&iid={$iid}'>\n";
    print "<table class='upload'><tr align='center'><td class='nuBorder' align='center'><input type='hidden' name='MAX_FILE_SIZE' value='4500000' />\n";
    print "Choose an image to upload: ";
    print "<input type='file'   name='uploadedfile'  value=''/>\n";
    print "<input type='hidden' name='filename'      value='{$filename}'/> \n <br/> \n";
    print "<input type='submit'                      value='Upload File' />\n";
    print "</td></tr></table></form>\n";
} else {
    $filename = $_FILES['uploadedfile']['tmp_name'];
    $handle = fopen($filename, "rb");
    $contents = fread($handle, filesize($filename));