Exemplo n.º 1
0
    $sql_pfs_update = $db->query("UPDATE {$db_pfs} SET\n\t\tpfs_desc='" . $db->prep($rdesc) . "',\n\t\tpfs_folderid={$folderid}\n\t\tWHERE pfs_userid={$userid} AND pfs_id={$id}");
    cot_redirect(cot_url('pfs', "f={$pfs_folderid}&" . $more, '', true));
}
/* ============= */
$out['subtitle'] = $L['pfs_title'];
if (!$standalone) {
    require_once $cfg['system_dir'] . '/header.php';
}
$t = new XTemplate(cot_tplfile('pfs.edit'));
if ($standalone) {
    cot_sendheaders();
    $html = Resources::render();
    if ($html) {
        $out['head_head'] = $html . $out['head_head'];
    }
    $t->assign(array('PFS_HEAD' => $out['head_head']));
    $t->parse('MAIN.STANDALONE_HEADER');
    $t->parse('MAIN.STANDALONE_FOOTER');
}
$t->assign(array('PFS_TITLE' => cot_breadcrumbs($title, $cfg['homebreadcrumb']), 'PFS_ACTION' => cot_url('pfs', 'm=edit&a=update&id=' . $pfs_id . '&' . $more), 'PFS_FILE' => $pfs_file, 'PFS_DATE' => cot_date('datetime_medium', $pfs_date), 'PFS_DATE_STAMP' => $pfs_date, 'PFS_FOLDER' => cot_selectbox_folders($userid, '', $pfs_folderid), 'PFS_URL' => $ff, 'PFS_DESC' => cot_inputbox('text', 'rdesc', $pfs_desc, 'size="56" maxlength="255"'), 'PFS_SIZE' => cot_build_filesize($pfs_size_bytes, 1), 'PFS_SIZE_BYTES' => $pfs_size_bytes, 'PFS_SIZE_KB' => $pfs_size_bytes / 1024));
cot_display_messages($t);
/* === Hook === */
foreach (cot_getextplugins('pfs.edit.tags') as $pl) {
    include $pl;
}
/* ===== */
$t->parse('MAIN');
$t->out('MAIN');
if (!$standalone) {
    require_once $cfg['system_dir'] . '/footer.php';
}
Exemplo n.º 2
0
        $pagnavParams = 'f=' . $f;
        if (!empty($more)) {
            $pagnavParams .= '&' . $more;
        }
        $pagnavParams .= $thumbspagination;
        $pagenav = cot_pagenav('pfs', $pagnavParams, $d, $totalitems, $cfg['pfs']['maxpfsperpage']);
        $filesinfolder .= $f > 0 ? $L['pfs_filesinthisfolder'] : $L['pfs_filesintheroot'];
        $t->assign(array('PFS_FILESCOUNT_TITLE' => cot_declension($files_count, $Ls['Files']), 'PFS_ONPAGE_FILES_TITLE' => cot_declension($iji, $Ls['Files']), 'PFS_FILESCOUNT' => $files_count, 'PFS_INTHISFOLDER' => $filesinfolder, 'PFS_ONPAGE_FILES' => $iji, 'PFS_PAGING_PREV' => $pagenav['prev'], 'PFS_PAGING_CURRENT' => $pagenav['main'], 'PFS_PAGING_NEXT' => $pagenav['next']));
    }
}
// ========== Statistics =========
$showthumbs .= $opt != 'thumbs' && $files_count > 0 && $cfg['pfs']['th_amode'] != 'Disabled' ? cot_rc_link(cot_url('pfs', 'f=' . $f . '&' . $more . '&opt=thumbs'), $L['Thumbnails']) : '';
$t->assign(array('PFS_TOTALSIZE' => cot_build_filesize($pfs_totalsize, 1), 'PFS_TOTALSIZE_BYTES' => $pfs_totalsize, 'PFS_TOTALSIZE_KB' => floor($pfs_totalsize / 1024), 'PFS_MAXTOTAL' => cot_build_filesize($maxtotal, 1), 'PFS_MAXTOTAL_BYTES' => $maxtotal, 'PFS_MAXTOTAL_KB' => $maxtotal / 1024, 'PFS_PERCENTAGE' => $maxtotal > 0 ? round($pfs_totalsize / $maxtotal * 100) : 0, 'PFS_MAXFILESIZE' => cot_build_filesize($maxfile, 1), 'PFS_MAXFILESIZE_BYTES' => $maxfile, 'PFS_MAXFILESIZE_KB' => $maxfile / 1024, 'PFS_SHOWTHUMBS' => $showthumbs));
// ========== Upload =========
$t->assign(array('PFS_UPLOAD_FORM_MAX_SIZE' => $maxfile, 'PFS_UPLOAD_FORM_USERID' => $userid));
$t->assign(array('PFS_UPLOAD_FORM_ACTION' => cot_url('pfs', "f={$f}&a=upload&{$more}"), 'PFS_UPLOAD_FORM_FOLDERS' => cot_selectbox_folders($userid, '', $f)));
for ($ii = 0; $ii < $cfg['pfs']['pfsmaxuploads']; $ii++) {
    $t->assign(array('PFS_UPLOAD_FORM_ROW_ID' => $ii, 'PFS_UPLOAD_FORM_ROW_NUM' => $ii + 1));
    $t->parse('MAIN.PFS_UPLOAD_FORM.PFS_UPLOAD_FORM_ROW');
}
$t->parse('MAIN.PFS_UPLOAD_FORM');
// ========== Allowed =========
reset($cot_extensions);
sort($cot_extensions);
foreach ($cot_extensions as $k => $line) {
    $t->assign(array('ALLOWED_ROW_ICON' => $icon[$line[0]], 'ALLOWED_ROW_EXT' => $line[0], 'ALLOWED_ROW_DESC' => $filedesc[$line[0]]));
    $t->parse('MAIN.ALLOWED_ROW');
}
// ========== Create a new folder =========
if ($usr['auth_write']) {
    $t->assign(array('NEWFOLDER_FORM_ACTION' => cot_url('pfs', 'a=newfolder&' . $more)));