function ad_filters in Advertisement 6.2
Same name and namespace in other branches
- 5.2 ad.module \ad_filters()
- 5 ad.module \ad_filters()
- 6.3 ad.admin.inc \ad_filters()
- 6 ad.admin.inc \ad_filters()
- 7 ad.admin.inc \ad_filters()
List ad administration filters that can be applied.
3 calls to ad_filters()
- ad_build_filter_query in ./
ad.admin.inc - Build query for ad administration filters based on session.
- ad_filter_form in ./
ad.admin.inc - Return form for advertisement administration filters.
- ad_filter_form_submit in ./
ad.admin.inc - Process result from ad administration filter form.
File
- ./
ad.admin.inc, line 285 - Advertisement admin pages and functions.
Code
function ad_filters() {
$session =& $_SESSION['ad_overview_filter'];
$session = is_array($session) ? $session : array();
// Regular filters
$options = array(
'pending-1' => t('pending'),
'approved-1' => t('approved'),
'active-1' => t('active'),
'offline-1' => t('offline'),
'expired-1' => t('expired'),
'denied-1' => t('denied'),
'pending-0' => t('not pending'),
'approved-0' => t('not approved'),
'active-0' => t('not active'),
'offline-0' => t('not offline'),
'expired-0' => t('not expired'),
'denied-0' => t('not denied'),
);
$filters['status'] = array(
'title' => t('status'),
'options' => $options,
);
$adtypes = ad_get_types();
$filters['type'] = array(
'title' => t('type'),
'options' => $adtypes,
);
// The taxonomy filter
if ($taxonomy = module_invoke('taxonomy', 'get_tree', _ad_get_vid())) {
$options = array();
// TODO: Add support for the default group.
//$options[0] = t('default');
foreach ($taxonomy as $term) {
$options[$term->tid] = check_plain($term->name);
}
$filters['group'] = array(
'title' => t('group'),
'options' => $options,
);
}
$filters = array_merge($filters, module_invoke_all('adapi', 'admin_filters', array()));
return $filters;
}