Browse Source

Added langs in configuration

Victor De la Rocha 16 years ago
parent
commit
d6b78f7d54
4 changed files with 12 additions and 8 deletions
  1. 4 2
      admin/themes/admin/install.htm
  2. 4 2
      classes/lang.functions.php
  3. 2 3
      classes/util.class.php
  4. 2 1
      install.php

+ 4 - 2
admin/themes/admin/install.htm View File

29
 					<fieldset class="install">
29
 					<fieldset class="install">
30
 						<legend class="install">Database Settings</legend>
30
 						<legend class="install">Database Settings</legend>
31
 						<ul>
31
 						<ul>
32
-							<li><label for="login">Are you the admin? please write the database name User</label>
32
+							<li><label for="login">Are you the admin? Write the same data that "DB_User" in config.php</label>
33
 								<input type="text" name="db_login" id="db_login" value="{db_login}" class="txt"/>{error.9}</li>
33
 								<input type="text" name="db_login" id="db_login" value="{db_login}" class="txt"/>{error.9}</li>
34
 						</ul>
34
 						</ul>
35
 					</fieldset><br  />
35
 					</fieldset><br  />
59
 								<input type="text" name="posts_limit" id="posts_limit" value="10" class="txt"/></li>
59
 								<input type="text" name="posts_limit" id="posts_limit" value="10" class="txt"/></li>
60
 							<li><label for="lang">Language:</label>
60
 							<li><label for="lang">Language:</label>
61
 								<select id="lang" name="lang">
61
 								<select id="lang" name="lang">
62
-									<option value="en" selected="selected">english</option>
62
+									{block $langs as $k=>$v}
63
+										<option value="{$k}" {if $k=='en'}selected="selected"{/if}>{$v}</option>
64
+									{/block}
63
 								</select>
65
 								</select>
64
 							</li>
66
 							</li>
65
 							<li><label for="template">Template:</label>
67
 							<li><label for="template">Template:</label>

+ 4 - 2
classes/lang.functions.php View File

23
 }
23
 }
24
 
24
 
25
 function __($text) {
25
 function __($text) {
26
-	global $l10n;
27
-	return $l10n->translate($text);
26
+	global $l10n;
27
+	if($l10n)
28
+		return $l10n->translate($text);
29
+	return $text;	
28
 }
30
 }
29
 
31
 
30
 function T_ngettext($single, $plural, $number) {
32
 function T_ngettext($single, $plural, $number) {

+ 2 - 3
classes/util.class.php View File

402
  		$dir = (substr(PHP_OS, 0, 3) == 'WIN') ? $path."\\".$langs_dir : $path."/".$langs_dir;
402
  		$dir = (substr(PHP_OS, 0, 3) == 'WIN') ? $path."\\".$langs_dir : $path."/".$langs_dir;
403
 		$dir = str_replace("admin\\", "", $dir);
403
 		$dir = str_replace("admin\\", "", $dir);
404
 		$dir = str_replace("admin/", "", $dir);
404
 		$dir = str_replace("admin/", "", $dir);
405
- 		$i=0;
405
+ 		$i=0; 
406
 		$cls_lang_dir = @ dir($dir);
406
 		$cls_lang_dir = @ dir($dir);
407
 		while (($directory = $cls_lang_dir->read()) !== false) {
407
 		while (($directory = $cls_lang_dir->read()) !== false) {
408
 			if($directory != "." && $directory != "..") {
408
 			if($directory != "." && $directory != "..") {
409
-
410
 				$dir2 = (substr(PHP_OS, 0, 3) == 'WIN') ? $path."\\".$langs_dir."\\".$directory : $path."/".$langs_dir."/".$directory;
409
 				$dir2 = (substr(PHP_OS, 0, 3) == 'WIN') ? $path."\\".$langs_dir."\\".$directory : $path."/".$langs_dir."/".$directory;
411
 				$dir2 = str_replace("admin\\", "", $dir2);
410
 				$dir2 = str_replace("admin\\", "", $dir2);
412
 				$dir2 = str_replace("admin/", "", $dir2);
411
 				$dir2 = str_replace("admin/", "", $dir2);
669
         }
668
         }
670
 	}
669
 	}
671
 }
670
 }
672
-?>
671
+?>

+ 2 - 1
install.php View File

41
 $theme->set('description',isset($install->data['description'])?$install->data['description']:'');
41
 $theme->set('description',isset($install->data['description'])?$install->data['description']:'');
42
 
42
 
43
 $theme->set('url_installation',(isset($install->data['url_installation']) and $install->data['url_installation'])?$install->data['url_installation']:(isset($_SERVER['SCRIPT_URI'])?substr($_SERVER["SCRIPT_URI"], 0, -12):''));
43
 $theme->set('url_installation',(isset($install->data['url_installation']) and $install->data['url_installation'])?$install->data['url_installation']:(isset($_SERVER['SCRIPT_URI'])?substr($_SERVER["SCRIPT_URI"], 0, -12):''));
44
-$theme->set('themes',util::getThemes());
44
+$theme->set('themes',util::getThemes());
45
+$theme->set('langs',util::getLangs());
45
 
46
 
46
 for($c=1;$c<=10;$c++)$errores[$c] = $install->mostrarerror($c);
47
 for($c=1;$c<=10;$c++)$errores[$c] = $install->mostrarerror($c);
47
 $theme->set('error',$errores);
48
 $theme->set('error',$errores);