Browse Source

! added txt strings for phpinfo
! minor formatting change to phpinfo output
! added space back to editor.js

Spuds 13 years ago
parent
commit
8abd3fd23b

+ 6 - 6
Sources/ManageServer.php

@@ -851,10 +851,10 @@ function saveDBSettings(&$config_vars)
  */
 function ShowPHPinfoSettings()
 {
-	global $context;
+	global $context, $txt;
 	
 	$info_lines = array();
-	$category = 'General';
+	$category = $txt['phpinfo_settings'];
 
 	// get the data
 	ob_start();
@@ -868,8 +868,8 @@ function ShowPHPinfoSettings()
 	// put all of it into an array
 	foreach ($info_lines as $line)
 	{
-		// lets not load/show these.
-		if (strpos($line, '_COOKIE') !== false || strpos($line, 'Cookie') !== false)
+		// lets not load/show these as they may contain session info
+		if (strpos($line, '_COOKIE') !== false || strpos($line, 'Cookie') !== false || strpos($line, '_GET') !== false || strpos($line, '_REQUEST') !== false)
 			continue;
 
 		// new category?
@@ -880,9 +880,9 @@ function ShowPHPinfoSettings()
 		if (preg_match('~<tr><td[^>]+>([^<]*)</td><td[^>]+>([^<]*)</td></tr>~', $line, $val))
 			$pinfo[$category][$val[1]] = $val[2];
 		elseif (preg_match('~<tr><td[^>]+>([^<]*)</td><td[^>]+>([^<]*)</td><td[^>]+>([^<]*)</td></tr>~', $line, $val))
-			$pinfo[$category][$val[1]] = array('local' => $val[2], 'master' => $val[3]);
+			$pinfo[$category][$val[1]] = array($txt['phpinfo_localsettings'] => $val[2], $txt['phpinfo_defaultsettings'] => $val[3]);
 	}
-	
+
 	// load it in to context and display it
 	$context['pinfo'] = $pinfo;
 	$context['page_title'] = $txt['admin_server_settings'];

+ 20 - 5
Themes/default/Admin.template.php

@@ -1543,7 +1543,7 @@ function template_repair_boards()
 
 function template_php_info()
 {
-	global $context;
+	global $context, $txt;
 
 	// for each php info area
 	foreach ($context['pinfo'] as $area => $php_area)
@@ -1559,13 +1559,27 @@ function template_php_info()
 		</thead>
 		<tbody>';
 
-		// and for each setting in that area
 		$alternate = true;
+		$localmaster = true;
+		
+		// and for each setting in this category
 		foreach ($php_area as $key => $setting)
 		{
-			// a local / master setting (3 col)
+			// start of a local / master setting (3 col)
 			if (is_array($setting))
 			{
+				if ($localmaster)
+				{
+					// heading row for the settings section of this categorys settings
+					echo '
+		<tr class="titlebg">
+			<td align="center" width="33%"><strong>', $txt['phpinfo_settings'], '</strong></td>
+			<td align="center" width="33%"><strong>', $txt['phpinfo_localsettings'], '</strong></td>
+			<td align="center" width="33%"><strong>', $txt['phpinfo_defaultsettings'], '</strong></td>
+		</tr>';
+					$localmaster = false;
+				}
+					
 				echo '
 		<tr>
 			<td align="left" width="33%" class="windowbg', $alternate ? '2' : '', '">', $key, '</td>';
@@ -1573,7 +1587,7 @@ function template_php_info()
 				foreach ($setting as $key_lm => $value)
 				{
 					echo '
-			<td align="left" width="33%" class="windowbg', $alternate ? '2' : '', '">', $key_lm, '/', $value, '</td>';
+			<td align="left" width="33%" class="windowbg', $alternate ? '2' : '', '">', $value, '</td>';
 				}
 				echo '
 		</tr>';
@@ -1587,7 +1601,8 @@ function template_php_info()
 			<td align="left" class="windowbg', $alternate ? '2' : '', '" colspan="2">', $setting, '</td>
 		</tr>';
 			}
-		$alternate = !$alternate;
+		
+			$alternate = !$alternate;
 		}
 		echo '
 		</tbody>

+ 3 - 0
Themes/default/languages/Admin.english.php

@@ -526,6 +526,9 @@ $txt['cookies_sessions_settings'] = 'Cookies and Sessions';
 $txt['caching_settings'] = 'Caching';
 $txt['load_balancing_settings'] = 'Load Balancing';
 $txt['phpinfo_settings'] = 'PHP Info';
+$txt['phpinfo_localsettings'] = 'Local Settings';
+$txt['phpinfo_defaultsettings'] = 'Default Settings';
+$txt['phpinfo_settings'] = 'Settings';
 
 $txt['language_configuration'] = 'Languages';
 $txt['language_description'] = 'This section allows you to edit languages installed on your forum, download new ones from the Simple Machines website. You may also edit language-related settings here.';

+ 1 - 1
Themes/default/scripts/editor.js

@@ -677,7 +677,7 @@ smc_Editor.prototype.insertSmiley = function(oSmileyProperties)
 			this.insertText((begin != ' ' ? ' ' : '') + oSmileyProperties.sCode + (end != ' ' ? ' ' : ''));
 		}
 		else
-			this.insertText(oSmileyProperties.sCode);
+			this.insertText(' ' + oSmileyProperties.sCode);
 	}
 	// Otherwise we need to do a whole image...
 	else