Annotation of db/prgsrc/drupal/modules/chgk_db/chgk_db.module, revision 1.4
1.1 roma7 1: <?php
2: /**********************
3: *
4: * Tournament
5: *
6: *********************/
7:
8: require_once(dirname(__FILE__)."/classes/DbPackage.class.php");
9:
10:
11: /**
12: * Implementation of hook_menu().
13: */
14: function chgk_db_menu() {
15: $items['print'] = array(
16: 'path' => 'print',
17: 'page callback' => 'chgk_db_print',
1.2 roma7 18: 'page arguments' => array(1),
1.1 roma7 19: 'access callback' => "chgk_db_access",
20: );
1.4 ! roma7 21: $items['fb2'] = array(
! 22: 'path' => 'fb2',
! 23: 'page callback' => 'chgk_db_fb2',
! 24: 'page arguments' => array(1),
! 25: 'access callback' => "chgk_db_access",
! 26: );
1.1 roma7 27: return $items;
28: }
29:
30: /**
31: * Implementation of hook_theme().
32: */
33: function chgk_db_theme() {
34: $items['chgk_db_print'] = array(
35: 'arguments' => array(
36: 'title' =>'',
37: 'content' => ''
38: ),
39: 'template'=>'templates/chgk_db_print'
40: );
41: $items['chgk_db_field'] = array(
42: 'arguments' => array(
43: 'field' => NULL
44: )
45: );
46: $items['chgk_db_tour'] = array(
47: 'arguments' => array(
1.3 roma7 48: 'tour'=>NULL,
49: 'alone' => TRUE
1.1 roma7 50: ),
51: 'template'=>'templates/chgk_db_tour'
52: );
53:
1.4 ! roma7 54: $items['chgk_db_tour_fb2'] = array(
! 55: 'arguments' => array(
! 56: 'tour'=>NULL,
! 57: 'alone' => TRUE
! 58: ),
! 59: 'template'=>'templates/chgk_db_tour_fb2'
! 60: );
! 61:
! 62:
1.1 roma7 63: $items['chgk_db_question'] = array(
64: 'arguments' => array(
1.2 roma7 65: 'question'=>NULL
1.1 roma7 66: ),
67: 'template'=>'templates/chgk_db_question'
1.2 roma7 68: );
69:
1.4 ! roma7 70: $items['chgk_db_question_fb2'] = array(
! 71: 'arguments' => array(
! 72: 'question'=>NULL
! 73: ),
! 74: 'template'=>'templates/chgk_db_question_fb2'
! 75: );
! 76:
! 77:
1.3 roma7 78: $items['chgk_db_jeopardy_question'] = array(
79: 'arguments' => array(
80: 'question'=>NULL
81: ),
82: 'template'=>'templates/chgk_db_jeopardy_question'
83: );
84:
1.2 roma7 85: $items['chgk_db_champ_full'] = array(
86: 'arguments' => array(
87: 'tour' => NULL
88: ),
89: 'template'=>'templates/chgk_db_champ_full'
90: );
1.4 ! roma7 91: $items['chgk_db_fb2'] = array(
! 92: 'arguments' => array('tournament'=>''),
! 93: 'template' => 'templates/chgk_db_fb2'
! 94: );
1.1 roma7 95: return $items;
96: }
97:
98: function chgk_db_print($string) {
1.2 roma7 99: $tournament = DbPackage::newFromDb($string);
100: print $tournament->getPrintVersion();
1.1 roma7 101: }
102:
1.4 ! roma7 103: function chgk_db_fb2($string) {
! 104: $tournament = DbPackage::newFromDb($string);
! 105: $tournament->getAll();
! 106: $xml = theme('chgk_db_fb2', $tournament);
! 107: header("Content-Type: application/octet-stream");
! 108: header("Content-Disposition: attachment; filename=\"$string.fb2\"\n");
! 109: print $xml;;
! 110: exit;
! 111: #print $tournament->getFb2();
! 112: }
! 113:
1.1 roma7 114:
115: function chgk_db_access() {
116: return TRUE;
117: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>