Пример #1
0
 public static function canImport($sourceInfo)
 {
     if (!is_array($sourceInfo)) {
         return false;
     }
     /* Retrieve the information for the first frame */
     if (!($imageInfo = parent::canImport($sourceInfo['first']))) {
         return false;
     }
     /* We don't care about the title generated by ImageImport */
     unset($imageInfo['title']);
     unset($imageInfo['_ext']);
     $sourceInfo = $sourceInfo + $imageInfo;
     if (!isset($sourceInfo['fps'])) {
         $sourceInfo['fps'] = 0;
     }
     if (!isset($sourceInfo['seqformat'])) {
         $sourceInfo['seqformat'] = $sourceInfo['base'] . str_repeat('?', $sourceInfo['seqdigits']) . '.' . $sourceInfo['ext'];
     }
     if (!isset($sourceInfo['title'])) {
         $sourceInfo['title'] = basename($sourceInfo['dir']);
     }
     if (!isset($sourceInfo['frames'])) {
         $sourceInfo['frames'] = 0;
     }
     $sourceInfo['_printf'] = sprintf('%%0%dd', $sourceInfo['seqdigits']);
     $sourceInfo['_base'] = $sourceInfo['base'];
     $sourceInfo['_dir'] = $sourceInfo['dir'];
     $sourceInfo['_ext'] = $sourceInfo['ext'];
     $sourceInfo['_firstIndex'] = $sourceInfo['firstIdx'];
     unset($sourceInfo['first']);
     unset($sourceInfo['dir']);
     unset($sourceInfo['ext']);
     unset($sourceInfo['base']);
     unset($sourceInfo['seqdigits']);
     unset($sourceInfo['first']);
     unset($sourceInfo['firstIdx']);
     return $sourceInfo;
 }
Пример #2
0
<?php

include_once '../../config/symbini.php';
include_once $serverRoot . '/classes/ImageImport.php';
header("Content-Type: text/html; charset=" . $charset);
$action = array_key_exists("action", $_POST) ? $_POST["action"] : "";
$ulFileName = array_key_exists("ulfilename", $_POST) ? $_POST["ulfilename"] : "";
$isEditor = false;
if ($IS_ADMIN) {
    $isEditor = true;
}
$importManager = new ImageImport();
$fieldMap = array();
//array(sourceField => symbIndex)
if ($isEditor) {
    if ($action) {
        $importManager->setUploadFile($ulFileName);
    }
    if (array_key_exists("sf", $_POST)) {
        //Grab field mapping, if mapping form was submitted
        $targetFields = $_POST["tf"];
        $sourceFields = $_POST["sf"];
        for ($x = 0; $x < count($targetFields); $x++) {
            if ($targetFields[$x] !== "" && $sourceFields[$x]) {
                $fieldMap[$sourceFields[$x]] = $targetFields[$x];
            }
        }
    }
}
?>
<html>