| Versionen | |
|---|---|
| drupal6 – drupal7 | php_filter($op, $delta = 0, $format = -1, $text = '') |
Implementation of hook_filter(). Contains a basic PHP evaluator.
Executes PHP code. Use with care.
modules/
<?php
function php_filter($op, $delta = 0, $format = -1, $text = '') {
switch ($op) {
case 'list':
return array(0 => t('PHP evaluator'));
case 'no cache':
// No caching for the PHP evaluator.
return $delta == 0;
case 'description':
return t('Executes a piece of PHP code. The usage of this filter should be restricted to administrators only!');
case 'process':
return drupal_eval($text);
default:
return $text;
}
}
?>
Kommentare
Kommentar hinzufügen