/[drupal]/contributions/themes/anitakravitz/template.php
ViewVC logotype

Contents of /contributions/themes/anitakravitz/template.php

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download) (as text)
Tue Jul 8 07:54:41 2008 UTC (16 months, 3 weeks ago) by intertextual
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/x-php
*** empty log message ***
1 <?php
2 // Amadou 3.x
3 // $Id: template.php,v 1.6.2.1.6.3.2.7 2007/12/07 23:05:15 jwolf Exp $
4
5 /**
6 * Adjust content width according to the absence or presence of sidebars.
7 *
8 * If only one sidebar is active, the mainContent width will expand to fill
9 * the space of the missing sidebar.
10 */
11 function amadou_get_mainContent_width($sidebar_right) {
12 $width = 650;
13 if (!$sidebar_right) {
14 $width = $width + 300;
15 }
16 return $width;
17 }
18 function amadou_get_sideBars_width($sidebar_right) {
19 $width = 0;
20
21 return $width + 300;
22 }
23
24 /**
25 * Return a themed breadcrumb trail.
26 *
27 * @param $breadcrumb
28 * An array containing the breadcrumb links.
29 * @return a string containing the breadcrumb output.
30 */
31 function phptemplate_breadcrumb($breadcrumb) {
32 if (!empty($breadcrumb)) {
33 return '<div class="breadcrumb">'. implode(' :: ', $breadcrumb) .'</div>';
34 }
35 }
36
37 /**
38 * Catch the theme_links function
39 */
40 function phptemplate_links($links, $attributes = array('class' => 'links')) {
41 $output = '';
42
43 if (count($links) > 0) {
44 $output = '<ul'. drupal_attributes($attributes) .'>';
45
46 $num_links = count($links);
47 $i = 1;
48
49 foreach ($links as $key => $link) {
50 $class = '';
51
52 // Automatically add a class to each link and also to each LI
53 if (isset($link['attributes']) && isset($link['attributes']['class'])) {
54 $link['attributes']['class'] .= ' ' . $key;
55 $class = $key;
56 }
57 else {
58 $link['attributes']['class'] = $key;
59 $class = $key;
60 }
61
62 // Add first and last classes to the list of links to help out themers.
63 $extra_class = '';
64 if ($i == 1) {
65 $extra_class .= 'first ';
66 }
67 if ($i == $num_links) {
68 $extra_class .= 'last ';
69 }
70 $output .= '<li class="'. $extra_class . $class .'">';
71
72 // Is the title HTML?
73 $html = isset($link['html']) && $link['html'];
74
75 // Initialize fragment and query variables.
76 $link['query'] = isset($link['query']) ? $link['query'] : NULL;
77 $link['fragment'] = isset($link['fragment']) ? $link['fragment'] : NULL;
78
79 if (isset($link['href'])) {
80 $output .= l($link['title'], $link['href'], $link['attributes'], $link['query'], $link['fragment'], FALSE, $html);
81 }
82 else if ($link['title']) {
83 //Some links are actually not links, but we wrap these in <span> for adding title and class attributes
84 if (!$html) {
85 $link['title'] = check_plain($link['title']);
86 }
87 $output .= '<span'. drupal_attributes($link['attributes']) .'>'. $link['title'] .'</span>';
88 }
89
90 $i++;
91 $output .= "</li>\n";
92 }
93
94 $output .= '</ul>';
95 }
96
97 return $output;
98 }
99
100 /**
101 * Customize a TinyMCE theme.
102 *
103 * @param init
104 * An array of settings TinyMCE should invoke a theme. You may override any
105 * of the TinyMCE settings. Details here:
106 *
107 * http://tinymce.moxiecode.com/wrapper.php?url=tinymce/docs/using.htm
108 *
109 * @param textarea_name
110 * The name of the textarea TinyMCE wants to enable.
111 *
112 * @param theme_name
113 * The default tinymce theme name to be enabled for this textarea. The
114 * sitewide default is 'simple', but the user may also override this.
115 *
116 * @param is_running
117 * A boolean flag that identifies id TinyMCE is currently running for this
118 * request life cycle. It can be ignored.
119 */
120 function phptemplate_tinymce_theme($init, $textarea_name, $theme_name, $is_running) {
121
122 switch ($textarea_name) {
123 // Disable tinymce for these textareas
124 case 'log': // book and page log
125 case 'img_assist_pages':
126 case 'caption': // signature
127 case 'pages':
128 case 'access_pages': //TinyMCE profile settings.
129 case 'user_mail_welcome_body': // user config settings
130 case 'user_mail_approval_body': // user config settings
131 case 'user_mail_pass_body': // user config settings
132 case 'synonyms': // taxonomy terms
133 case 'description': // taxonomy terms
134 unset($init);
135 break;
136
137 // Force the 'simple' theme for some of the smaller textareas.
138 case 'signature':
139 case 'site_mission':
140 case 'site_footer':
141 case 'site_offline_message':
142 case 'page_help':
143 case 'user_registration_help':
144 case 'user_picture_guidelines':
145 $init['theme'] = 'simple';
146 foreach ($init as $k => $v) {
147 if (strstr($k, 'theme_advanced_')) unset($init[$k]);
148 }
149 break;
150 }
151
152 // Add some extra features when using the advanced theme.
153 // If $init is available, we can extend it
154 if (isset($init)) {
155 switch ($theme_name) {
156 case 'advanced':
157 $init['width'] = '100%';
158 break;
159
160 }
161 }
162
163 // Always return $init
164 return $init;
165 }

  ViewVC Help
Powered by ViewVC 1.1.2