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

Source for file function.lang.php

Documentation is available at function.lang.php

  1. <?php
  2. /**
  3.  * Zikula Application Framework
  4.  *
  5.  * @copyright (c) 2004, Zikula Development Team
  6.  * @link http://www.zikula.org
  7.  * @version $Id: function.lang.php 24342 2008-06-06 12:03:14Z markwest $
  8.  * @license GNU/GPL - http://www.gnu.org/copyleft/gpl.html
  9.  * @package Zikula_Template_Plugins
  10.  * @subpackage Functions
  11.  */
  12.  
  13. /**
  14.  * Smarty function to get the site's language
  15.  *
  16.  * available parameters:
  17.  *  - assign      if set, the language will be assigned to this variable
  18.  *
  19.  * Example
  20.  * <html lang="<!--[lang]-->">
  21.  *
  22.  * @author   Jörg Napp
  23.  * @since    03. Feb. 04
  24.  * @param    array    $params     All attributes passed to this function from the template
  25.  * @param    object   $smarty     Reference to the Smarty object
  26.  * @return   string   the language
  27.  */
  28. function smarty_function_lang($params&$smarty)
  29. {
  30.     if (!defined('_LOCALE')) {
  31.         define('_LOCALE','en_US');
  32.     }
  33.     $p strpos(_LOCALE'.');
  34.     $p $locale substr(_LOCALE0$p$locale _LOCALE;
  35.     return DataUtil::formatForDisplay($locale);
  36. }

Documentation generated on Fri, 18 Jul 2008 21:45:27 +0200 by phpDocumentor 1.4.1