ampache-dev | 18 Sep 16:58 2010
Picon

Ampache SVN - r2452 - in trunk: . templates

Author: flowerysong
Date: 2010-09-18 07:58:23 -0700 (Sat, 18 Sep 2010)
New Revision: 2452

Added:
   trunk/templates/install_header.inc.php
Modified:
   trunk/lostpassword.php
   trunk/templates/show_install.inc.php
   trunk/templates/show_install_account.inc.php
   trunk/templates/show_install_check.inc.php
   trunk/templates/show_install_config.inc.php
   trunk/templates/show_install_lang.inc.php
Log:
Some grammar fixes and a code dedupe for installation.  Identical code in 5
files makes the baby Jesus cry and eventually results in the code not being
identical.

Modified: trunk/lostpassword.php
===================================================================
--- trunk/lostpassword.php	2010-08-17 20:59:16 UTC (rev 2451)
+++ trunk/lostpassword.php	2010-09-18 14:58:23 UTC (rev 2452)
 <at>  <at>  -36,9 +36,9  <at>  <at> 
 			$result = send_newpassword($email, $current_ip);
 		}
 		if ($result) {
-			Error::add('general',_('Password has been send'));
+			Error::add('general', _('Password has been sent'));
 		} else {
-			Error::add('general',_('Password has not been send'));
+			Error::add('general', _('Password has not been sent'));
 		}

 		require Config::get('prefix') . '/templates/show_login_form.inc.php';
 <at>  <at>  -60,7 +60,7  <at>  <at> 
 		AmpacheMail::$fromname = "Ampache";
 		AmpacheMail::$sender = $GLOBALS['user']->email;

-		$message  = sprintf(_("An user from %s has requested an new password."), $current_ip);
+		$message  = sprintf(_("A user from %s has requested a new password."), $current_ip);
 		$message .= "\n";
 		$message .= sprintf(_("The password has been set to: %s"), $newpassword);
 		AmpacheMail::$message = $message;

Added: trunk/templates/install_header.inc.php
===================================================================
--- trunk/templates/install_header.inc.php	                        (rev 0)
+++ trunk/templates/install_header.inc.php	2010-09-18 14:58:23 UTC (rev 2452)
 <at>  <at>  -0,0 +1,53  <at>  <at> 
+<?php
+/* vim:set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab: */
+/*
+
+ Copyright (c) Ampache.org
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+*/
+$prefix = realpath(dirname(__FILE__). "/../");
+?>
+<?php if (!defined('INSTALL')) { exit; } ?>
+<?php $results = 0; ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $htmllang; ?>" lang="<?php echo
$htmllang; ?>">
+<head>
+<title>Ampache :: Pour l'Amour de la Musique - Install</title>
+<link rel="stylesheet" href="templates/install.css" type="text/css" media="screen" />
+<meta http-equiv="Content-Type" content="text/html; Charset=<?php echo $charset; ?>" />
+</head>
+<body>
+<script src="modules/prototype/prototype.js" language="javascript" type="text/javascript"></script>
+<script src="lib/javascript/base.js" language="javascript" type="text/javascript"></script>
+<div id="header">
+<h1><?php echo _('Ampache Installation'); ?></h1>
+<p>For the love of Music</p>
+</div>
+<div id="text-box">
+	<div class="notify">
+		<h3><?php echo _('Requirements'); ?></h3>
+		<p>
+		<?php echo _('This page handles the installation of the Ampache database and the creation of the
ampache.cfg.php file. Before you continue please make sure that you have the following
prerequisites:'); ?>
+		</p>
+		<ul>
+			<li><?php echo _('A MySQL server with a username and password that can create/modify databases'); ?></li>
+                        <li><?php echo sprintf(_('Your webserver has read access to the files %s and %s'),$prefix .
'/sql/ampache.sql',$prefix . '/config/ampache.cfg.php.dist'); ?></li>
+		</ul>
+		<p>
+<?php echo sprintf(_("Once you have ensured that the above requirements are met please fill out the
information below. You will only be asked for the required config values. If you would like to make changes
to your Ampache install at a later date simply edit %s"), $prefix . '/config/ampache.cfg.php'); ?>
+		</p>
+</div>

Modified: trunk/templates/show_install.inc.php
===================================================================
--- trunk/templates/show_install.inc.php	2010-08-17 20:59:16 UTC (rev 2451)
+++ trunk/templates/show_install.inc.php	2010-09-18 14:58:23 UTC (rev 2452)
 <at>  <at>  -19,47 +19,16  <at>  <at> 
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
-if (!defined('INSTALL')) { exit; }
 $prefix = realpath(dirname(__FILE__). "/../");
-$dir = is_rtl($htmllang) ? 'rtl' : 'ltr';
+require $prefix . '/templates/install_header.inc.php';
 ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $htmllang; ?>" lang="<?php echo
$htmllang; ?>" dir="<?php echo $dir;?>">
-<head>
-<title>Ampache :: For The Love Of Music - Install</title>
-<link rel="stylesheet" href="templates/install.css" type="text/css" media="screen" />
-<meta http-equiv="Content-Type" content="text/html; Charset=<?php echo $charset; ?>" />
-</head>
-<body>
-<script src="modules/prototype/prototype.js" language="javascript" type="text/javascript"></script>
-<script src="lib/javascript/base.js" language="javascript" type="text/javascript"></script>
-<div id="header">
-<h1><?php echo _("Ampache Installation"); ?></h1>
-<p>Pour l'Amour de la Musique</p>
-</div>
-<div id="text-box">
-
-	<div class="notify">
-		<h3><?php echo _('Requirements'); ?></h3>
-		<p>
-		<?php echo _("This Page handles the installation of the Ampache database and the creation of the
ampache.cfg.php file. Before you continue please make sure that you have the following
pre-requisites"); ?>
-		</p>
-		<ul>
-			<li><?php echo _("A MySQL Server with a username and password that can create/modify databases"); ?></li>
-			<li><?php echo sprintf(_("Your webserver has read access to the %s file and the %s file"),$prefix .
'/sql/ampache.sql',$prefix . '/config/ampache.cfg.dist'); ?></li>
-		</ul>
-		<p>
-<?php echo sprintf(_('Once you have ensured that you have the above requirements please fill out the
information below. You will only be asked for the required config values. If you would like to make changes
to your ampache install at a later date simply edit %s'),$prefix . '/config/ampache.cfg.php'); ?>
-		</p>
-	</div>
-
 	<div class="content">
-		<strong><?php echo _("Step 1 - Creating and Inserting the Ampache Database"); ?></strong><br />
+		<strong><?php echo _('Step 1 - Create the Ampache database'); ?></strong><br />
 		<dl>
-			<dd><?php echo _("This step creates and inserts the Ampache database, as such please provide a mysql
account with database creation rights. This step may take a while depending upon the speed of your
computer"); ?></dd>
+			<dd><?php echo _('This step creates and inserts the Ampache database, so please provide a MySQL
account with database creation rights. This step may take some time on slower computers.'); ?></dd>
 		</dl>
-		<?php echo _("Step 2 - Creating the Ampache.cfg.php file"); ?><br />
-		<?php echo _("Step 3 - Setup Initial Account"); ?><br />
+		<?php echo _('Step 2 - Create ampache.cfg.php'); ?><br />
+		<?php echo _('Step 3 - Set up the initial account'); ?><br />
 		<br />
 		<?php Error::display('general'); ?>
 		<br />

Modified: trunk/templates/show_install_account.inc.php
===================================================================
--- trunk/templates/show_install_account.inc.php	2010-08-17 20:59:16 UTC (rev 2451)
+++ trunk/templates/show_install_account.inc.php	2010-09-18 14:58:23 UTC (rev 2452)
 <at>  <at>  -20,39 +20,15  <at>  <at> 
  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

 */
-if (!defined('INSTALL')) { exit; }
 $prefix = realpath(dirname(__FILE__). "/../");
+require $prefix . '/templates/install_header.inc.php';
 ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $htmllang; ?>" lang="<?php echo
$htmllang; ?>">
-<head>
-<title>Ampache :: For The Love Of Music - Install</title>
-<link rel="stylesheet" href="templates/install.css" type="text/css" media="screen" />
-<meta http-equiv="Content-Type" content="text/html; Charset=<?php echo $charset; ?>" />
-</head>
-<body>
-<div id="header">
-<h1><?php echo _("Ampache Installation"); ?></h1>
-<p>For the love of Music</p>
-</div>
-
-<div id="text-box">
-
-	<div class="notify">
-	<?php echo _("This Page handles the installation of the Ampache database and the creation of the
ampache.cfg.php file. Before you continue please make sure that you have the following
pre-requisites"); ?>
-	<br />
-	<ul>
-        <li><?php echo _("A MySQL Server with a username and password that can create/modify databases"); ?></li>
-	<li><?php echo sprintf(_("Your webserver has read access to the %s file and the %s file"),$prefix .
'/sql/ampache.sql',$prefix . '/config/ampache.cfg.dist'); ?></li>
-	</ul>
-<?php echo _("Once you have ensured that you have the above requirements please fill out the information
below. You will only be asked for the required config values. If you would like to make changes to your
ampache install at a later date simply edit /config/ampache.cfg.php"); ?>
-	</div>
 	<div class="content">
-	<?php echo _("Step 1 - Creating and Inserting the Ampache Database"); ?><br />
-	<?php echo _("Step 2 - Creating the ampache.cfg.php file"); ?><br />
-	<strong><?php echo _("Step 3 - Setup Initial Account"); ?></strong><br />
+	<?php echo _('Step 1 - Create the Ampache database'); ?><br />
+	<?php echo _('Step 2 - Create ampache.cfg.php'); ?><br />
+	<strong><?php echo _('Step 3 - Set up the initial account'); ?></strong><br />
 	<dl>
-	<dd><?php echo _("This step creates your initial Ampache admin account. Once your admin account has
been created you will be directed to the login page"); ?></dd>
+	<dd><?php echo _('This step creates your initial Ampache admin account. Once your admin account has
been created you will be redirected to the login page.'); ?></dd>
 	</dl>
 	<?php Error::display('general'); ?>
 	<br />

Modified: trunk/templates/show_install_check.inc.php
===================================================================
--- trunk/templates/show_install_check.inc.php	2010-08-17 20:59:16 UTC (rev 2451)
+++ trunk/templates/show_install_check.inc.php	2010-09-18 14:58:23 UTC (rev 2452)
 <at>  <at>  -38,6 +38,20  <at>  <at> 
 </td>
 </tr>
 <tr>
+<td><?php echo sprintf(_('%s is readable'), 'ampache.sql'); ?></td>
+<td>
+<?php
+	if (!is_readable($prefix . '/sql/ampache.sql')) {
+		echo debug_result('', false);
+		Error::add('install', sprintf(_('%s is readable'), 'ampache.sql'));
+	}
+	else {
+		echo debug_result('', true);
+	}
+?>
+</td>
+</tr>
+<tr>
 <td><?php echo _('PHP Version'); ?>:</td>
 <td>
 <?php
 <at>  <at>  -59,12 +73,12  <at>  <at> 
 ?>
 </td>
 </tr><tr>
-<td><?php echo _('Mysql for PHP'); ?>:</td>
+<td><?php echo _('PHP MySQL Support'); ?>:</td>
 <td>
 <?php
 	if (!check_php_mysql()) {
 		echo debug_result('',false);
-		Error::add('install',_('Mysql for PHP'));
+		Error::add('install', _('PHP MySQL Support'));
 	}
 	else {
 		echo debug_result(mysql_get_client_info(),true);
 <at>  <at>  -85,12 +99,12  <at>  <at> 
 ?>
 </td>
 </tr><tr>
-<td><?php echo _('PHP ICONV Support'); ?>:</td>
+<td><?php echo _('PHP iconv Support'); ?>:</td>
 <td>
 <?php
 	if (!check_php_iconv()) {
 		echo debug_result('',false);
-		Error::add('install',_('PHP ICONV Support'));
+		Error::add('install', _('PHP iconv Support'));
 	}
 	else {
 		echo debug_result('',true);
 <at>  <at>  -111,12 +125,12  <at>  <at> 
 ?>
 </td>
 </tr><tr>
-<td><?php echo _('PHP PutENV Support'); ?>:</td>
+<td><?php echo _('PHP putenv Support'); ?>:</td>
 <td>
 <?php
 	if (!check_putenv()) {
 		echo debug_result('',false);
-		Error::add('install',_('PHP PutENV Support'));
+		Error::add('install', _('PHP putenv Support'));
 	}
 	else {
 		echo debug_result('',true);
 <at>  <at>  -126,11 +140,11  <at>  <at> 
 </tr><tr>
 <th colspan="2"><h4><?php echo _('Optional'); ?></h4></th>
 </tr><tr>
-<td><?php echo _('Gettext Support'); ?>:</td>
+<td><?php echo _('PHP gettext Support'); ?>:</td>
 <td>
 <?php
 	if (!check_gettext()) {
-		echo debug_result(_('Gettext Emulator will be used'),false);
+		echo debug_result(_('gettext emulation will be used'), false);
 	}
 	else {
 		echo debug_result('',true);
 <at>  <at>  -138,11 +152,11  <at>  <at> 
 ?>
 </td>
 </tr><tr>
-<td><?php echo _('Mbstring Support'); ?>:</td>
+<td><?php echo _('PHP mbstring Support'); ?>:</td>
 <td>
 <?php
 	if (!check_mbstring()) {
-		echo debug_result(_('Multibyte Character may not detect correct'),false);
+		echo debug_result(_('Multibyte character encodings may not be autodetected correctly'), false);
 	}
 	else {
 		echo debug_result('',true);
 <at>  <at>  -154,7 +168,7  <at>  <at> 
 <td>
 <?php
 	if (!check_php_memory()) {
-		echo debug_result(_('Memory Limit less then recommended size') . ' ' . ini_get('memory_limit'),false);
+		echo debug_result(_('Memory limit less than recommended size') . ' ' . ini_get('memory_limit'), false);
 	}
 	else {
 		echo debug_result(ini_get('memory_limit'),true);
 <at>  <at>  -163,11 +177,11  <at>  <at> 
 ?>
 </td>
 </tr><tr>
-<td><?php echo _('PHP Execution timelimit'); ?>:</td>
+<td><?php echo _('PHP Execution Time Limit'); ?>:</td>
 <td>
 <?php
 	if (!check_php_timelimit()) {
-		echo debug_result(_('Execution timelimit less the recommended') . ' ' . ini_get('max_execution_time'),false);
+		echo debug_result(_('Execution time limit less than recommended') . ' ' .
ini_get('max_execution_time'), false);
 	}
 	else {
 		echo debug_result(ini_get('max_execution_time') . ' ' .  _('seconds'),true);

Modified: trunk/templates/show_install_config.inc.php
===================================================================
--- trunk/templates/show_install_config.inc.php	2010-08-17 20:59:16 UTC (rev 2451)
+++ trunk/templates/show_install_config.inc.php	2010-09-18 14:58:23 UTC (rev 2452)
 <at>  <at>  -20,41 +20,16  <at>  <at> 
  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

 */
-if (!defined('INSTALL')) { exit; }
 $prefix = realpath(dirname(__FILE__). "/../");
+require $prefix . '/templates/install_header.inc.php';
 ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $htmllang; ?>" lang="<?php echo
$htmllang; ?>">
-<head>
-<title>Ampache :: For The Love Of Music - Install</title>
-<link rel="stylesheet" href="templates/install.css" type="text/css" media="screen" />
-<meta http-equiv="Content-Type" content="text/html; Charset=<?php echo $charset; ?>" />
-</head>
-<body>
-<div id="header">
-<h1><?php echo _('Ampache Installation'); ?></h1>
-<p>Pour l'Amour de la Musique</p>
-</div>
-<div id="text-box">
-
-	<div class="notify">
-		<?php echo _("This Page handles the installation of the Ampache database and the creation of the
ampache.cfg.php file. Before you continue please make sure that you have the following
pre-requisites"); ?>
-		<br />
-		<ul>
-        	<li><?php echo _("A MySQL Server with a username and password that can create/modify databases"); ?></li>
- 		<li><?php printf(_("Your webserver has read access to the %s file and the %s file"),$prefix .
'/sql/ampache.sql',$prefix . '/config/ampache.cfg.dist'); ?></li>
-
-		</ul>
-		<?php printf(_('Once you have ensured that you have the above requirements please fill out the
information below. You will only be asked for the required config values. If you would like to make changes
to your ampache install at a later date simply edit %s'),$prefix . '/config/ampache.cfg.php'); ?>
-	</div>
-
 	<div class="content">
-		<?php echo _("Step 1 - Creating and Inserting the Ampache Database"); ?><br />
-		<strong><?php echo _("Step 2 - Creating the Ampache.cfg.php file"); ?></strong><br />
+		<?php echo _('Step 1 - Create the Ampache database'); ?><br />
+		<strong><?php echo _('Step 2 - Create ampache.cfg.php'); ?></strong><br />
 		<dl>
-		<dd><?php printf(_('This steps takes the basic config values and generates the config file. It will
prompt you to download the config file. Please put the downloaded config file in
%s'),$prefix.'/config'); ?></dd>
+		<dd><?php printf(_('This step takes the basic config values and generates the config file. It will
prompt you to download the config file. Please put the downloaded config file in
%s'),$prefix.'/config'); ?></dd>
 		</dl>
-		<?php echo _("Step 3 - Setup Initial Account"); ?><br />
+		<?php echo _('Step 3 - Set up the initial account'); ?><br />
 		<?php Error::display('general'); ?>
 		<br />

 <at>  <at>  -67,7 +42,7  <at>  <at> 
 	<td class="align"><input type="text" name="web_path" value="<?php echo $web_path; ?>" /></td>
 </tr>
 <tr>
-	<td class="align"><?php echo _('Desired Database Name'); ?></td>
+	<td class="align"><?php echo _('Database Name'); ?></td>
 	<td class="align"><input type="text" name="local_db" value="<?php echo
scrub_out($_REQUEST['local_db']); ?>" /></td>
 </tr>
 <tr>
 <at>  <at>  -95,7 +70,7  <at>  <at> 
 		<br />
 		<table>
 <tr>
-        <td class="align"><?php echo _('Ampache.cfg.php Exists?'); ?></td>
+        <td class="align"><?php echo _('ampache.cfg.php exists?'); ?></td>
         <td>[
         <?php
                 if (!is_readable($configfile)) {
 <at>  <at>  -110,7 +85,7  <at>  <at> 
 </tr>
 <tr>
         <td class="align">
-                <?php echo _('Ampache.cfg.php Configured?'); ?>
+                <?php echo _('ampache.cfg.php configured?'); ?>
         </td>
         <td>[
         <?php
 <at>  <at>  -129,7 +104,7  <at>  <at> 
 	<td>&nbsp;</td>
 	<td>
 	<?php $check_url = WEB_PATH .
"?action=show_create_config&amp;htmllang=$htmllang&amp;charset=$charset&amp;local_db=" .
$_REQUEST['local_db'] . "&amp;local_host=" . $_REQUEST['local_host']; ?>
-	<a href="<?php echo $check_url; ?>">[<?php echo _('Check for Config'); ?>]</a>
+	<a href="<?php echo $check_url; ?>">[<?php echo _('Recheck Config'); ?>]</a>
 	</td>
 		</tr>
 		</table>

Modified: trunk/templates/show_install_lang.inc.php
===================================================================
--- trunk/templates/show_install_lang.inc.php	2010-08-17 20:59:16 UTC (rev 2451)
+++ trunk/templates/show_install_lang.inc.php	2010-09-18 14:58:23 UTC (rev 2452)
 <at>  <at>  -20,46 +20,17  <at>  <at> 
  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
 $prefix = realpath(dirname(__FILE__). "/../");
+require $prefix . '/templates/install_header.inc.php';
 ?>
-<?php if (!defined('INSTALL')) { exit; } ?>
-<?php $results = 0; ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $htmllang; ?>" lang="<?php echo
$htmllang; ?>">
-<head>
-<title>Ampache :: Pour l'Amour de la Musique - Install</title>
-<link rel="stylesheet" href="templates/install.css" type="text/css" media="screen" />
-<meta http-equiv="Content-Type" content="text/html; Charset=<?php echo $charset; ?>" />
-</head>
-<body>
-<script src="modules/prototype/prototype.js" language="javascript" type="text/javascript"></script>
-<script src="lib/javascript/base.js" language="javascript" type="text/javascript"></script>
-<div id="header">
-<h1><?php echo _('Ampache Installation'); ?></h1>
-<p>For the love of Music</p>
-</div>
-<div id="text-box">
-	<div class="notify">
-		<h3><?php echo _('Requirements'); ?></h3>
-		<p>
-		<?php echo _('This Page handles the installation of the Ampache database and the creation of the
ampache.cfg.php file. Before you continue please make sure that you have the following
pre-requisites'); ?>
-		</p>
-		<ul>
-			<li><?php echo _('A MySQL Server with a username and password that can create/modify databases'); ?></li>
-                        <li><?php echo sprintf(_("Your webserver has read access to the %s file and the %s file"),$prefix .
'/sql/ampache.sql',$prefix . '/config/ampache.cfg.php.dist'); ?></li>
-		</ul>
-		<p>
-<?php echo sprintf(_("Once you have ensured that you have the above requirements please fill out the
information below. You will only be asked for the required config values. If you would like to make changes
to your ampache install at a later date simply edit %s"),$prefix . '/config/ampache.cfg.php'); ?>
-		</p>
 <?php require_once 'templates/show_install_check.inc.php'; ?>
-</div>
 <?php if (Error::occurred()) { ?>
 	<div class="content">
-	<span class="fatalerror"><?php echo _('Minimum Requirements not met. Unable to Install Ampache.'); ?></span>
+	<span class="fatalerror"><?php echo _('Minimum requirements not met. Unable to install Ampache.'); ?></span>
 	</div>
 <?php } ?>

 <div class="content">
-	<strong><?php echo _('Choose installation language.'); ?></strong>
+	<strong><?php echo _('Choose Installation Language'); ?></strong>
 	<p>
 	<?php Error::display('general'); ?>
 	</p>


Gmane