--- 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:08:33 1.3
@@ -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,20 @@ class DbField {
}
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')) {
+ if (!preg_match('/^\|/m',$this->html)) {
$this->html = preg_replace('/\s+\/m',' \', $this->html);
- }
-
+ }
$this->html = preg_replace('/\(pic: ([^\)]*)\)/','![](/images/db/$1)
', $this->html);
-
}
public function getName() {
@@ -46,5 +51,9 @@ class DbField {
public function isEmpty() {
return $this->value === NULL || $this->value==='';
- }
+ }
+
+ public function getValue() {
+ return $this->value;
+ }
}