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

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

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


Revision 1.1 - (show annotations) (download) (as text)
Thu Aug 31 14:03:18 2006 UTC (3 years, 2 months ago) by nickl
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-5, DRUPAL-4-7
File MIME type: text/x-php
Theme contributed by SEO Position http://www.seoposition.com/
1 <?php
2 // $Id$
3 function SEOposition_regions() {
4 return array(
5 'top_menu' => t('top menu'),
6 'sidebar' => t('sidebar'),
7 'left' => t('left sidebar'),
8 'right' => t('far right sidebar'),
9 'content' => t('content'),
10 'footer' => t('footer')
11 );
12 }
13
14 function _phptemplate_variables($hook, $vars = array()) {
15 if ($vars['logo'] == base_path() . path_to_theme() .'/logo.png') {
16 $vars['logo'] = base_path() . path_to_theme() .'/front.jpg';
17 }
18
19 return $vars;
20 }
21
22 function phptemplate_profile_listing($account, $fields = array()) {
23
24 $output = "<div class=\"profile clearfix\">\n";
25 $output .= theme('user_picture', $account);
26 $output .= ' <div class="name">'. theme('username', $account) ."</div>\n";
27
28 foreach ($fields as $field) {
29 if ($field->value) {
30 $output .= " <div class=\"field\">$field->value</div>\n";
31 }
32 }
33
34 $output .= "</div>\n";
35
36 return $output;
37 }
38
39 /**
40 * Theme a gallery page
41 */
42 function phptemplate_image_gallery($galleries, $images) {
43 drupal_set_html_head(theme('stylesheet_import', base_path() . drupal_get_path('module', 'image') .'/image.css'));
44
45 // We'll add height to keep thumbnails lined up.
46 $size = _image_get_dimensions('thumbnail');
47 $width = $size['width'];
48 $height = $size['height'];
49
50 $content = '';
51 if (count($galleries)) {
52 $content.= '<ul class="galleries">';
53 foreach ($galleries as $gallery) {
54 $content .= '<li style="min-height : '.$height .'px">';
55 if ($gallery->count)
56 $content.= l(image_display($gallery->latest, 'thumbnail'), 'image/tid/'.$gallery->tid, array(), NULL, NULL, FALSE, TRUE);
57 $content.= "<h3>".l($gallery->name, 'image/tid/'.$gallery->tid) . "</h3>\n";
58 $content.= '<div class="description">'. check_markup($gallery->description) ."</div>\n";
59 $content.= '<p class="count">' . format_plural($gallery->count, 'There is 1 image in this gallery', 'There are %count images in this gallery') . "</p>\n";
60 if ($gallery->latest->changed) {
61 $content.= '<p class="last">'. t('Last updated: %date', array('%date' => format_date($gallery->latest->changed))) . "</p>\n";
62 }
63 $content.= "</li>\n";
64 }
65 $content.= "</ul>\n";
66 }
67
68 if (count($images)) {
69 $height += 75;
70 $content.= '<ul class="images">';
71 foreach ($images as $image) {
72 $content .= '<li';
73 if ($image->sticky) {
74 $content .= ' class="sticky"';
75 }
76 $content .= ' style="min-height : '.$height .'px; min-width : '.$width.'px;"';
77 $content .= ">\n";
78 $content .= l(image_display($image, 'thumbnail'), 'node/'.$image->nid, array(), NULL, NULL, FALSE, TRUE);
79 $content .= '<h3>'.l($image->title, 'node/'.$image->nid)."</h3>";
80 if (theme_get_setting('toggle_node_info_' . $image->type)) {
81 $content .= '<div class="author">'. t('Posted by: %name', array('%name' => theme('username', $image))) . "</div>\n";
82 if ($image->created > 0) {
83 $content .= '<div class="date">'.format_date($image->created)."</div>\n";
84 }
85 }
86 $content .= "</li>\n";
87 }
88 $content.= "</ul>\n";
89 }
90
91 if ($pager = theme('pager', NULL, variable_get('image_images_per_page', 6), 0)) {
92 $content.= $pager;
93 }
94
95 If (count($images) + count($galleries) == 0) {
96 $content.= '<p class="count">' . format_plural(0, 'There is 1 image in this gallery', 'There are %count images in this gallery') . "</p>\n";
97 }
98
99 return $content;
100 }
101
102 function phptemplate_system_themes($form) {
103 foreach (element_children($form) as $key) {
104 $row = array();
105 if (is_array($form[$key]['description'])) {
106 $row[] = form_render($form[$key]['description']) . form_render($form[$key]['screenshot']) ;
107 $row[] = array('data' => form_render($form['status'][$key]), 'align' => 'center');
108 if ($form['theme_default']) {
109 $row[] = array('data' => form_render($form['theme_default'][$key]) . form_render($form[$key]['operations']), 'align' => 'center');
110 }
111 }
112 $rows[] = $row;
113 }
114 $header = array(t('Name/Screenshot'), t('Enabled'), t('Default'));
115 $output = theme('table', $header, $rows);
116 $output .= form_render($form);
117 return $output;
118 }
119
120 function phptemplate_system_user($form) {
121 foreach (element_children($form) as $key) {
122 $row = array();
123 if (is_array($form[$key]['description'])) {
124 $row[] = form_render($form[$key]['description']) . form_render($form[$key]['screenshot']);
125 $row[] = array('data' => form_render($form['theme'][$key]), 'align' => 'center');
126 }
127 $rows[] = $row;
128 }
129
130 $header = array(t('Name/Screenshot'), t('Selected'));
131 $output = theme('table', $header, $rows);
132 return $output;
133 }
134 ?>

  ViewVC Help
Powered by ViewVC 1.1.2