system_theme_listing
- Versions
- 4.6
system_theme_listing()
Generate a list of all the available theme/style combinations.
Code
modules/system.module, line 422
<?php
function system_theme_listing() {
$themes = system_theme_data();
ksort($themes);
foreach ($themes as $info) {
$info->screenshot = dirname($info->filename) . '/screenshot.png';
$row = array();
// Screenshot column.
$row[] = file_exists($info->screenshot) ? theme('image', $info->screenshot, t('Screenshot for %theme theme', array('%theme' => $info->name)), '', 'class="screenshot"', false) : t('no screenshot');
// Information field.
$row[] = "<strong>$info->name</strong><br /><em>" . dirname($info->filename) . '</em>';
// enabled, default, and operations columns
$row[] = array('data' => form_checkbox('', 'status]['. $info->name, 1, $info->status), 'align' => 'center');
$row[] = array('data' => form_radio('', 'theme_default', $info->name, (variable_get('theme_default', 'bluemarine') == $info->name) ? 1 : 0), 'align' => 'center');
if (function_exists($info->prefix . '_settings') || function_exists($info->prefix . '_features')) {
$row[] = array('data' => l(t('configure'), 'admin/themes/settings/' . $info->name), 'align' => 'center');
}
else {
$row[] = '';
}
$rows[] = $row;
}
$header = array(t('Screenshot'), t('Name'), t('Enabled'), t('Default'), t('Operations'));
$output = form_hidden('type', 'theme');
$output .= theme('table', $header, $rows);
return $output;
}
?>Login or register to post comments 