Community
OpenEnergyMonitor

Community

Help to change default user interface

hi,
i am teacher of technology in france and i use emoncms with the children. i want the default language is french when a child create a new account. and i only want in the menu the followings modules : inputs, feeds, graphs and dashboard cause it s enough and more secure to use in the classroom. which files, folders should it be modified, please ?
thanks a lot
laurent

Hi, I believe the default TZ and language are hardcoded at these points

As for limiting the menu’s,

Each module has a small file called ???_menu.php (where ??? is the module name) eg for the admin module see https://github.com/emoncms/emoncms/blob/master/Modules/admin/admin_menu.php

these menu files are all picked up by the emoncms theme by menu_view.php (https://github.com/emoncms/emoncms/blob/master/Theme/basic/menu_view.php) I guess you have at least 2 choices, you could either rename each ???_menu.php file in the modules you do not want to show (so they are not found) or to add some filtering to the functions in menu_view.php.

This is all theoretical so please let us know how you get on.

Hello and thank you. for the modification of the menus it works. But you can not force the timezone or the language. I had indeed already corrected the files you quote. An other idea ?

Have you tried editing the default mysql schema for the user table?

yes without successTZ-languageemoncms1

Seems to me the language setting starts from here

It pulls in the language from the account setting (settings - My Account).

If the user setting is blank, it looks at the php setting $_SERVER['HTTP_ACCEPT_LANGUAGE']

You can see what this is set to in phpinfo.php

The code takes this array and assumes the first language listed is the preferred language. Is French listed first in the above php env variable?

thanks a lot!
But php-info.php is blank !?capturephpinfo

If you open it in a browser [IP address]/emoncms/php-info.php from the same LAN it should be fine. You are just editing the file there - phpinfo is generated dynamically.

I just had a look, and language is set by the browser I think https://superuser.com/questions/1263533/how-is-serverhttp-accept-language-computed

Thanks !
i read


and after what should i do ?

I’ll have a look tonight at the code.

If you set the language in the user account, does that display correctly?

[edit]
One other piece of information. Could you run this command and post the output please.

locale -a

(might need sudo)
[edit2]
Unless you have set the locale on the RPi(?) it is likely to be the default en (you will see what is available using locale -a). Unless it is available, the server cannot be set to use it (I think).

I think If you use sudo raspi-config and set up the localisations, it will load the required packages so the server can respond correctly.

Lots of guessing at this point :smile:.

@laurent_chastain - how did you get on?

hope this helps… https://github.com/emoncms/emoncms/pull/1377