Example #1
0
function kfm_createDirectory($parent, $name)
{
    include_once KFM_BASE_PATH . 'includes/directories.php';
    return _createDirectory($parent, $name);
}
Example #2
0
        mkdir(USERBASE . '/f/products/product-images', 0777, true);
    }
    $pdata['images_directory'] = '/products/product-images/' . md5(rand() . microtime());
    mkdir(USERBASE . '/f' . $pdata['images_directory']);
}
if (!is_dir(USERBASE . '/f' . $pdata['images_directory'])) {
    $parent_id = kfm_api_getDirectoryId('products/product-images');
    $pos = strrpos($pdata['images_directory'], '/');
    $dname = '';
    if ($pos === false) {
        $dname = $pdata['images_directory'];
    } elseif (isset($_REQUEST['images_directory'])) {
        $dname = substr($_REQUEST['images_directory'], $pos);
    }
    if ($dname != '') {
        _createDirectory($parent_id, $dname);
    }
}
echo '<tr><th><input type="hidden" name="images_directory" value="' . $pdata['images_directory'] . '" /><div class="help products/images"></div>' . 'Images</th><td colspan="4">';
$image_directory = USERBASE . '/f/' . $pdata['images_directory'];
$dir = new DirectoryIterator($image_directory);
$n = 0;
$images = array();
foreach ($dir as $f) {
    if ($f->isDot()) {
        continue;
    }
    $images[] = $f->getFilename();
    ++$n;
}
echo '<iframe src="/ww.plugins/products/admin/uploader.php?images_directory=' . urlencode($pdata['images_directory']) . '" style="width:400px;height:50px;border:0;overflow:hidden"></iframe>';