aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrub <rub@piwigo.org>2007-02-25 11:42:25 +0000
committerrub <rub@piwigo.org>2007-02-25 11:42:25 +0000
commitab922de7422076b1e3fdd49dc2e51b524e5fe6e2 (patch)
tree7821bd7a5b51b0e12f92ae3577b18cc1a92ed8ce
parent027db797b2853e682c36793d35a2987c9e1cbc0a (diff)
Improvement for PWG installation:
o Installation is now with new colors o On selected language, page are reload in order to display page with selected language git-svn-id: http://piwigo.org/svn/trunk@1855 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--include/functions_html.inc.php20
-rw-r--r--install.php45
-rw-r--r--template/yoga/install.tpl229
3 files changed, 182 insertions, 112 deletions
diff --git a/include/functions_html.inc.php b/include/functions_html.inc.php
index 74934cbf0..60f26a45a 100644
--- a/include/functions_html.inc.php
+++ b/include/functions_html.inc.php
@@ -4,7 +4,7 @@
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
// +-----------------------------------------------------------------------+
-// | branch : BSF (Best So Far)
+// | file : $Id$
// | last update : $Date$
// | last modifier : $Author$
// | revision : $Revision$
@@ -230,24 +230,6 @@ function create_navigation_bar(
return $navbar;
}
-//
-// Pick a language, any language ...
-//
-function language_select($default, $select_name = "language")
-{
- $available_lang = get_languages();
-
- $lang_select = '<select name="' . $select_name . '">';
- foreach ($available_lang as $code => $displayname)
- {
- $selected = ( strtolower($default) == strtolower($code) ) ? ' selected="selected"' : '';
- $lang_select .= '<option value="' . $code . '"' . $selected . '>' . ucwords($displayname) . '</option>';
- }
- $lang_select .= '</select>';
-
- return $lang_select;
-}
-
/**
* returns the list of categories as a HTML string
*
diff --git a/install.php b/install.php
index 6e2566996..831ed98c2 100644
--- a/install.php
+++ b/install.php
@@ -4,8 +4,7 @@
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
// +-----------------------------------------------------------------------+
-// | branch : BSF (Best So Far)
-// | file : $RCSfile$
+// | file : $Id$
// | last update : $Date$
// | last modifier : $Author$
// | revision : $Revision$
@@ -34,6 +33,24 @@ function guess_lang()
return 'en_UK.iso-8859-1';
}
+//
+// Pick a language, any language ...
+//
+function language_select($default, $select_name = "language")
+{
+ $available_lang = get_languages();
+
+ $lang_select = '<select name="' . $select_name . '" onchange="document.location = \''.PHPWG_ROOT_PATH.'install.php?language=\'+this.options[this.selectedIndex].value;">';
+ foreach ($available_lang as $code => $displayname)
+ {
+ $selected = ( strtolower($default) == strtolower($code) ) ? ' selected="selected"' : '';
+ $lang_select .= '<option value="'.$code.'" ' . $selected . '>' . ucwords($displayname) . '</option>';
+ }
+ $lang_select .= '</select>';
+
+ return $lang_select;
+}
+
/**
* loads an sql file and executes all queries
*
@@ -101,6 +118,26 @@ if( !get_magic_quotes_gpc() )
@reset($_POST);
}
+ if( is_array($_GET) )
+ {
+ while( list($k, $v) = each($_GET) )
+ {
+ if( is_array($_GET[$k]) )
+ {
+ while( list($k2, $v2) = each($_GET[$k]) )
+ {
+ $_GET[$k][$k2] = addslashes($v2);
+ }
+ @reset($_GET[$k]);
+ }
+ else
+ {
+ $_GET[$k] = addslashes($v);
+ }
+ }
+ @reset($_GET);
+ }
+
if( is_array($_COOKIE) )
{
while( list($k, $v) = each($_COOKIE) )
@@ -173,6 +210,10 @@ if ( isset( $_POST['language'] ))
{
$language = strip_tags($_POST['language']);
}
+elseif ( isset( $_GET['language'] ))
+{
+ $language = strip_tags($_GET['language']);
+}
else
{
$language = guess_lang();
diff --git a/template/yoga/install.tpl b/template/yoga/install.tpl
index 2332910e2..76ab17782 100644
--- a/template/yoga/install.tpl
+++ b/template/yoga/install.tpl
@@ -7,145 +7,188 @@
<meta http-equiv="Content-Style-Type" content="text/css">
<title>PhpWebGallery {RELEASE}</title>
<style type="text/css">
-a, a:hover {
-color:#006699;
+
+body, input, select {
+ background-color:#cde;
}
-body,table,input,form,select {
-font-family:arial,verdana,sans-serif;
-font-size:12px;
-color:#000000;
-text-align:left;
+body {
+ margin: 5px;
+ padding: 0;
+ font-size: 0.8em;
+ font-family: Univers, Helvetica, Optima, "Bitstream Vera Sans", sans-serif;
}
-table
-{
-border-collapse:separate;
+
+body, table, input, form, select {
+ color:#369;
+ text-align:left;
}
-body {
-background-color:#E5E5E5;
-margin:5px;
+
+a {
+ text-decoration: none;
+ color: #c60;
+}
+
+a:hover {
+ color: #f92;
+}
+
+table {
+ border-collapse:separate;
+}
+
+.title {
+ letter-spacing: 0.2em;
+ text-align : center;
+ font-size: 150%;
+ font-weight: bold;
+ padding: 0;
+ margin: 0.5em 0 1em 0;
}
.contenucellule {
-background-color:#EEEEEE;
-border:2px solid #006699;
+ border-color: #69c;
+ background-color:#eee;
+ margin:12px 20px;
+ border-width: 3px;
+ border-style: solid ;
+}
+
+.error_copy {
+ color: #900;
+}
+
+th, .submit {
+ text-align: center;
+ font-weight: bold;
+ background-color: #369;
}
th {
-font-weight:bold;
-background-color:#D3DCE3;
-margin-bottom:10px;
-text-align: center;
+ font-size: 120%;
+ margin-bottom:10px;
+ color:#fff;
}
-td.row1 {
-background-color:#E6E4E4;
+
+td.row {
+ font-size: 90%;
}
-td.row2
-{
-background-color:#E8E8E8;
+
+.submit {
+ color: #cde
}
-.info {
-color:darkblue;
-text-align:center;
+.header {
+ font-weight: normal;
+ text-align: center;
+ margin: 20px;
}
+
+.infos {
+ padding: 15px;
+ font-weight: normal;
+ text-align: left;
+}
+
+.infos_title {
+ font-size: 150%;
+ padding: 15px;
+ font-weight: bold;
+ text-align: left;
+}
+
.errors {
- text-align:left;
- margin:25px;
- background-color:#ffe1e1;
+ text-align: left;
+ margin: 25px;
+ color: #900;
+ background-color: #ffe1e1;
border:1px solid red;
- color:black;
-}
-.grostitre {
- text-align : center;
- font-size : 20px;
- margin-bottom : 20px;
}
</style>
</head>
<body>
- <table style="width:100%;height:100%">
- <tr align="center" valign="middle">
- <td>
- <div class="grostitre">PhpWebGallery {RELEASE}</div>
- <table class="table1">
- <!-- BEGIN errors -->
- <tr>
- <td class="contenucellule" colspan="3">
- <div class="errors">
- <ul>
- <!-- BEGIN error -->
- <li>{errors.error.ERROR}</li>
- <!-- END error -->
- </ul>
- </div>
- </td>
- </tr>
- <!-- END errors -->
- <!-- BEGIN infos -->
- <tr>
- <td class="contenucellule" colspan="3">
- <div class="infos">
- <ul>
- <!-- BEGIN info -->
- <li>{infos.info.INFO}</li>
- <!-- END info -->
- </ul>
- </div>
- </td>
- </tr>
- <!-- END infos -->
- <tr>
- <td class="contenucellule">
+ <table style="width:100%;height:100%">
+ <tr align="center" valign="middle">
+ <td>
+ <div class="title">PhpWebGallery {RELEASE}</div>
+ <table class="table1">
+ <!-- BEGIN errors -->
+ <tr>
+ <td class="contenucellule" colspan="3">
+ <div class="errors">
+ <ul>
+ <!-- BEGIN error -->
+ <li>{errors.error.ERROR}</li>
+ <!-- END error -->
+ </ul>
+ </div>
+ </td>
+ </tr>
+ <!-- END errors -->
+ <!-- BEGIN infos -->
+ <tr>
+ <td class="contenucellule" colspan="3">
+ <div class="infos">
+ <ul>
+ <!-- BEGIN info -->
+ <li>{infos.info.INFO}</li>
+ <!-- END info -->
+ </ul>
+ </div>
+ </td>
+ </tr>
+ <!-- END infos -->
+ <tr>
+ <td class="contenucellule">
<!-- BEGIN error_copy -->
{L_ERR_COPY} :
<br />-----------------------------------------------------<br />
-<div style="color:blue;">{error_copy.FILE_CONTENT}</div>
+<div class="error_copy">{error_copy.FILE_CONTENT}</div>
-----------------------------------------------------<br />
<!-- END error_copy -->
<!-- BEGIN install -->
<form method="POST" action="{F_ACTION}" name="install_form">
- <table width="100%">
- <tr>
+ <table>
+ <tr>
<th colspan="3">{L_BASE_TITLE}</th>
</tr>
<tr>
<td style="width:30%;">{L_LANG_TITLE}</td>
<td colspan="2" align="left">
- {F_LANG_SELECT}
+ {F_LANG_SELECT}
</td>
</tr>
<tr>
- <th colspan="3">{L_DB_TITLE}</th>
+ <td colspan="3">&nbsp;</td>
</tr>
<tr>
- <td colspan="3">&nbsp;</td>
+ <th colspan="3">{L_DB_TITLE}</th>
</tr>
<tr>
<td>{L_DB_HOST}</td>
<td align=center><input type="text" name="dbhost" value="{F_DB_HOST}" /></td>
- <td class="row2">{L_DB_HOST_INFO}</td>
+ <td class="row">{L_DB_HOST_INFO}</td>
</tr>
<tr>
<td>{L_DB_USER}</td>
<td align=center><input type="text" name="dbuser" value="{F_DB_USER}" /></td>
- <td class="row2">{L_DB_USER_INFO}</td>
+ <td class="row">{L_DB_USER_INFO}</td>
</tr>
<tr>
<td>{L_DB_PASS}</td>
<td align=center><input type="password" name="dbpasswd" value="" /></td>
- <td class="row2">{L_DB_PASS_INFO}</td>
+ <td class="row">{L_DB_PASS_INFO}</td>
</tr>
<tr>
<td>{L_DB_NAME}</td>
<td align=center><input type="text" name="dbname" value="{F_DB_NAME}" /></td>
- <td class="row2">{L_DB_NAME_INFO}</td>
+ <td class="row">{L_DB_NAME_INFO}</td>
</tr>
<tr>
<td>{L_DB_PREFIX}</td>
<td align=center><input type="text" name="prefix" value="{F_DB_PREFIX}" /></td>
- <td class="row2">{L_DB_PREFIX_INFO}</td>
+ <td class="row">{L_DB_PREFIX_INFO}</td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
@@ -154,49 +197,53 @@ text-align:center;
<th colspan="3">{L_ADMIN_TITLE}</th>
</tr>
<tr>
- <td colspan="3">&nbsp;</td>
- </tr>
- <tr>
<td>{L_ADMIN}</td>
<td align="center"><input type="text" name="admin_name" value="{F_ADMIN}" /></td>
- <td class="row2">{L_ADMIN_INFO}</td>
+ <td class="row">{L_ADMIN_INFO}</td>
</tr>
<tr>
<td>{L_ADMIN_PASSWORD}</td>
<td align="center"><input type="password" name="admin_pass1" value="" /></td>
- <td class="row2">{L_ADMIN_PASSWORD_INFO}</td>
+ <td class="row">{L_ADMIN_PASSWORD_INFO}</td>
</tr>
<tr>
<td>{L_ADMIN_CONFIRM_PASSWORD}</td>
<td align="center"><input type="password" name="admin_pass2" value="" /></td>
- <td class="row2">{L_ADMIN_CONFIRM_PASSWORD_INFO}</td>
+ <td class="row">{L_ADMIN_CONFIRM_PASSWORD_INFO}</td>
</tr>
<tr>
<td>{L_ADMIN_EMAIL}</td>
<td align="center"><input type="text" name="admin_mail" value="{F_ADMIN_EMAIL}" /></td>
- <td class="row2">{L_ADMIN_EMAIL_INFO}</td>
+ <td class="row">{L_ADMIN_EMAIL_INFO}</td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3" align="center">
- <input type="submit" name="install" value="{L_SUBMIT}" />
+ <input class="submit" type="submit" name="install" value="{L_SUBMIT}" />
</td>
</tr>
+ <tr>
+ <td colspan="3">&nbsp;</td>
+ </tr>
</table>
</form>
<!-- END install -->
<!-- BEGIN install_end -->
-<div class="infos_title">{L_END_TITLE}</div>
-<div style="padding:5px;">{L_END_MESSAGE}</div>
+<div class="infos_title">
+{L_END_TITLE}
+</div>
+<div class="infos">
+{L_END_MESSAGE}
+</div>
<!-- END install_end -->
</td>
</tr>
</table>
- <div style="text-align:center;margin:20px;">{L_INSTALL_HELP}</div>
+ <div class="header">{L_INSTALL_HELP}</div>
</td>
</tr>
</table>