Index: recent_blocks.info =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/recent_blocks/recent_blocks.info,v retrieving revision 1.2 diff -u -p -r1.2 recent_blocks.info --- recent_blocks.info 4 Apr 2007 21:15:48 -0000 1.2 +++ recent_blocks.info 15 Feb 2008 17:18:05 -0000 @@ -2,3 +2,4 @@ name = Recent Blocks description = Make your own customizable blocks for displaying recent content. package = Other +core = 6.x Index: recent_blocks.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/recent_blocks/recent_blocks.module,v retrieving revision 1.10 diff -u -p -r1.10 recent_blocks.module --- recent_blocks.module 29 Aug 2007 21:44:36 -0000 1.10 +++ recent_blocks.module 15 Feb 2008 17:18:06 -0000 @@ -5,46 +5,39 @@ function recent_blocks_perm() { return array('administer recent blocks'); } -function recent_blocks_menu($may_cache) { - global $user; +function recent_blocks_menu() { $items = array(); - if ($may_cache) { - $items[] = array( - 'path' => 'admin/build/recent_blocks/add', - 'title' => t('Add a new block'), - 'access' => user_access('administer recent blocks'), - 'description' => t('add blocks for specific content types'), - 'callback' => 'drupal_get_form', - 'callback arguments' => array('_recent_blocks_add'), - 'type' => MENU_NORMAL_ITEM, - ); - $items[] = array( - 'path' => 'admin/build/recent_blocks/delete', - 'title' => t('Delete a block'), - 'access' => user_access('administer recent blocks'), - 'description' => t('remove blocks for specific content types'), - 'callback' => 'drupal_get_form', - 'callback arguments' => array('_recent_blocks_delete'), - 'type' => MENU_NORMAL_ITEM, - ); - $items[] = array( - 'path' => 'admin/build/recent_blocks/edit', - 'title' => t('Edit a block'), - 'access' => user_access('administer recent blocks'), - 'description' => t('edit blocks for specific content types'), - 'callback' => 'recent_blocks_edit_page', - 'type' => MENU_NORMAL_ITEM, - ); - $items[] = array( - 'path' => 'admin/build/recent_blocks', - 'title' => t('Recent Blocks'), - 'description' => t('Administer recent blocks'), - 'access' => user_access('administer recent blocks'), - 'callback' => '_recent_blocks_admin', - 'type' => MENU_NORMAL_ITEM, - ); - } + $items['admin/build/recent_blocks/add'] = array( + 'title' => 'Add a new block', + 'access arguments' => array('administer recent blocks'), + 'description' => 'add blocks for specific content types', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('_recent_blocks_add'), + 'type' => MENU_NORMAL_ITEM, + ); + $items['admin/build/recent_blocks/delete'] = array( + 'title' => 'Delete a block', + 'access arguments' => array('administer recent blocks'), + 'description' => 'remove blocks for specific content types', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('_recent_blocks_delete'), + 'type' => MENU_NORMAL_ITEM, + ); + $items['admin/build/recent_blocks/edit'] = array( + 'title' => 'Edit a block', + 'access arguments' => array('administer recent blocks'), + 'description' => 'edit blocks for specific content types', + 'page callback' => 'recent_blocks_edit_page', + 'type' => MENU_NORMAL_ITEM, + ); + $items['admin/build/recent_blocks'] = array( + 'title' => 'Recent Blocks', + 'description' => 'Administer recent blocks', + 'access arguments' => array('administer recent blocks'), + 'page callback' => '_recent_blocks_admin', + 'type' => MENU_NORMAL_ITEM, + ); return $items; } @@ -132,7 +125,7 @@ function _recent_blocks_block($s) { if ($show['comments number'] && $node->comment_count) { $comments_no = format_plural($node->comment_count, '1 reply', '@count replies'); if (module_exists('comment') && $new = comment_num_new($node->nid)) { - $comments_no .= ' '. l(format_plural($new, '1 new', '@count new'), "node/$node->nid", NULL, NULL, 'new'); + $comments_no .= ' '. l(format_plural($new, '1 new', '@count new'), "node/$node->nid", array('fragment' => 'new')); } } @@ -358,19 +351,19 @@ function recent_blocks_edit_page($delta) return drupal_get_form('recent_blocks_edit_form',$delta); } -function recent_blocks_edit_form_submit($form_id, $form_values) { - $delta = $form_values['delta']; +function recent_blocks_edit_form_submit($form, &$form_state) { + $delta = $form_state['delta']; #put node types in the format expected by _recent_blocks_block $types = array_keys(node_get_types()); - $rb_types = $form_values['types']; + $rb_types = $form_state['types']; foreach ($rb_types as $val) { - unset($form_values['types']["$val"]); - $form_values['types'][ $types[$val] ] = $types[$val]; + unset($form_state['types']["$val"]); + $form_state['types'][ $types[$val] ] = $types[$val]; } - variable_set("recent_blocks_$delta",$form_values); - variable_set("recent_blocks_broken",print_r($form_values,true)); + variable_set("recent_blocks_$delta",$form_state); + variable_set("recent_blocks_broken",print_r($form_state,true)); drupal_set_message(t('Your changes have been saved.')); return 'admin/build/recent_blocks'; }