[ Index ]

PHP Cross Reference of Quick Form DataBase

title

Body

[close]

/objects/ -> qfdbobj_content.php (source)

   1  <?php
   2  if (defined('QFDB_SECURITY')) {
   3      die("You can't access this file directly...");
   4  }
   5  
   6  // ver linha 56
   7  
   8  class qfdbobj_content {
   9      // 0.4
  10      static function obj_struct(&$qfdb)
  11      {
  12          $qfdb->m['object'] = 'content'; // string (fixed)
  13          $qfdb->m['status'] = '135'; // string
  14          $qfdb->m['if'] = ''; // string
  15          $qfdb->m['alias'] = ''; // string
  16  
  17          $qfdb->m['query'] = '';  // string
  18          $qfdb->m['vars'] = '';  // string  separated with comma
  19          $qfdb->m['content'] = '';  // string
  20          $qfdb->m['error_message'] = QFDBOBJ_CONTENT_WRONG_RESULT;  // string
  21  
  22          $qfdb->m['id'] = '';  // string
  23          $qfdb->m['required'] = 'false';  // string
  24          $qfdb->m['help'] = '';  // string
  25  
  26          $qfdb->m['label'] = '';  // string
  27          $qfdb->m['label_class'] = $qfdb->get_css_value('qfdb_tpl_label');  // string
  28          $qfdb->m['label_others'] = '';  // string
  29  
  30          $qfdb->m['display'] = 'only_object';  // string
  31  
  32          $qfdb->m['colspan_class'] = $qfdb->get_css_value('qfdb_tpl_colspan');  // string
  33          $qfdb->m['colspan_others'] = '';  // string
  34  
  35          $qfdb->m['left_class'] = $qfdb->get_css_value('qfdb_tpl_left');  // string
  36          $qfdb->m['left_others'] = '';  // string
  37          $qfdb->m['right_class'] = $qfdb->get_css_value('qfdb_tpl_right');  // string
  38          $qfdb->m['right_others'] = '';  // string
  39  
  40          $qfdb->m['object_properties'] = count($qfdb->m) +2; // int
  41      } // end func
  42  
  43      // 0.3
  44      static function obj_html(&$qfdb)
  45      {
  46          if ($qfdb->m['query']) {
  47              if ($result = $qfdb->sql_query($qfdb->m['query'])) {
  48                  $row = $qfdb->sql_fetchrow($result);
  49                  foreach ($qfdb->m['vars'] as $key => $value) {
  50                      $qfdb->m['content'] = str_replace('___'.strtoupper($key).'___', $row[$key], $qfdb->m['content']);
  51                  }
  52              } else {
  53                  $qfdb->m['content'] = $qfdb->m['error_message'];
  54              }
  55          } else {
  56  
  57              //$qfdb->add_critical_error
  58          }
  59  
  60          // make content
  61          $label = qfdb_themes::themes_label($qfdb->m);
  62  
  63          if ($qfdb->m['display'] == 'only_object') {
  64              $qfdb->add_output('html',  $qfdb->m['content']);
  65          } elseif ($qfdb->m['display'] == 'one_cell') {
  66              $qfdb->add_output('html', qfdb_themes::themes_container_one_cell( array('content'=>$qfdb->m['content'], 'others'=>$qfdb->m['colspan_others'], 'class'=>$qfdb->m['colspan_class']) ));
  67          } else {
  68              $qfdb->add_output('html', qfdb_themes::themes_container_two_cells( array('label'=>$label, 'content'=>$qfdb->m['content'], 'label_others'=>$qfdb->m['left_others'], 'content_others'=>$qfdb->m['right_others'], 'label_class'=>$qfdb->m['left_class'], 'content_class'=>$qfdb->m['right_class']) ));
  69          }
  70      } // end func
  71  
  72      // 0.3
  73      static function obj_db(&$qfdb)
  74      {
  75          self::obj_html($qfdb);
  76      } // end func
  77  
  78      // 0.3
  79      static function obj_debug(&$qfdb)
  80      {
  81      } // end func
  82  
  83  
  84      // 0.4
  85      static function obj_fixed(&$qfdb)
  86      {
  87          $qfdb->fix_display_3();
  88          $qfdb->fix_required();
  89  
  90          // fixed vars properties
  91          $aux = explode(',' , $qfdb->m['vars']);
  92          $qfdb->m['vars'] = array();
  93          foreach ($aux as $value) {
  94              $qfdb->m['vars'][strtolower(trim($value))] = '';
  95          }
  96      } // end func
  97  
  98  } // end class


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