| 1 |
<?php
|
| 2 |
// $Id: texy.install,v 1.1.2.1 2008/01/06 12:08:39 havran Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* Implementation of hook_install().
|
| 6 |
*/
|
| 7 |
function texy_install() {
|
| 8 |
$format_exists = db_result(db_query("SELECT COUNT(*) FROM {filter_formats} WHERE name = 'Texy! filter'"));
|
| 9 |
// Add a Texy! input format, if it does not exist. Do this only for the
|
| 10 |
// first install (or if the format has been manually deleted) as there is no
|
| 11 |
// reliable method to identify the format in an uninstall hook or in
|
| 12 |
// subsequent clean installs.
|
| 13 |
if (!$format_exists) {
|
| 14 |
db_query("INSERT INTO {filter_formats} (name, roles, cache) VALUES ('Texy! filter', '', 0)");
|
| 15 |
$format = db_result(db_query("SELECT MAX(format) FROM {filter_formats}"));
|
| 16 |
|
| 17 |
// Enable the Texy! filter.
|
| 18 |
db_query("INSERT INTO {filters} (format, module, delta, weight) VALUES (%d, 'texy', 0, 0)", $format);
|
| 19 |
|
| 20 |
drupal_set_message(t('A !texy input format has been created.', array('!texy' => l('Texy! filter', 'admin/settings/filters/'. $format))));
|
| 21 |
}
|
| 22 |
}
|
| 23 |
|
| 24 |
/**
|
| 25 |
* Implementation of hook_disable().
|
| 26 |
*/
|
| 27 |
function texy_disable() {
|
| 28 |
drupal_set_message(t('The Texy! filter module has been disabled. Please note that any existing content that was using the Texy! filter will now be visible in plain text.'));
|
| 29 |
}
|