-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.php
More file actions
117 lines (98 loc) · 3.15 KB
/
Copy pathtemplate.php
File metadata and controls
117 lines (98 loc) · 3.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?php
// $Id$
/**
* @file
* The guts of the theme :)
*/
require_once('theme-settings.php');
/**
* Add Custom Generated CSS File
* This file is generated each time the theme settings page is loaded.
*/
$custom_css = file_directory_path() .'/buho/custom.css';
if (file_exists($custom_css)) {
drupal_add_css($custom_css, 'theme', 'all', TRUE);
}
/**
* Implementation of hook_theme().
* This function provides a one-stop reference for all
*/
function buho_theme(&$existing, $type, $theme, $path) {
return array(
'breadcrumb' => array(
'arguments' => array('breadcrumb' => array()),
'file' => 'functions/theme-overrides.inc',
),
'conditional_stylesheets' => array(
'file' => 'functions/theme-custom.inc',
),
'feed_icon' => array(
'arguments' => array('url' => NULL, 'title' => NULL),
'file' => 'functions/theme-overrides.inc',
),
'form_element' => array(
'arguments' => array('element' => NULL, 'value' => NULL),
'file' => 'functions/theme-overrides.inc',
),
'fieldset' => array(
'arguments' => array('element' => NULL),
'file' => 'functions/theme-overrides.inc',
),
'menu_local_tasks' => array(
'arguments' => NULL,
'file' => 'functions/theme-overrides.inc',
),
'more_link' => array(
'arguments' => array('url' => array(), 'title' => NULL),
'file' => 'functions/theme-overrides.inc',
),
'pager' => array(
'arguments' => array('tags' => array(), 'limit' => NULL, 'element' => NULL, 'parameters' => array(), 'quantity' => NULL),
'file' => 'functions/theme-overrides.inc',
),
'status_messages' => array(
'arguments' => array('display' => NULL),
'file' => 'functions/theme-overrides.inc',
),
'status_report' => array(
'arguments' => array('requirements' => NULL),
'file' => 'functions/theme-overrides.inc',
),
'table' => array(
'arguments' => array('header' => NULL, 'rows' => NULL, 'attributes' => array(), 'caption' => NULL),
'file' => 'functions/theme-overrides.inc',
),
'render_attributes' => array(
'arguments' => array('attributes'),
'file' => 'functions/theme-custom.inc',
),
);
}
/**
* Implementation of hook_preprocess().
*
* @param $vars
* @param $hook
* @return Array
*/
function buho_preprocess(&$vars, $hook) {
// Only add the admin.css file to administrative pages
if (arg(0) == 'admin') {
drupal_add_css(path_to_theme() .'/css/admin.css', 'theme', 'all', TRUE);
}
/**
* This function checks to see if a hook has a preprocess file associated with
* it, and if so, loads it.
*/
if (is_file(drupal_get_path('theme', 'buho') .'/preprocess/preprocess-'. str_replace('_', '-', $hook) .'.inc')) {
include('preprocess/preprocess-'. str_replace('_', '-', $hook) .'.inc');
}
}
/*Eliminar el node title en determinados tipos de contenidos*/
function buho_preprocess_page(&$vars) {
/*itles are ignored by content type when they are not desired in the design.*/
$vars['original_title'] = $vars['title'];
if (!empty($vars['node']) && in_array($vars['node']->type, array('item', 'noticia'))) {
$vars['title'] = '';
}
}