| 1 |
<?php |
<?php |
| 2 |
|
|
| 3 |
//$Id: cleanfeeds.module,v 1.3 2006/09/27 18:33:33 kbahey Exp $ |
//$Id: cleanfeeds.module,v 1.4.2.1 2007/02/01 04:42:21 kbahey Exp $ |
| 4 |
|
|
| 5 |
// Copyright 2006 Khalid Baheyeldin http://2bits.com |
// Copyright 2006 Khalid Baheyeldin http://2bits.com |
| 6 |
|
|
| 9 |
function cleanfeeds_help($section) { |
function cleanfeeds_help($section) { |
| 10 |
switch ($section) { |
switch ($section) { |
| 11 |
case 'admin/settings/cleanfeeds': |
case 'admin/settings/cleanfeeds': |
| 12 |
$output = t('Cleans up HTML in feeds.'); |
return t('Cleans up HTML in feeds.'); |
|
break; |
|
| 13 |
} |
} |
|
return $output; |
|
| 14 |
} |
} |
| 15 |
|
|
| 16 |
function cleanfeeds_menu($may_cache) { |
function cleanfeeds_menu($may_cache) { |
| 17 |
$items = array(); |
$items = array(); |
| 18 |
|
|
| 19 |
if ($may_cache) { |
$items['admin/settings/cleanfeeds'] = array( |
| 20 |
$items[] = array( |
'title' => 'Cleanfeeds', |
| 21 |
'path' => 'admin/settings/cleanfeeds', |
'description' => t('Settings of the Cleanfeeds module'), |
| 22 |
'title' => 'Cleanfeeds', |
'page callback' => 'drupal_get_form', |
| 23 |
'description' => t('Settings of the Cleanfeeds module'), |
'page arguments' => array('cleanfeeds_settings'), |
| 24 |
'callback' => 'drupal_get_form', |
'access' => array('administer site configuration'), |
| 25 |
'callback arguments' => array('cleanfeeds_settings'), |
); |
|
'access' => user_access('administer site configuration'), |
|
|
); |
|
|
} |
|
| 26 |
|
|
| 27 |
return $items; |
return $items; |
| 28 |
} |
} |
| 30 |
function cleanfeeds_settings() { |
function cleanfeeds_settings() { |
| 31 |
$group = 'options'; |
$group = 'options'; |
| 32 |
$form[$group] = array( |
$form[$group] = array( |
| 33 |
'#type' => 'fieldset', |
'#type' => 'fieldset', |
| 34 |
'#collapsible' => true, |
'#collapsible' => true, |
| 35 |
); |
); |
| 36 |
foreach(node_get_types() as $type => $name) { |
foreach(node_get_types() as $type => $obj) { |
| 37 |
$form[$group][CLEANFEEDS_NODE . $type] = array( |
$form[$group][CLEANFEEDS_NODE . $type] = array( |
| 38 |
'#type' => 'checkbox', |
'#type' => 'checkbox', |
| 39 |
'#title' => $name, |
'#title' => $obj->name, |
| 40 |
'#return_value' => 1, |
'#return_value' => 1, |
| 41 |
'#default_value' => variable_get(CLEANFEEDS_NODE. $type, 0), |
'#default_value' => variable_get(CLEANFEEDS_NODE. $type, 0), |
| 42 |
); |
); |
| 43 |
} |
} |
| 54 |
break; |
break; |
| 55 |
} |
} |
| 56 |
} |
} |
|
|
|