Bug 550544 - Babel server is not ready for PHP 7

Change-Id: I27135e43fdd28ab2f0a6b663b00b8777ebbb4dcb
Signed-off-by: droy <denis.roy@eclipse-foundation.org>
diff --git a/addons/babel.eclipse.org/html/foot.php b/addons/babel.eclipse.org/html/foot.php
index 667f571..c538d59 100644
--- a/addons/babel.eclipse.org/html/foot.php
+++ b/addons/babel.eclipse.org/html/foot.php
@@ -1,6 +1,6 @@
 <?php
 /*******************************************************************************
- * Copyright (c) 2008 Eclipse Foundation and others.
+ * Copyright (c) 2008-2019 Eclipse Foundation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -15,16 +15,16 @@
 ?>
 <div>
 <br /><center>
-	<a target="_blank" href="https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Babel&component=Server&bug_file_loc=<?= $_SERVER['SCRIPT_NAME'] ?>">Report errors or enhancements for server</a>&nbsp;|&nbsp;
-	<a target="_blank" href="https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Babel&component=EnglishStrings&bug_file_loc=URL_TO_THE_STRING&short_desc=Problem%20with%20KEY_NAME&comment=elaborate_here">Report errors for English strings</a>&nbsp;|&nbsp;
-	<a href="https://dev.eclipse.org/mailman/listinfo/babel-translators">Discuss translations on translators mailing list</a>
+	<a target="_blank" href="//bugs.eclipse.org/bugs/enter_bug.cgi?product=Babel&component=Server&bug_file_loc=<?= $_SERVER['SCRIPT_NAME'] ?>">Report errors or enhancements for server</a>&nbsp;|&nbsp;
+	<a target="_blank" href="//bugs.eclipse.org/bugs/enter_bug.cgi?product=Babel&component=EnglishStrings&bug_file_loc=URL_TO_THE_STRING&short_desc=Problem%20with%20KEY_NAME&comment=elaborate_here">Report errors for English strings</a>&nbsp;|&nbsp;
+	<a href="//dev.eclipse.org/mailman/listinfo/babel-translators">Discuss translations on translators mailing list</a>
 </center><br />
 </div>
 <div id="footer">
 <ul id="footernav">
 <li class="first"><a href="/">Home</a></li>
-<li><a href="http://www.eclipse.org/legal/privacy.php">Privacy Policy</a></li>
-<li><a href="http://www.eclipse.org/legal/termsofuse.php">Terms of Use</a></li>
+<li><a href="//www.eclipse.org/legal/privacy.php">Privacy Policy</a></li>
+<li><a href="//www.eclipse.org/legal/termsofuse.php">Terms of Use</a></li>
 </ul>
 <p>Copyright &copy; <?=date("Y");?> The Eclipse Foundation. All Rights Reserved</p>
 </div></body></html>
\ No newline at end of file
diff --git a/addons/babel.eclipse.org/html/head.php b/addons/babel.eclipse.org/html/head.php
index a2bfffe..7af2864 100644
--- a/addons/babel.eclipse.org/html/head.php
+++ b/addons/babel.eclipse.org/html/head.php
@@ -1,6 +1,6 @@
 <?php
 /*******************************************************************************
- * Copyright (c) 2007-2013 Eclipse Foundation, IBM Corporation and others.
+ * Copyright (c) 2007-2019 Eclipse Foundation, IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -31,15 +31,15 @@
     <div id="header-global-holder" class="babel-global">
         <div id="header-global-links">
             <ul>
-                <li><a href="http://www.eclipse.org/org/foundation/contact.php" class="first_one">Contact</a></li>
-                <li><a href="http://www.eclipse.org/legal/">Legal</a></li>
+                <li><a href="//www.eclipse.org/org/foundation/contact.php" class="first_one">Contact</a></li>
+                <li><a href="//www.eclipse.org/legal/">Legal</a></li>
             </ul>
         </div>
         <div id="header-icons">
-            <a href="http://www.eclipse.org"><img src="images/Icon_Org.png" width="28" height="28" alt="eclipse.org" title="Eclipse.org" /></a>
-            <a href="http://live.eclipse.org"><img src="images/Icon_Live.png" width="28" height="28" alt="Eclipse Live" title="Eclipse Live" /></a>
-            <a href="http://www.eclipseplugincentral.com"><img src="images/Icon_plugin.png" width="28" height="28" alt="Eclipse Plugin Central" title="Eclipse Plugin Central" /></a>
-            <a href="http://www.planeteclipse.org"><img src="images/Icon_planet.png" width="28" height="28" alt="Planet Eclipse" title="Planet Eclipse" /></a>
+            <a href="//www.eclipse.org"><img src="images/Icon_Org.png" width="28" height="28" alt="eclipse.org" title="Eclipse.org" /></a>
+            <a href="//live.eclipse.org"><img src="images/Icon_Live.png" width="28" height="28" alt="Eclipse Live" title="Eclipse Live" /></a>
+            <a href="//www.eclipseplugincentral.com"><img src="images/Icon_plugin.png" width="28" height="28" alt="Eclipse Plugin Central" title="Eclipse Plugin Central" /></a>
+            <a href="//www.planeteclipse.org"><img src="images/Icon_planet.png" width="28" height="28" alt="Planet Eclipse" title="Planet Eclipse" /></a>
         </div>
     </div>
 </div>
@@ -51,7 +51,7 @@
         <li><a  href="project_source_locations.php" target="_self">For committers</a></li> 
         <li><a  href="stats.php" target="_self">Translation Statistics</a></li>
         <li><a  href="recent.php" target="_self">Recent Translations</a></li> 
-        <li><a  href="http://www.eclipse.org/babel" target="_self">About Babel</a></li> 
+        <li><a  href="//www.eclipse.org/babel" target="_self">About Babel</a></li> 
     </ul>
     </div>
     <div id="header-utils"></div>
diff --git a/addons/babel.eclipse.org/html_functions.php b/addons/babel.eclipse.org/html_functions.php
index 204065e..c5458f0 100644
--- a/addons/babel.eclipse.org/html_functions.php
+++ b/addons/babel.eclipse.org/html_functions.php
@@ -1,6 +1,6 @@
 <?php
 /*******************************************************************************
- * Copyright (c) 2007-2009 Intalio, Inc.
+ * Copyright (c) 2007-2019 Intalio, Inc.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
  *
  * Contributors:
  *    Antoine Toulme, Intalio Inc.
+ *    Denis Roy (Eclipse Foundation) - Bug 550544 - Babel server is not ready for PHP 7
 *******************************************************************************/
 
 // Use a class to define the hooks to avoid bugs with already defined functions.
@@ -17,9 +18,9 @@
      * May be a distant server or a local folder.
      */
     function _imageRoot() {
-        return "http://dev.eclipse.org";
+        return "//dev.eclipse.org";
     }
-    
+
     function validateMapFileUrl() {
         return <<<JS
         function fnCheckUrl() {
@@ -37,14 +38,14 @@
         }
 JS;
     }
-    
+
     /**
      * Outputs the head of the html page.
      */
     function head() {
         include(dirname(__FILE__) . "/html/head.php");
     }
-    
+
     /**
      * Outputs the footer of the html page.
      */
diff --git a/html/callback/getCurrentStringTranslation.php b/html/callback/getCurrentStringTranslation.php
index 6861e52..09a4b01 100644
--- a/html/callback/getCurrentStringTranslation.php
+++ b/html/callback/getCurrentStringTranslation.php
@@ -60,7 +60,7 @@
 
 $res = mysqli_query($dbh, $query);
 
-$line = mysqli_fetch_array($res, MYSQL_ASSOC);
+$line = mysqli_fetch_array($res, MYSQLI_ASSOC);
 
 //print_r($line);
 
@@ -138,7 +138,7 @@
 			$res_th = mysqli_query($dbh, $q_th);
 			if(mysqli_affected_rows($dbh) > 0) {
 				echo "<b>, or use from the following:</b><ul>";
-				while($translation_hints = mysqli_fetch_array($res_th, MYSQL_ASSOC)){
+				while($translation_hints = mysqli_fetch_array($res_th, MYSQLI_ASSOC)){
 					echo "<li>", $translation_hints['value'], "</li>";
 				}
 				echo "</ul>";
@@ -183,7 +183,7 @@
 			if(!mysqli_num_rows($res_history)){
 				print "No history.";
 			}else{		
-				while($line = mysqli_fetch_array($res_history, MYSQL_ASSOC)){
+				while($line = mysqli_fetch_array($res_history, MYSQLI_ASSOC)){
 					$fuzzy = "";
 					if($line['fuzzy'] == 1) {
 						$fuzzy = "<img src='images/fuzzy.png' />";
diff --git a/html/callback/getExcludePatterns.php b/html/callback/getExcludePatterns.php
index f3d5fa7..508f85b 100644
--- a/html/callback/getExcludePatterns.php
+++ b/html/callback/getExcludePatterns.php
@@ -24,7 +24,7 @@
 
 $res = mysqli_query($dbh, $query);
 if (mysqli_affected_rows($dbh) > 0) {
-	while ($line = mysqli_fetch_array($res, MYSQL_ASSOC)) {
+	while ($line = mysqli_fetch_array($res, MYSQLI_ASSOC)) {
 		echo $line['pattern'] . "\n";
 	}
 } else {
diff --git a/html/callback/getFilesForProject.php b/html/callback/getFilesForProject.php
index d334a6a..b38d823 100644
--- a/html/callback/getFilesForProject.php
+++ b/html/callback/getFilesForProject.php
@@ -61,7 +61,7 @@
 $res = mysqli_query($dbh, $query);
 
 
-while($line = mysqli_fetch_array($res, MYSQL_ASSOC)){
+while($line = mysqli_fetch_array($res, MYSQLI_ASSOC)){
 	$ret = Array();
 	
 	$ret['name'] = $line['name'];
diff --git a/html/callback/getLanguages.php b/html/callback/getLanguages.php
index 0d04883..1b6730a 100644
--- a/html/callback/getLanguages.php
+++ b/html/callback/getLanguages.php
@@ -22,7 +22,7 @@
 
 $return = Array();
 
-while($line = mysqli_fetch_array($res, MYSQL_ASSOC)){
+while($line = mysqli_fetch_array($res, MYSQLI_ASSOC)){
     if(isset($_SESSION['language']) and $line['language_id'] == $_SESSION['language']){
     	$line['current'] = true;
     }
diff --git a/html/callback/getMapFiles.php b/html/callback/getMapFiles.php
index 3b4866c..b997121 100644
--- a/html/callback/getMapFiles.php
+++ b/html/callback/getMapFiles.php
@@ -27,7 +27,7 @@
 
 $res = mysqli_query($dbh, $query);
 if (mysqli_affected_rows($dbh) > 0) {
-	while ($line = mysqli_fetch_array($res, MYSQL_ASSOC)) {
+	while ($line = mysqli_fetch_array($res, MYSQLI_ASSOC)) {
 		echo $line['location'] . "\n";
 	}
 } else {
diff --git a/html/callback/getProjectSourceLocations.php b/html/callback/getProjectSourceLocations.php
index a9bb04f..08fe420 100644
--- a/html/callback/getProjectSourceLocations.php
+++ b/html/callback/getProjectSourceLocations.php
@@ -24,7 +24,7 @@
 
 $res = mysqli_query($dbh, $query);
 if (mysqli_affected_rows($dbh) > 0) {
-	while ($line = mysqli_fetch_array($res, MYSQL_ASSOC)) {
+	while ($line = mysqli_fetch_array($res, MYSQLI_ASSOC)) {
 		echo $line['location'] . "\n";
 	}
 } else {
diff --git a/html/callback/getProjects.php b/html/callback/getProjects.php
index 0211dd0..2c2c443 100644
--- a/html/callback/getProjects.php
+++ b/html/callback/getProjects.php
@@ -1,6 +1,6 @@
 <?php
 /*******************************************************************************
- * Copyright (c) 2007 Eclipse Foundation and others.
+ * Copyright (c) 2007-2019 Eclipse Foundation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
  *
  * Contributors:
  *    Paul Colton (Aptana)- initial API and implementation
-
+ *    Denis Roy (Eclipse Foundation) - Bug 550544 - Babel server is not ready for PHP 7
 *******************************************************************************/
 require_once("cb_global.php");
 
@@ -24,8 +24,8 @@
 	$res = mysqli_query($dbh, $query);
 
 //	$return = '<ul id="project-choices">';
-
-	while($line = mysqli_fetch_array($res, MYSQL_ASSOC)){
+	$return = Array();
+	while($line = mysqli_fetch_array($res, MYSQLI_ASSOC)){
 		$ret = Array();
 		$ret['project'] = $line['project_id'];
 		//	$ret['version'] = $line['version'];
diff --git a/html/callback/getStringsforProject.php b/html/callback/getStringsforProject.php
index 02ef131..ea90ac9 100644
--- a/html/callback/getStringsforProject.php
+++ b/html/callback/getStringsforProject.php
@@ -141,7 +141,7 @@
 
 $stringids = Array();
 $return = Array();
-while($line = mysqli_fetch_array($res, MYSQL_ASSOC)){
+while($line = mysqli_fetch_array($res, MYSQLI_ASSOC)){
     if(isset($stringids[$line['stringId']])){
  		  continue;
     }else{
diff --git a/html/callback/getTranslationHints.php b/html/callback/getTranslationHints.php
index 848d392..5e2e000 100644
--- a/html/callback/getTranslationHints.php
+++ b/html/callback/getTranslationHints.php
@@ -41,7 +41,7 @@
 $res = mysqli_query($dbh, $query);
 if(mysqli_affected_rows($dbh) > 0) {
 	echo "<ul>";
-	while($line = mysqli_fetch_array($res, MYSQL_ASSOC)){
+	while($line = mysqli_fetch_array($res, MYSQLI_ASSOC)){
 		echo "<li>", $line['value'], "</li>";
 	}
 	echo "</ul>";
@@ -63,7 +63,7 @@
 	$res = mysqli_query($dbh, $query2);
 	if(mysqli_affected_rows($dbh) > 0) {
 		echo "<ul>";
-		while($line = mysqli_fetch_array($res, MYSQL_ASSOC)){
+		while($line = mysqli_fetch_array($res, MYSQLI_ASSOC)){
 			echo "<li>", $line['value'], "</li>";
 		}
 		echo "</ul>";
diff --git a/html/callback/getUrlType.php b/html/callback/getUrlType.php
index 5d7dd97..8b4313b 100644
--- a/html/callback/getUrlType.php
+++ b/html/callback/getUrlType.php
@@ -22,7 +22,7 @@
 
 $res = mysqli_query($dbh, $query);
 if (mysqli_affected_rows($dbh) > 0) {
-	while ($line = mysqli_fetch_array($res, MYSQL_ASSOC)) {
+	while ($line = mysqli_fetch_array($res, MYSQLI_ASSOC)) {
 		echo $line['is_map_file'];
 	}
 } else {
diff --git a/html/callback/getVersionsforProject.php b/html/callback/getVersionsforProject.php
index ced82a9..828b4c9 100644
--- a/html/callback/getVersionsforProject.php
+++ b/html/callback/getVersionsforProject.php
@@ -37,7 +37,7 @@
 
 	$return = array();
 
-	while($line = mysqli_fetch_array($res, MYSQL_ASSOC)){
+	while($line = mysqli_fetch_array($res, MYSQLI_ASSOC)){
 		$ret = Array();
 		$ret['version'] = $line['version'];
 		$ret['pct'] = $line['pct_complete'];
diff --git a/html/images/spinner.gif b/html/images/spinner.gif
new file mode 100644
index 0000000..e24bb17
--- /dev/null
+++ b/html/images/spinner.gif
Binary files differ
diff --git a/html/js/global.js b/html/js/global.js
index a1fb87c..b252132 100644
--- a/html/js/global.js
+++ b/html/js/global.js
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007-2018 Eclipse Foundation and others.
+ * Copyright (c) 2007-2019 Eclipse Foundation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
  * Contributors:
  *    Paul Colton (Aptana)- initial API and implementation
  *    Eclipse Foundation
+ *    Denis Roy (Eclipse Foundation) - Bug 550544 - Babel server is not ready for PHP 7
 *******************************************************************************/
 
 YAHOO.widget.Logger.enableBrowserConsole();
@@ -17,7 +18,7 @@
 
 	attach: function(domIN){
 		if(domIN){
-			domIN.innerHTML = "<div id='spinner'><img src='http://babel.eclipse.org/images/spinner.gif' alt='spinner'><h1>...loading...</h1></div>";
+			domIN.innerHTML = "<div id='spinner'><img src='images/spinner.gif' alt='spinner'><h1>...loading...</h1></div>";
 		}
 	}
 };