Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LCDproc: add a shutdown/reboot control menu. Issue #8196 #784

Merged
merged 1 commit into from
Mar 9, 2020

Conversation

vktg
Copy link
Contributor

@vktg vktg commented Feb 28, 2020

Redmine Issue: https://redmine.pfsense.org/issues/8196
Ready for review

add a control menu with the name 'pfsense' next to the 'Options' menu of LCDproc.
Currently there are only two options implemented: Reboot and shutdown.
Structure:

Options (original LCDproc)
pfsense
  ->Reboot
    ->No
    ->Yes
  ->Shutdown
    ->No
    ->Yes

This is fixed/resolved copy of the original PR #376 by @c-schwamborn

@vktg
Copy link
Contributor Author

vktg commented Feb 28, 2020

Why we need to use printf() instead of <br /> as everywhere in this code https://github.com/pfsense/FreeBSD-ports/pull/376/files#r130587889 ?

@rbgarga
Copy link
Member

rbgarga commented Feb 28, 2020

Why we need to use printf() instead of <br /> as everywhere in this code https://github.com/pfsense/FreeBSD-ports/pull/376/files#r130587889 ?

setHelt() is one of the functions considered by our gettext config to be translated and we don't want to have HTML tags mixed with strings for translation. setHelp accepts printf() similar parameters so you can replace
by %1$s and pass '<br />' as a parameter

@vktg vktg force-pushed the lcdcontrol branch 2 times, most recently from 61c39d3 to 0607ff0 Compare February 28, 2020 12:49
@vktg
Copy link
Contributor Author

vktg commented Feb 28, 2020

Why we need to use printf() instead of <br /> as everywhere in this code https://github.com/pfsense/FreeBSD-ports/pull/376/files#r130587889 ?

setHelt() is one of the functions considered by our gettext config to be translated and we don't want to have HTML tags mixed with strings for translation. setHelp accepts printf() similar parameters so you can replace
by %1$s and pass '<br />' as a parameter

ok, fixed in all lcdproc_client.php

Comment on lines 446 to 447
if(!isset($lcdproc_config['controlmenu']))
return false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if body needs braces

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

function cmenu_enabled() {
global $config;
$lcdproc_config = $config['installedpackages']['lcdproc']['config'][0];
if(!isset($lcdproc_config['controlmenu'])) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a space between if and (

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@netgate-git-updates netgate-git-updates merged commit ebc6aa6 into pfsense:devel Mar 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants