system_themes
modules/system/system.module, строка 1142
- Версии
- 5
system_themes()
Menu callback; displays a listing of all themes.
Код
<?php
function system_themes() {
drupal_clear_css_cache();
$themes = system_theme_data();
ksort($themes);
foreach ($themes as $info) {
$info->screenshot = dirname($info->filename) .'/screenshot.png';
$screenshot = file_exists($info->screenshot) ? theme('image', $info->screenshot, t('Screenshot for %theme theme', array('%theme' => $info->name)), '', array('class' => 'screenshot'), FALSE) : t('no screenshot');
$form[$info->name]['screenshot'] = array('#value' => $screenshot);
$form[$info->name]['description'] = array('#type' => 'item', '#title' => $info->name, '#value' => dirname($info->filename));
$options[$info->name] = '';
if ($info->status) {
$status[] = $info->name;
}
if ($info->status && (function_exists($info->prefix .'_settings') || function_exists($info->prefix .'_features'))) {
$form[$info->name]['operations'] = array('#value' => l(t('configure'), 'admin/build/themes/settings/'. $info->name) );
}
else {
// Dummy element for drupal_render. Cleaner than adding a check in the theme function.
$form[$info->name]['operations'] = array();
}
}
$form['status'] = array('#type' => 'checkboxes', '#options' => $options, '#default_value' => $status);
$form['theme_default'] = array('#type' => 'radios', '#options' => $options, '#default_value' => variable_get('theme_default', 'garland'));
$form['buttons']['submit'] = array('#type' => 'submit', '#value' => t('Save configuration') );
$form['buttons']['reset'] = array('#type' => 'submit', '#value' => t('Reset to defaults') );
return $form;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии