Changing Language & Theme screen

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
User avatar
pilandros
Veteran Member
Posts: 93
Joined: 2014-02-13 18:19

Changing Language & Theme screen

Post by pilandros » 2017-01-25 17:59

I've developed a rather complicated way to modify a generated project to allow the users to change Theme & Language to be used within the generated app, but it involves changes to several files on the main App folder , which may be kind of a delicate operation; it is easy to mess up things whis way...
It would be great to have scripts for reach this changes within the hooks folder instead, but I couldn't think of anything now. (May be a subject for a new AG version release?)

The changes to customize language-selection for each project involves:
- using a specific finlename for each language. Obviously you have to have a "languate.php" version for each language, named "language_xx.php" where "xx" are the 2-digit ISO 639-1 codes to identify each language, ie. en, sp, it, ru, etc.
- modifying the config.php file to include the global variable $langdefault (which will contain the 2-char language set) which will be used to generate a new language filename to be included on each script via the "header.php" file
- To allow each user to select his/her own language, I modified the membership_profile where I inserted a new <div></div> that contains the lines to change/select the languages available for each user, then I have to load the config parameters again (now since ver 5.60 I am looking at settings-manager.php)

The changes to ustomize theme-selection for each project involves:
- having a new file named "themecss_{$usr}.txt", this file will contain the name of the css file selected for the {$usr}.
- Then in the header.php change the corresponding lines to include that css filename as the new theme, instead of the AppGini choosen theme.
- TYo allow each user to choose/select his/her theme, I included a new <div></div> section within the membership_profile.php file to show a list of css files available to choose from; these lines also creates the "themecss_{$usr}.txt" file.

Any thoughts or suggestions on these subject? to improve this method? or a new way to reach the same results?

FTH Abrar
Posts: 4
Joined: 2017-01-11 05:28

Re: Changing Language & Theme screen

Post by FTH Abrar » 2017-02-06 10:06

We are trying to perform the same especially on the language change, appreciate anyone whom have done it successfully to share your sample codes. Thanks in advance.

Post Reply