field = $field;
$this->value = $value;
$this->number = $number;
$this->getHtml();
}
public function getHtml() {
if ($this->html) {
return $this->html;
}
$this->html = $this->value;
$this->formatHtml();
return $this->html;
}
public function formatHtml() {
$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',$this->html)) {
$this->html = preg_replace('/\s+\/m',' \', $this->html);
}
$this->html = preg_replace('/\(pic: ([^\)]*)\)/','', $this->html);
}
public function getName() {
return $this->field;
}
public function getNumber() {
return $this->number;
}
public function isEmpty() {
return $this->value === NULL || $this->value==='';
}
public function getValue() {
return $this->value;
}
}