} // Display the form, if raw option isn't set if (!isset($_REQUEST['raw'])) { print "<html>\n"; print "<head><title>EasyRdf Converter</title></head>\n"; print "<body>\n"; print "<h1>EasyRdf Converter</h1>\n"; print "<div style='margin: 10px'>\n"; print form_tag(); print label_tag('data', 'Input Data: ') . '<br />' . text_area_tag('data', '', array('cols' => 80, 'rows' => 10)) . "<br />\n"; print label_tag('uri', 'or Uri: ') . text_field_tag('uri', 'http://www.dajobe.org/foaf.rdf', array('size' => 80)) . "<br />\n"; print label_tag('input_format', 'Input Format: ') . select_tag('input_format', $input_format_options) . "<br />\n"; print label_tag('output_format', 'Output Format: ') . select_tag('output_format', $output_format_options) . "<br />\n"; print label_tag('raw', 'Raw Output: ') . check_box_tag('raw') . "<br />\n"; print reset_tag() . submit_tag(); print form_end_tag(); print "</div>\n"; } if (isset($_REQUEST['uri']) or isset($_REQUEST['data'])) { // Parse the input $graph = new EasyRdf_Graph($_REQUEST['uri']); if (empty($_REQUEST['data'])) { $graph->load($_REQUEST['uri'], $_REQUEST['input_format']); } else { $graph->parse($_REQUEST['data'], $_REQUEST['input_format'], $_REQUEST['uri']); } // Lookup the output format $format = EasyRdf_Format::getFormat($_REQUEST['output_format']); // Serialise to the new output format $output = $graph->serialise($format); if (!is_scalar($output)) {
} } ?> </ul> </div> <?php } ?> <?php echo text_field($this->entity, "id"); ?> <?php echo datetime_field($this->entity, "created_at"); ?> <?php echo datetime_field($this->entity, "updated_at"); ?> <?php echo text_field($this->entity, "email"); ?> <input type ="submit" value="Save" /> <?php echo form_end_tag();
function link_to($url, $text, $html_code = "") { global $rHandler; $html_attrs = ""; if ($html_code != "") { foreach ($html_code as $key => $value) { $html_attrs .= ' ' . $key . '="' . $value . '"'; } } if ($rHandler->find_method_for($url) == Makiavelo::VIA_POST) { $html = form_tag($url, "post"); $html .= '<a href="#" type="submit" ' . $html_attrs . '>' . $text . '</a>'; $html .= form_end_tag(); } else { $html = '<a href="' . $url . '" ' . $html_attrs . '>' . $text . '</a>'; } return $html; }