CSS_THEME + 1,'every_page' =>TRUE)); //drupal_add_css('/sites/default/themes/popsu/css/css3/css3_graphics.css', array('group' => CSS_THEME + 2,'every_page' =>TRUE)); // give
tag a unique class depending on PATHs $path_alias = strtolower(drupal_clean_css_identifier(drupal_get_path_alias($_GET['q']))); if ($path_alias == 'node') { $vars['classes_array'][] = ''; } else { $vars['classes_array'][] = 'path-'. $path_alias; } // Add to the array of body classes // layout classes $vars['classes_array'][] = 'layout-'. (!empty($vars['page']['sidebar_first']) ? 'first-main' : 'main') . (!empty($vars['page']['sidebar_second']) ? '-second' : ''); } /** * Override or insert variables into the page template. * * @param $vars * An array of variables to pass to the theme template. */ function popsu_preprocess_page(&$vars) { // Render manager menu tree from main-menu //$menu_tree = menu_tree('menu-manager-menu'); //$vars['menu_manager_menu_tree'] = render($menu_tree); $menu_tree = menu_tree_all_data('menu-manager-menu'); $vars['menu_manager_menu_tree'] = menu_tree_output($menu_tree); } /** * Override or insert variables into the node templates. * * @param $vars * An array of variables to pass to the theme template. */ function popsu_preprocess_node(&$vars) { $vars['classes_array'][] = $vars['zebra']; if ($vars['view_mode'] == 'full') { $vars['classes_array'][] = 'node-full'; } // Add node-type-page template suggestion if ($vars['page']) { $vars['theme_hook_suggestions'][] = 'node__'. $vars['node']->type .'_page'; $vars['theme_hook_suggestions'][] = 'node__'. $vars['node']->type .'-'. $vars['node']->nid .'_page'; } else { $vars['theme_hook_suggestions'][] = 'node__'. $vars['node']->type .'_teaser'; $vars['theme_hook_suggestions'][] = 'node__'. $vars['node']->nid; } } /** * Preprocess variables for region.tpl.php * * Prepare the values passed to the theme_region function to be passed into a * pluggable template engine. Uses the region name to generate a template file * suggestions. If none are found, the default region.tpl.php is used. * * @see region.tpl.php */ function popsu_preprocess_region(&$vars) { // Sidebar region template suggestion. if (strpos($vars['region'], 'sidebar_') === 0) { $vars['theme_hook_suggestions'][] = 'region__sidebar'; $vars['theme_hook_suggestions'][] = 'region__' . $vars['region']; } } /** * Override or insert variables into the block templates. * * @param $vars * An array of variables to pass to the theme template. */ function popsu_preprocess_block(&$vars) { $block = $vars['block']; // First/last block position $vars['position'] = ($vars['block_id'] == 1) ? 'first' : ''; if ($vars['block_id'] == count(block_list($block->region))) { $vars['position'] = ($vars['position']) ? '' : 'last'; } } /** * Override or insert variables into the comment templates. * * @param $vars * An array of variables to pass to the theme template. */ function popsu_preprocess_comment(&$vars) { // Add odd/even classes to comments classes_array static $comment_odd = TRUE; $vars['classes_array'][] = $comment_odd ? 'odd' : 'even'; $comment_odd = !$comment_odd; } function popsu_form_element($variables) { $element = &$variables['element']; // This is also used in the installer, pre-database setup. $t = get_t(); // This function is invoked as theme wrapper, but the rendered form element // may not necessarily have been processed by form_builder(). $element += array( '#title_display' => 'before', ); // Add element #id for #type 'item'. if (isset($element['#markup']) && !empty($element['#id'])) { $attributes['id'] = $element['#id']; } // Add element's #type and #name as class to aid with JS/CSS selectors. $attributes['class'] = array('form-item'); $error = form_get_error($element); if (!empty($error) ) { $attributes['class'][] = 'error'; } if (!empty($element['#type'])) { $attributes['class'][] = 'form-type-' . strtr($element['#type'], '_', '-'); } if (!empty($element['#name'])) { $attributes['class'][] = 'form-item-' . strtr($element['#name'], array(' ' => '-', '_' => '-', '[' => '-', ']' => '')); } // Add a class for disabled elements to facilitate cross-browser styling. if (!empty($element['#attributes']['disabled'])) { $attributes['class'][] = 'form-disabled'; } $output = '