formating.php
57 lines
| 1 | <?php |
| 2 | /** |
| 3 | * General formating functions. |
| 4 | * Used to format output data and send messages to user. |
| 5 | * |
| 6 | * @version $Rev: 199485 $ |
| 7 | * @author Jordi Canals |
| 8 | * @copyright Copyright (C) 2008, 2009, 2010 Jordi Canals |
| 9 | * @license GNU General Public License version 2 |
| 10 | * @link http://alkivia.org |
| 11 | * @package Alkivia |
| 12 | * @subpackage Framework |
| 13 | * |
| 14 | |
| 15 | Copyright 2008, 2009, 2010 Jordi Canals <devel@jcanals.cat> |
| 16 | |
| 17 | This program is free software; you can redistribute it and/or |
| 18 | modify it under the terms of the GNU General Public License |
| 19 | version 2 as published by the Free Software Foundation. |
| 20 | |
| 21 | This program is distributed in the hope that it will be useful, |
| 22 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 23 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 24 | GNU General Public License for more details. |
| 25 | |
| 26 | You should have received a copy of the GNU General Public License |
| 27 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 28 | */ |
| 29 | |
| 30 | /** |
| 31 | * Displays admin notices. |
| 32 | * |
| 33 | * @param $message Message to display. |
| 34 | * @return void |
| 35 | */ |
| 36 | function ak_admin_notify( $message = '' ) |
| 37 | { |
| 38 | if ( is_admin() ) { |
| 39 | if ( empty($message) ) { |
| 40 | $message = __('Settings saved.', 'capsman-enhanced'); |
| 41 | } |
| 42 | echo '<div id="message" class="updated fade"><p><strong>' . $message . '</strong></p></div>'; |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * Displays admin ERRORS. |
| 48 | * |
| 49 | * @param $message Message to display. |
| 50 | * @return void |
| 51 | */ |
| 52 | function ak_admin_error( $message ) |
| 53 | { |
| 54 | if ( is_admin() ) { |
| 55 | echo '<div id="error" class="error"><p><strong>' . $message . '</strong></p></div>'; |
| 56 | } |
| 57 | } |