phpPoA2
[ class tree: phpPoA2 ] [ index: phpPoA2 ] [ all elements ]

Source for file utils.php

Documentation is available at utils.php

  1. <?php
  2. /**
  3.  * @copyright Copyright 2005-2010 RedIRIS, http://www.rediris.es/
  4.  *
  5.  *  This file is part of phpPoA2.
  6.  *
  7.  *  phpPoA2 is free software: you can redistribute it and/or modify
  8.  *  it under the terms of the GNU General Public License as published by
  9.  *  the Free Software Foundation, either version 3 of the License, or
  10.  *  (at your option) any later version.
  11.  *
  12.  *  phpPoA2 is distributed in the hope that it will be useful,
  13.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.  *  GNU General Public License for more details.
  16.  *
  17.  *  You should have received a copy of the GNU General Public License
  18.  *  along with phpPoA2. If not, see <http://www.gnu.org/licenses/>.
  19.  *
  20.  * @license http://www.gnu.org/licenses/gpl.html GNU General Public License
  21.  * @version 2.0
  22.  * @author Jaime Perez <jaime.perez@rediris.es>
  23.  * @filesource
  24.  * @package phpPoA2
  25.  */
  26.  
  27. /**
  28.  * Return the internationalized message identified by the code 's'.
  29.  * @param The identifier of the message.
  30.  * @param args An array of arguments that the message expects.
  31.  * @return string The human readable message already translated.
  32.  */
  33. function msg($s$args array()) {
  34.     global $poa_messages;
  35.  
  36.     return vsprintf($poa_messages[$s]$args);
  37. }
  38.  
  39. /**
  40.  * Return the language code identifying applicable to a messages file.
  41.  * @param filename The name of the file.
  42.  * @return string The internationalization code corresponding with the file.
  43.  */
  44. function lang_code($filename{
  45.     $pat['/^.*\/messages-/';
  46.     $pat['/\.php/';
  47.     $code preg_replace($pat''$filename);
  48.     return $code;
  49. }
  50.  
  51. ?>

Documentation generated on Wed, 13 Oct 2010 15:06:26 +0200 by phpDocumentor 1.4.3