Ejemplo n.º 1
0
 /**
  * @param string $caption
  * @param string $fieldName
  * @param CustomEditor $editControl
  * @param Dataset $dataset
  * @param bool $allowSetToNull
  * @param bool $allowSetToDefault
  */
 public function __construct($caption, $fieldName, $editControl, $dataset, $allowSetToNull = false, $allowSetToDefault = false)
 {
     $this->caption = $caption;
     $this->editControl = $editControl;
     if ($dataset->GetFieldByName($fieldName) != null) {
         $this->fieldIsReadOnly = $dataset->GetFieldByName($fieldName)->GetReadOnly();
     } else {
         $this->fieldIsReadOnly = true;
     }
     $this->editControl->SetReadOnly($this->fieldIsReadOnly);
     $this->editControl->SetFieldName($fieldName);
     $this->fieldName = $fieldName;
     $this->dataset = $dataset;
     $this->SetAllowSetToNull($allowSetToNull);
     $this->allowSetToDefault = $allowSetToDefault;
     $this->displaySetToNullCheckBox = false;
     $this->displaySetToDefaultCheckBox = false;
     $this->readOnly = false;
     $this->SetVariableContainer(null);
     $this->setVisible(true);
     $this->setEnabled(true);
 }
Ejemplo n.º 2
0
 public function OnBeforePostHandler(Dataset $dataset)
 {
     foreach ($this->getRealEditColumns() as $column) {
         $fieldName = $column->GetFieldName();
         if ($dataset->GetFieldByName($fieldName)) {
             if ($column->getUseHTMLFilter()) {
                 GetApplication()->getHTMLFilter()->setTags($column->getHTMLFilterString());
                 $dataset->SetFieldValueByName($fieldName, GetApplication()->getHTMLFilter()->filter($dataset->GetFieldValueByName($fieldName)));
             }
         }
     }
 }