Commit e57faf21 authored by Dries's avatar Dries

- Bugfix: fixed problem with changing themes. Didn't apply Al's patch as

  the fix was somewhat simpler.  Fixes bug #2003.

- Bugfix: fixed problem with voting on certain poll pages.  Patch #37 by Al.

- Improvement: removed stupid descriptions from profile module.
parent 25081b21
......@@ -873,8 +873,8 @@ function form_hidden($name, $value) {
return "<input type=\"hidden\" name=\"edit[$name]\" value=\"". check_form($value) ."\" />\n";
}
function form_submit($value) {
return "<input type=\"submit\" class=\"form-submit\" name=\"op\" value=\"". check_form($value) ."\" />\n";
function form_submit($value, $name = "op") {
return "<input type=\"submit\" class=\"form-submit\" name=\"$name\" value=\"". check_form($value) ."\" />\n";
}
function form_weight($title = NULL, $name = "weight", $value = 0, $delta = 10, $description = 0, $extra = 0) {
......
......@@ -220,7 +220,6 @@ function poll_node($field) {
function poll_page() {
theme("header");
$result = db_query("SELECT n.nid, n.title, p.active, SUM(c.chvotes) AS votes FROM node n LEFT JOIN poll p ON n.nid=p.nid LEFT JOIN poll_choices c ON n.nid=c.nid WHERE type = 'poll' AND status = '1' AND moderate = '0' GROUP BY n.nid, n.title, p.active, n.created ORDER BY n.created DESC");
$output = "<ul>";
......@@ -269,7 +268,7 @@ function poll_view_voting(&$node, $main, $block, $links) {
}
}
}
$output .= "</div>". form_submit(t("Vote")) ."</div>";
$output .= "</div>". form_submit(t("Vote"), "vote") ."</div>";
$output .= $block ? "<div class=\"links\">". theme("links", $links) ."</div>" : "";
$output .= "</form></div>";
......
......@@ -220,7 +220,6 @@ function poll_node($field) {
function poll_page() {
theme("header");
$result = db_query("SELECT n.nid, n.title, p.active, SUM(c.chvotes) AS votes FROM node n LEFT JOIN poll p ON n.nid=p.nid LEFT JOIN poll_choices c ON n.nid=c.nid WHERE type = 'poll' AND status = '1' AND moderate = '0' GROUP BY n.nid, n.title, p.active, n.created ORDER BY n.created DESC");
$output = "<ul>";
......@@ -269,7 +268,7 @@ function poll_view_voting(&$node, $main, $block, $links) {
}
}
}
$output .= "</div>". form_submit(t("Vote")) ."</div>";
$output .= "</div>". form_submit(t("Vote"), "vote") ."</div>";
$output .= $block ? "<div class=\"links\">". theme("links", $links) ."</div>" : "";
$output .= "</form></div>";
......
......@@ -9,21 +9,21 @@ function _profile_init() {
*/
$GLOBALS["profile_fields"] = array(
"address" => array("textfield", t("Address"), "", 64, 64, t("Your address: street and number.")),
"city" => array("textfield", t("City"), "", 64, 64, t("Your city.")),
"address" => array("textfield", t("Address"), "", 64, 64, ""),
"city" => array("textfield", t("City"), "", 64, 64, ""),
"state" => array("textfield", t("State, province or region"), "", 64, 64, ""),
"zip" => array("textfield", t("Zip or postal code"), "", 7, 10, ""),
"country" => array("textfield", t("Country"), "", 64, 64, ""),
"birthday" => array("", t("Birthday"), ""),
"gender" => array("select", t("Gender"), "", array(0 => "-", "m" => t("male"), "f" => t("female")), "", 0, 0),
"job" => array("textfield", t("Job title"), "", 64, 64, t("Your job title or position.")),
"job" => array("textfield", t("Job title"), "", 64, 64, ""),
"icq" => array("textfield", t("ICQ messenger ID"), "", 12, 12, ""),
"msn" => array("textfield", t("MSN messenger ID"), "", 64, 64, ""),
"yahoo" => array("textfield", t("Yahoo messenger ID"), "", 64, 64, ""),
"aim" => array("textfield", t("AIM messenger ID"), "", 64, 64, ""),
"homepage" => array("textfield", t("URL of homepage"), "", 64, 64, t("Make sure you enter a fully qualified URL: remember to include \"http://\".")),
"biography" => array("textarea", t("Biography"), "", 64, 4, ""),
"interests" => array("textarea", t("Interests"), "", 64, 4, t("What you like.")),
"interests" => array("textarea", t("Interests"), "", 64, 4, ""),
"publickey" => array("textarea", t("Public key"), "", 64, 4, ""),
"avatar" => array("", t("Avatar or picture"), t("Your virtual face or picture. Maximum dimensions are %dimensions and the maximum size is %size kB.", array("%dimensions" => variable_get("profile_avatar_dimensions", "85x85"), "%size" => variable_get("profile_avatar_file_size", "30"))))
);
......
......@@ -9,21 +9,21 @@ function _profile_init() {
*/
$GLOBALS["profile_fields"] = array(
"address" => array("textfield", t("Address"), "", 64, 64, t("Your address: street and number.")),
"city" => array("textfield", t("City"), "", 64, 64, t("Your city.")),
"address" => array("textfield", t("Address"), "", 64, 64, ""),
"city" => array("textfield", t("City"), "", 64, 64, ""),
"state" => array("textfield", t("State, province or region"), "", 64, 64, ""),
"zip" => array("textfield", t("Zip or postal code"), "", 7, 10, ""),
"country" => array("textfield", t("Country"), "", 64, 64, ""),
"birthday" => array("", t("Birthday"), ""),
"gender" => array("select", t("Gender"), "", array(0 => "-", "m" => t("male"), "f" => t("female")), "", 0, 0),
"job" => array("textfield", t("Job title"), "", 64, 64, t("Your job title or position.")),
"job" => array("textfield", t("Job title"), "", 64, 64, ""),
"icq" => array("textfield", t("ICQ messenger ID"), "", 12, 12, ""),
"msn" => array("textfield", t("MSN messenger ID"), "", 64, 64, ""),
"yahoo" => array("textfield", t("Yahoo messenger ID"), "", 64, 64, ""),
"aim" => array("textfield", t("AIM messenger ID"), "", 64, 64, ""),
"homepage" => array("textfield", t("URL of homepage"), "", 64, 64, t("Make sure you enter a fully qualified URL: remember to include \"http://\".")),
"biography" => array("textarea", t("Biography"), "", 64, 4, ""),
"interests" => array("textarea", t("Interests"), "", 64, 4, t("What you like.")),
"interests" => array("textarea", t("Interests"), "", 64, 4, ""),
"publickey" => array("textarea", t("Public key"), "", 64, 4, ""),
"avatar" => array("", t("Avatar or picture"), t("Your virtual face or picture. Maximum dimensions are %dimensions and the maximum size is %size kB.", array("%dimensions" => variable_get("profile_avatar_dimensions", "85x85"), "%size" => variable_get("profile_avatar_file_size", "30"))))
);
......
......@@ -255,6 +255,7 @@ function taxonomy_del_term($tid) {
db_query("DELETE FROM term_node WHERE tid = %d", $tid);
module_invoke_all("taxonomy", "delete", "term", $term);
cache_clear_all();
return t("deleted term '%name'.", array("%name" => $term->name));
......@@ -334,6 +335,7 @@ function taxonomy_get_vocabularies($type = '', $key = "vid") {
while ($voc = db_fetch_object($result)) {
$vocabularies[$voc->$key] = $voc;
}
return $vocabularies;
}
......
......@@ -255,6 +255,7 @@ function taxonomy_del_term($tid) {
db_query("DELETE FROM term_node WHERE tid = %d", $tid);
module_invoke_all("taxonomy", "delete", "term", $term);
cache_clear_all();
return t("deleted term '%name'.", array("%name" => $term->name));
......@@ -334,6 +335,7 @@ function taxonomy_get_vocabularies($type = '', $key = "vid") {
while ($voc = db_fetch_object($result)) {
$vocabularies[$voc->$key] = $voc;
}
return $vocabularies;
}
......
......@@ -1164,7 +1164,7 @@ function user_page() {
case t("Save user information"):
case "edit":
$output = user_edit($edit);
$theme = theme_init();
$GLOBALS["theme"] = theme_init();
theme("header");
theme("box", t("User account"), user_menu());
theme("box", t("Edit user information"), $output);
......
......@@ -1164,7 +1164,7 @@ function user_page() {
case t("Save user information"):
case "edit":
$output = user_edit($edit);
$theme = theme_init();
$GLOBALS["theme"] = theme_init();
theme("header");
theme("box", t("User account"), user_menu());
theme("box", t("Edit user information"), $output);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment