File:  [Local Repository] / db / prgsrc / drupal / modules / chgk_db / chgk_db.module
Revision 1.4: download - view: text, annotated - select for diffs - revision graph
Sun Mar 21 18:06:04 2010 UTC (14 years, 1 month ago) by roma7
Branches: MAIN
CVS tags: HEAD
FB2 export

    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',
   18:     'page arguments' => array(1),
   19:     'access callback' => "chgk_db_access",
   20:   );
   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:   );
   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(
   48:       'tour'=>NULL,
   49:       'alone' => TRUE
   50:     ),
   51:     'template'=>'templates/chgk_db_tour'
   52:   );
   53: 
   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: 
   63:   $items['chgk_db_question'] = array(
   64:     'arguments' => array(
   65:       'question'=>NULL
   66:     ),
   67:     'template'=>'templates/chgk_db_question'
   68:   );
   69: 
   70:   $items['chgk_db_question_fb2'] = array(
   71:     'arguments' => array(
   72:       'question'=>NULL
   73:     ),
   74:     'template'=>'templates/chgk_db_question_fb2'
   75:   );
   76: 
   77: 
   78:   $items['chgk_db_jeopardy_question'] = array(
   79:     'arguments' => array(
   80:       'question'=>NULL
   81:     ),
   82:     'template'=>'templates/chgk_db_jeopardy_question'
   83:   );
   84: 
   85:   $items['chgk_db_champ_full'] = array(
   86:     'arguments' => array(
   87:         'tour' => NULL
   88:     ),
   89:     'template'=>'templates/chgk_db_champ_full'
   90:   );
   91:   $items['chgk_db_fb2'] = array(
   92:       'arguments' => array('tournament'=>''),
   93:       'template' => 'templates/chgk_db_fb2'
   94:   );
   95:   return $items;
   96: }
   97: 
   98: function chgk_db_print($string) {
   99:   $tournament = DbPackage::newFromDb($string);
  100:   print $tournament->getPrintVersion();
  101: }
  102: 
  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: 
  114: 
  115: function chgk_db_access() {
  116:   return TRUE;
  117: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>