dokeos-plugin
[ class tree: dokeos-plugin ] [ index: dokeos-plugin ] [ all elements ]

Source for file exampletables.php

Documentation is available at exampletables.php

  1. <?php // $Id: exampletables.php,v 1.2 2006/03/15 14:34:45 pcool Exp $ 
  2. /*
  3. ============================================================================== 
  4.     Dokeos - elearning and course management software
  5.     
  6.     Copyright (c) 2004 Dokeos S.A.
  7.     Copyright (c) 2003 Ghent University (UGent)
  8.     Copyright (c) 2001 Universite catholique de Louvain (UCL)
  9.     Copyright (c) Vrije Universiteit Brussel (VUB)
  10.     
  11.     For a full list of contributors, see "credits.txt".
  12.     The full license can be read in "license.txt".
  13.     
  14.     This program is free software; you can redistribute it and/or
  15.     modify it under the terms of the GNU General Public License
  16.     as published by the Free Software Foundation; either version 2
  17.     of the License, or (at your option) any later version.
  18.     
  19.     See the GNU General Public License for more details.
  20.     
  21.     Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
  22. ============================================================================== 
  23. */
  24. /**
  25. ============================================================================== 
  26. *    This file is a code template;
  27. *    copy the code and paste it in a new file to begin your own work.
  28. *
  29. *    @package dokeos.plugin
  30. ============================================================================== 
  31. */
  32.     
  33. /*
  34. ============================================================================== 
  35.         INIT SECTION
  36. ============================================================================== 
  37. */
  38.  
  39. // global settings initialisation 
  40. // also provides access to main api (inc/lib/main_api.lib.php)
  41. include("../inc/global.inc.php")
  42.  
  43. /*
  44. -----------------------------------------------------------
  45.     Libraries
  46. -----------------------------------------------------------
  47. */ 
  48.  
  49. //main_api.lib.php by default included
  50. //also the display and database libraries are loaded by default
  51.     
  52. /*
  53. -----------------------------------------------------------
  54.     Header
  55. -----------------------------------------------------------
  56. */
  57.  
  58. $nameTools "Table examples (for developers)"// title of the page (should come from the language file) 
  59. Display::display_header($nameTools);
  60. /*
  61. -----------------------------------------------------------
  62.     Constants
  63. -----------------------------------------------------------
  64. */ 
  65.  
  66. define ("REPEAT_COUNT""5");
  67.  
  68.  
  69. /*
  70. ============================================================================== 
  71.         FUNCTIONS
  72. ============================================================================== 
  73. */
  74.     
  75. /*
  76. ============================================================================== 
  77.         MAIN CODE
  78. ============================================================================== 
  79. */ 
  80.  
  81.  
  82. $row 0;
  83. $column_header[$row++"Column 1";
  84. $column_header[$row++"Column 2";
  85. $column_header[$row++"Column 3";
  86.  
  87. /*
  88.     An important parameter for display_complex_table_header
  89.     is $properties, an array with elements, all of which have defaults
  90.     
  91.     "width" - the table width, e.g. "85%"
  92.     "class" - the class to use for the table, e.g. "class=\"data_table\""
  93.                 by default class is  "class=\"data_table\""
  94.     "cellpadding" - the extra border in each cell, e.g. "8"
  95. */
  96.  
  97. /*
  98. -----------------------------------------------------------
  99.     Table that hilites
  100. -----------------------------------------------------------
  101. */ 
  102.  
  103. Display::display_normal_message("The following table hilites on mouseover (hover), this is the Display API default.");
  104.  
  105. Display::display_complex_table_header($properties$column_header);
  106. for ($i 0$i REPEAT_COUNT$i++)
  107. {
  108.     $row 0;
  109.     $table_row[$row++"First";
  110.     $table_row[$row++"Second";
  111.     $table_row[$row++"Third";
  112.     Display::display_table_row($bgcolor$table_rowtrue);
  113. }
  114.  
  115. echo "<br/><br/>";
  116.  
  117. /*
  118. -----------------------------------------------------------
  119.     Table that alternates row colours
  120. -----------------------------------------------------------
  121. */ 
  122. Display::display_normal_message("The following table has alternating row colours and no hilite");
  123.  
  124. $properties["class"""//no hilite
  125. $bgcolour Display::display_complex_table_header($properties$column_header);
  126. for ($i 0$i REPEAT_COUNT$i++)
  127. {
  128.     $row 0;
  129.     $table_row[$row++"First";
  130.     $table_row[$row++"Second";
  131.     $table_row[$row++"Third";
  132.     $bgcolour Display::display_table_row($bgcolour$table_rowtrue);
  133. }
  134.  
  135. /*
  136. ============================================================================== 
  137.         FOOTER 
  138. ============================================================================== 
  139. */ 
  140.  
  141. ?>

Documentation generated on Thu, 12 Jun 2008 13:23:51 -0500 by phpDocumentor 1.4.1