Source for file phpsetting.php

Documentation is available at phpsetting.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Administrator
  4.  * @subpackage  com_admin
  5.  *
  6.  * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
  7.  * @license     GNU General Public License version 2 or later; see LICENSE.txt
  8.  */
  9.  
  10. defined('_JEXEC'or die;
  11.  
  12. /**
  13.  * Utility class working with phpsetting
  14.  *
  15.  * @package     Joomla.Administrator
  16.  * @subpackage  com_admin
  17.  * @since       1.6
  18.  */
  19. abstract class JHtmlPhpSetting
  20. {
  21.     /**
  22.      * Method to generate a boolean message for a value
  23.      *
  24.      * @param   boolean  $val  is the value set?
  25.      *
  26.      * @return  string html code
  27.      */
  28.     public static function boolean($val)
  29.     {
  30.         if ($val)
  31.         {
  32.             return JText::_('JON');
  33.         }
  34.         else
  35.         {
  36.             return JText::_('JOFF');
  37.         }
  38.     }
  39.  
  40.     /**
  41.      * Method to generate a boolean message for a value
  42.      *
  43.      * @param   boolean  $val  is the value set?
  44.      *
  45.      * @return  string html code
  46.      */
  47.     public static function set($val)
  48.     {
  49.         if ($val)
  50.         {
  51.             return JText::_('JYES');
  52.         }
  53.         else
  54.         {
  55.             return JText::_('JNO');
  56.         }
  57.     }
  58.  
  59.     /**
  60.      * Method to generate a string message for a value
  61.      *
  62.      * @param   string  $val  a php ini value
  63.      *
  64.      * @return  string html code
  65.      */
  66.     public static function string($val)
  67.     {
  68.         if (empty($val))
  69.         {
  70.             return JText::_('JNONE');
  71.         }
  72.         else
  73.         {
  74.             return $val;
  75.         }
  76.     }
  77.  
  78.     /**
  79.      * Method to generate an integer from a value
  80.      *
  81.      * @param   string  $val  a php ini value
  82.      *
  83.      * @return  string html code
  84.      *
  85.      * @deprecated  4.0  Use intval() or casting instead.
  86.      */
  87.     public static function integer($val)
  88.     {
  89.         JLog::add(
  90.             'JHtmlPhpSetting::integer() is deprecated. Use intval() or casting instead.',
  91.             JLog::WARNING,
  92.             'deprecated'
  93.         );
  94.  
  95.         return (int) $val;
  96.     }
  97. }

Documentation generated on Tue, 19 Nov 2013 15:10:40 +0100 by phpDocumentor 1.4.3