예제 #1
0
 private function decryptRequestVars(&$arr)
 {
     foreach ($arr as $key => $val) {
         if (is_string($arr[$key])) {
             $arr[$key] = Cryptography::de($arr[$key]);
         } else {
             if (is_array($arr[$key])) {
                 $this->decryptRequestVars($arr[$key]);
             }
         }
     }
 }
예제 #2
0
파일: CRUD.php 프로젝트: raxisau/JackBooted
 private function renderValue($rowIdx, $colName, $value)
 {
     $html = '';
     $name = $this->gridTag . '[' . $rowIdx . '][' . $colName . ']';
     $autoUpdateJS = "autoUpdate({$rowIdx},'{$this->updTag}','{$this->delTag}','{$this->submitId}');";
     $id = $this->gridTag . '_' . $rowIdx . '_' . $colName;
     $updClickAttrib = ['onClick' => $autoUpdateJS, 'id' => $id];
     $updCheckAttrib = ['onChange' => $autoUpdateJS, 'id' => $id];
     $type = $this->getColumnType($colName);
     switch ($type) {
         case self::NONE:
             break;
         case self::DISPLAY:
             $html .= $value == '' ? ' ' : Tag::e($value);
             break;
         case self::HIDDEN:
             $this->resp->set($name, $value);
             break;
         case self::RADIO:
             $dispList = isset($this->displayType[$colName][1]) ? $this->displayType[$colName][1] : null;
             $updCheckAttrib['default'] = $value;
             $html .= Tag::table() . Tag::tr() . Tag::td(['nowrap' => 'nowrap']) . implode(Tag::_td() . Tag::td(['nowrap' => 'nowrap']), Lists::radio($name, $dispList, $updCheckAttrib)) . Tag::_td() . Tag::_tr() . Tag::_table();
             break;
         case self::SELECT:
             $dispList = isset($this->displayType[$colName][1]) ? $this->displayType[$colName][1] : null;
             $blankLine = isset($this->displayType[$colName][2]) ? $this->displayType[$colName][2] : false;
             $updCheckAttrib['default'] = $value;
             $updCheckAttrib['hasBlank'] = $blankLine;
             $html .= Lists::select($name, $dispList, $updCheckAttrib);
             break;
         case self::CHECKBOX:
             $checkValue = isset($this->displayType[$colName][1]) ? $this->displayType[$colName][1] : 'YES';
             $html .= Tag::checkBox($name, $checkValue, $value == $checkValue, $updClickAttrib);
             break;
         case self::TIMESTAMP:
             $attribs = array_merge($updCheckAttrib, $this->cellAttributes[$colName]);
             $attribs['value'] = strftime('%Y-%m-%d %H:%M:%S', (int) $value);
             $attribs['size'] = strlen($attribs['value']) + 1;
             $html .= Tag::text($name, $attribs);
             break;
         case self::ENCTEXT:
             $value = Cryptography::de((string) $value);
             // Fall through to output text field
         // Fall through to output text field
         case self::TEXT:
         default:
             $updCheckAttrib['value'] = (string) $value;
             $html .= Tag::text($name, array_merge($updCheckAttrib, $this->cellAttributes[$colName]));
             break;
     }
     if (!in_array($type, [self::HIDDEN, self::NONE])) {
         $html = Tag::td() . $html . Tag::_td();
     }
     return $html;
 }