diff options
author | Dries Buytaert <dries@buytaert.net> | 2004-02-15 14:54:39 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2004-02-15 14:54:39 +0000 |
commit | 4f07deabcb5a618d9cd71315d5d043fa4c623b2e (patch) | |
tree | a8b8b0b1d2711d545b9351f127ad6c5897844dc2 /themes | |
parent | b13a4cb2e3bf6d9dd887335aa6c64c31a2768134 (diff) | |
download | brdo-4f07deabcb5a618d9cd71315d5d043fa4c623b2e.tar.gz brdo-4f07deabcb5a618d9cd71315d5d043fa4c623b2e.tar.bz2 |
- Changed the directory structure of theme chameleon. Each template is now
in a subdirectory. This makes it easier to clone/fork an existing theme.
Modified patch by MegaGrunt.
- Added some help text, reorganized the Xtemplate configuration page, added
<legend>/<fieldset> tags, fixed a logo bug.
Diffstat (limited to 'themes')
-rw-r--r-- | themes/xtemplate/default/logo.gif (renamed from themes/xtemplate/images/druplicon.gif) | bin | 3509 -> 3509 bytes | |||
-rw-r--r-- | themes/xtemplate/default/xtemplate.css (renamed from themes/xtemplate/xtemplate.css) | 0 | ||||
-rw-r--r-- | themes/xtemplate/default/xtemplate.xtmpl (renamed from themes/xtemplate/xtemplate.xtmpl) | 2 | ||||
-rw-r--r-- | themes/xtemplate/xtemplate.theme | 58 |
4 files changed, 40 insertions, 20 deletions
diff --git a/themes/xtemplate/images/druplicon.gif b/themes/xtemplate/default/logo.gif Binary files differindex ab6e59c3c..ab6e59c3c 100644 --- a/themes/xtemplate/images/druplicon.gif +++ b/themes/xtemplate/default/logo.gif diff --git a/themes/xtemplate/xtemplate.css b/themes/xtemplate/default/xtemplate.css index cc42447dc..cc42447dc 100644 --- a/themes/xtemplate/xtemplate.css +++ b/themes/xtemplate/default/xtemplate.css diff --git a/themes/xtemplate/xtemplate.xtmpl b/themes/xtemplate/default/xtemplate.xtmpl index 456a2424d..aea3dd3db 100644 --- a/themes/xtemplate/xtemplate.xtmpl +++ b/themes/xtemplate/default/xtemplate.xtmpl @@ -5,7 +5,7 @@ <head> <title>{head_title}</title> {head} - <link type="text/css" rel="stylesheet" href="{stylesheet}" /> + <link type="text/css" rel="stylesheet" href="{path}/xtemplate.css" /> </head> <body{onload_attributes}> diff --git a/themes/xtemplate/xtemplate.theme b/themes/xtemplate/xtemplate.theme index a75452257..bc300ee97 100644 --- a/themes/xtemplate/xtemplate.theme +++ b/themes/xtemplate/xtemplate.theme @@ -4,24 +4,43 @@ if (!class_exists("XTemplate")) { include_once("themes/xtemplate/xtemplate.inc"); } - -$GLOBALS["xtemplate"]->template = new XTemplate("themes/xtemplate/xtemplate.xtmpl"); +$template_directory = variable_get('xtemplate_template', 'default'); +$GLOBALS["xtemplate"]->template = new XTemplate('xtemplate.xtmpl', 'themes/xtemplate/' . $template_directory); $GLOBALS["xtemplate"]->template->SetNullBlock(" "); // "" doesnt work! function xtemplate_settings() { - $output .= form_textarea(t("Message on front page"), "xtemplate_mission", variable_get("xtemplate_mission", "edit mission"), 70, 6, t("This text will be displayed on the front page. It can be used to display a mission statement, announcement or site description..")); - $output .= form_textfield(t("Stylesheet URL"), "xtemplate_stylesheet", variable_get("xtemplate_stylesheet", "themes/xtemplate/xtemplate.css"), 70, 300, t("The URL for your theme's cascading stylesheet.")); - $output .= form_textarea(t("Logo"), "xtemplate_logo", variable_get("xtemplate_logo", "<img src=\"themes/xtemplate/images/druplicon.gif\" alt=\"Druplicon - Drupal logo\" />"), 70, 4, t("The HTML code for displaying the logo.")); - $output .= form_textarea(t("Primary links"), "xtemplate_primary_links", variable_get("xtemplate_primary_links", l("edit primary links", "admin/system/themes/xtemplate")), 70, 8, t("The HTML code for the primary links.")); - $output .= form_textarea(t("Secondary links"), "xtemplate_secondary_links", variable_get("xtemplate_secondary_links", l("edit secondary links", "admin/system/themes/xtemplate")), 70, 8, t("The HTML code for the secondary links.")); - $output .= form_radios(t("Search box"), "xtemplate_search_box", variable_get("xtemplate_search_box", 0), array(t("Disabled"), t("Enabled")), t("Show a search box in the upper right corner.")); - $output .= form_group(t("Avatars"), form_checkbox(t("Display avatars with posts"), "xtemplate_avatar_node", 1, variable_get("xtemplate_avatar_node", 0), t("Display individualized pictures identifying users with posts they start.")) . form_checkbox(t("Display avatars with comments"), "xtemplate_avatar_comment", 1, variable_get("xtemplate_avatar_comment", 0), t("Display individualized pictures identifying users with their comments.")) . form_textfield(t("Default avatar"), "xtemplate_avatar_default", variable_get("xtemplate_avatar_default", ""), 70, 300, t("URL of avatar to display for users with no custom avatar selected. Leave blank for none."))); + /* + ** Compile a list of the available style sheets: + */ + + $fd = opendir('themes/xtemplate'); + while ($file = readdir($fd)) { + if (is_dir("themes/xtemplate/$file") && !in_array($file, array('.', '..', 'CVS'))) { + $files[$file] = $file; + } + } + closedir($fd); + + $template_directory = variable_get('xtemplate_template', 'default'); + $group = form_select(t('Template'), 'xtemplate_template', variable_get('xtemplate_template', 'default'), $files, t('Selecting a different template will change the look and feel of your site. To create a new template, create a new directory under <code>themes/xtemplate</code> and copy the contents of an existing template (e.g. <code>themes/xtemplate/default</code>) into it. The new template will automatically become available in the selection menu and will be identified by its directory name.')); + $output = form_group(t('Template selection'), $group); + + $group = form_textarea(t('Logo'), 'xtemplate_logo', variable_get('xtemplate_logo', "<img src=\"themes/xtemplate/$template_directory/logo.gif\" alt=\"Logo\" />"), 70, 4, t('The HTML code for displaying the logo.')); + $group .= form_textarea(t('Primary links'), 'xtemplate_primary_links', variable_get('xtemplate_primary_links', l('edit primary links', 'admin/system/themes/xtemplate')), 70, 8, t('The HTML code for the primary links.')); + $group .= form_textarea(t('Secondary links'), 'xtemplate_secondary_links', variable_get('xtemplate_secondary_links', l('edit secondary links', 'admin/system/themes/xtemplate')), 70, 8, t('The HTML code for the secondary links.')); + $group .= form_textarea(t('Message on front page'), 'xtemplate_mission', variable_get('xtemplate_mission', 'edit mission'), 70, 6, t('This text will be displayed on the front page. It can be used to display a mission statement, announcement or site description..')); + $group .= form_radios(t('Search box'), 'xtemplate_search_box', variable_get('xtemplate_search_box', 0), array(t('Disabled'), t('Enabled')), t('Show a search box in the upper right corner.')); + $output .= form_group(t('Header settings'), $group); + + $group = form_checkbox(t('Display avatars with posts'), 'xtemplate_avatar_node', 1, variable_get('xtemplate_avatar_node', 0), t('Display individualized pictures identifying users with posts they start.')) . form_checkbox(t('Display avatars with comments'), 'xtemplate_avatar_comment', 1, variable_get('xtemplate_avatar_comment', 0), t('Display individualized pictures identifying users with their comments.')) . form_textfield(t('Default avatar'), 'xtemplate_avatar_default', variable_get('xtemplate_avatar_default', ''), 70, 300, t('URL of avatar to display for users with no custom avatar selected. Leave blank for none.')); + $output .= form_group(t('Avatar settings'), $group); + return $output; } function xtemplate_help($section) { - $output = ""; + $output = ''; switch ($section) { case 'admin/system/themes#description': @@ -133,17 +152,18 @@ function xtemplate_page($content, $title = NULL, $breadcrumb = NULL) { } global $xtemplate; + $template_directory = variable_get('xtemplate_template', 'default'); $xtemplate->template->assign(array( - "head_title" => (drupal_get_title() ? drupal_get_title() ." | ". variable_get("site_name", "drupal") : variable_get("site_name", "drupal") ." | ". variable_get("site_slogan", "")), - "site" => variable_get("site_name", "drupal"), - "head" => drupal_get_html_head(), - "stylesheet" => variable_get("xtemplate_stylesheet", "themes/xtemplate/xtemplate.css"), - "onload_attributes" => theme_onload_attribute(), - "logo" => variable_get("xtemplate_logo", "<img src=\"themes/xtemplate/images/druplicon.gif\" alt=\"Druplicon - Drupal logo\" />"), - "primary_links" => variable_get("xtemplate_primary_links", l("edit primary links", "admin/system/themes/xtemplate")), - "secondary_links" => variable_get("xtemplate_secondary_links", l("edit secondary links", "admin/system/themes/xtemplate")) - )); + "head_title" => (drupal_get_title() ? drupal_get_title() ." | ". variable_get("site_name", "drupal") : variable_get("site_name", "drupal") ." | ". variable_get("site_slogan", "")), + "site" => variable_get("site_name", "drupal"), + "head" => drupal_get_html_head(), + "path" => "themes/xtemplate/$template_directory", + "onload_attributes" => theme_onload_attribute(), + "logo" => variable_get('xtemplate_logo', "<img src=\"themes/xtemplate/$template_directory/logo.gif\" alt=\"Logo\" />"), + "primary_links" => variable_get("xtemplate_primary_links", l("edit primary links", "admin/system/themes/xtemplate")), + "secondary_links" => variable_get("xtemplate_secondary_links", l("edit secondary links", "admin/system/themes/xtemplate")) + )); if ($title = drupal_get_title()) { $xtemplate->template->assign("title", $title); |