| 1 installer.pages.inc | installer_browser_filters_form($form, &$form_state, $type) |
Builds the filters form.
File
- core/
modules/ installer/ installer.pages.inc, line 870 - Page callbacks used by the Installer browse pages.
Code
function installer_browser_filters_form($form, &$form_state, $type) {
switch ($type) {
case 'module':
$projects = t('modules');
break;
case 'theme':
$projects = t('themes');
break;
case 'layout':
$projects = t('layout templates');
break;
default:
$projects = t('projects');
}
$form['description'] = array(
'#type' => 'help',
'#markup' => t('<p>This form allows you to find and install @projects with an official release.</p>
<p>Additional @projects in various stages of development may be found in the <a href="!url" target="_blank">backdrop-contrib</a> repositories. Use of dev @projects in production is not recommended without careful testing.</p>',
array(
'@projects' => $projects,
'!url' => url('https://github.com/backdrop-contrib'),
)
),
);
$form['search_text'] = array(
'#title' => t('Search'),
'#type' => 'textfield',
'#size' => '25',
'#default_value' => isset($_SESSION['installer_browser_text_filter_' . $type]) ? $_SESSION['installer_browser_text_filter_' . $type] : '',
);
$form['project_type'] = array(
'#type' => 'value',
'#value' => $type,
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Search'),
);
if (!empty($_SESSION['installer_browser_text_filter_' . $type])) {
$form['clear'] = array(
'#type' => 'submit',
'#value' => t('Clear'),
);
}
return $form;
}