ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 8181


Ignore:
Timestamp:
Sep 3, 2008, 6:20:40 PM (13 years ago)
Author:
ebihara
Message:

#2809:admin_make_pager() -> util_make_pager()

Location:
OpenPNE/trunk/webapp
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/trunk/webapp/lib/db/file.php

    r6527 r8181  
    4444    $total_num = db_get_one($sql);
    4545
    46     $pager = admin_make_pager($page, $page_size, $total_num);
     46    $pager = util_make_pager($page, $page_size, $total_num);
    4747
    4848    return $c_file_list;
  • OpenPNE/trunk/webapp/lib/db/image.php

    r4933 r8181  
    4242    $total_num = $db->get_one($sql);
    4343
    44     $pager = admin_make_pager($page, $page_size, $total_num);
     44    $pager = util_make_pager($page, $page_size, $total_num);
    4545    return $c_image_list;
    4646}
  • OpenPNE/trunk/webapp/modules/admin/lib/db_admin.php

    r8154 r8181  
    2020    $sql = 'SELECT COUNT(*) FROM c_member';
    2121    $total_num = db_get_one($sql);
    22     $pager = admin_make_pager($page, $page_size, $total_num);
     22    $pager = util_make_pager($page, $page_size, $total_num);
    2323
    2424    return $c_member_list;
     
    896896
    897897    if ($total_num > 0) {
    898         $pager = admin_make_pager($page, $page_size, $total_num);
     898        $pager = util_make_pager($page, $page_size, $total_num);
    899899    } else {
    900900        $pager = array('page_size' => $page_size);
     
    26302630    $sql = 'SELECT count(*) FROM c_free_page';
    26312631    $total_num = db_get_one($sql, $params);
    2632     $pager = admin_make_pager($page, $page_size, $total_num);
     2632    $pager = util_make_pager($page, $page_size, $total_num);
    26332633
    26342634    return $list;
     
    26532653    $sql = 'SELECT count(*) FROM c_api';
    26542654    $total_num = db_get_one($sql, $params);
    2655     $pager = admin_make_pager($page, $page_size, $total_num);
     2655    $pager = util_make_pager($page, $page_size, $total_num);
    26562656
    26572657    return $list;
     
    28122812    $sql = 'SELECT count(*) FROM c_send_messages_history';
    28132813    $total_num = db_get_one($sql, $params);
    2814     $pager = admin_make_pager($page, $page_size, $total_num);
     2814    $pager = util_make_pager($page, $page_size, $total_num);
    28152815
    28162816    return $history_list;
     
    31703170    $total_num = $db->get_one($sql, $params);
    31713171
    3172     $pager = admin_make_pager($page, $page_size, $total_num);
     3172    $pager = util_make_pager($page, $page_size, $total_num);
    31733173    return $c_image_album_list;
    31743174}
     
    31903190    $total_num = $db->get_one($sql, $params);
    31913191
    3192     $pager = admin_make_pager($page, $page_size, $total_num);
     3192    $pager = util_make_pager($page, $page_size, $total_num);
    31933193    return $c_image_album_list;
    31943194}
  • OpenPNE/trunk/webapp/modules/admin/lib/etc_admin.php

    r6527 r8181  
    3030    $inc_smarty->assign('is_secure', $is_secure);
    3131    return $inc_smarty->ext_fetch('inc_footer.tpl');
    32 }
    33 
    34 function admin_make_pager($page, $page_size, $total_num)
    35 {
    36     if ($total_num == 0) {
    37         return;
    38     }
    39     $pager = array(
    40         'page' => $page,
    41         'page_size' => $page_size,
    42         'total_num' => $total_num,
    43         'start_num' => ($page - 1) * $page_size + 1,
    44         'end_num' => $page * $page_size,
    45         'total_page' => ceil($total_num / $page_size),
    46         'prev_page' => 0,
    47         'next_page' => 0,
    48     );
    49 
    50     // 表示している最後の番号
    51     if ($pager['end_num'] > $pager['total_num'])
    52         $pager['end_num'] = $pager['total_num'];
    53 
    54     // 前ページ
    55     if ($pager['page'] > 1)
    56         $pager['prev_page'] = $page - 1;
    57 
    58     // 次ページ
    59     if ($pager['end_num'] < $pager['total_num'])
    60         $pager['next_page'] = $page + 1;
    61 
    62     $disp_first = max(($page - 10), 1);
    63     $disp_last = min(($page + 9), $pager['total_page']);
    64     for (; $disp_first <= $disp_last; $disp_first++) {
    65         $pager['disp_pages'][] = $disp_first;
    66     }
    67 
    68     return $pager;
    6932}
    7033
  • OpenPNE/trunk/webapp/modules/portal/lib/db_portal.php

    r7330 r8181  
    364364    $total_num = db_get_one($sql);
    365365
    366     $pager = admin_make_pager($page, $page_size, $total_num);
     366    $pager = util_make_pager($page, $page_size, $total_num);
    367367    return $portal_image_list;
    368368}
Note: See TracChangeset for help on using the changeset viewer.