Update the install.php.

This commit is contained in:
markjcrane 2016-03-26 19:17:33 -06:00
parent e3175814bd
commit d71f1323c3
7 changed files with 54 additions and 132 deletions

View File

@ -209,31 +209,31 @@
if(!($event_host == '' || $event_host == 'localhost' || $event_host == '::1' || $event_host == '127.0.0.1' )){
echo "<p><b>Warning</b> you have choosen a value other than localhost for event_host, this is unsoported at present</p>\n";
}
include "resources/page_parts/install_event_socket.php";
if($detect_ok){
//if($detect_ok){
echo "<form method='post' name='frm' action=''>\n";
include "resources/page_parts/install_event_socket.php";
echo " <input type='hidden' name='install_language' value='".$_SESSION['domain']['language']['code']."'/>\n";
echo " <input type='hidden' name='return_install_step' value='detect_config'/>\n";
echo " <input type='hidden' name='install_step' value='config_detail'/>\n";
echo " <input type='hidden' name='event_host' value='$event_host'/>\n";
echo " <input type='hidden' name='event_port' value='$event_port'/>\n";
echo " <input type='hidden' name='event_password' value='$event_password'/>\n";
echo " <div style='text-align:right'>\n";
echo " <button type='button' class='btn' onclick=\"history.go(-1);\">".$text['button-back']."</button>\n";
echo " <button type='submit' class='btn' id='next'>".$text['button-next']."</button>\n";
echo " </div>\n";
//echo " <div style='text-align:right'>\n";
//echo " <button type='button' class='btn' onclick=\"history.go(-1);\">".$text['button-back']."</button>\n";
//echo " <button type='submit' class='btn' id='next'>".$text['button-next']."</button>\n";
//echo " </div>\n";
echo "</form>\n";
} else {
echo "<form method='post' name='frm' action=''>\n";
echo " <div style='text-align:right'>\n";
echo " <button type='button' class='btn' onclick=\"history.go(-1);\">".$text['button-back']."</button>\n";
echo " </div>\n";
echo "</form>\n";
}
//} else {
// echo "<form method='post' name='frm' action=''>\n";
// echo " <div style='text-align:right'>\n";
// echo " <button type='button' class='btn' onclick=\"history.go(-1);\">".$text['button-back']."</button>\n";
// echo " </div>\n";
// echo "</form>\n";
//}
}
elseif($install_step == 'config_detail'){
if(!$domain_name){
//get the domain
if(!$domain_name){
$domain_array = explode(":", $_SERVER["HTTP_HOST"]);
$domain_name = $domain_array[0];
}
@ -253,8 +253,8 @@
try {
$detect_switch->detect();
} catch(Exception $e){
echo "<p>Failed to detect configuration detect_switch reported: " . $e->getMessage() . "</p>\n";
$detect_ok = false;
//echo "<p>Failed to detect configuration detect_switch reported: " . $e->getMessage() . "</p>\n";
//$detect_ok = false;
}
if($detect_ok){
$install_ok = true;
@ -328,9 +328,9 @@
}
//initialize some defaults so we can be 'logged in'
//$_SESSION['username'] = 'install_enabled';
//$_SESSION['permissions'][]['permission_name'] = 'superadmin';
//$_SESSION['menu'] = '';
$_SESSION['username'] = 'install_enabled';
$_SESSION['permissions'][]['permission_name'] = 'superadmin';
$_SESSION['menu'] = '';
//add the content to the template and then send output
$body = ob_get_contents(); //get the output from the buffer

View File

@ -994,7 +994,7 @@ include "root.php";
//set the defaults
$menu_name = 'default';
$menu_language = 'en-us';
$menu_description = 'Default Menu Set';
$menu_description = 'Default Menu';
$this->write_progress("\tChecking if menu exists");
$sql = "select count(*) from v_menus ";

View File

@ -44,7 +44,10 @@
echo "<tr>\n";
echo "<td align='left' width='30%' nowrap><b>".$text['header-config_database']."</b></td>\n";
echo "<td width='70%' align='right'>&nbsp;</td>\n";
echo "<td width='70%' align='right'>\n";
echo " <input type='button' name='back' class='btn' onclick=\"history.go(-1);\" value='".$text['button-back']."'/>\n";
echo " <input type='submit' name='execute' class='".$text['button-execute']."'>\n";
echo "</td>\n";
echo "</tr>\n";
if ($db_type == "sqlite") {
@ -274,8 +277,8 @@
echo "</table>";
echo " <div style='text-align:right'>\n";
echo " <button type='button' onclick=\"history.go(-1);\">".$text['button-back']."</button>\n";
echo " <button type='submit'>".$text['button-execute']."</button>\n";
echo " <input type='button' name='back' class='btn' onclick=\"history.go(-1);\" value='".$text['button-back']."'/>\n";
echo " <input type='submit' name='execute' class='".$text['button-execute']."'>\n";
echo " </div>\n";
echo "</form>\n";
?>

View File

@ -38,7 +38,10 @@
echo "<tr>\n";
echo "<td align='left' width='30%' nowrap><b>".$text['header-config_detail']."</b></td>\n";
echo "<td width='70%' align='right'>&nbsp;</td>\n";
echo "<td width='70%' align='right'>\n";
echo " <input type='button' name='back' class='btn' onclick=\"history.go(-1);\" value='".$text['button-back']."'/>\n";
echo " <input type='submit' class='btn' name='execute' class='".$text['button-next']."'>\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
@ -140,8 +143,8 @@
echo "</table>";
echo " <div style='text-align:right'>\n";
echo " <button type='button' onclick=\"history.go(-1);\">".$text['button-back']."</button>\n";
echo " <button type='submit' id='next'>".$text['button-next']."</button>\n";
echo " <input type='button' name='back' class='btn' onclick=\"history.go(-1);\" value='".$text['button-back']."'/>\n";
echo " <input type='submit' class='btn' name='execute' class='".$text['button-next']."'>\n";
echo " </div>\n";
echo "</form>\n";
?>

View File

@ -31,10 +31,9 @@
try {
$switch_detect->detect();
} catch(Exception $e){
echo "<p><b>Failed to detect configuration</b> detect_switch reported: " . $e->getMessage() ."</p>\n";
$detect_ok = false;
//echo "<p><b>Failed to detect configuration</b> detect_switch reported: " . $e->getMessage() ."</p>\n";
//$detect_ok = false;
}
echo "<form method='post' name='detect_switch' action=''>\n";
echo "<input type='hidden' name='install_language' value='".$_SESSION['domain']['language']['code']."'/>\n";
echo "<input type='hidden' name='install_step' value='detect_config'/>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
@ -42,7 +41,9 @@
echo "<tr>\n";
echo "<td width='30%' align='left' nowrap><b>".$text['header-event_socket']."</b><br><br></td>\n";
echo "<td width='70%' align='right'>";
echo " <input type='submit' name='submit' class='btn' value='".$text['button-detect']."'/>\n";
echo " <input type='button' name='detect' class='btn' onclick=\"location.reload();\" value='".$text['button-detect']."'/>\n";
echo " <input type='button' name='back' class='btn' onclick=\"history.go(-1);\" value='".$text['button-back']."'/>\n";
echo " <input type='submit' name='next' class='btn' value='".$text['button-next']."'/>\n";
echo "</td>\n";
echo "</tr>\n";
@ -51,7 +52,7 @@
echo " ".$text['label-event_host']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='event_host' maxlength='255' value=\"".$switch_detect->event_host."\" onchange='JavaScript:disable_next()'/>\n";
echo " <input class='formfld' type='text' name='event_host' maxlength='255' value=\"".$switch_detect->event_host."\" />\n";
echo "<br />\n";
echo $text['description-event_host']."\n";
echo "</td>\n";
@ -62,7 +63,7 @@
echo " ".$text['label-event_port']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='event_port' maxlength='255' value=\"".$switch_detect->event_port."\" onchange='JavaScript:disable_next()'/>\n";
echo " <input class='formfld' type='text' name='event_port' maxlength='255' value=\"".$switch_detect->event_port."\"/>\n";
echo "<br />\n";
echo $text['description-event_port']."\n";
echo "</td>\n";
@ -73,7 +74,7 @@
echo " ".$text['label-event_password']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='password' name='event_password' maxlength='255' value=\"".$switch_detect->event_password."\" onchange='JavaScript:disable_next()'/>\n";
echo " <input class='formfld' type='password' name='event_password' maxlength='255' value=\"".$switch_detect->event_password."\"/>\n";
echo "<br />\n";
echo $text['description-event_password']."\n";
echo "</td>\n";
@ -86,7 +87,6 @@
echo " </tr>";
echo "</table>";
echo "</form>";
if($detect_ok){
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
@ -120,8 +120,7 @@
echo "<td colspan='4' align='left' nowrap><br/><b>".$text['title-assumed_configuration']."</b></td>\n";
echo "</tr>\n";
$id=0;
foreach ($switch_detect->get_vdirs() as $folder)
{
foreach ($switch_detect->get_vdirs() as $folder) {
if($id % 2 == 0){ echo "<tr>\n"; }
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap' width='15%'>\n";
echo $folder."\n";
@ -132,13 +131,7 @@
if($id % 2 == 1){ echo "</tr>\n"; }
$id++;
}
echo "</table>";
}
?><script type='text/javascript'>
function disable_next() {
document.getElementById("next").style.display = 'none';
}
</script>
?>

View File

@ -17,16 +17,16 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
Portions created by the Initial Developer are Copyright (C) 2015-2016
the Initial Developer. All Rights Reserved.
Contributor(s):
Matthew Vale <github@mafoo.org>
*/
echo "<table width='80%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo " <tr>\n";
echo " <td width='30%' align='left' nowrap><b>".$text['header-select_language']."</b><br><br></td>\n";
echo " <td width='30%' align='left' nowrap='nowrap'><b>".$text['header-select_language']."</b><br><br></td>\n";
echo " <td width='70%' align='right'>";
echo " <input type='submit' name='submit' class='btn' value='".$text['button-next']."'/>\n";
echo " </td>\n";
@ -36,18 +36,22 @@
echo " ".$text['label-select_language']."\n";
echo " </td>\n";
echo " <td class='vtable' align='left'>\n";
echo " <table>";
echo " <table cellpadding='0' cellspacing='0'>";
foreach($_SESSION['app']['languages'] as $lang_code){
echo " <tr>";
echo " <td>\n";
echo " <td width='15' class='vtable' valign='top' nowrap='nowrap'>\n";
echo " <input type='radio' name='install_language' value='$lang_code' id='lang_$lang_code' ";
if($lang_code == $_SESSION['domain']['language']['code']) {
echo " checked='checked'";
}
echo "/>";
echo " </td>";
echo " <td class='vtable' align='left' valign='top' nowrap='nowrap'>\n";
echo " <img src='<!--{project_path}-->/core/install/resources/images/flags/$lang_code.png' alt='$lang_code'/>&nbsp;".$text["language-$lang_code"];
echo " </td>";
echo " <td width='100%' class='vtable' valign='top'>\n";
echo " &nbsp;\n";
echo " </td>";
echo " </tr>";
}
echo " </table>";

View File

@ -1,81 +0,0 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
require_once "root.php";
require_once "resources/require.php";
//define the variable
$v_menu = '';
//force the menu to generate on every page load
//$_SESSION["menu"] = '';
//build the menu if the session menu has no length
if (!isset($_SESSION["menu"])) {
$_SESSION["menu"] = '';
}
if (strlen($_SESSION["menu"]) == 0) {
$menuwidth = '110';
//echo " <!-- http://www.seoconsultants.com/css/menus/horizontal/ -->\n";
//echo " <!-- http://www.tanfa.co.uk/css/examples/css-dropdown-menus.asp -->";
$v_menu = "";
$v_menu .= " <!--[if IE]>\n";
$v_menu .= " <style type=\"text/css\" media=\"screen\">\n";
$v_menu .= " #menu{float:none;} /* This is required for IE to avoid positioning bug when placing content first in source. */\n";
$v_menu .= " /* IE Menu CSS */\n";
$v_menu .= " /* csshover.htc file version: V1.21.041022 - Available for download from: http://www.xs4all.nl/~peterned/csshover.html */\n";
$v_menu .= " body{behavior:url(/resources/csshover.htc);\n";
$v_menu .= " font-size:100%; /* to enable text resizing in IE */\n";
$v_menu .= " }\n";
$v_menu .= " #menu ul li{float:left;width:100%;}\n";
$v_menu .= " #menu h2, #menu a{height:1%;font:bold arial,helvetica,sans-serif;}\n";
$v_menu .= " </style>\n";
$v_menu .= " <![endif]-->\n";
//$v_menu .= " <style type=\"text/css\">@import url(\"/resources/menuh.css\");</style>\n";
$v_menu .= "\n";
$v_menu .= "<!-- Begin CSS Horizontal Popout Menu -->\n";
$v_menu .= "<div id=\"menu\" style=\"position: relative; z-index:199; width:100%;\" align='left'>\n";
$v_menu .= "\n";
require_once "resources/classes/menu.php";
$menu = new menu;
$menu->db = $db;
$menu->menu_uuid = $_SESSION['domain']['menu']['uuid'];
$v_menu .= $menu->build_html();
unset($menu);
$v_menu .= "</div>\n";
$_SESSION["menu"] = $v_menu;
}
else {
//echo "from session";
}
//testing
//echo $_SESSION["menu"];
?>