diff options
author | Paul 'flowerysong' Arthur <flowerysong00@yahoo.com> | 2010-09-18 14:58:23 +0000 |
---|---|---|
committer | Paul 'flowerysong' Arthur <flowerysong00@yahoo.com> | 2010-09-18 14:58:23 +0000 |
commit | 613ac787827ea12e3aaef5dc6cd12b11a9acb1f5 (patch) | |
tree | c53a3e5fc4e607236b55fbacaee36d7896c5f615 | |
parent | df80bd72432011010dc0e91ab564659ca6b2c500 (diff) | |
download | ampache-613ac787827ea12e3aaef5dc6cd12b11a9acb1f5.tar.gz ampache-613ac787827ea12e3aaef5dc6cd12b11a9acb1f5.tar.bz2 ampache-613ac787827ea12e3aaef5dc6cd12b11a9acb1f5.zip |
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.
-rw-r--r-- | lostpassword.php | 6 | ||||
-rw-r--r-- | templates/install_header.inc.php | 53 | ||||
-rw-r--r-- | templates/show_install.inc.php | 41 | ||||
-rw-r--r-- | templates/show_install_account.inc.php | 34 | ||||
-rw-r--r-- | templates/show_install_check.inc.php | 40 | ||||
-rw-r--r-- | templates/show_install_config.inc.php | 43 | ||||
-rw-r--r-- | templates/show_install_lang.inc.php | 35 |
7 files changed, 105 insertions, 147 deletions
diff --git a/lostpassword.php b/lostpassword.php index 43022614..5804bcf8 100644 --- a/lostpassword.php +++ b/lostpassword.php @@ -36,9 +36,9 @@ switch ($action) { $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'; @@ -60,7 +60,7 @@ function send_newpassword($email,$current_ip){ 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; diff --git a/templates/install_header.inc.php b/templates/install_header.inc.php new file mode 100644 index 00000000..7f0079ea --- /dev/null +++ b/templates/install_header.inc.php @@ -0,0 +1,53 @@ +<?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> diff --git a/templates/show_install.inc.php b/templates/show_install.inc.php index 616f4a87..6a38e1ca 100644 --- a/templates/show_install.inc.php +++ b/templates/show_install.inc.php @@ -19,47 +19,16 @@ 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 /> diff --git a/templates/show_install_account.inc.php b/templates/show_install_account.inc.php index 826c88bd..b92c80af 100644 --- a/templates/show_install_account.inc.php +++ b/templates/show_install_account.inc.php @@ -20,39 +20,15 @@ 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 /> diff --git a/templates/show_install_check.inc.php b/templates/show_install_check.inc.php index 08952496..8a60eb94 100644 --- a/templates/show_install_check.inc.php +++ b/templates/show_install_check.inc.php @@ -38,6 +38,20 @@ </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 @@ -59,12 +73,12 @@ ?> </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); @@ -85,12 +99,12 @@ ?> </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); @@ -111,12 +125,12 @@ ?> </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); @@ -126,11 +140,11 @@ </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); @@ -138,11 +152,11 @@ ?> </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); @@ -154,7 +168,7 @@ <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); @@ -163,11 +177,11 @@ ?> </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); diff --git a/templates/show_install_config.inc.php b/templates/show_install_config.inc.php index 70d95975..99e424bf 100644 --- a/templates/show_install_config.inc.php +++ b/templates/show_install_config.inc.php @@ -20,41 +20,16 @@ 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 /> @@ -67,7 +42,7 @@ $prefix = realpath(dirname(__FILE__). "/../"); <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> @@ -95,7 +70,7 @@ $prefix = realpath(dirname(__FILE__). "/../"); <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)) { @@ -110,7 +85,7 @@ $prefix = realpath(dirname(__FILE__). "/../"); </tr> <tr> <td class="align"> - <?php echo _('Ampache.cfg.php Configured?'); ?> + <?php echo _('ampache.cfg.php configured?'); ?> </td> <td>[ <?php @@ -129,7 +104,7 @@ $prefix = realpath(dirname(__FILE__). "/../"); <td> </td> <td> <?php $check_url = WEB_PATH . "?action=show_create_config&htmllang=$htmllang&charset=$charset&local_db=" . $_REQUEST['local_db'] . "&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> diff --git a/templates/show_install_lang.inc.php b/templates/show_install_lang.inc.php index eac64464..2b2a7cd8 100644 --- a/templates/show_install_lang.inc.php +++ b/templates/show_install_lang.inc.php @@ -20,46 +20,17 @@ 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> |