--- db/prgsrc/drupal/modules/chgk_db/classes/DbField.class.php 2010/02/28 20:17:33 1.1 +++ db/prgsrc/drupal/modules/chgk_db/classes/DbField.class.php 2010/03/09 21:17:40 1.4 @@ -4,7 +4,7 @@ require_once(dirname(__FILE__)."/DbField class DbField { private $field; - private $value; + protected $value; private $number; private $html; public function __construct($field, $value, $number = false) { @@ -25,15 +25,22 @@ class DbField { } public function formatHtml() { + $this->html = preg_replace('/(\s+)-+(\s+)/','\1—$2', $this->html); + + $this->html = preg_replace('/\[Раздаточный материал:(.*?)\]\s*\n/sm', + "
Раздаточный материал
\\1
\n", + $this->html ); + $this->html = preg_replace('/^\s*<раздатка>(.*?)<\/раздатка>/sm', + "
Раздаточный материал
\\1
\n", + $this->html ); + $this->html = preg_replace('/^\s+/m', "
\n    ", $this->html); - if (!preg_match('/^\|/m')) { + if (!preg_match('/^\|/m',$this->html)) { $this->html = preg_replace('/\s+\–/m',' \–', $this->html); - } - + } $this->html = preg_replace('/\(pic: ([^\)]*)\)/','

', $this->html); - } public function getName() { @@ -46,5 +53,9 @@ class DbField { public function isEmpty() { return $this->value === NULL || $this->value===''; - } + } + + public function getValue() { + return $this->value; + } }