/** * get an object value * * @param string $name : the name of the value to get * @param string $parameters (optional) : parameters for the value to get * @return multidimentionnal array : the object values structure * @access public */ function getValue($name, $parameters = '') { $params = $this->getParamsValues(); switch ($name) { case 'label': return isset($params['html']) && $params['html'] ? $this->getLabel() : io::htmlspecialchars($this->getLabel()); break; case 'txtvalue': if (isset($params['html']) && $params['html']) { return strip_tags(str_replace('<br />', "\n", str_replace(array("\n", "\r"), "", $this->_evalPHPContent($this->_subfieldValues[0]->getValue())))); } else { return $this->_subfieldValues[0]->getValue(); } break; case 'htmlvalue': case 'value': //do not put an htmlspecialchars on text only value because line-breaks are auto converted to <br /> tags if (isset($params['html']) && $params['html']) { return $this->_evalPHPContent($this->_subfieldValues[0]->getValue()); } else { return $name == 'value' ? str_replace('<br />', "\n", str_replace(array("\n", "\r"), "", $this->_subfieldValues[0]->getValue())) : sensitiveIO::convertTextToHTML($this->_subfieldValues[0]->getValue(), false); } break; case 'hasvalue': return $this->_subfieldValues[0]->getValue() ? true : false; break; case 'rawvalue': return $this->_subfieldValues[0]->getValue(); break; default: return parent::getValue($name, $parameters); break; } }