Пример #1
0
/**
 * This function shows the address book sort button.
 *
 * @param integer $abook_sort_order Current sort value
 * @param string  $alt_tag          The alt tag value (string
 *                                  visible to text only browsers)
 * @param integer $Down             Sort value when list is sorted
 *                                  ascending
 * @param integer $Up               Sort value when list is sorted
 *                                  descending
 * @param array   $uri_extra        Any additional parameters to add
 *                                  to the button's link, as an
 *                                  associative array of key/value pairs
 *                                  (OPTIONAL; default none)
 *
 * @return string html code with sorting images and urls
 *
 */
function show_abook_sort_button($abook_sort_order, $alt_tag, $Down, $Up, $uri_extra = array())
{
    global $form_url, $icon_theme_path;
    /* Figure out which image we want to use. */
    if ($abook_sort_order != $Up && $abook_sort_order != $Down) {
        $img = 'sort_none.png';
        $text_icon = '◻';
        // U+25FB WHITE MEDIUM SQUARE
        $which = $Up;
    } elseif ($abook_sort_order == $Up) {
        $img = 'up_pointer.png';
        $text_icon = '⇧';
        // U+21E7 UPWARDS WHITE ARROW
        $which = $Down;
    } else {
        $img = 'down_pointer.png';
        $text_icon = '⇩';
        // U+21E9 DOWNWARDS WHITE ARROW
        $which = 8;
    }
    $uri_extra['abook_sort_order'] = $which;
    $uri = set_uri_vars($form_url, $uri_extra, FALSE);
    /* Now that we have everything figured out, show the actual button. */
    return create_hyperlink($uri, getIcon($icon_theme_path, $img, $text_icon, $alt_tag), '', '', '', '', '', array('style' => 'text-decoration:none', 'title' => $alt_tag), FALSE);
}
Пример #2
0
/**
 * Build a page (pagination) link for use with the address book list page
 *
 * @param int    $page_number       The page number for the link
 * @param string $text              The link text
 * @param array  $current_page_args All known query string arguments
 *                                  for the current page request; structured
 *                                  as an associative array of key/value pairs
 *
 */
function make_abook_paginator_link($page_number, $text, $current_page_args)
{
    $uri = sqm_baseuri() . 'src/addressbook.php';
    $current_page_args['page_number'] = $page_number;
    $uri = set_uri_vars($uri, $current_page_args, FALSE);
    return create_hyperlink($uri, $text);
}