Exemplo n.º 1
0
function defineMetaIAHWrite($xsl_params = null)
{
    global $lang;
    $sucess = false;
    $xml = DATABASE_PATH . "xml/" . $lang . "/bvs.xml";
    $xml = file_get_contents($xml);
    $xsl = SITE_PATH . "xsl/metaiah/define-metaiah.xsl";
    $define = DATABASE_PATH . "xml/" . $lang . "/metaiah.xml";
    //print "\n xsl=" . $xsl . " ini=" . $ini . "<br>";
    $text = processTransformation($xml, $xsl, $xsl_params);
    // permite usar relative meta search parameters using %HOST%
    if (eregi('%HOST%', $text)) {
        $thisHOST = $_SERVER['HTTP_HOST'];
        $text = str_replace("%HOST%", $thisHOST, $text);
    }
    if ($text == "") {
        print "warning ocurred in " . __FUNCTION__ . ": transformation error generated empty content";
    } else {
        if (!putDoc($define, $text)) {
            print "putDoc error: " . $define . "<br/>\n";
        } else {
            $sucess = true;
        }
    }
    return $sucess;
}
Exemplo n.º 2
0
$error = "";
$warning = "";
if ($id == "" || $lang == "" || $type == "") {
    $error = $messages["param"] . " id=" . $id . " lang=" . $lang . " type=" . $type;
} else {
    if (is_file($fileXml)) {
        $error = $messages["exist"] . $fileXml;
    } else {
        $fp = fopen($fileXml, "a+b");
        chmod($fileXml, 0764);
        $content = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n";
        $content .= "<" . $type . " lang=\"" . $lang . "\" available=\"yes\">";
        if ($type == "decs") {
            $xml = "http://decs.ws.bvsalud.org/main.php";
            $xsl = $def["SITE_PATH"] . "xsl/adm/xml-decs.xsl";
            $decsTree = processTransformation($xml, $xsl);
            if ($decsTree == '[open failure]') {
                $warning = $messages["decs_connection"];
            } else {
                $content .= $decsTree;
            }
        }
        $content .= "</" . $type . ">";
        if (!fwrite($fp, $content)) {
            $error = $messages["fail"] . $fileXml;
        }
    }
}
?>
<html>
    <head>
Exemplo n.º 3
0
$currentDirectory = $baseDirectory;
if ($relativeDirectory != '') {
    $currentDirectory .= "/" . $relativeDirectory . "/";
}
$column = $_POST['column'] ? $_POST['column'] : "name";
$order = $_POST['order'] ? $_POST['order'] : "ascending";
$message = "";
$errorMessage = "";
if ($task == "createFolder") {
    $message .= createNewFolder($currentDirectory, $newFolder);
}
if (isset($_POST['submitUpload'])) {
    $message .= uploadFile($_FILES["uploadFile"], $currentDirectory);
}
if ($task == "removeFile") {
    $message .= removeFile($currentDirectory, $deleteFile);
}
if ($task == "renameFile") {
    $message .= renameFile($currentDirectory, $renameFrom, $renameTo);
}
$directoryList = getDirectoryList($currentDirectory);
$fileList = getFileList($currentDirectory);
$navigationList["Fnow"] = str_replace('\\', '/', pFNOW);
$navigationList["base"] = $cfg['base_directory'];
$navigationList["relative"] = $relativeDirectory;
$navigationList["column"] = $column;
$navigationList["order"] = $order;
$navigationList["pathData"] = $def['DIRECTORY'];
$directoryListXML = setDirectoryListXML($currentDirectory, $navigationList, $directoryList, $fileList, $message);
$result = processTransformation($directoryListXML, pFNOW . "/xsl/directoryList.xsl");
print $result;
Exemplo n.º 4
0
if (isset($xslSave)) {
    $xslSave = "../" . $checked['xslSave'];
    $sucessWriteXml = xmlWrite($xmlContent, $xslSave, $checked['xmlSave']);
    if ($sucessWriteXml != '' && $checked['page'] != 'users') {
        // generate html
        htmlWrite($sucessWriteXml);
        // generate ini
        iniWrite($sucessWriteXml);
        if ($checked['page'] == 'collection' || $checked['page'] == 'topic') {
            // generate metaiah define xml
            defineMetaIAHWrite();
        }
    }
    if (isset($xmlT)) {
        if ($xmlT == "saved") {
            $xmlContent = BVSDocXml("root", $checked['xmlSave']);
        }
    }
}
$xslTransform = normalizePath($checked['xsl'], "SITE_PATH");
if ($debug == "XSL") {
    die($xslContent);
}
if (isset($xsl)) {
    print processTransformation($xmlContent, $xslTransform);
} else {
    print $xmlContent;
}
?>

function defineMetaIAHWrite()
{
    global $lang;
    $sucess = false;
    $xml = normalizePath("xml/" . $lang . "/bvs.xml");
    $xsl = normalizePath("xsl/metaiah/define-metaiah.xsl", "SITE_PATH");
    $define = normalizePath("xml/" . $lang . "/metaiah.xml");
    //print "\n xsl=" . $xsl . " ini=" . $ini . "<br>";
    $text = processTransformation($xml, $xsl);
    $text = str_replace("encoding=\"UTF-8\"", "encoding=\"ISO-8859-1\"", $text);
    if ($text == "") {
        print "warning:transformation error generated empty content";
    } else {
        if (!putDoc($define, $text)) {
            print "putDoc error: " . $define . "<br/>\n";
        } else {
            $sucess = true;
        }
    }
    return $sucess;
}
Exemplo n.º 6
0
if (isset($xslSave)) {
    $xslSave = "../" . $checked['xslSave'];
    $sucessWriteXml = xmlWrite($xmlContent, $xslSave, $checked['xmlSave'], $xsl_params);
    if ($sucessWriteXml != '' && $checked['page'] != 'users') {
        // generate html
        htmlWrite($sucessWriteXml, $xsl_params);
        // generate ini
        iniWrite($sucessWriteXml, $xsl_params);
        if ($checked['page'] == 'collection' || $checked['page'] == 'topic') {
            // generate metaiah define xml
            defineMetaIAHWrite();
        }
    }
    if (isset($xmlT)) {
        if ($xmlT == "saved") {
            $xmlContent = BVSDocXml("root", $checked['xmlSave']);
        }
    }
}
$xslTransform = SITE_PATH . $checked['xsl'];
if ($debug == "XSL") {
    die($xslContent);
}
if (isset($checked['xsl'])) {
    print processTransformation($xmlContent, $xslTransform, $xsl_params);
} else {
    print $xmlContent;
}
?>