Converting og_aggregator from 4.7 -> 5.x

yanisdon - June 14, 2007 - 05:38
Project:OG Aggregator
Version:4.7.x-1.0
Component:Code
Category:support request
Priority:normal
Assigned:zagorot
Status:closed
Description

Hi,
I am trying to convert the og_aggregator and I got stuck with it.
I don't understand why (in this particular case) $edit seems to be always empty (except from $edit['refresh']).

Here is the juicy part:

function og_aggregator_form_feed_edit($edit = array(),$og_id) {
$period = drupal_map_assoc(array(900, 1800, 3600, 7200, 10800, 21600, 32400, 43200, 64800, 86400, 172800, 259200, 604800, 1209600, 2419200), 'format_interval');

if ($edit['refresh'] == '') {
$edit['refresh'] = 3600;
}

$form['title'] = array('#type' => 'textfield',
'#title' => t('Title'),
'#default_value' => $edit['title'],
'#maxlength' => 64,
'#description' => t('The name of the feed; typically the name of the web site you syndicate content from.'),
'#required' => TRUE,
);
$form['url'] = array('#type' => 'textfield',
'#title' => t('URL'),
'#default_value' => $edit['url'],
'#maxlength' => 255,
'#description' => t('The fully-qualified URL of the feed.'),
'#required' => TRUE,
);
$form['refresh'] = array('#type' => 'select',
'#title' => t('Update interval'),
'#default_value' => $edit['refresh'],
'#options' => $period,
'#description' => t('The refresh interval indicating how often you want to update this feed. Requires crontab.'),
);
$form['keyword'] = array('#type' => 'textfield',
'#title' => t('Keyword'),
'#default_value' => $edit['keyword'],
'#maxlength' => 255,
'#description' => t('The keyword of the feed; Feed content filter.'),
);
$form['antikeyword'] = array('#type' => 'textfield',
'#title' => t('Anti Keyword'),
'#default_value' => $edit['antikeyword'],
'#maxlength' => 255,
'#description' => t('The anti keyword of the feed; Feed content filter.'),
);

// Handling of categories:
$options = array();
$values = array();
$form['submit'] = array('#type' => 'submit', '#value' =>t('Submit'));

if ($edit['fid']) {
$form['delete'] = array('#type' => 'submit', '#value' =>t('Delete'));
$form['fid'] = array('#type' => 'hidden', '#value' => $edit['fid']);
}

if ($og_id){
$form['og_id'] = array('#type' => 'hidden', '#value' => $og_id);
}

/* ********** */
#return drupal_get_form('og_aggregator_form_feed', $form);
#print_r($form);
#print_r($form_values);
#print_r($edit);
/* ********** */

return $form;

}

#1

zagorot - June 27, 2007 - 13:03
Assigned to:Anonymous» zagorot
Status:active» closed
 
 

Drupal is a registered trademark of Dries Buytaert.