Source for file helper.php

Documentation is available at helper.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Administrator
  4.  * @subpackage  mod_version
  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.  * Helper for mod_version
  14.  *
  15.  * @package     Joomla.Administrator
  16.  * @subpackage  mod_version
  17.  * @since       1.6
  18.  */
  19. abstract class ModVersionHelper
  20. {
  21.     /**
  22.      * Get the member items of the submenu.
  23.      *
  24.      * @param   JRegistry  &$params  The parameters object.
  25.      *
  26.      * @return  string  String containing the current Joomla version based on the selected format.
  27.      */
  28.     public static function getVersion(&$params)
  29.     {
  30.         $format  $params->get('format''short');
  31.         $product $params->get('product'0);
  32.         $method  'get' ucfirst($format"Version";
  33.  
  34.         // Get the joomla version
  35.         $instance new JVersion;
  36.         $version  call_user_func(array($instance$method));
  37.  
  38.         if ($format == 'short' && !empty($product))
  39.         {
  40.             // Add the product name to short format only (in long format it's included)
  41.             $version $instance->PRODUCT ' ' $version;
  42.         }
  43.  
  44.         return $version;
  45.     }
  46. }

Documentation generated on Tue, 19 Nov 2013 15:04:24 +0100 by phpDocumentor 1.4.3