簡單而簡單。 看看函數aggregator_filter_xss()http://api.drupal.org/api/function/aggregator_filter_xss。
<?php
function aggregator_filter_xss($value) {
return filter_xss($value, preg_split('/\s+|<|>/', variable_get('aggregator_allowed_html_tags', '<a> <b> <br> <dd> <dl> <dt> <em> <i> <li> <ol> <p> <strong> <u> <ul>'), -1, PREG_SPLIT_NO_EMPTY));
}
?>
正如你可以看到有一個名爲aggregator_allowed_html_tags Drupal的變量。
您只需要在某個模塊的設置窗體上對其進行編輯即可。因爲我沒有找到哪個drupal管理頁面允許編輯這個變量,所以我會說沒有。
這裏有您需要爲您的自定義模塊的代碼:
function your_module_settings()
{
$form = array();
// Params para aggregator
$form['aggregator_allowed_html_tags'] = array(
'#type' => 'textarea',
'#title' => t('Core Module Aggregator allowed tags'),
'#default_value' => variable_get('aggregator_allowed_html_tags', '<a> <b> <br> <dd> <dl> <dt> <em> <i> <li> <ol> <p> <strong> <u> <ul>'),
'#required' => TRUE,
'#description' => t('Core Module Aggregator allowed tags'),
);
return system_settings_form($form);
}
function your_module_menu()
{
$items = array();
$items['admin/content/your-module'] = array(
'title' => 'My module settings',
'description' => 'desc',
'page callback' => 'drupal_get_form',
'page arguments' => array('your_module_ pasos'),
'type' => MENU_NORMAL_ITEM,
);
return $items;
}
我希望這是有幫助的。
這就是我想要做的,如果我的問題沒有解決方案 – 2008-12-22 17:53:55