[ Index ]

PHP Cross Reference of Quick Form DataBase

title

Body

[close]

/objects/ -> qfdbobj_textarea.php (source)

   1  <?php
   2  if (!defined('QFDB_SECURITY')) {
   3      die("You can't access this file directly...");
   4  }
   5  // 0.1
   6  
   7  
   8  class qfdbobj_textarea {
   9      // 0.4
  10      static function obj_struct(&$qfdb)
  11      {
  12          $qfdb->m['object'] = 'textarea'; // string (fixed)
  13          $qfdb->m['status'] = '1234'; // string
  14          $qfdb->m['if'] = ''; // string
  15          $qfdb->m['alias'] = ''; // string
  16  
  17          $qfdb->m['db_field'] = ''; // string
  18          $qfdb->m['form_field'] = ''; // string
  19          $qfdb->m['label'] = ''; // string
  20          $qfdb->m['replace'] = '<>"&'; // string
  21          $qfdb->m['label_class'] = $qfdb->get_css_value('qfdb_tpl_label'); // string
  22          $qfdb->m['label_others'] = ''; // string
  23          $qfdb->m['validate'] = ''; // array
  24          $qfdb->m['others'] = '';  // string
  25          $qfdb->m['beggin'] = ''; // string
  26          $qfdb->m['end'] = ''; // string
  27          $qfdb->m['left_class'] = $qfdb->get_css_value('qfdb_tpl_left'); // string
  28          $qfdb->m['left_others'] = ''; // string
  29          $qfdb->m['right_class'] = $qfdb->get_css_value('qfdb_tpl_right'); // string
  30          $qfdb->m['right_others'] = ''; // string
  31          $qfdb->m['display'] = 'two_cells'; //  string
  32          $qfdb->m['colspan_class'] = $qfdb->get_css_value('qfdb_tpl_colspan'); //  string
  33          $qfdb->m['colspan_others'] = ''; //  string
  34  
  35          $qfdb->m['cols'] = 20; // int
  36          $qfdb->m['rows'] = 3; // int
  37          $qfdb->m['disabled'] = 'false'; // bool
  38          $qfdb->m['readonly'] = 'false'; // bool
  39          $qfdb->m['value'] = ''; // mixed
  40          $qfdb->m['required'] = 'false'; // bool
  41          $qfdb->m['help'] = ''; // string
  42          $qfdb->m['id'] = ''; // string
  43          $qfdb->m['style'] = ''; // string
  44          $qfdb->m['class'] = $qfdb->get_css_value('qfdb_textarea'); // string
  45          $qfdb->m['title'] = ''; // string
  46  
  47          $qfdb->m['object_properties'] = count($qfdb->m) +2; // int
  48      } // end func
  49  
  50      // 0.3
  51      static function obj_html(&$qfdb)
  52      {
  53          // inicia a construcao do objeto text
  54          $object = $qfdb->m['beggin'] . '<textarea';
  55          if ($qfdb->m['form_field']) {
  56              $object .= ' name="'.$qfdb->m['form_field'].'"';
  57          }
  58          if ($qfdb->m['id']) {
  59              $object .= ' id="'.$qfdb->m['id'].'"';
  60          } elseif ($qfdb->m['form_field']) {
  61              $object .= ' id="'.$qfdb->m['form_field'].'"';
  62          }
  63          if ($qfdb->m['rows']) {
  64              $object .= ' rows="'.$qfdb->m['rows'].'"';
  65          }
  66          if ($qfdb->m['cols']) {
  67              $object .= ' cols="'.$qfdb->m['cols'].'"';
  68          }
  69          if ($qfdb->m['style']) {
  70              $object .= ' style="'.$qfdb->m['style'].'"';
  71          }
  72          if ($qfdb->m['class']) {
  73              $object .= ' class="'.$qfdb->m['class'].'"';
  74          }
  75          if ($qfdb->m['title']) {
  76              $object .= ' title="'.$qfdb->m['title'].'"';
  77          }
  78          if ($qfdb->m['disabled']) {
  79              $object .= ' disabled="disabled"';
  80          }
  81          if ($qfdb->m['readonly']) {
  82              $object .= ' readonly="readonly"';
  83          }
  84          $object .= $qfdb->m['others'];
  85          $object .= '>'.$qfdb->scape_htmlentities((str_replace('"', '&quot;', $qfdb->m['value']))) . '</textarea>'. $qfdb->m['end'];
  86  
  87          if ($qfdb->m['display'] == 'only_object') {
  88              $qfdb->add_output('html',  $object."\n");
  89          } elseif ($qfdb->m['display'] == 'one_cell') {
  90              $label = qfdb_themes::themes_label($qfdb->m);
  91              $qfdb->add_output('html', qfdb_themes::themes_container_one_cell( array('content'=>$object, 'others'=>$qfdb->m['colspan_others'], 'class'=>$qfdb->m['colspan_class'], 'label'=>$label) ));
  92          } else { // $qfdb->m['display'] == 'two_cells'
  93              $label = qfdb_themes::themes_label($qfdb->m);
  94              $qfdb->add_output('html', qfdb_themes::themes_container_two_cells(  array('label'=>$label, 'content'=>$object, 'label_others'=>$qfdb->m['left_others'], 'content_others'=>$qfdb->m['right_others'], 'label_class'=>$qfdb->m['left_class'], 'content_class'=>$qfdb->m['right_class']) ));
  95          }
  96      } // end func
  97  
  98  
  99      // 0.3
 100      static function obj_db(&$qfdb)
 101      {
 102      } // end func
 103  
 104  
 105      // 0.3
 106      static function obj_debug(&$qfdb)
 107      {
 108      } // end func
 109  
 110  
 111      // 0.4
 112      static function obj_fixed(&$qfdb)
 113      {
 114          $qfdb->m['cols'] = intval($qfdb->m['cols']);
 115          $qfdb->m['rows'] = intval($qfdb->m['rows']);
 116  
 117          $qfdb->m['cols'] = intval($qfdb->m['cols']);
 118          if (!$qfdb->m['cols']) {
 119              $qfdb->m['cols'] = 20;
 120          }
 121  
 122          $qfdb->m['rows'] = intval($qfdb->m['rows']);
 123          if (!$qfdb->m['rows']) {
 124              $qfdb->m['rows'] = 3;
 125          }
 126  
 127          $qfdb->m['id'] = ($qfdb->m['id']) ? $qfdb->m['id'] : $qfdb->m['form_field'];
 128  
 129          $qfdb->fix_disabled();
 130          $qfdb->fix_readonly();
 131          $qfdb->fix_required();
 132          $qfdb->fix_others();
 133          $qfdb->fix_display_3();
 134      } // end func
 135  
 136  } // end class
 137  


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