mName = $name; $this->mValue = $value; $this->mOptions = $options; } function getName() { return $this->mName; } function isTranslateEnabled() { return class_exists('SpecialTranslate'); } function getValue() { $value = $this->mValue; if ( $this->isTranslateEnabled() && isset($this->mOptions['translatable']) && $this->mOptions['translatable']) { if( strpos($value, '') === false) { // fix : rearrange tags to avoid errors // 4 cases : // 1 : text => text\n\n // 2 : text => \ntext // 3 : \n* => \n\n // 4 : \n* => \n\n $value = preg_replace(['#([^\s])()#m', '#()([^\s])#m', '#()([\s]+)#m', '#([\s]+)()#m'], ["$1\n\n$2", "$1\n$2", "$1\n", "\n\n$2"], $value); $value = '' . $value .''; } } return $value; } function setValue( $value ) { $this->mValue = $value; } function getOptions() { return $this->mOptions; } function setOptions( $options ) { $this->mOptions = $options; } }