コード例 #1
0
ファイル: sheet.php プロジェクト: netcon-source/dotspotting
#
$is_own = $owner['id'] == $GLOBALS['cfg']['user']['id'] ? 1 : 0;
$smarty->assign("is_own", $is_own);
$smarty->assign_by_ref("owner", $owner);
$smarty->assign_by_ref("sheet", $sheet);
# delete this sheet?
if ($is_own) {
    $crumb_key = 'delete-sheet';
    $smarty->assign("crumb_key", $crumb_key);
    if (post_str('delete') && crumb_check($crumb_key)) {
        if (post_str('confirm')) {
            $rsp = sheets_delete_sheet($sheet);
            $smarty->assign('deleted', $rsp);
        }
        if ($rsp['ok']) {
            $redir = urls_sheets_for_user($GLOBALS['cfg']['user']) . "?deleted=1";
            header("location: {$redir}");
            exit;
        }
        $smarty->display('page_sheet_delete.txt');
        exit;
    }
}
# Hey look! At least to start we are deliberately not doing
# any pagination on the 'dots-for-a-sheet' page. We'll see
# how long its actually sustainable but for now it keeps a
# variety of (display) avenues open.
# (20101025/straup)
$more = array('per_page' => $GLOBALS['cfg']['import_max_records']);
$sheet['dots'] = dots_get_dots_for_sheet($sheet, $GLOBALS['cfg']['user']['id'], $more);
$to_index = array($sheet['dots'][0]);
コード例 #2
0
function urls_url_for_sheet(&$sheet)
{
    $user = users_get_by_id($sheet['user_id']);
    return urls_sheets_for_user($user) . "{$sheet['id']}/";
}
コード例 #3
0
<?php

#
# $Id$
#
include "include/init.php";
#################################################################
$owner = users_ensure_valid_user_from_url();
$smarty->assign_by_ref('owner', $owner);
#################################################################
$page = get_int32('page');
$args = array('page' => $page);
$sheets = sheets_sheets_for_user($owner, $GLOBALS['cfg']['user']['id'], $args);
$counts = sheets_counts_for_user($owner, $GLOBALS['cfg']['user']['id']);
$is_own = $owner['id'] == $GLOBALS['cfg']['user']['id'] ? 1 : 0;
$smarty->assign("is_own", $is_own);
$smarty->assign_by_ref('sheets', $sheets);
$smarty->assign_by_ref('counts', $counts);
$smarty->assign("pagination_url", urls_sheets_for_user($owner));
$smarty->display('page_user_sheets.txt');
exit;