function page_manager_list_pages_form in Chaos Tool Suite (ctools) 6
Same name and namespace in other branches
- 7 page_manager/page_manager.admin.inc \page_manager_list_pages_form()
Provide a form for sorting and filtering the list of pages.
1 string reference to 'page_manager_list_pages_form'
- page_manager_list_page in page_manager/
page_manager.admin.inc - Output a list of pages that are managed.
File
- page_manager/
page_manager.admin.inc, line 224 - Administrative functions for the page manager.
Code
function page_manager_list_pages_form(&$form_state) {
// This forces the form to *always* treat as submitted which is
// necessary to make it work.
if (empty($_POST)) {
$form["#programmed"] = TRUE;
}
$form['#action'] = url('admin/build/pages/nojs/', array(
'absolute' => TRUE,
));
if (!variable_get('clean_url', FALSE)) {
$form['q'] = array(
'#type' => 'hidden',
'#value' => $_GET['q'],
);
}
$all = array(
'all' => t('<All>'),
);
$form['type'] = array(
'#type' => 'select',
'#title' => t('Type'),
'#options' => $all + $form_state['pages']['types'],
'#default_value' => 'all',
);
$form['storage'] = array(
'#type' => 'select',
'#title' => t('Storage'),
'#options' => $all + $form_state['pages']['storages'],
'#default_value' => 'all',
);
$form['disabled'] = array(
'#type' => 'select',
'#title' => t('Enabled'),
'#options' => $all + array(
'0' => t('Enabled'),
'1' => t('Disabled'),
),
'#default_value' => 'all',
);
$form['search'] = array(
'#type' => 'textfield',
'#title' => t('Search'),
);
$form['order'] = array(
'#type' => 'select',
'#title' => t('Sort by'),
'#options' => array(
'disabled' => t('Enabled, title'),
'title' => t('Title'),
'name' => t('Name'),
'path' => t('Path'),
'type' => t('Type'),
'storage' => t('Storage'),
),
'#default_value' => 'disabled',
);
$form['sort'] = array(
'#type' => 'select',
'#title' => t('Order'),
'#options' => array(
'asc' => t('Up'),
'desc' => t('Down'),
),
'#default_value' => 'asc',
);
$form['submit'] = array(
'#name' => '',
// so it won't in the $_GET args
'#type' => 'submit',
'#id' => 'edit-pages-apply',
'#value' => t('Apply'),
'#attributes' => array(
'class' => 'ctools-use-ajax',
),
);
$form['reset'] = array(
'#type' => 'submit',
'#id' => 'edit-pages-reset',
'#value' => t('Reset'),
'#attributes' => array(
'class' => 'ctools-use-ajax',
),
);
ctools_add_js('ajax-responder');
drupal_add_js('misc/jquery.form.js');
drupal_add_js(drupal_get_path('module', 'page_manager') . '/js/page-list.js');
$form['#theme'] = array(
'page_manager_list_pages_form',
);
return $form;
}