PageRenderTime 57ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/content/code/trunk/modules/mod_artofcontent_docman/elements/help.php

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