Beispiel #1
0
function wikiToHtml(&$session, $wiki_text)
{
    $lines = explode("\n", $wiki_text);
    $session->trace(TC_Util1, 'wikiToHtml: ' . (0 + count($lines)) . ' Zeilen' . "({$lines['0']})");
    $status = new LayoutStatus($session);
    $last_linetype = '';
    foreach ($lines as $ii => $line) {
        $start_code = false;
        if (!$status->fPreformatted && ($line_trimmed = trim($line)) == '') {
            $last_linetype = '';
            $status->changeOfLineType($last_linetype, '');
        } else {
            $linetype = $status->fPreformatted ? '[' : substr($line, 0, 1);
            switch ($linetype) {
                case '-':
                    $count = countRepeats($line, '-');
                    if ($count < 4) {
                        $linetype = 'x';
                    }
                    break;
                case '[':
                    if (strpos($line, 'code]') == 1) {
                        $start_code = true;
                    } elseif (strpos($line, '/code]') == 1) {
                        $status->finishCode();
                        $last_linetype = 'x';
                        $line = $line_trimmed = substr($line, 7);
                        $session->trace(TC_Util2, 'wikiToHtml: /code-Restzeile: ' . $line);
                    } else {
                        $linetype = 'x';
                    }
                    break;
                case '!':
                case ';':
                case '*':
                case '#':
                case '|':
                    break;
                default:
                    $linetype = 'x';
                    break;
            }
            $last_linetype = $status->testChangeOfLineType($last_linetype, $linetype);
            switch ($linetype) {
                case '!':
                    if (strpos($line, '|') != 1) {
                        writeHeader($line, $status);
                    } else {
                        writeTableHeader($line, $status);
                        $last_linetype = '|';
                    }
                    break;
                case '[':
                    if ($start_code) {
                        $status->startCode();
                    }
                    $line = substr($line_trimmed, 6);
                    if (!empty($line)) {
                        writeLine($line, $status);
                    }
                    break;
                case ';':
                    writeIndent($line, $status);
                    break;
                case '*':
                    writeUList($line, $status);
                    break;
                case '#':
                    writeOrderedList($line, $status);
                    break;
                case '|':
                    writeTable($line, $status);
                    break;
                case '-':
                    guiLine($status->fSession, $count - 3);
                    break;
                default:
                    writeLine($line, $status);
                    break;
            }
        }
    }
    // foreach
    if ($status->fPreformatted) {
        $session->trace(TC_Warning, PREFIX_Warning . '[/code] fehlt');
    }
    $session->trace(TC_Util1, 'wikiToHtml-Ende');
}
    exit;
}
if (isset($_REQUEST["sortBy"])) {
    $sortBy = $_REQUEST["sortBy"];
} else {
    $sortBy = "";
}
if (isset($_REQUEST["sortDir"])) {
    $sortDir = $_REQUEST["sortDir"];
} else {
    $sortDir = "ASC";
}
$db = login();
$selfUrl = "https://" . $_SERVER["HTTP_HOST"] . $_SERVER["PHP_SELF"];
$msg = "";
writeHeader("Building session- build new session", "secure", $msg);
wizardHeader(2);
//echo "<p><font size=+1><a href=\"selectExistingSession.php?table=sessions&returnURL=".urlencode($selfUrl)."&returnIdName=sessionId\">Select existing session</a>\n";
//echo "&nbsp;&nbsp; or add a new session:\n</font></p>";
$idStr = '<a href="buildSession3.php?studyId=' . $studyId . '&sessionId=<ID>"><ID></a>';
$sortbyStr = '<a href="' . selfURL() . '?table=' . $table . '&studyId=' . $studyId . '&sortDir=<DIR2>&sortBy=<ID>"><ID><DIR></a>';
if ($sortBy == "") {
    // Default sort
    $sortBy = 'id';
}
$displaySummary = 1;
echo "<p><font size=+1><b>Select from the following existing sessions:</b></font></p>";
//tableText = displayTable($db, $table, $idStr, "WHERE primaryStudyID=".$studyId, 0, $displaySummary, "", $studyId, $subjectId, $sessionId, "", "", "", "");
$tableText = displayTable($db, $table, $idStr, "WHERE primaryStudyID=" . $studyId, 0, $displaySummary, "", $studyId, 0, $sessionId, $sortbyStr, $sortBy, $sortDir, "");
if ($tableText != "") {
    echo $tableText;
login();
if (!isset($_REQUEST["scanner"])) {
    $scanner = $scannerList[0];
} else {
    $scanner = $_REQUEST["scanner"];
}
$src = $GLOBALS["conf"]->rawDataSrc[$scanner];
$cacheDir = $GLOBALS["conf"]->protocolCacheDir . "_" . $scanner;
$cacheTime = date("l M j, Y \\a\t g:ia T", filemtime($cacheDir));
if (isset($_REQUEST["scanner"]) && isset($_REQUEST["refreshCache"])) {
    getAllProtocols($src, $cacheDir);
    // We do a redirect so that the 'refreshCache' flag won't remain in the url.
    header("Location: " . $_SERVER["PHP_SELF"] . "?scanner=" . urlencode($_REQUEST["scanner"]));
    exit;
}
writeHeader("Protocol Wizard", "secure");
foreach ($GLOBALS["conf"]->rawDataSrc as $key => $val) {
    if (isset($val->protocolDir)) {
        $scannerList[] = $key;
    }
}
if (isset($_REQUEST["add"]) && isset($_REQUEST["scanner"]) && isset($_REQUEST["cat"]) && isset($_REQUEST["protocol"])) {
    $protocol = getCachedProtocol($cacheDir, $_REQUEST["cat"], $_REQUEST["protocol"]);
    echo "<h1>Select a series from " . $protocol['name'] . ":</h1>\n";
    echo "<ul>\n";
    foreach ($protocol['series'] as $sNum => $s) {
        echo "<li>Series {$sNum} (" . $s['sedesc'] . "):";
        echo "<form method=POST name=\"protocolWizard_form\" action=\"editTable.php\">\n";
        echo "<input type=hidden name=table value=protocols>\n";
        echo "<input type=hidden name=d[protocols][protocolName] value=\"" . $protocol['name'] . "\">\n";
        foreach ($s as $name => $value) {
    } else {
        list($success, $m) = deleteRecord($db, $table, $deleteId);
        if (strlen($msg > 0)) {
            $msg .= " / " . $m;
        } else {
            $msg = $m;
        }
        // We do a redirect so that the 'deleteId' won't remain in the url.
        // *** RFD: There's got to be a better way!
        header("Location: " . $_SERVER["PHP_SELF"] . "?table=" . $table . "&msg=" . urlencode($msg));
        exit;
    }
}
if (isset($_REQUEST["updateId"])) {
    $d[$table]['id'] = $_REQUEST["updateId"];
} else {
    $d[$table]['id'] = 0;
}
// Here we actually start writing the HTML.
writeHeader("Edit {$table}", "secure", $msg);
wizardHeader(1);
if ($d[$table]['id'] != 0) {
    echo "<h1>Update entry in table '{$table}':</h1>\n";
} else {
    echo "<p><font size=+1><b>Add entry to table '{$table}':</b></font></p>\n";
}
$selfUrl = "https://" . $_SERVER["HTTP_HOST"] . $_SERVER["PHP_SELF"];
// The following function requires the non-trivial code above to process the
// data, so I'm not sure that it makes sense to keep it in a separate function.
echo buildFormFromTable($db, $table, $prevTable, $selfUrl, $d, $extras, $defaultDataId);
writeFooter('basic');
<?php

require_once "include.php";
//init_session();
$db = login();
writeHeader("Home", "basic");
?>
<h1>mrData advanced index</h1>
<ul>
<li><a href="editTable.php?table=studies">Edit studies</a></li>
<li><a href="editTable.php?table=rois">Edit ROIs</a></li>
<li><a href="editTable.php?table=subjects">Edit subjects</a></li>
<li><a href="editTable.php?table=users">Edit users</a></li>
<li><a href="editTable.php?table=sessions">Edit sessions</a></li>
<li><a href="editTable.php?table=scans">Edit scans</a></li>
<li><a href="editTable.php?table=stimuli">Edit stimuli</a></li>
<li><a href="editTable.php?table=protocols">Edit protocols</a></li>
<li><a href="editTable.php?table=dataFiles">Edit datafiles</a></li>
<li><a href="editTable.php?table=analyses">Edit analyses</a></li>
<hr>
<li><a href="displayTable.php?table=studies">Show studies</a></li>
<li><a href="displayTable.php?table=rois">Show ROIs</a></li>
<li><a href="displayTable.php?table=subjects">Show subjects</a></li>
<li><a href="displayTable.php?table=users">Show users</a></li>
<li><a href="displayTable.php?table=scans">Show scans</a></li>
<li><a href="displayTable.php?table=protocols">Show scan protocols</a></li>
<li><a href="displayTable.php?table=sessions">Show sessions</a></li>
<li><a href="displayTable.php?table=dataFiles">Show data files</a></li>
<li><a href="displayTable.php?table=analyses">Show analyses</a></li>
<hr>
<li><a href="showPfiles.php?scanner=lucas15t">View Lucas 1.5T P-files</a></li>
     db_free_result($result);
 }
 if (!empty($tables)) {
     $folder = SERVERPATH . "/" . BACKUPFOLDER;
     $filename = $folder . '/backup-' . date('Y_m_d-H_i_s') . '.zdb';
     if (!is_dir($folder)) {
         mkdir($folder, FOLDER_MOD);
     }
     @chmod($folder, FOLDER_MOD);
     $writeresult = $handle = @fopen($filename, 'w');
     if ($handle === false) {
         $msg = sprintf(gettext('Failed to open %s for writing.'), $filename);
         echo $msg;
     } else {
         $writeresult = writeheader('file_version', 1);
         $writeresult = $writeresult && writeHeader('compression_handler', $compression_handler);
         if ($writeresult === false) {
             $msg = gettext('failed writing to backup!');
         }
         $counter = 0;
         $writeresult = true;
         foreach ($tables as $row) {
             $table = array_shift($row);
             $unprefixed_table = substr($table, strlen($prefix));
             $sql = 'SELECT * from `' . $table . '`';
             $result = query($sql);
             if ($result) {
                 while ($tablerow = db_fetch_assoc($result)) {
                     extendExecution();
                     $storestring = serialize($tablerow);
                     $storestring = compressRow($storestring, $compression_level);
 */
require_once "include.php";
$db = login();
$msg = "Connected as user " . $_SESSION['username'];
if (isset($_REQUEST["tbl"])) {
    $tbl = $_REQUEST["tbl"];
} else {
    $tbl = "studies";
}
if (isset($_REQUEST["fld"])) {
    $fld = $_REQUEST["fld"];
} else {
    $fld = "all fields";
}
$selfURL = "https://" . $_SERVER["HTTP_HOST"] . $_SERVER["PHP_SELF"];
writeHeader("Search tool", "secure", $msg);
echo "<h1>Search tool:</h1>\n";
/*
// Get searchable (i.e. text) fields in mrData db
$mrDataTables = array('people', 'scans', 'sessions', 'studies');
//$textTypes = array('');
$notgoodarray = array('species', 'scannerCertified', )
foreach ($mrDataTables as $value){
  $query = "SELECT * FROM $value";
  if(!$res = mysql_query($query, $db)){
    print "\n<p>ERROR ".mysql_error($db);
	exit;
  }
  $fullTextString = '';
  for($i = 0; $i < mysql_num_fields($res); $i++){
//    echo mysql_field_type($res, $i);
Beispiel #8
0
<?php

require_once "include.php";
//init_session();
login();
writeHeader("Get Data Files", "secure");
$secureUrlBase = "https://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/";
if (!isset($_REQUEST["scanner"])) {
    $scanner = "lucas15t";
} else {
    $scanner = $_REQUEST["scanner"];
}
$ifileServer = $GLOBALS["conf"]->rawDataSrc["lucas"]->user . "@" . $GLOBALS["conf"]->rawDataSrc["lucas"]->host;
$src = $GLOBALS["conf"]->rawDataSrc[$scanner];
if (!isset($_REQUEST["examNum"])) {
    $examNum = $_REQUEST["examNum"];
}
if (isset($examNum) && $examNum != "") {
    // Note that for this to work, you must have an ssh private
    // key stored in the specified place (/var/www/.ssh/id_dsa).
    // The public component of this key needs to be entered into
    // the /home/wandell/.shh/authorized_hosts file on lucas.
    // ("ssh-keygen -t rsa -f /var/www/.ssh/id_dsa" will make the keys.)
    $series = `ssh -i /var/www/.ssh/id_dsa -o "StrictHostKeyChecking no" {$ifileServer} listseries -r {$src->name} {$examNum}`;
    echo "<p>Scan series from exam <strong>{$examNum}</strong> on <strong>{$src->name}</strong>:</p>\n";
    echo "<pre>{$series}</pre>\n";
}
$pfileTree = listPfiles($src);
if (!$pfileTree) {
    echo "<p class=msg>No P-files found.</p>\n";
} else {
    echo "<h1>Display record:</h1>\n";
} else {
    if ($sessionId > 0) {
        writeHeader("Browse scan", "secure", $msg);
        checkSessionForRecon($db, $studyId, $sessionId);
        echo "<h1> Browse scan:</h1>\n";
    } else {
        if ($subjectId > 0) {
            writeHeader("Browse session", "secure", $msg);
            echo "<h1>Browse session:</h1>\n";
        } else {
            if ($studyId > 0) {
                writeHeader("Browse subject", "secure", $msg);
                echo "<h1>Browse subject:</h1>\n";
            } else {
                writeHeader("Browse study", "secure", $msg);
                echo "<h1>Browse study:</h1>\n";
            }
        }
    }
}
echo '<p><a href="' . selfURL() . '?studyId=' . $studyId . '&subjectId=' . $subjectId . '&sessionId=' . $sessionId . '&scanId=' . $scanId . '&displaySummary=1' . '">Summary (default)</a>' . "\n";
echo '&nbsp;&nbsp;&nbsp;<a href="' . selfURL() . '?studyId=' . $studyId . '&subjectId=' . $subjectId . '&sessionId=' . $sessionId . '&scanId=' . $scanId . '&displaySummary=0' . '">Full</a>' . "</p>\n";
/*echo "studyId=".$studyId."  subjectId=".$subjectId."  sessionId=".$sessionId."  scanId=".$scanId;*/
if ($scanId > 0) {
    $table = 'scans';
    $tableText = displayRecord($db, $table, "WHERE id=" . $scanId, $studyId, $subjectId, $sessionId, $scanId);
    if ($tableText != "") {
        echo $tableText;
    } else {
        echo "<p class=error>Entry not found.</p>\n";
/**
 * stores the string information
 *
 * @param string  $file      the string containing the filename the string's in
 * @param string  $input     the string containing the msgid/msgstr block
 * @param array   $filelist  the array containing the version info of the files
 * @param boolean $get       the boolean switch whether the call is storing
 *                           something or trying to get the whole storage back
 *
 * @return array  the array with the whole storage; only when $get == true
 */
function store($file = 0, $input = 0, $filelist = array(), $get = false)
{
    static $storage = array();
    if (!$get) {
        if (isset($storage[$file])) {
            $storage[$file][1] = array_unique(array_merge($storage[$file][1], $filelist));
            $storage[$file][] = $input;
        } else {
            $storage[$file] = array();
            $storage[$file][0] = writeHeader($file);
            $storage[$file][1] = $filelist;
            $storage[$file][2] = $input;
        }
    } else {
        return $storage;
    }
}
}
if (isset($_REQUEST["sessionId"])) {
    $sessionId = $_REQUEST["sessionId"];
} else {
    echo "<p class=error>Error: Can't get the session id.</p>\n";
    exit;
}
if (isset($_REQUEST["scanId"])) {
    $scanId = $_REQUEST["scanId"];
} else {
    echo "<p class=error>Error: Can't get the scan id.</p>\n";
    exit;
}
$selfUrl = "https://" . $_SERVER["HTTP_HOST"] . $_SERVER["PHP_SELF"];
$msg = "";
writeHeader("Building session- Process finished", "secure", $msg);
$q = "SELECT subjectID FROM sessions WHERE id=" . $sessionId;
if (!($res = mysql_query($q, $db))) {
    print "\n<p>mrData ERROR: " . mysql_error($db);
    exit;
}
$getrow = mysql_fetch_row($res);
$subjectId = $getrow[0];
echo "<p><font size=+2>Congratulations! You have successfully added the following record(s):</font></p>\n";
echo "<p><b>Study:</b></p>";
$table = 'studies';
$displaySummary = 1;
$tableText = displayTable($db, $table, "", "WHERE id=" . $studyId, 0, $displaySummary, "", $studyId, $subjectId, $sessionId, "", "", "", "");
if ($tableText != "") {
    echo $tableText;
} else {
Beispiel #12
0
<?php

require_once "include.php";
//init_session();
$db = login();
writeHeader("Get Data Files", "basic");
$secureUrlBase = "https://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/";
echo "<p class=warn>This is just a place-holder function. When it's finished, you'll be able ";
echo "to select the data files that you want to add and specify if you want them transferred.</p>\n";
if (!isset($_REQUEST["scanner"])) {
    $scanner = "lucas 1.5t";
} else {
    $scanner = $_REQUEST["scanner"];
}
$ifileServer = "*****@*****.**";
$dataSrc = getDataSourceInfo($scanner);
if (isset($_REQUEST["examNumber"])) {
    $examNumber = $_REQUEST["examNumber"];
} else {
    $examNumber = 0;
}
if ($examNumber != 0) {
    // Note that for this to work, you must have an ssh private
    // key stored in the specified place (/var/www/.ssh/id_dsa).
    // The public component of this key needs to be entered into
    // the /home/wandell/.shh/authorized_hosts file on lucas.
    // ("ssh-keygen -t rsa -f /var/www/.ssh/id_dsa" will make the keys.)
    $series = `ssh -i /var/www/.ssh/id_dsa -o "StrictHostKeyChecking no" {$ifileServer} listseries -r {$dataSramc->name} {$examNum}`;
    echo "<p>Scan series from exam <strong>{$examNum}</strong> on <strong>{$scanner}</strong> ({$dataSrc->name}):</p>\n";
    echo "<pre>{$series}</pre>\n";
}
Beispiel #13
0
<html lang="en-US">
	<head>
		<meta charset="utf-8">
		<meta name="author" content="William Jessup University" />
		<meta name="viewport" content="width=1024" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<title><?php 
echo $sPageTitle;
?>
</title>
		<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Open+Sans:400,400italic,700,700italic" />
		<link rel="stylesheet" href="/css/normalize.css" />
		<link rel="stylesheet" href="/css/global.css" />

		<?php 
writeHeader();
?>

	</head>
	<body>

		<?php 
if (isLoggedIn() && $bRegLogin) {
    ?>
<a href="/?logout=true" class="logout">Logout <?php 
    echo $_SESSION['user'];
    ?>
</a><?php 
}
?>
Beispiel #14
0
 public static function getResponse($request)
 {
     require_once 'web/header.inc';
     require_once 'web/page.inc';
     require_once 'web/footer.inc';
     require_once 'template/TemplateManager.php';
     //inizio il conteggio delle query
     require_once 'session.php';
     Session::initializeQueryCounter();
     self::$user = Session::getUser();
     $data = self::elaborateRequest($request);
     if (self::$requestedObject == "Login") {
         self::redirect("");
     } else {
         if (self::$requestedObject == "Logout") {
             Session::destroy();
             self::redirect("");
         }
     }
     $default = TemplateManager::getDefaultTemplate();
     $parser = null;
     $tentativi = 0;
     while (is_numeric($parser) || is_null($parser)) {
         $template = TemplateManager::getTemplateForRequest(self::$requestedObject, self::$currentID, self::$requestedAction);
         if (is_numeric($parser) || is_null($template) || $template === false) {
             $template = $default;
         }
         if ($tentativi == 1) {
             echo "<h3>ERRORE IN " . $template . "</h3>";
         }
         if ($tentativi == 2) {
             echo "<h3>ERRORE NEL TEMPLATE DI DEFAULT</h3>";
             return;
         }
         $tentativi++;
         $parser = TemplateParser::parseTemplate($template);
         //echo "<p>" . serialize(is_numeric($parser)) . "</p>"; //DEBUG
     }
     //echo "parser creato: " . serialize($parser) . "<br />";  //DEBUG
     $css = array();
     $js = array();
     $title = self::titleForRequest($request);
     $cols_stack = array();
     $write_h = false;
     $write_f = false;
     $ad = false;
     //		$i=0; //DEBUG
     while ($el = $parser->nextElement()) {
         //			if($i==10) //DEBUG
         //				return; //DEBUG
         //			$i++; //DEBUG
         $id = null;
         $class = null;
         switch ($el["tag"]) {
             case "TEMPLATE":
                 break;
             case "HEAD":
                 if ($el["type"] != "close") {
                     continue;
                 }
                 writeHeader($title, $css, $js);
                 break;
             case "STYLESHEET":
                 if (isset($el["attributes"]["CSS"])) {
                     $c = $el["attributes"]["CSS"];
                     if ($c != "default/default") {
                         $css[] = $c;
                     }
                 }
                 break;
             case "JS":
                 if (isset($el["attributes"]["SRC"])) {
                     $js[] = $el["attributes"]["SRC"];
                 }
                 break;
             case "HEADER":
                 $write_h = true;
                 if ($el["type"] == "close") {
                     writePageHeader(self::$user, $ad);
                     $write_h = false;
                 }
                 break;
             case "FOOTER":
                 $write_f = true;
                 if ($el["type"] == "close" || $el["type"] == "complete") {
                     writePageFooter(null, $ad);
                     $write_f = false;
                 }
                 break;
             case "AD":
                 if ($write_h || $write_f) {
                     $ad = true;
                 } else {
                     $style = "default";
                     if (isset($el["attributes"]["STYLE"])) {
                         $style = $el["attributes"]["STYLE"];
                     }
                     writeAD($style);
                 }
                 break;
             case "CONTENT":
                 $id = "content";
             case "COL":
                 //echo "<p>element: " . serialize($el) . "</p>";  //DEBUG
             //echo "<p>element: " . serialize($el) . "</p>";  //DEBUG
             case "DIV":
                 //echo "<p>element: " . serialize($el) . "</p>";  //DEBUG
                 if ($el["type"] == "open" || $el["type"] == "complete") {
                     if (isset($el["attributes"]["COLS"])) {
                         $cols_stack[] = $el["attributes"]["COLS"];
                     } else {
                         $cols_stack[] = 1;
                     }
                     if (isset($el["attributes"]["ID"])) {
                         $id = $el["attributes"]["ID"];
                     }
                     if (isset($el["attributes"]["CLASS"])) {
                         $class = $el["attributes"]["CLASS"];
                     }
                     opendiv($class, $id);
                 }
                 if (isset($el["value"]) && $el["value"] != "\n") {
                     self::evaluateText($el["value"], $data);
                 }
                 if ($el["type"] == "close" || $el["type"] == "complete") {
                     if ($el["type"] == "close") {
                         unset($cols_stack[count($cols_stack) - 1]);
                     }
                     closediv();
                 }
                 break;
         }
         //echo "<p style='color:red;'>element: " . $el["tag"] . "</p>";  //DEBUG
     }
     writeFooter();
 }
Beispiel #15
0
    fwrite($fh, '$MESSAGE = array();' . "\n");
    fwrite($fh, '$OVERVIEW = array();' . "\n");
    fclose($fh);
}
// create some more default files
if ($type == 'module') {
    $files = array('index', 'install', 'uninstall', 'upgrade');
    if ($func == 'tool') {
        array_push($files, 'tool');
    } else {
        array_push($files, 'add', 'view', 'modify');
    }
    foreach ($files as $n) {
        $fh = fopen($full . '/' . $n . '.php', 'w');
        if ($fh) {
            writeHeader($fh, $name, $author, $type);
            fclose($fh);
        }
    }
}
// if it's a template...
if ($type == 'template') {
    $contents = file_get_contents($full . '/index.php');
    $contents .= "\n\$dwoodata\t= array(); // if you need to set some additional template vars, add them here\nglobal \$page_id;\n\$variant = CAT_Helper_Page::getPageSettings(\$page_id,'internal','template_variant');\nif ( \$variant == '' ) \$variant = DEFAULT_TEMPLATE_VARIANT;\nif ( \$variant == '' || !file_exists(CAT_PATH.'/templates/bootstrap/templates/'.\$variant.'/index.tpl' ) )\n    \$variant = 'default';\n\$parser->setPath(CAT_TEMPLATE_DIR.'/templates/'.\$variant);\n\$parser->setFallbackPath(CAT_TEMPLATE_DIR.'/templates/default');\n\$parser->output('index.tpl',\$dwoodata);\n";
    file_put_contents($full . '/index.php', $contents);
    CAT_Helper_Directory::createDirectory($full . '/templates/default');
    CAT_Helper_Directory::recursiveCreateIndex($full . '/templates');
}
// insert module into DB
foreach ($info as $key => $value) {
    $key = str_replace($pre, 'module_', $key);
Beispiel #16
0
function wikiToHtml(&$session, $wiki_text)
{
    $lines = explode("\n", $wiki_text);
    $session->trace(TC_Util1, 'wikiToHtml: ' . (0 + count($lines)) . ' Zeilen' . "({$lines['0']})");
    $status = new LayoutStatus($session);
    foreach ($lines as $ii => $line) {
        if (($line_trimmed = trim($line)) == '') {
            writeParagraphEnd($status);
        } else {
            #$session->trace (TC_X, "Neue Zeile: '$line_trimmed' $line]");
            if ($line_trimmed == '[code]') {
                $session->startCode();
            } elseif ($line_trimmed == '[/code]') {
                $session->finishCode();
            } elseif ($session->fPreformated) {
                echo htmlentities($line);
            } else {
                switch (substr($line, 0, 1)) {
                    case '!':
                        if (substr($line, 1, 1) == '|') {
                            writeTableHeader($line, $status);
                        } else {
                            writeHeader($line, $status);
                        }
                        break;
                    case ' ':
                        writeLine($line, $status);
                        break;
                        # writeIndent ($line, $status); break;
                    # writeIndent ($line, $status); break;
                    case '*':
                        writeUList($line, $status);
                        break;
                    case '#':
                        writeOrderedList($line, $status);
                        break;
                    case '|':
                        writeTable($line, $status);
                        break;
                    case '-':
                        writeHoricontalLine($line, $status);
                        break;
                    default:
                        writeLine($line, $status);
                        break;
                }
            }
        }
    }
    // foreach
    $session->trace(TC_Util1, 'wikiToHtml-Ende');
}
Beispiel #17
0
         $i++;
     }
     echo '</table><br>';
     if ($gallery->isPublic || $gallery->creator == $_SESSION["UserID"]) {
         // form for creating an album
         writeSectionHeader("Create an Album");
         $frm = new Form("field", "createAlbum", "galleries.php?gid=" . $_GET["gid"], "addAlbum");
         $frm->addHidden("gid", $_GET["gid"]);
         $frm->addFormElement("album_name", "text", "Name", "", true);
         $frm->addFormElement("album_description", "textarea", "Description", "", true);
         $frm->addFormElement("album_files", "file", "Zip File", "", true);
         $frm->method = "post";
         $frm->draw();
     }
 } else {
     writeHeader(3, "Nerdery Pictures", "Picture Galleries");
     writeCP();
     $sh = new SectionHeader("Picture Galleries", true);
     $sh->start();
     $sh->end();
     echo '<table border="0" cellpadding="2" cellspacing="0" width="700">';
     $each = getGalleries();
     $i = 0;
     while ($g = $each[$i]) {
         //print_r ($g);
         if (strtotime($g->lastModified) > strtotime($_SESSION["PrevVisit"])) {
             $classname = "modifiedLink";
         } else {
             $classname = "unmodifiedLink";
         }
         echo "<tr><td colspan=\"2\"><a href=\"galleries.php?gid=" . $g->id . "\"><span class=\"" . $classname . "\">" . $g->name . "</span></a></td></tr><tr><td width=\"20\"></td><td width=\"680\"><span class=\"itemText\">" . $g->description . " (" . strtotime($g->lastModified) . " - " . strtotime($_SESSION["PrevVisit"]) . " - " . (strtotime($g->lastModified) > strtotime($_SESSION["PrevVisit"])) . ")</span></td></tr>";
Beispiel #18
0
  // Load language API
  google.load("language", "1"); 
</script>
<script src="scripts/jquery.easywidgets.min.js" type="text/javascript"></script>
<script src="scripts/bokser.js" type="text/javascript"></script>
<script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.accordion.js"></script>
  <script type="text/javascript">
  $(document).ready(function(){
    $(".trekkspill").accordion({ autoHeight: false, active: false });
  });
  </script>
';
//forteller hvilken filtype (MIME) og tegnsett som skal brukes
header('Content-Type: text/html; Extension: xhtml; charset=utf-8');
//skriver header delen
writeHeader($config['app_title'], $header_extras);
?>
		<div id="content">
			<!--
			<div id="menu">
				<a class="menulinks" href=".">Hjem</a>
				<a class="menulinks" href="?about">Om</a>
			</div>
			-->
			<h1><?php 
echo $config['app_title'];
?>
</h1>
			<div id="header">
<?php 
$type = "";
    $studyId = $_REQUEST["studyId"];
    header("Location: buildSession2.php?studyId=" . $studyId);
}
if (isset($_REQUEST["sortBy"])) {
    $sortBy = $_REQUEST["sortBy"];
} else {
    $sortBy = "";
}
if (isset($_REQUEST["sortDir"])) {
    $sortDir = $_REQUEST["sortDir"];
} else {
    $sortDir = "ASC";
}
$selfUrl = "https://" . $_SERVER["HTTP_HOST"] . $_SERVER["PHP_SELF"];
$msg = "";
writeHeader("Building session- select study", "secure", $msg);
wizardHeader(1);
echo "<p><font size=+1><a href=\"buildNewStudy.php?table=studies&returnURL=" . urlencode($selfUrl) . "&returnIdName=studyId\">Add new study</a>\n";
echo "&nbsp;&nbsp; or select an existing study:\n</font></p>";
$table = 'studies';
$idStr = '<a href="buildSession2.php?studyId=<ID>"><ID></a>';
$sortbyStr = '<a href="' . selfURL() . '?sortDir=<DIR2>&sortBy=<ID>"><ID2><DIR></a>';
if ($sortBy == "") {
    // Default sort
    $sortBy = 'id';
}
$displaySummary = 1;
$tableText = displayTable($db, $table, $idStr, "", 0, $displaySummary, "", $studyId, $subjectId, $sessionId, $sortbyStr, $sortBy, $sortDir, "builder");
if ($tableText != "") {
    echo $tableText;
} else {
Beispiel #20
0
if (!function_exists('writeHeader')) {
    function writeHeader($str, $level = 1)
    {
        $levels = array(1 => '=', 2 => '=', 3 => '-', 4 => '^', 5 => '~');
        $count = strlen($str);
        $char = isset($levels[$level]) ? $levels[$level] : "'";
        # fallback character is '
        if ($level == 1) {
            # write also overline
            for ($i = 0; $i < $count; $i++) {
                echo $char;
            }
        }
        echo "\n{$str}\n";
        for ($i = 0; $i < $count; $i++) {
            echo $char;
        }
        echo "\n";
    }
}
writeHeader($view['title'], $view['titleLevel']);
echo "\n";
echo $view['description'];
echo "\n\n";
foreach ($view['fields'] as $field) {
    echo $field['label'];
    echo "\n";
    echo "    " . $T('Describe *${0}* here..', array($field['label']));
    echo "\n\n";
}
<?php

require_once "Includes/functions.php";
writeHeader("NMIMS - Add Consumer", "");
?>
	
<style type="text/css">
	#addform
			{
				color:#FFFFFF;	
			}
			tr
			{
				cell-padding: 20px;
				font-size: 18px;
				font-family: Verdana, Geneva, sans-serif;
				text-align: center;
			}
				
			tr.tr2
			{
				background-color: #443266;	
			}
			tr.tr1
			{
				background-color: #8c489f;	
			}
	#heading {
		color:#443266;
		text-align:center;
		font-size: 24px;
<?php

require_once "Includes/functions.php";
writeHeader("NMIMS - Add Item", "");
?>
	
<style type="text/css">
	#addform
			{
				color:#FFFFFF;	
			}
			tr
			{
				cell-padding: 20px;
				font-size: 18px;
				font-family: Verdana, Geneva, sans-serif;
				text-align: center;
			}
				
			tr.tr2
			{
				background-color: #443266;	
			}
			tr.tr1
			{
				background-color: #8c489f;	
			}
	#heading {
		color:#443266;
		text-align:center;
		font-size: 24px;
Beispiel #23
0
   </articleinfo> 
  <formalpara><title></title><para></para></formalpara>

  <toc>
   <title>XML_PullParser Contents</title>
   <tocpart>

HEADER;
require_once "XML_PullParser.inc";
$files = array();
$file = "synopsis.xml";
$xml_outfile = "XML_PullParser_contents.xml";
$html_outfile = "html_contents.html";
$handle = openOutputFile($xml_outfile);
$html_handle = openOutputFile($html_outfile);
writeHeader($handle);
writeText($html_handle, $HTML_Header);
echo "<A href = \"article2html.php?fn=synopsis.xml\">Synopsis</A><br>\n";
writeEntry($handle, "synopsis.xml", "Synopsis");
writeHTMLEntry($html_handle, "synopsis.xml", "Synopsis");
while ($file = toc($file)) {
}
writeFooter($handle, $xml_outfile);
writeHTMLFooter($html_handle, $html_outfile);
function toc($file)
{
    global $handle, $html_handle;
    global $files;
    $tags = array("para");
    $child_tags = array("ulink");
    $parser = new XML_PullParser($file, $tags, $child_tags);
<?php

require_once "connection.php";
require_once "Includes/functions.php";
writeHeader("NMIMS - Update/Remove Received Item", "");
//Get values from server on select of drop down
if (isset($_GET)) {
    $id = $_GET['rId'];
    $query = "select * from received where rId='{$id}'";
    if ($row = mysql_query($query, $connection)) {
        $result = mysql_fetch_assoc($row);
        $date = $result['rDate'];
        $iname = $result['iName'];
        $remarks = $result['rRemarks'];
        $oldQuantity = $result['rQuantity'];
    }
}
?>
	
<style type="text/css">
	.updateForm
			{
				color:#FFFFFF;	
			}
			tr
			{
				cell-padding: 20px;
				font-size: 18px;
				font-family: Verdana, Geneva, sans-serif;
				text-align: center;
			}
//echo $table;
require_once "include.php";
//echo $table;
//init_session();
//echo $table;
//if(!isset($table) || $table==""){
$db = login();
//echo $table;
if (isset($_REQUEST["table"]) && $_REQUEST["table"] != "") {
    $table = $_REQUEST["table"];
} else {
    trigger_error("'table' is not specified.");
    exit;
}
$msg = "Connected as user " . $_SESSION['username'];
writeHeader("Display {$table}", "secure", $msg);
echo "<h1>Display table '{$table}':</h1>\n";
$selfURL = "https://" . $_SERVER["HTTP_HOST"] . $_SERVER["PHP_SELF"];
?>
<hr>
<h1>Existing entries in table '<?php 
echo $table;
?>
':</h1>
<?
$tableText = displayTable($db, $table);
if($tableText!=""){
  echo $tableText;
} else {
  echo "<p class=error>No entries found.</p>\n";
}
<?php

require_once "Includes/functions.php";
writeHeader("NMIMS - 404 Error", "");
?>
<style type="text/css" media="screen">
            
            
			#box {
				font-family:Verdana, Geneva, sans-serif;
				color:#8C489F;
				font-size:18px;
			}
			#image
			{
				width:200px;
				padding:0px;
				clear:both;
				margin-left:auto;
				margin-right:auto;	
				margin-top:20px;
				margin-bottom:30px;
			}
			#heading {
				color:#8C489F;
				text-align:center;
				font-size:24px;
				font-family:Verdana, Geneva, sans-serif;
			}
			#text
			{
require "config.php";
require "./lang/lang." . LANGUAGE_CODE . ".php";
require "functions.php";
$auth = auth();
$id = $_GET['id'];
mysql_connect(DB_HOST, DB_USER, DB_PASS) or die(mysql_error());
mysql_select_db(DB_NAME) or die(mysql_error());
$sql = "SELECT d, m, y FROM " . DB_TABLE_PREFIX . "mssgs WHERE id=" . $id;
$result = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_array($result);
$d = $row["d"];
$m = $row["m"];
$y = $row["y"];
$dateline = $lang['months'][$m - 1] . " {$d}, {$y}";
$wday = date("w", mktime(0, 0, 0, $m, $d, $y));
writeHeader($m, $y, $dateline, $wday, $auth);
// display selected posting first
writePosting($id, $auth);
// give some space
echo '<img src="images/clear.gif" width="1" height="25" border="0"><br clear="all">';
// query for rest of this day's postings
$sql = "SELECT id, start_time FROM " . DB_TABLE_PREFIX . "mssgs ";
$sql .= "WHERE y = " . $y . " AND m = " . $m . " AND d = " . $d . " AND id != {$id} ";
$sql .= "ORDER BY start_time ASC";
$result = mysql_query($sql) or die(mysql_error());
if (mysql_num_rows($result)) {
    echo '<span class="display_header">' . $lang['otheritems'] . '</span>';
    echo '<br clear="all"><img src="/images/clear.gif" width="1" height="3" border="0"><br clear="all">';
    // display rest of this day's postings
    while ($row = mysql_fetch_array($result)) {
        writePosting($row[0], $auth);
Beispiel #28
0
}
?>
</table>
-->
<!-- end of time sheet -->
    </td>
    <td align="right" valign="top">
    </td>
</tr>
</table>

    <table width="100%">
    <tr>
    <td align="left">
        <?php 
writeHeader($jobs[0]->name);
?>
		<?php 
for ($job = 0; $job < count($jobs); $job++) {
    ?>
		<div id="<?php 
    echo "jobSchedule" . ($job + 1);
    ?>
"<?php 
    if ($job > 0) {
        ?>
 style="display:none"<?php 
    }
    ?>
>
        <table width="540" bgcolor="#CDDEEE" cellpadding="0" cellspacing="1" align="center">
<?php

require_once "connection.php";
require_once "Includes/functions.php";
writeHeader("NMIMS - Display", "<link href=\"Styles/calendar.css\" rel=\"stylesheet\" type=\"text/css\" >\n        <script src=\"Scripts/calendar.js\" type=\"text/javascript\"></script>\n        <script type=\"text/javascript\">\n            function init() {\n                calendar.set(\"date\");\n\t\t\t\tcalendar.set(\"date1\");\n            }\n        </script>");
?>
<style type="text/css">
	p{
		color:#443266;
	}
	.addform
			{
				color:#443266;	
			}
			tr
			{
				cell-padding: 20px;
				font-size: 12px;
				font-family: Verdana, Geneva, sans-serif;
				text-align: center;
				background-color: #C3C3E5;
			}
				
			tr.tr2
			{
				background-color: #443266;	
			}
			tr.tr1
			{
				background-color: #8c489f;	
			}
<?php

require_once "Includes/functions.php";
$moreScripts = "<script type=\"application/javascript\" src=\"Scripts/slides.jquery.js\"></script>\n\t\t\t\t  <script> \$(function(){\n                \t\t\t\t\$(\"#slides\").slides();\n\t\t\t\t\t\t\t\tgenerateNextPrev: true\n           \t\t\t\t\t });\n\t\t\t\t  </script>";
writeHeader("NMIMS - About the Developers", $moreScripts);
?>
<style type="text/css" media="screen">
            .slides_container {
				margin-left:auto;
				margin-right:auto;
				margin-top:20px;
				margin-bottom:20px;
                width:650px;
                height:400px;
            }
            .slides_container div {
                width:650px;
                height:400px;
                display:block;
            }
			#slides a {
				display:inline;
			}
			#heading {
				color:#8C489F;
				text-align:center;
				font-size:20px;
				font-family:Verdana, Geneva, sans-serif;
			}
</style>
<div id="heading">