예제 #1
0
 protected function updateLine($type, $val, $line)
 {
     if ($this->cfg->mode == 'view') {
         $tmp = array();
         if (is_array($this->cfg->value)) {
             foreach ($this->cfg->value as $v) {
                 if ($v[db::getCfg('relatedValue')] == $val) {
                     foreach ($v as $kk => $vv) {
                         if ($kk != db::getCfg('relatedValue') && $vv) {
                             $tmp[] = $this->form->get(str_replace('[name]', $kk, $this->replaceName))->label . $this->cfg->sepLabelViewSubValues . $vv;
                         }
                     }
                 }
             }
         }
         if (count($tmp)) {
             $line .= ' (' . implode($this->cfg->sepViewSubValues, $tmp) . ')';
         }
         return $line;
     }
     $form = clone $this->form;
     if (is_array($this->cfg->value)) {
         foreach ($this->cfg->value as $v) {
             if ($v[db::getCfg('relatedValue')] == $val) {
                 foreach ($v as $k => $vv) {
                     if ($k != db::getCfg('relatedValue')) {
                         $form->setValue(str_replace('[name]', $k, $this->replaceName), $vv);
                     }
                 }
             }
         }
     }
     foreach ($this->cfg->fields as $f) {
         $name = str_replace('[name]', $f['name'], $this->replaceName);
         $form->get($name)->getCfg()->name = str_replace($this->cfg->replaceKey, $val, $name);
         $form->get($name)->renew();
     }
     return str_replace('[fields]', $form->__toString(), $line);
 }
예제 #2
0
 /**
  * Create the data Table out
  *
  * @param string $type Out type
  * @return string
  */
 public function to($type)
 {
     return $this->form->to($type);
 }