Enhance - Display text on app_defaults (#2645)

enable display_type on domains (and therefore app_defaults)
capture the output of app_defaults
format if statements to project preference
use more generic label display for results reducing number of translations required
change upgrade.php to use the more consistent $display_type
This commit is contained in:
Mafoo
2017-06-08 16:39:50 +01:00
committed by FusionPBX
parent f0feb25016
commit bfe3ff173f
4 changed files with 46 additions and 53 deletions
+7 -6
View File
@@ -32,7 +32,7 @@
set_include_path($document_root);
require_once "resources/require.php";
$_SERVER["DOCUMENT_ROOT"] = $document_root;
$format = 'text'; //html, text
$display_type = 'text'; //html, text
}
else {
include "root.php";
@@ -45,7 +45,7 @@
echo "access denied";
exit;
}
$format = 'html';
$display_type = 'html';
}
//add multi-lingual support
@@ -54,7 +54,7 @@
$text = $language->get();
//show the title
if ($format == 'text') {
if ($display_type == 'text') {
echo "\n";
echo $text['label-upgrade']."\n";
echo "-----------------------------------------\n";
@@ -70,10 +70,11 @@
//run all app_defaults.php files
require_once "resources/classes/domains.php";
$domain = new domains;
$domain->display_type = $display_type;
$domain->upgrade();
//show the content
if ($format == 'html') {
if ($display_type == 'html') {
echo "<div align='center'>\n";
echo "<table width='40%'>\n";
echo "<tr>\n";
@@ -93,12 +94,12 @@
echo "<br />\n";
echo "<br />\n";
}
elseif ($format == 'text') {
elseif ($display_type == 'text') {
echo "\n";
}
//include the footer
if ($format == "html") {
if ($display_type == "html") {
require_once "resources/footer.php";
}