# get the project short description $intro = $xmlClass->get_xml_element("intro", $project); # get the project main description $main = $xmlClass->get_xml_element("main", $project); # initialize string class $stringClass = new string(); # execute text2html function /* $name = $stringClass->text2html($name); $by = $stringClass->text2html($by); $intro = $stringClass->text2html($intro); $main = $stringClass->text2html($main); */ ################# # start XML creation process (MAIN FILE) $xmlClass->createXMLFile(); # set the Path of the file $xmlClass->setPath("misc/groupware/writeable/projects/shared/" . $_GET['id'] . "/main.xml"); ##############################ATTENTION!!! $xmlClass->setOverwrite(true); # add comment $xmlClass->add_comment(XML_CLASS_COMMENT); # open XML element $xmlClass->open_xml_element("main"); # add XML element (Name) $xmlClass->add_xml_element("name", $name); # add XML element (MOTD) $xmlClass->add_xml_element("motd", $intro); # add XML element (Description) $xmlClass->add_xml_element("description", $main); # add XML element (Main block)
} # create selectBox where put the sections $formClass->select("category", $array, "Categoria:"); # create TextInput for the creation of a category $formClass->text("newCategory", "Crea categoria:"); # create TextArea $formClass->textarea("mainText", "Testo del documento:"); # crate submit button $formClass->submit("", true, "Invia i dati"); # close DocCreation form $formClass->closeForm(); } else { # create XML object $xmlClass = new xml(); # start XML file cration $xmlClass->createXMLFile(); # eregi all whitespaces from string $docTitle = eregi_replace(" ", "_", $_POST['title']); # if is checked the option `[crea categoria]' create a new directory in the # FlatDoc writeable directory if ($_POST['category'] == "[crea categoria]" and !file_exists(FNDOC_WRITEABLE . $_POST['newCategory'])) { if (mkdir(FNDOC_WRITEABLE . $_POST['newCategory'])) { echo "Categoria creata con successo!"; $_POST['category'] = $_POST['newCategory']; } else { trigger_error("Impossiile creare la directory `" . $_POST['newCategory'] . "' in `" . FNDOC_WRITEABLE . "'", E_USER_ERROR); } } elseif ($_POST['category'] == "[crea categoria]") { trigger_error("Categoria già esistente, inserisco all'interno il documento.", E_USER_NOTICE); $_POST['category'] = $_POST['newCategory']; }