Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
<?php // from aggregator_menu() $items['aggregator/sources/%aggregator_feed'] = array( 'page callback' => 'aggregator_page_source', // <- called here 'page arguments' => array(2), 'type' => MENU_CALLBACK, 'file' => 'aggregator.pages.inc', ); $items['aggregator/sources/%aggregator_feed/categorize'] = array( 'title' => 'Categorize', 'page callback' => 'drupal_get_form', // <- and here 'page arguments' => array('aggregator_page_source', 2), 'access arguments' => array('administer news feeds'), 'type' => MENU_LOCAL_TASK, 'file' => 'aggregator.pages.inc', ); function aggregator_page_source($arg1, $arg2 = NULL) { // If there are two arguments then this function is the categorize form, and // $arg1 is $form_state and $arg2 is $feed. Otherwise, $arg1 is $feed. $feed = is_array($arg2) ? $arg2 : $arg1; $feed = (object)$feed; drupal_set_title(check_plain($feed->title)); $info = theme('aggregator_feed', $feed); return _aggregator_page_list('SELECT * FROM {aggregator_item} WHERE fid = '. $feed->fid .' ORDER BY timestamp DESC, iid DESC', arg(3), $info); }
This paste will be private.
From the Design Piracy series on my blog: