type, TRUE)) { if ($node->type == "article") { if (!empty($node->field_blog_categories)) { $categories = jollyness_format_comma_field('field_blog_categories', $node); $variables['blog_categories'] = $categories; } } } } function jollyness_format_comma_field($field_category, $node, $limit = NULL) { $category_arr = array(); $field = field_get_items('node', $node, $field_category); if (!empty($field)) { foreach ($field as $item) { $term = taxonomy_term_load($item['tid']); if ($term) { if (module_exists('i18n_taxonomy')) { $term_name = i18n_taxonomy_term_name($term, $node->language); } else { $term_name = $term->name; } $category_arr[] = l($term_name, 'taxonomy/term/' . $item['tid']); } if ($limit) { if (count($category_arr) == $limit) { $category = implode(', ', $category_arr); return $category; } } } } $category = implode(', ', $category_arr); return $category; } /** * Implement hook_form_comment_form_alter(). */ function jollyness_form_comment_form_alter(&$form, &$form_state, $form_id) { $form['actions']['submit']['#value'] = t('SEND MESSAGE'); } function jollyness_preprocess_html(&$vars) { //Process portfolio color if ($portfolio_category = taxonomy_vocabulary_machine_name_load('portfolio_category')) { $terms = taxonomy_get_tree($portfolio_category->vid); $less = new lessc(); $css = ''; $color = ''; $class = ''; foreach ($terms as $t) { $term = taxonomy_term_load($t->tid); $class = drupal_html_class($t->name); if (!empty($term->field_color)) { foreach ($term->field_color as $v) { $color = $v[0]['value']; break; } } if ($color) { $css .= ".dexp-masonry-filter,.dexp-portfolio-filter{.{$class} span:before{background-color: {$color} !important;}}"; $css .= ".{$class} .portfolio-item-overlay{background-color: rgba(red({$color}), green({$color}), blue({$color}), 0.7) !important;}"; } } $css = $less->compile($css); drupal_add_css($css, array('type' => 'inline')); } /*//Process HTML.TPL $node = menu_get_object(); if ($node && $node->nid) { $vars['theme_hook_suggestion'][] = 'html__' . $node->type; }*/ } function jollyness_preprocess_region(&$vars) { //$theme = drupalexp_get_theme(); $region_key = $vars['elements']['#region']; if ($region_key == 'search') { $vars['classes_array'][] = 'pull-right'; } //$region = $theme->getRegion($region_key); } function jollyness_form_search_block_form_alter(&$form) { $form['search_block_form']['#attributes']['placeholder'] = t('Type and Enter to Seach'); $form['actions']['submit']['#attributes']['class'][] = 'element-invisible'; }