Skip to content
This repository was archived by the owner on Aug 14, 2023. It is now read-only.

Commit f6ac73a

Browse files
committed
issue #OS2WEB-9 by martinyde: Added new theme
1 parent 1713dc5 commit f6ac73a

File tree

1,014 files changed

+59098
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,014 files changed

+59098
-0
lines changed
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<?php
2+
/**
3+
* @file
4+
* Default theme implementation to display a list of forums and containers.
5+
*
6+
* Available variables:
7+
* - $forums: An array of forums and containers to display. It is keyed to the
8+
* numeric id's of all child forums and containers.
9+
* - $forum_id: Forum id for the current forum. Parent to all items within
10+
* the $forums array.
11+
*
12+
* Each $forum in $forums contains:
13+
* - $forum->is_container: Is TRUE if the forum can contain other forums. Is
14+
* FALSE if the forum can contain only topics.
15+
* - $forum->depth: How deep the forum is in the current hierarchy.
16+
* - $forum->zebra: 'even' or 'odd' string used for row class.
17+
* - $forum->name: The name of the forum.
18+
* - $forum->link: The URL to link to this forum.
19+
* - $forum->description: The description of this forum.
20+
* - $forum->new_topics: True if the forum contains unread posts.
21+
* - $forum->new_url: A URL to the forum's unread posts.
22+
* - $forum->new_text: Text for the above URL which tells how many new posts.
23+
* - $forum->old_topics: A count of posts that have already been read.
24+
* - $forum->total_posts: The total number of posts in the forum.
25+
* - $forum->last_reply: Text representing the last time a forum was posted or
26+
* commented in.
27+
* - $forum->forum_image: If used, contains an image to display for the forum.
28+
*
29+
* @see template_preprocess_forum_list()
30+
* @see theme_forum_list()
31+
*/
32+
?>
33+
34+
<?php
35+
/*
36+
The $tables variable holds the individual tables to be shown. A table is
37+
either created from a root level container or added as needed to hold root
38+
level forums. The following code will loop through each of the tables.
39+
In each table, it loops through the items in the table. These items may be
40+
subcontainers or forums. Subcontainers are printed simply with the name
41+
spanning the entire table. Forums are printed out in more detail. Subforums
42+
have already been attached to their parent forums in the preprocessing code
43+
and will display under their parents.
44+
*/
45+
46+
47+
?>
48+
49+
<?php foreach ($tables as $table_id => $table): ?>
50+
<?php $table_info = $table['table_info']; ?>
51+
<div id="forum-wrapper">
52+
<?php foreach ($table['items'] as $item_id => $item): ?>
53+
54+
<div class="forum-item">
55+
<div class="forum-item-wrap">
56+
<?php if (!empty($item->forum_image)): ?>
57+
<div class="forum-icon">
58+
<?php print $item->forum_image; ?>
59+
</div>
60+
<?php endif; ?>
61+
<div class="forum-name">
62+
<h3><a href="<?php print $item->link; ?>"><span class="ting-icon-bubbles2"></span><?php print $item->name; ?><span class="total">(<?php print $item->total_topics; ?>)</span></a></h3>
63+
</div>
64+
65+
<?php if (!empty($item->description)): ?>
66+
<div class="forum-description">
67+
<?php print $item->description; ?>
68+
</div>
69+
<?php endif; ?>
70+
<div class="forum-lastest-reply">
71+
<p class="latest-label">Seneste indlæg:</p>
72+
<?php foreach($item->latest as $posts): ?>
73+
<div class="latest-posts">
74+
<?php
75+
$user = user_load($posts->uid, TRUE);
76+
print l($posts->title, 'node/'.$posts->nid); ?>
77+
<p><?php print format_date($posts->created, $type = 'medium'); ?> / Af: <span class="user"><a href="<?php print drupal_get_path_alias('user/' . $user->uid); ?>"><?php print $user->field_user_firstname['und'][0]['safe_value']; ?> <?php print $user->field_user_lastname['und'][0]['safe_value']; ?></a></span></p>
78+
</div>
79+
<?php endforeach; ?>
80+
</div>
81+
<div class="goto-forum">
82+
<a href="<?php print $item->link; ?>" class="goto-link">Se alle indlæg</a>
83+
</div>
84+
</div>
85+
</div>
86+
87+
<?php endforeach; ?>
88+
</div>
89+
<?php endforeach; ?>
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
<?php
2+
/**
3+
* @file views-view.tpl.php
4+
* Main view template
5+
*
6+
* Variables available:
7+
* - $classes_array: An array of classes determined in
8+
* template_preprocess_views_view(). Default classes are:
9+
* .view
10+
* .view-[css_name]
11+
* .view-id-[view_name]
12+
* .view-display-id-[display_name]
13+
* .view-dom-id-[dom_id]
14+
* - $classes: A string version of $classes_array for use in the class attribute
15+
* - $css_name: A css-safe version of the view name.
16+
* - $css_class: The user-specified classes names, if any
17+
* - $header: The view header
18+
* - $footer: The view footer
19+
* - $rows: The results of the view query, if any
20+
* - $empty: The empty text to display if the view is empty
21+
* - $pager: The pager next/prev links to display, if any
22+
* - $exposed: Exposed widget form/info to display
23+
* - $feed_icon: Feed icon to display, if any
24+
* - $more: A link to view more, if any
25+
* - $admin_links: A rendered list of administrative links
26+
* - $admin_links_raw: A list of administrative links suitable for theme('links')
27+
* - $forum_description: Forum description
28+
*
29+
* - $forum_tools: Drop down list of forum tools
30+
* - $forum_jump: Drop down list of forum hierarchy
31+
*
32+
* @ingroup views_templates
33+
*/
34+
35+
?>
36+
37+
<div class="<?php print $classes; ?>">
38+
<?php if (!empty($admin_links)): ?>
39+
<div class="views-admin-links views-hide">
40+
<?php print $admin_links; ?>
41+
</div>
42+
<?php endif; ?>
43+
44+
<?php if ($header): ?>
45+
<div class="view-header">
46+
<?php print $header; ?>
47+
</div>
48+
<?php endif; ?>
49+
50+
<?php if ($exposed): ?>
51+
<div class="view-filters">
52+
<?php print $exposed; ?>
53+
</div>
54+
<?php endif; ?>
55+
56+
<?php if ($attachment_before): ?>
57+
<div class="attachment attachment-before">
58+
<?php print $attachment_before; ?>
59+
</div>
60+
<?php endif; ?>
61+
62+
<?php if ($rows): ?>
63+
<div class="view-content">
64+
<?php print $rows; ?>
65+
</div>
66+
<?php elseif ($empty): ?>
67+
<div class="view-empty">
68+
<?php print $empty; ?>
69+
</div>
70+
<?php endif; ?>
71+
72+
<?php if ($pager): ?>
73+
<div class="forum-bottom-pager clearfix"><?php print $pager; ?></div>
74+
<?php endif; ?>
75+
76+
<?php if (!empty($view->sort_form)): ?>
77+
<div id="forum-sort"><?php print advanced_forum_forum_topic_list_sort(); ?></div>
78+
<?php endif; ?>
79+
80+
<?php if ($attachment_after): ?>
81+
<div class="attachment attachment-after">
82+
<?php print $attachment_after; ?>
83+
</div>
84+
<?php endif; ?>
85+
86+
<?php if ($more): ?>
87+
<?php print $more; ?>
88+
<?php endif; ?>
89+
90+
<?php if ($footer): ?>
91+
<div class="view-footer">
92+
<?php print $footer; ?>
93+
</div>
94+
<?php endif; ?>
95+
96+
<?php if ($feed_icon): ?>
97+
<div class="feed-icon">
98+
<?php print $feed_icon; ?>
99+
</div>
100+
<?php endif; ?>
101+
102+
</div> <?php /* class view */ ?>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
/**
3+
* @file views-view-table.tpl.php
4+
* Template to display a view as a table.
5+
*
6+
* - $title : The title of this group of rows. May be empty.
7+
* - $header: An array of header labels keyed by field id.
8+
* - $fields: An array of CSS IDs to use for each field id.
9+
* - $class: A class or classes to apply to the table, based on settings.
10+
* - $row_classes: An array of classes to apply to each row, indexed by row
11+
* number. This matches the index in $rows.
12+
* - $rows: An array of row items. Each row is an array of content.
13+
* $rows are keyed by row number, fields within rows are keyed by field ID.
14+
* @ingroup views_templates
15+
*/
16+
?>
17+
<div id="forum-topic-list">
18+
<?php if (!empty($title)) : ?>
19+
<caption><?php print $title; ?></caption>
20+
<?php endif; ?>
21+
<?php foreach ($rows as $count => $row): ?>
22+
<div class="<?php print implode(' ', $row_classes[$count]); ?>">
23+
<?php if (empty($shadow[$count])): ?>
24+
<?php foreach ($row as $field => $content): ?>
25+
<?php /* To add popup from teaser in the title of the td, add: title="<?php print $teasers[$count] ?>"*/ ?>
26+
<div class="views-field views-field-<?php print $fields[$field]; ?>">
27+
<?php /* Extra label for stickies. */ ?>
28+
<?php if ($field == 'title' && !empty($sticky[$count])): ?>
29+
<span class="sticky-label"><?php print t('Sticky:'); ?></span>
30+
<?php endif; ?>
31+
<?php print $content; ?>
32+
</div>
33+
<?php endforeach; ?>
34+
<?php else: ?>
35+
<div class="views-field views-field-<?php print $fields['title']; ?>" colspan="<?php print count($header)-1; ?>">
36+
<?php print $shadow[$count]; ?>
37+
</div>
38+
<?php endif; ?>
39+
</div>
40+
<?php endforeach; ?>
41+
</div>
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
<?php
2+
3+
/**
4+
* @file
5+
* Theme implementation to display a list of forum topics.
6+
*
7+
* Available variables:
8+
* - $header: The table header. This is pre-generated with click-sorting
9+
* information. If you need to change this, see template_preprocess_forum_topic_list().
10+
* - $pager: The pager to display beneath the table.
11+
* - $topics: An array of topics to be displayed.
12+
* - $topic_id: Numeric id for the current forum topic.
13+
* - $forum_description: Description of the forum these topics are in.
14+
*
15+
* Each $topic in $topics contains:
16+
* - $topic->icon: The icon to display.
17+
* - $topic->moved: A flag to indicate whether the topic has been moved to
18+
* another forum.
19+
* - $topic->title: The title of the topic. Safe to output.
20+
* - $topic->message: If the topic has been moved, this contains an
21+
* explanation and a link.
22+
* - $topic->zebra: 'even' or 'odd' string used for row class.
23+
* - $topic->sticky_class: 'sticky-topic' or 'first-not-sticky' or 'not-sticky'
24+
* - $topic->num_comments: The number of replies on this topic.
25+
* - $topic->new_replies: A flag to indicate whether there are unread comments.
26+
* - $topic->new_url: If there are unread replies, this is a link to them.
27+
* - $topic->new_text: Text containing the translated, properly pluralized count.
28+
* - $topic->created: An outputtable string represented when the topic was posted.
29+
* - $topic->last_reply: An outputtable string representing when the topic was
30+
* last replied to.
31+
* - $topic->timestamp: The raw timestamp this topic was posted.
32+
* - $topic->new: 1 if this is a new/updated topic for the current user.
33+
*
34+
* @see template_preprocess_forum_topic_list()
35+
* @see advanced_forum_preprocess_forum_topic_list()
36+
*/
37+
?>
38+
39+
<?php print $pager; ?>
40+
41+
<table id="forum-topic-<?php print $topic_id; ?>" class="forum-table forum-table-topics">
42+
<thead>
43+
<tr><?php print $header; ?></tr>
44+
</thead>
45+
46+
<tbody>
47+
<?php foreach ($topics as $topic): ?>
48+
<?php
49+
if ($topic->sticky) {
50+
// Extra label on sticky topics
51+
$topic->title = t('Sticky') . ': ' . $topic->title;
52+
}
53+
?>
54+
55+
<?php
56+
// Add "new" or "updated" to title where appropriate.
57+
$topic_new = "";
58+
if ($topic->new) {
59+
if ($topic->new_replies > 0) {
60+
$topic_new = ' <span class="marker">' . t('updated') . '</span>';
61+
}
62+
else {
63+
$topic_new = ' <span class="marker">' . t('new') . '</span>';
64+
}
65+
}
66+
?>
67+
68+
<tr class="<?php print $topic->zebra;?> <?php print $topic->sticky_class;?>">
69+
<td class="forum-topic-icon"><div class="forum-icon"><?php print $topic->icon; ?></div></td>
70+
71+
<td class="forum-topic-title">
72+
<?php print $topic->title . $topic_new; ?>
73+
<?php if (!empty($topic->pager)): ?>
74+
<div class="forum-topic-pager"> <?php print $topic->pager ?> </div>
75+
<?php endif; ?>
76+
</td>
77+
78+
<?php if ($topic->moved): ?>
79+
<td colspan="3">
80+
<?php print $topic->message; ?>
81+
</td>
82+
<?php else: ?>
83+
<td class="forum-replies">
84+
<div class="forum-number-replies"><?php print $topic->num_comments; ?></div>
85+
<?php if ($topic->new_replies): ?>
86+
<div class="forum-number-new-replies"><a href="<?php print $topic->new_url; ?>"><?php print $topic->new_text; ?></a></div>
87+
<?php endif; ?>
88+
</td>
89+
90+
<?php if (module_exists('statistics')): ?>
91+
<td class="forum-number-views"><?php print $topic->views;?> </td>
92+
<?php endif; ?>
93+
94+
<?php if (!variable_get('advanced_forum_hide_created', 0)): ?>
95+
<td class="forum-topic-created"><?php print $topic->created; ?></td>
96+
<?php endif; ?>
97+
98+
<td class="forum-last-reply"><?php print $topic->last_reply; ?></td>
99+
<?php endif; ?>
100+
</tr>
101+
<?php endforeach; ?>
102+
</tbody>
103+
</table>
104+
<?php print $pager; ?>

0 commit comments

Comments
 (0)