/[drupal]/contributions/modules/cleanfeeds/cleanfeeds.module
ViewVC logotype

Contents of /contributions/modules/cleanfeeds/cleanfeeds.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.6 - (show annotations) (download) (as text)
Sun Sep 28 19:59:57 2008 UTC (13 months, 4 weeks ago) by kbahey
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +2 -2 lines
File MIME type: text/x-php
Function signature is wrong, hook_menu() no longer takes arguments.
1 <?php
2
3 //$Id: cleanfeeds.module,v 1.5 2008/09/28 01:06:31 kbahey Exp $
4
5 // Copyright 2006 Khalid Baheyeldin http://2bits.com
6
7 define('CLEANFEEDS_NODE', 'cleanfeeds_node_');
8
9 function cleanfeeds_help($section) {
10 switch ($section) {
11 case 'admin/settings/cleanfeeds':
12 return t('Cleans up HTML in feeds.');
13 }
14 }
15
16 function cleanfeeds_menu() {
17 $items = array();
18
19 $items['admin/settings/cleanfeeds'] = array(
20 'title' => 'Cleanfeeds',
21 'description' => t('Settings of the Cleanfeeds module'),
22 'page callback' => 'drupal_get_form',
23 'page arguments' => array('cleanfeeds_settings'),
24 'access' => array('administer site configuration'),
25 );
26
27 return $items;
28 }
29
30 function cleanfeeds_settings() {
31 $group = 'options';
32 $form[$group] = array(
33 '#type' => 'fieldset',
34 '#collapsible' => true,
35 );
36 foreach(node_get_types() as $type => $obj) {
37 $form[$group][CLEANFEEDS_NODE . $type] = array(
38 '#type' => 'checkbox',
39 '#title' => $obj->name,
40 '#return_value' => 1,
41 '#default_value' => variable_get(CLEANFEEDS_NODE. $type, 0),
42 );
43 }
44 return system_settings_form($form);
45 }
46
47 function cleanfeeds_nodeapi(&$node, $op, $teaser, $page) {
48 switch($op) {
49 case 'rss item':
50 if (variable_get(CLEANFEEDS_NODE . $node->type, 0)) {
51 $node->body = check_plain(decode_entities(strip_tags($node->body)));
52 $node->teaser = check_plain(decode_entities(strip_tags($node->teaser)));
53 }
54 break;
55 }
56 }

  ViewVC Help
Powered by ViewVC 1.1.2