summaryrefslogtreecommitdiff
path: root/modules/taxonomy/taxonomy.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/taxonomy/taxonomy.module')
-rw-r--r--modules/taxonomy/taxonomy.module105
1 files changed, 50 insertions, 55 deletions
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index 0d32a606b..f426f09a1 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -767,68 +767,63 @@ function taxonomy_admin() {
$op = $_POST["op"];
$edit = $_POST["edit"];
- if (user_access("administer taxonomy")) {
- if (empty($op)) {
- $op = arg(2);
- }
+ if (empty($op)) {
+ $op = arg(2);
+ }
- switch ($op) {
- case "add":
- if (arg(3) == "vocabulary") {
- $output .= taxonomy_form_vocabulary();
- }
- else if (arg(3) == "term") {
- $output .= taxonomy_form_term();
- }
- break;
- case "edit":
+ switch ($op) {
+ case "add":
+ if (arg(3) == "vocabulary") {
+ $output .= taxonomy_form_vocabulary();
+ }
+ else if (arg(3) == "term") {
+ $output .= taxonomy_form_term();
+ }
+ break;
+ case "edit":
+ if (arg(3) == "vocabulary") {
+ $output .= taxonomy_form_vocabulary(object2array(taxonomy_get_vocabulary(arg(4))));
+ }
+ else if (arg(3) == "term") {
+ $output .= taxonomy_form_term(object2array(taxonomy_get_term(arg(4))));
+ }
+ break;
+ case "preview":
+ $output .= taxonomy_form(arg(4));
+ break;
+ case "help":
+ $output .= taxonomy_help();
+ break;
+ case t("Delete"):
+ if (!$edit["confirm"]) {
if (arg(3) == "vocabulary") {
- $output .= taxonomy_form_vocabulary(object2array(taxonomy_get_vocabulary(arg(4))));
+ $output .= _taxonomy_confirm_del_vocabulary($edit["vid"]);
}
- else if (arg(3) == "term") {
- $output .= taxonomy_form_term(object2array(taxonomy_get_term(arg(4))));
+ else {
+ $output .= _taxonomy_confirm_del_term($edit["tid"]);
}
break;
- case "preview":
- $output .= taxonomy_form(arg(4));
- break;
- case "help":
- $output .= taxonomy_help();
- break;
- case t("Delete"):
- if (!$edit["confirm"]) {
- if (arg(3) == "vocabulary") {
- $output .= _taxonomy_confirm_del_vocabulary($edit["vid"]);
- }
- else {
- $output .= _taxonomy_confirm_del_term($edit["tid"]);
- }
+ }
+ else {
+ $edit["name"] = 0;
+ // fall through:
+ }
+ case t("Submit"):
+ if (arg(3) == "vocabulary") {
+ taxonomy_save_vocabulary($edit);
+ }
+ else {
+ taxonomy_save_term($edit);
+ if (!$edit["tid"]) {
+ // if INSERT show form again
+ $output .= taxonomy_form_term();
break;
}
- else {
- $edit["name"] = 0;
- // fall through:
- }
- case t("Submit"):
- if (arg(3) == "vocabulary") {
- taxonomy_save_vocabulary($edit);
- }
- else {
- taxonomy_save_term($edit);
- if (!$edit["tid"]) {
- // if INSERT show form again
- $output .= taxonomy_form_term();
- break;
- }
- // else (UPDATE or DELETE) fall through
- }
- // fall through:
- default:
- $output .= taxonomy_overview();
- }
- }
- else {
- $output .= message_access();
+ // else (UPDATE or DELETE) fall through
+ }
+ // fall through:
+ default:
+ $output .= taxonomy_overview();
}
print theme("page", $output);