*/
require_once "../../../config.php";
// xml.inc.php is required, so the whole thing works.
require_once "classmysql2lom.php";
$cid = optional_param('cid', 0, PARAM_INT);
// Course Module ID
$loid = optional_param('loid', 0, PARAM_INT);
// metadatadc ID
require_login($course->id);
if (!(isteacher($course->id) or $course->showreports and $USER->id == $user->id)) {
    echo "<br><div ='center'><hr>";
    $unauthorized = get_string("Comment_student", "metadatalom");
    error('Opss! - ' . $unauthorized);
    echo "<br><hr></div>";
} else {
    $XMLGenerator = new XMLDefinition("{$CFG->dbhost}", "{$CFG->dbname}", "{$CFG->dbuser}", "{$CFG->dbpass}", "{$CFG->prefix}metadatalom", "lom", "resource", "{$cid}", "{$loid}", "{$CFG->dataroot}", "utf-8");
    /*
    Add Fields to select and which is added to the XML document.
    The parameters are:
    1. Field name in DB table.
    2. Tag name in the returned XML.
    */
    $XMLGenerator->AddNode("General_Identifier_Catalog", "<general>\r\n\t<identifier>\r\n\t\t<catalog>", "</catalog>");
    $XMLGenerator->AddNode("General_Identifier_Entry", "\r\n\t\t<entry>", "</entry>\r\n\t</identifier>");
    $XMLGenerator->AddNode("General_Title", "\r\n\t<title>\r\n\t\t<string language=\"pt\">", "</string>\r\n\t</title>");
    $XMLGenerator->AddNode("General_Language", "\r\n\t<language>", "</language>");
    $XMLGenerator->AddNode("General_Description", "\r\n\t<description>\r\n\t\t<string language=\"pt\">", "</string>\r\n\t</description>");
    $XMLGenerator->AddNode("General_Keyword", "\r\n\t<keyword>\r\n\t\t<string language=\"pt\">", "</string>\r\n\t</keyword>");
    $XMLGenerator->AddNode("General_Coverage", "\r\n\t<coverage>\r\n\t\t<string language=\"pt\">", "</string>\r\n\t</coverage>");
    $XMLGenerator->AddNode("General_Structure", "\r\n\t<structure>\r\n\t\t<source>\r\n\t\t\t<string language=\"none\">LOMv1.0</string>\r\n\t\t</source>\r\n\t\t<value>\r\n\t\t\t<string language=\"none\">", "</string>\r\n\t\t</value>\r\n\t</structure>");
    $XMLGenerator->AddNode("General_AggregationLevel", "\r\n\t<aggregationLevel>\r\n\t\t<source>\r\n\t\t\t<string language=\"none\">LOMv1.0</string>\r\n\t\t</source>\r\n\t\t<value>\r\n\t\t\t<string language=\"none\">", "</string>\r\n\t\t</value>\r\n\t</aggregationLevel>");
*/
require_once "../../../config.php";
// xml.inc.php is required, so the whole thing works.
require_once "classmysql2qdc.php";
$cid = optional_param('cid', 0, PARAM_INT);
// Course Module ID
$loid = optional_param('loid', 0, PARAM_INT);
// metadatadc ID
require_login($course->id);
if (!(isteacher($course->id) or $course->showreports and $USER->id == $user->id)) {
    echo "<br><div ='center'><hr>";
    $unauthorized = get_string("Comment_student", "metadatadc");
    error('Opss! - ' . $unauthorized);
    echo "<br><hr></div>";
} else {
    $XMLGenerator = new XMLDefinition("{$CFG->dbhost}", "{$CFG->dbname}", "{$CFG->dbuser}", "{$CFG->dbpass}", "{$CFG->prefix}metadatadc", "metadata", "resource", "{$cid}", "{$loid}", "{$CFG->dataroot}", "utf-8");
    /*
    Add Fields to select and which is added to the XML document.
    The parameters are:
    1. Field name in DB table.
    2. Tag name in the returned XML.
    */
    //$XMLGenerator->AddNode( "FieldinTable", "1Tag2xml", "2Tag2xml");
    $XMLGenerator->AddNode("title", "dc:title", "dc:title");
    $XMLGenerator->AddNode("alternative", "dcterms:alternative", "dcterms:alternative");
    $XMLGenerator->AddNode("creator", "dc:creator", "dc:creator");
    $XMLGenerator->AddNode("subject", "dc:subject xsi:type=\"dcterms:UDC\"", "dc:subject");
    $XMLGenerator->AddNode("description", "dc:description", "dc:description");
    $XMLGenerator->AddNode("descriptionout", "dc:description xml:lang=\"uk\"", "dc:description");
    $XMLGenerator->AddNode("tableOfContents", "dcterms:tableOfContents", "dcterms:tableOfContents");
    $XMLGenerator->AddNode("abstract", "dcterms:abstract", "dcterms:abstract");
Updated to PHP4 and the PEAR DB Class.
*/
// xml.inc.php is required, so the whole thing works.
require_once "classmysql2sdcrdf.php";
$cid = optional_param('cid', 0, PARAM_INT);
// Course Module ID
$loid = optional_param('loid', 0, PARAM_INT);
// metadatadc ID
require_login($course->id);
if (!(isteacher($course->id) or $course->showreports and $USER->id == $user->id)) {
    echo "<br><div ='center'><hr>";
    $unauthorized = get_string("Comment_student", "metadatadc");
    error('Opss! - ' . $unauthorized);
    echo "<br><hr></div>";
} else {
    $XMLGenerator = new XMLDefinition("{$CFG->dbhost}", "{$CFG->dbname}", "{$CFG->dbuser}", "{$CFG->dbpass}", "{$CFG->prefix}metadatadc", "rdf:RDF", "rdf:Description", "{$cid}", "{$loid}", "{$CFG->dataroot}", "utf-8");
    /*
    Add Fields to select and which is added to the XML document.
    The parameters are:
    1. Field name in DB table.
    2. Tag name in the returned XML.
    */
    $XMLGenerator->AddNode("title", "dc:title");
    $XMLGenerator->AddNode("creator", "dc:creator");
    $XMLGenerator->AddNode("subject", "dc:subject");
    $XMLGenerator->AddNode("description", "dc:description");
    $XMLGenerator->AddNode("publisher", "dc:publisher");
    $XMLGenerator->AddNode("contributor", "dc:contributor");
    $XMLGenerator->AddNode("date", "dc:date");
    $XMLGenerator->AddNode("type", "dc:type");
    $XMLGenerator->AddNode("format", "dc:format");
*/
require_once "../../../config.php";
// xml.inc.php is required, so the whole thing works.
require_once "classmysql2qdcrdf.php";
$cid = optional_param('cid', 0, PARAM_INT);
// Course Module ID
$loid = optional_param('loid', 0, PARAM_INT);
// metadatadc ID
require_login($course->id);
if (!(isteacher($course->id) or $course->showreports and $USER->id == $user->id)) {
    echo "<br><div ='center'><hr>";
    $unauthorized = get_string("Comment_student", "metadatadc");
    error('Opss! - ' . $unauthorized);
    echo "<br><hr></div>";
} else {
    $XMLGenerator = new XMLDefinition("{$CFG->dbhost}", "{$CFG->dbname}", "{$CFG->dbuser}", "{$CFG->dbpass}", "{$CFG->prefix}metadatadc", "rdf:RDF", "rdf:Description", "{$cid}", "{$loid}", "{$CFG->dataroot}", "utf-8");
    /*
    Add Fields to select and which is added to the XML document.
    The parameters are:
    1. Field name in DB table.
    2. Tag name in the returned XML.
    */
    //$XMLGenerator->AddNode( "title", "<dc:title>", "</dc:title>" );
    $XMLGenerator->AddNode("title", "<rdfs:Class rdfs:label=\"", "\">");
    $XMLGenerator->AddNode("creator", "<dc:creator>", "</dc:creator>");
    $XMLGenerator->AddNode("alternative", "\r\n</rdfs:Class><dcterms:alternative>", "</dcterms:alternative>");
    //$XMLGenerator->AddNode( "creator", "<dc:creator>", "</dc:creator>" );
    $XMLGenerator->AddNode("subject", "<dc:subject>\r\n\t<dcterms:UDC>\r\n\t\t<rdf:value>", "</rdf:value>\r\n\t\t<rdfs:label>UDC</rdfs:label>\r\n\t</dcterms:UDC>\r\n</dc:subject>");
    $XMLGenerator->AddNode("subject", "<dc:subject>\r\n\t<dcterms:UDC>\r\n\t\t<rdf:value>", "</rdf:value>\r\n\t\t<rdfs:label>UDC</rdfs:label>\r\n\t\t<rdfs:comment  xml:lang=\"en-US\">Universal Decimal Classification</rdfs:comment>\r\n\t\t<rdfs:isDefinedBy rdf:resource=\"http://dublincore.org/2005/06/13/dcq#UDC\"/>\r\n\t</dcterms:UDC>\r\n</dc:subject>");
    $XMLGenerator->AddNode("description", "<dc:description>", "</dc:description>");
    $XMLGenerator->AddNode("descriptionout", "<dc:description xml:lang=\"uk\">", "</dc:description>");