Ejemplo n.º 1
0
function kfm_api_createDirectory($parent, $name)
{
    $r = kfm_createDirectory($parent, $name);
    foreach ($r['directories'] as $dir) {
        if ($dir[0] == $name) {
            return $dir[2];
        }
    }
    return 0;
}
Ejemplo n.º 2
0
 // { filename
 $filename = $file['name'];
 if (isset($_REQUEST['rename_to'])) {
     $filename = $_REQUEST['rename_to'];
 }
 // }
 // { directory
 if (isset($_REQUEST['directory_name'])) {
     $dirs = explode(DIRECTORY_SEPARATOR, trim($_REQUEST['directory_name'], ' ' . DIRECTORY_SEPARATOR));
     $subdir = $user_root_dir;
     $startup_sequence_array = array();
     foreach ($dirs as $dirname) {
         $parent = $subdir;
         $subdir = $parent->getSubdir($dirname);
         if (!$subdir) {
             kfm_createDirectory($parent->id, $dirname);
             $subdir = $parent->getSubdir($dirname);
         }
         $kfm_startupfolder_id = $subdir->id;
     }
     $kfm_session->set('cwd_id', $kfm_startupfolder_id);
     $cwd = $kfm_startupfolder_id;
 } else {
     $cwd = $kfm_session->get('cwd_id');
 }
 if (isset($_REQUEST['cwd']) && $_REQUEST['cwd'] > 0) {
     $cwd = $_REQUEST['cwd'];
 }
 // }
 if (!$cwd) {
     $errors[] = kfm_lang('CWD not set');