PageRenderTime 47ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/googlemini/code/trunk/administrator/components/com_artofgm/helpers/elements/help.php

https://bitbucket.org/eddieajau/the-art-of-joomla-archive
PHP | 81 lines | 31 code | 8 blank | 42 comment | 1 complexity | 92e71b7cf1577af956f10d84da9b7b93 MD5 | raw file
  1. <?php
  2. /**
  3. * @version $Id: help.php 518 2011-01-07 06:36:43Z eddieajau $
  4. * @package NewLifeInIT
  5. * @subpackage com_artofgm
  6. * @copyright Copyright 2011 New Life in IT Pty Ltd. All rights reserved.
  7. * @license GNU General Public License version 2 or later.
  8. * @link http://www.theartofjoomla.com
  9. */
  10. // No direct access
  11. defined('_JEXEC') or die;
  12. /**
  13. * This is a JHtml element that displays a help message.
  14. *
  15. * @package NewLifeInIT
  16. * @subpackage com_artofgm
  17. * @since 1.0
  18. */
  19. class JElementHelp extends JElement
  20. {
  21. /**
  22. * Element name
  23. */
  24. public $_name = 'Help';
  25. /**
  26. * Fetch the elements.
  27. *
  28. * @param string $name The name of the variable.
  29. * @param string $value The value of the variable.
  30. * @param object $node The XML node defining the variable.
  31. * @param string $controlName The name of the HTML control that stores this variable.
  32. *
  33. * @return string The HTML representation of the control.
  34. * @since 1.0
  35. */
  36. function fetchElement($name, $value, &$node, $control_name)
  37. {
  38. switch ($node->attributes('style'))
  39. {
  40. case 'notice':
  41. $style = 'background: #d2edc9;border: 1px solid #90e772;color: #2b7312;padding: 8px 10px;margin:0;';
  42. break;
  43. case 'warning':
  44. $style = 'background: #FFF3A3;border: 1px solid #E7BD72;color: #B79000;padding: 8px 10px;margin:0;';
  45. break;
  46. case 'heading':
  47. $style = 'font-size:12px;font-weight:bold;color:#fff;background-color:#888;text-align:left;padding: 5px 10px;margin:0;';
  48. break;
  49. default:
  50. $style = 'margin:0; padding: 8px 10px;';
  51. break;
  52. }
  53. return '<div style="'.$style.'">'.
  54. JText::_($value).
  55. '</div>';
  56. }
  57. /**
  58. * Fetch the tooltip for the variable label.
  59. *
  60. * @param string $label The text for the label.
  61. * @param string $description The description associated with the label.
  62. * @param object $xmlElement The XML node defining the variable.
  63. * @param string $controlName The name of the HTML control that stores this variable (optional).
  64. * @param string $name The name of the variable (optional).
  65. *
  66. * @return string The HTML representation of the label including the tooltip.
  67. * @since 1.0
  68. */
  69. function fetchTooltip($label, $description, &$xmlElement, $control_name='', $name='')
  70. {
  71. return false;
  72. }
  73. }