summaryrefslogtreecommitdiff
path: root/modules/system/system.install
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2007-05-20 16:44:35 +0000
committerDries Buytaert <dries@buytaert.net>2007-05-20 16:44:35 +0000
commit667bf95308cfbaac5929bee70e9ba98fa92ed3db (patch)
tree23e51f2eabbc0cc69847b987f607c84bdbefeb1f /modules/system/system.install
parentd78badccbc51fde2e21d7799a816b1a64d0058b6 (diff)
downloadbrdo-667bf95308cfbaac5929bee70e9ba98fa92ed3db.tar.gz
brdo-667bf95308cfbaac5929bee70e9ba98fa92ed3db.tar.bz2
- Patch #54833 by Steven: added an HTML corrector.
Diffstat (limited to 'modules/system/system.install')
-rw-r--r--modules/system/system.install28
1 files changed, 28 insertions, 0 deletions
diff --git a/modules/system/system.install b/modules/system/system.install
index 7bc70779f..30d4a62d3 100644
--- a/modules/system/system.install
+++ b/modules/system/system.install
@@ -1209,12 +1209,16 @@ function system_install() {
db_query("INSERT INTO {filters} (format, module, delta, weight) VALUES (1, 'filter', 0, 1)");
// Line break filter.
db_query("INSERT INTO {filters} (format, module, delta, weight) VALUES (1, 'filter', 1, 2)");
+ // HTML corrector filter.
+ db_query("INSERT INTO {filters} (format, module, delta, weight) VALUES (1, 'filter', 3, 10)");
// Full HTML:
// URL filter.
db_query("INSERT INTO {filters} (format, module, delta, weight) VALUES (2, 'filter', 2, 0)");
// Line break filter.
db_query("INSERT INTO {filters} (format, module, delta, weight) VALUES (2, 'filter', 1, 1)");
+ // HTML corrector filter.
+ db_query("INSERT INTO {filters} (format, module, delta, weight) VALUES (1, 'filter', 3, 10)");
db_query("INSERT INTO {variable} (name,value) VALUES ('filter_html_1','i:1;')");
@@ -4063,6 +4067,30 @@ function system_update_6017() {
}
/**
+ * Add HTML corrector to HTML formats or replace the old module if it was in use.
+ */
+function system_update_6018() {
+ $ret = array();
+
+ // Disable htmlcorrector.module, if it exists and replace its filter.
+ if (module_exists('htmlcorrector')) {
+ module_disable(array('htmlcorrector'));
+ $ret[] = update_sql("UPDATE {filter_formats} SET module = 'filter', delta = 3 WHERE module = 'htmlcorrector'");
+ $ret[] = t('HTML Corrector module was disabled; this functionality has now been added to core.');
+ return $ret;
+ }
+
+ // Otherwise, find any format with 'HTML' in its name and add the filter at the end.
+ $result = db_query("SELECT format FROM {filter_formats} WHERE name LIKE '%HTML%'");
+ while ($format = db_fetch_object($result)) {
+ $weight = db_result(db_query("SELECT MAX(weight) FROM {filters} WHERE format = %d", $format->format));
+ db_query("INSERT INTO {filters} (format, module, delta, weight) VALUES (%d, '%s', %d, %d)", $format->format, 'filter', 3, max(10, $weight + 1));
+ }
+
+ return $ret;
+}
+
+/**
* @} End of "defgroup updates-5.x-to-6.x"
* The next series of updates should start at 7000.
*/