diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/archive.module | 5 | ||||
-rw-r--r-- | modules/archive/archive.module | 5 | ||||
-rw-r--r-- | modules/block.module | 8 | ||||
-rw-r--r-- | modules/block/block.module | 8 | ||||
-rw-r--r-- | modules/node.module | 16 | ||||
-rw-r--r-- | modules/node/node.module | 16 | ||||
-rw-r--r-- | modules/system.module | 26 | ||||
-rw-r--r-- | modules/system/system.module | 26 |
8 files changed, 72 insertions, 38 deletions
diff --git a/modules/archive.module b/modules/archive.module index 1d711a9a8..73d070676 100644 --- a/modules/archive.module +++ b/modules/archive.module @@ -146,9 +146,8 @@ function archive_page() { $edit["day"] = date("d", $date); } - $start = str_replace("<b>:</b><br />", " ", form_select("", "year", ($edit["year"] ? $edit["year"] : date("Y")), $years) . form_select("", "month", ($edit["month"] ? $edit["month"] : date("m")), $months) . form_select("", "day", ($edit["day"] ? $edit["day"] : date("d")), $days) . form_submit(t("Show"))); - $start = str_replace("<p>", "", $start); - $start = str_replace("</p>\n", " ", $start); + $start = form_select("", "year", ($edit["year"] ? $edit["year"] : date("Y")), $years) . form_select("", "month", ($edit["month"] ? $edit["month"] : date("m")), $months) . form_select("", "day", ($edit["day"] ? $edit["day"] : date("d")), $days) . form_submit(t("Show")); + $start = ereg_replace("<[/]?p>", "", $start); $theme->box(t("Archives"), form($start)); diff --git a/modules/archive/archive.module b/modules/archive/archive.module index 1d711a9a8..73d070676 100644 --- a/modules/archive/archive.module +++ b/modules/archive/archive.module @@ -146,9 +146,8 @@ function archive_page() { $edit["day"] = date("d", $date); } - $start = str_replace("<b>:</b><br />", " ", form_select("", "year", ($edit["year"] ? $edit["year"] : date("Y")), $years) . form_select("", "month", ($edit["month"] ? $edit["month"] : date("m")), $months) . form_select("", "day", ($edit["day"] ? $edit["day"] : date("d")), $days) . form_submit(t("Show"))); - $start = str_replace("<p>", "", $start); - $start = str_replace("</p>\n", " ", $start); + $start = form_select("", "year", ($edit["year"] ? $edit["year"] : date("Y")), $years) . form_select("", "month", ($edit["month"] ? $edit["month"] : date("m")), $months) . form_select("", "day", ($edit["day"] ? $edit["day"] : date("d")), $days) . form_submit(t("Show")); + $start = ereg_replace("<[/]?p>", "", $start); $theme->box(t("Archives"), form($start)); diff --git a/modules/block.module b/modules/block.module index 60ea18e96..b74d2c2a1 100644 --- a/modules/block.module +++ b/modules/block.module @@ -61,7 +61,7 @@ function block_block() { } function block_admin_save($edit) { - foreach ($edit as $key=>$value) { + foreach ($edit as $key => $value) { db_query("UPDATE blocks SET region = '%s', status = '%d', custom = '%d', path = '%s', weight = '%d' WHERE name = '%s'", $value["region"], $value["status"], $value["custom"], $value["path"], $value["weight"], $key); } } @@ -71,7 +71,7 @@ function block_admin_display() { // Generate output: $output = "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n"; - $output .= "<tr><th>block</th><th>module</th><th>status</th><th>custom</th><th>weight</th><th>region</th><th>path</th><th colspan=\"2\">operations</th></tr>\n"; + $output .= "<tr><th>block</th><th>module</th><th>enabled</th><th>custom</th><th>weight</th><th>region</th><th>path</th><th colspan=\"2\">operations</th></tr>\n"; while ($block = db_fetch_object($result)) { $weights = array(0 => 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10); @@ -80,8 +80,8 @@ function block_admin_display() { //$output .= '<td>'. la($block->name, array("mod" => "block", "op" => "view", "id" => $block->delta), t("View the block details")) .'</td>'; $output .= "<td>$block->name</td>"; $output .= '<td>'. (module_hook($block->module, "admin") ? la($block->module, array("mod" => $block->module), "Administer module") : $block->module) .'</td>'; - $output .= '<td>'. form_select(NULL, "$block->name][status", $block->status, array("disabled", "enabled")) .'</td>'; - $output .= '<td>'. form_select(NULL, "$block->name][custom", $block->custom, array("disabled", "enabled")) .'</td>'; + $output .= '<td align="center">'. form_checkbox(NULL, "$block->name][status", 1, $block->status) .'</td>'; + $output .= '<td align="center">'. form_checkbox(NULL, "$block->name][custom", 1, $block->custom) .'</td>'; $output .= '<td>'. form_select(NULL, "$block->name][weight", $block->weight, $weights) .'</td>'; $output .= '<td>'. form_select(NULL, "$block->name][region", $block->region, array("left", "right")) .'</td>'; $output .= '<td>'. form_textfield(NULL, "$block->name][path", $block->path, 10, 255) .'</td>'; diff --git a/modules/block/block.module b/modules/block/block.module index 60ea18e96..b74d2c2a1 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -61,7 +61,7 @@ function block_block() { } function block_admin_save($edit) { - foreach ($edit as $key=>$value) { + foreach ($edit as $key => $value) { db_query("UPDATE blocks SET region = '%s', status = '%d', custom = '%d', path = '%s', weight = '%d' WHERE name = '%s'", $value["region"], $value["status"], $value["custom"], $value["path"], $value["weight"], $key); } } @@ -71,7 +71,7 @@ function block_admin_display() { // Generate output: $output = "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n"; - $output .= "<tr><th>block</th><th>module</th><th>status</th><th>custom</th><th>weight</th><th>region</th><th>path</th><th colspan=\"2\">operations</th></tr>\n"; + $output .= "<tr><th>block</th><th>module</th><th>enabled</th><th>custom</th><th>weight</th><th>region</th><th>path</th><th colspan=\"2\">operations</th></tr>\n"; while ($block = db_fetch_object($result)) { $weights = array(0 => 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10); @@ -80,8 +80,8 @@ function block_admin_display() { //$output .= '<td>'. la($block->name, array("mod" => "block", "op" => "view", "id" => $block->delta), t("View the block details")) .'</td>'; $output .= "<td>$block->name</td>"; $output .= '<td>'. (module_hook($block->module, "admin") ? la($block->module, array("mod" => $block->module), "Administer module") : $block->module) .'</td>'; - $output .= '<td>'. form_select(NULL, "$block->name][status", $block->status, array("disabled", "enabled")) .'</td>'; - $output .= '<td>'. form_select(NULL, "$block->name][custom", $block->custom, array("disabled", "enabled")) .'</td>'; + $output .= '<td align="center">'. form_checkbox(NULL, "$block->name][status", 1, $block->status) .'</td>'; + $output .= '<td align="center">'. form_checkbox(NULL, "$block->name][custom", 1, $block->custom) .'</td>'; $output .= '<td>'. form_select(NULL, "$block->name][weight", $block->weight, $weights) .'</td>'; $output .= '<td>'. form_select(NULL, "$block->name][region", $block->region, array("left", "right")) .'</td>'; $output .= '<td>'. form_textfield(NULL, "$block->name][path", $block->path, 10, 255) .'</td>'; diff --git a/modules/node.module b/modules/node.module index 92b882f76..5521cd43a 100644 --- a/modules/node.module +++ b/modules/node.module @@ -416,7 +416,7 @@ function node_admin_settings($edit = array()) { ** Reset the configuration options to their default value: */ - foreach ($edit as $name=>$value) { + foreach ($edit as $name => $value) { variable_del($name); } } @@ -460,7 +460,7 @@ function node_admin_edit($node) { $output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">"; $output .= " <tr><th>older revisions</th><th colspan=\"3\">operations</th></tr>"; foreach ($node->revisions as $key => $revision) { - $output .= " <tr><td>". t("revision #%r revised by %u on %d", array("%r" => $key, "%u" => format_name(user_load(array("uid" => $revision["uid"]))), "%d" => format_date($revision["timestamp"], "small"))) . ($revision["history"] ? "<br /><small>". $revision["history"] ."</small>" : "") ."</td><td>". l(t("view revision"), array("id" => $node->nid, "revision" =>$key)) ."</td><td>". la(t("rollback revision"), array("mod" => "node", "op" => "rollback+revision", "id" => $node->nid, "revision" => $key)) ."</td><td>". la(t("delete revision"), array("mod" => "node", "op" => "delete+revision", "id" => $node->nid, "revision" => $key)) ."</td></tr>"; + $output .= " <tr><td>". t("revision #%r revised by %u on %d", array("%r" => $key, "%u" => format_name(user_load(array("uid" => $revision["uid"]))), "%d" => format_date($revision["timestamp"], "small"))) . ($revision["history"] ? "<br /><small>". $revision["history"] ."</small>" : "") ."</td><td>". l(t("view revision"), array("id" => $node->nid, "revision" => $key)) ."</td><td>". la(t("rollback revision"), array("mod" => "node", "op" => "rollback+revision", "id" => $node->nid, "revision" => $key)) ."</td><td>". la(t("delete revision"), array("mod" => "node", "op" => "delete+revision", "id" => $node->nid, "revision" => $key)) ."</td></tr>"; } $output .= "</table>"; } @@ -1031,7 +1031,9 @@ function node_submit($node) { ** Update terms of the node */ - taxonomy_node_save($nid, $node->taxonomy); + if (function_exists("taxonomy_node_save")) { + taxonomy_node_save($nid, $node->taxonomy); + } watchdog("special", "$node->type: updated '$node->title'"); $output = t("The node has been updated."); @@ -1076,7 +1078,9 @@ function node_submit($node) { ** Insert terms of the node */ - taxonomy_node_save($nid, $node->taxonomy); + if (function_exists("taxonomy_node_save")) { + taxonomy_node_save($nid, $node->taxonomy); + } watchdog("special", "$node->type: added '$node->title'"); $output = t("Thanks for your submission."); @@ -1138,7 +1142,9 @@ function node_delete($edit) { ** Delete any taxonomy terms */ - taxonomy_node_delete($node->nid); + if (function_exists("taxonomy_node_delete")) { + taxonomy_node_delete($nid, $node->taxonomy); + } /* ** Call the node specific callback (if any): diff --git a/modules/node/node.module b/modules/node/node.module index 92b882f76..5521cd43a 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -416,7 +416,7 @@ function node_admin_settings($edit = array()) { ** Reset the configuration options to their default value: */ - foreach ($edit as $name=>$value) { + foreach ($edit as $name => $value) { variable_del($name); } } @@ -460,7 +460,7 @@ function node_admin_edit($node) { $output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">"; $output .= " <tr><th>older revisions</th><th colspan=\"3\">operations</th></tr>"; foreach ($node->revisions as $key => $revision) { - $output .= " <tr><td>". t("revision #%r revised by %u on %d", array("%r" => $key, "%u" => format_name(user_load(array("uid" => $revision["uid"]))), "%d" => format_date($revision["timestamp"], "small"))) . ($revision["history"] ? "<br /><small>". $revision["history"] ."</small>" : "") ."</td><td>". l(t("view revision"), array("id" => $node->nid, "revision" =>$key)) ."</td><td>". la(t("rollback revision"), array("mod" => "node", "op" => "rollback+revision", "id" => $node->nid, "revision" => $key)) ."</td><td>". la(t("delete revision"), array("mod" => "node", "op" => "delete+revision", "id" => $node->nid, "revision" => $key)) ."</td></tr>"; + $output .= " <tr><td>". t("revision #%r revised by %u on %d", array("%r" => $key, "%u" => format_name(user_load(array("uid" => $revision["uid"]))), "%d" => format_date($revision["timestamp"], "small"))) . ($revision["history"] ? "<br /><small>". $revision["history"] ."</small>" : "") ."</td><td>". l(t("view revision"), array("id" => $node->nid, "revision" => $key)) ."</td><td>". la(t("rollback revision"), array("mod" => "node", "op" => "rollback+revision", "id" => $node->nid, "revision" => $key)) ."</td><td>". la(t("delete revision"), array("mod" => "node", "op" => "delete+revision", "id" => $node->nid, "revision" => $key)) ."</td></tr>"; } $output .= "</table>"; } @@ -1031,7 +1031,9 @@ function node_submit($node) { ** Update terms of the node */ - taxonomy_node_save($nid, $node->taxonomy); + if (function_exists("taxonomy_node_save")) { + taxonomy_node_save($nid, $node->taxonomy); + } watchdog("special", "$node->type: updated '$node->title'"); $output = t("The node has been updated."); @@ -1076,7 +1078,9 @@ function node_submit($node) { ** Insert terms of the node */ - taxonomy_node_save($nid, $node->taxonomy); + if (function_exists("taxonomy_node_save")) { + taxonomy_node_save($nid, $node->taxonomy); + } watchdog("special", "$node->type: added '$node->title'"); $output = t("Thanks for your submission."); @@ -1138,7 +1142,9 @@ function node_delete($edit) { ** Delete any taxonomy terms */ - taxonomy_node_delete($node->nid); + if (function_exists("taxonomy_node_delete")) { + taxonomy_node_delete($nid, $node->taxonomy); + } /* ** Call the node specific callback (if any): diff --git a/modules/system.module b/modules/system.module index 12e4360e2..f49cf36f5 100644 --- a/modules/system.module +++ b/modules/system.module @@ -78,7 +78,7 @@ function system_view_options() { // layout settings: $output .= "<h3>Layout settings</h3>\n"; - foreach (theme_list() as $key=>$value) $options .= "<option value=\"$key\"". (variable_get("theme_default", 0) == $key ? " selected=\"selected\"" : "") .">$key</option>\n"; + foreach (theme_list() as $key => $value) $options .= "<option value=\"$key\"". (variable_get("theme_default", 0) == $key ? " selected=\"selected\"" : "") .">$key</option>\n"; $output .= form_item("Default theme", "<select name=\"edit[theme_default]\">$options</select>", "The default theme as seen by visitors or anonymous users."); $output .= "<hr />\n"; @@ -107,12 +107,12 @@ function system_view_filters() { } function system_save($edit = array()) { - foreach ($edit as $name=>$value) variable_set($name, $value); + foreach ($edit as $name => $value) variable_set($name, $value); return "the configuration options have been saved."; } function system_default($edit = array()) { - foreach ($edit as $name=>$value) variable_del($name); + foreach ($edit as $name => $value) variable_del($name); return "the configuration options have been reset to their default values."; } @@ -163,9 +163,15 @@ function system_modules() { $required = array("user", "drupal", "system", "watchdog"); $output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n"; - $output .= " <tr><th>module</th><th>description</th><th>status</th><th colspan=\"2\">operations</th></tr>\n"; + $output .= "<tr><th>module</th><th>description</th><th>enabled</th><th colspan=\"2\">operations</th></tr>\n"; foreach ($modules as $name => $module) { - $output .= " <tr><td>$name</td><td>". check_output(module_invoke($name, "system", "description")) ."</td><td>". (in_array($name, $required) ? "Enabled" : form_select("", "status][$name", $module["status"], array(t("Disabled"), t("Enabled")))) ."</td><td>". (module_hook($name, "page") ? lm(t("view"), array("mod" => $name)) : " ") ."</td><td>". (module_hook($name, "admin") ? la(t("admin"), array("mod" => $name)) : " ") ."</td></tr>\n"; + $output .= "<tr>"; + $output .= "<td>$name</td>"; + $output .= "<td>". check_output(module_invoke($name, "system", "description")) ."</td>"; + $output .= "<td align=\"center\">". (in_array($name, $required) ? "Enabled" : form_checkbox("", "status][$name", 1, $module["status"])) ."</td>"; + $output .= "<td>". (module_hook($name, "page") ? lm(t("view"), array("mod" => $name)) : " ") ."</td>"; + $output .= "<td>". (module_hook($name, "admin") ? la(t("admin"), array("mod" => $name)) : " ") ."</td>"; + $output .= "</tr>\n"; if (!in_array($name, $required)) { db_query("INSERT INTO system SET name = '$name', type = 'module', filename = '$module[filename]', status = '$module[status]'"); } @@ -229,9 +235,15 @@ function system_themes() { db_query("DELETE FROM system WHERE type = 'theme'"); $output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n"; - $output .= " <tr><th>theme</th><th>name</th><th>description</th><th>author</th><th>status</th></tr>\n"; + $output .= "<tr><th>theme</th><th>name</th><th>description</th><th>author</th><th>enabled</th></tr>\n"; foreach ($themes as $name => $theme) { - $output .= " <tr><td>$name</td><td>$theme->displayname</td><td>". form_textfield("", "$name][description", $theme->description, 40, 255)."</td><td>$theme->author</td><td>". form_select("", "$name][status", $theme->status, array(t("Disabled"), t("Enabled"))) ."</td></tr>\n"; + $output .= "<tr>"; + $output .= "<td>$name</td>"; + $output .= "<td>$theme->displayname</td>"; + $output .= "<td>". form_textfield("", "$name][description", $theme->description, 40, 255)."</td>"; + $output .= "<td>$theme->author</td>"; + $output .= "<td align=\"center\">". form_checkbox("", "$name][status", 1, $theme->status) ."</td>"; + $output .= "</tr>\n"; db_query("INSERT INTO system SET name = '$name', type = 'theme', filename = '$theme->filename', status = '$theme->status', description = '$theme->description'"); } $output .= "</table><br />\n"; diff --git a/modules/system/system.module b/modules/system/system.module index 12e4360e2..f49cf36f5 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -78,7 +78,7 @@ function system_view_options() { // layout settings: $output .= "<h3>Layout settings</h3>\n"; - foreach (theme_list() as $key=>$value) $options .= "<option value=\"$key\"". (variable_get("theme_default", 0) == $key ? " selected=\"selected\"" : "") .">$key</option>\n"; + foreach (theme_list() as $key => $value) $options .= "<option value=\"$key\"". (variable_get("theme_default", 0) == $key ? " selected=\"selected\"" : "") .">$key</option>\n"; $output .= form_item("Default theme", "<select name=\"edit[theme_default]\">$options</select>", "The default theme as seen by visitors or anonymous users."); $output .= "<hr />\n"; @@ -107,12 +107,12 @@ function system_view_filters() { } function system_save($edit = array()) { - foreach ($edit as $name=>$value) variable_set($name, $value); + foreach ($edit as $name => $value) variable_set($name, $value); return "the configuration options have been saved."; } function system_default($edit = array()) { - foreach ($edit as $name=>$value) variable_del($name); + foreach ($edit as $name => $value) variable_del($name); return "the configuration options have been reset to their default values."; } @@ -163,9 +163,15 @@ function system_modules() { $required = array("user", "drupal", "system", "watchdog"); $output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n"; - $output .= " <tr><th>module</th><th>description</th><th>status</th><th colspan=\"2\">operations</th></tr>\n"; + $output .= "<tr><th>module</th><th>description</th><th>enabled</th><th colspan=\"2\">operations</th></tr>\n"; foreach ($modules as $name => $module) { - $output .= " <tr><td>$name</td><td>". check_output(module_invoke($name, "system", "description")) ."</td><td>". (in_array($name, $required) ? "Enabled" : form_select("", "status][$name", $module["status"], array(t("Disabled"), t("Enabled")))) ."</td><td>". (module_hook($name, "page") ? lm(t("view"), array("mod" => $name)) : " ") ."</td><td>". (module_hook($name, "admin") ? la(t("admin"), array("mod" => $name)) : " ") ."</td></tr>\n"; + $output .= "<tr>"; + $output .= "<td>$name</td>"; + $output .= "<td>". check_output(module_invoke($name, "system", "description")) ."</td>"; + $output .= "<td align=\"center\">". (in_array($name, $required) ? "Enabled" : form_checkbox("", "status][$name", 1, $module["status"])) ."</td>"; + $output .= "<td>". (module_hook($name, "page") ? lm(t("view"), array("mod" => $name)) : " ") ."</td>"; + $output .= "<td>". (module_hook($name, "admin") ? la(t("admin"), array("mod" => $name)) : " ") ."</td>"; + $output .= "</tr>\n"; if (!in_array($name, $required)) { db_query("INSERT INTO system SET name = '$name', type = 'module', filename = '$module[filename]', status = '$module[status]'"); } @@ -229,9 +235,15 @@ function system_themes() { db_query("DELETE FROM system WHERE type = 'theme'"); $output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n"; - $output .= " <tr><th>theme</th><th>name</th><th>description</th><th>author</th><th>status</th></tr>\n"; + $output .= "<tr><th>theme</th><th>name</th><th>description</th><th>author</th><th>enabled</th></tr>\n"; foreach ($themes as $name => $theme) { - $output .= " <tr><td>$name</td><td>$theme->displayname</td><td>". form_textfield("", "$name][description", $theme->description, 40, 255)."</td><td>$theme->author</td><td>". form_select("", "$name][status", $theme->status, array(t("Disabled"), t("Enabled"))) ."</td></tr>\n"; + $output .= "<tr>"; + $output .= "<td>$name</td>"; + $output .= "<td>$theme->displayname</td>"; + $output .= "<td>". form_textfield("", "$name][description", $theme->description, 40, 255)."</td>"; + $output .= "<td>$theme->author</td>"; + $output .= "<td align=\"center\">". form_checkbox("", "$name][status", 1, $theme->status) ."</td>"; + $output .= "</tr>\n"; db_query("INSERT INTO system SET name = '$name', type = 'theme', filename = '$theme->filename', status = '$theme->status', description = '$theme->description'"); } $output .= "</table><br />\n"; |