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

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

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


Revision 1.8 - (show annotations) (download) (as text)
Sat Mar 28 22:50:40 2009 UTC (7 months, 4 weeks ago) by skiquel
Branch: MAIN
CVS Tags: DRUPAL-6--1-0, HEAD
Branch point for: DRUPAL-6--1
Changes since 1.7: +60 -10 lines
File MIME type: text/x-php
Syncing latest friendsforever (deprecated) with friendselectric
1 <?php
2
3 function friendselectric_wrap_content($text) {
4 $text = preg_replace('!<pre>!i', '<div class="pre"><pre>', $text);
5 $text = preg_replace('!</pre>!i', '</pre></div>', $text);
6 return $text;
7 }
8 function friendselectric_wrap_links($link, $n) {
9 $classes = array("lw1", "lw2");
10 $before = $after = "";
11 foreach ($classes as $c) {
12 $before .= '<span class="'. $c .'">';
13 $after .= '</span>';
14 }
15 $link = preg_replace('!<a[^>]*>!i', '\0'. $before, $link);
16 $link = preg_replace('!</a[^>]*>!i', $after . '\0', $link);
17 return $link;
18 }
19
20 function friendselectric_menu_item_link($link) {
21 // $link = l('<span class="lw1">'. check_plain($link['title']) .'</span>', $link['href'], array('html' => TRUE));
22 if (empty($link['options'])) {
23 $link['options'] = array();
24 }
25
26 // If an item is a LOCAL TASK, render it as a tab
27 if ($link['type'] & MENU_IS_LOCAL_TASK) {
28 $link['title'] = '<span class="lw1">' . check_plain($link['title']) . '</span>';
29 $link['options']['html'] = TRUE;
30 }
31
32 if (empty($link['type'])) {
33 $true = TRUE;
34 }
35
36 return l($link['title'], $link['href'], $link['options']);
37
38 return $link;
39 }
40
41
42 function phptemplate_menu_primary_links($primary_links) {
43 foreach ($primary_links as $link) {
44 $links[] = l('<span class="lw3">'. check_plain($link['title']) .'</span>', $link['href'], array('html' => TRUE));
45 }
46
47 return $links;
48 }
49
50 function friendselectric_comment_thread_collapsed($comment) {
51 if ($comment->depth) {
52 $output = '<div style="padding-left:'. ($comment->depth * 25) ."px;\">\n";
53 $output .= theme('comment_view', $comment, '', 0);
54 $output .= "</div>\n";
55 }
56 else {
57 $output .= theme('comment_view', $comment, '', 0);
58 }
59 return $output;
60 }
61
62 function friendselectric_comment_thread_expanded($comment) {
63 $output = '';
64 if ($comment->depth) {
65 $output .= '<div style="padding-left:'. ($comment->depth * 25) ."px;\">\n";
66 }
67
68 $output .= theme('comment_view', $comment, module_invoke_all('link', 'comment', $comment, 0));
69
70 if ($comment->depth) {
71 $output .= "</div>\n";
72 }
73 return $output;
74 }
75
76
77 /**
78 * Override or insert PHPTemplate variables into the page templates.
79 *
80 * @param $vars
81 * A sequential array of variables to pass to the theme template.
82 * @param $hook
83 * The name of the theme function being called ("page" in this case.)
84 */
85 function friendselectric_preprocess_page(&$vars, $hook) {
86 }
87
88 /**
89 * Return the path to the main nista theme directory.
90 */
91 function path_to_friendselectrictheme() {
92 static $theme_path;
93 if (!isset($theme_path)) {
94 global $theme;
95 if ($theme == 'nista') {
96 $theme_path = path_to_theme();
97 }
98 else {
99 $theme_path = drupal_get_path('theme', 'friendselectric');
100 }
101 }
102 return $theme_path;
103 }
104

  ViewVC Help
Powered by ViewVC 1.1.2