[Linpha-cvs] SF.net SVN: linpha: [4458] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <bz...@us...> - 2006-03-31 08:08:04
|
Revision: 4458 Author: bzrudi Date: 2006-03-31 00:07:40 -0800 (Fri, 31 Mar 2006) ViewCVS: http://svn.sourceforge.net/linpha/?rev=4458&view=rev Log Message: ----------- at least mysql installation should work now (automatic mode only) - made i18n ready using tr() Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/install/header.php trunk/linpha2/install/header_html.php trunk/linpha2/install/index.php trunk/linpha2/install/lang/lang.English.php trunk/linpha2/install/lib.install.php trunk/linpha2/install/sql/sql.data.php trunk/linpha2/install/sql/sql.mysql.php trunk/linpha2/install/sql/sql.tables.php trunk/linpha2/install/step10_postsettings.php trunk/linpha2/install/step11_finish.php trunk/linpha2/install/step1_license.php trunk/linpha2/install/step2_requirements.php trunk/linpha2/install/step3_dbtype.php trunk/linpha2/install/step4_selectdirectories.php trunk/linpha2/install/step5_getlogin.php trunk/linpha2/install/step6_selectdatabase.php trunk/linpha2/install/step7_selectprefix.php trunk/linpha2/install/step8_testing.php trunk/linpha2/install/step9_createtables.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-03-30 18:56:38 UTC (rev 4457) +++ trunk/linpha2/ChangeLog 2006-03-31 08:07:40 UTC (rev 4458) @@ -1,3 +1,8 @@ +2006-03-31 bzrudi <linpha2_AT_tuxpower_DOT_de> + * Installer: + + at least mysql installation should work now (automatic mode only) + + made i18n ready using tr() + 2006-03-30 flo * fixing some errors in browse by date view (we got an endless loop if meta_exif is empty) Modified: trunk/linpha2/install/header.php =================================================================== --- trunk/linpha2/install/header.php 2006-03-30 18:56:38 UTC (rev 4457) +++ trunk/linpha2/install/header.php 2006-03-31 08:07:40 UTC (rev 4458) @@ -96,17 +96,17 @@ ); $title_str[0] = "Welcome"; -$title_str[1] = "Accept the GNU License"; -$title_str[2] = "Checking the requirements"; -$title_str[3] = "Select the database type"; -$title_str[4] = "Select directories"; -$title_str[5] = "Entering SQL login information"; -$title_str[6] = "Selecting database"; -$title_str[7] = "Select prefix"; -$title_str[8] = "Testing"; -$title_str[9] = "Creating tables"; -$title_str[10] = "Post settings"; -$title_str[11] = "Finish installation"; +$title_str[1] = "Accept GPL"; +$title_str[2] = "Requirements Check"; +$title_str[3] = "Database Type"; +$title_str[4] = "Directories"; +$title_str[5] = "Database Login"; +$title_str[6] = "Select Database"; +$title_str[7] = "Select Prefix"; +$title_str[8] = "System Checks"; +$title_str[9] = "Database Tables"; +$title_str[10] = "Post Settings"; +$title_str[11] = "Finalizing"; if(! isset($is_special)) { Modified: trunk/linpha2/install/header_html.php =================================================================== --- trunk/linpha2/install/header_html.php 2006-03-30 18:56:38 UTC (rev 4457) +++ trunk/linpha2/install/header_html.php 2006-03-31 08:07:40 UTC (rev 4458) @@ -27,7 +27,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html lang="de"> <head> -<title>LinPHA Web Installer - <?php echo $title_str[$key]; ?></title> +<title><?php echo tr("LinPHA Web Installer"); echo "-". $title_str[$key]; ?></title> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <link rel="stylesheet" type="text/css" href="layout.css"> @@ -55,13 +55,13 @@ switch($i) { case 0: - echo "Welcome"; + echo tr("Welcome"); break; case $end: - echo "Finish"; + echo tr("Finish"); break; default: - echo "Step ".$i; + echo tr("$title_str[$i]"); break; } echo "</div>"; @@ -82,7 +82,7 @@ </div> <div class="rightside"> -<h1><?php echo $title_str[$key]; ?></h1> +<h1><?php echo tr("$title_str[$key]"); ?></h1> <br /> <?php Modified: trunk/linpha2/install/index.php =================================================================== --- trunk/linpha2/install/index.php 2006-03-30 18:56:38 UTC (rev 4457) +++ trunk/linpha2/install/index.php 2006-03-31 08:07:40 UTC (rev 4458) @@ -41,13 +41,14 @@ include_once(LINPHA_DIR."/install/header.php"); include_once(LINPHA_DIR."/install/header_html.php"); -?> -Welcome to the new LinPHA installer<br /> -<br /><br /> +echo tr("Welcome To LinPHA2 Installation"); -Select your preferred language:<br /> -<select name="language" size="1"> -<?php +echo "<br /><br /><br />"; + +echo tr("Please Select Your Preferred Language:"); + +echo "<br /><select name='language' size='1'>"; + $options = get_available_language_files(); foreach($options AS $value) { Modified: trunk/linpha2/install/lang/lang.English.php =================================================================== --- trunk/linpha2/install/lang/lang.English.php 2006-03-30 18:56:38 UTC (rev 4457) +++ trunk/linpha2/install/lang/lang.English.php 2006-03-31 08:07:40 UTC (rev 4458) @@ -10,11 +10,7 @@ $basedir_active_msg2="If possible, please unset \"open_basedir\" in PHP.ini"; $gd_jpg_missing_msg="Your System lacks jpeg support in GD Library!"; $inst_abort_msg="!!! INSTALLATION ABORTED !!!"; -$str_not_enabled_in_php_config="Not enabled in PHP config (php.ini)"; $str_make_dir_writable="Make the directory %s world writeable!"; -$choose_def_quali="Choose default quality of photos"; -$choose_def_quali_warn="Do NOT set to high quality if your CPU is < 1Ghz (heavy CPU load)"; -$inst_thumbsize_header="Choose thumbnail size"; Modified: trunk/linpha2/install/lib.install.php =================================================================== --- trunk/linpha2/install/lib.install.php 2006-03-30 18:56:38 UTC (rev 4457) +++ trunk/linpha2/install/lib.install.php 2006-03-31 08:07:40 UTC (rev 4458) @@ -17,7 +17,58 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +/** + * Take care of translation + * + * This simple method takes care of all translation related stuff. + * If option tr_learn is set - all new entries will be autolearned. + * @param string $text phrase/word to translate + */ + function tr($text) + { + global $translate; + $tr_learn = false; //autolearn new language entries + + /** + * translation starts here + */ + if(true == isset($translate[$text])) + { + $str = "$translate[$text]"; + } + else + { + $str = "$text"; + } + /** + * autolearn new language entries defined by tr() function. + */ + if($tr_learn == true) + { + $tmpfile = LINPHA_DIR."/var/tmp/lang.install.temp.txt"; + + if(false == file_exists("$tmpfile")) + { + if(false == touch("$tmpfile")) + { + echo "Unable to create ".$tmpfile." - please check permissions"; + } + } + + $filedata = file("$tmpfile"); + + if(false == in_array($text."\n", $filedata)) + { + $filedata[] = $text."\n"; + natcasesort($filedata); // Sort an array using a case insensitive "natural order" algorithm + file_put_contents($tmpfile, $filedata); + } + } + + return $str; + +} // end tr() /** * don't know where to place this part * other.php is the only one which is also included during the installation @@ -198,9 +249,11 @@ ## language to use ##########################################################*/ - $http_accept_language = trim(@$_SERVER["HTTP_ACCEPT_LANGUAGE"]); + $http_accept_language = trim($_SERVER["HTTP_ACCEPT_LANGUAGE"]); // Accept-Language Header detail, see RFC2616 - $knownlangs = array( "dk" => "Danish", + $knownlangs = array( "" => "" ); + /* + "dk" => "Danish", "nl" => "Dutch", "en" => "English", "de" => "German", @@ -212,42 +265,49 @@ "co" => "Spanish", "fr" => "French", "no" => "Norwegian", - //"pt" => "BrazilianPortuguese", - //"br" => "BrazilianPortuguese", + "pt" => "BrazilianPortuguese", + "br" => "BrazilianPortuguese", "zh" => "zh-tw", "tw" => "zh-tw", "cz" => "Czech", "cs" => "Czech", "ro" => "Romanian", - //"cn" => "zh-cn", + "cn" => "zh-cn", "se" => "Swedish", "sv" => "Swedish", "ru" => "Russian" ); + */ +$accept_lang = 'English'; +$lastquality = 0.0; - $accept_lang = 'English'; - $lastquality = 0.0; +$langtag = '((?:[a-zA-Z]{1,8})(?:-[a-zA-Z]{1,8})*)'; +$qvalue ='(0(?:\.[0-9]{1,3})?|1(?:\.0{1,3}))'; +$eachbit = '^' . $langtag . '(?:;q=' . $qvalue . ')?(?:,\s*)?(.*)$'; - $langtag = '((?:[a-zA-Z]{1,8})(?:-[a-zA-Z]{1,8})*)'; - $qvalue ='(0(?:\.[0-9]{1,3})?|1(?:\.0{1,3}))'; - $eachbit = '^' . $langtag . '(?:;q=' . $qvalue . ')?(?:,\s*)?(.*)$'; +while(strlen($http_accept_language)) +{ + if(preg_match( "/$eachbit/", $http_accept_language, $m)) + { + $tag = $m[1]; + $quality = $m[2]; + + if(strlen($quality) == 0) $quality = 1; + $http_accept_language = $m[3]; - while (strlen($http_accept_language)) { - if (preg_match( "/$eachbit/", $http_accept_language, $m=array())) { - $tag = $m[1]; - $quality = $m[2]; - if (strlen($quality) == 0) $quality = 1; - $http_accept_language = $m[3]; + if(array_key_exists($tag, $knownlangs) && $quality > $lastquality) + { + $accept_lang = $knownlangs[$tag]; + $lastquality = $quality; + } + } + else + { + break; + } +} - if (array_key_exists($tag, $knownlangs) and $quality > $lastquality) { - $accept_lang = $knownlangs[$tag]; - $lastquality = $quality; - } - } else { - break; - } - } - return $accept_lang; +return $accept_lang; } /** Modified: trunk/linpha2/install/sql/sql.data.php =================================================================== --- trunk/linpha2/install/sql/sql.data.php 2006-03-30 18:56:38 UTC (rev 4457) +++ trunk/linpha2/install/sql/sql.data.php 2006-03-31 08:07:40 UTC (rev 4458) @@ -21,82 +21,27 @@ * linpha installer */ - - /** * config table */ $options = array( - 'db_version' => '1', - 'album_dir' => $_SESSION['album_dir'], - 'photo_width' => '512', - 'photo_height' => '384', - 'lang' => $_SESSION['language'], - 'autolang' => '1', - 'photos_row' => '3', - 'photos_col' => '4', - 'filenames' => '1', - 'autoconf' => '1', - 'counterstat' => '1', - 'exifinfo' => '1', - 'exif_level' => 'medium', - 'exif_default' => '0', - 'users' => '0', - 'ip_blocking' => '15', - 'gd_version' => $_SESSION['gd_version'], - 'use_convert' => $_SESSION['use_convert'], - 'convert_path' => $_SESSION['convert_path'], - 'sort_thumbs' => '0', - 'style' => 'aqua', - 'thumb_quality' => '0', - 'slideshow' => '1', - 'mini_img_preview' => 'default', - 'img_rotation' => '0', - 'img_quality' => '75', - 'photo_archive_title' => '', - 'thumb_size' => '120', - 'thumb_border' => '5', - 'thumb_border_color' => '#CCCCCC', - 'autologin' => '1', - 'timer' => '0', - 'gb_max_pages' => '8', - 'gb_anon_posts' => '1', - 'gb_posts_order' => 'DESC', - 'cache_path' => $_SESSION['cache_dir'], - 'cache_size' => '0', // 0 = unlimited, x = max cache size in bytes - 'alb_download_limit' => '0', - 'navigation_view' => '0', - 'mail_block_size' => '30', - 'mail_from_address' => 'noreply@'.$_SERVER["HTTP_HOST"].'', - 'show_comments_in_subfolder' => '1', - 'default_date_format' => "%a %m/%d/%Y", - 'default_time_format'=> "%I:%M:%S %p", - 'showNewImagesFolderDays' => '7', - 'showNewImagesFolder' => '1', - 'tmp_dir' => $_SESSION['tmp_dir'], - 'mail_mode_max_size' => (1024*1024*2), - 'adodb_caching' => '0', - 'adodb_cache_time' => '1440', - 'adodb_cache_path' => $_SESSION['tmp_dir'].'adocache', - 'random_index_image' => '0', - 'random_image_size' => '300', - 'log_email' => 'LinPHA Logger<log@'.$_SERVER["HTTP_HOST"].'>', - 'log_email_headers' => 'From:LinPHA Logger<noreply@'.$_SERVER["HTTP_HOST"].'>', - 'log_email_subject' => 'Linpha Log', - 'log_filename' => $_SESSION['tmp_dir'].'linpha.log', - 'log_method_db' => 'none', - 'log_method_filemanager' => 'none', - 'log_method_login' => 'none', - 'log_method_thumbnail' => 'none', - 'log_method_update' => 'none', - 'update_time' => time(), - 'update_notice' => '1', - 'iptcinfo' => '0', - 'iptc_level' => 'medium', - 'video_thumbnail' => '1', - 'blacklist_comments' => '1', - 'blacklist_guestbook' => '1', - 'im_bracket_support' => $_SESSION['im_bracket_support'] + 'sys_db_version' => '1', + 'sys_im_bracket_support' => $_SESSION['sys_im_bracket_support'], + 'sys_im_convert_path' => $_SESSION['sys_im_convert_path'], + 'sys_im_use_convert' => $_SESSION['sys_im_use_convert'], + 'sys_im_video_thumbnail' => '1', + 'sys_import_autoimport' => '1', + 'sys_image_exif' => '1', + 'sys_image_iptc' => '0', + 'sys_lang' => $_SESSION['language'], + 'sys_lang_autolang' => '1', + 'sys_path_album_dir' => $_SESSION['album_dir'], + 'sys_path_cache_dir' => $_SESSION['cache_dir'], + 'sys_path_tmp_dir' => $_SESSION['tmp_dir'], + 'sys_style_img_quality' => '75', + 'sys_style_template' => 'default', + 'sys_style_tn_size' => '150', + 'sys_user_autologin' => '1' ); /** @@ -104,55 +49,54 @@ */ while( list($name, $value) = each($options) ) { - $sql_queries[] = "INSERT INTO ".PREFIX."config (option_name, option_value) VALUES ('".$name."', '".$value."')"; + $sql_queries[] = "INSERT INTO ".PREFIX."config (option_name, option_value, userid) " . + "VALUES ('".$name."', '".$value."', '0')"; } /** * groups */ -$sql_queries[] = "INSERT INTO ".PREFIX."groups (id, groups) VALUES (1, 'admin')"; // id must be 1 ! -$sql_queries[] = "INSERT INTO ".PREFIX."groups (id, groups) VALUES (2, 'friend')"; -$sql_queries[] = "INSERT INTO ".PREFIX."groups (id, groups) VALUES (3, 'uploader')"; +$sql_queries[] = "INSERT INTO ".PREFIX."groups (name) VALUES ('group1')"; +$sql_queries[] = "INSERT INTO ".PREFIX."groups (name) VALUES ('group2')"; /** - * blacklist + * permissions */ -$sql_queries[] = "INSERT INTO ".PREFIX."blacklist (action, value) VALUES ('comment','jack, casino, poker, betting, gambling, sex, blackjack, winning')"; -$sql_queries[] = "INSERT INTO ".PREFIX."blacklist (action, value) VALUES ('guestbook','jack, casino, poker, betting, gambling, sex, blackjack, winning')"; +$sql_queries[] = "INSERT INTO ".PREFIX."permissions (photos_id, perm_type, permission) " . + "VALUES (0, 'read', ';public;')"; - /** - * plugins - */ -$sql_queries[] = "INSERT INTO ".PREFIX."plugins (name) VALUES ('sql')"; -$sql_queries[] = "INSERT INTO ".PREFIX."plugins (name) VALUES ('benchmark')"; -$sql_queries[] = "INSERT INTO ".PREFIX."plugins (name) VALUES ('watermark')"; -$sql_queries[] = "INSERT INTO ".PREFIX."plugins (name) VALUES ('guestbook')"; -$sql_queries[] = "INSERT INTO ".PREFIX."plugins (name) VALUES ('cache')"; -$sql_queries[] = "INSERT INTO ".PREFIX."plugins (name) VALUES ('mail')"; -//$sql_queries[] = "INSERT INTO ".PREFIX."plugins (name) VALUES ('facetmap')"; -$sql_queries[] = "INSERT INTO ".PREFIX."plugins (name) VALUES ('log')"; + * metadata + */ +$sql_queries[] = "INSERT INTO ".PREFIX."meta_fields " . + "(`id`, `name`, `field_type`, `flags`) VALUES (1, 'description', 1, 5)"; +$sql_queries[] = "INSERT INTO ".PREFIX."meta_fields " . + "(`id`, `name`, `field_type`, `flags`) VALUES (2, 'category', 2, 5)"; +$sql_queries[] = "INSERT INTO ".PREFIX."meta_fields " . + "(`id`, `name`, `field_type`, `flags`) VALUES (3, 'persons', 2, 5)"; +$sql_queries[] = "INSERT INTO ".PREFIX."meta_fields " . + "(`id`, `name`, `field_type`, `flags`) VALUES (4, 'date', 3, 5)"; +$sql_queries[] = "INSERT INTO ".PREFIX."meta_fields " . + "(`id`, `name`, `field_type`, `flags`) VALUES (6, 'filename', 0, 1)"; +$sql_queries[] = "INSERT INTO ".PREFIX."meta_fields " . + "(`id`, `name`, `field_type`, `flags`) VALUES (7, 'imagesize', 0, 1)"; +$sql_queries[] = "INSERT INTO ".PREFIX."meta_fields " . + "(`id`, `name`, `field_type`, `flags`) VALUES (8, 'dimension', 0, 1)"; +$sql_queries[] = "INSERT INTO ".PREFIX."meta_fields " . + "(`name`, `field_type`, `flags`) VALUES ('id_6', 0, 10)"; +$sql_queries[] = "INSERT INTO ".PREFIX."meta_fields " . + "(`name`, `field_type`, `flags`) VALUES ('id_7', 0, 10)"; +$sql_queries[] = "INSERT INTO ".PREFIX."meta_fields " . + "(`name`, `field_type`, `flags`) VALUES ('id_8', 0, 10)"; +$sql_queries[] = "INSERT INTO ".PREFIX."meta_fields " . + "(`name`, `field_type`, `flags`) VALUES ('id_1', 0, 10)"; +$sql_queries[] = "INSERT INTO ".PREFIX."meta_fields " . + "(`name`, `field_type`, `flags`) VALUES ('id_2', 0, 10)"; +$sql_queries[] = "INSERT INTO ".PREFIX."meta_fields " . + "(`name`, `field_type`, `flags`) VALUES ('id_3', 0, 10)"; +$sql_queries[] = "INSERT INTO ".PREFIX."meta_fields " . + "(`name`, `field_type`, `flags`) VALUES ('exif_datetimeoriginal', 0, 10)"; -/** - * permissions - */ -$sql_queries[] = "INSERT into ".PREFIX."permissions (type, who, groups_exceptions, groups_additional, and_or, alb, albums) VALUES ('watermark', '1', '', '', 0, 0, '')"; -$sql_queries[] = "INSERT into ".PREFIX."permissions (type, who, groups_exceptions, groups_additional, and_or, alb, albums) VALUES ('download', '1', '', '', 0, 0, '')"; -$sql_queries[] = "INSERT into ".PREFIX."permissions (type, who, groups_exceptions, groups_additional, and_or, alb, albums) VALUES ('img_comments', '1', '', '', 0, 0, '')"; -$sql_queries[] = "INSERT into ".PREFIX."permissions (type, who, groups_exceptions, groups_additional, and_or, alb, albums) VALUES ('basket_print', '1', '', '', 0, 0, '')"; -$sql_queries[] = "INSERT into ".PREFIX."permissions (type, who, groups_exceptions, groups_additional, and_or, alb, albums) VALUES ('basket_download', '1', '', '', 0, 0, '')"; -$sql_queries[] = "INSERT into ".PREFIX."permissions (type, who, groups_exceptions, groups_additional, and_or, alb, albums) VALUES ('basket_mail', '1', '', '', 0, 0, '')"; -$sql_queries[] = "INSERT into ".PREFIX."permissions (type, who, groups_exceptions, groups_additional, and_or, alb, albums) VALUES ('img_description', '0', '', ';1;', 0, 0, '')"; +?> - -/** - * watermark - */ -include_once(LINPHA_DIR.'/lib/plugins/watermark/func.watermark.php'); -$arr_config = array_watermark(); -while(list($name,$value) = each($arr_config) ) -{ - $sql_queries[] = "INSERT INTO ".PREFIX."config (option_name, option_value) VALUES ('".$name."','".$value."')"; -} -?> \ No newline at end of file Modified: trunk/linpha2/install/sql/sql.mysql.php =================================================================== --- trunk/linpha2/install/sql/sql.mysql.php 2006-03-30 18:56:38 UTC (rev 4457) +++ trunk/linpha2/install/sql/sql.mysql.php 2006-03-31 08:07:40 UTC (rev 4458) @@ -27,10 +27,7 @@ "`option_name` varchar(50) NOT NULL default '', " . "`option_value` varchar(100) NOT NULL default '', " . "`userid` mediumint(8) unsigned default '0', " . - "PRIMARY KEY (`id`), " . - "UNIQUE KEY `option_name_2` (`option_name`), " . - "KEY `option_name` (`option_name`), " . - "KEY `option_value` (`option_value`) " . + "PRIMARY KEY (`id`) " . ")", "CREATE TABLE ".$linpha_tables['groups']." ( ". "`id` int(11) NOT NULL auto_increment, " . @@ -111,11 +108,14 @@ ")" ); + /** - * create dynamically the linpha_meta_exif table - */ + * @todo do we still need this part ? guess not!? + * create dynamically the linpha_meta_exif table + include_once(LINPHA_DIR.'/lib/classes/linpha.metadata.class.php'); -$sql_tables[] = Metadata::createExifTable(); - -?> \ No newline at end of file +$objMetaData = new Metadata; +$sql_tables[] = $objMetaData->createExifTable(); + */ +?> Modified: trunk/linpha2/install/sql/sql.tables.php =================================================================== --- trunk/linpha2/install/sql/sql.tables.php 2006-03-30 18:56:38 UTC (rev 4457) +++ trunk/linpha2/install/sql/sql.tables.php 2006-03-31 08:07:40 UTC (rev 4458) @@ -30,30 +30,7 @@ "meta_category" => "meta_category", "meta_exif" => "meta_exif", "meta_iptc" => "meta_iptc", - "meta_comments" => "meta_data" + "meta_comments" => "meta_comments", + "meta_data" => "meta_data" ); - -/* -$linpha_tables = Array( - "config" => "config", - "users" => "users", - "first_lev_album" => "first_lev_album", - "sec_lev_album" => "sec_lev_album", - "third_lev_album" => "third_lev_album", - "photos" => "photos", - "photo_cache" => "photo_cache", - "category" => "category", - "counter_stats" => "counter_stats", - "groups" => "groups", - "image_comments" => "image_comments", - "album_comments" => "album_comments", - "plugins" => "plugins", - "guestbook" => "guestbook", - "mail_list" => "mail_list", - //"facetmap" => "facetmap", - "permissions" => "permissions", - "blacklist" => "blacklist", - "meta_exif" => "meta_exif" -);*/ - -?> \ No newline at end of file +?> Modified: trunk/linpha2/install/step10_postsettings.php =================================================================== --- trunk/linpha2/install/step10_postsettings.php 2006-03-30 18:56:38 UTC (rev 4457) +++ trunk/linpha2/install/step10_postsettings.php 2006-03-31 08:07:40 UTC (rev 4458) @@ -23,8 +23,8 @@ if(!defined('LINPHA_DIR')) { define('LINPHA_DIR','..'); } -include_once(LINPHA_DIR."/install/header.php"); -include_once(LINPHA_DIR."/install/lib.requirements.php"); +include_once(LINPHA_DIR.'/install/header.php'); +include_once(LINPHA_DIR.'/install/lib.requirements.php'); /** * now, it is too late to go back... @@ -40,14 +40,14 @@ } -include_once(LINPHA_DIR."/install/header_html.php"); +include_once(LINPHA_DIR.'/install/header_html.php'); -echo 'Connect to db using connection file... '; +echo tr("Connected To Database")."... "; unset($_SESSION['installmode1']); include_once(LINPHA_DIR.'/lib/classes/linpha.class.php'); -$linpha = new linpha(); +$linpha = new Linpha(); $linpha->sql->dbConnect(); echo success_msg(); @@ -55,27 +55,38 @@ /** * add new linpha user */ -echo '<br /><br />'; -echo '<h2>Create your linpha admin user</h2>'; +echo "<br /><br />"; +echo "<h2>".tr("Setup Linpha Admin User").".</h2>"; ?> <div class="boxalign"> -Admin username: <input class="boxalignelement" type="text" id="check01" onKeyup="checkForm()" name="admin_name" value="admin"> +<?php echo tr("Admin Username").":"; ?> +<input class="boxalignelement" type="text" id="check01" onKeyup="checkForm()" + name="admin_name" value="admin"> </div> + <div class="boxalign"> -Admin password: <input class="boxalignelement" type="password" id="check02" onKeyup="checkForm()" name="admin_pass"> +<?php echo tr("Admin Password").":"; ?> +<input class="boxalignelement" type="password" id="check02" + onKeyup="checkForm()" name="admin_pass"> </div> + <div class="boxalign"> -Admin email: <input class="boxalignelement" type="text" id="check03" onKeyup="checkForm()" name="admin_email"> +<?php echo tr("Admin eMail").":"; ?> +<input class="boxalignelement" type="text" id="check03" onKeyup="checkForm()" + name="admin_email"> </div> <br /> <br /> <?php -$query = $linpha->db->Execute("SELECT option_value FROM ".PREFIX."config WHERE option_name='use_convert'"); + +$query = $linpha->db->Execute("SELECT option_value FROM ".PREFIX."config " . + "WHERE option_name='sys_im_use_convert'"); $data = $query->FetchRow(); -if( !$data[0] && get_gd_version() == ">2" ) + +if(false === $data[0]) { - echo '<h2>'.$choose_def_quali.'</h2>'; + echo "<h2>".tr("Please Choose Thumbnail Quality")."</h2>"; ?> <div align="center"> <div class="box2"> @@ -89,31 +100,29 @@ </div> </div> <?php - echo $choose_def_quali_warn; + echo tr("Warning: High Quality Requires CPU > 1 GHz"); } - - ?> <br /><br /> <?php -echo '<h2>'.$inst_thumbsize_header.'</h2>'; +echo "<h2>".tr("Please Choose Default Thumbnail Size")."</h2>"; ?> <div align="center"> <div class="box3"> - <input type='radio' name='thumb_size' value='90'> + <input type='radio' name='sys_style_tn_size' value='90'> 90 pixel<br /> <img src='./graphics/thumb90px.jpg' /> </div> <div class="box3"> - <input type='radio' name='thumb_size' value='120' checked="checked"> + <input type='radio' name='sys_style_tn_size' value='120' checked="checked"> 120 pixel<br /> <img src='./graphics/thumb120px.jpg' /> </div> <div class="box3"> - <input type='radio' name='thumb_size' value='150'> + <input type='radio' name='sys_style_tn_size' value='150'> 150 pixel<br /> <img src='./graphics/thumb150px.jpg' /> </div> Modified: trunk/linpha2/install/step11_finish.php =================================================================== --- trunk/linpha2/install/step11_finish.php 2006-03-30 18:56:38 UTC (rev 4457) +++ trunk/linpha2/install/step11_finish.php 2006-03-31 08:07:40 UTC (rev 4458) @@ -25,9 +25,9 @@ include_once(LINPHA_DIR."/install/header.php"); include_once(LINPHA_DIR."/install/header_html.php"); -include_once(LINPHA_DIR.'/lib/classes/linpha.class.php'); +include_once(LINPHA_DIR."/lib/classes/linpha.class.php"); -$linpha = new linpha(); +$linpha = new Linpha(); $linpha->sql->dbConnect(); /** @@ -45,32 +45,35 @@ if(isset($error_nr)) { - echo "Validate informations... "; + echo tr("Validating Information")."... "; echo failed_msg(); - echo "<br />You must fill out all fields"; + echo "<br />".tr("Please Fill In All Fields").""; echo "</form>"; $show_next_button = false; include_once("./footer.php"); exit(1); } - echo "Adding linpha admin user... "; - $result = $linpha->db->Execute("INSERT INTO ".PREFIX."users (nickname, password, email, lang, level, groups, fullname) " . - "VALUES('".$linpha->sql->linAddslashes($_POST['admin_name'])."','".md5($_POST['admin_pass'])."','".$linpha->sql->linAddslashes($_POST['admin_email'])."','',10, ';1;','')"); + /*echo "Adding linpha admin user... "; + //$result = $linpha->db->Execute("INSERT INTO ".PREFIX."users (nickname, password, email, lang, level, groups, fullname) " . + // "VALUES('".$linpha->sql->linAddslashes($_POST['admin_name'])."','".md5($_POST['admin_pass'])."','".$linpha->sql->linAddslashes($_POST['admin_email'])."','',10, ';1;','')"); if(!$result) { echo failed_msg(); } else { echo success_msg(); } + */ /** - * save thumbnails quality settings + * save thumbnails default size */ -if( isset( $_POST['quality'] ) ) +echo "<br />".tr("Saving Thumbnail Size To Database")."... "; +if( isset( $_POST['sys_style_tn_size'] ) ) { - echo "<br />Setting quality selection... "; - $result = $linpha->db->Execute("UPDATE ".PREFIX."config SET option_value = '".$linpha->sql->linAddslashes($_POST['quality'])."' WHERE option_name = 'thumb_quality'"); + $result = $linpha->db->Execute("UPDATE ".PREFIX."config " . + "SET option_value = '".$linpha->sql->linAddslashes($_POST['sys_style_tn_size'])."' " . + "WHERE option_name = 'sys_style_tn_size'"); if(!$result) { echo failed_msg(); @@ -78,25 +81,10 @@ echo success_msg(); } } - -/** - * save thumbnails quality settings - */ -echo "<br />Setting thumbnail size selection... "; -if( isset( $_POST['thumb_size'] ) ) -{ - $result = $linpha->db->Execute("UPDATE ".PREFIX."config SET option_value = '".$linpha->sql->linAddslashes($_POST['thumb_size'])."' WHERE option_name = 'thumb_size'"); - if(!$result) - { - echo failed_msg(); - } else { - echo success_msg(); - } -} else { echo failed_msg(); - echo '<br />No value specified!'; + echo "<br />".tr("Error - No Value Specified")."!"; $error_nr = 1; } @@ -107,10 +95,11 @@ exit(1); } + +echo "<br /><br /><hr /><br />"; +echo "<h2>".tr("Congratulations")."</h2><br />"; +echo tr("Installation Finished")."!"; ?> -<br /><br /><hr /><br /> -<h2>Congratulations</h2><br /> -Installation finished! <script language="JavaScript" type='text/javascript'> <!-- document.back_form.submit_button.disabled = true; Modified: trunk/linpha2/install/step1_license.php =================================================================== --- trunk/linpha2/install/step1_license.php 2006-03-30 18:56:38 UTC (rev 4457) +++ trunk/linpha2/install/step1_license.php 2006-03-31 08:07:40 UTC (rev 4458) @@ -23,16 +23,16 @@ if(!defined('LINPHA_DIR')) { define('LINPHA_DIR','..'); } -include_once(LINPHA_DIR."/install/header.php"); -include_once(LINPHA_DIR."/install/header_html.php"); +include_once(LINPHA_DIR.'/install/header.php'); +include_once(LINPHA_DIR.'/install/header_html.php'); + ?> <iframe src="gpl.html" class="license" frameborder="0" scrolling="auto"></iframe> - <br /> <input type="hidden" name="language" value="<?php echo isset($_POST['language']) ? $_POST['language'] : ''; ?>"> -<input type="checkbox" id="check01" onChange="checkForm()">I accept the GNU General Public License<br /> +<input type="checkbox" id="check01" onChange="checkForm()"> +<?php echo tr("Please Accept The GNU General Public License")."<br />"; -<?php $array_check = array('check01' => 'checkbox'); $do_javascript_disable_button = true; include_once("./footer.php"); Modified: trunk/linpha2/install/step2_requirements.php =================================================================== --- trunk/linpha2/install/step2_requirements.php 2006-03-30 18:56:38 UTC (rev 4457) +++ trunk/linpha2/install/step2_requirements.php 2006-03-31 08:07:40 UTC (rev 4458) @@ -23,9 +23,9 @@ * linpha installer */ -include_once(LINPHA_DIR."/install/header.php"); -include_once(LINPHA_DIR."/install/lib.requirements.php"); -include_once(LINPHA_DIR."/install/header_html.php"); +include_once(LINPHA_DIR.'/install/header.php'); +include_once(LINPHA_DIR.'/install/lib.requirements.php'); +include_once(LINPHA_DIR.'/install/header_html.php'); ?> <script language="JavaScript" type='text/javascript'> @@ -68,14 +68,14 @@ */ print_line_left("PHP Version"); print_line_middle(PHP_VERSION); - if(version_compare(PHP_VERSION, "4.1.0", ">=")) + if(version_compare(PHP_VERSION, "5.0.0", ">=")) { print_line_right(success_msg()); } else { print_line_right(failed_msg()); - print_line_info("We need at least 4.1.0"); + print_line_info("PHP Version >= 5.0.0 Required"); $error = 1; } @@ -83,7 +83,7 @@ /** * check for supported databases */ - print_line_left("Supported databases (MySQL, PostgreSQL, SQLite)"); + print_line_left("Supported Databases (MySQL, PostgreSQL, SQLite)"); if(function_exists('mysql_connect')) { $supported_db['mysql'] = 1; } @@ -98,12 +98,13 @@ { print_line_middle("NONE"); print_line_right(failed_msg()); - print_line_info("Enable at least one database in your php configuration (php.ini)"); + print_line_info("Enable at least support for one Database in your " . + "PHP configuration (php.ini)"); $error = 1; } else { - print_line_middle("yes"); + print_line_middle("Yes"); print_line_right(success_msg()); $str = ""; @@ -111,7 +112,7 @@ { $str .= $key.' '; } - print_line_info("Supported databases: ".$str); + print_line_info("Supported Databases: ".$str); } /** @@ -185,20 +186,21 @@ */ if(version_compare($convert_version, "6.1.4", ">=")) { - $bracket_support = 1; + $sys_im_bracket_support = 1; } else { - $bracket_support = 0; + $sys_im_bracket_support = 0; } - echo "\t".'<input type="hidden" name="im_bracket_support" value="'.$bracket_support.'">'."\n"; + echo "\t".'<input type="hidden" name="sys_im_bracket_support" value="'.$sys_im_bracket_support.'">'."\n"; - echo "\t".'<input type="hidden" name="use_convert" value="1">'."\n"; - echo "\t".'<input type="hidden" name="convert_path" value="'.$convert_path.'">'."\n"; + echo "\t".'<input type="hidden" name="sys_im_use_convert" value="1">'."\n"; + echo "\t".'<input type="hidden" name="sys_im_convert_path" value="'.$convert_path.'">'."\n"; } } else { print_line_right(warning_msg()); - print_line_info($convert_sum_miss_msg); + print_line_info("ImageMagick was NOT found on this server. " . + "This will result in lower quality thumbnails"); } @@ -211,20 +213,20 @@ print_line_left("GD Library"); if(extension_loaded('gd')) { - print_line_middle("installed"); + print_line_middle("Installed"); print_line_right(success_msg()); } else { - print_line_middle("not found"); + print_line_middle("Not Found"); print_line_right(failed_msg()); $error = 1; } - print_line_left("GD jpeg support"); + print_line_left("GD JPEG Support"); if(!function_exists('imagecreatefromjpeg') || !function_exists('imagejpeg')) { - print_line_middle("no"); + print_line_middle("No"); print_line_right(failed_msg()); print_line_info($gd_jpg_missing_msg."<br />".$inst_linpha_not_work_correctly); @@ -232,12 +234,9 @@ } else { - print_line_middle("yes"); + print_line_middle("Yes"); print_line_right(success_msg()); } - - $gd_version = get_gd_version(); - echo "\t".'<input type="hidden" name="gd_version" value="'.$gd_version.'">'."\n"; } /** @@ -246,51 +245,51 @@ */ if(installGetOS() != "win") { - print_line_left("Posix extension"); + print_line_left("Posix Extension"); if(check_posix()) { - print_line_middle("yes"); + print_line_middle("Yes"); print_line_right(success_msg()); } else { - print_line_middle("no"); + print_line_middle("No"); print_line_right(warning_msg()); - print_line_info($posix_sum_miss_msg); + print_line_info("Missing POSIX Extension"); } } /** * checking safe mode */ - print_line_left("Safe mode activated"); + print_line_left("Safe Mode Activated"); if(! ini_get('safe_mode')) { - print_line_middle("no"); + print_line_middle("No"); print_line_right(success_msg()); } else { - print_line_middle("yes"); + print_line_middle("Yes"); print_line_right(warning_msg()); - print_line_info($safemode_active_msg."<br />".$inst_linpha_not_work_correctly."<br />".$safemode_active_msg2); + print_line_info("Save Mode Is Active - Bad Fun"); } /** * checking open basedir */ - print_line_left("Open basedir activated"); + print_line_left("Open Basedir Activated"); $basedir_name=ini_get("open_basedir"); if(empty($basedir_name)) { - print_line_middle("no"); + print_line_middle("No"); print_line_right(success_msg()); } else { - print_line_middle("yes"); + print_line_middle("Yes"); print_line_right(warning_msg()); - print_line_info($basedir_active_msg."<br />".$inst_linpha_not_work_correctly."<br />".$basedir_active_msg2); + print_line_info("Open Basedir Restrictions Set"); } @@ -301,7 +300,7 @@ $limit = get_mem_limit(); if($limit === false) { - print_line_middle("unlimited"); + print_line_middle("Unlimited"); print_line_right(success_msg()); } elseif($limit <= 16) @@ -319,34 +318,33 @@ /** * checking session variables */ - print_line_left("Session save path set correctly"); + print_line_left("Session Save Path Set Correctly"); $session_path=session_save_path(); if(!empty($session_path)) { - print_line_middle("yes"); + print_line_middle("Yes"); print_line_right(success_msg()); - print_line_info("Session save path is set in php.ini to: ".$session_path); + print_line_info("Session Save Path Is Set To: ".$session_path); } else { - print_line_middle("no"); + print_line_middle("No"); print_line_right(warning_msg()); - print_line_info("NO value found for session_save_path.<br />". - "Open your php.ini, and change the session.save_path to a writable directory, for example: \"/tmp\""); + print_line_info("NO Value Found For session_save_path."); } - print_line_left("Session save handler set correctly"); + print_line_left("Session Save Handler Set Correctly"); $session_save_handler = strtolower(ini_get('session.save_handler')); if($session_save_handler == 'files') { - print_line_middle("yes"); + print_line_middle("Yes"); print_line_right(success_msg()); } else { - print_line_middle("no"); + print_line_middle("No"); print_line_right(failed_msg()); print_line_info("Session save handler NOT correctly set.<br />". "Open your php.ini, and change the session.save_handler to \"files\""); @@ -354,16 +352,16 @@ /** * checking file permissions */ - print_line_left("File permissions set correctly"); + print_line_left("File Permissions Set Correctly"); if( is_writable(LINPHA_DIR.'/var') ) { - print_line_middle("yes"); + print_line_middle("Yes"); print_line_right(success_msg()); } else { - print_line_middle("no"); + print_line_middle("No"); print_line_right(failed_msg()); print_line_info(sprintf($str_make_dir_writable,""<b>linpha/var</b>"")); @@ -376,10 +374,12 @@ */ print_foot(); +echo "<br />"; +echo tr("For More Detailed Info - Click On The Status Text<br />"); + ?> -<br /> -For more detailled info, click on the status text<br /> -(<a href="#" onclick="show_hide_tables('',<?php echo $table_lines; ?>)">Show all infos</a>). +<a href="#" onclick="show_hide_tables('',<?php echo $table_lines; ?>)"> +(<?php echo tr("Show All Information"); ?></a>). <script language="JavaScript" type='text/javascript'> <!-- @@ -410,8 +410,8 @@ <table width="95%"> <tr> <td> </td> - <td>Version</td> - <td>Status</td> + <td><?php echo tr("Result"); ?></td> + <td><?php echo tr("Status"); ?></td> </tr> <?php } @@ -421,14 +421,14 @@ $GLOBALS['table_lines']++; ?> <tr> - <td style="text-align: left;"><?php echo $str; ?></td> + <td style="text-align: left;"><?php echo tr("$str"); ?></td> <?php } function print_line_middle($str) { ?> - <td width="50"><?php echo $str; ?></td> + <td width="50"><?php echo tr("$str"); ?></td> <?php } @@ -436,7 +436,7 @@ { ?> <td width="50"><a href="#" onclick="switch_visibility(<?php echo $GLOBALS['table_lines']; ?>)"><?php - echo $str; ?></a></td> + echo tr("$str"); ?></a></td> </tr> <?php } @@ -445,7 +445,8 @@ { ?> <tr id="table_line_<?php echo $GLOBALS['table_lines']; ?>" style="display:"> - <td colspan="3" style="text-align: left; border-left: none; border-right: none; border-bottom: none; "><?php echo $str; ?><br /><br /></td> + <td colspan="3" style="text-align: left; border-left: none; border-right: none; border-bottom: none; "> + <?php echo tr("$str"); ?><br /><br /></td> </tr> <?php } Modified: trunk/linpha2/install/step3_dbtype.php =================================================================== --- trunk/linpha2/install/step3_dbtype.php 2006-03-30 18:56:38 UTC (rev 4457) +++ trunk/linpha2/install/step3_dbtype.php 2006-03-31 08:07:40 UTC (rev 4458) @@ -23,7 +23,7 @@ * linpha installer */ -include_once(LINPHA_DIR."/install/header.php"); +include_once(LINPHA_DIR.'/install/header.php'); /** * save settings from previous page @@ -33,7 +33,7 @@ $_SESSION['language'] = $_POST['language']; } -$array = array('im_bracket_support','gd_version','use_convert','convert_path'); +$array = array('sys_im_bracket_support','sys_im_use_convert','sys_im_convert_path'); foreach($array AS $value) { if(isset($_POST[$value])) @@ -47,7 +47,7 @@ } -include_once(LINPHA_DIR."/install/header_html.php"); +include_once(LINPHA_DIR.'/install/header_html.php'); /** @@ -102,42 +102,44 @@ $checked_mysql = ' checked="checked"'; } ?> -<input type='radio' name='sql_dbtype' value='mysql'<?php echo $disabled_mysql; ?><?php echo $checked_mysql; ?>> -MySQL<br /> +<input type='radio' name='sql_dbtype' value='mysql'<?php echo $disabled_mysql; ?> +<?php echo $checked_mysql; ?>>MySQL<br /> <?php if(!isset($supported_db['mysql'])) { - echo '<b>'.$str_not_enabled_in_php_config.'</b><br />'; + echo '<b>'.tr("No Support In PHP Config (php.ini)");'</b><br />'; } ?> <br /> -<input type='radio' name='sql_dbtype' value='postgres'<?php echo $disabled_postgres; ?><?php echo $checked_postgres; ?>> -Postgresql<br /> +<input type='radio' name='sql_dbtype' value='postgres'<?php echo $disabled_postgres; ?> +<?php echo $checked_postgres; ?>>Postgresql<br /> <?php if(!isset($supported_db['postgres'])) { - echo '<b>'.$str_not_enabled_in_php_config.'</b><br />'; + echo '<b>'.tr("No Support In PHP Config (php.ini)");'</b><br />'; } ?> <br /> -<input type='radio' name='sql_dbtype' value='sqlite'<?php echo $disabled_sqlite; ?><?php echo $checked_sqlite; ?>> -SQLite<br /> +<input type='radio' name='sql_dbtype' value='sqlite'<?php echo $disabled_sqlite; ?> +<?php echo $checked_sqlite; ?>>SQLite<br /> <?php if(!isset($supported_db['sqlite'])) { - echo '<b>'.$str_not_enabled_in_php_config.'</b><br />'; + echo '<b>'.tr("No Support In PHP Config (php.ini)");'</b><br />'; } ?> <br /><br /> -<h1>Select installation mode</h1> +<h1><?php echo tr("Select Installation Mode"); ?></h1> <br /> -<input type='radio' name='install_mode' value='automatic' checked="checked">Automatic mode +<input type='radio' name='install_mode' value='automatic' checked="checked"> +<?php echo tr("Automatic mode"); ?> <br /><br /> -<input type='radio' name='install_mode' value='manual'>Manual mode (only for experts) +<input type='radio' name='install_mode' value='manual'> +<?php echo tr("Manual Mode (Experts Only)"); ?> <?php include_once("./footer.php"); Modified: trunk/linpha2/install/step4_selectdirectories.php =================================================================== --- trunk/linpha2/install/step4_selectdirectories.php 2006-03-30 18:56:38 UTC (rev 4457) +++ trunk/linpha2/install/step4_selectdirectories.php 2006-03-31 08:07:40 UTC (rev 4458) @@ -23,7 +23,7 @@ * linpha installer */ -include_once(LINPHA_DIR."/install/header.php"); +include_once(LINPHA_DIR.'/install/header.php'); /** * save settings from previous page @@ -55,40 +55,45 @@ -include_once(LINPHA_DIR."/install/header_html.php"); +include_once(LINPHA_DIR.'/install/header_html.php'); $album_dir = (isset($_SESSION['album_dir']) ? $_SESSION['album_dir'] : 'albums'); $sql_dir = (isset($_SESSION['sql_dir']) ? $_SESSION['sql_dir_parent'] : 'var/'); $cache_dir = (isset($_SESSION['cache_dir']) ? $_SESSION['cache_dir_parent'] : 'var/'); $tmp_dir = (isset($_SESSION['tmp_dir']) ? $_SESSION['tmp_dir_parent'] : 'var/'); ?> + <div class="boxalign"> -Album directory: -<input class="boxalignelement" type="text" id="check01" onKeyup="checkForm()" name="album_dir" size="30" value="<?php echo $album_dir; ?>"> +<?php echo tr("Album Directory:"); ?> +<input class="boxalignelement" type="text" id="check01" onKeyup="checkForm()" + name="album_dir" size="30" value="<?php echo $album_dir; ?>"> </div> (-> <?php echo realpath(LINPHA_DIR.'/'.$album_dir); ?>) <br /><br /> -<h2>Warning: all the following subdirectories will be deleted</h2> +<h2><?php echo tr("Warning: All Subdirectories Will Be Deleted"); ?></h2> <br /> <div class="boxalign"> -Sql directory: -<input class="boxalignelement" type="text" id="check02" onKeyup="checkForm()" name="sql_dir" size="30" value="<?php echo $sql_dir; ?>"> +<?php echo tr("Sql Directory:"); ?> +<input class="boxalignelement" type="text" id="check02" onKeyup="checkForm()" + name="sql_dir" size="30" value="<?php echo $sql_dir; ?>"> </div> (-> <?php echo realpath(LINPHA_DIR.'/'.$sql_dir); ?>/sql) <br /><br /> <div class="boxalign"> -Cache directory: -<input class="boxalignelement" type="text" id="check03" onKeyup="checkForm()" name="cache_dir" size="30" value="<?php echo $cache_dir; ?>"> +<?php echo tr("Cache Directory:"); ?> +<input class="boxalignelement" type="text" id="check03" onKeyup="checkForm()" + name="cache_dir" size="30" value="<?php echo $cache_dir; ?>"> </div> (-> <?php echo realpath(LINPHA_DIR.'/'.$cache_dir); ?>/cache) <br /><br /> <div class="boxalign"> -Tmp directory: -<input class="boxalignelement" type="text" id="check04" onKeyup="checkForm()" name="tmp_dir" size="30" value="<?php echo $tmp_dir; ?>"> +<?php echo tr("Temp Directory:"); ?> +<input class="boxalignelement" type="text" id="check04" onKeyup="checkForm()" + name="tmp_dir" size="30" value="<?php echo $tmp_dir; ?>"> </div> (-> <?php echo realpath(LINPHA_DIR.'/'.$tmp_dir); ?>/tmp) <br /><br /> Modified: trunk/linpha2/install/step5_getlogin.php =================================================================== --- trunk/linpha2/install/step5_getlogin.php 2006-03-30 18:56:38 UTC (rev 4457) +++ trunk/linpha2/install/step5_getlogin.php 2006-03-31 08:07:40 UTC (rev 4458) @@ -23,7 +23,7 @@ * linpha installer */ -include_once(LINPHA_DIR."/install/header.php"); +include_once(LINPHA_DIR.'/install/header.php'); /** * save settings from previous page @@ -77,14 +77,14 @@ } -include_once(LINPHA_DIR."/install/header_html.php"); +include_once(LINPHA_DIR.'/install/header_html.php'); /** * validate writable directories */ - echo "<h2>Checking permissions of directories</h2><br />"; + echo "<h2>".tr("Checking Directory Permissions")."</h2><br />"; - echo "Album directory... "; + echo tr("Album Directory")."... "; if( is_dir( $dirs['album'] ) ) { if( is_writable( $dirs['album'] ) ) @@ -96,20 +96,20 @@ { echo warning_msg(); echo '<br /> ('.$_SESSION['album_dir'].' => '.realpath( $dirs['album'] ).')'; - echo "<br />Your album directory isn't writable. Some functions may not be used: rotate images, manage images with the integrated filemanager, ...<br />"; + echo "<br />".tr("Album Directory Not Writable. Some Features May Not Work")."<br />"; } } else { echo failed_msg(); echo '<br /> ('.$_SESSION['album_dir'].')'; - echo '<br />No valid directory found!'; + echo "<br />".tr("No Valid Directory Found")."!"; } $array = array('sql','cache','tmp'); foreach($array AS $value) { - echo "<br /><br />Checking ".$value." directory... "; + echo "<br /><br />Checking ".$value." Directory... "; if( is_dir( $dirs[$value.'_parent'] ) ) { if( is_writable( $dirs[$value.'_parent'] ) ) @@ -117,7 +117,7 @@ if( file_exists( $dirs[$value] ) ) { echo warning_msg(); - echo "<br />Directory already exists, trying to delete folder... "; + echo "<br />".tr("Directory Already Exists - Trying To Delete")."... "; if( rm_rf( $dirs[$value] ) ) { echo success_msg(); @@ -125,7 +125,7 @@ else { echo failed_msg(); - echo "<br />Try to delete the folder yourself."; + echo "<br />".tr("Please Delete Folder Manually").""; $error_nr = 2; } } @@ -138,7 +138,7 @@ else { echo failed_msg(); - echo "<br />Missing write permission to this directory. Please change permissions or use another directory!"; + echo "<br />".tr("No Write Permissions. Please Change Permissions Or Choose Another Directory")."!"; echo '<br /> ('.$_SESSION[$value.'_dir'].' => '.realpath( $dirs[$value.'_parent'] ).'/'.$value.')'; $error_nr = 1; } @@ -146,7 +146,7 @@ else { echo failed_msg(); - echo "<br />Directory doesn't exists!"; + echo "<br />".tr("Directory Doesn't Exist")."!"; echo '<br /> ('.$_SESSION[$value.'_dir'].' => '.$dirs[$value.'_parent'].'/'.$value.')'; // no realpath() because if dir does not exists realpath will show something strange... $error_nr = 1; } @@ -163,24 +163,28 @@ } ?> <hr /> -<h1><?php echo $title_str[$key]; ?></h1> +<h1><?php echo tr("$title_str[$key]"); ?></h1> <br /> <div class="boxalign"> -Username: -<input class="boxalignelement" type="text" id="check01" onKeyup="checkForm()" name="sql_username" value="<?php echo isset($_SESSION['sql_username']) ? $_SESSION['sql_username'] : 'root' ; ?>"> +<?php echo tr("Username").":"; ?> +<input class="boxalignelement" type="text" id="check01" onKeyup="checkForm()" + name="sql_username" value="<?php echo isset($_SESSION['sql_username']) ? $_SESSION['sql_username'] : 'root' ; ?>"> <br /> </div> <div class="boxalign"> -Password: -<input class="boxalignelement" type="password" id="check02" onKeyup="checkForm()" name="sql_password"> +<?php echo tr("Password").":"; ?> +<input class="boxalignelement" type="password" id="check02" + onKeyup="checkForm()" name="sql_password"> <br /> </div> <div class="boxalign"> -Host name: -<input class="boxalignelement" type="text" id="check03" onKeyup="checkForm()" name="sql_hostname" value="<?php echo isset($_SESSION['sql_hostname']) ? $_SESSION['sql_hostname'] : 'localhost' ; ?>"> +<?php echo tr("Hostname:").":"; ?> +<input class="boxalignelement" type="text" id="check03" onKeyup="checkForm()" + name="sql_hostname" value="<?php echo isset($_SESSION['sql_hostname']) ? + $_SESSION['sql_hostname'] : 'localhost' ; ?>"> </div> <?php Modified: trunk/linpha2/install/step6_selectdatabase.php =================================================================== --- trunk/linpha2/install/step6_selectdatabase.php 2006-03-30 18:56:38 UTC (rev 4457) +++ trunk/linpha2/install/step6_selectdatabase.php 2006-03-31 08:07:40 UTC (rev 4458) @@ -23,8 +23,8 @@ * linpha installer */ -include_once(LINPHA_DIR."/install/header.php"); -include_once(LINPHA_DIR."/install/header_html.php"); +include_once(LINPHA_DIR.'/install/header.php'); +include_once(LINPHA_DIR.'/install/header_html.php'); /** * save settings from previous page @@ -42,11 +42,12 @@ /** * validate settings */ -if(empty($_SESSION['sql_hostname']) OR empty($_SESSION['sql_username']) OR empty($_SESSION['sql_password'])) +if(empty($_SESSION['sql_hostname']) OR empty($_SESSION['sql_username']) + OR empty($_SESSION['sql_password'])) { - echo "Validate informations... "; + echo tr("Validating Information")."... "; echo failed_msg(); - echo "<br />You must fill out all fields"; + echo "<br />".tr("Please Fill In All Fields").""; echo "</form>"; $show_next_button = false; @@ -54,18 +55,18 @@ exit(); } + switch($_SESSION['sql_dbtype']) { case "mysql": - echo "Checking server connection<br /><br />"; - echo "Connecting to"; - echo "MySQL-Server... "; + echo tr("Testing Server Connection")."<br /><br />"; + echo tr("Connecting MySQL-Server")."... "; $link = @mysql_connect($_SESSION['sql_hostname'], $_SESSION['sql_username'], $_SESSION['sql_password']); if (!$link) { echo failed_msg(); - echo "<br />Can't connect to server : " . mysql_error(); + echo "<br />".tr("Error Connecting To Server").": ".mysql_error().""; $error_nr = 2; } else @@ -73,11 +74,11 @@ echo success_msg(); $curtime = time(); - $result = mysql_query("CREATE database linpha_test_".$curtime); + $result = mysql_query("CREATE DATABASE linpha_test_".$curtime); if($result) { $able_to_create_database = true; - mysql_query("DROP database linpha_test_".$curtime); + mysql_query("DROP DATABASE linpha_test_".$curtime); $db_list = mysql_list_dbs($link); @@ -153,23 +154,30 @@ $checked_create = ' checked="checked"'; $checked_dontcreate = ''; } + + echo tr("You Are Allowed To Create A New Database (Recommended)"); ?> - You can created a new database (recommended): <br /> - <input type="radio" id="radio_db1" name="create_database" value="create"<?php echo $checked_create; ?>> - Database name: - <input type="text" name="sql_dbname_create" value="<?php echo isset($_SESSION['sql_dbname']) ? $_SESSION['sql_dbname'] : $dbname ; ?>" onKeyup="document.getElementById('radio_db1').checked = true;"> + <input type="radio" id="radio_db1" name="create_database" + value="create"<?php echo $checked_create; ?>> + <?php echo tr("New Database Name").": "; ?> + <input type="text" name="sql_dbname_create" + value="<?php echo isset($_SESSION['sql_dbname']) ? + $_SESSION['sql_dbname'] : $dbname ; ?>" + onKeyup="document.getElementById('radio_db1').checked = true;"> + <br /><br /> - Or,<br /> - <input type="radio" id="radio_db2" name="create_database" value="false"<?php echo $checked_dontcreate; ?>> + <?php echo tr("Or").","; ?><br /> + <input type="radio" id="radio_db2" name="create_database" + value="false"<?php echo $checked_dontcreate; ?>> <?php } if(isset($databases)) { + echo tr("Install Into Existing Database").": "; ?> - Install into an existing database: <br /> <select name="sql_dbname_installinto"<?php if($able_to_create_database) @@ -197,9 +205,11 @@ if(!$able_to_create_database AND !isset($database)) { + echo tr("Install Linpha Into").":<br />"; ?> - Install linpha into this database:<br /> - <input type="text" name="sql_dbname_installinto" value="<?php echo isset($_SESSION['sql_dbname']) ? $_SESSION['sql_dbname'] : '' ; ?>"> + <input type="text" name="sql_dbname_installinto" + value="<?php echo isset($_SESSION['sql_dbname']) ? + $_SESSION['sql_dbname'] : '' ; ?>"> <?php } Modified: trunk/linpha2/install/step7_selectprefix.php =================================================================== --- trunk/linpha2/install/step7_selectprefix.php 2006-03-30 18:56:38 UTC (rev 4457) +++ trunk/linpha2/install/step7_selectprefix.php 2006-03-31 08:07:40 UTC (rev 4458) @@ -23,7 +23,7 @@ * linpha installer */ -include_once(LINPHA_DIR."/install/header.php"); +include_once(LINPHA_DIR.'/install/header.php'); /** @@ -34,7 +34,7 @@ $back_file = "step4_mode.php"; } -include_once(LINPHA_DIR."/install/header_html.php"); +include_once(LINPHA_DIR.'/install/header_html.php'); /** * save settings from previous page @@ -55,8 +55,9 @@ */ if( empty($_SESSION['sql_dbname']) ) { - echo "You must fill out all fields"; - + echo tr("Validating Information")."... "; + echo failed_msg(); + echo "<br />".tr("Please Fill In All Fields").""; echo "</form>"; $show_next_button = false; include_once("./footer.php"); @@ -66,13 +67,13 @@ switch($_SESSION['sql_dbtype']) { case "mysql": - echo "<h2>Checking database</h2><br />"; + echo "<h2>".tr("Checking Database")."</h2><br />"; $link = @mysql_connect($_SESSION['sql_hostname'], $_SESSION['sql_username'], $_SESSION['sql_password']); if(isset($_POST['create_database']) && $_POST['create_database'] == "create") { - echo "Creating database... "; + echo tr("Creating Database")."... "; $result = @mysql_query("CREATE database ".$_SESSION['sql_dbname']); if($result) @@ -90,12 +91,12 @@ if(!isset($error_nr)) { - echo "<br />Selecting database ".$_SESSION['sql_dbname'].'... '; + echo "<br />".tr("Selecting Database").". ".$_SESSION['sql_dbname'].'... '; $db_selected = @mysql_select_db($_SESSION['sql_dbname'], $link); if (!$db_selected) { echo failed_msg(); - echo "<br />Can't open database ".$_SESSION['sql_dbname'].": " . mysql_error() . "<br />"; + echo "<br />".tr("Failed Opening Database").". ".$_SESSION['sql_dbname'].": " . mysql_error() . "<br />"; $error_nr = 3; } else @@ -106,16 +107,15 @@ break; case "postgres": - echo "<h2>Checking server connection</h2><br />"; - echo "Connecting to"; - echo "PostgreSQL-Server... "; + echo tr("Testing Server Connection")."<br /><br />"; + echo tr("Connecting PostgreSQL-Server")."... "; $link = pg_pconnect("host=".$_SESSION['sql_hostname']." dbname=".$_SESSION['sql_dbname']." user=".$_SESSION['sql_username']." password=".$_SESSION['sql_password']); // port=5432 if (!$link) { echo failed_msg(); - echo "<br />Can't connect to server : " . pg_last_error($link); + echo "<br />".tr("Error Connecting To Server").": ".pg_last_error($link); $error_nr = 2; } else @@ -124,13 +124,13 @@ } break; case "sqlite": - echo "<h2>Checking database</h2><br />"; - echo "Creating database... "; + echo tr("Testing File Connection")."<br /><br />"; + echo tr("Connecting SQLite Database")."... "; if(file_exists($_SESSION['sql_dbname'])) { echo failed_msg(); - echo '<br />Database already exists, delete the file '.$_SESSION['sql_dbname'].' first!'; + echo "<br />".tr("Database Already Exists, Delete The File ".$_SESSION['sql_dbname']." first!").""; $error_nr = 3; } else @@ -142,7 +142,7 @@ else { echo failed_msg(); - echo '<br />Cannot create database: '.$sqliteerror; + echo "<br />".tr("Failed To Create Database").": ".$sqliteerror; $error_nr = 3; } } @@ -166,8 +166,10 @@ <br /><br /> <hr> <br /> - Please enter the prefix for the linpha tables (leave for default):<br /> - <input type="text" id="check01" onKeyup="checkForm()" name="sql_prefix" value="<?php echo isset($_SESSION['sql_prefix']) ? $_SESSION['sql_prefix'] : 'linpha_' ; ?>"> + <?php echo tr("Please Enter Database Prefix For Linpha Tables (Leave For Default)").": <br />" ?> + <input type="text" id="check01" onKeyup="checkForm()" name="sql_prefix" + value="<?php echo isset($_SESSION['sql_prefix']) ? + $_SESSION['sql_prefix'] : 'linpha_' ; ?>"> <?php $array_check = array( Modified: trunk/linpha2/install/step8_testing.php =================================================================== --- trunk/linpha2/install/step8_testing.php 2006-03-30 18:56:38 UTC (rev 4457) +++ trunk/linpha2/install/step8_testing.php 2006-03-31 08:07:40 UTC (rev 4458) @@ -23,8 +23,8 @@ * linpha installer */ -include_once(LINPHA_DIR."/install/header.php"); -include_once(LINPHA_DIR."/install/header_html.php"); +include_once(LINPHA_DIR.'/install/header.php'); +include_once(LINPHA_DIR.'/install/header_html.php'); /** * save settings from previous page @@ -39,8 +39,9 @@ */ if( empty($_SESSION['sql_prefix']) ) { - echo "You must fill out all fields"; - + echo tr("Validating Information")."... "; + echo failed_msg(); + echo "<br />".tr("Please Fill In All Fields").""; echo "</form>"; $show_next_button = false; include_once("./footer.php"); @@ -51,7 +52,7 @@ * switching to AdoDB * connect to db and check if connection was succesfull */ - echo "Switching to AdoDB... "; + echo tr("Switching To AdoDB")."... "; $_SESSION['installmode1'] = true; $_SESSION['installmode2'] = true; @@ -71,16 +72,16 @@ if($_SESSION['sql_dbtype'] != "sqlite") { ?> - <h2>Checking prefix</h2><br /> + <h2><?php echo tr("Checking Table Prefix"); ?></h2><br /> - Doesn't any tables already exists... + <?php echo tr("Checking For Existing Tables")."... "; ?> <?php $array_tables = $linpha->db->MetaTables(); if (! isset($array_tables) OR ! is_array($array_tables)) { echo failed_msg(); - echo '<br />Cannot read tables: '.mysql_error(); + echo "<br />".tr("Cannot Read Tables").": ".mysql_error(); $error_nr = 2; } else @@ -100,7 +101,7 @@ if(isset($result) && is_array($result) && (count($result) > 0) ) { echo failed_msg(); - echo '<br />There is already a linpha installation with this prefix, choose another one!'; + echo "<br />".tr("Table Prefix Already Exists, Please Choose Another One").".!"; echo "</form>"; $show_next_button = false; include_once("./footer.php"); @@ -121,7 +122,7 @@ $n_runs = 1; if($_SESSION['sql_dbtype']=="mysql") { - echo 'Trying to create a new db user... '; + echo tr("Trying To Create New Database User")."... "; $random_pass = random_password(8); $random_user = "linpha_".random_password(4); @@ -136,14 +137,14 @@ "IDENTIFIED BY '".$random_pass."' WITH GRANT OPTION") ) { echo warning_msg(); - echo "<br />".$str_cant_create_user; + echo "<br />".tr("Failed To Create New User"); } else { if(! $linpha->db->Execute("FLUSH PRIVILEGES") ) { echo warning_msg(); - echo "<br />".$str_cant_create_user; + echo "<br />".tr("Failed To Create New User"); } else { @@ -154,7 +155,7 @@ if(! $test_conn->Connect($_SESSION['sql_hostname'], $random_user, $random_pass, $_SESSION['sql_dbname']) ) { echo warning_msg(); - echo "<br />".$str_cant_create_user; + echo "<br />".tr("Failed To Create New User"); } else { @@ -179,7 +180,7 @@ */ if($i == 2) { - echo "<br /><br />All went fine, now trying the new user...<br /><br />"; + echo "<br /><br />".tr("User Created, Now Running Tests")."...<br /><br />"; $orig_conn = $linpha->db; $linpha->db = $test_conn; } @@ -187,10 +188,10 @@ /** * Test table stuff */ - echo '<h2>Testing tables</h2>'; + echo "<h2>".tr("Testing Tables")."</h2>"; $table_name = $_SESSION['sql_prefix']."test".time(); - echo "<br />Running tests: "; + echo "<br />".tr("Running Tests").": "; $array_tests = array( "CREATE" => "CREATE TABLE ".$table_name." ( id INT NOT NULL )", @@ -266,7 +267,7 @@ */ if(isset($use_other_conn)) { - echo '<br /><br /><b>New user failed, using original user...</b>'; + echo "<br /><br /><b>".tr("New User Tests Failed, Falling Back")."...</b>"; $linpha->db = $orig_conn; } elseif($n_runs == 2) Modified: trunk/linpha2/install/step9_createtables.php =================================================================== --- trunk/linpha2/install/step9_createtables.php 2006-03-3... [truncated message content] |