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