@@ -13,76 +13,76 @@ |
||
13 | 13 | * The name of the template being rendered ("block" in this case.) |
14 | 14 | */ |
15 | 15 | function zen_preprocess_block_editing(&$vars, $hook) { |
16 | - $block = $vars['block']; |
|
16 | + $block = $vars['block']; |
|
17 | 17 | |
18 | - // Display 'edit block' for custom blocks. |
|
19 | - if ($block->module == 'block') { |
|
18 | + // Display 'edit block' for custom blocks. |
|
19 | + if ($block->module == 'block') { |
|
20 | 20 | $vars['edit_links_array']['block-edit'] = l('<span>' . t('edit block') . '</span>', 'admin/build/block/configure/' . $block->module . '/' . $block->delta, |
21 | - array( |
|
21 | + array( |
|
22 | 22 | 'attributes' => array( |
23 | - 'title' => t('edit the content of this block'), |
|
24 | - 'class' => 'block-edit', |
|
23 | + 'title' => t('edit the content of this block'), |
|
24 | + 'class' => 'block-edit', |
|
25 | 25 | ), |
26 | 26 | 'query' => drupal_get_destination(), |
27 | 27 | 'html' => TRUE, |
28 | - ) |
|
28 | + ) |
|
29 | 29 | ); |
30 | - } |
|
31 | - // Display 'configure' for other blocks. |
|
32 | - else { |
|
30 | + } |
|
31 | + // Display 'configure' for other blocks. |
|
32 | + else { |
|
33 | 33 | $vars['edit_links_array']['block-config'] = l('<span>' . t('configure') . '</span>', 'admin/build/block/configure/' . $block->module . '/' . $block->delta, |
34 | - array( |
|
34 | + array( |
|
35 | 35 | 'attributes' => array( |
36 | - 'title' => t('configure this block'), |
|
37 | - 'class' => 'block-config', |
|
36 | + 'title' => t('configure this block'), |
|
37 | + 'class' => 'block-config', |
|
38 | 38 | ), |
39 | 39 | 'query' => drupal_get_destination(), |
40 | 40 | 'html' => TRUE, |
41 | - ) |
|
41 | + ) |
|
42 | 42 | ); |
43 | - } |
|
43 | + } |
|
44 | 44 | |
45 | - // Display 'edit view' for Views blocks. |
|
46 | - if ($block->module == 'views' && user_access('administer views')) { |
|
45 | + // Display 'edit view' for Views blocks. |
|
46 | + if ($block->module == 'views' && user_access('administer views')) { |
|
47 | 47 | list($view_name, $view_block) = explode('-block', $block->delta); |
48 | 48 | $vars['edit_links_array']['block-edit-view'] = l('<span>' . t('edit view') . '</span>', 'admin/build/views/edit/' . $view_name, |
49 | - array( |
|
49 | + array( |
|
50 | 50 | 'attributes' => array( |
51 | - 'title' => t('edit the view that defines this block'), |
|
52 | - 'class' => 'block-edit-view', |
|
51 | + 'title' => t('edit the view that defines this block'), |
|
52 | + 'class' => 'block-edit-view', |
|
53 | 53 | ), |
54 | 54 | 'query' => drupal_get_destination(), |
55 | 55 | 'fragment' => 'views-tab-block' . $view_block, |
56 | 56 | 'html' => TRUE, |
57 | - ) |
|
57 | + ) |
|
58 | 58 | ); |
59 | - } |
|
60 | - // Display 'edit menu' for Menu blocks. |
|
61 | - elseif (($block->module == 'menu' || ($block->module == 'user' && $block->delta == 1)) && user_access('administer menu')) { |
|
59 | + } |
|
60 | + // Display 'edit menu' for Menu blocks. |
|
61 | + elseif (($block->module == 'menu' || ($block->module == 'user' && $block->delta == 1)) && user_access('administer menu')) { |
|
62 | 62 | $menu_name = ($block->module == 'user') ? 'navigation' : $block->delta; |
63 | 63 | $vars['edit_links_array']['block-edit-menu'] = l('<span>' . t('edit menu') . '</span>', 'admin/build/menu-customize/' . $menu_name, |
64 | - array( |
|
64 | + array( |
|
65 | 65 | 'attributes' => array( |
66 | - 'title' => t('edit the menu that defines this block'), |
|
67 | - 'class' => 'block-edit-menu', |
|
66 | + 'title' => t('edit the menu that defines this block'), |
|
67 | + 'class' => 'block-edit-menu', |
|
68 | 68 | ), |
69 | 69 | 'query' => drupal_get_destination(), |
70 | 70 | 'html' => TRUE, |
71 | - ) |
|
71 | + ) |
|
72 | 72 | ); |
73 | - } |
|
74 | - // Display 'edit menu' for Menu block blocks. |
|
75 | - elseif ($block->module == 'menu_block' && user_access('administer menu')) { |
|
73 | + } |
|
74 | + // Display 'edit menu' for Menu block blocks. |
|
75 | + elseif ($block->module == 'menu_block' && user_access('administer menu')) { |
|
76 | 76 | list($menu_name, ) = split(':', variable_get("menu_block_{$block->delta}_parent", 'navigation:0')); |
77 | 77 | $vars['edit_links_array']['block-edit-menu'] = l('<span>' . t('edit menu') . '</span>', 'admin/build/menu-customize/' . $menu_name, |
78 | - array( |
|
78 | + array( |
|
79 | 79 | 'attributes' => array( |
80 | - 'title' => t('edit the menu that defines this block'), |
|
81 | - 'class' => 'block-edit-menu', |
|
80 | + 'title' => t('edit the menu that defines this block'), |
|
81 | + 'class' => 'block-edit-menu', |
|
82 | 82 | ), |
83 | 83 | 'query' => drupal_get_destination(), |
84 | 84 | 'html' => TRUE, |
85 | - ) |
|
85 | + ) |
|
86 | 86 | ); |
87 | - } |
|
87 | + } |
|
88 | 88 | } |
@@ -10,63 +10,63 @@ discard block |
||
10 | 10 | * We are simply using this hook as a convenient time to do some related work. |
11 | 11 | */ |
12 | 12 | function _zen_theme(&$existing, $type, $theme, $path) { |
13 | - // Compute the conditional stylesheets. |
|
14 | - if (!module_exists('conditional_styles')) { |
|
13 | + // Compute the conditional stylesheets. |
|
14 | + if (!module_exists('conditional_styles')) { |
|
15 | 15 | include_once './' . _zen_path() . '/zen-internals/template.conditional-styles.inc'; |
16 | 16 | // _conditional_styles_theme() only needs to be run once. |
17 | 17 | if ($theme == 'zen') { |
18 | - _conditional_styles_theme($existing, $type, $theme, $path); |
|
18 | + _conditional_styles_theme($existing, $type, $theme, $path); |
|
19 | + } |
|
19 | 20 | } |
20 | - } |
|
21 | 21 | |
22 | - // Since we are rebuilding the theme registry and the theme settings' default |
|
23 | - // values may have changed, make sure they are saved in the database properly. |
|
24 | - zen_theme_get_default_settings($theme); |
|
22 | + // Since we are rebuilding the theme registry and the theme settings' default |
|
23 | + // values may have changed, make sure they are saved in the database properly. |
|
24 | + zen_theme_get_default_settings($theme); |
|
25 | 25 | |
26 | - // If we are auto-rebuilding the theme registry, warn about the feature. |
|
27 | - // Always display the warning in the admin section, otherwise limit to three |
|
28 | - // warnings per hour. |
|
29 | - if (function_exists('user_access') && user_access('administer site configuration') && theme_get_setting('zen_rebuild_registry') && $theme == $GLOBALS['theme'] && (arg(0) == 'admin' || flood_is_allowed($GLOBALS['theme'] . '_rebuild_registry_warning', 3))) { |
|
26 | + // If we are auto-rebuilding the theme registry, warn about the feature. |
|
27 | + // Always display the warning in the admin section, otherwise limit to three |
|
28 | + // warnings per hour. |
|
29 | + if (function_exists('user_access') && user_access('administer site configuration') && theme_get_setting('zen_rebuild_registry') && $theme == $GLOBALS['theme'] && (arg(0) == 'admin' || flood_is_allowed($GLOBALS['theme'] . '_rebuild_registry_warning', 3))) { |
|
30 | 30 | flood_register_event($GLOBALS['theme'] . '_rebuild_registry_warning'); |
31 | 31 | drupal_set_message(t('For easier theme development, the theme registry is being rebuilt on every page request. It is <em>extremely</em> important to <a href="!link">turn off this feature</a> on production websites.', array('!link' => url('admin/build/themes/settings/' . $GLOBALS['theme']))), 'warning', FALSE); |
32 | - } |
|
32 | + } |
|
33 | 33 | |
34 | - // Keep track of all the base themes. |
|
35 | - static $base_themes = array(); |
|
36 | - $base_themes[] = $theme; |
|
34 | + // Keep track of all the base themes. |
|
35 | + static $base_themes = array(); |
|
36 | + $base_themes[] = $theme; |
|
37 | 37 | |
38 | - // Add a "process" phase to come after the "preprocess" functions. |
|
39 | - if ($type == 'theme') { |
|
38 | + // Add a "process" phase to come after the "preprocess" functions. |
|
39 | + if ($type == 'theme') { |
|
40 | 40 | foreach (array_keys($existing) as $hook) { |
41 | - // Normally, preprocess functions are added to the registry after |
|
42 | - // HOOK_theme() returns, but if we add them first, they won't be re-added. |
|
43 | - if (function_exists($theme . '_preprocess')) { |
|
41 | + // Normally, preprocess functions are added to the registry after |
|
42 | + // HOOK_theme() returns, but if we add them first, they won't be re-added. |
|
43 | + if (function_exists($theme . '_preprocess')) { |
|
44 | 44 | $existing[$hook]['preprocess functions'][] = $theme . '_preprocess'; |
45 | - } |
|
46 | - if (function_exists($theme . '_preprocess_' . $hook)) { |
|
45 | + } |
|
46 | + if (function_exists($theme . '_preprocess_' . $hook)) { |
|
47 | 47 | $existing[$hook]['preprocess functions'][] = $theme . '_preprocess_' . $hook; |
48 | - } |
|
49 | - // Add base theme process functions. |
|
50 | - foreach ($base_themes as $base_theme) { |
|
48 | + } |
|
49 | + // Add base theme process functions. |
|
50 | + foreach ($base_themes as $base_theme) { |
|
51 | 51 | if (function_exists($base_theme . '_process')) { |
52 | - $existing[$hook]['preprocess functions'][] = $base_theme . '_process'; |
|
52 | + $existing[$hook]['preprocess functions'][] = $base_theme . '_process'; |
|
53 | 53 | } |
54 | 54 | if (function_exists($base_theme . '_process_' . $hook)) { |
55 | - $existing[$hook]['preprocess functions'][] = $base_theme . '_process_' . $hook; |
|
55 | + $existing[$hook]['preprocess functions'][] = $base_theme . '_process_' . $hook; |
|
56 | + } |
|
56 | 57 | } |
57 | - } |
|
58 | - // Add the theme process functions. |
|
59 | - if (function_exists($theme . '_process')) { |
|
58 | + // Add the theme process functions. |
|
59 | + if (function_exists($theme . '_process')) { |
|
60 | 60 | $existing[$hook]['preprocess functions'][] = $theme . '_process'; |
61 | - } |
|
62 | - if (function_exists($theme . '_process_' . $hook)) { |
|
61 | + } |
|
62 | + if (function_exists($theme . '_process_' . $hook)) { |
|
63 | 63 | $existing[$hook]['preprocess functions'][] = $theme . '_process_' . $hook; |
64 | - } |
|
64 | + } |
|
65 | + } |
|
65 | 66 | } |
66 | - } |
|
67 | 67 | |
68 | - // Manipulations only to be done by the base theme. |
|
69 | - if ($theme == 'zen') { |
|
68 | + // Manipulations only to be done by the base theme. |
|
69 | + if ($theme == 'zen') { |
|
70 | 70 | // Insert zen_show_blocks_discovery() before template_preprocess_page(). |
71 | 71 | $existing['page']['preprocess functions'] = array_merge(array('zen_show_blocks_discovery'), $existing['page']['preprocess functions']); |
72 | 72 | |
@@ -75,14 +75,14 @@ discard block |
||
75 | 75 | |
76 | 76 | // The base theme registers region.tpl.php. |
77 | 77 | $templates = array( |
78 | - 'region' => array( |
|
78 | + 'region' => array( |
|
79 | 79 | 'arguments' => array('elements' => NULL), |
80 | 80 | 'pattern' => 'region_', |
81 | 81 | 'path' => drupal_get_path('theme', 'zen') . '/templates', |
82 | 82 | 'template' => 'region', |
83 | 83 | // drupal_find_theme_templates() requires this, so manually add it. |
84 | 84 | 'include files' => array(), |
85 | - ), |
|
85 | + ), |
|
86 | 86 | ); |
87 | 87 | // We have to manually find template suggestions since phptemplate_theme() |
88 | 88 | // is in charge of that, but runs before zen_theme(). |
@@ -90,18 +90,18 @@ discard block |
||
90 | 90 | // We manually register the preprocess and process functions, since Drupal |
91 | 91 | // won't auto-register template_preprocess or process functions. |
92 | 92 | foreach (array_keys($templates) as $key) { |
93 | - $templates[$key]['preprocess functions'] = array( |
|
93 | + $templates[$key]['preprocess functions'] = array( |
|
94 | 94 | 'template_preprocess', |
95 | 95 | 'zen_preprocess', |
96 | 96 | 'zen_preprocess_region', |
97 | 97 | 'zen_process', |
98 | - ); |
|
98 | + ); |
|
99 | 99 | } |
100 | 100 | return $templates; |
101 | - } |
|
101 | + } |
|
102 | 102 | |
103 | - // Else return nothing. |
|
104 | - return array(); |
|
103 | + // Else return nothing. |
|
104 | + return array(); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | /** |
@@ -111,27 +111,27 @@ discard block |
||
111 | 111 | * The name of theme. |
112 | 112 | */ |
113 | 113 | function zen_theme_get_default_settings($theme) { |
114 | - $themes = list_themes(); |
|
114 | + $themes = list_themes(); |
|
115 | 115 | |
116 | - // Get the default values from the .info file. |
|
117 | - $defaults = !empty($themes[$theme]->info['settings']) ? $themes[$theme]->info['settings'] : array(); |
|
116 | + // Get the default values from the .info file. |
|
117 | + $defaults = !empty($themes[$theme]->info['settings']) ? $themes[$theme]->info['settings'] : array(); |
|
118 | 118 | |
119 | - if (!module_exists('domain_theme') && !empty($defaults)) { |
|
119 | + if (!module_exists('domain_theme') && !empty($defaults)) { |
|
120 | 120 | // Merge the defaults with the theme settings saved in the database. |
121 | 121 | $settings = array_merge($defaults, variable_get('theme_'. $theme .'_settings', array())); |
122 | 122 | // Save the settings back to the database. |
123 | 123 | if (db_is_active()) { |
124 | - variable_set('theme_'. $theme .'_settings', $settings); |
|
124 | + variable_set('theme_'. $theme .'_settings', $settings); |
|
125 | 125 | } |
126 | 126 | else { |
127 | - $GLOBALS['conf']['theme_'. $theme .'_settings'] = $settings; |
|
127 | + $GLOBALS['conf']['theme_'. $theme .'_settings'] = $settings; |
|
128 | 128 | } |
129 | 129 | // If the active theme has been loaded, force refresh of Drupal internals. |
130 | 130 | if (!empty($GLOBALS['theme_key'])) { |
131 | - theme_get_setting('', TRUE); |
|
131 | + theme_get_setting('', TRUE); |
|
132 | + } |
|
132 | 133 | } |
133 | - } |
|
134 | 134 | |
135 | - // Return the default settings. |
|
136 | - return $defaults; |
|
135 | + // Return the default settings. |
|
136 | + return $defaults; |
|
137 | 137 | } |
@@ -14,26 +14,26 @@ |
||
14 | 14 | * If the user is silly and enables Zen as the theme, manually add some stylesheets. |
15 | 15 | */ |
16 | 16 | function _zen_preprocess_page(&$vars, $hook) { |
17 | - $directory = _zen_path() . '/zen-internals/css'; |
|
17 | + $directory = _zen_path() . '/zen-internals/css'; |
|
18 | 18 | |
19 | - // Add default styles. |
|
20 | - if (theme_get_setting('zen_layout') == 'zen-columns-fixed') { |
|
19 | + // Add default styles. |
|
20 | + if (theme_get_setting('zen_layout') == 'zen-columns-fixed') { |
|
21 | 21 | drupal_add_css($directory . '/zen-fixed.css', 'theme', 'all'); |
22 | - } |
|
23 | - else { |
|
22 | + } |
|
23 | + else { |
|
24 | 24 | drupal_add_css($directory . '/zen-liquid.css', 'theme', 'all'); |
25 | - } |
|
26 | - // Add print styles. |
|
27 | - drupal_add_css($directory . '/print.css', 'theme', 'print'); |
|
25 | + } |
|
26 | + // Add print styles. |
|
27 | + drupal_add_css($directory . '/print.css', 'theme', 'print'); |
|
28 | 28 | |
29 | - // Regenerate the stylesheets. |
|
30 | - $vars['css'] = drupal_add_css(); |
|
31 | - $vars['styles'] = drupal_get_css(); |
|
29 | + // Regenerate the stylesheets. |
|
30 | + $vars['css'] = drupal_add_css(); |
|
31 | + $vars['styles'] = drupal_get_css(); |
|
32 | 32 | |
33 | - // Add IE styles. |
|
34 | - $query_string = '?'. substr(variable_get('css_js_query_string', '0'), 0, 1); |
|
35 | - $base_path = base_path() . $directory; |
|
36 | - $vars['styles'] .= <<< IE_STYLES |
|
33 | + // Add IE styles. |
|
34 | + $query_string = '?'. substr(variable_get('css_js_query_string', '0'), 0, 1); |
|
35 | + $base_path = base_path() . $directory; |
|
36 | + $vars['styles'] .= <<< IE_STYLES |
|
37 | 37 | <!--[if IE]><link type="text/css" rel="stylesheet" media="all" href="$base_path/ie.css$query_string" /><![endif]--> |
38 | 38 | <!--[if lte IE 6]><link type="text/css" rel="stylesheet" media="all" href="$base_path/ie6.css$query_string" /><![endif]--> |
39 | 39 |
@@ -13,46 +13,46 @@ |
||
13 | 13 | * The name of the template being rendered ("comment" in this case.) |
14 | 14 | */ |
15 | 15 | function _zen_preprocess_comment(&$vars, $hook) { |
16 | - // In Drupal 7, $date has been renamed to $created. |
|
17 | - $vars['created'] = $vars['date']; |
|
16 | + // In Drupal 7, $date has been renamed to $created. |
|
17 | + $vars['created'] = $vars['date']; |
|
18 | 18 | |
19 | - // If comment subjects are disabled, don't display them. |
|
20 | - if (variable_get('comment_subject_field_' . $vars['node']->type, 1) == 0) { |
|
19 | + // If comment subjects are disabled, don't display them. |
|
20 | + if (variable_get('comment_subject_field_' . $vars['node']->type, 1) == 0) { |
|
21 | 21 | $vars['title'] = ''; |
22 | - } |
|
22 | + } |
|
23 | 23 | |
24 | - // New comment. |
|
25 | - if ($vars['comment']->new) { |
|
24 | + // New comment. |
|
25 | + if ($vars['comment']->new) { |
|
26 | 26 | $vars['classes_array'][] = 'comment-new'; |
27 | - } |
|
28 | - // Add an "unpublished" flag. |
|
29 | - if ($vars['comment']->status == COMMENT_NOT_PUBLISHED) { |
|
27 | + } |
|
28 | + // Add an "unpublished" flag. |
|
29 | + if ($vars['comment']->status == COMMENT_NOT_PUBLISHED) { |
|
30 | 30 | $vars['unpublished'] = TRUE; |
31 | 31 | $vars['classes_array'][] = $vars['status']; |
32 | - } |
|
33 | - else { |
|
32 | + } |
|
33 | + else { |
|
34 | 34 | $vars['unpublished'] = FALSE; |
35 | - } |
|
36 | - // Zebra striping. |
|
37 | - if ($vars['id'] == 1) { |
|
35 | + } |
|
36 | + // Zebra striping. |
|
37 | + if ($vars['id'] == 1) { |
|
38 | 38 | $vars['classes_array'][] = 'first'; |
39 | - } |
|
40 | - if ($vars['id'] == $vars['node']->comment_count) { |
|
39 | + } |
|
40 | + if ($vars['id'] == $vars['node']->comment_count) { |
|
41 | 41 | $vars['classes_array'][] = 'last'; |
42 | - } |
|
43 | - $vars['classes_array'][] = $vars['zebra']; |
|
44 | - if ($vars['comment']->uid == 0) { |
|
42 | + } |
|
43 | + $vars['classes_array'][] = $vars['zebra']; |
|
44 | + if ($vars['comment']->uid == 0) { |
|
45 | 45 | // Comment is by an anonymous user. |
46 | 46 | $vars['classes_array'][] = 'comment-by-anonymous'; |
47 | - } |
|
48 | - else { |
|
47 | + } |
|
48 | + else { |
|
49 | 49 | if ($vars['comment']->uid == $vars['node']->uid) { |
50 | - // Comment is by the node author. |
|
51 | - $vars['classes_array'][] = 'comment-by-node-author'; |
|
50 | + // Comment is by the node author. |
|
51 | + $vars['classes_array'][] = 'comment-by-node-author'; |
|
52 | 52 | } |
53 | 53 | if ($vars['comment']->uid == $GLOBALS['user']->uid) { |
54 | - // Comment was posted by current user. |
|
55 | - $vars['classes_array'][] = 'comment-by-viewer'; |
|
54 | + // Comment was posted by current user. |
|
55 | + $vars['classes_array'][] = 'comment-by-viewer'; |
|
56 | + } |
|
56 | 57 | } |
57 | - } |
|
58 | 58 | } |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | |
14 | 14 | // Auto-rebuild the theme registry during theme development. |
15 | 15 | if (theme_get_setting('zen_rebuild_registry')) { |
16 | - drupal_rebuild_theme_registry(); |
|
16 | + drupal_rebuild_theme_registry(); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | |
@@ -21,9 +21,9 @@ discard block |
||
21 | 21 | * Implements HOOK_theme(). |
22 | 22 | */ |
23 | 23 | function zen_theme(&$existing, $type, $theme, $path) { |
24 | - // When #341140 is fixed, replace _zen_path() with drupal_get_path(). |
|
25 | - include_once './' . _zen_path() . '/zen-internals/template.theme-registry.inc'; |
|
26 | - return _zen_theme($existing, $type, $theme, $path); |
|
24 | + // When #341140 is fixed, replace _zen_path() with drupal_get_path(). |
|
25 | + include_once './' . _zen_path() . '/zen-internals/template.theme-registry.inc'; |
|
26 | + return _zen_theme($existing, $type, $theme, $path); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | /** |
@@ -35,33 +35,33 @@ discard block |
||
35 | 35 | * A string containing the breadcrumb output. |
36 | 36 | */ |
37 | 37 | function zen_breadcrumb($breadcrumb) { |
38 | - // Determine if we are to display the breadcrumb. |
|
39 | - $show_breadcrumb = theme_get_setting('zen_breadcrumb'); |
|
40 | - if ($show_breadcrumb == 'yes' || $show_breadcrumb == 'admin' && arg(0) == 'admin') { |
|
38 | + // Determine if we are to display the breadcrumb. |
|
39 | + $show_breadcrumb = theme_get_setting('zen_breadcrumb'); |
|
40 | + if ($show_breadcrumb == 'yes' || $show_breadcrumb == 'admin' && arg(0) == 'admin') { |
|
41 | 41 | |
42 | 42 | // Optionally get rid of the homepage link. |
43 | 43 | $show_breadcrumb_home = theme_get_setting('zen_breadcrumb_home'); |
44 | 44 | if (!$show_breadcrumb_home) { |
45 | - array_shift($breadcrumb); |
|
45 | + array_shift($breadcrumb); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | // Return the breadcrumb with separators. |
49 | 49 | if (!empty($breadcrumb)) { |
50 | - $breadcrumb_separator = theme_get_setting('zen_breadcrumb_separator'); |
|
51 | - $trailing_separator = $title = ''; |
|
52 | - if (theme_get_setting('zen_breadcrumb_title')) { |
|
50 | + $breadcrumb_separator = theme_get_setting('zen_breadcrumb_separator'); |
|
51 | + $trailing_separator = $title = ''; |
|
52 | + if (theme_get_setting('zen_breadcrumb_title')) { |
|
53 | 53 | if ($title = drupal_get_title()) { |
54 | - $trailing_separator = $breadcrumb_separator; |
|
54 | + $trailing_separator = $breadcrumb_separator; |
|
55 | 55 | } |
56 | - } |
|
57 | - elseif (theme_get_setting('zen_breadcrumb_trailing')) { |
|
56 | + } |
|
57 | + elseif (theme_get_setting('zen_breadcrumb_trailing')) { |
|
58 | 58 | $trailing_separator = $breadcrumb_separator; |
59 | - } |
|
60 | - return '<div class="breadcrumb">' . implode($breadcrumb_separator, $breadcrumb) . "$trailing_separator$title</div>"; |
|
59 | + } |
|
60 | + return '<div class="breadcrumb">' . implode($breadcrumb_separator, $breadcrumb) . "$trailing_separator$title</div>"; |
|
61 | 61 | } |
62 | - } |
|
63 | - // Otherwise, return an empty string. |
|
64 | - return ''; |
|
62 | + } |
|
63 | + // Otherwise, return an empty string. |
|
64 | + return ''; |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
@@ -90,27 +90,27 @@ discard block |
||
90 | 90 | * A string containing an unordered list of links. |
91 | 91 | */ |
92 | 92 | function zen_links($links, $attributes = array('class' => 'links'), $heading = '') { |
93 | - global $language; |
|
94 | - $output = ''; |
|
93 | + global $language; |
|
94 | + $output = ''; |
|
95 | 95 | |
96 | - if (count($links) > 0) { |
|
96 | + if (count($links) > 0) { |
|
97 | 97 | // Treat the heading first if it is present to prepend it to the |
98 | 98 | // list of links. |
99 | 99 | if (!empty($heading)) { |
100 | - if (is_string($heading)) { |
|
100 | + if (is_string($heading)) { |
|
101 | 101 | // Prepare the array that will be used when the passed heading |
102 | 102 | // is a string. |
103 | 103 | $heading = array( |
104 | - 'text' => $heading, |
|
105 | - // Set the default level of the heading. |
|
106 | - 'level' => 'h2', |
|
104 | + 'text' => $heading, |
|
105 | + // Set the default level of the heading. |
|
106 | + 'level' => 'h2', |
|
107 | 107 | ); |
108 | - } |
|
109 | - $output .= '<' . $heading['level']; |
|
110 | - if (!empty($heading['class'])) { |
|
108 | + } |
|
109 | + $output .= '<' . $heading['level']; |
|
110 | + if (!empty($heading['class'])) { |
|
111 | 111 | $output .= drupal_attributes(array('class' => $heading['class'])); |
112 | - } |
|
113 | - $output .= '>' . check_plain($heading['text']) . '</' . $heading['level'] . '>'; |
|
112 | + } |
|
113 | + $output .= '>' . check_plain($heading['text']) . '</' . $heading['level'] . '>'; |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | $output .= '<ul'. drupal_attributes($attributes) .'>'; |
@@ -119,89 +119,89 @@ discard block |
||
119 | 119 | $i = 1; |
120 | 120 | |
121 | 121 | foreach ($links as $key => $link) { |
122 | - $class = $key; |
|
122 | + $class = $key; |
|
123 | 123 | |
124 | - // Add first, last and active classes to the list of links to help out themers. |
|
125 | - if ($i == 1) { |
|
124 | + // Add first, last and active classes to the list of links to help out themers. |
|
125 | + if ($i == 1) { |
|
126 | 126 | $class .= ' first'; |
127 | - } |
|
128 | - if ($i == $num_links) { |
|
127 | + } |
|
128 | + if ($i == $num_links) { |
|
129 | 129 | $class .= ' last'; |
130 | - } |
|
131 | - if (isset($link['href']) && ($link['href'] == $_GET['q'] || ($link['href'] == '<front>' && drupal_is_front_page())) |
|
130 | + } |
|
131 | + if (isset($link['href']) && ($link['href'] == $_GET['q'] || ($link['href'] == '<front>' && drupal_is_front_page())) |
|
132 | 132 | && (empty($link['language']) || $link['language']->language == $language->language)) { |
133 | 133 | $class .= ' active'; |
134 | - } |
|
135 | - $output .= '<li'. drupal_attributes(array('class' => $class)) .'>'; |
|
134 | + } |
|
135 | + $output .= '<li'. drupal_attributes(array('class' => $class)) .'>'; |
|
136 | 136 | |
137 | - if (isset($link['href'])) { |
|
137 | + if (isset($link['href'])) { |
|
138 | 138 | // Pass in $link as $options, they share the same keys. |
139 | 139 | $output .= l($link['title'], $link['href'], $link); |
140 | - } |
|
141 | - else if (!empty($link['title'])) { |
|
140 | + } |
|
141 | + else if (!empty($link['title'])) { |
|
142 | 142 | // Some links are actually not links, but we wrap these in <span> for adding title and class attributes |
143 | 143 | if (empty($link['html'])) { |
144 | - $link['title'] = check_plain($link['title']); |
|
144 | + $link['title'] = check_plain($link['title']); |
|
145 | 145 | } |
146 | 146 | $span_attributes = ''; |
147 | 147 | if (isset($link['attributes'])) { |
148 | - $span_attributes = drupal_attributes($link['attributes']); |
|
148 | + $span_attributes = drupal_attributes($link['attributes']); |
|
149 | 149 | } |
150 | 150 | $output .= '<span'. $span_attributes .'>'. $link['title'] .'</span>'; |
151 | - } |
|
151 | + } |
|
152 | 152 | |
153 | - $i++; |
|
154 | - $output .= "</li>\n"; |
|
153 | + $i++; |
|
154 | + $output .= "</li>\n"; |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | $output .= '</ul>'; |
158 | - } |
|
158 | + } |
|
159 | 159 | |
160 | - return $output; |
|
160 | + return $output; |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | /** |
164 | 164 | * Implements theme_menu_item_link() |
165 | 165 | */ |
166 | 166 | function zen_menu_item_link($link) { |
167 | - if (empty($link['localized_options'])) { |
|
167 | + if (empty($link['localized_options'])) { |
|
168 | 168 | $link['localized_options'] = array(); |
169 | - } |
|
169 | + } |
|
170 | 170 | |
171 | - // If an item is a LOCAL TASK, render it as a tab |
|
172 | - if ($link['type'] & MENU_IS_LOCAL_TASK) { |
|
171 | + // If an item is a LOCAL TASK, render it as a tab |
|
172 | + if ($link['type'] & MENU_IS_LOCAL_TASK) { |
|
173 | 173 | $link['title'] = '<span class="tab">' . check_plain($link['title']) . '</span>'; |
174 | 174 | $link['localized_options']['html'] = TRUE; |
175 | - } |
|
175 | + } |
|
176 | 176 | |
177 | - return l($link['title'], $link['href'], $link['localized_options']); |
|
177 | + return l($link['title'], $link['href'], $link['localized_options']); |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | /** |
181 | 181 | * Duplicate of theme_menu_local_tasks() but adds clearfix to tabs. |
182 | 182 | */ |
183 | 183 | function zen_menu_local_tasks() { |
184 | - $output = ''; |
|
184 | + $output = ''; |
|
185 | 185 | |
186 | - // CTools requires a different set of local task functions. |
|
187 | - if (module_exists('ctools')) { |
|
186 | + // CTools requires a different set of local task functions. |
|
187 | + if (module_exists('ctools')) { |
|
188 | 188 | ctools_include('menu'); |
189 | 189 | $primary = ctools_menu_primary_local_tasks(); |
190 | 190 | $secondary = ctools_menu_secondary_local_tasks(); |
191 | - } |
|
192 | - else { |
|
191 | + } |
|
192 | + else { |
|
193 | 193 | $primary = menu_primary_local_tasks(); |
194 | 194 | $secondary = menu_secondary_local_tasks(); |
195 | - } |
|
195 | + } |
|
196 | 196 | |
197 | - if ($primary) { |
|
197 | + if ($primary) { |
|
198 | 198 | $output .= '<ul class="tabs primary clearfix">' . $primary . '</ul>'; |
199 | - } |
|
200 | - if ($secondary) { |
|
199 | + } |
|
200 | + if ($secondary) { |
|
201 | 201 | $output .= '<ul class="tabs secondary clearfix">' . $secondary . '</ul>'; |
202 | - } |
|
202 | + } |
|
203 | 203 | |
204 | - return $output; |
|
204 | + return $output; |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | /** |
@@ -218,32 +218,32 @@ discard block |
||
218 | 218 | * @see zen_show_blocks_discovery() |
219 | 219 | */ |
220 | 220 | function zen_blocks($region, $show_blocks = NULL) { |
221 | - // Since Drupal 6 doesn't pass $show_blocks to theme_blocks, we manually call |
|
222 | - // theme('blocks', NULL, $show_blocks) so that this function can remember the |
|
223 | - // value on later calls. |
|
224 | - static $render_sidebars = TRUE; |
|
225 | - if (!is_null($show_blocks)) { |
|
221 | + // Since Drupal 6 doesn't pass $show_blocks to theme_blocks, we manually call |
|
222 | + // theme('blocks', NULL, $show_blocks) so that this function can remember the |
|
223 | + // value on later calls. |
|
224 | + static $render_sidebars = TRUE; |
|
225 | + if (!is_null($show_blocks)) { |
|
226 | 226 | $render_sidebars = $show_blocks; |
227 | - } |
|
227 | + } |
|
228 | 228 | |
229 | - // If zen_blocks was called with a NULL region, its likely we were just |
|
230 | - // setting the $render_sidebars static variable. |
|
231 | - if ($region) { |
|
229 | + // If zen_blocks was called with a NULL region, its likely we were just |
|
230 | + // setting the $render_sidebars static variable. |
|
231 | + if ($region) { |
|
232 | 232 | $output = ''; |
233 | 233 | |
234 | 234 | // If $renders_sidebars is FALSE, don't render any region whose name begins |
235 | 235 | // with "sidebar_". |
236 | 236 | if ($render_sidebars || (strpos($region, 'sidebar_') !== 0)) { |
237 | - // Allow context module to set blocks. |
|
238 | - if (function_exists('context_blocks')) { |
|
237 | + // Allow context module to set blocks. |
|
238 | + if (function_exists('context_blocks')) { |
|
239 | 239 | $output = context_blocks($region); |
240 | - } |
|
241 | - else { |
|
240 | + } |
|
241 | + else { |
|
242 | 242 | foreach (block_list($region) as $key => $block) { |
243 | - // $key == module_delta |
|
244 | - $output .= theme('block', $block); |
|
243 | + // $key == module_delta |
|
244 | + $output .= theme('block', $block); |
|
245 | + } |
|
245 | 246 | } |
246 | - } |
|
247 | 247 | } |
248 | 248 | |
249 | 249 | // Add any content assigned to this region through drupal_set_content() calls. |
@@ -255,11 +255,11 @@ discard block |
||
255 | 255 | // Set the theme hook suggestions. |
256 | 256 | $hook = array('region_' . $region); |
257 | 257 | if (strpos($region, 'sidebar_') === 0) { |
258 | - $hook[] = 'region_sidebar'; |
|
258 | + $hook[] = 'region_sidebar'; |
|
259 | 259 | } |
260 | 260 | $hook[] = 'region'; |
261 | 261 | return $output ? theme($hook, $elements) : ''; |
262 | - } |
|
262 | + } |
|
263 | 263 | } |
264 | 264 | |
265 | 265 | /** |
@@ -271,11 +271,11 @@ discard block |
||
271 | 271 | * @see zen_blocks() |
272 | 272 | */ |
273 | 273 | function zen_show_blocks_discovery(&$vars) { |
274 | - if ($vars['show_blocks'] == FALSE) { |
|
274 | + if ($vars['show_blocks'] == FALSE) { |
|
275 | 275 | // Allow zen_blocks() to statically cache the $show_blocks variable. A TRUE |
276 | 276 | // value is assumed, so we only need to override when $show_blocks is FALSE. |
277 | 277 | theme('blocks', NULL, FALSE); |
278 | - } |
|
278 | + } |
|
279 | 279 | } |
280 | 280 | |
281 | 281 | /** |
@@ -287,25 +287,25 @@ discard block |
||
287 | 287 | * The name of the template being rendered. |
288 | 288 | */ |
289 | 289 | function zen_preprocess(&$vars, $hook) { |
290 | - // In D6, the page.tpl uses a different variable name to hold the classes. |
|
291 | - $key = ($hook == 'page' || $hook == 'maintenance_page') ? 'body_classes' : 'classes'; |
|
290 | + // In D6, the page.tpl uses a different variable name to hold the classes. |
|
291 | + $key = ($hook == 'page' || $hook == 'maintenance_page') ? 'body_classes' : 'classes'; |
|
292 | 292 | |
293 | - // Create a D7-standard classes_array variable. |
|
294 | - if (array_key_exists($key, $vars)) { |
|
293 | + // Create a D7-standard classes_array variable. |
|
294 | + if (array_key_exists($key, $vars)) { |
|
295 | 295 | // Views (and possibly other modules) have templates with a $classes |
296 | 296 | // variable that isn't a string, so we leave those variables alone. |
297 | 297 | if (is_string($vars[$key])) { |
298 | - $vars['classes_array'] = explode(' ', $hook . ' ' . $vars[$key]); |
|
299 | - unset($vars[$key]); |
|
298 | + $vars['classes_array'] = explode(' ', $hook . ' ' . $vars[$key]); |
|
299 | + unset($vars[$key]); |
|
300 | + } |
|
300 | 301 | } |
301 | - } |
|
302 | - else { |
|
302 | + else { |
|
303 | 303 | $vars['classes_array'] = array($hook); |
304 | - } |
|
305 | - // Add support for Skinr |
|
306 | - if (!empty($vars['skinr']) && array_key_exists('classes_array', $vars)) { |
|
304 | + } |
|
305 | + // Add support for Skinr |
|
306 | + if (!empty($vars['skinr']) && array_key_exists('classes_array', $vars)) { |
|
307 | 307 | $vars['classes_array'][] = $vars['skinr']; |
308 | - } |
|
308 | + } |
|
309 | 309 | } |
310 | 310 | |
311 | 311 | /** |
@@ -317,82 +317,82 @@ discard block |
||
317 | 317 | * The name of the template being rendered ("page" in this case.) |
318 | 318 | */ |
319 | 319 | function zen_preprocess_page(&$vars, $hook) { |
320 | - // If the user is silly and enables Zen as the theme, add some styles. |
|
321 | - if ($GLOBALS['theme'] == 'zen') { |
|
320 | + // If the user is silly and enables Zen as the theme, add some styles. |
|
321 | + if ($GLOBALS['theme'] == 'zen') { |
|
322 | 322 | include_once './' . _zen_path() . '/zen-internals/template.zen.inc'; |
323 | 323 | _zen_preprocess_page($vars, $hook); |
324 | - } |
|
325 | - // Add conditional stylesheets. |
|
326 | - elseif (!module_exists('conditional_styles')) { |
|
324 | + } |
|
325 | + // Add conditional stylesheets. |
|
326 | + elseif (!module_exists('conditional_styles')) { |
|
327 | 327 | $language = $GLOBALS['language']->direction == LANGUAGE_RTL ? '_rtl' : ''; |
328 | 328 | $vars['conditional_styles'] = variable_get('conditional_styles_' . $GLOBALS['theme'] . $language, ''); |
329 | 329 | $vars['styles'] .= $vars['conditional_styles']; |
330 | - } |
|
330 | + } |
|
331 | 331 | |
332 | - // Classes for body element. Allows advanced theming based on context |
|
333 | - // (home page, node of certain type, etc.) |
|
334 | - // Remove the mostly useless page-ARG0 class. |
|
335 | - if ($index = array_search(preg_replace('![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s', '', 'page-'. drupal_strtolower(arg(0))), $vars['classes_array'])) { |
|
332 | + // Classes for body element. Allows advanced theming based on context |
|
333 | + // (home page, node of certain type, etc.) |
|
334 | + // Remove the mostly useless page-ARG0 class. |
|
335 | + if ($index = array_search(preg_replace('![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s', '', 'page-'. drupal_strtolower(arg(0))), $vars['classes_array'])) { |
|
336 | 336 | unset($vars['classes_array'][$index]); |
337 | - } |
|
338 | - if (!$vars['is_front']) { |
|
337 | + } |
|
338 | + if (!$vars['is_front']) { |
|
339 | 339 | // Add unique class for each page. |
340 | 340 | $path = drupal_get_path_alias($_GET['q']); |
341 | 341 | $vars['classes_array'][] = drupal_html_class('page-' . $path); |
342 | 342 | // Add unique class for each website section. |
343 | 343 | list($section, ) = explode('/', $path, 2); |
344 | 344 | if (arg(0) == 'node') { |
345 | - if (arg(1) == 'add') { |
|
345 | + if (arg(1) == 'add') { |
|
346 | 346 | $section = 'node-add'; |
347 | - } |
|
348 | - elseif (is_numeric(arg(1)) && (arg(2) == 'edit' || arg(2) == 'delete')) { |
|
347 | + } |
|
348 | + elseif (is_numeric(arg(1)) && (arg(2) == 'edit' || arg(2) == 'delete')) { |
|
349 | 349 | $section = 'node-' . arg(2); |
350 | - } |
|
350 | + } |
|
351 | 351 | } |
352 | 352 | $vars['classes_array'][] = drupal_html_class('section-' . $section); |
353 | - } |
|
354 | - if (theme_get_setting('zen_wireframes')) { |
|
353 | + } |
|
354 | + if (theme_get_setting('zen_wireframes')) { |
|
355 | 355 | $vars['classes_array'][] = 'with-wireframes'; // Optionally add the wireframes style. |
356 | - } |
|
357 | - // We need to re-do the $layout and body classes because |
|
358 | - // template_preprocess_page() assumes sidebars are named 'left' and 'right'. |
|
359 | - $vars['layout'] = 'none'; |
|
360 | - if (!empty($vars['sidebar_first'])) { |
|
356 | + } |
|
357 | + // We need to re-do the $layout and body classes because |
|
358 | + // template_preprocess_page() assumes sidebars are named 'left' and 'right'. |
|
359 | + $vars['layout'] = 'none'; |
|
360 | + if (!empty($vars['sidebar_first'])) { |
|
361 | 361 | $vars['layout'] = 'first'; |
362 | - } |
|
363 | - if (!empty($vars['sidebar_second'])) { |
|
362 | + } |
|
363 | + if (!empty($vars['sidebar_second'])) { |
|
364 | 364 | $vars['layout'] = ($vars['layout'] == 'first') ? 'both' : 'second'; |
365 | - } |
|
366 | - // If the layout is 'none', then template_preprocess_page() will already have |
|
367 | - // set a 'no-sidebars' class since it won't find a 'left' or 'right' sidebar. |
|
368 | - if ($vars['layout'] != 'none') { |
|
365 | + } |
|
366 | + // If the layout is 'none', then template_preprocess_page() will already have |
|
367 | + // set a 'no-sidebars' class since it won't find a 'left' or 'right' sidebar. |
|
368 | + if ($vars['layout'] != 'none') { |
|
369 | 369 | // Remove the incorrect 'no-sidebars' class. |
370 | 370 | if ($index = array_search('no-sidebars', $vars['classes_array'])) { |
371 | - unset($vars['classes_array'][$index]); |
|
371 | + unset($vars['classes_array'][$index]); |
|
372 | 372 | } |
373 | 373 | // Set the proper layout body classes. |
374 | 374 | if ($vars['layout'] == 'both') { |
375 | - $vars['classes_array'][] = 'two-sidebars'; |
|
375 | + $vars['classes_array'][] = 'two-sidebars'; |
|
376 | 376 | } |
377 | 377 | else { |
378 | - $vars['classes_array'][] = 'one-sidebar'; |
|
379 | - $vars['classes_array'][] = 'sidebar-' . $vars['layout']; |
|
378 | + $vars['classes_array'][] = 'one-sidebar'; |
|
379 | + $vars['classes_array'][] = 'sidebar-' . $vars['layout']; |
|
380 | + } |
|
380 | 381 | } |
381 | - } |
|
382 | - // Store the menu item since it has some useful information. |
|
383 | - $vars['menu_item'] = menu_get_item(); |
|
384 | - switch ($vars['menu_item']['page_callback']) { |
|
382 | + // Store the menu item since it has some useful information. |
|
383 | + $vars['menu_item'] = menu_get_item(); |
|
384 | + switch ($vars['menu_item']['page_callback']) { |
|
385 | 385 | case 'views_page': |
386 | 386 | // Is this a Views page? |
387 | 387 | $vars['classes_array'][] = 'page-views'; |
388 | - break; |
|
388 | + break; |
|
389 | 389 | case 'page_manager_page_execute': |
390 | 390 | case 'page_manager_node_view': |
391 | 391 | case 'page_manager_contact_site': |
392 | 392 | // Is this a Panels page? |
393 | 393 | $vars['classes_array'][] = 'page-panels'; |
394 | - break; |
|
395 | - } |
|
394 | + break; |
|
395 | + } |
|
396 | 396 | } |
397 | 397 | |
398 | 398 | /** |
@@ -404,17 +404,17 @@ discard block |
||
404 | 404 | * The name of the template being rendered ("maintenance_page" in this case.) |
405 | 405 | */ |
406 | 406 | function zen_preprocess_maintenance_page(&$vars, $hook) { |
407 | - // If Zen is the maintenance theme, add some styles. |
|
408 | - if ($GLOBALS['theme'] == 'zen') { |
|
407 | + // If Zen is the maintenance theme, add some styles. |
|
408 | + if ($GLOBALS['theme'] == 'zen') { |
|
409 | 409 | include_once './' . _zen_path() . '/zen-internals/template.zen.inc'; |
410 | 410 | _zen_preprocess_page($vars, $hook); |
411 | - } |
|
412 | - // Add conditional stylesheets. |
|
413 | - elseif (!module_exists('conditional_styles')) { |
|
411 | + } |
|
412 | + // Add conditional stylesheets. |
|
413 | + elseif (!module_exists('conditional_styles')) { |
|
414 | 414 | $language = $GLOBALS['language']->direction == LANGUAGE_RTL ? '_rtl' : ''; |
415 | 415 | $vars['conditional_styles'] = variable_get('conditional_styles_' . $GLOBALS['theme'] . $language, ''); |
416 | 416 | $vars['styles'] .= $vars['conditional_styles']; |
417 | - } |
|
417 | + } |
|
418 | 418 | } |
419 | 419 | |
420 | 420 | /** |
@@ -426,67 +426,67 @@ discard block |
||
426 | 426 | * The name of the template being rendered ("node" in this case.) |
427 | 427 | */ |
428 | 428 | function zen_preprocess_node(&$vars, $hook) { |
429 | - // Create the build_mode variable. |
|
430 | - switch ($vars['node']->build_mode) { |
|
429 | + // Create the build_mode variable. |
|
430 | + switch ($vars['node']->build_mode) { |
|
431 | 431 | case NODE_BUILD_NORMAL: |
432 | 432 | if ($vars['node']->build_mode === NODE_BUILD_NORMAL) { |
433 | 433 | $vars['build_mode'] = $vars['teaser'] ? 'teaser' : 'full'; |
434 | - } |
|
435 | - else { |
|
434 | + } |
|
435 | + else { |
|
436 | 436 | $vars['build_mode'] = $vars['node']->build_mode; |
437 | - } |
|
438 | - break; |
|
437 | + } |
|
438 | + break; |
|
439 | 439 | case NODE_BUILD_PREVIEW: |
440 | 440 | $vars['build_mode'] = 'preview'; |
441 | - break; |
|
441 | + break; |
|
442 | 442 | case NODE_BUILD_SEARCH_INDEX: |
443 | 443 | $vars['build_mode'] = 'search_index'; |
444 | - break; |
|
444 | + break; |
|
445 | 445 | case NODE_BUILD_SEARCH_RESULT: |
446 | 446 | $vars['build_mode'] = 'search_result'; |
447 | - break; |
|
447 | + break; |
|
448 | 448 | case NODE_BUILD_RSS: |
449 | 449 | $vars['build_mode'] = 'rss'; |
450 | - break; |
|
450 | + break; |
|
451 | 451 | case NODE_BUILD_PRINT: |
452 | 452 | $vars['build_mode'] = 'print'; |
453 | - break; |
|
453 | + break; |
|
454 | 454 | default: |
455 | 455 | $vars['build_mode'] = $vars['node']->build_mode; |
456 | - } |
|
456 | + } |
|
457 | 457 | |
458 | - // Create the user_picture variable. |
|
459 | - $vars['user_picture'] = $vars['picture']; |
|
458 | + // Create the user_picture variable. |
|
459 | + $vars['user_picture'] = $vars['picture']; |
|
460 | 460 | |
461 | - // Create the Drupal 7 $display_submitted variable. |
|
462 | - $vars['display_submitted'] = theme_get_setting('toggle_node_info_' . $vars['node']->type); |
|
461 | + // Create the Drupal 7 $display_submitted variable. |
|
462 | + $vars['display_submitted'] = theme_get_setting('toggle_node_info_' . $vars['node']->type); |
|
463 | 463 | |
464 | - // Special classes for nodes. |
|
465 | - // Class for node type: "node-type-page", "node-type-story", "node-type-my-custom-type", etc. |
|
466 | - $vars['classes_array'][] = drupal_html_class('node-type-' . $vars['type']); |
|
467 | - if ($vars['promote']) { |
|
464 | + // Special classes for nodes. |
|
465 | + // Class for node type: "node-type-page", "node-type-story", "node-type-my-custom-type", etc. |
|
466 | + $vars['classes_array'][] = drupal_html_class('node-type-' . $vars['type']); |
|
467 | + if ($vars['promote']) { |
|
468 | 468 | $vars['classes_array'][] = 'node-promoted'; |
469 | - } |
|
470 | - if ($vars['sticky']) { |
|
469 | + } |
|
470 | + if ($vars['sticky']) { |
|
471 | 471 | $vars['classes_array'][] = 'node-sticky'; |
472 | - } |
|
473 | - if (!$vars['status']) { |
|
472 | + } |
|
473 | + if (!$vars['status']) { |
|
474 | 474 | $vars['classes_array'][] = 'node-unpublished'; |
475 | 475 | $vars['unpublished'] = TRUE; |
476 | - } |
|
477 | - else { |
|
476 | + } |
|
477 | + else { |
|
478 | 478 | $vars['unpublished'] = FALSE; |
479 | - } |
|
480 | - if ($vars['uid'] && $vars['uid'] == $GLOBALS['user']->uid) { |
|
479 | + } |
|
480 | + if ($vars['uid'] && $vars['uid'] == $GLOBALS['user']->uid) { |
|
481 | 481 | $vars['classes_array'][] = 'node-by-viewer'; // Node is authored by current user. |
482 | - } |
|
483 | - if ($vars['teaser']) { |
|
482 | + } |
|
483 | + if ($vars['teaser']) { |
|
484 | 484 | $vars['classes_array'][] = 'node-teaser'; // Node is displayed as teaser. |
485 | - } |
|
486 | - if (isset($vars['preview'])) { |
|
485 | + } |
|
486 | + if (isset($vars['preview'])) { |
|
487 | 487 | $vars['classes_array'][] = 'node-preview'; |
488 | - } |
|
489 | - $vars['classes_array'][] = 'build-mode-' . $vars['build_mode'] ; |
|
488 | + } |
|
489 | + $vars['classes_array'][] = 'build-mode-' . $vars['build_mode'] ; |
|
490 | 490 | } |
491 | 491 | |
492 | 492 | /** |
@@ -498,8 +498,8 @@ discard block |
||
498 | 498 | * The name of the template being rendered ("comment" in this case.) |
499 | 499 | */ |
500 | 500 | function zen_preprocess_comment(&$vars, $hook) { |
501 | - include_once './' . _zen_path() . '/zen-internals/template.comment.inc'; |
|
502 | - _zen_preprocess_comment($vars, $hook); |
|
501 | + include_once './' . _zen_path() . '/zen-internals/template.comment.inc'; |
|
502 | + _zen_preprocess_comment($vars, $hook); |
|
503 | 503 | } |
504 | 504 | |
505 | 505 | /** |
@@ -511,18 +511,18 @@ discard block |
||
511 | 511 | * @see region.tpl.php |
512 | 512 | */ |
513 | 513 | function zen_preprocess_region(&$vars, $hook) { |
514 | - // Create the $content variable that templates expect. |
|
515 | - $vars['content'] = $vars['elements']['#children']; |
|
516 | - $vars['region'] = $vars['elements']['#region']; |
|
514 | + // Create the $content variable that templates expect. |
|
515 | + $vars['content'] = $vars['elements']['#children']; |
|
516 | + $vars['region'] = $vars['elements']['#region']; |
|
517 | 517 | |
518 | - // Setup the default classes. |
|
519 | - $vars['classes_array'] = array('region', 'region-' . str_replace('_', '-', $vars['region'])); |
|
518 | + // Setup the default classes. |
|
519 | + $vars['classes_array'] = array('region', 'region-' . str_replace('_', '-', $vars['region'])); |
|
520 | 520 | |
521 | - // Sidebar regions get a couple extra classes. |
|
522 | - if (strpos($vars['region'], 'sidebar_') === 0) { |
|
521 | + // Sidebar regions get a couple extra classes. |
|
522 | + if (strpos($vars['region'], 'sidebar_') === 0) { |
|
523 | 523 | $vars['classes_array'][] = 'column'; |
524 | 524 | $vars['classes_array'][] = 'sidebar'; |
525 | - } |
|
525 | + } |
|
526 | 526 | } |
527 | 527 | |
528 | 528 | /** |
@@ -534,36 +534,36 @@ discard block |
||
534 | 534 | * The name of the template being rendered ("block" in this case.) |
535 | 535 | */ |
536 | 536 | function zen_preprocess_block(&$vars, $hook) { |
537 | - $block = $vars['block']; |
|
537 | + $block = $vars['block']; |
|
538 | 538 | |
539 | - // Drupal 7 uses a $content variable instead of $block->content. |
|
540 | - $vars['content'] = $block->content; |
|
541 | - // Drupal 7 should use a $title variable instead of $block->subject. |
|
542 | - $vars['title'] = $block->subject; |
|
539 | + // Drupal 7 uses a $content variable instead of $block->content. |
|
540 | + $vars['content'] = $block->content; |
|
541 | + // Drupal 7 should use a $title variable instead of $block->subject. |
|
542 | + $vars['title'] = $block->subject; |
|
543 | 543 | |
544 | - // Special classes for blocks. |
|
545 | - $vars['classes_array'][] = 'block-' . $block->module; |
|
546 | - // Classes describing the position of the block within the region. |
|
547 | - if ($vars['block_id'] == 1) { |
|
544 | + // Special classes for blocks. |
|
545 | + $vars['classes_array'][] = 'block-' . $block->module; |
|
546 | + // Classes describing the position of the block within the region. |
|
547 | + if ($vars['block_id'] == 1) { |
|
548 | 548 | $vars['classes_array'][] = 'first'; |
549 | - } |
|
550 | - if (!function_exists('context_blocks') && count(block_list($vars['block']->region)) == $vars['block_id']) { |
|
549 | + } |
|
550 | + if (!function_exists('context_blocks') && count(block_list($vars['block']->region)) == $vars['block_id']) { |
|
551 | 551 | $vars['classes_array'][] = 'last'; |
552 | - } |
|
553 | - $vars['classes_array'][] = 'region-' . $vars['block_zebra']; |
|
554 | - $vars['classes_array'][] = $vars['zebra']; |
|
555 | - $vars['classes_array'][] = 'region-count-' . $vars['block_id']; |
|
556 | - $vars['classes_array'][] = 'count-' . $vars['id']; |
|
552 | + } |
|
553 | + $vars['classes_array'][] = 'region-' . $vars['block_zebra']; |
|
554 | + $vars['classes_array'][] = $vars['zebra']; |
|
555 | + $vars['classes_array'][] = 'region-count-' . $vars['block_id']; |
|
556 | + $vars['classes_array'][] = 'count-' . $vars['id']; |
|
557 | 557 | |
558 | - // Create the block ID. |
|
559 | - $vars['block_html_id'] = 'block-' . $block->module . '-' . $block->delta; |
|
558 | + // Create the block ID. |
|
559 | + $vars['block_html_id'] = 'block-' . $block->module . '-' . $block->delta; |
|
560 | 560 | |
561 | - $vars['edit_links_array'] = array(); |
|
562 | - if (theme_get_setting('zen_block_editing') && user_access('administer blocks')) { |
|
561 | + $vars['edit_links_array'] = array(); |
|
562 | + if (theme_get_setting('zen_block_editing') && user_access('administer blocks')) { |
|
563 | 563 | include_once './' . _zen_path() . '/zen-internals/template.block-editing.inc'; |
564 | 564 | zen_preprocess_block_editing($vars, $hook); |
565 | 565 | $vars['classes_array'][] = 'with-block-editing'; |
566 | - } |
|
566 | + } |
|
567 | 567 | } |
568 | 568 | |
569 | 569 | /** |
@@ -575,10 +575,10 @@ discard block |
||
575 | 575 | * The name of the template being rendered. |
576 | 576 | */ |
577 | 577 | function zen_process(&$vars, $hook) { |
578 | - // Don't clobber Views 3 classes. |
|
579 | - if (array_key_exists('classes_array', $vars) && !array_key_exists('classes', $vars)) { |
|
578 | + // Don't clobber Views 3 classes. |
|
579 | + if (array_key_exists('classes_array', $vars) && !array_key_exists('classes', $vars)) { |
|
580 | 580 | $vars['classes'] = implode(' ', $vars['classes_array']); |
581 | - } |
|
581 | + } |
|
582 | 582 | } |
583 | 583 | |
584 | 584 | /** |
@@ -590,22 +590,22 @@ discard block |
||
590 | 590 | * The name of the template being rendered ("block" in this case.) |
591 | 591 | */ |
592 | 592 | function zen_process_block(&$vars, $hook) { |
593 | - $vars['edit_links'] = !empty($vars['edit_links_array']) ? '<div class="edit">' . implode(' ', $vars['edit_links_array']) . '</div>' : ''; |
|
593 | + $vars['edit_links'] = !empty($vars['edit_links_array']) ? '<div class="edit">' . implode(' ', $vars['edit_links_array']) . '</div>' : ''; |
|
594 | 594 | } |
595 | 595 | |
596 | 596 | if (!function_exists('drupal_html_class')) { |
597 | - /** |
|
598 | - * Prepare a string for use as a valid class name. |
|
599 | - * |
|
600 | - * Do not pass one string containing multiple classes as they will be |
|
601 | - * incorrectly concatenated with dashes, i.e. "one two" will become "one-two". |
|
602 | - * |
|
603 | - * @param $class |
|
604 | - * The class name to clean. |
|
605 | - * @return |
|
606 | - * The cleaned class name. |
|
607 | - */ |
|
608 | - function drupal_html_class($class) { |
|
597 | + /** |
|
598 | + * Prepare a string for use as a valid class name. |
|
599 | + * |
|
600 | + * Do not pass one string containing multiple classes as they will be |
|
601 | + * incorrectly concatenated with dashes, i.e. "one two" will become "one-two". |
|
602 | + * |
|
603 | + * @param $class |
|
604 | + * The class name to clean. |
|
605 | + * @return |
|
606 | + * The cleaned class name. |
|
607 | + */ |
|
608 | + function drupal_html_class($class) { |
|
609 | 609 | // By default, we filter using Drupal's coding standards. |
610 | 610 | $class = strtr(drupal_strtolower($class), array(' ' => '-', '_' => '-', '/' => '-', '[' => '-', ']' => '')); |
611 | 611 | |
@@ -623,19 +623,19 @@ discard block |
||
623 | 623 | $class = preg_replace('/[^\x{002D}\x{0030}-\x{0039}\x{0041}-\x{005A}\x{005F}\x{0061}-\x{007A}\x{00A1}-\x{FFFF}]/u', '', $class); |
624 | 624 | |
625 | 625 | return $class; |
626 | - } |
|
626 | + } |
|
627 | 627 | } /* End of drupal_html_class conditional definition. */ |
628 | 628 | |
629 | 629 | if (!function_exists('drupal_html_id')) { |
630 | - /** |
|
631 | - * Prepare a string for use as a valid HTML ID and guarantee uniqueness. |
|
632 | - * |
|
633 | - * @param $id |
|
634 | - * The ID to clean. |
|
635 | - * @return |
|
636 | - * The cleaned ID. |
|
637 | - */ |
|
638 | - function drupal_html_id($id) { |
|
630 | + /** |
|
631 | + * Prepare a string for use as a valid HTML ID and guarantee uniqueness. |
|
632 | + * |
|
633 | + * @param $id |
|
634 | + * The ID to clean. |
|
635 | + * @return |
|
636 | + * The cleaned ID. |
|
637 | + */ |
|
638 | + function drupal_html_id($id) { |
|
639 | 639 | $id = strtr(drupal_strtolower($id), array(' ' => '-', '_' => '-', '[' => '-', ']' => '')); |
640 | 640 | |
641 | 641 | // As defined in http://www.w3.org/TR/html4/types.html#type-name, HTML IDs can |
@@ -647,7 +647,7 @@ discard block |
||
647 | 647 | $id = preg_replace('/[^A-Za-z0-9\-_]/', '', $id); |
648 | 648 | |
649 | 649 | return $id; |
650 | - } |
|
650 | + } |
|
651 | 651 | } /* End of drupal_html_id conditional definition. */ |
652 | 652 | |
653 | 653 | /** |
@@ -657,12 +657,12 @@ discard block |
||
657 | 657 | * replace _zen_path() with drupal_get_path('theme', 'zen'). |
658 | 658 | */ |
659 | 659 | function _zen_path() { |
660 | - static $path = FALSE; |
|
661 | - if (!$path) { |
|
660 | + static $path = FALSE; |
|
661 | + if (!$path) { |
|
662 | 662 | $matches = drupal_system_listing('zen\.info$', 'themes', 'name', 0); |
663 | 663 | if (!empty($matches['zen']->filename)) { |
664 | - $path = dirname($matches['zen']->filename); |
|
664 | + $path = dirname($matches['zen']->filename); |
|
665 | + } |
|
665 | 666 | } |
666 | - } |
|
667 | - return $path; |
|
667 | + return $path; |
|
668 | 668 | } |
@@ -15,51 +15,51 @@ discard block |
||
15 | 15 | */ |
16 | 16 | function zen_settings($saved_settings, $subtheme_defaults = array()) { |
17 | 17 | |
18 | - // Add the form's CSS |
|
19 | - drupal_add_css(drupal_get_path('theme', 'zen') . '/zen-internals/css/theme-settings.css', 'theme'); |
|
18 | + // Add the form's CSS |
|
19 | + drupal_add_css(drupal_get_path('theme', 'zen') . '/zen-internals/css/theme-settings.css', 'theme'); |
|
20 | 20 | |
21 | - // Add javascript to show/hide optional settings |
|
22 | - drupal_add_js(drupal_get_path('theme', 'zen') . '/zen-internals/js/theme-settings.js', 'theme'); |
|
21 | + // Add javascript to show/hide optional settings |
|
22 | + drupal_add_js(drupal_get_path('theme', 'zen') . '/zen-internals/js/theme-settings.js', 'theme'); |
|
23 | 23 | |
24 | - // Get the default values from the .info file. |
|
25 | - $defaults = zen_theme_get_default_settings('zen'); |
|
24 | + // Get the default values from the .info file. |
|
25 | + $defaults = zen_theme_get_default_settings('zen'); |
|
26 | 26 | |
27 | - // Allow a subtheme to override the default values. |
|
28 | - $defaults = array_merge($defaults, $subtheme_defaults); |
|
27 | + // Allow a subtheme to override the default values. |
|
28 | + $defaults = array_merge($defaults, $subtheme_defaults); |
|
29 | 29 | |
30 | - // Merge the saved variables and their default values. |
|
31 | - $settings = array_merge($defaults, $saved_settings); |
|
30 | + // Merge the saved variables and their default values. |
|
31 | + $settings = array_merge($defaults, $saved_settings); |
|
32 | 32 | |
33 | - /* |
|
33 | + /* |
|
34 | 34 | * Create the form using Forms API |
35 | 35 | */ |
36 | - $form['zen-div-opening'] = array( |
|
36 | + $form['zen-div-opening'] = array( |
|
37 | 37 | '#value' => '<div id="zen-settings">', |
38 | - ); |
|
38 | + ); |
|
39 | 39 | |
40 | - $form['zen_block_editing'] = array( |
|
40 | + $form['zen_block_editing'] = array( |
|
41 | 41 | '#type' => 'checkbox', |
42 | 42 | '#title' => t('Show block editing on hover'), |
43 | 43 | '#description' => t('When hovering over a block, privileged users will see block editing links.'), |
44 | 44 | '#default_value' => $settings['zen_block_editing'], |
45 | - ); |
|
45 | + ); |
|
46 | 46 | |
47 | - $form['breadcrumb'] = array( |
|
47 | + $form['breadcrumb'] = array( |
|
48 | 48 | '#type' => 'fieldset', |
49 | 49 | '#title' => t('Breadcrumb settings'), |
50 | 50 | '#attributes' => array('id' => 'zen-breadcrumb'), |
51 | - ); |
|
52 | - $form['breadcrumb']['zen_breadcrumb'] = array( |
|
51 | + ); |
|
52 | + $form['breadcrumb']['zen_breadcrumb'] = array( |
|
53 | 53 | '#type' => 'select', |
54 | 54 | '#title' => t('Display breadcrumb'), |
55 | 55 | '#default_value' => $settings['zen_breadcrumb'], |
56 | 56 | '#options' => array( |
57 | - 'yes' => t('Yes'), |
|
58 | - 'admin' => t('Only in admin section'), |
|
59 | - 'no' => t('No'), |
|
57 | + 'yes' => t('Yes'), |
|
58 | + 'admin' => t('Only in admin section'), |
|
59 | + 'no' => t('No'), |
|
60 | 60 | ), |
61 | - ); |
|
62 | - $form['breadcrumb']['zen_breadcrumb_separator'] = array( |
|
61 | + ); |
|
62 | + $form['breadcrumb']['zen_breadcrumb_separator'] = array( |
|
63 | 63 | '#type' => 'textfield', |
64 | 64 | '#title' => t('Breadcrumb separator'), |
65 | 65 | '#description' => t('Text only. Don’t forget to include spaces.'), |
@@ -67,61 +67,61 @@ discard block |
||
67 | 67 | '#size' => 5, |
68 | 68 | '#maxlength' => 10, |
69 | 69 | '#prefix' => '<div id="div-zen-breadcrumb-collapse">', // jquery hook to show/hide optional widgets |
70 | - ); |
|
71 | - $form['breadcrumb']['zen_breadcrumb_home'] = array( |
|
70 | + ); |
|
71 | + $form['breadcrumb']['zen_breadcrumb_home'] = array( |
|
72 | 72 | '#type' => 'checkbox', |
73 | 73 | '#title' => t('Show home page link in breadcrumb'), |
74 | 74 | '#default_value' => $settings['zen_breadcrumb_home'], |
75 | - ); |
|
76 | - $form['breadcrumb']['zen_breadcrumb_trailing'] = array( |
|
75 | + ); |
|
76 | + $form['breadcrumb']['zen_breadcrumb_trailing'] = array( |
|
77 | 77 | '#type' => 'checkbox', |
78 | 78 | '#title' => t('Append a separator to the end of the breadcrumb'), |
79 | 79 | '#default_value' => $settings['zen_breadcrumb_trailing'], |
80 | 80 | '#description' => t('Useful when the breadcrumb is placed just before the title.'), |
81 | - ); |
|
82 | - $form['breadcrumb']['zen_breadcrumb_title'] = array( |
|
81 | + ); |
|
82 | + $form['breadcrumb']['zen_breadcrumb_title'] = array( |
|
83 | 83 | '#type' => 'checkbox', |
84 | 84 | '#title' => t('Append the content title to the end of the breadcrumb'), |
85 | 85 | '#default_value' => $settings['zen_breadcrumb_title'], |
86 | 86 | '#description' => t('Useful when the breadcrumb is not placed just before the title.'), |
87 | 87 | '#suffix' => '</div>', // #div-zen-breadcrumb |
88 | - ); |
|
88 | + ); |
|
89 | 89 | |
90 | - $form['themedev'] = array( |
|
90 | + $form['themedev'] = array( |
|
91 | 91 | '#type' => 'fieldset', |
92 | 92 | '#title' => t('Theme development settings'), |
93 | 93 | '#attributes' => array('id' => 'zen-themedev'), |
94 | - ); |
|
95 | - $form['themedev']['zen_rebuild_registry'] = array( |
|
94 | + ); |
|
95 | + $form['themedev']['zen_rebuild_registry'] = array( |
|
96 | 96 | '#type' => 'checkbox', |
97 | 97 | '#title' => t('Rebuild theme registry on every page.'), |
98 | 98 | '#default_value' => $settings['zen_rebuild_registry'], |
99 | 99 | '#description' => t('During theme development, it can be very useful to continuously <a href="!link">rebuild the theme registry</a>. WARNING: this is a huge performance penalty and must be turned off on production websites.', array('!link' => 'http://drupal.org/node/173880#theme-registry')), |
100 | 100 | '#prefix' => '<div id="div-zen-registry"><strong>' . t('Theme registry:') . '</strong>', |
101 | 101 | '#suffix' => '</div>', |
102 | - ); |
|
103 | - $form['themedev']['zen_layout'] = array( |
|
102 | + ); |
|
103 | + $form['themedev']['zen_layout'] = array( |
|
104 | 104 | '#type' => 'radios', |
105 | 105 | '#title' => t('Layout method'), |
106 | 106 | '#options' => array( |
107 | - 'zen-columns-liquid' => t('Liquid layout') . ' <small>(layout-liquid.css)</small>', |
|
108 | - 'zen-columns-fixed' => t('Fixed layout') . ' <small>(layout-fixed.css)</small>', |
|
107 | + 'zen-columns-liquid' => t('Liquid layout') . ' <small>(layout-liquid.css)</small>', |
|
108 | + 'zen-columns-fixed' => t('Fixed layout') . ' <small>(layout-fixed.css)</small>', |
|
109 | 109 | ), |
110 | 110 | '#default_value' => $settings['zen_layout'], |
111 | - ); |
|
112 | - $form['themedev']['zen_wireframes'] = array( |
|
111 | + ); |
|
112 | + $form['themedev']['zen_wireframes'] = array( |
|
113 | 113 | '#type' => 'checkbox', |
114 | 114 | '#title' => t('Display borders around main layout elements'), |
115 | 115 | '#default_value' => $settings['zen_wireframes'], |
116 | 116 | '#description' => t('<a href="!link">Wireframes</a> are useful when prototyping a website.', array('!link' => 'http://www.boxesandarrows.com/view/html_wireframes_and_prototypes_all_gain_and_no_pain')), |
117 | 117 | '#prefix' => '<div id="div-zen-wireframes"><strong>' . t('Wireframes:') . '</strong>', |
118 | 118 | '#suffix' => '</div>', |
119 | - ); |
|
119 | + ); |
|
120 | 120 | |
121 | - $form['zen-div-closing'] = array( |
|
121 | + $form['zen-div-closing'] = array( |
|
122 | 122 | '#value' => '</div>', |
123 | - ); |
|
123 | + ); |
|
124 | 124 | |
125 | - // Return the form |
|
126 | - return $form; |
|
125 | + // Return the form |
|
126 | + return $form; |
|
127 | 127 | } |
@@ -65,13 +65,13 @@ |
||
65 | 65 | * Implementation of HOOK_theme(). |
66 | 66 | */ |
67 | 67 | function STARTERKIT_theme(&$existing, $type, $theme, $path) { |
68 | - $hooks = zen_theme($existing, $type, $theme, $path); |
|
69 | - // Add your theme hooks like this: |
|
70 | - /* |
|
68 | + $hooks = zen_theme($existing, $type, $theme, $path); |
|
69 | + // Add your theme hooks like this: |
|
70 | + /* |
|
71 | 71 | $hooks['hook_name_here'] = array( // Details go here ); |
72 | 72 | */ |
73 | - // @TODO: Needs detailed comments. Patches welcome! |
|
74 | - return $hooks; |
|
73 | + // @TODO: Needs detailed comments. Patches welcome! |
|
74 | + return $hooks; |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
@@ -13,17 +13,17 @@ discard block |
||
13 | 13 | */ |
14 | 14 | function STARTERKIT_settings($saved_settings) { |
15 | 15 | |
16 | - // Get the default values from the .info file. |
|
17 | - $defaults = zen_theme_get_default_settings('STARTERKIT'); |
|
16 | + // Get the default values from the .info file. |
|
17 | + $defaults = zen_theme_get_default_settings('STARTERKIT'); |
|
18 | 18 | |
19 | - // Merge the saved variables and their default values. |
|
20 | - $settings = array_merge($defaults, $saved_settings); |
|
19 | + // Merge the saved variables and their default values. |
|
20 | + $settings = array_merge($defaults, $saved_settings); |
|
21 | 21 | |
22 | - /* |
|
22 | + /* |
|
23 | 23 | * Create the form using Forms API: http://api.drupal.org/api/6 |
24 | 24 | */ |
25 | - $form = array(); |
|
26 | - /* -- Delete this line if you want to use this setting |
|
25 | + $form = array(); |
|
26 | + /* -- Delete this line if you want to use this setting |
|
27 | 27 | $form['STARTERKIT_example'] = array( |
28 | 28 | '#type' => 'checkbox', |
29 | 29 | '#title' => t('Use this sample setting'), |
@@ -32,12 +32,12 @@ discard block |
||
32 | 32 | ); |
33 | 33 | // */ |
34 | 34 | |
35 | - // Add the base theme's settings. |
|
36 | - $form += zen_settings($saved_settings, $defaults); |
|
35 | + // Add the base theme's settings. |
|
36 | + $form += zen_settings($saved_settings, $defaults); |
|
37 | 37 | |
38 | - // Remove some of the base theme's settings. |
|
39 | - unset($form['themedev']['zen_layout']); // We don't need to select the base stylesheet. |
|
38 | + // Remove some of the base theme's settings. |
|
39 | + unset($form['themedev']['zen_layout']); // We don't need to select the base stylesheet. |
|
40 | 40 | |
41 | - // Return the form |
|
42 | - return $form; |
|
41 | + // Return the form |
|
42 | + return $form; |
|
43 | 43 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $ppid=$pstatus['pid']; |
36 | 36 | $ret=`ps -o pid --no-heading --ppid $ppid`; |
37 | 37 | //echo "parent pid is $ppid\nterninate it\n"; |
38 | - proc_terminate($p); |
|
38 | + proc_terminate($p); |
|
39 | 39 | // echo "child process is $ret\n"; |
40 | 40 | $pids=preg_split('/\s+/',$ret); |
41 | 41 | foreach($pids as $pid){ |
@@ -61,9 +61,9 @@ discard block |
||
61 | 61 | while (1) { |
62 | 62 | $ctime=time(); |
63 | 63 | if($ctime-$stime >=2 and ! file_exists("log.1")){ |
64 | - if($GLOBALS["debug"]) echo "time out "."<br>"; |
|
65 | - terminate_job($p); |
|
66 | - break; |
|
64 | + if($GLOBALS["debug"]) echo "time out "."<br>"; |
|
65 | + terminate_job($p); |
|
66 | + break; |
|
67 | 67 | } |
68 | 68 | if (file_exists("log.1")) { |
69 | 69 | list($avg_cpu, $test_steps) = calc_step_cpu("log.1"); |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | } |
113 | 113 | fclose($fd); |
114 | 114 | //$total_steps = $loopno*$looprun; |
115 | - if($GLOBALS["debug"])print "total_steps = ".$total_steps."<br>"; |
|
115 | + if($GLOBALS["debug"])print "total_steps = ".$total_steps."<br>"; |
|
116 | 116 | return $total_steps; |
117 | 117 | } |
118 | 118 | |
@@ -147,12 +147,12 @@ discard block |
||
147 | 147 | $cpu = (float)$arr[2]; |
148 | 148 | //echo "step=".$step." cpu=".$cpu."\n"; |
149 | 149 | if ($cpu==0) { |
150 | - $count=0; |
|
151 | - $start_step = $step; |
|
150 | + $count=0; |
|
151 | + $start_step = $step; |
|
152 | 152 | } else { |
153 | 153 | $count+=1; |
154 | 154 | if($GLOBALS["debug"])echo "step=".$step." cpu=".$cpu."count=".$count."<br>"; |
155 | - if($count >= 10) { |
|
155 | + if($count >= 10) { |
|
156 | 156 | $end_step = $step; |
157 | 157 | $steps = $end_step-$start_step; |
158 | 158 | $avg_cpu = $cpu/$steps; |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | |
184 | 184 | if(preg_match("/^\s*dump\s+(\d)\s+/", $line,$matches)) |
185 | 185 | { |
186 | - if($GLOBALS["debug"]){print "matches=";print_r($matches);} |
|
186 | + if($GLOBALS["debug"]){print "matches=";print_r($matches);} |
|
187 | 187 | |
188 | 188 | $dump_types=(int)$matches[1]; |
189 | 189 | break; |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | echo "can not open file $cmd_file\n"; |
199 | 199 | exit(-1); |
200 | 200 | } |
201 | - if($GLOBALS["debug"]) print "structure_file_size=".$structure_file_size."<br>"; |
|
201 | + if($GLOBALS["debug"]) print "structure_file_size=".$structure_file_size."<br>"; |
|
202 | 202 | |
203 | 203 | $loopno=1; |
204 | 204 | $looprun=1; |
@@ -216,8 +216,8 @@ discard block |
||
216 | 216 | } |
217 | 217 | fclose($fd); |
218 | 218 | if($GLOBALS["debug"]){ |
219 | - print "max loopno(number of loops to run)=".$loopno."<br>"; |
|
220 | - print "max looprun(steps for each loop)=".$looprun."<br>"; |
|
219 | + print "max loopno(number of loops to run)=".$loopno."<br>"; |
|
220 | + print "max looprun(steps for each loop)=".$looprun."<br>"; |
|
221 | 221 | } |
222 | 222 | //$est_size = $loopno*$structure_file_size*0.8*$dump_types; |
223 | 223 | $test_log_size = filesize("log.1"); |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | <br>Please refer to the following Error Message:<br><p> |
369 | 369 | "; |
370 | 370 | foreach($err_msgs as $line){ |
371 | - $err=$err.$line."<br>"; |
|
371 | + $err=$err.$line."<br>"; |
|
372 | 372 | } |
373 | 373 | $err=$err." <p> |
374 | 374 | <a href=sandbox.php><strong> File_Sandbox </strong></a> |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | // |
394 | 394 | $njobs = count(file($cmdline_file_path)); |
395 | 395 | $secs_est = estimated_makespan($njobs, $info->rsc_fpops_est); |
396 | - if($GLOBALS["debug"])echo "secs_est is $secs_est\n"; |
|
396 | + if($GLOBALS["debug"])echo "secs_est is $secs_est\n"; |
|
397 | 397 | //assume the server's flops is 1.5G and the average client's flops is 1G |
398 | 398 | $hrs_est = number_format($secs_est*1.5/60, 2); |
399 | 399 | //$hrs_est = number_format($secs_est, 2); |