source: sipes/cord/modules/php/php.install @ 8a8efa8

stableversion-3.0
Last change on this file since 8a8efa8 was b354002, checked in by José Gregorio Puentes <jpuentes@…>, 8 años ago

se agrego el directorio del cord

  • Propiedad mode establecida a 100755
File size: 1.2 KB
Línea 
1<?php
2
3/**
4 * Implementation of hook_install().
5 */
6function php_install() {
7  $format_exists = db_result(db_query("SELECT COUNT(*) FROM {filter_formats} WHERE name = 'PHP code'"));
8  // Add a PHP code input format, if it does not exist. Do this only for the
9  // first install (or if the format has been manually deleted) as there is no
10  // reliable method to identify the format in an uninstall hook or in
11  // subsequent clean installs.
12  if (!$format_exists) {
13    db_query("INSERT INTO {filter_formats} (name, roles, cache) VALUES ('PHP code', '', 0)");
14    $format = db_result(db_query("SELECT MAX(format) FROM {filter_formats}"));
15
16    // Enable the PHP evaluator filter.
17    db_query("INSERT INTO {filters} (format, module, delta, weight) VALUES (%d, 'php', 0, 0)", $format);
18
19    drupal_set_message(t('A !php-code input format has been created.', array('!php-code' => l('PHP code', 'admin/settings/filters/'. $format))));
20  }
21}
22
23/**
24 * Implementation of hook_disable().
25 */
26function php_disable() {
27  drupal_set_message(t('The PHP module has been disabled. Please note that 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.'));
28}
Nota: Vea TracBrowser para ayuda de uso del navegador del repositorio.