Differences

This shows you the differences between two versions of the page.

Link to this comparison view

en:entwickler:neue_organisationseinstellungen_einbauen [2015/11/04 17:30]
thomas-rcv created
en:entwickler:neue_organisationseinstellungen_einbauen [2016/12/03 15:00] (current)
ximex typos and urls
Line 3: Line 3:
  
 ===== 1. Built in the installation script ===== ===== 1. Built in the installation script =====
-The variable is also available with a new installation with a default value, a corresponding entry in the **adm_install/​scripts/​preferences.php** in the array **$orga_preferences** must be added. Naming the variable you should make sure that at the beginning of the name the module name is determined where the variable is used and that the name is as descriptive as possible eg. **profile_show_map_link**. This is more understanable ​in the code, what the variable is and what it is intended for.+The variable is also available with a new installation with a default value, a corresponding entry in the **adm_install/​scripts/​preferences.php** in the array **$orga_preferences** must be added. Naming the variable you should make sure that at the beginning of the name the module name is determined where the variable is used and that the name is as descriptive as possible eg. **profile_show_map_link**. This is more understandable ​in the code, what the variable is and what it is intended for.
  
 Users who update Admidio also automatically receive the settings from the preferences.php. A SQL entry are must be created in the file **upd_x_x.conv.php** if you want, however here set other default parameter (eg to maintain a previous operation). An example is available in upd_1_3_conv.php line 56 - 102. If there are no entries in the current script, the loop must also be copied on all organizations! Users who update Admidio also automatically receive the settings from the preferences.php. A SQL entry are must be created in the file **upd_x_x.conv.php** if you want, however here set other default parameter (eg to maintain a previous operation). An example is available in upd_1_3_conv.php line 56 - 102. If there are no entries in the current script, the loop must also be copied on all organizations!
Line 16: Line 16:
  
 ===== Alternative for developing and testing===== ===== Alternative for developing and testing=====
-If I want only add a new setting to test something, so I can do this directly in the database via phpMyAdmin or MySQL Query Browser once. Here you just have to take in account the Orga-Id and naming the variables with a usefull ​name(eg '​test_variable'​) with initial value ('​Test'​).+If I want only add a new setting to test something, so I can do this directly in the database via phpMyAdmin or MySQL Query Browser once. Here you just have to take in account the Orga-Id and naming the variables with a useful ​name(eg '​test_variable'​) with initial value ('​Test'​).
  
 Even now I can work in the scripts with the following code: <code php> echo $gPreferences["​test_variable"​];​ Output: test </​code>​ Even now I can work in the scripts with the following code: <code php> echo $gPreferences["​test_variable"​];​ Output: test </​code>​
  
 ===== Important notes ===== ===== Important notes =====
-Further settings are not necessary for the use of new variables. The variable is automatically stored and updated and is available globally under the array mentoned ​above.+Further settings are not necessary for the use of new variables. The variable is automatically stored and updated and is available globally under the array mentioned ​above.
  
 Still remember that the organization variables are stored in the session. If you change these values not on the surface, but directly in the database, it is not updated in the session. In this case, you should close the browser and restart it. Still remember that the organization variables are stored in the session. If you change these values not on the surface, but directly in the database, it is not updated in the session. In this case, you should close the browser and restart it.
  
  • en/entwickler/neue_organisationseinstellungen_einbauen.txt
  • Last modified: 2016/12/03 15:00
  • by ximex