コード例 #1
0
ファイル: interface.php プロジェクト: thezawad/vakuum
        }
        $right_size = $size - $left_size - 1;
        if ($current + $right_size > $total) {
            $right_size = $total - $current;
            $left_size = $size - $right_size - 1;
        }
        $bound = $current - $left_size;
        if ($bound != 1) {
            $html .= '<span class="extend">...</span>' . "\n";
        }
        for ($i = $bound; $i < $current; ++$i) {
            $html .= self::list_navigation_make_url($i, $i) . "\n";
        }
        $html .= '<span class="current">' . $current . '</span>' . "\n";
        $bound = $current + $right_size;
        for ($i = $current + 1; $i <= $bound; ++$i) {
            $html .= self::list_navigation_make_url($i, $i) . "\n";
        }
        if ($bound != $total) {
            $html .= '<span class="extend">...</span>' . "\n";
        }
        if ($current != $total) {
            $html .= self::list_navigation_make_url($current + 1, '&raquo;') . "\n";
            $html .= self::list_navigation_make_url($total, 'Last') . "\n";
        }
        $html .= '</div>' . "\n";
        return $html;
    }
}
list_navigation::initialize();