This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ if ( ! function_exists('akv_admin_notify') ) : /** * Displays admin notices. * * @param $message Message to display. * @return void */ function akv_admin_notify( $message = '' ) { if ( empty($message) ) { $message = __('Settings saved.'); } echo '

' . $message . '

'; } endif; if ( ! function_exists('akv_admin_error') ) : /** * Displays admin ERRORS. * * @param $message Message to display. * @return void */ function akv_admin_error( $message ) { echo '

' . $message . '

'; } endif; if ( ! function_exists('akv_pager') ) : /** * Generic pager. * * @param int $total Total elements to paginate. * @param int $in_page Number of elements per page. * @param $current Current page number. * @param $url Base url for links. Only page numbers are appended. * @return string Formated pager. */ function akv_pager( $total, $in_page, $url, $current = 0 ) { if ( 0 == $current ) $current = 1; $pages = $total / $in_page; $pages = ( $pages == intval($pages) ) ? intval($pages) : intval($pages) + 1; if ( $pages == 1 ) { $out = ''; } else { $out = '
'; if ( $current != 1 ) { $start = $current - 1; $out .= ''; } for ( $i = 1; $i <= $pages; $i++ ) { if ( $i == $current ) { $out .= ''. $i .''; } else { $out .= ''. $i .''; } } if ( $current != $pages ) { $start = $current + 1; $out .= ''; } $out .= '
'; } return $out; } endif;