Exemple #1
0
        }
        fm_update_link($store, $groupid, $linkid, $id, $rootdir);
        notify(get_string('msgmodificationok', 'block_file_manager'), 'notifysuccess');
        if (!$popup) {
            redirect("view.php?id={$id}&groupid={$groupid}&rootdir={$rootdir}");
        } else {
            redirect("link_manage.php?id={$id}&groupid={$groupid}&popup=close&rootdir={$rootdir}");
        }
    }
}
if ($linkid != NULL) {
    // Modding existing link
    if ($groupid == 0) {
        fm_user_owns_link($linkid);
    } else {
        fm_group_owns_link($linkid, $groupid);
    }
    echo '<br/>' . print_simple_box(text_to_html(get_string('msgmodlink', 'block_file_manager')), 'center', '') . '<br/>';
} else {
    echo '<br/>' . print_simple_box(text_to_html(get_string('msgaddlink', 'block_file_manager')), 'center', '') . '<br/>';
}
print_simple_box_start('center', '', '#C0C0C0');
$linkrec = NULL;
if ($linkid != NULL) {
    if ($groupid == 0) {
        $linkrec = fm_get_user_link($linkid);
    } else {
        $linkrec = fm_get_group_link($linkid, $groupid);
    }
    $store->name = $linkrec->name;
    $store->category = $linkrec->category;
     $list->inusemsg = $tempmessage;
     break;
     // removes a link
 // removes a link
 case 'link':
     $linkshared = 0;
     $tmpcount = 0;
     /* if (!is_array($cb["c"])) { 	
     			echo "n'est pas un tableau <br/> \n"; 		test pour voir si c'est un tableau
     			}  */
     // F($cb);
     foreach ($cb as $c) {
         $tmplist = "";
         if ($c != 0) {
             // Ensures the user owns the link
             if ($groupid == 0 && !fm_user_owns_link($c) || $groupid != 0 && !fm_group_owns_link($c, $groupid)) {
                 die;
                 // backup...
             }
             if (!isset($_POST['yesdel']) && !isset($_POST['nodel'])) {
                 $tmpcount = $linkshared;
                 // Checks if user has shared the file
                 if (($tmpcount += count_records('fmanager_shared', 'sharedlink', $c)) > $linkshared) {
                     $tmplist .= "* ";
                 }
                 $linkshared += $tmpcount;
                 $tmprec = get_record('fmanager_link', 'id', $c);
                 $tmplist .= $tmprec->name;
                 $list->thelist[] = $tmplist;
             }
             // delete confirmed
Exemple #3
0
$type = 0;
// Link shared by default
if ($from == 'link') {
    $type = 0;
    foreach ($cb as $c) {
        if (substr($c, 0, 2) == 'f-') {
            if ($groupid == 0) {
                fm_user_owns_folder(substr($c, 2));
            } else {
                fm_group_owns_folder(substr($c, 2), $groupid);
            }
        } else {
            if ($groupid == 0) {
                fm_user_owns_link($c);
            } else {
                fm_group_owns_link($c, $groupid);
            }
        }
    }
} elseif ($from == 'category') {
    $type = 1;
    foreach ($cb as $c) {
        if ($groupid == 0) {
            fm_user_owns_cat($c);
        } else {
            fm_group_owns_cat($c, $groupid);
        }
    }
} elseif ($from == 'folder') {
    // $from is folder only when sharing 1 folder
    $type = 2;