/** * Return the display value of this form field as a DOM Node. * @param DOMNode $node * @param I2CE_Template $template * @return DOMNode */ public function getDisplayNode($node, $template) { $text = explode("\n", $this->getDisplayValue()); if (count($text) < 2) { return parent::getDisplayNode($node, $template); } else { $node = $template->createElement("span", array('class' => 'string_mline')); foreach ($text as $line) { if (!empty($line)) { $node->appendChild($template->createTextNode($line)); $node->appendChild($template->createElement("br")); } } return $node; } }
public function save($do_check, $user) { $bin_file = $this->getStorageFile(); if ($this->temp_file && file_exists($this->temp_file)) { //I2CE::raiseMessage("copying from ".$this->temp_file." to $bin_file"); if (!rename($this->temp_file, $bin_file)) { I2CE::raiseError("Failed to open {$bin_file} for binary files!"); return false; } } else { if (strlen($this->value) > 0 && $this->value != 'from_file') { I2CE::raiseMessage("writing from value to {$bin_file}"); $cH = fopen($bin_file, 'w'); if (!$cH) { I2CE::raiseError("Failed to open {$bin_file} for binary files!"); return false; } fwrite($cH, $this->value); fclose($cH); } else { I2CE::raiseMessage("No data so not creating: {$bin_file}"); } } return parent::save($do_check, $user); }
public function _hasMethod($method, $getFuzzy = false, $returnErrors = false) { //this is b/c of the laziness above if (preg_match('/^processDOMEditable_(.+)$/', $method, $matches)) { return $this->hasDisplay($matches[1]); } return parent::_hasMethod($method, $getFuzzy, $returnErrors); }