These options control the default display settings for your entire site, across all themes. Unless they have been overridden by a specific theme, these settings will be used.

'); case 'admin/modules#description': return t('Allows users to select the theme with which they view the site.'); } } /** * Implementation of hook_perm(). */ function usertheme_perm() { return array('select personal theme'); } /** * Implementation of hook_menu(). */ function usertheme_menu($may_cache) { global $user; $items = array(); if ($may_cache) { // TODO: uncomment for use with usertheme_admin and usertheme_list_themes /* $items[] = array('path' => 'admin/themes/user', 'title' => t('user-selectable themes'), 'callback' => 'usertheme_admin', 'access' => user_access('administer site configuration'), 'type' => MENU_LOCAL_TASK, 'weight' => 5); */ } else if (user_access('select personal theme') && !empty($user->theme)) { $GLOBALS['custom_theme'] = $user->theme; } return $items; } /** * Implementation of hook_user(). * * Allows users to individually set their theme. */ function usertheme_user($type, $edit, &$user, $category = NULL) { if ($type == 'form' && $category == 'account' && user_access('select personal theme', $user)) { $themes = usertheme_list_themes(); ksort($themes); if (count($themes) > 1) { $rows = array(); foreach ($themes as $key => $value) { $row = array(); // Screenshot column. $screenshot = dirname($value->filename) .'/screenshot.png'; $row[] = file_exists($screenshot) ? theme('image', $screenshot, t('Screenshot for %theme theme', array('%theme' => $value->name)), '', array('class' => 'screenshot'), false) : t('no screenshot'); // Information field. $row[] = ''. $value->name .''; // Reset to follow site default theme if user selects the site default if ($key == variable_get('theme_default', 'bluemarine')) { $key = ''; if ($edit['theme'] == variable_get('theme_default', 'bluemarine')) { $edit['theme'] = ''; } } // Selected column. $row[] = array('data' => form_radio('', 'theme', $key, ($edit['theme'] == $key) ? 1 : 0), 'align' => 'center'); $rows[] = $row; } $header = array(t('Screenshot'), t('Name'), t('Selected')); $data[] = array('title' => t('Theme settings'), 'data' => form_item('', theme('table', $header, $rows), t('Selecting a different theme will change the look and feel of the site.')), 'weight' => 2); return $data; } } } /** * Menu callback: enable/disable user-selectable themes */ function usertheme_admin() { // TODO } /* * Generates a list_themes()-style output of ONLY themes which are user-selectable */ function usertheme_list_themes() { // TODO return list_themes(); } ?>