Revision: 14993
http://svn.sourceforge.net/gallery/?rev=14993&view=rev
Author: jenst
Date: 2006-10-28 08:42:59 -0700 (Sat, 28 Oct 2006)
Log Message:
-----------
2006-10-28 Jens Tkotz <jens@...> 1.6-alpha2-svn-b19
* CHANGE: Removed Js function localGetElementsByTagName() and
nnGetAllLayers().
So the config wizard does NOT WORK IN Netscape 4 anymore !
* Change: Again nicifying in config wizard.
Putted longer messages in step 1 into a toggle Box.
* Change: Typo toogle -> toggle
(Is there something well known with *oogle ?)
* Fix: typo in step 1, "nogo" is no type for infoBoxes.
* Change: indenting and " to ' convertion.
* Change: Use of galleryTable() in step 1, along with css adjustment.
* Removed: css/config.css.default
Modified Paths:
--------------
trunk/gallery/ChangeLog
trunk/gallery/Version.php
trunk/gallery/css/base.css.default
trunk/gallery/css/screen.css.default
trunk/gallery/includes/setup/checks.inc
trunk/gallery/js/toggle.js
trunk/gallery/lib/content.php
trunk/gallery/lib/setup.php
trunk/gallery/setup/check.inc
trunk/gallery/setup/check_versions.php
trunk/gallery/setup/index.php
Removed Paths:
-------------
trunk/gallery/css/config.css.default
Modified: trunk/gallery/ChangeLog
===================================================================
--- trunk/gallery/ChangeLog 2006-10-28 15:10:22 UTC (rev 14992)
+++ trunk/gallery/ChangeLog 2006-10-28 15:42:59 UTC (rev 14993)
@@ -1,3 +1,22 @@
+2006-10-28 Jens Tkotz <jens@...> 1.6-alpha2-svn-b19
+
+ * CHANGE: Removed Js function localGetElementsByTagName() and
+ nnGetAllLayers.
+ So the config wizard does NOT WORK IN Netscape 4 anymore !
+
+ * Change: Again nicifying in config wizard.
+ Putted longer messages in step 1 into a toggle Box.
+
+ * Change: Typo toogle -> toggle (Is there something well known with *oogle ?).
+
+ * Fix: typo in step 1, "nogo" is no type for infoBoxes.
+
+ * Change: indenting and " to ' convertion.
+
+ * Change: Use of galleryTable() in step 1, along with css adjustment.
+
+ * Removed: css/config.css.default
+
2006-10-27 Jens Tkotz <jens@...> 1.6-alpha2-svn-b18
* New: Added field initialized to Gallery UserDB.
Modified: trunk/gallery/Version.php
===================================================================
--- trunk/gallery/Version.php 2006-10-28 15:10:22 UTC (rev 14992)
+++ trunk/gallery/Version.php 2006-10-28 15:42:59 UTC (rev 14993)
@@ -22,7 +22,7 @@
?>
<?php
-$gallery->version = '1.6-alpha2-svn-b18';
+$gallery->version = '1.6-alpha2-svn-b19';
$gallery->config_version = 99;
$gallery->album_version = 38;
$gallery->user_version = 6;
Modified: trunk/gallery/css/base.css.default
===================================================================
--- trunk/gallery/css/base.css.default 2006-10-28 15:10:22 UTC (rev 14992)
+++ trunk/gallery/css/base.css.default 2006-10-28 15:42:59 UTC (rev 14993)
@@ -388,6 +388,8 @@
/******************** End autocomplete *********************/
+/***************** Styles used in config *******************/
+
.g-setup-block, .g-setup-fields {
width: 100%;
margin-bottom: 10px;
@@ -400,6 +402,28 @@
padding: 10px !important;
}
+.g-setupchecks td {
+ border-bottom: 2px solid #ececec;
+ vertical-align: top;
+}
+
+.g-setup-check-desc {
+ width: 35%;
+ font-weight: bold;
+}
+
+.g-setup-check-desc div {
+ font-weight: normal;
+}
+
+.g-setup-check-toggle {
+ border-right: 2px solid #ececec;
+}
+
+.g-setup-check-trafficlight {
+ border-right: 2px solid #ececec;
+}
+
.g-sitedesc td {
vertical-align: top;
}
@@ -489,4 +513,16 @@
-moz-border-radius: 8px;
}
-/******************** End infoBox ********************/
\ No newline at end of file
+/******************** End infoBox ********************/
+
+.progressBar {
+ width: 100%;
+ background: red;
+ height: 10px;
+}
+
+.progressBarDone {
+ width: 0%;
+ background: green;
+ height: 10px;
+}
\ No newline at end of file
Deleted: trunk/gallery/css/config.css.default
===================================================================
--- trunk/gallery/css/config.css.default 2006-10-28 15:10:22 UTC (rev 14992)
+++ trunk/gallery/css/config.css.default 2006-10-28 15:42:59 UTC (rev 14993)
@@ -1,152 +0,0 @@
-/*
- $Id$
-
- Gallery - a web based photo album viewer and editor
- Copyright (C) 2000-2006 Bharat Mediratta
-
- 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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
-
-*/
-
-body {
- margin-top: 10px; margin-left: 20px; margin-right: 20px;
- color: #000000;
- background-image: url(../images/simplex-bkg.gif);
-}
-
-.header {
- background-color: #E6E6DC;
- font-size: 1.5em; font-weight:bold;
- padding: 10px;
- border: 1px solid #000000;
-}
-
-.sitedesc {
- background-color: #FCFCF3;
- margin-top:5px; padding:5px;
- border: 1px solid #000000;
-}
-
-textarea:focus, input:focus {
- background-color: #FFFFDA;
-}
-
-img {
- border: none;
-}
-
-p#bottom { width: 500px; }
-
-div#top {
- width: 200px;
- text-align:center;
-}
-
-.error { font-weight:bold; background-color: #CC0000; color: #FFFFFF ;
- padding:2px;
- }
-
-.errorpct { font-weight:bold; background-color: #CC0000; color: #FFFFFF ;
- padding:2px;
- }
-
-.errorlong { font-weight:bold; background-color: #CC0000; color: #FFFFFF ;
- padding:2px; width: 100%; padding-left:10px;
- }
-
-.success { font-weight:bold; background-color: green; color: #FFFFFF ;
- width: 150px; padding:2px;
- }
-
-.successpct { font-weight:bold; background-color: green; color: #FFFFFF ;
- padding:2px;
- }
-
-.successlong { font-weight:bold; background-color: green; color: #FFFFFF ;
- width: 100%; padding:2px; padding-left:10px;
- }
-
-
-.warning { font-weight:bold; background-color: #FFFF33; color: #000000 ;
- width: 150px; padding:2px;
- }
-
-.warninglong { font-weight:bold; background-color: #FFFF33; color: #000000 ;
- width: 100%; padding:2px; padding-left:10px;
- }
-
-.warningpct { font-weight:bold; background-color: #FFFF33; color: #000000 ;
- padding:2px;
- }
-
-.separator {
- text-align:center;
- font-size: 22px;
- background-color: #000099; color:#FFFFFF;
- padding:2px;
-}
-
-
-.subgroup {
- text-align: center;
- font-size: 16px; font-weight: bold;
- background-color: #5e78dd; color:#FFFFFF;
- padding: 2px;
- width: 60%;
- margin-top: -5px; margin-bottom: 5px;
-}
-
-.inner {
- margin-bottom: 7px;
- border-bottom: 3px double #000000;
-}
-
-.shortdesc {
- background-color: #DCDCC0;
- padding:5px;
- font-weight: bold;
-}
-
-.desc {
- background-color: #FCFCF3 ;
- padding: 3px;
-}
-
-.emphasis {
- font-weight: bold;
-}
-
-.attention { font-size: 1.1em; font-weight:bold;
- color:red ;
- }
-
-a:link { color: #000099;
- }
-
-a:visited, a:hover {
- color: #409D27;
-}
-
-
-.install {
- margin-left: auto;
- margin-right: auto;
- margin-top: 3em;
- margin-bottom: 3em;
- padding: 10px;
- border: 1px solid #cccccc;
- width: 750px;
- background: #F1F1F1;
-}
\ No newline at end of file
Modified: trunk/gallery/css/screen.css.default
===================================================================
--- trunk/gallery/css/screen.css.default 2006-10-28 15:10:22 UTC (rev 14992)
+++ trunk/gallery/css/screen.css.default 2006-10-28 15:42:59 UTC (rev 14993)
@@ -652,7 +652,7 @@
border: 1px solid #fff;
}
-/****** Styles used in config *****/
+/***************** Styles used in config *******************/
/* Indicates an important setting. */
.g-attention {
Modified: trunk/gallery/includes/setup/checks.inc
===================================================================
--- trunk/gallery/includes/setup/checks.inc 2006-10-28 15:10:22 UTC (rev 14992)
+++ trunk/gallery/includes/setup/checks.inc 2006-10-28 15:42:59 UTC (rev 14993)
@@ -66,39 +66,32 @@
'<p style="font-weight: bold;">' . gTranslate('config',"Note:"). '</p>'.
gTranslate('config',"You can install the binaries from the Gallery site even if you don't have root access on your box! If you can't get it working, try leaving the NetPBM path blank and using ImageMagick instead.");
-$common_messages['fail-netpbm-partial'] =
- gTranslate('config',"I've found part of NetPBM, but some critical components are missing (see below). Perhaps your version of NetPBM is out of date.") . ' ' .
- $common_messages['getting-netpbm'];
-
$common_messages['getting-imagemagick'] = '<br>'.
sprintf(gTranslate('config',"Gallery prefers ImageMagick version 5.4.8 and up. (Tough Version 6.x is recommended.) You can get the entire ImageMagick package from the %sImageMagick website%s." ),
'<a href="http://www.imagemagick.org" target="_blank">', '</a>') .
'<p style="font-weight: bold;">' . gTranslate('config',"Note:"). '</p>'.
gTranslate('config',"The site also has binaries available for assorted operating systems. If you can't get it working, try leaving the ImageMagick path blank and using NetPBM instead.");
-$common_messages['fail-imagemagick-partial'] =
- gTranslate('config',"I've found part of ImageMagick , but some critical components are missing (see below).") . ' ' .
- $common_messages['getting-imagemagick'];
-
$common_messages['open-basedir-active'] =
'<p style="font-weight: bold;">' . gTranslate('config',"Note:"). '</p>'.
sprintf(gTranslate('config',"Your PHP installation is configured with the %s restriction. This may make it difficult for Gallery to detect and verify your binaries, even if you've already successfully used the Config. Wizard in the past. Don't worry too much if this page gives warnings; your settings will still be saved properly."),
'<b><a href="http://www.php.net/manual/en/features.safe-mode.php#ini.open-basedir" target="_blank">open_basedir</a></b>');
+/* The list of checks done in step 1 */
$checklist = array(
'gallery_version' => array(
'prompt' => gTranslate('config',"Gallery version"),
- 'optional' => 1,
'desc' => sprintf(gTranslate('config',"Check to see how old %s version %s is."),
Gallery(),
"<i>$gallery->version</i>"),
- 'func' => 'check_gallery_version'
+ 'func' => 'check_gallery_version',
+ 'optional' => 1,
),
'php' => array(
'prompt' => gTranslate('config',"PHP version"),
'desc' => gTranslate('config',"Check to see if you are running a supported Version of PHP.") .'<br>'. gTranslate('config',"Due to bugs and missing functionality in some PHP versions, the minimum PHP version for Gallery 1.5 and newer is at least PHP 4.1.0"),
'func' => 'check_php',
- 'fail-too-old' => sprintf(gTranslate('config',"You're running PHP version %s. You need to upgrade to PHP %s."), phpversion(), $MIN_PHP_MAJOR_VERSION),
+ 'fail-too-old' => sprintf(gTranslate('config',"You're running PHP version %s. You need to upgrade to at least PHP %s."), phpversion(), $MIN_PHP_MAJOR_VERSION),
'fail-incompatible' => sprintf(gTranslate('config',"You're running PHP version %s which has known bugs that cause Gallery to fail."), phpversion()),
'fail-buggy__FILE__' => gTranslate('config',"It seems your PHP has a problem with __FILE__, please upgrade to a recent Version"),
'serious' => 1,
@@ -112,24 +105,28 @@
'optional' => 1,
),
'safe_mode' => array(
- 'prompt' => gTranslate('config',"PHPs safe mode disabled"),
+ 'prompt' => gTranslate('config',"PHPs safe mode"),
'desc' => gTranslate('config',"Check to see if PHP is running in <b>safe_mode</b>. Safe Mode is a PHP security feature commonly used in shared environments. Gallery cannot run when Safe Mode is enabled because it imposes too many restrictions."),
'func' => 'check_safe_mode',
- 'fail-safe-mode' => sprintf(gTranslate('config',"<b>safe_mode</b> is enabled on this server. You must disable it before you can use Gallery. Refer to the FAQ, the forums, and the help page on the %sGallery website%s and the %sPHP website%s for assistance."),
- '<a href="http://gallery.sourceforge.net" target="_blank">',
- '</a>',
- '<a href="http://www.php.net/manual/en/features.safe-mode.php" target="_blank">',
- '</a>') .
- '<br><br>' .
- '<p style="font-weight: bold;">' . gTranslate('config',"Note:"). '</p>'.
- sprintf(gTranslate('config',"In some rare circumstances, Gallery thinks that Safe Mode is on, when it's really off. You can see for yourself by looking in the <i>Local</i> column of the <i>safe_mode</i> row in the %sPHP Info%s page. If it says 'Off' or '0' or 'undefined' then it's possible that Gallery made a mistake and you can continue. If not, then you must resolve this problem before you can use Gallery."),
- '<a href="phpinfo.php" target="_blank">',
- '</a>'),
+ 'fail-safe-mode' => gTranslate('config',"<b>safe_mode</b> is enabled on this server.") .
+ toggleBox('check_safe_mode',
+ sprintf(gTranslate('config',"<b>safe_mode</b> is enabled on this server. You must disable it before you can use Gallery. Refer to the FAQ, the forums, and the help page on the %sGallery website%s and the %sPHP website%s for assistance."),
+ '<a href="http://gallery.sourceforge.net" target="_blank">',
+ '</a>',
+ '<a href="http://www.php.net/manual/en/features.safe-mode.php" target="_blank">',
+ '</a>'
+ ) .
+ '<br><br>' .
+ '<p style="font-weight: bold;">' . gTranslate('config',"Note:") . '</p>'.
+ sprintf(gTranslate('config',"In some rare circumstances, Gallery thinks that Safe Mode is on, when it's really off. You can see for yourself by looking in the <i>Local</i> column of the <i>safe_mode</i> row in the %sPHP Info%s page. If it says 'Off' or '0' or 'undefined' then it's possible that Gallery made a mistake and you can continue. If not, then you must resolve this problem before you can use Gallery."),
+ '<a href="phpinfo.php" target="_blank">',
+ '</a>')
+ ),
'optional' => 1,
'serious' => 1
),
'exec' => array(
- 'prompt' => gTranslate('config',"PHPs exec() function enabled"),
+ 'prompt' => gTranslate('config',"PHPs exec() function"),
'desc' => gTranslate('config',"The <b>exec()</b> function is what Gallery uses to launch programs such as NetPBM, ImageMagick, and jhead. If <b>exec()</b> is disabled on your server then Gallery will not be able operate."),
'func' => 'check_exec',
'fail-exec' => gTranslate('config',"The <b>exec()</b> function is disabled on your server. Gallery will not function with this PHP configuration."),
@@ -144,50 +141,60 @@
"\tAllowOverride Options FileInfo\n" .
"</Directory></pre>\n" .
gTranslate('config',"If you are running PHP in CGI mode, this message is unavoidable."),
- 'fail-nohtaccess' => gTranslate('config',"Gallery could not test if your webserver is obeying the 'php_value' lines in your <b>.htaccess</b> as the (original) .htaccess file in your setup folder is missing."),
+ 'fail-nohtaccess' => gTranslate('config',"Gallery could not test if your webserver is obeying the 'php_value' lines in your <b>.htaccess</b> as the (original) .htaccess file in your setup folder is missing."),
'optional' => 1
),
'magic-quotes' => array(
'prompt' => gTranslate('config',"PHPs magic quotes off"),
- 'optional' => 1,
'desc' => sprintf(gTranslate('config',"Check to see if %smagic quotes%s are enabled on your PHP server. If they're on, you may notice strange behavior if you put ' (single-quote), " (double quote) or \ (backslash) characters in titles or captions in Gallery."),
'<b><a href="http://www.php.net/manual/en/configuration.php#ini.magic-quotes-gpc" target="_blank">',
'</a></b>'),
'func' => 'check_magic_quotes',
'fail-magic-quotes' => sprintf(gTranslate('config',"Magic quotes are on. Your webserver administrator can turn them off by putting %s in your <b>php.ini</b> file."),
- ": <pre>\n\tmagic_quotes_gpc = Off</pre>")
+ ": <pre>\n\tmagic_quotes_gpc = Off</pre>"),
+ 'optional' => 1
),
'mod-rewrite' => array(
'prompt' => gTranslate('config',"Apache mod_rewrite"),
'desc' => gTranslate('config',"Check to see if your webserver is compiled with <b>mod_rewrite</b>. This Apache module allows Gallery to use shorter URLs that are easier to read and look nicer when you mail them to your web-challenged relatives. It's not an essential feature."),
'func' => 'check_mod_rewrite',
- 'fail-mod-rewrite' => gTranslate('config',"Either <b>mod_rewrite</b> is not installed or your <b>.htaccess</b> file is not enabled (see above). Either way, we'll have to use longer URLs in the Gallery. If you want to turn it on, first make sure that your <b>.htaccess</b> file is being obeyed. If it still doesn't work, you may need to reconfigure and rebuild Apache with this flag: ") .
- "<pre>\t--enable-module=rewrite</pre>",
+ 'fail-mod-rewrite' => gTranslate('config',"Either <b>mod_rewrite</b> is not installed or your <b>.htaccess</b> file is not enabled (see above).") .
+ toggleBox('check_mod_rewrite',
+ gTranslate('config', "Either way, we'll have to use longer URLs in the Gallery. If you want to turn it on, first make sure that your <b>.htaccess</b> file is being obeyed. If it still doesn't work, you may need to reconfigure and rebuild Apache with this flag: ") .
+ "<pre>\t--enable-module=rewrite</pre>"),
'fail-mod-rewrite-nohtaccess' => gTranslate('config',"Gallery could not test if <b>mod_rewrite</b> is working, as the (original) .htaccess file in your setup folder is missing."),
'optional' => 1
),
'NetPBM' => array(
'prompt' => gTranslate('config',"NetPBM installed"),
- 'optional' => 1,
- 'desc' => gTranslate('config',"Check to see if NetPBM is installed so that Gallery can manipulate images (rotate, resize, make thumbnails, etc.). You only need to have either NetPBM <b>or</b> ImageMagick installed."),
+ 'desc' => gTranslate('config',"Check to see if NetPBM is installed so that Gallery can manipulate images (rotate, resize, make thumbnails, etc.). You only need to have either NetPBM <b>or</b> ImageMagick installed."),
'func' => 'check_graphics',
- 'fail-netpbm' => gTranslate('config',"I can't find NetPBM. If it's installed and not in the path of the webserver user that's OK—you can specify the path to NetPBM by hand on the following page. If it's not installed, you have two choices: " ) .
- $common_messages['getting-netpbm'],
- 'fail-netpbm-partial' =>
- $common_messages['fail-netpbm-partial'] .
- '<p><b> ' . gTranslate('config',"If NetPBM is installed and Gallery isn't finding it automatically that's OK—you can specify the path to NetPBM by hand on the following page.") .' </b>',
- 'open-basedir-note' => $common_messages['open-basedir-active']
+ 'fail-netpbm' => gTranslate('config',"I can't find NetPBM!") .
+ toggleBox('checkNetPBM', gTranslate('config',
+ "If it's installed and not in the path of the webserver user that's OK—you can specify the path to NetPBM by hand on the following page. If it's not installed, you have two choices: " ) .
+ $common_messages['getting-netpbm']),
+ 'fail-netpbm-partial' => gTranslate('config',"I've found part of NetPBM, but some components are missing (see below).") .
+ toggleBox('fail_netpbm_partial', gTranslate('config',"Perhaps your version of NetPBM is out of date.") . ' ' .
+ $common_messages['getting-netpbm'] .
+ '<p><b> ' . gTranslate('config',"If NetPBM is installed and Gallery isn't finding it automatically that's OK—you can specify the path to NetPBM by hand on the following page.") .' </b>'
+ ),
+ 'open-basedir-note' => $common_messages['open-basedir-active'],
+ 'optional' => 1,
),
'ImageMagick' => array(
'prompt' => gTranslate('config',"ImageMagick installed"),
'optional' => 1,
'desc' => gTranslate('config',"Check to see if ImageMagick is installed so that Gallery can manipulate images (rotate, resize, make thumbnails, etc.). You only need to have either ImageMagick <b>or</b> NetPBM installed."),
'func' => 'check_graphics_im',
- 'fail-imagemagick' => gTranslate('config',"I can't find ImageMagick. If it's installed and not in the path of the webserver user that's OK—you can specify the path to ImageMagick by hand on the following page. If it's not installed, you must install it. ") .
- $common_messages['getting-imagemagick'],
- 'fail-imagemagick-partial' =>
- $common_messages['fail-imagemagick-partial'] .
- '<p><b> ' . gTranslate('config',"If ImageMagick is installed and Gallery isn't finding it automatically that's OK—you can specify the path to ImageMagick by hand on the following page.") .' </b>',
+ 'fail-imagemagick' => gTranslate('config',"I can't find ImageMagick") .
+ toggleBox('fail_imagemagick', gTranslate('config',
+ "If it's installed and not in the path of the webserver user that's OK—you can specify the path to ImageMagick by hand on the following page. If it's not installed, you must install it. ") .
+ $common_messages['getting-imagemagick']),
+ 'fail-imagemagick-partial' => gTranslate('config',"I've found part of ImageMagick , but some components are missing (see below).") .
+ toggleBox('fail_imagemagick_partial',
+ $common_messages['getting-imagemagick'] .
+ '<p><b> ' . gTranslate('config',"If ImageMagick is installed and Gallery isn't finding it automatically that's OK—you can specify the path to ImageMagick by hand on the following page.") .' </b>'
+ ),
'open-basedir-note' => $common_messages['open-basedir-active']
),
'exif' => array(
@@ -195,9 +202,10 @@
'optional' => 1,
'desc' => gTranslate('config',"Check to see if <b>jhead</b> is installed so that Gallery can examine EXIF headers embedded in images created with most digital cameras."),
'func' => 'check_exif',
- 'fail-exif' => sprintf(gTranslate('config',"I can't find <b>jhead</b>. If it's installed and not in the path of the webserver user that's OK—you can specify the path by hand on the following page. If it's not installed, you can install it yourself. Jhead is a public domain EXIF parser. Source, linux binaries, and windows binaries can be found at the %sjhead homepage%s."),
- '<a href="http://www.sentex.net/~mwandel/jhead/index.html" target="_blank">',
- '</a>'),
+ 'fail-exif' => gTranslate('config',"I can't find <b>jhead</b>") .
+ toggleBox('check_exif', sprintf(gTranslate('core',
+ "If it's installed and not in the path of the webserver user that's OK—you can specify the path by hand on the following page. If it's not installed, you can install it yourself. Jhead is a public domain EXIF parser. Source, linux binaries, and windows binaries can be found at the %sjhead homepage%s."),
+ '<a href="http://www.sentex.net/~mwandel/jhead/index.html" target="_blank">', '</a>')),
'open-basedir-note' => $common_messages['open-basedir-active']
),
'jpegtran' => array (
@@ -205,9 +213,10 @@
'optional' => 1,
'desc' => gTranslate('config',"Check to see if <b>jpegtran</b> is installed so that Gallery can perform lossless rotations on JPEG images."),
'func' => 'check_jpegtran',
- 'fail-jpegtran' => sprintf(gTranslate('config',"I can't find <b>jpegtran</b>. If it's installed and not in the path of the webserver user that's OK—you can specify the path by hand on the following page. If it's not installed, you can install it yourself. Jpegtran is a free tool distributed by the Independent JPEG Group as part of <i>libjpeg</i>. Source may be found at the %sIJG homepage%s. Binaries may be found at the %sJPEG Club website%s or in the <i>libjpeg</i> package of Linux distributions."),
+ 'fail-jpegtran' => gTranslate('config',"I can't find <b>jpegtran</b>!") .
+ toggleBox('check_jpegtran', sprintf(gTranslate('config', "If it's installed and not in the path of the webserver user that's OK—you can specify the path by hand on the following page. If it's not installed, you can install it yourself. Jpegtran is a free tool distributed by the Independent JPEG Group as part of <i>libjpeg</i>. Source may be found at the %sIJG homepage%s. Binaries may be found at the %sJPEG Club website%s or in the <i>libjpeg</i> package of Linux distributions."),
'<a href="http://www.ijg.org" target="_blank">', '</a>',
- '<a href="http://jpegclub.org/" target="_blank">', '</a>'),
+ '<a href="http://jpegclub.org/" target="_blank">', '</a>')),
'open-basedir-note' => $common_messages['open-basedir-active']
),
'gettext' => array (
@@ -244,14 +253,14 @@
$checkPriority = array(
'mandatory' => array(
- 'checks' => array('gallery_version', 'php', 'safe_mode', 'exec',
- 'NetPBM', 'ImageMagick', 'check-versions'),
+ 'checkslist' => array('gallery_version', 'php', 'safe_mode', 'exec',
+ 'NetPBM', 'ImageMagick', 'check-versions'),
'shortdesc' => gTranslate('config',"Mandatory checks"),
'longdesc' => gTranslate('config' ,"If any of these items are highlighted in red then please take actions to correct them. Failure to do so could lead to your Gallery installation not functioning correctly.")
),
'recommend' => array(
- 'checks' => array('register_globals', 'htaccess', 'magic-quotes', 'mod-rewrite', 'exif',
- 'jpegtran', 'gettext', 'gallery-locale', 'missing-locales'),
+ 'checkslist' => array('register_globals', 'htaccess', 'magic-quotes', 'mod-rewrite', 'exif',
+ 'jpegtran', 'gettext', 'gallery-locale', 'missing-locales'),
'shortdesc' => gTranslate('config',"Recommended things"),
'longdesc' => gTranslate('config' ,"Nice to have.")
)
Modified: trunk/gallery/js/toggle.js
===================================================================
--- trunk/gallery/js/toggle.js 2006-10-28 15:10:22 UTC (rev 14992)
+++ trunk/gallery/js/toggle.js 2006-10-28 15:42:59 UTC (rev 14993)
@@ -7,9 +7,9 @@
var img;
var elem;
- img = document.getElementById('toogleBut_' + id);
- elem = document.getElementById('toogleFrame_' + id);
-
+ img = document.getElementById('toggleBut_' + id);
+ elem = document.getElementById('toggleFrame_' + id);
+
if (elem.style.display == 'none') {
elem.style.display = 'inline';
img.src = '../images/collapse.gif';
Modified: trunk/gallery/lib/content.php
===================================================================
--- trunk/gallery/lib/content.php 2006-10-28 15:10:22 UTC (rev 14992)
+++ trunk/gallery/lib/content.php 2006-10-28 15:42:59 UTC (rev 14993)
@@ -1488,32 +1488,33 @@
* @return string The HTML code.
* @author Jens Tkotz <jens@...>
*/
-function toogleButton($id) {
+function toggleButton($id) {
$html = "<a href=\"#\" style=\"outline: none;\" onClick=\"gallery_toggle('$id'); return false;\">" .
- gImage('expand.gif', gTranslate('config', "Show/hide more information"), array('id' => "toogleBut_$id")) .
+ gImage('expand.gif', gTranslate('config', "Show/hide more information"), array('id' => "toggleBut_$id")) .
'</a> ';
return $html;
}
+
/**
* Creates a toggle Box. Optionally a toggle Button is added before, or after.
*
* @param string $id
* @param string $text
- * @param string $toogleButton Can be 'append', 'prepend', if something else, no toggle Button shows up.
+ * @param string $toggleButton Can be 'append', 'prepend', if something else, no toggle Button shows up.
* @return string The HTML code.
* @author Jens Tkotz <jens@...>
*/
-function toogleBox($id, $text, $toogleButton = 'prepend') {
- $html = "\n<div id=\"toogleFrame_$id\" style=\"display:none;\">$text\n</div>";
+function toggleBox($id, $text, $toggleButton = 'prepend') {
+ $html = "\n<div id=\"toggleFrame_$id\" style=\"display:none;\">$text\n</div>";
- if ($toogleButton == 'prepend') {
- $html = toogleButton($id) . $html;
+ if ($toggleButton == 'prepend') {
+ $html = toggleButton($id) . $html;
}
- if ($toogleButton == 'append') {
- $html .= toogleButton($id);
+ if ($toggleButton == 'append') {
+ $html .= toggleButton($id);
}
$html = '<br>' . $html;
Modified: trunk/gallery/lib/setup.php
===================================================================
--- trunk/gallery/lib/setup.php 2006-10-28 15:10:22 UTC (rev 14992)
+++ trunk/gallery/lib/setup.php 2006-10-28 15:42:59 UTC (rev 14993)
@@ -301,8 +301,19 @@
return $buf;
}
+/**
+ * Returns an array containing all pathes set in the environment var 'PATH'
+ * plus some additional guesses.
+ *
+ * @return array $path
+ */
function getPath() {
+ static $path;
+ if(!empty($path)) {
+ return $path;
+ }
+
/* Start with the server user's path */
if (getOS() != OS_WINDOWS) {
$path = explode(":", getenv('PATH'));
@@ -413,7 +424,7 @@
if (!empty($disabled)) {
foreach(explode(',', $disabled) as $disabled_func) {
if(eregi('^exec$', $disabled_func)) {
- $fail["fail-exec"] = 1;
+ $fail['fail-exec'] = 1;
}
}
}
@@ -449,25 +460,25 @@
}
function check_php() {
- global $MIN_PHP_MAJOR_VERSION;
+ global $MIN_PHP_MAJOR_VERSION;
- $version = phpversion();
- $success = array();
- $fail = array();
- $warn = array();
+ $version = phpversion();
+ $success = array();
+ $fail = array();
+ $warn = array();
- if (!function_exists('version_compare') || !version_compare($version, $MIN_PHP_MAJOR_VERSION, ">=")) {
- $fail['fail-too-old'] = 1;
- }
+ if (!function_exists('version_compare') ||
+ !version_compare($version, $MIN_PHP_MAJOR_VERSION, ">=")) {
+ $fail['fail-too-old'] = 1;
+ }
+ elseif (strstr(__FILE__, 'lib/setup.php') || strstr(__FILE__, 'lib\\setup.php')) {
+ $success[] = sprintf(gTranslate('config', "PHP v%s is OK."), $version);
+ }
+ else {
+ $fail['fail-buggy__FILE__'] = 1;
+ }
- if (strstr(__FILE__, 'lib/setup.php') ||
- strstr(__FILE__, 'lib\\setup.php')) {
- $success[] = sprintf(gTranslate('config', "PHP v%s is OK."), $version);
- } else {
- $fail['fail-buggy__FILE__'] = 1;
- }
-
- return array($success, $fail, $warn);
+ return array($success, $fail, $warn);
}
function check_mod_rewrite() {
@@ -478,15 +489,15 @@
$warn = array();
if(fs_file_exists(GALLERY_SETUPDIR .'/.htaccess')) {
- if ($GALLERY_REWRITE_OK) {
- $success[] = gTranslate('config', "<b>mod_rewrite</b> is enabled.");
- }
- else {
- $fail["fail-mod-rewrite"] = true;
- }
+ if ($GALLERY_REWRITE_OK) {
+ $success[] = gTranslate('config', "<b>mod_rewrite</b> is enabled.");
+ }
+ else {
+ $fail["fail-mod-rewrite"] = 1;
+ }
}
else {
- $fail["fail-mod-rewrite-nohtaccess"] = true;
+ $fail["fail-mod-rewrite-nohtaccess"] = 1;
}
return array($success, $fail, $warn);
@@ -528,28 +539,28 @@
$missing_critical = array();
$missing = 0;
$netpbm = array(
- fs_executable("jpegtopnm"),
- fs_executable("giftopnm"),
- fs_executable("pngtopnm"),
- fs_executable("pnmtojpeg"),
- fs_executable("ppmtogif"),
- fs_executable("pnmtopng"),
- fs_executable("pnmscale"),
- fs_executable("pnmfile"),
- fs_executable("ppmquant"),
- fs_executable("pnmcut"),
- fs_executable("pnmrotate"),
- fs_executable("pnmflip"),
- fs_executable("pnmcomp"),
+ fs_executable('jpegtopnm'),
+ fs_executable('giftopnm'),
+ fs_executable('pngtopnm'),
+ fs_executable('pnmtojpeg'),
+ fs_executable('ppmtogif'),
+ fs_executable('pnmtopng'),
+ fs_executable('pnmscale'),
+ fs_executable('pnmfile'),
+ fs_executable('ppmquant'),
+ fs_executable('pnmcut'),
+ fs_executable('pnmrotate'),
+ fs_executable('pnmflip'),
+ fs_executable('pnmcomp'),
);
$fallback = array(
- fs_executable("pnmtojpeg") => fs_executable("ppmtojpeg"),
- fs_executable("pnmcomp") => fs_executable("pamcomp")
+ fs_executable('pnmtojpeg') => fs_executable('ppmtojpeg'),
+ fs_executable('pnmcomp') => fs_executable('pamcomp')
);
$optional = array(
- fs_executable("pnmcomp") =>
+ fs_executable('pnmcomp') =>
gTranslate('config', "Without pnmcomp and pamcomp gallery will not be able to watermark images, unless you use ImageMagick and have the composite binary installed."),
);
@@ -609,18 +620,19 @@
}
if ($missing == count($netpbm)) {
- $fail["fail-netpbm"] = 1;
+ $fail['fail-netpbm'] = 1;
/* Any other warning doesnt care */
$warn = array();
}
elseif ($missing > 0) {
- $warn[] = sprintf(gTranslate('config', "%d of %d NetPBM binaries located."),
+ $warn[] = "\n<br>" . sprintf(gTranslate('config', "%d of %d NetPBM binaries located."),
count($netpbm) - $missing, count($netpbm));
- if(count($missing_critical) > 0) {
- $fail["fail-netpbm-partial"] = array_values($missing_critical);
+ if(count($missing_critical) > 0 || 1 != 2) {
+ $fail['fail-netpbm-partial'] = array_values($missing_critical);
}
- } else {
+ }
+ else {
$success[] = sprintf(gTranslate('config', "%d of %d NetPBM binaries located."),
count($netpbm), count($netpbm));
}
@@ -638,13 +650,14 @@
$missing_critical = array();
$missing = 0;
$imagick = array(
- fs_executable("identify"),
- fs_executable("convert"),
- fs_executable("composite"),
+ fs_executable('identify'),
+ fs_executable('convert'),
+ fs_executable('disco1'),
+ fs_executable('composite'),
);
$optional = array(
- fs_executable("composite") =>
+ fs_executable('composite') =>
gTranslate('config', "Without composite gallery will not be able to watermark images, except you use NetPBM and have the pnmcomp binary installed."),
);
@@ -687,16 +700,16 @@
}
if ($missing == count($imagick)) {
- $fail["fail-imagemagick"] = 1;
+ $fail['fail-imagemagick'] = 1;
/* Any other warning doesnt care */
$warn = array();
}
elseif ($missing > 0) {
- $warn[] = sprintf(gTranslate('config', "%d of %d ImageMagick binaries located."),
+ $warn[] = '<br>'. sprintf(gTranslate('config', "%d of %d ImageMagick binaries located."),
count($imagick) - $missing, count($imagick));
if(count($missing_critical) > 0) {
- $fail["fail-imagemagick-partial"] = array_values($missing_critical);
+ $fail['fail-imagemagick-partial'] = array_values($missing_critical);
}
} else {
$success[] = sprintf(gTranslate('config', "%d of %d ImageMagick binaries located."),
@@ -713,12 +726,12 @@
$success = array();
$warn = array();
- $bin = fs_executable("jpegtran");
+ $bin = fs_executable('jpegtran');
if ($location) {
$dir = locateDir($bin, $location);
} else {
- $dir = locateDir($bin, isset($gallery->app->use_jpegtran) ? dirname($gallery->app->use_jpegtran) : "");
+ $dir = locateDir($bin, isset($gallery->app->use_jpegtran) ? dirname($gallery->app->use_jpegtran) : '');
}
if (!$dir) {
$warn["fail-jpegtran"] = gTranslate('config', "Can't find <i>jpegtran</i>!");
@@ -765,10 +778,14 @@
function check_gallery_version() {
global $gallery;
+
$fail = array();
$success = array();
$warn = array();
+ $maxAge = 180;
+ $maxBetaAge = 14;
+
/* how many days old is the gallery version? */
$age = (time() - $gallery->last_change)/86400;
@@ -777,7 +794,7 @@
$link = galleryLink($gallery->url, $gallery->url, array('target' => '_blank'));
- $visit = '<br>'. sprintf(gTranslate('config', "You can check for more recent versions by visiting %s."), $link);
+ $visit = sprintf(gTranslate('config', "You can check for more recent versions by visiting %s."), $link);
$this_version = sprintf(gTranslate('config', "This version of %s was released on %s."),
Gallery(), strftime("%x", $gallery->last_change));
@@ -785,16 +802,29 @@
$this_beta_version = sprintf(gTranslate('config', "This is a development build of %s that was released on %s."),
Gallery(), strftime("%x", $gallery->last_change));
- if ($age > 180) {
- $fail["too_old"] = "$this_version $visit";
- } else if ($age > 14 && $beta) {
- $fail["too_old"] = "$this_beta_version $visit";
- } else if ($beta) {
- $success["ok"] = "$this_beta_version $visit" . " "
- . gTranslate('config', "Please check regularly for updates.");
- } else {
- $success["ok"] = "$this_version $visit";
+ if ($age > $maxAge) {
+ if($beta) {
+ $fail['too_old'] = $this_beta_version . ' ' .
+ sprintf(gTranslate('config', "Thats more than %d days ago. Which is way too old for a pre Release version."), $maxAge) .
+ toggleBox('g_version', $visit);
+ }
+ else {
+ $fail['too_old'] = $this_version . ' ' .
+ sprintf(gTranslate('config', "Thats more than %d days ago."), $maxAge) .
+ toggleBox('g_version', $visit);
+ }
}
+ else if ($beta && $age > $maxBetaAge) {
+ $fail['too_old'] = $this_beta_version . toggleBox('g_version', $visit);
+ }
+ else if ($beta) {
+ $visit .= ' '. gTranslate('config', "Please check regularly for updates.");
+ $success['ok'] = $this_beta_version . toggleBox('g_version', $visit);
+ }
+ else {
+ $success['ok'] = $this_version . toggleBox('g_version', $visit);
+ }
+
return array($success, $fail, $warn);
}
@@ -806,42 +836,42 @@
$warn = array();
$msg = '';
- $available = $locale_check["available_locales"];
- $maybe = $locale_check["maybe_locales"];
- $unavailable = $locale_check["unavailable_locales"];
+ $available = $locale_check['available_locales'];
+ $maybe = $locale_check['maybe_locales'];
+ $unavailable = $locale_check['unavailable_locales'];
if($locale_check != NULL && sizeof($unavailable) == 0) {
- $success[] = gTranslate('config', "All gallery locales are available on this host.");
+ $success[] = gTranslate('config', "All gallery locales are available on this host.");
}
else if( (sizeof($maybe) + sizeof($unavailable)) > 0) {
- if (sizeof($maybe) > 0) {
- $msg = sprintf(gTranslate('config', "There are %d locales that Gallery was unable to locate. You may need to select manually date formats. "),sizeof($maybe));
- }
+ if (sizeof($maybe) > 0) {
+ $msg = sprintf(gTranslate('config', "There are %d locales that Gallery was unable to locate. You may need to select manually date formats. "),sizeof($maybe));
+ }
- if (sizeof($unavailable) > 0) {
- if(sizeof($maybe) > 0) {
- $msg .= "<br><br>";
- }
+ if (sizeof($unavailable) > 0) {
+ if(sizeof($maybe) > 0) {
+ $msg .= '<br><br>';
+ }
- $msg .= sprintf(gTranslate('config', "Dates in %d languages may not be formatted properly, because the corresponding locales are missing. You may need to select manually the date formats for these."),sizeof($unavailable));
- }
- $warn[] = $msg;
+ $msg .= sprintf(gTranslate('config', "Dates in %d languages may not be formatted properly, because the corresponding locales are missing. You may need to select manually the date formats for these."),sizeof($unavailable));
+ }
+ $warn[] = $msg;
}
else {
- if (ini_get('open_basedir') && getOS() != OS_LINUX) {
- $warn[] = sprintf(gTranslate('config', "We were unable to detect any locales. However, your PHP installation is configured with the %s restriction so this may be interfering with the way that we detect locales. Unfortunately this means the date format will not change for different languages. However, it is OK to continue."),
- '<b><a href="http://www.php.net/manual/en/features.safe-mode.php#ini.open-basedir" target="_blank">open_basedir</a></b>');
- }
- else {
- if (getOS() == OS_LINUX) {
- $fail[] = sprintf(gTranslate('config', "We were unable to detect any system locales. Multi-language functions will be disabled. Please install the corresponding locales or ask your administrator to do this. This problem is known on %s systems. In this case please have a look at this %sDebian locale HowTo%s."),
- 'Debian',
- '<a href="http://people.debian.org/~schultmc/locales.html" target="_blank">', '</a>');
- }
- else {
- $warn[] = gTranslate('config', "Only the default locale for this machine is available, so date format will not change for different languages.");
- }
- }
+ if (ini_get('open_basedir') && getOS() != OS_LINUX) {
+ $warn[] = sprintf(gTranslate('config', "We were unable to detect any locales. However, your PHP installation is configured with the %s restriction so this may be interfering with the way that we detect locales. Unfortunately this means the date format will not change for different languages. However, it is OK to continue."),
+ '<b><a href="http://www.php.net/manual/en/features.safe-mode.php#ini.open-basedir" target="_blank">open_basedir</a></b>');
+ }
+ else {
+ if (getOS() == OS_LINUX) {
+ $fail[] = sprintf(gTranslate('config', "We were unable to detect any system locales. Multi-language functions will be disabled. Please install the corresponding locales or ask your administrator to do this. This problem is known on %s systems. In this case please have a look at this %sDebian locale HowTo%s."),
+ 'Debian',
+ '<a href="http://people.debian.org/~schultmc/locales.html" target="_blank">', '</a>');
+ }
+ else {
+ $warn[] = gTranslate('config', "Only the default locale for this machine is available, so date format will not change for different languages.");
+ }
+ }
}
return array($success, $fail, $warn);
@@ -861,7 +891,7 @@
# Unix / Linux
# Check which locales are installed
- exec("locale -a", $results, $status);
+ exec('locale -a', $results, $status);
if(count($results) >2) {
$system_locales = $results;
@@ -979,66 +1009,66 @@
$nr = 0;
foreach ($maybe as $key => $aliases) {
- if (sizeof($aliases) == 0) {
- $unavailable[] = $key;
- continue;
- }
+ if (sizeof($aliases) == 0) {
+ $unavailable[] = $key;
+ continue;
+ }
- /*
- if (sizeof($aliases) == 1) {
- $results["locale_alias['$key']"] = array (
- "type" => "hidden",
- "value" => array_pop($aliases),
- "desc" => "locale_alias[$key]",
- "prompt" => "locale_alias[$key]"
- );
- continue;
- }
- */
+ /*
+ if (sizeof($aliases) == 1) {
+ $results["locale_alias['$key']"] = array (
+ "type" => "hidden",
+ "value" => array_pop($aliases),
+ "desc" => "locale_alias[$key]",
+ "prompt" => "locale_alias[$key]"
+ );
+ continue;
+ }
+ */
- $nr++;
- if (!$block_start_done) {
- $block_start_done = true;
- $results[] = array (
- 'type' => 'block_start',
- 'prompt' => '<b>(' . gTranslate('config', "Advanced") . ') </b><br>' .
- sprintf(gTranslate('config', "<b>System</b> locale selection required")),
- 'desc' => gTranslate('config', "There is more than one suitable <b>system</b> locale installed on your machine for the following languages. Please chose the one you think is most suitable.") .
- '<br><br>' .
- gTranslate('config', "This is <b>only</b> for date & time format. You only need to edit the languages you enabled above.")
- );
- }
+ $nr++;
+ if (!$block_start_done) {
+ $block_start_done = true;
+ $results[] = array (
+ 'type' => 'block_start',
+ 'prompt' => '<b>(' . gTranslate('config', "Advanced") . ') </b><br>' .
+ sprintf(gTranslate('config', "<b>System</b> locale selection required")),
+ 'desc' => gTranslate('config', "There is more than one suitable <b>system</b> locale installed on your machine for the following languages. Please chose the one you think is most suitable.") .
+ '<br><br>' .
+ gTranslate('config', "This is <b>only</b> for date & time format. You only need to edit the languages you enabled above.")
+ );
+ }
- $index = $nls['language'][$key];
+ $index = $nls['language'][$key];
- $choices = array();
+ $choices = array();
- foreach ($aliases as $value) {
- $choices[$value] = $value;
- }
+ foreach ($aliases as $value) {
+ $choices[$value] = $value;
+ }
- if (getOS() != OS_WINDOWS) {
- $choices[''] = gTranslate('config', "System locale");
- next($choices);
- }
+ if (getOS() != OS_WINDOWS) {
+ $choices[''] = gTranslate('config', "System locale");
+ next($choices);
+ }
- $results["locale_alias['$key']"] = array (
- 'prompt' => $nr . '.) ' . $nls['language'][$key],
- 'optional' => true,
- 'name' => 'locale_alias',
- 'key' => $key,
- 'type' => 'block_element',
- 'choices' => $choices,
- 'value' => (getOS() != OS_WINDOWS) ? key($choices) : '',
- 'allow_empty' => true,
- 'remove_empty' => true
- );
+ $results["locale_alias['$key']"] = array (
+ 'prompt' => $nr . '.) ' . $nls['language'][$key],
+ 'optional' => true,
+ 'name' => 'locale_alias',
+ 'key' => $key,
+ 'type' => 'block_element',
+ 'choices' => $choices,
+ 'value' => (getOS() != OS_WINDOWS) ? key($choices) : '',
+ 'allow_empty' => true,
+ 'remove_empty' => true
+ );
} // End foreach maybe
if ($block_start_done) {
- $results[] = array ('type' => 'block_end');
+ $results[] = array ('type' => 'block_end');
}
$block_start_done = false;
@@ -1046,78 +1076,78 @@
$choices = array();
if (getOS() != OS_WINDOWS) {
- $choices = array('' => gTranslate('config', "System locale"));
+ $choices = array('' => gTranslate('config', "System locale"));
}
if (sizeof($available) > 0) {
- foreach ($available as $choice => $value) {
- $choices[$choice] = $nls['language'][$value];
- }
+ foreach ($available as $choice => $value) {
+ $choices[$choice] = $nls['language'][$value];
+ }
- $avail_keys = array_keys($available);
+ $avail_keys = array_keys($available);
}
elseif (sizeof($maybe) > 0) {
- foreach ($maybe as $key => $aliases) {
- foreach ($aliases as $choice) {
- $choices[$choice] = $choice;
- }
- }
+ foreach ($maybe as $key => $aliases) {
+ foreach ($aliases as $choice) {
+ $choices[$choice] = $choice;
+ }
+ }
- $avail_keys = array_keys($choices);
+ $avail_keys = array_keys($choices);
}
else {
- if (getOS() == OS_OTHER) {
- $array_keys = $choices;
- }
- else {
- $skip = true;
- }
+ if (getOS() == OS_OTHER) {
+ $array_keys = $choices;
+ }
+ else {
+ $skip = true;
+ }
}
if (! isset ($skip)) {
- $avail_keys = array_keys($choices);
- foreach ($unavailable as $key) {
- if (sizeof($choices) == 1) {
- $results["locale_alias['$key']"] = array (
- 'type' => 'hidden',
- 'value' => $avail_keys[0],
- 'desc' => "locale_alias[$key]",
- 'prompt' => "locale_alias[$key]",
- 'allow_empty' => true,
- 'remove_empty' => true
- );
- continue;
- }
+ $avail_keys = array_keys($choices);
+ foreach ($unavailable as $key) {
+ if (sizeof($choices) == 1) {
+ $results["locale_alias['$key']"] = array (
+ 'type' => 'hidden',
+ 'value' => $avail_keys[0],
+ 'desc' => "locale_alias[$key]",
+ 'prompt' => "locale_alias[$key]",
+ 'allow_empty' => true,
+ 'remove_empty' => true
+ );
+ continue;
+ }
- if (!$block_start_done) {
- $block_start_done = true;
- $results[] = array (
- 'type' => 'block_start',
- 'prompt' => '<b>(' . gTranslate('config', "Advanced") . ')</b><br>' .
- sprintf(gTranslate('config', "<b>System</b> locale problems")),
- 'desc' => gTranslate('config', "There are no apparently suitable <b>system</b> locales installed on your machine for the following languages. Please choose the one you think is most suitable.") .
- '<br><br>' .
- gTranslate('config', "This is <b>only</b> for date & time format. You only need to edit the languages you enabled above.")
- );
- }
+ if (!$block_start_done) {
+ $block_start_done = true;
+ $results[] = array (
+ 'type' => 'block_start',
+ 'prompt' => '<b>(' . gTranslate('config', "Advanced") . ')</b><br>' .
+ sprintf(gTranslate('config', "<b>System</b> locale problems")),
+ 'desc' => gTranslate('config', "There are no apparently suitable <b>system</b> locales installed on your machine for the following languages. Please choose the one you think is most suitable.") .
+ '<br><br>' .
+ gTranslate('config', "This is <b>only</b> for date & time format. You only need to edit the languages you enabled above.")
+ );
+ }
- $index = $nls['language'][$key] ;
+ $index = $nls['language'][$key] ;
- $results["locale_alias['$key']"] = array (
- 'prompt' => $nls['language'][$key],
- 'name' => 'locale_alias',
- 'key' => $key,
- 'type' => 'block_element',
- 'choices' => $choices,
- 'value' => '',
- 'allow_empty' => true,
- 'remove_empty' => true
- );
- }
+ $results["locale_alias['$key']"] = array (
+ 'prompt' => $nls['language'][$key],
+ 'name' => 'locale_alias',
+ 'key' => $key,
+ 'type' => 'block_element',
+ 'choices' => $choices,
+ 'value' => '',
+ 'allow_empty' => true,
+ 'remove_empty' => true
+ );
+ }
- if ($block_start_done) {
- $results[] = array ('type' => 'block_end');
- }
+ if ($block_start_done) {
+ $results[] = array ('type' => 'block_end');
+ }
}
return $results;
@@ -1134,20 +1164,23 @@
}
function check_safe_mode() {
- $fail = array();
- $success = array();
- $warn = array();
+ $fail = array();
+ $success = array();
+ $warn = array();
- $safe_mode = ini_get("safe_mode");
- if (empty($safe_mode) ||
- !strcasecmp($safe_mode, "off") ||
- !strcasecmp($safe_mode, "0") ||
- !strcasecmp($safe_mode, "false")) {
- $success[] = gTranslate('config', "<b>safe_mode</b> is off.");
- } else {
- $fail["fail-safe-mode"] = 1;
- }
- return array($success, $fail,$warn);
+ $safe_mode = ini_get("safe_mode");
+
+ if (empty($safe_mode) ||
+ !strcasecmp($safe_mode, "off") ||
+ !strcasecmp($safe_mode, "0") ||
+ !strcasecmp($safe_mode, "false")) {
+ $success[] = gTranslate('config', "<b>safe_mode</b> is off.");
+ }
+ else {
+ $fail["fail-safe-mode"] = 1;
+ }
+
+ return array($success, $fail,$warn);
}
function check_magic_quotes() {
@@ -1592,7 +1625,7 @@
$versionStatus['unkown']
);
- $hint = "<p>" . gTranslate('config', "This should be fixed before proceeding") .
+ $hint = "<p>" . gTranslate('config', "This should be fixed before proceeding.") .
"<br>" . sprintf(gTranslate('config', "Look at %sCheck Versions%s for more details."),
'<a href="check_versions.php">', '</a>') . '</p>';
@@ -1827,14 +1860,19 @@
require_once(GALLERY_BASE . '/classes/UserDB.php');
require_once(GALLERY_BASE . '/classes/gallery/UserDB.php');
require_once(GALLERY_BASE . '/classes/gallery/User.php');
+
$gallery->userDB = new Gallery_UserDB();
- // Check the UserDB for upgrades before trying to make someone login
- if ($gallery->userDB->versionOutOfDate()) {
- include(GALLERY_BASE . "/upgrade_users.php");
- exit;
+ if (! $gallery->userDB->isInitialized()) {
+ exit;
}
+ // Check the UserDB for upgrades before trying to make someone login
+ if ($gallery->userDB->versionOutOfDate()) {
+ include(GALLERY_BASE . "/upgrade_users.php");
+ exit;
+ }
+
include(GALLERY_BASE . '/setup/login.inc');
}
}
@@ -1861,14 +1899,22 @@
}
/**
+ * Returns a status code base on the given resultset
+ *
* 0 - success
* 5 - warning, optional
* 10 - serious warning, but optional
* 51 - serious warning
* 100 - failure
+ *
+ * @param array $result The resultcheck
+ * @param array $check
+ * @return integer
+ * @author Jens Tkotz <jens@...>
*/
function getCheckStatus($result, $check) {
list($success, $fail, $warn) = $result;
+
if(!empty($success)) {
return 0;
}
@@ -1881,13 +1927,16 @@
else {
return 10;
}
- } else {
+ }
+ else {
return 5;
}
- } else {
+ }
+ else {
if (isset($check["serious"]) && $check["serious"] == 1) {
return 51;
- } else {
+ }
+ else {
return 100;
}
}
Modified: trunk/gallery/setup/check.inc
===================================================================
--- trunk/gallery/setup/check.inc 2006-10-28 15:10:22 UTC (rev 14992)
+++ trunk/gallery/setup/check.inc 2006-10-28 15:42:59 UTC (rev 14993)
@@ -47,13 +47,13 @@
'image' => gImage('red_trafficlight.gif', gTranslate('config', "Serious warning, no go !")),
'text' => gTranslate('config', "Serious warning, no go !"),
'border' => 'border: 4px solid #ec000a',
- 'type' => 'nogo'
+ 'type' => 'error'
),
100 => array(
'image' => gImage('red_trafficlight.gif', gTranslate('config', "Failure")),
'text' => gTranslate('config', "Failure"),
'border' => 'border: 4px solid #ec000a',
- 'type' => 'nogo'
+ 'type' => 'error'
)
);
@@ -113,58 +113,59 @@
}
?>
</div>
- <?php foreach ($checkPriority as $key => $content) {
- echo "\n\t<h1>". $content['shortdesc'] . '</h1>';
+ <?php
- echo "\n\t" . $content['longdesc'];
-?>
+ foreach ($checkPriority as $key => $checklistGroup) {
+ echo "\n\t<h1>". $checklistGroup['shortdesc'] . '</h1>';
- <div class="g-config-main">
- <table cellspacing="0" align="center">
-<?php
- foreach ($content['checks'] as $short) {
+ echo "\n\t" . $checklistGroup['longdesc'];
+
+ $table = new galleryTable();
+ $table->setColumnCount(4);
+ $table->setAttrs(array(
+ 'cellspacing' => 0,
+ 'id' => "setupchecks_$key",
+ 'class' => 'g-setupchecks'));
+
+ /* $checklist contains actually the complete list of checks */
+ foreach ($checklistGroup['checkslist'] as $short) {
$check = $checklist[$short];
if( isset($check["enabled"]) && $check["enabled"] == "no") continue;
- $func = $check["func"];
+ $func = $check['func'];
$result = $func();
list($success, $fail, $warn) = $result;
$status = getCheckStatus($result, $check);
$usedStatus[$status] = $status;
- // new Line //
- echo "\n<tr style=\"margin-top: 2px\">";
- // shortdesc
- echo "\n\t<td class=\"g-desc-cell\" width=\"35%\" style=\"font-weight: bold; vertical-align: top; border-bottom: 2px solid #ececec;\">". $check['prompt'];
- echo "\n\t\t". '<br><div style="font-weight: normal; display:none;" id="toogleFrame_'. $short .'">'. $check["desc"] .'</div>';
- echo "\n</td>";
+ // shortdesc
+ $table->addElement(array(
+ 'content' => $check['prompt'] . '<br>' . toggleBox($short, $check["desc"], 'none'),
+ 'cellArgs' => array('class' => 'g-desc-cell g-setup-check-desc')));
- // toogle button
- echo "\n\t<td class=\"g-desc-cell\" style=\"vertical-align: top; border-right: 2px solid #ececec; border-bottom: 2px solid #ececec;\">" .
- "\n\t\t<a href=\"#\" onClick=\"gallery_toggle('$short'); return false;\">" .
- gImage('expand.gif', gTranslate('config', "Show/hide more information"), array('id' => "toogleBut_$short")) .
- '</a>';
- echo "\n\t</td>";
+ // toggle button for the long description
+ $table->addElement(array(
+ 'content' => toggleButton($short),
+ 'cellArgs' => array('class' => 'g-desc-cell g-setup-check-toggle')));
// traffic light
- echo "\n\t<td class=\"g-desc-cell\" style=\"border-right: 2px solid #ececec; border-bottom: 2px solid #ececec;\">";
- echo $configTestStatus[$status]['image'];
- echo "\n\t</td>";
+ $table->addElement(array(
+ 'content' => $configTestStatus[$status]['image'],
+ 'cellArgs' => array('class' => 'g-desc-cell g-setup-check-trafficlight')));
// result
- echo "\n\t<td class=\"g-desc-cell\" style=\"vertical-align: top;border-bottom: 2px solid #ececec;\">";
+ $message = '';
- $message = '';
- foreach ($success as $key) {
- if ($key != '') {
- $message .= $key;
+ foreach ($success as $successMsg) {
+ if ($successMsg != '') {
+ $message .= $successMsg;
}
}
foreach ($fail as $key => $val) {
- if (isset($check['optional']) && $check['optional'] == 1) {
- if (isset($check["serious"]) && $check["serious"] == 1) {
+ if (isset($check['optional']) && $check['optional']) {
+ if (isset($check['serious']) && $check['serious']) {
$serious_warning = true;
}
if (isset($check) && isset($check[$key])) {
@@ -173,7 +174,7 @@
$warning++;
}
else {
- if (isset($check["serious"]) && $check["serious"] == 1) {
+ if (isset($check['serious']) && $check['serious']) {
$serious_warning = true;
}
@@ -183,8 +184,8 @@
$error++;
}
- if (isset($check["open-basedir-note"]) && !empty($openBasedir)) {
- $message .= '<p>'. $check["open-basedir-note"] . '</p>';
+ if (isset($check['open-basedir-note']) && !empty($openBasedir)) {
+ $message .= '<p>'. $check['open-basedir-note'] . '</p>';
}
if (is_array($val)) {
@@ -212,24 +213,26 @@
}
}
- echo infoBox(array(array(
- 'type' => $configTestStatus[$status]['type'],
- 'text' => $message)
- ), '', false
- );
- echo "</td>";
-
- echo "\n</tr>";
+ $table->addElement(array(
+ 'content' => infoBox(array(array(
+ 'type' => $configTestStatus[$status]['type'],
+ 'text' => $message)
+ ), '', false
+ ),
+ 'cellArgs' => array('class' => 'g-desc-cell')));
}
-?>
- </table>
- </div>
+ // Now show the checklist.
+ ?>
+ <div class="g-config-main">
+ <?php echo $table->render(); ?>
+ </div>
- <div class="clear"></div>
-<?php
+ <div class="clear"></div>
+ <?php
+
}
-?>
+ ?>
</div>
<div class="floatleft left" style="width: 30%">
@@ -237,12 +240,13 @@
<tr>
<td colspan="2" class="left"><?php echo gTranslate ('config', "Legend:"); ?></td>
</tr><?php
- foreach ($usedStatus as $status) {
- echo "\n <tr>";
- echo "\n <td>". $configTestStatus[$status]['image'] .'</td>';
- echo "\n <td style=\"padding: 2px; ". $configTestStatus[$status]['border'] .'">'. $configTestStatus[$status]['text'] .'</td>';
- echo "\n </tr>";
- }
+ sort($usedStatus);
+ foreach ($usedStatus as $status) {
+ echo "\n <tr>";
+ echo "\n <td>". $configTestStatus[$status]['image'] .'</td>';
+ echo "\n <td style=\"padding: 2px; ". $configTestStatus[$status]['border'] .'">'. $configTestStatus[$status]['text'] .'</td>';
+ echo "\n </tr>";
+ }
?>
</table>
</div>
@@ -282,11 +286,11 @@
?>
</div>
<?php
- echo gSubmit(
- 'go_next',
- gTranslate('config', "_Next Step >>"),
- array('disabled' => 'disabled')
- );
+echo gSubmit(
+ 'go_next',
+ gTranslate('config', "_Next Step >>"),
+ array('disabled' => 'disabled')
+);
}
?>
</div>
Modified: trunk/gallery/setup/check_versions.php
===================================================================
--- trunk/gallery/setup/check_versions.php 2006-10-28 15:10:22 UTC (rev 14992)
+++ trunk/gallery/setup/check_versions.php 2006-10-28 15:42:59 UTC (rev 14993)
@@ -92,9 +92,9 @@
foreach($tests as $testname => $args) {
if (!empty($versionStatus[$testname])) { ?>
<div class="g-notice left">
- <a href="#" style="float: left;" onClick="gallery_toggle('<?php echo $testname; ?>'); return false;"><?php echo gImage('expand.gif', _("Show/hide more information"), array('id' => "toogleBut_$testname")); ?></a>
+ <a href="#" style="float: left;" onClick="gallery_toggle('<?php echo $testname; ?>'); return false;"><?php echo gImage('expand.gif', _("Show/hide more information"), array('id' => "toggleBut_$testname")); ?></a>
<?php echo infobox(array(array('type' => $args['type'], 'text' => $args['text'])), '', false); ?>
- <div style="width:100%; display:none;" id="toogleFrame_<?php echo $testname; ?>">
+ <div style="width:100%; display:none;" id="toggleFrame_<?php echo $testname; ?>">
<table>
<tr>
<td class="g-sitedesc" colspan="2"><?php echo $args['hinttext']; ?></td>
Modified: trunk/gallery/setup/index.php
===================================================================
--- trunk/gallery/setup/index.php 2006-10-28 15:10:22 UTC (rev 14992)
+++ trunk/gallery/setup/index.php 2006-10-28 15:42:59 UTC (rev 14993)
@@ -44,35 +44,12 @@
<script language="JavaScript" type="text/javascript">
<!--
-
- function localGetElementsByTagName(tagName) {
- var eleArray;
- if (window.opera) eleArray = document.body.getElementsByTagName(tagName);
- else if (document.getElementsByTagName) eleArray = document.getElementsByTagName(tagName);
- else if (document.all) eleArray = document.all.tags(tagName);
- else if (document.layers) {
- eleArray = new Array();
- nnGetAllLayers(window, eleArray, 0);
- }
- return eleArray;
- }
-
- function nnGetAllLayers(parent, layerArray, nextIndex) {
- var i, layer;
- for (i = 0; i < parent.document.layers.length; i++) {
- layer = parent.document.layers[i];
- layerArray[nextIndex++] = layer;
- if (layer.document.layers.length) nextIndex = nnGetAllLayers(layer, layerArray, nextIndex);
- }
- return nextIndex;
- }
-
function enableButtons() {
- var buttons = localGetElementsByTagName("input");
+ var buttons = document.getElementsByTagName('input');
var i = 0;
while (buttons[i]) {
- if (buttons[i].type == "submit" || buttons[i].type == "button") {
+ if (buttons[i].type == 'submit' || buttons[i].type == 'button') {
buttons[i].disabled = false;
}
i++;
@@ -93,9 +70,11 @@
if (isset($go_defaults) || isset($refresh)) {
$setup_page = $this_page;
-} else if (isset($go_next)) {
+}
+else if (isset($go_next)) {
$setup_page = $next_page;
-} else if (isset($go_back)) {
+}
+else if (isset($go_back)) {
$setup_page = $back_page;
}
@@ -148,11 +127,12 @@
<?php
if (array_key_exists($setup_page, $steps)) {
- include(dirname(__FILE__) ."/$setup_page.inc");
-} else {
- print _("Security violation") .".\n";
- exit;
+ include(dirname(__FILE__) ."/$setup_page.inc");
}
+else {
+ print _("Security violation") .".\n";
+ exit;
+}
foreach ($preserve as $key => $val) {
if ($key && !isset($onThisPage[$key])) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|