function Notifications_Subscription_Table::subscription_fields in Notifications 7
Fill in fields for a subscription
2 calls to Notifications_Subscription_Table::subscription_fields()
- Notifications_Subscription_Table::table_list in ./
notifications.list.inc - Produce simple table with all these subscriptions
- Notifications_Subscription_Table::table_select in ./
notifications.list.inc - Produce a select table with all these subscriptions
File
- ./
notifications.list.inc, line 503 - Drupal Notifications Framework - Default class file
Class
- Notifications_Subscription_Table
- Loadable collection of subscriptions for tablesel ect
Code
function subscription_fields($subs) {
$send_methods = messaging_method_info(NULL, 'name');
$send_intervals = notifications_send_intervals();
$send_intervals[-1] = t('Scheduled');
$fields = array();
foreach (array_keys($this->header) as $index) {
switch ($index) {
case 'sid':
$value = array(
'data' => array(
'#type' => 'link',
'#title' => $subs->sid,
'#href' => $this->base_path . '/' . $subs->sid,
),
);
break;
case 'title':
$value = $subs
->get_title();
break;
case 'name':
$value = $subs
->get_name();
break;
case 'type':
$type_list = notifications_subscription_type(NULL, 'title');
$value = $type_list[$subs->type];
break;
case 'status':
$status_list = Notifications_Subscription::status_list();
$value = $status_list[$subs->status];
break;
case 'created':
$value = format_date($subs->created, 'short');
break;
case 'uid':
// User
$value = theme('username', array(
'account' => $subs
->get_user(),
));
break;
case 'operations':
$value = $this
->field_operations($subs);
break;
case 'send_method':
$value = isset($send_methods[$subs->send_method]) ? $send_methods[$subs->send_method] : $subs->send_method;
break;
case 'send_interval':
$value = isset($send_intervals[$subs->send_interval]) ? $send_intervals[$subs->send_interval] : $subs->send_interval;
break;
default:
$value = isset($subs->{$index}) ? check_plain($subs->{$index}) : '--';
break;
}
$fields[$index] = $value;
}
return $fields;
}