123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- function php_enable() {
- $format_exists = (bool) db_query_range('SELECT 1 FROM {filter_format} WHERE name = :name', 0, 1, array(':name' => 'PHP code'))->fetchField();
-
-
-
-
- if (!$format_exists) {
- $php_format = array(
- 'format' => 'php_code',
- 'name' => 'PHP code',
-
-
-
- 'weight' => 11,
- 'filters' => array(
-
- 'php_code' => array(
- 'weight' => 0,
- 'status' => 1,
- ),
- ),
- );
- $php_format = (object) $php_format;
- filter_format_save($php_format);
- drupal_set_message(t('A <a href="@php-code">PHP code</a> text format has been created.', array('@php-code' => url('admin/config/content/formats/' . $php_format->format))));
- }
- }
- function php_disable() {
- drupal_set_message(t('The PHP module has been disabled. Any existing content that was using the PHP filter will now be visible in plain text. This might pose a security risk by exposing sensitive information, if any, used in the PHP code.'));
- }
|