[ Index ]

PHP Cross Reference of Joomla 1.5.26 DE

title

Body

[close]

/libraries/joomla/html/toolbar/button/ -> help.php (source)

   1  <?php
   2  /**
   3  * @version        $Id: help.php 14401 2010-01-26 14:10:00Z louis $
   4  * @package        Joomla.Framework
   5  * @subpackage    HTML
   6  * @copyright    Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
   7  * @license        GNU/GPL, see LICENSE.php
   8  * Joomla! is free software. This version may have been modified pursuant
   9  * to the GNU General Public License, and as distributed it includes or
  10  * is derivative of works licensed under the GNU General Public License or
  11  * other free or open source software licenses.
  12  * See COPYRIGHT.php for copyright notices and details.
  13  */
  14  
  15  // Check to ensure this file is within the rest of the framework
  16  defined('JPATH_BASE') or die();
  17  
  18  /**
  19   * Renders a help popup window button
  20   *
  21   * @package     Joomla.Framework
  22   * @subpackage        HTML
  23   * @since        1.5
  24   */
  25  class JButtonHelp extends JButton
  26  {
  27      /**
  28       * Button type
  29       *
  30       * @access    protected
  31       * @var        string
  32       */
  33      var $_name = 'Help';
  34  
  35  	function fetchButton( $type='Help', $ref = '', $com = false )
  36      {
  37          $text    = JText::_('Help');
  38          $class    = $this->fetchIconClass('help');
  39          $doTask    = $this->_getCommand($ref, $com);
  40  
  41          $html    = "<a href=\"#\" onclick=\"$doTask\" class=\"toolbar\">\n";
  42          $html .= "<span class=\"$class\" title=\"$text\">\n";
  43          $html .= "</span>\n";
  44           $html    .= "$text\n";
  45          $html    .= "</a>\n";
  46  
  47          return $html;
  48      }
  49  
  50      /**
  51       * Get the button id
  52       *
  53       * Redefined from JButton class
  54       *
  55       * @access        public
  56       * @param        string    $name    Button name
  57       * @return        string    Button CSS Id
  58       * @since        1.5
  59       */
  60  	function fetchId($name)
  61      {
  62          return $this->_parent->_name.'-'."help";
  63      }
  64  
  65      /**
  66       * Get the JavaScript command for the button
  67       *
  68       * @access    private
  69       * @param    object    $definition    Button definition
  70       * @return    string    JavaScript command string
  71       * @since    1.5
  72       */
  73  	function _getCommand($ref, $com)
  74      {
  75          // Get Help URL
  76          jimport('joomla.language.help');
  77          $url = JHelp::createURL($ref, $com);
  78  
  79          $cmd = "popupWindow('$url', '".JText::_('Help', true)."', 640, 480, 1)";
  80  
  81          return $cmd;
  82      }
  83  }


Generated: Wed Mar 28 15:54:07 2012 Cross-referenced by PHPXref 0.7.1