diff --git a/modules/command.php b/modules/command.php index 0f1d104..42da835 100644 --- a/modules/command.php +++ b/modules/command.php @@ -2,6 +2,7 @@ define("COMMAND_CLASS", "class"); define("COMMAND_EXEC", "exec"); +define("COMMAND_ICON", "icon"); function _command(array $opts) { $attr = [ @@ -12,8 +13,12 @@ function _command(array $opts) { } else { $output = null; } + if (!empty($opts[COMMAND_ICON])) { + $output = icon($opts[COMMAND_ICON]).$output; + } return panel($output, $attr, 'command'); } module("command", "Execute a command and display the output"); option("exec",COMMAND_EXEC,OPT_TYPE_STRING,"Command to execute",""); -option("class",COMMAND_CLASS,OPT_TYPE_STRING,"The class to use","system"); \ No newline at end of file +option("class",COMMAND_CLASS,OPT_TYPE_STRING,"The class to use","system"); +option("icon",COMMAND_ICON,OPT_TYPE_STRING,"Name of custom icon to be put in front of the output",""); \ No newline at end of file diff --git a/modules/text.php b/modules/text.php index b4fe734..0fec74f 100644 --- a/modules/text.php +++ b/modules/text.php @@ -2,12 +2,15 @@ define("TEXT_TEXT", "text"); define("TEXT_CLASS", "class"); +define("TEXT_ICON", "icon"); function _text(array $opts) { $attr = []; if ($opts[TEXT_CLASS]) $attr['class'] = $opts[TEXT_CLASS]; - return panel($opts[TEXT_TEXT], $attr, 'text'); + $icon = (!empty($opts[TEXT_ICON]))?icon($opts[TEXT_ICON]):""; + return panel($icon.$opts[TEXT_TEXT], $attr, 'text'); } module("text", "Show a static text"); option("text", TEXT_TEXT, "string", "The text to dispaly", "Text"); option("class", TEXT_CLASS, "string", "The class to use", "info"); +option("icon", TEXT_ICON,OPT_TYPE_STRING,"Name of custom icon to be put in front of the output",""); \ No newline at end of file