[ Index ]

PHP Cross Reference of Quick Form DataBase

title

Body

[close]

/objects/ -> qfdbobj_table.php (source)

   1  <?php
   2  if (!defined('QFDB_SECURITY')) {
   3      die("You can't access this file directly...");
   4  }
   5  
   6  
   7  
   8  /**
   9   * Graphic QFDB Object: print TABLE (end)
  10   *
  11   * @author Everaldo Wanderlei Uavniczak <everaldouav [at] gmail.com>
  12   * @since 0.1
  13   * @package quickformdb
  14   * @see http://www.qfdb.net/
  15   * @link http://w3schools.com/tags/tag_table.asp
  16   * @license BSD License <http://www.qfdb.net/bsd_license.txt>
  17   * @todo implement warning if strict DTD is used with 'bgcolor'
  18   * @todo implement warning if strict DTD is used with 'align'
  19   * @todo implement warning if 'frames' is used with 'border'=0
  20   * @todo implement warning if 'rules' is used with 'border'=0
  21   * @todo fix 'frames' and 'rules'
  22   * @todo implement example of 'rules' and 'frames' in docs
  23   */
  24  
  25  
  26  
  27  class qfdbobj_table {
  28  
  29      static static function obj_struct(&$qfdb)
  30      {
  31          $qfdb->m['object'] = 'table'; // string (fixed)
  32          $qfdb->m['status'] = '12345';  // string
  33          $qfdb->m['if'] = ''; // string
  34          $qfdb->m['alias'] = ''; // string
  35  
  36          $qfdb->m['border'] = 0;  // int
  37          $qfdb->m['cellspacing'] = 0;  // int
  38          $qfdb->m['cellpadding'] = 0;  // int
  39          $qfdb->m['frame'] = '';  // string
  40          $qfdb->m['rules'] = '';  // string
  41          $qfdb->m['summary'] = '';  // string
  42          $qfdb->m['width'] = '';  // string
  43          $qfdb->m['bgcolor'] = '';  // string
  44          $qfdb->m['align'] = '';  // string
  45  
  46          $qfdb->m['others'] = '';  // string
  47  
  48          $qfdb->m['id'] = ''; // string
  49          $qfdb->m['style'] = ''; // string
  50          $qfdb->m['class'] = $qfdb->get_css_value('qfdb_table'); // string
  51          $qfdb->m['title'] = ''; // string
  52  
  53          $qfdb->m['object_properties'] = count($qfdb->m) +2; // int
  54      } // end func
  55  
  56  
  57      static static function obj_html(&$qfdb)
  58      {
  59          // inicia a construcao do objeto text
  60          $object = "\n".'<table border="'.intval($qfdb->m['border']).'" cellpadding="'.intval($qfdb->m['cellpadding']).'"'.
  61          ' cellspacing="'.intval($qfdb->m['cellspacing']).'"';
  62          if ($qfdb->m['width']) {
  63              $object .= ' width="'.$qfdb->m['width'].'"';
  64          }
  65          if ($qfdb->m['style']) {
  66              $object .= ' style="'.$qfdb->m['style'].'"';
  67          }
  68          if ($qfdb->m['class']) {
  69              $object .= ' class="'.$qfdb->m['class'].'"';
  70          }
  71          if ($qfdb->m['title']) {
  72              $object .= ' title="'.$qfdb->m['title'].'"';
  73          }
  74          if ($qfdb->m['id']) {
  75              $object .= ' id="'.$qfdb->m['id'].'"';
  76          }
  77          if ($qfdb->m['frame']) {
  78              $object .= ' frame="'.$qfdb->m['frame'].'"';
  79          }
  80          if ($qfdb->m['rules']) {
  81              $object .= ' rules="'.$qfdb->m['rules'].'"';
  82          }
  83          if ($qfdb->m['summary']) {
  84              $object .= ' summary="'.str_replace('"', '&quot;', $qfdb->m['summary']).'"';
  85          }
  86          if ($qfdb->m['bgcolor']) {
  87              $object .= ' bgcolor="'.$qfdb->m['bgcolor'].'"';
  88          }
  89          if ($qfdb->m['others']) {
  90              $object .= ' '.$qfdb->m['others'];
  91          }
  92          if ($qfdb->m['align']) {
  93              $object .= ' align="'.$qfdb->m['align'].'"';
  94          }
  95          $object .= ">\n\n";
  96          $qfdb->add_output('html', $object);
  97      } // end func
  98  
  99  
 100      static static function obj_db(&$qfdb)
 101      {
 102          self::obj_html($qfdb);
 103      } // end func
 104  
 105  
 106      static static function obj_debug(&$qfdb)
 107      {
 108      } // end func
 109  
 110  
 111      static static function obj_fixed(&$qfdb)
 112      {
 113          $qfdb->m['border'] = intval($qfdb->m['border']);
 114          $qfdb->m['cellspacing'] = intval($qfdb->m['cellspacing']);
 115          $qfdb->m['cellpadding'] = intval($qfdb->m['cellpadding']);
 116  
 117          $qfdb->fix_others();
 118  
 119          // frames: void, above, below, hsides, lhs, rhs, vsides, box, border
 120          // rules: none, groups, rows, cols, all
 121      } // end func
 122  
 123  } // end class


Generated: Fri Nov 14 17:48:13 2008 Cross-referenced by PHPXref 0.7