Пример #1
0
/*
 *  import        libcaca importers test program
 *  Copyright (c) 2008 Benjamin C. Wiley Sittler <*****@*****.**>
 *
 *  This file is a Php port of "examples/import.c"
 *  which is:
 *  Copyright (c) 2006 Jean-Yves Lamoureux <*****@*****.**>
 *                All Rights Reserved
 *
 *  This program is free software. It comes without any warranty, to
 *  the extent permitted by applicable law. You can redistribute it
 *  and/or modify it under the terms of the Do What the F**k You Want
 *  to Public License, Version 2, as published by Sam Hocevar. See
 *  http://www.wtfpl.net/ for more details.
 */
$imports = caca_get_import_list();
$file = isset($_FILES['file']) ? $_FILES['file']['tmp_name'] : NULL;
$filename = isset($_FILES['file']) ? $_FILES['file']['name'] : NULL;
$format = isset($_REQUEST['format']) ? $_REQUEST['format'] : NULL;
?>
<head>
<title><?php 
echo $filename == NULL ? '' : htmlspecialchars($filename . ' | ');
?>
libcaca importers test program</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<?php 
if ($file == NULL) {
    ?>
Пример #2
0
</p>

<p>Available drivers:</p>
<ul>
<?php 
$list = caca_get_display_driver_list();
foreach ($list as $type => $name) {
    echo '<li>' . htmlspecialchars("{$name} ({$type})") . '</li>';
}
?>
</ul>

<p>Available import formats:</p>
<ul>
<?php 
$list = caca_get_import_list();
foreach ($list as $format => $name) {
    echo '<li>' . htmlspecialchars("{$name} ({$format})") . '</li>';
}
?>
</ul>

<p>Available export formats:</p>
<ul>
<?php 
$list = caca_get_export_list();
foreach ($list as $format => $name) {
    echo '<li>' . htmlspecialchars("{$name} ({$format})") . '</li>';
}
?>
</ul>