Browse Source

Fixed bug on options

pecesama 17 years ago
parent
commit
2442496087
4 changed files with 15 additions and 23 deletions
  1. 13 6
      admin/options.php
  2. 2 4
      classes/gelato.class.php
  3. BIN
      languages/en/lang.mo
  4. 0 13
      languages/en/lang.po

+ 13 - 6
admin/options.php View File

23
 
23
 
24
 if ($user->isAdmin()) {
24
 if ($user->isAdmin()) {
25
 	
25
 	
26
-	if(isset($_POST["btnsubmit"]))	{		
27
-		unset($_POST["btnsubmit"]);		
28
-		$tumble->saveOption($_POST["rich_text"], "rich_text");
29
-		$tumble->saveOption($_POST["urlFriendly"], "rich_text");
26
+	if(isset($_POST["btnsubmit"]))	{
27
+		if (!$tumble->saveOption($_POST["rich_text"], "rich_text")) {
28
+			header("Location: ".$conf->urlGelato."/admin/options.php?error=1&des=".$conf->merror);
29
+			die();
30
+		}
31
+		if (!$tumble->saveOption($_POST["url_friendly"], "url_friendly")) {
32
+			header("Location: ".$conf->urlGelato."/admin/options.php?error=1&des=".$conf->merror);
33
+			die();
34
+		}
35
+		header("Location: ".$conf->urlGelato."/admin/options.php?modified=true");
36
+		die();
30
 	} else {
37
 	} else {
31
 ?>
38
 ?>
32
 	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
39
 	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
92
 							<fieldset>								
99
 							<fieldset>								
93
 								<ul>																	
100
 								<ul>																	
94
 									<li><label for="rich_text"><?=__("Rich text editor:")?></label>
101
 									<li><label for="rich_text"><?=__("Rich text editor:")?></label>
95
-										<select name="rich_text" id="rich_text">										
102
+										<select name="rich_text" id="rich_text">
96
 											<option value="1" <?php if($conf->richText) echo "selected"; ?>><?=__("Active")?></option>
103
 											<option value="1" <?php if($conf->richText) echo "selected"; ?>><?=__("Active")?></option>
97
 											<option value="0" <?php if(!$conf->richText) echo "selected"; ?>><?=__("Deactive")?></option>
104
 											<option value="0" <?php if(!$conf->richText) echo "selected"; ?>><?=__("Deactive")?></option>
98
 										</select>
105
 										</select>
99
 									</li>
106
 									</li>
100
-									<li><label for="rich_text">URL friendly:</label>
107
+									<li><label for="url_friendly">URL friendly:</label>
101
 										<select name="url_friendly" id="url_friendly">
108
 										<select name="url_friendly" id="url_friendly">
102
 											<option value="1" <?php if($conf->urlFriendly) echo "selected"; ?>><?=__("Active")?></option>
109
 											<option value="1" <?php if($conf->urlFriendly) echo "selected"; ?>><?=__("Active")?></option>
103
 											<option value="0" <?php if(!$conf->urlFriendly) echo "selected"; ?>><?=__("Deactive")?></option>
110
 											<option value="0" <?php if(!$conf->urlFriendly) echo "selected"; ?>><?=__("Deactive")?></option>

+ 2 - 4
classes/gelato.class.php View File

35
 	function saveOption($value, $name) {
35
 	function saveOption($value, $name) {
36
 		$sqlStr = "UPDATE ".$this->conf->tablePrefix."options SET val='".$value."' WHERE name='".$name."' LIMIT 1";		
36
 		$sqlStr = "UPDATE ".$this->conf->tablePrefix."options SET val='".$value."' WHERE name='".$name."' LIMIT 1";		
37
 		if ($this->ejecutarConsulta($sqlStr)) {
37
 		if ($this->ejecutarConsulta($sqlStr)) {
38
-			header("Location: ".$this->conf->urlGelato."/admin/options.php?modified=true");
39
-			die();
38
+			return true;
40
 		} else {
39
 		} else {
41
-			header("Location: ".$this->conf->urlGelato."/admin/options.php?error=1&des=".$this->merror);
42
-			die();
40
+			return true;
43
 		}
41
 		}
44
 	}
42
 	}
45
 	
43
 	

BIN
languages/en/lang.mo View File


+ 0 - 13
languages/en/lang.po View File

1
-msgid ""
2
-msgstr ""
3
-"Project-Id-Version: \n"
4
-"POT-Creation-Date: \n"
5
-"PO-Revision-Date: 2007-07-20 00:14-0600\n"
6
-"Last-Translator: Victor De la Rocha <vyk2rr@gmail.com>\n"
7
-"Language-Team: \n"
8
-"MIME-Version: 1.0\n"
9
-"Content-Type: text/plain; charset=iso-8859-1\n"
10
-"Content-Transfer-Encoding: 8bit\n"
11
-
12
-msgid "this is a test."
13
-msgstr ""