From 49f0d48171ceae2544859e2b04e3394497731c5f Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Tue, 13 Apr 2010 20:45:05 +0000 Subject: [PATCH] MDL-21695 new help_icon structure --- lib/outputcomponents.php | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/lib/outputcomponents.php b/lib/outputcomponents.php index 30dfd97ee92..abf6305082e 100644 --- a/lib/outputcomponents.php +++ b/lib/outputcomponents.php @@ -153,7 +153,7 @@ class user_picture implements renderable { */ class old_help_icon implements renderable { /** - * @var string $helpidentifier lang pack identifier (should inlcude the "_hlp" suffix) + * @var string $helpidentifier lang pack identifier */ public $helpidentifier; /** @@ -191,6 +191,41 @@ class old_help_icon implements renderable { } } +/** + * Data structure representing a help icon. + * + * @copyright 2010 Petr Skoda (info@skodak.org) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @since Moodle 2.0 + */ +class help_icon implements renderable { + /** + * @var string $identifier lang pack identifier (without the "_hlp" suffix), + * both get_string($identifier, $component) and get_string($identifier.'_hlp', $component) + * must exist. + */ + public $identifier; + /** + * @var string $component Component name, the same as in get_string() + */ + public $component; + /** + * @var string $linktext Extra descriptive text next to the icon + */ + public $linktext = null; + + /** + * Constructor + * @param string $identifier string for help page title, + * string with _hlp suffix is used for the actual help text. + * @param string $component + */ + public function __construct($pidentifier, $component) { + $this->identifier = $helpidentifier; + $this->component = $component; + } +} + /** * Data structure representing an icon. -- 2.43.0