Fixed bug on options

master
pecesama 2007-07-20 23:36:39 +00:00
parent fda0b65799
commit 2442496087
4 changed files with 15 additions and 23 deletions

View File

@ -23,10 +23,17 @@ $conf = new configuration();
if ($user->isAdmin()) {
if(isset($_POST["btnsubmit"])) {
unset($_POST["btnsubmit"]);
$tumble->saveOption($_POST["rich_text"], "rich_text");
$tumble->saveOption($_POST["urlFriendly"], "rich_text");
if(isset($_POST["btnsubmit"])) {
if (!$tumble->saveOption($_POST["rich_text"], "rich_text")) {
header("Location: ".$conf->urlGelato."/admin/options.php?error=1&des=".$conf->merror);
die();
}
if (!$tumble->saveOption($_POST["url_friendly"], "url_friendly")) {
header("Location: ".$conf->urlGelato."/admin/options.php?error=1&des=".$conf->merror);
die();
}
header("Location: ".$conf->urlGelato."/admin/options.php?modified=true");
die();
} else {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -92,12 +99,12 @@ if ($user->isAdmin()) {
<fieldset>
<ul>
<li><label for="rich_text"><?=__("Rich text editor:")?></label>
<select name="rich_text" id="rich_text">
<select name="rich_text" id="rich_text">
<option value="1" <?php if($conf->richText) echo "selected"; ?>><?=__("Active")?></option>
<option value="0" <?php if(!$conf->richText) echo "selected"; ?>><?=__("Deactive")?></option>
</select>
</li>
<li><label for="rich_text">URL friendly:</label>
<li><label for="url_friendly">URL friendly:</label>
<select name="url_friendly" id="url_friendly">
<option value="1" <?php if($conf->urlFriendly) echo "selected"; ?>><?=__("Active")?></option>
<option value="0" <?php if(!$conf->urlFriendly) echo "selected"; ?>><?=__("Deactive")?></option>

View File

@ -35,11 +35,9 @@ class gelato extends Conexion_Mysql {
function saveOption($value, $name) {
$sqlStr = "UPDATE ".$this->conf->tablePrefix."options SET val='".$value."' WHERE name='".$name."' LIMIT 1";
if ($this->ejecutarConsulta($sqlStr)) {
header("Location: ".$this->conf->urlGelato."/admin/options.php?modified=true");
die();
return true;
} else {
header("Location: ".$this->conf->urlGelato."/admin/options.php?error=1&des=".$this->merror);
die();
return true;
}
}

Binary file not shown.

View File

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