From patchwork Fri May 15 21:39:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim FitzGeorge X-Patchwork-Id: 3102 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 49P1zf6t4jz3xVh for ; Fri, 15 May 2020 21:40:30 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 49P1zf2g7Gz2f6; Fri, 15 May 2020 21:40:30 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 49P1zf1Bkmz2yCT; Fri, 15 May 2020 21:40:30 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 49P1zc1tHdz2xbY for ; Fri, 15 May 2020 21:40:28 +0000 (UTC) Received: from mail-out-auth1.hosts.co.uk (mail-out-auth1.hosts.co.uk [195.7.255.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPS id 49P1zb2qpzz2JZ for ; Fri, 15 May 2020 21:40:27 +0000 (UTC) Received: from [95.149.142.196] (helo=aragorn.hosts.co.uk.tfitzgeorge.me.uk) by smtp.hosts.co.uk with esmtpa (Exim) (envelope-from ) id 1jZi41-0005Nq-7m; Fri, 15 May 2020 22:40:21 +0100 From: Tim FitzGeorge To: development@lists.ipfire.org Subject: [PATCH 1/3] Help for GUI - ipfire theme code Date: Fri, 15 May 2020 22:39:50 +0100 Message-Id: <20200515213952.15127-2-ipfr@tfitzgeorge.me.uk> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200515213952.15127-1-ipfr@tfitzgeorge.me.uk> References: <20200515213952.15127-1-ipfr@tfitzgeorge.me.uk> MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1589578827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PWzIGSD26NMJUzz4xZhIfJqLvwp07y1cSUUR5S+qiH0=; b=YOwb4iz1lLNN21x/qVYSKL2Jsp1bRd86D1xB62c+aJCqFhYhv9mRPEfgWUm7A298tf0NeM Z3TO8hB/ihBiiGhFRXdTjmHor4AK+owQuHKU5jwQ3dezWm13AOJqbDYPDUDxJBzCBkQeuv eq/xY1eW+4+0vAfsaViVWIWWkzzGgu58cvqizG31IVhNFIZdlDy7L+y0UNlub6J5KejXuu SrOW0kCgJPCwI00rCUy8iG9x4vL5o11JrfHjL2dClkTr2J+AiI02F33BpQmdFR++oGttsC UFBQpzNT0dF0b9AYxHV6OSMR01NOLlqjPooc9MC4zzhcg7LYXMnreNF31FWSig== ARC-Seal: i=1; s=202003rsa; d=lists.ipfire.org; t=1589578827; a=rsa-sha256; cv=none; b=mTTnmtbE89B/4687GEnRQ8Insdm6ndjCTFG5E0CIDEieqMYTprJwjYh7vLqbQxHkzFGhTX QeKjkfwxoBNsHJEpvCpdWanfVdVD+xHfWaQmHbpl5U3JccA8j9ffK6Eaym2k0Jm3nviO82 8Pwv9Q+Wkp5ZM6LrxMKGNVloAZly6Oi2NCEYgHMGz1immW/4sjfUiG9xmDQXxXMWq3xii6 5MwO1wZkvEBJimsLqlopkZp9Ja4JOfZ/e5Af679Q5gf/TAIlVWiT1MOZ6SENWptzMVe6e0 Jcz3ReGclLPF2xyC5wrPcPJk+hEke4y9Bi2SKpf7h6q1bOCqgU/2wA/9ue4LTw== ARC-Authentication-Results: i=1; mail01.ipfire.org; dkim=none; spf=pass (mail01.ipfire.org: domain of ipfr@tfitzgeorge.me.uk designates 195.7.255.1 as permitted sender) smtp.mailfrom=ipfr@tfitzgeorge.me.uk Authentication-Results: mail01.ipfire.org; dkim=none; dmarc=none; spf=pass (mail01.ipfire.org: domain of ipfr@tfitzgeorge.me.uk designates 195.7.255.1 as permitted sender) smtp.mailfrom=ipfr@tfitzgeorge.me.uk X-Rspamd-Queue-Id: 49P1zb2qpzz2JZ X-Spamd-Result: default: False [0.61 / 11.00]; RCVD_TLS_LAST(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_MISSING_CHARSET(2.50)[]; R_SPF_ALLOW(-0.20)[+ip4:195.7.255.0/25]; MIME_GOOD(-0.10)[text/plain]; ARC_SIGNED(0.00)[i=1]; BROKEN_CONTENT_TYPE(1.50)[]; DMARC_NA(0.00)[tfitzgeorge.me.uk]; RECEIVED_SPAMHAUS_PBL(0.00)[95.149.142.196:received]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[]; RCPT_COUNT_TWO(0.00)[2]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM(-1.00)[-1.002]; IP_REPUTATION_SPAM(0.01)[asn: 8622(0.00), country: GB(0.01), ip: 195.7.255.1(0.00)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8622, ipnet:195.7.224.0/19, country:GB]; RCVD_COUNT_TWO(0.00)[2]; BAYES_HAM(-2.98)[99.91%]; RCVD_IN_DNSWL_LOW(-0.10)[195.7.255.1:from] X-Rspamd-Server: mail01.haj.ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Extracts help key from menu hash when building menus and adds help link to the menu. Signed-off-by: Tim FitzGeorge --- html/html/themes/ipfire/include/functions.pl | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/html/html/themes/ipfire/include/functions.pl b/html/html/themes/ipfire/include/functions.pl index 9aec77497..6eb56c628 100644 --- a/html/html/themes/ipfire/include/functions.pl +++ b/html/html/themes/ipfire/include/functions.pl @@ -39,6 +39,8 @@ require "${General::swroot}/lang.pl"; # @param submenu entries sub showsubmenu() { my $submenus = shift; + my $uri = shift; + my $help; print "
    "; foreach my $item (sort keys %$submenus) { @@ -54,16 +56,26 @@ sub showsubmenu() { } print ''.$submenus->{$item}->{'caption'}.''; + if (exists $submenus->{$item}->{'help'} and $link eq $uri) { + $help = $submenus->{$item}->{'help'}; + } + &showsubmenu($subsubmenus) if ($subsubmenus); print ''; } - print "
" + print ""; + + return $help; } ############################################################################### # # print menu html elements sub showmenu() { + $uri = shift; + my $help = ''; + my $subhelp; + print '
'; if ($settings{'SPEED'} ne 'off') { @@ -82,10 +94,11 @@ EOF next if (!is_menu_visible($link) or $link eq ''); print '
  • '.$menu->{$k1}->{'caption'}.''; my $submenus = $menu->{$k1}->{'subMenu'}; - &showsubmenu($submenus) if ($submenus); + $help .= &showsubmenu($submenus, $uri) if ($submenus); print "
  • "; } + print '
  • ?
  • ' if ($help); print "
    "; } @@ -168,7 +181,7 @@ print <