if a application is installed via a symlink PHP will resolve the symlink
for __DIR__ and __FILE__ making it impossible for an application to work
out it's relative path withing the fusion system.
By providing $app_path during upgrade routines an application will
beable to provide the correct link for menu items (e.g.
/opt/languages/index.php) instead of having to hard code it where it
could change depending on how the application was installed
convert all app_menu.php files to have all placeholders and languages and use 2-2 format for languages
update app_defaults to convert any items found using legacy values in user_setings, domain_settings and default_settings
when a translation is missing/blank take it from en-us
take the list of lanaguages from text class so all languages get a value
(should fix missing logout button in some languages)
So, please find in this set numerous small changes which eliminate numerous php warning messages.
Also, a small bug fix in an sql statistics routine, naming a count(*) field as count, so displaying correct detail.
If any of the proposed changes are omitted, the relevant page will experience php warnings.
There are no doubt fusionpbx pages I've yet to visit that still generate warnings, this set is nearly certainly not comprehensive.
Problem now in `tepmplate.php`
```PHP
$menu_array = $menu->menu_array();
...
foreach ($menu_array as $index_main => $menu_parent) {
```
It appear while install process because in this moment there not `$db`
and `$menu->menu_array()` returns nothing.
This problem also can be solved in `tepmplate.php` like
```PHP
if(is_array($menu_array)){
foreach ($menu_array as $index_main => $menu_parent) {
...
```