/[drupal]/contributions/modules/fsgame/fsgame.theme.inc
ViewVC logotype

Contents of /contributions/modules/fsgame/fsgame.theme.inc

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


Revision 1.9 - (show annotations) (download) (as text)
Sat Sep 27 02:22:39 2008 UTC (14 months ago) by aaron
Branch: MAIN
CVS Tags: HEAD
Changes since 1.8: +2 -2 lines
File MIME type: text/x-php
  * Change db_query's to drupal_write_record (aaronwinborn).
  * Fix link destination for 'create new character' (aaronwinborn).
  * Fix install schema (aaronwinborn).
  * Change fsgame_user's latest_character column (aaronwinborn).
1 <?php
2 // $Id: fsgame.theme.inc,v 1.8 2008/09/26 02:38:23 aaron Exp $
3
4 function theme_test($file = NULL) {
5 drupal_set_message("$file is ". print_r($file, TRUE));
6 return $file['filepath'];
7 }
8
9 /**
10 * @file
11 * Theme functions for the 5 Second Game Engine.
12 */
13
14 /**
15 * Display all attributes for a character.
16 */
17 function theme_fsgame_character_attributes($node) {
18 $output = '<div class="fsgame-character-attributes">';
19 foreach (fsgame_base_attributes() as $attribute) {
20 $output .= '<div class="fsgame-character-attribute fsgame-character-attribute-' . $attribute['id'] . '">';
21 $output .= '<div class="fsgame-character-attribute-label">' . $attribute['title'] . '</div>';
22 $output .= '<div class="fsgame-character-attribute-value">' . $node->fsgame['character'][$attribute['id']] . '</div>';
23 $output .= '</div>';
24 }
25 $output .= '</div>';
26 return $output;
27 }
28
29 /**
30 * Display the character's class.
31 */
32 function theme_fsgame_character_class($node) {
33 $class = fsgame_world_load('classes', $node->fsgame['character']['class']);
34
35 if (!$class) {
36 drupal_set_message("This character's class was not found; please contact a site administrator.", 'error');
37 return; // if this character no longer is plausible, complain loudly to the site admin cos they broke something.
38 }
39
40 $output .= '<div class="fsgame-character-class">';
41 $output .= t('Level @level !class_and_modifiers.',
42 array(
43 '@level' => $node->fsgame['character']['level'],
44 '!class_and_modifiers' => fsgame_attributes_modifiers_string($class),
45 ));
46 $output .= '</div>';
47 return $output;
48 }
49
50 /**
51 * Display a list of contest character links.
52 */
53 function theme_fsgame_contest_selectors_character($character_nid = 'recent', $opponent_nid = 'recent') {
54 $output .= 'Or select one of the following:';
55 $items = array(
56 l(t('Random character'), 'fsgame/contest/random/'. $opponent_nid),
57 l(t('Create new character'), 'node/add/fsgame-character', array('query' => 'destination=fsgame/contest/latest/'. $opponent_nid)),
58 );
59 $output .= theme('item_list', $items);
60 return $output;
61 }
62
63 /**
64 * Display a list of contest opponent links.
65 */
66 function theme_fsgame_contest_selectors_opponent($character_nid = 'recent', $opponent_nid = 'recent') {
67 $output .= 'Or select one of the following:';
68 $items = array(
69 l(t('Random opponent'), 'fsgame/contest/'. $character_nid .'/random'),
70 );
71 $output .= theme('item_list', $items);
72 return $output;
73 }
74

  ViewVC Help
Powered by ViewVC 1.1.2